@x-edu/service 0.0.1 → 0.0.2

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.
@@ -463,7 +463,7 @@ var __publicField = (obj, key, value) => {
463
463
  var cryptoJs = { exports: {} };
464
464
  var core = { exports: {} };
465
465
  (function(module2, exports2) {
466
- (function(root, factory) {
466
+ (function(root2, factory) {
467
467
  {
468
468
  module2.exports = factory();
469
469
  }
@@ -711,7 +711,7 @@ var __publicField = (obj, key, value) => {
711
711
  })(core);
712
712
  var x64Core = { exports: {} };
713
713
  (function(module2, exports2) {
714
- (function(root, factory) {
714
+ (function(root2, factory) {
715
715
  {
716
716
  module2.exports = factory(core.exports);
717
717
  }
@@ -758,7 +758,7 @@ var __publicField = (obj, key, value) => {
758
758
  })(x64Core);
759
759
  var libTypedarrays = { exports: {} };
760
760
  (function(module2, exports2) {
761
- (function(root, factory) {
761
+ (function(root2, factory) {
762
762
  {
763
763
  module2.exports = factory(core.exports);
764
764
  }
@@ -796,7 +796,7 @@ var __publicField = (obj, key, value) => {
796
796
  })(libTypedarrays);
797
797
  var encUtf16 = { exports: {} };
798
798
  (function(module2, exports2) {
799
- (function(root, factory) {
799
+ (function(root2, factory) {
800
800
  {
801
801
  module2.exports = factory(core.exports);
802
802
  }
@@ -849,7 +849,7 @@ var __publicField = (obj, key, value) => {
849
849
  })(encUtf16);
850
850
  var encBase64 = { exports: {} };
851
851
  (function(module2, exports2) {
852
- (function(root, factory) {
852
+ (function(root2, factory) {
853
853
  {
854
854
  module2.exports = factory(core.exports);
855
855
  }
@@ -921,7 +921,7 @@ var __publicField = (obj, key, value) => {
921
921
  var Base64$1 = encBase64.exports;
922
922
  var encBase64url = { exports: {} };
923
923
  (function(module2, exports2) {
924
- (function(root, factory) {
924
+ (function(root2, factory) {
925
925
  {
926
926
  module2.exports = factory(core.exports);
927
927
  }
@@ -992,7 +992,7 @@ var __publicField = (obj, key, value) => {
992
992
  })(encBase64url);
993
993
  var md5 = { exports: {} };
994
994
  (function(module2, exports2) {
995
- (function(root, factory) {
995
+ (function(root2, factory) {
996
996
  {
997
997
  module2.exports = factory(core.exports);
998
998
  }
@@ -1154,7 +1154,7 @@ var __publicField = (obj, key, value) => {
1154
1154
  })(md5);
1155
1155
  var sha1 = { exports: {} };
1156
1156
  (function(module2, exports2) {
1157
- (function(root, factory) {
1157
+ (function(root2, factory) {
1158
1158
  {
1159
1159
  module2.exports = factory(core.exports);
1160
1160
  }
@@ -1225,9 +1225,9 @@ var __publicField = (obj, key, value) => {
1225
1225
  return CryptoJS2.SHA1;
1226
1226
  });
1227
1227
  })(sha1);
1228
- var sha256 = { exports: {} };
1228
+ var sha256$1 = { exports: {} };
1229
1229
  (function(module2, exports2) {
1230
- (function(root, factory) {
1230
+ (function(root2, factory) {
1231
1231
  {
1232
1232
  module2.exports = factory(core.exports);
1233
1233
  }
@@ -1333,12 +1333,12 @@ var __publicField = (obj, key, value) => {
1333
1333
  })(Math);
1334
1334
  return CryptoJS2.SHA256;
1335
1335
  });
1336
- })(sha256);
1336
+ })(sha256$1);
1337
1337
  var sha224 = { exports: {} };
1338
1338
  (function(module2, exports2) {
1339
- (function(root, factory, undef) {
1339
+ (function(root2, factory, undef) {
1340
1340
  {
1341
- module2.exports = factory(core.exports, sha256.exports);
1341
+ module2.exports = factory(core.exports, sha256$1.exports);
1342
1342
  }
1343
1343
  })(commonjsGlobal$1, function(CryptoJS2) {
1344
1344
  (function() {
@@ -1362,7 +1362,7 @@ var __publicField = (obj, key, value) => {
1362
1362
  })(sha224);
1363
1363
  var sha512 = { exports: {} };
1364
1364
  (function(module2, exports2) {
1365
- (function(root, factory, undef) {
1365
+ (function(root2, factory, undef) {
1366
1366
  {
1367
1367
  module2.exports = factory(core.exports, x64Core.exports);
1368
1368
  }
@@ -1541,7 +1541,7 @@ var __publicField = (obj, key, value) => {
1541
1541
  })(sha512);
1542
1542
  var sha384 = { exports: {} };
1543
1543
  (function(module2, exports2) {
1544
- (function(root, factory, undef) {
1544
+ (function(root2, factory, undef) {
1545
1545
  {
1546
1546
  module2.exports = factory(core.exports, x64Core.exports, sha512.exports);
1547
1547
  }
@@ -1568,7 +1568,7 @@ var __publicField = (obj, key, value) => {
1568
1568
  })(sha384);
1569
1569
  var sha3 = { exports: {} };
1570
1570
  (function(module2, exports2) {
1571
- (function(root, factory, undef) {
1571
+ (function(root2, factory, undef) {
1572
1572
  {
1573
1573
  module2.exports = factory(core.exports, x64Core.exports);
1574
1574
  }
@@ -1747,7 +1747,7 @@ var __publicField = (obj, key, value) => {
1747
1747
  })(sha3);
1748
1748
  var ripemd160 = { exports: {} };
1749
1749
  (function(module2, exports2) {
1750
- (function(root, factory) {
1750
+ (function(root2, factory) {
1751
1751
  {
1752
1752
  module2.exports = factory(core.exports);
1753
1753
  }
@@ -1892,7 +1892,7 @@ var __publicField = (obj, key, value) => {
1892
1892
  })(ripemd160);
1893
1893
  var hmac = { exports: {} };
1894
1894
  (function(module2, exports2) {
1895
- (function(root, factory) {
1895
+ (function(root2, factory) {
1896
1896
  {
1897
1897
  module2.exports = factory(core.exports);
1898
1898
  }
@@ -1944,7 +1944,7 @@ var __publicField = (obj, key, value) => {
1944
1944
  })(hmac);
1945
1945
  var pbkdf2 = { exports: {} };
1946
1946
  (function(module2, exports2) {
1947
- (function(root, factory, undef) {
1947
+ (function(root2, factory, undef) {
1948
1948
  {
1949
1949
  module2.exports = factory(core.exports, sha1.exports, hmac.exports);
1950
1950
  }
@@ -1997,7 +1997,7 @@ var __publicField = (obj, key, value) => {
1997
1997
  })(pbkdf2);
1998
1998
  var evpkdf = { exports: {} };
1999
1999
  (function(module2, exports2) {
2000
- (function(root, factory, undef) {
2000
+ (function(root2, factory, undef) {
2001
2001
  {
2002
2002
  module2.exports = factory(core.exports, sha1.exports, hmac.exports);
2003
2003
  }
@@ -2043,7 +2043,7 @@ var __publicField = (obj, key, value) => {
2043
2043
  })(evpkdf);
2044
2044
  var cipherCore = { exports: {} };
2045
2045
  (function(module2, exports2) {
2046
- (function(root, factory, undef) {
2046
+ (function(root2, factory, undef) {
2047
2047
  {
2048
2048
  module2.exports = factory(core.exports, evpkdf.exports);
2049
2049
  }
@@ -2263,7 +2263,7 @@ var __publicField = (obj, key, value) => {
2263
2263
  })(cipherCore);
2264
2264
  var modeCfb = { exports: {} };
2265
2265
  (function(module2, exports2) {
2266
- (function(root, factory, undef) {
2266
+ (function(root2, factory, undef) {
2267
2267
  {
2268
2268
  module2.exports = factory(core.exports, cipherCore.exports);
2269
2269
  }
@@ -2304,7 +2304,7 @@ var __publicField = (obj, key, value) => {
2304
2304
  })(modeCfb);
2305
2305
  var modeCtr = { exports: {} };
2306
2306
  (function(module2, exports2) {
2307
- (function(root, factory, undef) {
2307
+ (function(root2, factory, undef) {
2308
2308
  {
2309
2309
  module2.exports = factory(core.exports, cipherCore.exports);
2310
2310
  }
@@ -2335,7 +2335,7 @@ var __publicField = (obj, key, value) => {
2335
2335
  })(modeCtr);
2336
2336
  var modeCtrGladman = { exports: {} };
2337
2337
  (function(module2, exports2) {
2338
- (function(root, factory, undef) {
2338
+ (function(root2, factory, undef) {
2339
2339
  {
2340
2340
  module2.exports = factory(core.exports, cipherCore.exports);
2341
2341
  }
@@ -2406,7 +2406,7 @@ var __publicField = (obj, key, value) => {
2406
2406
  })(modeCtrGladman);
2407
2407
  var modeOfb = { exports: {} };
2408
2408
  (function(module2, exports2) {
2409
- (function(root, factory, undef) {
2409
+ (function(root2, factory, undef) {
2410
2410
  {
2411
2411
  module2.exports = factory(core.exports, cipherCore.exports);
2412
2412
  }
@@ -2435,7 +2435,7 @@ var __publicField = (obj, key, value) => {
2435
2435
  })(modeOfb);
2436
2436
  var modeEcb = { exports: {} };
2437
2437
  (function(module2, exports2) {
2438
- (function(root, factory, undef) {
2438
+ (function(root2, factory, undef) {
2439
2439
  {
2440
2440
  module2.exports = factory(core.exports, cipherCore.exports);
2441
2441
  }
@@ -2455,7 +2455,7 @@ var __publicField = (obj, key, value) => {
2455
2455
  })(modeEcb);
2456
2456
  var padAnsix923 = { exports: {} };
2457
2457
  (function(module2, exports2) {
2458
- (function(root, factory, undef) {
2458
+ (function(root2, factory, undef) {
2459
2459
  {
2460
2460
  module2.exports = factory(core.exports, cipherCore.exports);
2461
2461
  }
@@ -2477,7 +2477,7 @@ var __publicField = (obj, key, value) => {
2477
2477
  })(padAnsix923);
2478
2478
  var padIso10126 = { exports: {} };
2479
2479
  (function(module2, exports2) {
2480
- (function(root, factory, undef) {
2480
+ (function(root2, factory, undef) {
2481
2481
  {
2482
2482
  module2.exports = factory(core.exports, cipherCore.exports);
2483
2483
  }
@@ -2495,7 +2495,7 @@ var __publicField = (obj, key, value) => {
2495
2495
  })(padIso10126);
2496
2496
  var padIso97971 = { exports: {} };
2497
2497
  (function(module2, exports2) {
2498
- (function(root, factory, undef) {
2498
+ (function(root2, factory, undef) {
2499
2499
  {
2500
2500
  module2.exports = factory(core.exports, cipherCore.exports);
2501
2501
  }
@@ -2512,7 +2512,7 @@ var __publicField = (obj, key, value) => {
2512
2512
  })(padIso97971);
2513
2513
  var padZeropadding = { exports: {} };
2514
2514
  (function(module2, exports2) {
2515
- (function(root, factory, undef) {
2515
+ (function(root2, factory, undef) {
2516
2516
  {
2517
2517
  module2.exports = factory(core.exports, cipherCore.exports);
2518
2518
  }
@@ -2536,7 +2536,7 @@ var __publicField = (obj, key, value) => {
2536
2536
  })(padZeropadding);
2537
2537
  var padNopadding = { exports: {} };
2538
2538
  (function(module2, exports2) {
2539
- (function(root, factory, undef) {
2539
+ (function(root2, factory, undef) {
2540
2540
  {
2541
2541
  module2.exports = factory(core.exports, cipherCore.exports);
2542
2542
  }
@@ -2549,7 +2549,7 @@ var __publicField = (obj, key, value) => {
2549
2549
  })(padNopadding);
2550
2550
  var formatHex = { exports: {} };
2551
2551
  (function(module2, exports2) {
2552
- (function(root, factory, undef) {
2552
+ (function(root2, factory, undef) {
2553
2553
  {
2554
2554
  module2.exports = factory(core.exports, cipherCore.exports);
2555
2555
  }
@@ -2573,7 +2573,7 @@ var __publicField = (obj, key, value) => {
2573
2573
  })(formatHex);
2574
2574
  var aes = { exports: {} };
2575
2575
  (function(module2, exports2) {
2576
- (function(root, factory, undef) {
2576
+ (function(root2, factory, undef) {
2577
2577
  {
2578
2578
  module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2579
2579
  }
@@ -2715,7 +2715,7 @@ var __publicField = (obj, key, value) => {
2715
2715
  var AES = aes.exports;
2716
2716
  var tripledes = { exports: {} };
2717
2717
  (function(module2, exports2) {
2718
- (function(root, factory, undef) {
2718
+ (function(root2, factory, undef) {
2719
2719
  {
2720
2720
  module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2721
2721
  }
@@ -2830,7 +2830,7 @@ var __publicField = (obj, key, value) => {
2830
2830
  })(tripledes);
2831
2831
  var rc4 = { exports: {} };
2832
2832
  (function(module2, exports2) {
2833
- (function(root, factory, undef) {
2833
+ (function(root2, factory, undef) {
2834
2834
  {
2835
2835
  module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2836
2836
  }
@@ -2891,7 +2891,7 @@ var __publicField = (obj, key, value) => {
2891
2891
  })(rc4);
2892
2892
  var rabbit = { exports: {} };
2893
2893
  (function(module2, exports2) {
2894
- (function(root, factory, undef) {
2894
+ (function(root2, factory, undef) {
2895
2895
  {
2896
2896
  module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2897
2897
  }
@@ -2990,7 +2990,7 @@ var __publicField = (obj, key, value) => {
2990
2990
  })(rabbit);
2991
2991
  var rabbitLegacy = { exports: {} };
2992
2992
  (function(module2, exports2) {
2993
- (function(root, factory, undef) {
2993
+ (function(root2, factory, undef) {
2994
2994
  {
2995
2995
  module2.exports = factory(core.exports, encBase64.exports, md5.exports, evpkdf.exports, cipherCore.exports);
2996
2996
  }
@@ -3085,9 +3085,9 @@ var __publicField = (obj, key, value) => {
3085
3085
  });
3086
3086
  })(rabbitLegacy);
3087
3087
  (function(module2, exports2) {
3088
- (function(root, factory, undef) {
3088
+ (function(root2, factory, undef) {
3089
3089
  {
3090
- module2.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
3090
+ module2.exports = factory(core.exports, x64Core.exports, libTypedarrays.exports, encUtf16.exports, encBase64.exports, encBase64url.exports, md5.exports, sha1.exports, sha256$1.exports, sha224.exports, sha512.exports, sha384.exports, sha3.exports, ripemd160.exports, hmac.exports, pbkdf2.exports, evpkdf.exports, cipherCore.exports, modeCfb.exports, modeCtr.exports, modeCtrGladman.exports, modeOfb.exports, modeEcb.exports, padAnsix923.exports, padIso10126.exports, padIso97971.exports, padZeropadding.exports, padNopadding.exports, formatHex.exports, aes.exports, tripledes.exports, rc4.exports, rabbit.exports, rabbitLegacy.exports);
3091
3091
  }
3092
3092
  })(commonjsGlobal$1, function(CryptoJS2) {
3093
3093
  return CryptoJS2;
@@ -5549,15 +5549,15 @@ var __publicField = (obj, key, value) => {
5549
5549
  var Hex = { decode: function(a2) {
5550
5550
  var i;
5551
5551
  if (decoder$1 === void 0) {
5552
- var hex = "0123456789ABCDEF";
5552
+ var hex2 = "0123456789ABCDEF";
5553
5553
  var ignore = " \f\n\r  \u2028\u2029";
5554
5554
  decoder$1 = {};
5555
5555
  for (i = 0; i < 16; ++i) {
5556
- decoder$1[hex.charAt(i)] = i;
5556
+ decoder$1[hex2.charAt(i)] = i;
5557
5557
  }
5558
- hex = hex.toLowerCase();
5558
+ hex2 = hex2.toLowerCase();
5559
5559
  for (i = 10; i < 16; ++i) {
5560
- decoder$1[hex.charAt(i)] = i;
5560
+ decoder$1[hex2.charAt(i)] = i;
5561
5561
  }
5562
5562
  for (i = 0; i < ignore.length; ++i) {
5563
5563
  decoder$1[ignore.charAt(i)] = -1;
@@ -8264,15 +8264,15 @@ var __publicField = (obj, key, value) => {
8264
8264
  return asn1Obj.getEncodedHex();
8265
8265
  };
8266
8266
  }();
8267
- KJUR.asn1.ASN1Util.oidHexToInt = function(hex) {
8267
+ KJUR.asn1.ASN1Util.oidHexToInt = function(hex2) {
8268
8268
  var s = "";
8269
- var i01 = parseInt(hex.substr(0, 2), 16);
8269
+ var i01 = parseInt(hex2.substr(0, 2), 16);
8270
8270
  var i0 = Math.floor(i01 / 40);
8271
8271
  var i1 = i01 % 40;
8272
8272
  var s = i0 + "." + i1;
8273
8273
  var binbuf = "";
8274
- for (var i = 2; i < hex.length; i += 2) {
8275
- var value = parseInt(hex.substr(i, 2), 16);
8274
+ for (var i = 2; i < hex2.length; i += 2) {
8275
+ var value = parseInt(hex2.substr(i, 2), 16);
8276
8276
  var bin = ("00000000" + value.toString(2)).slice(-8);
8277
8277
  binbuf = binbuf + bin.substr(1, 7);
8278
8278
  if (bin.substr(0, 1) == "0") {
@@ -11487,7 +11487,7 @@ var __publicField = (obj, key, value) => {
11487
11487
  const { isArray: isArray$1 } = Array;
11488
11488
  const isUndefined$1 = typeOfTest$1("undefined");
11489
11489
  function isBuffer$1(val) {
11490
- return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$2(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11490
+ return val !== null && !isUndefined$1(val) && val.constructor !== null && !isUndefined$1(val.constructor) && isFunction$4(val.constructor.isBuffer) && val.constructor.isBuffer(val);
11491
11491
  }
11492
11492
  const isArrayBuffer$1 = kindOfTest$1("ArrayBuffer");
11493
11493
  function isArrayBufferView$1(val) {
@@ -11500,9 +11500,9 @@ var __publicField = (obj, key, value) => {
11500
11500
  return result;
11501
11501
  }
11502
11502
  const isString$1 = typeOfTest$1("string");
11503
- const isFunction$2 = typeOfTest$1("function");
11503
+ const isFunction$4 = typeOfTest$1("function");
11504
11504
  const isNumber$1 = typeOfTest$1("number");
11505
- const isObject$1 = (thing) => thing !== null && typeof thing === "object";
11505
+ const isObject$4 = (thing) => thing !== null && typeof thing === "object";
11506
11506
  const isBoolean$1 = (thing) => thing === true || thing === false;
11507
11507
  const isPlainObject$1 = (val) => {
11508
11508
  if (kindOf$1(val) !== "object") {
@@ -11515,10 +11515,10 @@ var __publicField = (obj, key, value) => {
11515
11515
  const isFile$1 = kindOfTest$1("File");
11516
11516
  const isBlob$1 = kindOfTest$1("Blob");
11517
11517
  const isFileList$1 = kindOfTest$1("FileList");
11518
- const isStream$1 = (val) => isObject$1(val) && isFunction$2(val.pipe);
11518
+ const isStream$1 = (val) => isObject$4(val) && isFunction$4(val.pipe);
11519
11519
  const isFormData$1 = (thing) => {
11520
11520
  let kind;
11521
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$2(thing.append) && ((kind = kindOf$1(thing)) === "formdata" || kind === "object" && isFunction$2(thing.toString) && thing.toString() === "[object FormData]"));
11521
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$4(thing.append) && ((kind = kindOf$1(thing)) === "formdata" || kind === "object" && isFunction$4(thing.toString) && thing.toString() === "[object FormData]"));
11522
11522
  };
11523
11523
  const isURLSearchParams$1 = kindOfTest$1("URLSearchParams");
11524
11524
  const trim$1 = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
@@ -11586,7 +11586,7 @@ var __publicField = (obj, key, value) => {
11586
11586
  }
11587
11587
  const extend$1 = (a2, b, thisArg, { allOwnKeys } = {}) => {
11588
11588
  forEach$1(b, (val, key) => {
11589
- if (thisArg && isFunction$2(val)) {
11589
+ if (thisArg && isFunction$4(val)) {
11590
11590
  a2[key] = bind$1(val, thisArg);
11591
11591
  } else {
11592
11592
  a2[key] = val;
@@ -11673,7 +11673,7 @@ var __publicField = (obj, key, value) => {
11673
11673
  const toCamelCase$1 = (str) => str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
11674
11674
  return p1.toUpperCase() + p2;
11675
11675
  });
11676
- const hasOwnProperty$1 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11676
+ const hasOwnProperty$5 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
11677
11677
  const isRegExp$1 = kindOfTest$1("RegExp");
11678
11678
  const reduceDescriptors$1 = (obj, reducer) => {
11679
11679
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
@@ -11687,11 +11687,11 @@ var __publicField = (obj, key, value) => {
11687
11687
  };
11688
11688
  const freezeMethods$1 = (obj) => {
11689
11689
  reduceDescriptors$1(obj, (descriptor, name) => {
11690
- if (isFunction$2(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11690
+ if (isFunction$4(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
11691
11691
  return false;
11692
11692
  }
11693
11693
  const value = obj[name];
11694
- if (!isFunction$2(value))
11694
+ if (!isFunction$4(value))
11695
11695
  return;
11696
11696
  descriptor.enumerable = false;
11697
11697
  if ("writable" in descriptor) {
@@ -11733,12 +11733,12 @@ var __publicField = (obj, key, value) => {
11733
11733
  return str;
11734
11734
  };
11735
11735
  function isSpecCompliantForm$1(thing) {
11736
- return !!(thing && isFunction$2(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
11736
+ return !!(thing && isFunction$4(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
11737
11737
  }
11738
11738
  const toJSONObject$1 = (obj) => {
11739
11739
  const stack = new Array(10);
11740
11740
  const visit = (source, i) => {
11741
- if (isObject$1(source)) {
11741
+ if (isObject$4(source)) {
11742
11742
  if (stack.indexOf(source) >= 0) {
11743
11743
  return;
11744
11744
  }
@@ -11758,8 +11758,8 @@ var __publicField = (obj, key, value) => {
11758
11758
  return visit(obj, 0);
11759
11759
  };
11760
11760
  const isAsyncFn$1 = kindOfTest$1("AsyncFunction");
11761
- const isThenable$1 = (thing) => thing && (isObject$1(thing) || isFunction$2(thing)) && isFunction$2(thing.then) && isFunction$2(thing.catch);
11762
- var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$1, isPlainObject: isPlainObject$1, isUndefined: isUndefined$1, isDate: isDate$1, isFile: isFile$1, isBlob: isBlob$1, isRegExp: isRegExp$1, isFunction: isFunction$2, isStream: isStream$1, isURLSearchParams: isURLSearchParams$1, isTypedArray: isTypedArray$1, isFileList: isFileList$1, forEach: forEach$1, merge: merge$1, extend: extend$1, trim: trim$1, stripBOM: stripBOM$1, inherits: inherits$1, toFlatObject: toFlatObject$1, kindOf: kindOf$1, kindOfTest: kindOfTest$1, endsWith: endsWith$1, toArray: toArray$1, forEachEntry: forEachEntry$1, matchAll: matchAll$1, isHTMLForm: isHTMLForm$1, hasOwnProperty: hasOwnProperty$1, hasOwnProp: hasOwnProperty$1, reduceDescriptors: reduceDescriptors$1, freezeMethods: freezeMethods$1, toObjectSet: toObjectSet$1, toCamelCase: toCamelCase$1, noop: noop$1, toFiniteNumber: toFiniteNumber$1, findKey: findKey$1, global: _global$1, isContextDefined: isContextDefined$1, ALPHABET: ALPHABET$1, generateString: generateString$1, isSpecCompliantForm: isSpecCompliantForm$1, toJSONObject: toJSONObject$1, isAsyncFn: isAsyncFn$1, isThenable: isThenable$1 };
11761
+ const isThenable$1 = (thing) => thing && (isObject$4(thing) || isFunction$4(thing)) && isFunction$4(thing.then) && isFunction$4(thing.catch);
11762
+ var utils$2 = { isArray: isArray$1, isArrayBuffer: isArrayBuffer$1, isBuffer: isBuffer$1, isFormData: isFormData$1, isArrayBufferView: isArrayBufferView$1, isString: isString$1, isNumber: isNumber$1, isBoolean: isBoolean$1, isObject: isObject$4, isPlainObject: isPlainObject$1, isUndefined: isUndefined$1, isDate: isDate$1, isFile: isFile$1, isBlob: isBlob$1, isRegExp: isRegExp$1, isFunction: isFunction$4, isStream: isStream$1, isURLSearchParams: isURLSearchParams$1, isTypedArray: isTypedArray$1, isFileList: isFileList$1, forEach: forEach$1, merge: merge$1, extend: extend$1, trim: trim$1, stripBOM: stripBOM$1, inherits: inherits$1, toFlatObject: toFlatObject$1, kindOf: kindOf$1, kindOfTest: kindOfTest$1, endsWith: endsWith$1, toArray: toArray$1, forEachEntry: forEachEntry$1, matchAll: matchAll$1, isHTMLForm: isHTMLForm$1, hasOwnProperty: hasOwnProperty$5, hasOwnProp: hasOwnProperty$5, reduceDescriptors: reduceDescriptors$1, freezeMethods: freezeMethods$1, toObjectSet: toObjectSet$1, toCamelCase: toCamelCase$1, noop: noop$1, toFiniteNumber: toFiniteNumber$1, findKey: findKey$1, global: _global$1, isContextDefined: isContextDefined$1, ALPHABET: ALPHABET$1, generateString: generateString$1, isSpecCompliantForm: isSpecCompliantForm$1, toJSONObject: toJSONObject$1, isAsyncFn: isAsyncFn$1, isThenable: isThenable$1 };
11763
11763
  function AxiosError$1(message, code, config2, request, response) {
11764
11764
  Error.call(this);
11765
11765
  if (Error.captureStackTrace) {
@@ -13231,7 +13231,7 @@ var __publicField = (obj, key, value) => {
13231
13231
  const { isArray } = Array;
13232
13232
  const isUndefined = typeOfTest("undefined");
13233
13233
  function isBuffer(val) {
13234
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
13234
+ return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction$3(val.constructor.isBuffer) && val.constructor.isBuffer(val);
13235
13235
  }
13236
13236
  const isArrayBuffer = kindOfTest("ArrayBuffer");
13237
13237
  function isArrayBufferView(val) {
@@ -13244,9 +13244,9 @@ var __publicField = (obj, key, value) => {
13244
13244
  return result;
13245
13245
  }
13246
13246
  const isString = typeOfTest("string");
13247
- const isFunction$1 = typeOfTest("function");
13247
+ const isFunction$3 = typeOfTest("function");
13248
13248
  const isNumber = typeOfTest("number");
13249
- const isObject = (thing) => thing !== null && typeof thing === "object";
13249
+ const isObject$3 = (thing) => thing !== null && typeof thing === "object";
13250
13250
  const isBoolean = (thing) => thing === true || thing === false;
13251
13251
  const isPlainObject = (val) => {
13252
13252
  if (kindOf(val) !== "object") {
@@ -13259,11 +13259,11 @@ var __publicField = (obj, key, value) => {
13259
13259
  const isFile = kindOfTest("File");
13260
13260
  const isBlob = kindOfTest("Blob");
13261
13261
  const isFileList = kindOfTest("FileList");
13262
- const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
13262
+ const isStream = (val) => isObject$3(val) && isFunction$3(val.pipe);
13263
13263
  const isFormData = (thing) => {
13264
13264
  let kind;
13265
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$1(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
13266
- kind === "object" && isFunction$1(thing.toString) && thing.toString() === "[object FormData]"));
13265
+ return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction$3(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
13266
+ kind === "object" && isFunction$3(thing.toString) && thing.toString() === "[object FormData]"));
13267
13267
  };
13268
13268
  const isURLSearchParams = kindOfTest("URLSearchParams");
13269
13269
  const [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest);
@@ -13332,7 +13332,7 @@ var __publicField = (obj, key, value) => {
13332
13332
  }
13333
13333
  const extend = (a2, b, thisArg, { allOwnKeys } = {}) => {
13334
13334
  forEach(b, (val, key) => {
13335
- if (thisArg && isFunction$1(val)) {
13335
+ if (thisArg && isFunction$3(val)) {
13336
13336
  a2[key] = bind(val, thisArg);
13337
13337
  } else {
13338
13338
  a2[key] = val;
@@ -13430,7 +13430,7 @@ var __publicField = (obj, key, value) => {
13430
13430
  }
13431
13431
  );
13432
13432
  };
13433
- const hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
13433
+ const hasOwnProperty$4 = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
13434
13434
  const isRegExp = kindOfTest("RegExp");
13435
13435
  const reduceDescriptors = (obj, reducer) => {
13436
13436
  const descriptors2 = Object.getOwnPropertyDescriptors(obj);
@@ -13445,11 +13445,11 @@ var __publicField = (obj, key, value) => {
13445
13445
  };
13446
13446
  const freezeMethods = (obj) => {
13447
13447
  reduceDescriptors(obj, (descriptor, name) => {
13448
- if (isFunction$1(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
13448
+ if (isFunction$3(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
13449
13449
  return false;
13450
13450
  }
13451
13451
  const value = obj[name];
13452
- if (!isFunction$1(value))
13452
+ if (!isFunction$3(value))
13453
13453
  return;
13454
13454
  descriptor.enumerable = false;
13455
13455
  if ("writable" in descriptor) {
@@ -13494,12 +13494,12 @@ var __publicField = (obj, key, value) => {
13494
13494
  return str;
13495
13495
  };
13496
13496
  function isSpecCompliantForm(thing) {
13497
- return !!(thing && isFunction$1(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
13497
+ return !!(thing && isFunction$3(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
13498
13498
  }
13499
13499
  const toJSONObject = (obj) => {
13500
13500
  const stack = new Array(10);
13501
13501
  const visit = (source, i) => {
13502
- if (isObject(source)) {
13502
+ if (isObject$3(source)) {
13503
13503
  if (stack.indexOf(source) >= 0) {
13504
13504
  return;
13505
13505
  }
@@ -13519,7 +13519,7 @@ var __publicField = (obj, key, value) => {
13519
13519
  return visit(obj, 0);
13520
13520
  };
13521
13521
  const isAsyncFn = kindOfTest("AsyncFunction");
13522
- const isThenable = (thing) => thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
13522
+ const isThenable = (thing) => thing && (isObject$3(thing) || isFunction$3(thing)) && isFunction$3(thing.then) && isFunction$3(thing.catch);
13523
13523
  var utils$1 = {
13524
13524
  isArray,
13525
13525
  isArrayBuffer,
@@ -13529,7 +13529,7 @@ var __publicField = (obj, key, value) => {
13529
13529
  isString,
13530
13530
  isNumber,
13531
13531
  isBoolean,
13532
- isObject,
13532
+ isObject: isObject$3,
13533
13533
  isPlainObject,
13534
13534
  isReadableStream,
13535
13535
  isRequest,
@@ -13540,7 +13540,7 @@ var __publicField = (obj, key, value) => {
13540
13540
  isFile,
13541
13541
  isBlob,
13542
13542
  isRegExp,
13543
- isFunction: isFunction$1,
13543
+ isFunction: isFunction$3,
13544
13544
  isStream,
13545
13545
  isURLSearchParams,
13546
13546
  isTypedArray,
@@ -13559,8 +13559,8 @@ var __publicField = (obj, key, value) => {
13559
13559
  forEachEntry,
13560
13560
  matchAll,
13561
13561
  isHTMLForm,
13562
- hasOwnProperty,
13563
- hasOwnProp: hasOwnProperty,
13562
+ hasOwnProperty: hasOwnProperty$4,
13563
+ hasOwnProp: hasOwnProperty$4,
13564
13564
  // an alias to avoid ESLint no-prototype-builtins detection
13565
13565
  reduceDescriptors,
13566
13566
  freezeMethods,
@@ -17126,7 +17126,7 @@ var __publicField = (obj, key, value) => {
17126
17126
  axios.getAdapter = adapters.getAdapter;
17127
17127
  axios.HttpStatusCode = HttpStatusCode;
17128
17128
  axios.default = axios;
17129
- var isFunction = function isFunction2(variable) {
17129
+ var isFunction$2 = function isFunction2(variable) {
17130
17130
  return typeof variable === "function";
17131
17131
  };
17132
17132
  var STATUS;
@@ -17165,7 +17165,7 @@ var __publicField = (obj, key, value) => {
17165
17165
  var blockRequest = false;
17166
17166
  var blockError = null;
17167
17167
  var handleError = function handleError2(error, c2) {
17168
- if (isFunction(c2.failover)) {
17168
+ if (isFunction$2(c2.failover)) {
17169
17169
  var newConfig = c2.failover(error, c2);
17170
17170
  if (typeof newConfig === "object") {
17171
17171
  return instance.request(_objectSpread2(_objectSpread2({}, newConfig), {}, {
@@ -17173,7 +17173,7 @@ var __publicField = (obj, key, value) => {
17173
17173
  }));
17174
17174
  }
17175
17175
  }
17176
- if (isFunction(c2.shouldBlock)) {
17176
+ if (isFunction$2(c2.shouldBlock)) {
17177
17177
  blockRequest = c2.shouldBlock(error);
17178
17178
  blockError = error;
17179
17179
  setTimeout(function() {
@@ -17187,7 +17187,7 @@ var __publicField = (obj, key, value) => {
17187
17187
  return instance.request(c2);
17188
17188
  }
17189
17189
  }
17190
- if (isFunction(c2.error)) {
17190
+ if (isFunction$2(c2.error)) {
17191
17191
  c2.error(error, c2);
17192
17192
  }
17193
17193
  return Promise.reject(error);
@@ -17230,7 +17230,7 @@ var __publicField = (obj, key, value) => {
17230
17230
  cache[key] = {
17231
17231
  status: STATUS.pending,
17232
17232
  timer: setTimeout(function() {
17233
- if (isFunction(loading)) {
17233
+ if (isFunction$2(loading)) {
17234
17234
  loading(_objectSpread2(_objectSpread2({}, c2), {}, {
17235
17235
  key
17236
17236
  }));
@@ -17301,7 +17301,7 @@ var __publicField = (obj, key, value) => {
17301
17301
  }
17302
17302
  }
17303
17303
  }
17304
- if (isFunction(_config.complete)) {
17304
+ if (isFunction$2(_config.complete)) {
17305
17305
  _config.complete(c2);
17306
17306
  }
17307
17307
  return response;
@@ -17314,7 +17314,7 @@ var __publicField = (obj, key, value) => {
17314
17314
  delete cache[key];
17315
17315
  }
17316
17316
  }
17317
- if (isFunction(_config.complete)) {
17317
+ if (isFunction$2(_config.complete)) {
17318
17318
  _config.complete(error.config);
17319
17319
  }
17320
17320
  return handleError(error, error.config);
@@ -17532,9 +17532,9 @@ var __publicField = (obj, key, value) => {
17532
17532
  }
17533
17533
  const parseParams = (params) => {
17534
17534
  var _a2;
17535
- const { prefix = "", host, sdpAppId, uc, ...reset } = params;
17535
+ const { prefix = "", host, sdpAppId, uc, noSdpAppId, ...reset } = params;
17536
17536
  const headers = {
17537
- sdpAppId: sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
17537
+ sdpAppId: noSdpAppId ? null : sdpAppId || ((_a2 = uc == null ? void 0 : uc.options) == null ? void 0 : _a2.sdpAppId),
17538
17538
  ...reset || {}
17539
17539
  };
17540
17540
  params.originBaseURL = `${host}${prefix}`;
@@ -17550,7 +17550,8 @@ var __publicField = (obj, key, value) => {
17550
17550
  prefix,
17551
17551
  params,
17552
17552
  throwError,
17553
- sdpAppId
17553
+ sdpAppId,
17554
+ noSdpAppId
17554
17555
  }) {
17555
17556
  var _a2;
17556
17557
  const _params = parseParams({
@@ -17558,7 +17559,8 @@ var __publicField = (obj, key, value) => {
17558
17559
  prefix,
17559
17560
  host,
17560
17561
  uc,
17561
- sdpAppId
17562
+ sdpAppId,
17563
+ noSdpAppId
17562
17564
  });
17563
17565
  if (!uc) {
17564
17566
  return rawAPI(_params);
@@ -17570,6 +17572,38 @@ var __publicField = (obj, key, value) => {
17570
17572
  }, throwError);
17571
17573
  }
17572
17574
  const api = getApi({});
17575
+ function isTestHost() {
17576
+ const testHosts = [
17577
+ "localhost",
17578
+ "x-edu-web.beta.101.com",
17579
+ "test3.ykt.eduyun.cn",
17580
+ "test5.ykt.eduyun.cn",
17581
+ "test6.ykt.eduyun.cn",
17582
+ "test-x-edu-portal4.ykt.eduyun.cn",
17583
+ "web-bd.ykt.eduyun.cn",
17584
+ "xue-test.ykt.eduyun.cn",
17585
+ "teach-test.ykt.eduyun.cn",
17586
+ "teach-test2.ykt.eduyun.cn",
17587
+ "teach-test3.ykt.eduyun.cn",
17588
+ "h5-teach-test.ykt.eduyun.cn",
17589
+ "h5-teach-test2.ykt.eduyun.cn",
17590
+ "test-x-edu-portal3.ykt.eduyun.cn",
17591
+ "museum-test4.ykt.eduyun.cn",
17592
+ "sun.ykt.eduyun.cn",
17593
+ "computer.ykt.eduyun.cn",
17594
+ "zxx-preview.ykt.eduyun.cn"
17595
+ ];
17596
+ if (testHosts.indexOf(window.location.host) > -1 || window.location.host.indexOf("localhost") > -1 || window.location.host.indexOf("192.") > -1) {
17597
+ return true;
17598
+ }
17599
+ return false;
17600
+ }
17601
+ function getValueByHost({ value, defaultValue }) {
17602
+ if (isTestHost()) {
17603
+ return value;
17604
+ }
17605
+ return defaultValue;
17606
+ }
17573
17607
  const config = {
17574
17608
  "ncet-xedu": {
17575
17609
  // 代理
@@ -17586,7 +17620,28 @@ var __publicField = (obj, key, value) => {
17586
17620
  // 收藏
17587
17621
  "e-favorite-api": "//e-favorite-api.ykt.eduyun.cn",
17588
17622
  // 学习记录
17589
- "x-study-record": "//x-study-record-api.ykt.eduyun.cn"
17623
+ "x-study-record": "//x-study-record-api.ykt.eduyun.cn",
17624
+ cdn: getValueByHost({
17625
+ value: "//pretest-s-file-1.ykt.cbern.com.cn",
17626
+ defaultValue: "//s-file-1.ykt.cbern.com.cn"
17627
+ }),
17628
+ "cdn-s-file": getValueByHost({
17629
+ value: "//pretest-s-file-1.ykt.cbern.com.cn",
17630
+ defaultValue: "//s-file-1.ykt.cbern.com.cn"
17631
+ }),
17632
+ "cdn-bdcs-file": "//bdcs-file-1.ykt.cbern.com.cn",
17633
+ // 站点配置(存在灰度能力)
17634
+ "site-config": "//grey-config-web.ykt.cbern.com.cn",
17635
+ serviceName: {
17636
+ site: "bdxcloud",
17637
+ zxxRegion: "zxx_region",
17638
+ train: "teach",
17639
+ "t-course": "teach",
17640
+ eLabour: "ldjy"
17641
+ },
17642
+ defaultAreaSite: "hn",
17643
+ // 内容库
17644
+ "elearning-library": "//elearning-library-gateway.ykt.eduyun.cn"
17590
17645
  },
17591
17646
  preproduction: {
17592
17647
  // 代理
@@ -17599,7 +17654,20 @@ var __publicField = (obj, key, value) => {
17599
17654
  "cs-feedback": "//betacs.101.com",
17600
17655
  "e-favorite-api": "//e-favorite-api.beta.101.com",
17601
17656
  // 学习记录
17602
- "x-study-record": "//x-study-record-api.beta.101.com"
17657
+ "x-study-record": "//x-study-record-api.beta.101.com",
17658
+ cdn: "//ndcs-pre.101.com",
17659
+ // 站点配置(存在灰度能力)
17660
+ "site-config": "//grey-config-web.ykt.cbern.com.cn",
17661
+ serviceName: {
17662
+ site: "preproduction_content_x_cloud",
17663
+ zxxRegion: "preproduction_content_zxx_region",
17664
+ train: "preproduction_content_staticize",
17665
+ "t-course": "preproduction_content_x_course",
17666
+ eLabour: "preproduction_content_zxx"
17667
+ },
17668
+ defaultAreaSite: "hn",
17669
+ // 内容库
17670
+ "elearning-library": "//elearning-library-gateway.beta.101.com"
17603
17671
  }
17604
17672
  };
17605
17673
  const recommendAPIV2 = ({
@@ -17718,6 +17786,46 @@ var __publicField = (obj, key, value) => {
17718
17786
  uc
17719
17787
  });
17720
17788
  };
17789
+ const cdnAPI = ({
17790
+ env
17791
+ }) => getApi({
17792
+ host: config[env]["cdn"],
17793
+ prefix: "",
17794
+ noSdpAppId: true
17795
+ });
17796
+ const cdnSFileAPI = ({
17797
+ env
17798
+ }) => getApi({
17799
+ host: config[env]["cdn-s-file"],
17800
+ prefix: "",
17801
+ noSdpAppId: true
17802
+ });
17803
+ const cdnBdcsFileAPI = ({
17804
+ env
17805
+ }) => getApi({
17806
+ host: config[env]["cdn-bdcs-file"],
17807
+ prefix: "",
17808
+ noSdpAppId: true
17809
+ });
17810
+ const siteConfigAPI = ({
17811
+ uc,
17812
+ env
17813
+ }) => {
17814
+ var _a2;
17815
+ return getApi({
17816
+ host: config[env]["site-config"],
17817
+ prefix: "",
17818
+ sdpAppId: (_a2 = uc.options) == null ? void 0 : _a2.sdpAppId
17819
+ });
17820
+ };
17821
+ const eLearningLibraryAPI = ({
17822
+ uc,
17823
+ env
17824
+ }) => getApi({
17825
+ host: config[env]["elearning-library"],
17826
+ prefix: "",
17827
+ uc
17828
+ });
17721
17829
  async function getStatByChunk(resIds, requestFn, ...args) {
17722
17830
  try {
17723
17831
  const chunkSize = 100;
@@ -18438,6 +18546,740 @@ var __publicField = (obj, key, value) => {
18438
18546
  this.request = request;
18439
18547
  }
18440
18548
  }
18549
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
18550
+ var _freeGlobal = freeGlobal$1;
18551
+ var freeGlobal = _freeGlobal;
18552
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
18553
+ var root$3 = freeGlobal || freeSelf || Function("return this")();
18554
+ var _root = root$3;
18555
+ var root$2 = _root;
18556
+ var Symbol$3 = root$2.Symbol;
18557
+ var _Symbol = Symbol$3;
18558
+ var Symbol$2 = _Symbol;
18559
+ var objectProto$4 = Object.prototype;
18560
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
18561
+ var nativeObjectToString$1 = objectProto$4.toString;
18562
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
18563
+ function getRawTag$1(value) {
18564
+ var isOwn = hasOwnProperty$3.call(value, symToStringTag$1), tag = value[symToStringTag$1];
18565
+ try {
18566
+ value[symToStringTag$1] = void 0;
18567
+ var unmasked = true;
18568
+ } catch (e2) {
18569
+ }
18570
+ var result = nativeObjectToString$1.call(value);
18571
+ if (unmasked) {
18572
+ if (isOwn) {
18573
+ value[symToStringTag$1] = tag;
18574
+ } else {
18575
+ delete value[symToStringTag$1];
18576
+ }
18577
+ }
18578
+ return result;
18579
+ }
18580
+ var _getRawTag = getRawTag$1;
18581
+ var objectProto$3 = Object.prototype;
18582
+ var nativeObjectToString = objectProto$3.toString;
18583
+ function objectToString$1(value) {
18584
+ return nativeObjectToString.call(value);
18585
+ }
18586
+ var _objectToString = objectToString$1;
18587
+ var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
18588
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
18589
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
18590
+ function baseGetTag$1(value) {
18591
+ if (value == null) {
18592
+ return value === void 0 ? undefinedTag : nullTag;
18593
+ }
18594
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
18595
+ }
18596
+ var _baseGetTag = baseGetTag$1;
18597
+ function isObject$2(value) {
18598
+ var type = typeof value;
18599
+ return value != null && (type == "object" || type == "function");
18600
+ }
18601
+ var isObject_1 = isObject$2;
18602
+ var baseGetTag = _baseGetTag, isObject$1 = isObject_1;
18603
+ var asyncTag = "[object AsyncFunction]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
18604
+ function isFunction$1(value) {
18605
+ if (!isObject$1(value)) {
18606
+ return false;
18607
+ }
18608
+ var tag = baseGetTag(value);
18609
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
18610
+ }
18611
+ var isFunction_1 = isFunction$1;
18612
+ var root$1 = _root;
18613
+ var coreJsData$1 = root$1["__core-js_shared__"];
18614
+ var _coreJsData = coreJsData$1;
18615
+ var coreJsData = _coreJsData;
18616
+ var maskSrcKey = function() {
18617
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
18618
+ return uid ? "Symbol(src)_1." + uid : "";
18619
+ }();
18620
+ function isMasked$1(func) {
18621
+ return !!maskSrcKey && maskSrcKey in func;
18622
+ }
18623
+ var _isMasked = isMasked$1;
18624
+ var funcProto$1 = Function.prototype;
18625
+ var funcToString$1 = funcProto$1.toString;
18626
+ function toSource$1(func) {
18627
+ if (func != null) {
18628
+ try {
18629
+ return funcToString$1.call(func);
18630
+ } catch (e2) {
18631
+ }
18632
+ try {
18633
+ return func + "";
18634
+ } catch (e2) {
18635
+ }
18636
+ }
18637
+ return "";
18638
+ }
18639
+ var _toSource = toSource$1;
18640
+ var isFunction = isFunction_1, isMasked = _isMasked, isObject = isObject_1, toSource = _toSource;
18641
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
18642
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
18643
+ var funcProto = Function.prototype, objectProto$2 = Object.prototype;
18644
+ var funcToString = funcProto.toString;
18645
+ var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
18646
+ var reIsNative = RegExp(
18647
+ "^" + funcToString.call(hasOwnProperty$2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
18648
+ );
18649
+ function baseIsNative$1(value) {
18650
+ if (!isObject(value) || isMasked(value)) {
18651
+ return false;
18652
+ }
18653
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
18654
+ return pattern.test(toSource(value));
18655
+ }
18656
+ var _baseIsNative = baseIsNative$1;
18657
+ function getValue$1(object, key) {
18658
+ return object == null ? void 0 : object[key];
18659
+ }
18660
+ var _getValue = getValue$1;
18661
+ var baseIsNative = _baseIsNative, getValue = _getValue;
18662
+ function getNative$2(object, key) {
18663
+ var value = getValue(object, key);
18664
+ return baseIsNative(value) ? value : void 0;
18665
+ }
18666
+ var _getNative = getNative$2;
18667
+ var getNative$1 = _getNative;
18668
+ var nativeCreate$4 = getNative$1(Object, "create");
18669
+ var _nativeCreate = nativeCreate$4;
18670
+ var nativeCreate$3 = _nativeCreate;
18671
+ function hashClear$1() {
18672
+ this.__data__ = nativeCreate$3 ? nativeCreate$3(null) : {};
18673
+ this.size = 0;
18674
+ }
18675
+ var _hashClear = hashClear$1;
18676
+ function hashDelete$1(key) {
18677
+ var result = this.has(key) && delete this.__data__[key];
18678
+ this.size -= result ? 1 : 0;
18679
+ return result;
18680
+ }
18681
+ var _hashDelete = hashDelete$1;
18682
+ var nativeCreate$2 = _nativeCreate;
18683
+ var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
18684
+ var objectProto$1 = Object.prototype;
18685
+ var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
18686
+ function hashGet$1(key) {
18687
+ var data = this.__data__;
18688
+ if (nativeCreate$2) {
18689
+ var result = data[key];
18690
+ return result === HASH_UNDEFINED$1 ? void 0 : result;
18691
+ }
18692
+ return hasOwnProperty$1.call(data, key) ? data[key] : void 0;
18693
+ }
18694
+ var _hashGet = hashGet$1;
18695
+ var nativeCreate$1 = _nativeCreate;
18696
+ var objectProto = Object.prototype;
18697
+ var hasOwnProperty = objectProto.hasOwnProperty;
18698
+ function hashHas$1(key) {
18699
+ var data = this.__data__;
18700
+ return nativeCreate$1 ? data[key] !== void 0 : hasOwnProperty.call(data, key);
18701
+ }
18702
+ var _hashHas = hashHas$1;
18703
+ var nativeCreate = _nativeCreate;
18704
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
18705
+ function hashSet$1(key, value) {
18706
+ var data = this.__data__;
18707
+ this.size += this.has(key) ? 0 : 1;
18708
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
18709
+ return this;
18710
+ }
18711
+ var _hashSet = hashSet$1;
18712
+ var hashClear = _hashClear, hashDelete = _hashDelete, hashGet = _hashGet, hashHas = _hashHas, hashSet = _hashSet;
18713
+ function Hash$1(entries) {
18714
+ var index = -1, length = entries == null ? 0 : entries.length;
18715
+ this.clear();
18716
+ while (++index < length) {
18717
+ var entry = entries[index];
18718
+ this.set(entry[0], entry[1]);
18719
+ }
18720
+ }
18721
+ Hash$1.prototype.clear = hashClear;
18722
+ Hash$1.prototype["delete"] = hashDelete;
18723
+ Hash$1.prototype.get = hashGet;
18724
+ Hash$1.prototype.has = hashHas;
18725
+ Hash$1.prototype.set = hashSet;
18726
+ var _Hash = Hash$1;
18727
+ function listCacheClear$1() {
18728
+ this.__data__ = [];
18729
+ this.size = 0;
18730
+ }
18731
+ var _listCacheClear = listCacheClear$1;
18732
+ function eq$1(value, other) {
18733
+ return value === other || value !== value && other !== other;
18734
+ }
18735
+ var eq_1 = eq$1;
18736
+ var eq = eq_1;
18737
+ function assocIndexOf$4(array, key) {
18738
+ var length = array.length;
18739
+ while (length--) {
18740
+ if (eq(array[length][0], key)) {
18741
+ return length;
18742
+ }
18743
+ }
18744
+ return -1;
18745
+ }
18746
+ var _assocIndexOf = assocIndexOf$4;
18747
+ var assocIndexOf$3 = _assocIndexOf;
18748
+ var arrayProto = Array.prototype;
18749
+ var splice = arrayProto.splice;
18750
+ function listCacheDelete$1(key) {
18751
+ var data = this.__data__, index = assocIndexOf$3(data, key);
18752
+ if (index < 0) {
18753
+ return false;
18754
+ }
18755
+ var lastIndex = data.length - 1;
18756
+ if (index == lastIndex) {
18757
+ data.pop();
18758
+ } else {
18759
+ splice.call(data, index, 1);
18760
+ }
18761
+ --this.size;
18762
+ return true;
18763
+ }
18764
+ var _listCacheDelete = listCacheDelete$1;
18765
+ var assocIndexOf$2 = _assocIndexOf;
18766
+ function listCacheGet$1(key) {
18767
+ var data = this.__data__, index = assocIndexOf$2(data, key);
18768
+ return index < 0 ? void 0 : data[index][1];
18769
+ }
18770
+ var _listCacheGet = listCacheGet$1;
18771
+ var assocIndexOf$1 = _assocIndexOf;
18772
+ function listCacheHas$1(key) {
18773
+ return assocIndexOf$1(this.__data__, key) > -1;
18774
+ }
18775
+ var _listCacheHas = listCacheHas$1;
18776
+ var assocIndexOf = _assocIndexOf;
18777
+ function listCacheSet$1(key, value) {
18778
+ var data = this.__data__, index = assocIndexOf(data, key);
18779
+ if (index < 0) {
18780
+ ++this.size;
18781
+ data.push([key, value]);
18782
+ } else {
18783
+ data[index][1] = value;
18784
+ }
18785
+ return this;
18786
+ }
18787
+ var _listCacheSet = listCacheSet$1;
18788
+ var listCacheClear = _listCacheClear, listCacheDelete = _listCacheDelete, listCacheGet = _listCacheGet, listCacheHas = _listCacheHas, listCacheSet = _listCacheSet;
18789
+ function ListCache$1(entries) {
18790
+ var index = -1, length = entries == null ? 0 : entries.length;
18791
+ this.clear();
18792
+ while (++index < length) {
18793
+ var entry = entries[index];
18794
+ this.set(entry[0], entry[1]);
18795
+ }
18796
+ }
18797
+ ListCache$1.prototype.clear = listCacheClear;
18798
+ ListCache$1.prototype["delete"] = listCacheDelete;
18799
+ ListCache$1.prototype.get = listCacheGet;
18800
+ ListCache$1.prototype.has = listCacheHas;
18801
+ ListCache$1.prototype.set = listCacheSet;
18802
+ var _ListCache = ListCache$1;
18803
+ var getNative = _getNative, root = _root;
18804
+ var Map$1 = getNative(root, "Map");
18805
+ var _Map = Map$1;
18806
+ var Hash = _Hash, ListCache = _ListCache, Map = _Map;
18807
+ function mapCacheClear$1() {
18808
+ this.size = 0;
18809
+ this.__data__ = {
18810
+ "hash": new Hash(),
18811
+ "map": new (Map || ListCache)(),
18812
+ "string": new Hash()
18813
+ };
18814
+ }
18815
+ var _mapCacheClear = mapCacheClear$1;
18816
+ function isKeyable$1(value) {
18817
+ var type = typeof value;
18818
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
18819
+ }
18820
+ var _isKeyable = isKeyable$1;
18821
+ var isKeyable = _isKeyable;
18822
+ function getMapData$4(map, key) {
18823
+ var data = map.__data__;
18824
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
18825
+ }
18826
+ var _getMapData = getMapData$4;
18827
+ var getMapData$3 = _getMapData;
18828
+ function mapCacheDelete$1(key) {
18829
+ var result = getMapData$3(this, key)["delete"](key);
18830
+ this.size -= result ? 1 : 0;
18831
+ return result;
18832
+ }
18833
+ var _mapCacheDelete = mapCacheDelete$1;
18834
+ var getMapData$2 = _getMapData;
18835
+ function mapCacheGet$1(key) {
18836
+ return getMapData$2(this, key).get(key);
18837
+ }
18838
+ var _mapCacheGet = mapCacheGet$1;
18839
+ var getMapData$1 = _getMapData;
18840
+ function mapCacheHas$1(key) {
18841
+ return getMapData$1(this, key).has(key);
18842
+ }
18843
+ var _mapCacheHas = mapCacheHas$1;
18844
+ var getMapData = _getMapData;
18845
+ function mapCacheSet$1(key, value) {
18846
+ var data = getMapData(this, key), size = data.size;
18847
+ data.set(key, value);
18848
+ this.size += data.size == size ? 0 : 1;
18849
+ return this;
18850
+ }
18851
+ var _mapCacheSet = mapCacheSet$1;
18852
+ var mapCacheClear = _mapCacheClear, mapCacheDelete = _mapCacheDelete, mapCacheGet = _mapCacheGet, mapCacheHas = _mapCacheHas, mapCacheSet = _mapCacheSet;
18853
+ function MapCache$1(entries) {
18854
+ var index = -1, length = entries == null ? 0 : entries.length;
18855
+ this.clear();
18856
+ while (++index < length) {
18857
+ var entry = entries[index];
18858
+ this.set(entry[0], entry[1]);
18859
+ }
18860
+ }
18861
+ MapCache$1.prototype.clear = mapCacheClear;
18862
+ MapCache$1.prototype["delete"] = mapCacheDelete;
18863
+ MapCache$1.prototype.get = mapCacheGet;
18864
+ MapCache$1.prototype.has = mapCacheHas;
18865
+ MapCache$1.prototype.set = mapCacheSet;
18866
+ var _MapCache = MapCache$1;
18867
+ var MapCache = _MapCache;
18868
+ var FUNC_ERROR_TEXT = "Expected a function";
18869
+ function memoize(func, resolver) {
18870
+ if (typeof func != "function" || resolver != null && typeof resolver != "function") {
18871
+ throw new TypeError(FUNC_ERROR_TEXT);
18872
+ }
18873
+ var memoized = function() {
18874
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
18875
+ if (cache.has(key)) {
18876
+ return cache.get(key);
18877
+ }
18878
+ var result = func.apply(this, args);
18879
+ memoized.cache = cache.set(key, result) || cache;
18880
+ return result;
18881
+ };
18882
+ memoized.cache = new (memoize.Cache || MapCache)();
18883
+ return memoized;
18884
+ }
18885
+ memoize.Cache = MapCache;
18886
+ var memoize_1 = memoize;
18887
+ const memoize$1 = /* @__PURE__ */ getDefaultExportFromCjs(memoize_1);
18888
+ const serviceName = "teach";
18889
+ class TCourse {
18890
+ constructor(props) {
18891
+ __publicField(this, "request");
18892
+ __publicField(this, "config");
18893
+ __publicField(this, "getCourseRelativeInfo1", memoize$1(
18894
+ async (courseId) => {
18895
+ const { data } = await this.request.cdn.cdnAPI.get(
18896
+ `/${this.config.serviceName["t-course"]}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
18897
+ );
18898
+ const { data: provider } = await this.request.cdn.cdnAPI.get(
18899
+ `/${serviceName}/s_course/v2/business_courses/${courseId}/course_providers.json`
18900
+ );
18901
+ if (data.course_detail && (provider == null ? void 0 : provider.length)) {
18902
+ data.course_detail.ext_info = {
18903
+ ...data.course_detail.ext_info,
18904
+ source: provider.map((item) => item.name).join("/")
18905
+ };
18906
+ }
18907
+ return data;
18908
+ },
18909
+ (courseId) => `CourseRelativeInfo_${courseId}`
18910
+ ));
18911
+ __publicField(this, "getCourseRelativeInfo", async ({
18912
+ courseId,
18913
+ tenantCode
18914
+ }) => {
18915
+ const { data } = await this.request.cdn.cdnAPI.get(`/${tenantCode}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`);
18916
+ return data;
18917
+ });
18918
+ __publicField(this, "getAreaCourseRelativeInfo", memoize$1(
18919
+ async ({ courseId, siteRelaId }) => {
18920
+ const { data } = await this.request.cdn.cdnAPI.get(
18921
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_relative_infos/zh-CN.json`
18922
+ );
18923
+ const { data: provider } = await this.request.cdn.cdnAPI.get(
18924
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/business_courses/${courseId}/course_providers.json`
18925
+ );
18926
+ if (data.course_detail && (provider == null ? void 0 : provider.length)) {
18927
+ data.course_detail.ext_info = {
18928
+ ...data.course_detail.ext_info,
18929
+ source: provider.map((item) => item.name).join("/")
18930
+ };
18931
+ }
18932
+ return data;
18933
+ },
18934
+ ({ courseId }) => `Area-CourseRelativeInfo_${courseId}`
18935
+ ));
18936
+ /**
18937
+ * 获取活动集信息, 包括了章节目录信息
18938
+ *
18939
+ * @export
18940
+ * @param {string} activitySetId
18941
+ * @returns 课程的活动集信息, nodes字段中包含活动节点信息
18942
+ */
18943
+ __publicField(this, "getActiveSet", async ({
18944
+ activitySetId,
18945
+ tenantCode
18946
+ }) => {
18947
+ const { data } = await this.request.cdn.cdnAPI.get(
18948
+ `/${tenantCode}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
18949
+ );
18950
+ if (data) {
18951
+ data.activity_set_id = activitySetId;
18952
+ }
18953
+ return data;
18954
+ });
18955
+ __publicField(this, "getAreaActiveSet", async ({ activitySetId, siteRelaId }) => {
18956
+ const { data } = await this.request.cdn.cdnAPI.get(
18957
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v2/activity_sets/${activitySetId}/fulls.json`
18958
+ );
18959
+ if (data) {
18960
+ data.activity_set_id = activitySetId;
18961
+ }
18962
+ return data;
18963
+ });
18964
+ // 获取视频活动课时
18965
+ __publicField(this, "getVideoActivity", async ({ activityId, siteRelaId }) => {
18966
+ const { data } = await this.request.cdn.cdnAPI.get(
18967
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/video_activity/${activityId}.json`
18968
+ );
18969
+ return data;
18970
+ });
18971
+ // 获取文档活动课时
18972
+ __publicField(this, "getDocumentActivity", async ({ activityId, siteRelaId }) => {
18973
+ const { data } = await this.request.cdn.cdnAPI.get(
18974
+ `/${this.config.serviceName.zxxRegion}/${siteRelaId}/s_course/v1/document_activity/${activityId}.json`
18975
+ );
18976
+ return data;
18977
+ });
18978
+ const { request, config: config2 } = props;
18979
+ this.request = request;
18980
+ this.config = config2;
18981
+ }
18982
+ }
18983
+ function sha256(_x) {
18984
+ return _sha.apply(this, arguments);
18985
+ }
18986
+ function _sha() {
18987
+ _sha = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(str) {
18988
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
18989
+ while (1)
18990
+ switch (_context.prev = _context.next) {
18991
+ case 0:
18992
+ return _context.abrupt("return", window.crypto.subtle.digest("SHA-256", new TextEncoder().encode(str)).then(hex));
18993
+ case 1:
18994
+ case "end":
18995
+ return _context.stop();
18996
+ }
18997
+ }, _callee);
18998
+ }));
18999
+ return _sha.apply(this, arguments);
19000
+ }
19001
+ function hex(buffer) {
19002
+ return Array.prototype.map.call(new Uint8Array(buffer), function(b) {
19003
+ return `00${b.toString(16)}`.slice(-2);
19004
+ }).join("");
19005
+ }
19006
+ async function getRequestURL(params) {
19007
+ const { apiURL, language = "zh-CN", serviceName: serviceName2, sdpAppId, sdpOrgId } = params;
19008
+ const component = "auxo_channel_api";
19009
+ const [urlPath, qs] = apiURL.split("?");
19010
+ const hashCode = await sha256(`${urlPath}?${qs}`);
19011
+ const hashPath = `${urlPath}/${hashCode}.json`;
19012
+ return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
19013
+ }
19014
+ class Channel {
19015
+ constructor(props) {
19016
+ __publicField(this, "request");
19017
+ /* 获取频道列表
19018
+ scope: 'default' 默认频道
19019
+ scope: 'teach_training' 学习强师的频道
19020
+ */
19021
+ __publicField(this, "getChannelList", async ({
19022
+ scope,
19023
+ language = "zh-CN",
19024
+ sdpAppId,
19025
+ sdpOrgId,
19026
+ serviceName: serviceName2,
19027
+ api: api2 = this.request.cdn.cdnAPI
19028
+ }) => {
19029
+ const requestURL = await getRequestURL({
19030
+ apiURL: `/v1/app/channels?language=zh-CN&scope=${scope}`,
19031
+ language,
19032
+ serviceName: serviceName2,
19033
+ sdpAppId,
19034
+ sdpOrgId
19035
+ });
19036
+ const { data } = await api2.get(requestURL);
19037
+ return data;
19038
+ });
19039
+ /* 获取频道板块信息 */
19040
+ __publicField(this, "getChannelSectionList", async ({ channelId, serviceName: serviceName2, sdpAppId, sdpOrgId, api: api2 = this.request.cdn.cdnBdcsFileAPI }) => {
19041
+ const requestURL = await getRequestURL({
19042
+ apiURL: `/v2/channels/${channelId}/sections?query_type=0`,
19043
+ serviceName: serviceName2,
19044
+ sdpAppId,
19045
+ sdpOrgId
19046
+ });
19047
+ const { data } = await api2.get(requestURL);
19048
+ return data;
19049
+ });
19050
+ const { request } = props;
19051
+ this.request = request;
19052
+ }
19053
+ }
19054
+ class ElearningTrain {
19055
+ constructor(props) {
19056
+ __publicField(this, "request");
19057
+ __publicField(this, "getTrainDetailStatic", async (trainId) => {
19058
+ try {
19059
+ const requestURL = `/teach/api_static/trains/${trainId}.json`;
19060
+ const { data } = await this.request.cdn.cdnAPI.get(requestURL);
19061
+ return data;
19062
+ } catch (_2) {
19063
+ return {};
19064
+ }
19065
+ });
19066
+ const { request } = props;
19067
+ this.request = request;
19068
+ }
19069
+ }
19070
+ class SiteConfig {
19071
+ constructor(props) {
19072
+ __publicField(this, "request");
19073
+ __publicField(this, "config");
19074
+ __publicField(this, "getSiteConfig", memoize$1(
19075
+ async () => {
19076
+ try {
19077
+ const { data } = await this.request.siteConfig.siteConfigAPI.get("/web_config.json");
19078
+ return data;
19079
+ } catch {
19080
+ return {};
19081
+ }
19082
+ },
19083
+ () => "web_config"
19084
+ ));
19085
+ __publicField(this, "getAreaSites", memoize$1(
19086
+ async () => {
19087
+ const requestURL = `/${this.config.serviceName.site}/sites/sitelist.json`;
19088
+ const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
19089
+ return data;
19090
+ },
19091
+ () => "AreaSites"
19092
+ ));
19093
+ __publicField(this, "getSiteCode", async () => {
19094
+ let siteCode = window.location.pathname.split("/")[1];
19095
+ const skipAreaSiteList = window.location.search.includes("_skip_area_sitelist=1") || window.isPreview;
19096
+ if (skipAreaSiteList) {
19097
+ return siteCode;
19098
+ }
19099
+ const areaSites = await this.getAreaSites();
19100
+ let areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
19101
+ if (areaSite) {
19102
+ return areaSite.code;
19103
+ }
19104
+ siteCode = window.location.hostname.split(".")[0];
19105
+ areaSite = areaSites.find((t2) => t2.domain === siteCode || t2.code === siteCode);
19106
+ if (areaSite) {
19107
+ return areaSite.code;
19108
+ }
19109
+ return this.config.defaultAreaSite;
19110
+ });
19111
+ __publicField(this, "getSiteInfo", async (siteCode) => {
19112
+ const _siteCode = siteCode || await this.getSiteCode();
19113
+ const requestURL = `/${this.config.serviceName.site}/sites/${_siteCode}/site.json`;
19114
+ const { data } = await this.request.cdn.cdnBdcsFileAPI.get(requestURL);
19115
+ data.isHn = data.code === "hn";
19116
+ return data;
19117
+ });
19118
+ const { request, config: config2 } = props;
19119
+ this.request = request;
19120
+ this.config = config2;
19121
+ }
19122
+ }
19123
+ function converToTag(node) {
19124
+ return {
19125
+ tag_group_code: node.code,
19126
+ tag_group_name: node.next_level_name,
19127
+ tags: node.children.length === 0 ? [] : node.children.map((n2) => ({
19128
+ tag_name: n2.title,
19129
+ tag_id: n2.id,
19130
+ tag_code: n2.code,
19131
+ children: [converToTag(n2)]
19132
+ }))
19133
+ };
19134
+ }
19135
+ class Library {
19136
+ constructor(props) {
19137
+ __publicField(this, "request");
19138
+ __publicField(this, "config");
19139
+ __publicField(this, "getLibraryDynamicData", async ({ libraryId, sdpOrgId }) => {
19140
+ const getData = async ({ pageNo: pageNo2, pageSize: pageSize2 }) => {
19141
+ const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
19142
+ `/v1/libraries/${libraryId}/contents/actions/search/adapter`,
19143
+ {
19144
+ params: {
19145
+ page_no: pageNo2,
19146
+ page_size: pageSize2,
19147
+ sort_type: 3
19148
+ },
19149
+ headers: {
19150
+ "sdp-org-id": sdpOrgId
19151
+ }
19152
+ }
19153
+ );
19154
+ return data;
19155
+ };
19156
+ let pageNo = 0;
19157
+ const pageSize = 20;
19158
+ const libraryData = await getData({ pageNo, pageSize });
19159
+ const { total = 0 } = libraryData || {};
19160
+ const pageCount = Math.ceil(total / pageSize);
19161
+ let allData = libraryData.items;
19162
+ for (let i = 1; i < pageCount; i++) {
19163
+ pageNo = i;
19164
+ const data = await getData({ pageNo, pageSize });
19165
+ allData = allData.concat(data.items);
19166
+ }
19167
+ return allData;
19168
+ });
19169
+ __publicField(this, "getRequestURL", async ({ apiURL, language = "zh-CN", serviceName: serviceName2, sdpOrgId, sdpAppId }) => {
19170
+ const component = "elearning_library";
19171
+ const [urlPath, qs] = apiURL.split("?");
19172
+ const hashCode = await sha256(`${urlPath}?${qs}`);
19173
+ const hashPath = `${urlPath}/${hashCode}.json`;
19174
+ return `/${serviceName2}/api/${language}/${sdpAppId}${sdpOrgId ? `/${sdpOrgId}` : ""}/${component}${hashPath}`;
19175
+ });
19176
+ /* 获取所有内容库*/
19177
+ __publicField(this, "getLibraryContentListAll", memoize$1(
19178
+ async ({ libraryId, sdpOrgId, sdpAppId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
19179
+ if (!libraryId) {
19180
+ return [];
19181
+ }
19182
+ if (window.isPreview) {
19183
+ try {
19184
+ const dynamicData = await this.getLibraryDynamicData({ libraryId, sdpOrgId });
19185
+ return dynamicData;
19186
+ } catch (e2) {
19187
+ }
19188
+ }
19189
+ const requestURL = await this.getRequestURL({
19190
+ apiURL: `/v1/libraries/${libraryId}/contents/actions/full/adapter?sort_type=3`,
19191
+ serviceName: serviceName2,
19192
+ sdpAppId,
19193
+ sdpOrgId
19194
+ });
19195
+ const { data } = await api2.get(requestURL);
19196
+ if (data.files.length) {
19197
+ const pageDataArray = await Promise.all(
19198
+ data.files.map(async (fileUrl) => {
19199
+ const { data: result } = await api2.get(fileUrl);
19200
+ return result;
19201
+ })
19202
+ );
19203
+ let allData = [];
19204
+ pageDataArray.forEach((pageData) => {
19205
+ allData = allData.concat(pageData);
19206
+ });
19207
+ return allData;
19208
+ } else {
19209
+ return [];
19210
+ }
19211
+ },
19212
+ ({ libraryId, extraParams }) => `LibraryContentListAll_${libraryId}_${extraParams}`
19213
+ ));
19214
+ /* 获取内容库所有资源 */
19215
+ __publicField(this, "getLibraryContentByUnitId", async ({ libraryId, unitId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 }) => {
19216
+ if (!libraryId || !unitId) {
19217
+ return {};
19218
+ }
19219
+ const data = await this.getLibraryContentListAll({
19220
+ libraryId,
19221
+ sdpAppId,
19222
+ sdpOrgId,
19223
+ serviceName: serviceName2,
19224
+ api: api2
19225
+ });
19226
+ return data.find((item) => item.unit_id === unitId) || {};
19227
+ });
19228
+ __publicField(this, "getDynamicCatalogs", async ({ libraryId, sdpOrgId }) => {
19229
+ const { data } = await this.request.elearningLibrary.eLearningLibraryAPI.get(
19230
+ `/v1/catalogs/libraries/${libraryId}`,
19231
+ {
19232
+ params: {
19233
+ all: true
19234
+ },
19235
+ headers: {
19236
+ "sdp-org-id": sdpOrgId ? sdpOrgId ?? "" : ""
19237
+ }
19238
+ }
19239
+ );
19240
+ return data;
19241
+ });
19242
+ /* 获取内容库所有标签 */
19243
+ __publicField(this, "getLibraryCatalogs", memoize$1(
19244
+ async ({ libraryId, sdpAppId, sdpOrgId, serviceName: serviceName2, api: api2 = this.request.cdn.cdnAPI }) => {
19245
+ if (!libraryId) {
19246
+ return [];
19247
+ }
19248
+ const requestURL = await this.getRequestURL({
19249
+ apiURL: `/v1/catalogs/libraries/${libraryId}?all=true`,
19250
+ serviceName: serviceName2,
19251
+ sdpAppId,
19252
+ sdpOrgId
19253
+ });
19254
+ try {
19255
+ let data;
19256
+ if (window.isPreview) {
19257
+ try {
19258
+ data = await this.getDynamicCatalogs(libraryId);
19259
+ } catch (e2) {
19260
+ }
19261
+ }
19262
+ if (!data) {
19263
+ const response = await api2.get(requestURL);
19264
+ data = response.data;
19265
+ }
19266
+ if (data) {
19267
+ const root2 = converToTag(data);
19268
+ return root2;
19269
+ }
19270
+ return {};
19271
+ } catch (e2) {
19272
+ console.error(e2);
19273
+ return {};
19274
+ }
19275
+ },
19276
+ ({ libraryId }) => `LibraryCatalogs_${libraryId}`
19277
+ ));
19278
+ const { request, config: config2 } = props;
19279
+ this.request = request;
19280
+ this.config = config2;
19281
+ }
19282
+ }
18441
19283
  const _Service = class _Service {
18442
19284
  constructor(props) {
18443
19285
  __publicField(this, "env");
@@ -18451,10 +19293,12 @@ var __publicField = (obj, key, value) => {
18451
19293
  __publicField(this, "recommend");
18452
19294
  // 推荐相关接口
18453
19295
  __publicField(this, "sdpAppId");
19296
+ __publicField(this, "config");
18454
19297
  var _a2, _b2;
18455
19298
  const { uc } = props;
18456
19299
  this.uc = uc;
18457
19300
  this.env = (_a2 = uc.options) == null ? void 0 : _a2.env;
19301
+ this.config = config[this.env];
18458
19302
  this.sdpAppId = (_b2 = uc.options) == null ? void 0 : _b2.sdpAppId;
18459
19303
  this.rawAPI = api;
18460
19304
  this.init();
@@ -18471,43 +19315,73 @@ var __publicField = (obj, key, value) => {
18471
19315
  this.uc = ucInstance;
18472
19316
  this.init();
18473
19317
  }
19318
+ initSingleRequest(requestFn) {
19319
+ return requestFn({ uc: this.uc, env: this.env });
19320
+ }
18474
19321
  init() {
18475
- this.request = {
19322
+ const requests = {
18476
19323
  recommend: {
18477
- recommendAPIV2: recommendAPIV2({ uc: this.uc, env: this.env })
19324
+ recommendAPIV2
18478
19325
  },
18479
19326
  xProxy: {
18480
- xProxyCloudAPI: xProxyCloudAPI({ env: this.env, uc: this.uc }),
18481
- xProxyAssessmentAPI: xProxyAssessmentAPI({ env: this.env, uc: this.uc }),
18482
- xProxyRecommendAPI: xProxyRecommendAPI({ env: this.env, uc: this.uc })
19327
+ xProxyCloudAPI,
19328
+ xProxyAssessmentAPI,
19329
+ xProxyRecommendAPI
18483
19330
  },
18484
19331
  assessment: {
18485
- assessmentAPI: assessmentAPI({ env: this.env, uc: this.uc })
19332
+ assessmentAPI
18486
19333
  },
18487
19334
  xCloudWeb: {
18488
- xCloudWebAPI: xCloudWebAPI({ uc: this.uc, env: this.env })
19335
+ xCloudWebAPI
18489
19336
  },
18490
19337
  xFeedback: {
18491
- xFeddbackCommonAPI: xFeddbackCommonAPI({ uc: this.uc, env: this.env }),
18492
- xFeddbackAuthAPI: xFeddbackAuthAPI({ uc: this.uc, env: this.env })
19338
+ xFeddbackCommonAPI,
19339
+ xFeddbackAuthAPI
18493
19340
  },
18494
19341
  favorite: {
18495
- favoriteCommonAPI: favoriteCommonAPI({ uc: this.uc, env: this.env }),
18496
- favoriteAuthAPI: favoriteAuthAPI({ uc: this.uc, env: this.env }),
18497
- favoriteAuthAPIWithError: favoriteAuthAPIWithError({ uc: this.uc, env: this.env })
19342
+ favoriteCommonAPI,
19343
+ favoriteAuthAPI,
19344
+ favoriteAuthAPIWithError
18498
19345
  },
18499
19346
  xStudyRecord: {
18500
- xStudyRecordAPI: xStudyRecordAPI({ uc: this.uc, env: this.env })
19347
+ xStudyRecordAPI
19348
+ },
19349
+ cdn: {
19350
+ cdnAPI,
19351
+ cdnBdcsFileAPI,
19352
+ cdnSFileAPI
19353
+ },
19354
+ siteConfig: {
19355
+ siteConfigAPI
19356
+ },
19357
+ elearningLibrary: {
19358
+ eLearningLibraryAPI
18501
19359
  }
18502
19360
  };
18503
- this.service = {
18504
- stat: new Stat({ request: this.request }),
18505
- assessment: new Assessment({ request: this.request }),
18506
- like: new Like({ request: this.request }),
18507
- feedback: new Feedback({ request: this.request }),
18508
- favorite: new Favorite({ request: this.request }),
18509
- studyRecord: new StudyRecord({ request: this.request })
19361
+ this.request = {};
19362
+ Object.keys(requests).forEach((key) => {
19363
+ this.request[key] = {};
19364
+ Object.keys(requests[key]).forEach((subKey) => {
19365
+ this.request[key][subKey] = this.initSingleRequest(requests[key][subKey]);
19366
+ });
19367
+ });
19368
+ const services = {
19369
+ stat: Stat,
19370
+ assessment: Assessment,
19371
+ like: Like,
19372
+ feedback: Feedback,
19373
+ favorite: Favorite,
19374
+ studyRecord: StudyRecord,
19375
+ tCourse: TCourse,
19376
+ channel: Channel,
19377
+ elearningTrain: ElearningTrain,
19378
+ siteConfig: SiteConfig,
19379
+ library: Library
18510
19380
  };
19381
+ this.service = {};
19382
+ Object.keys(services).forEach((key) => {
19383
+ this.service[key] = new services[key]({ request: this.request, config: this.config });
19384
+ });
18511
19385
  }
18512
19386
  };
18513
19387
  __publicField(_Service, "instance");