@das-fed/upf-utils 6.4.0-dev.176 → 6.4.0-dev.178

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.
Files changed (64) hide show
  1. package/api-services/es5.js +1 -1
  2. package/api-services/modules/app-manage/es5.js +793 -795
  3. package/api-services/modules/app-manage/index.js +614 -618
  4. package/api-services/modules/app-manage/index.js.gz +0 -0
  5. package/api-services/modules/authentication/es5.js +981 -969
  6. package/api-services/modules/authentication/index.js +804 -786
  7. package/api-services/modules/authentication/index.js.gz +0 -0
  8. package/api-services/modules/bems/es5.js +997 -985
  9. package/api-services/modules/bems/index.js +818 -800
  10. package/api-services/modules/bems/index.js.gz +0 -0
  11. package/api-services/modules/contract/es5.js +981 -969
  12. package/api-services/modules/contract/index.js +804 -786
  13. package/api-services/modules/contract/index.js.gz +0 -0
  14. package/api-services/modules/duty-manage/es5.js +993 -981
  15. package/api-services/modules/duty-manage/index.js +817 -799
  16. package/api-services/modules/duty-manage/index.js.gz +0 -0
  17. package/api-services/modules/enterpriseright/es5.js +1 -1
  18. package/api-services/modules/es5.js +1176 -1188
  19. package/api-services/modules/file/es5.js +1 -1
  20. package/api-services/modules/gateway-edge/es5.js +969 -981
  21. package/api-services/modules/gateway-edge/index.js +786 -804
  22. package/api-services/modules/gateway-edge/index.js.gz +0 -0
  23. package/api-services/modules/index.js +928 -946
  24. package/api-services/modules/index.js.gz +0 -0
  25. package/api-services/modules/iot/es5.js +975 -963
  26. package/api-services/modules/iot/index.js +798 -780
  27. package/api-services/modules/iot/index.js.gz +0 -0
  28. package/api-services/modules/justauth/es5.js +981 -972
  29. package/api-services/modules/justauth/index.js +803 -789
  30. package/api-services/modules/justauth/index.js.gz +0 -0
  31. package/api-services/modules/knowledge/es5.js +979 -970
  32. package/api-services/modules/knowledge/index.js +802 -788
  33. package/api-services/modules/knowledge/index.js.gz +0 -0
  34. package/api-services/modules/link/es5.js +1 -1
  35. package/api-services/modules/permission/es5.js +981 -969
  36. package/api-services/modules/permission/index.js +804 -786
  37. package/api-services/modules/permission/index.js.gz +0 -0
  38. package/api-services/modules/platformManage/es5.js +1 -1
  39. package/api-services/modules/portal/es5.js +969 -981
  40. package/api-services/modules/portal/index.js +786 -804
  41. package/api-services/modules/portal/index.js.gz +0 -0
  42. package/api-services/modules/space-manage/es5.js +969 -981
  43. package/api-services/modules/space-manage/index.js +786 -804
  44. package/api-services/modules/space-manage/index.js.gz +0 -0
  45. package/api-services/modules/super-admin/es5.js +1 -1
  46. package/api-services/modules/supplier/es5.js +1 -1
  47. package/api-services/modules/supplychain-manage/es5.js +969 -981
  48. package/api-services/modules/supplychain-manage/index.js +786 -804
  49. package/api-services/modules/supplychain-manage/index.js.gz +0 -0
  50. package/api-services/modules/systemConfiguration/es5.js +981 -969
  51. package/api-services/modules/systemConfiguration/index.js +804 -786
  52. package/api-services/modules/systemConfiguration/index.js.gz +0 -0
  53. package/api-services/modules/tool/es5.js +979 -970
  54. package/api-services/modules/tool/index.js +802 -788
  55. package/api-services/modules/tool/index.js.gz +0 -0
  56. package/api-services/src/create-service/es5.js +979 -967
  57. package/api-services/src/create-service/index.js +803 -785
  58. package/api-services/src/create-service/index.js.gz +0 -0
  59. package/common-info/set-personal-info/es5.js +1 -1
  60. package/common-tools/handle-data/es5.js +253 -119
  61. package/common-tools/handle-data/index.js +99 -57
  62. package/common-tools/handle-data/index.js.gz +0 -0
  63. package/create-api-service/es5.js +1 -1
  64. package/package.json +4 -4
@@ -34,7 +34,7 @@ function _asyncGeneratorDelegate(t) { var e = {}, n = !1; function pump(e, r) {
34
34
  function _OverloadYield(e, d) { this.v = e, this.k = d; }
35
35
  function _asyncIterator(r) { var n, t, o, e = 2; for ("undefined" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) { if (t && null != (n = r[t])) return n.call(r); if (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r)); t = "@@asyncIterator", o = "@@iterator"; } throw new TypeError("Object is not async iterable"); }
36
36
  function AsyncFromSyncIterator(r) { function AsyncFromSyncIteratorContinuation(r) { if (Object(r) !== r) return Promise.reject(new TypeError(r + " is not an object.")); var n = r.done; return Promise.resolve(r.value).then(function (r) { return { value: r, done: n }; }); } return AsyncFromSyncIterator = function AsyncFromSyncIterator(r) { this.s = r, this.n = r.next; }, AsyncFromSyncIterator.prototype = { s: null, n: null, next: function next() { return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments)); }, "return": function _return(r) { var n = this.s["return"]; return void 0 === n ? Promise.resolve({ value: r, done: !0 }) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); }, "throw": function _throw(r) { var n = this.s["return"]; return void 0 === n ? Promise.reject(r) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments)); } }, new AsyncFromSyncIterator(r); }
37
- var index = require('@das-fed/upf-web/packages/i18n/index');
37
+ var index = require('@das-fed/upf-web/packages/i18n/es5');
38
38
  var commonInfo = require('@das-fed/upf-utils/common-info/es5');
39
39
  var config = require('@das-fed/upf-utils/config/es5');
40
40
  function Ce(e, t) {
@@ -1,171 +1,305 @@
1
1
  'use strict';
2
2
 
3
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
3
4
  function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
4
5
  function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }
5
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
6
6
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
7
7
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
8
8
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
9
9
  var config = require('@das-fed/upf-utils/config/es5');
10
- var m = function m(r) {
11
- return r === null || _typeof(r) > "u" || r === "";
10
+ var h = /* @__PURE__ */new Map(),
11
+ $ = /* @__PURE__ */new Map(),
12
+ S = 3e5,
13
+ b = function b(l) {
14
+ return l === null || _typeof(l) > "u" || l === "";
12
15
  },
13
- w = function w(r) {
14
- var t;
15
- return (((t = config.getConfig()) == null ? undefined : t.systemLangList) || []).includes(r);
16
+ z = function z(l) {
17
+ var e;
18
+ return (((e = config.getConfig()) == null ? undefined : e.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(l);
16
19
  },
17
- b = /*#__PURE__*/function () {
18
- var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(r) {
19
- var o, _o$currentLang, t, _o$baseUrl, a, _o$appName, l, _o$isPullBack, u, _o$isDasUI, $, _o$urlObj, n, _o$fallbackBaseUrl, e, i, y, f, s, _f, _s, _f2, _s2;
20
- return _regenerator().w(function (_context2) {
21
- while (1) switch (_context2.n) {
20
+ B = /*#__PURE__*/function () {
21
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(l) {
22
+ var y, _y$currentLang, e, _y$baseUrl, r, _y$appName, c, _y$isPullBack, _, _y$isDasUI, L, _y$urlObj, n, _y$fallbackBaseUrl, s, f, w, x, C, g, d, _g, _d;
23
+ return _regenerator().w(function (_context5) {
24
+ while (1) switch (_context5.n) {
22
25
  case 0:
23
- o = r || {};
24
- _o$currentLang = o.currentLang, t = _o$currentLang === void 0 ? "zh-CN" : _o$currentLang, _o$baseUrl = o.baseUrl, a = _o$baseUrl === void 0 ? "/" : _o$baseUrl, _o$appName = o.appName, l = _o$appName === void 0 ? "jc" : _o$appName, _o$isPullBack = o.isPullBack, u = _o$isPullBack === void 0 ? false : _o$isPullBack, _o$isDasUI = o.isDasUI, $ = _o$isDasUI === void 0 ? false : _o$isDasUI, _o$urlObj = o.urlObj, n = _o$urlObj === void 0 ? {
26
+ y = l || {};
27
+ _y$currentLang = y.currentLang, e = _y$currentLang === void 0 ? "zh-CN" : _y$currentLang, _y$baseUrl = y.baseUrl, r = _y$baseUrl === void 0 ? "/" : _y$baseUrl, _y$appName = y.appName, c = _y$appName === void 0 ? "jc" : _y$appName, _y$isPullBack = y.isPullBack, _ = _y$isPullBack === void 0 ? false : _y$isPullBack, _y$isDasUI = y.isDasUI, L = _y$isDasUI === void 0 ? false : _y$isDasUI, _y$urlObj = y.urlObj, n = _y$urlObj === void 0 ? {
25
28
  frontEndUrl: "",
26
29
  backEndUrl: "",
27
30
  dasUiUrl: ""
28
- } : _o$urlObj, _o$fallbackBaseUrl = o.fallbackBaseUrl, e = _o$fallbackBaseUrl === void 0 ? "" : _o$fallbackBaseUrl;
29
- (typeof t != "string" || !t) && (t = "zh-CN"), (typeof l != "string" || !l) && (l = "jc"), typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof e != "string" && (e = ""), e && !e.endsWith("/") && (e = e + "/");
30
- i = {
31
+ } : _y$urlObj, _y$fallbackBaseUrl = y.fallbackBaseUrl, s = _y$fallbackBaseUrl === void 0 ? "" : _y$fallbackBaseUrl;
32
+ (typeof e != "string" || !e) && (e = "zh-CN"), (typeof c != "string" || !c) && (c = "jc"), typeof r != "string" && (r = "/"), r || (r = "/"), r.endsWith("/") || (r = r + "/"), typeof s != "string" && (s = ""), s && !s.endsWith("/") && (s = s + "/");
33
+ f = {
31
34
  frontEnd: null,
32
35
  dasUiEnd: null,
33
36
  backMsg: null
34
37
  };
35
- y = /*#__PURE__*/function () {
36
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(f, s) {
37
- var E,
38
- g,
39
- p,
40
- _ref3,
41
- d,
42
- _ref4,
43
- U,
44
- _args = arguments,
45
- _t,
46
- _t2;
47
- return _regenerator().w(function (_context) {
48
- while (1) switch (_context.p = _context.n) {
38
+ w = /*#__PURE__*/function () {
39
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(g, d) {
40
+ var I,
41
+ F,
42
+ M,
43
+ D,
44
+ E,
45
+ k,
46
+ o,
47
+ _args4 = arguments;
48
+ return _regenerator().w(function (_context4) {
49
+ while (1) switch (_context4.n) {
49
50
  case 0:
50
- E = _args.length > 2 && _args[2] !== undefined ? _args[2] : "zh-CN";
51
- g = _args.length > 3 && _args[3] !== undefined ? _args[3] : "资源";
52
- p = window.importShim ? function (d) {
53
- return window.importShim(d);
54
- } : function (d) {
55
- return function (specifier) {
56
- return new Promise(function (r) {
57
- return r("".concat(specifier));
58
- }).then(function (s) {
59
- return _interopRequireWildcard(require(s));
60
- });
61
- }(/* @vite-ignore */
62
- d);
51
+ I = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : "zh-CN";
52
+ F = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : "资源";
53
+ M = /*#__PURE__*/function () {
54
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(o) {
55
+ var t, _t, _t2;
56
+ return _regenerator().w(function (_context) {
57
+ while (1) switch (_context.p = _context.n) {
58
+ case 0:
59
+ _context.p = 0;
60
+ if (!((typeof window === "undefined" ? "undefined" : _typeof(window)) < "u" && typeof window.fetch == "function")) {
61
+ _context.n = 5;
62
+ break;
63
+ }
64
+ _context.n = 1;
65
+ return window.fetch(o, {
66
+ cache: "no-cache"
67
+ });
68
+ case 1:
69
+ t = _context.v;
70
+ if (!(!t || !t.ok)) {
71
+ _context.n = 2;
72
+ break;
73
+ }
74
+ _t = null;
75
+ _context.n = 4;
76
+ break;
77
+ case 2:
78
+ _context.n = 3;
79
+ return t.text();
80
+ case 3:
81
+ _t = _context.v;
82
+ case 4:
83
+ return _context.a(2, _t);
84
+ case 5:
85
+ _context.n = 6;
86
+ return new Promise(function (t) {
87
+ try {
88
+ var a = new XMLHttpRequest();
89
+ a.open("GET", o, !0), a.onreadystatechange = function () {
90
+ a.readyState === 4 && t(a.status >= 200 && a.status < 300 ? a.responseText : null);
91
+ }, a.onerror = function () {
92
+ t(null);
93
+ }, a.send();
94
+ } catch (_unused) {
95
+ t(null);
96
+ }
97
+ });
98
+ case 6:
99
+ return _context.a(2, _context.v);
100
+ case 7:
101
+ _context.n = 9;
102
+ break;
103
+ case 8:
104
+ _context.p = 8;
105
+ _t2 = _context.v;
106
+ return _context.a(2, null);
107
+ case 9:
108
+ return _context.a(2);
109
+ }
110
+ }, _callee, null, [[0, 8]]);
111
+ }));
112
+ return function M(_x4) {
113
+ return _ref3.apply(this, arguments);
114
+ };
115
+ }();
116
+ D = function D(o) {
117
+ var t = (o || "").replace(/^\uFEFF/, "");
118
+ try {
119
+ var a = t.trim();
120
+ if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(a)) {
121
+ var i = a.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
122
+ var u = i.indexOf("{"),
123
+ p = i.lastIndexOf("}");
124
+ if (u !== -1 && p !== -1 && p > u) return i = i.slice(u, p + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
125
+ }
126
+ } catch (_unused3) {
127
+ return null;
128
+ }
63
129
  };
64
- _context.p = 1;
65
- _context.n = 2;
66
- return p("".concat(f));
130
+ E = /*#__PURE__*/function () {
131
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(o) {
132
+ var _i$value;
133
+ var t, a, i, u;
134
+ return _regenerator().w(function (_context3) {
135
+ while (1) switch (_context3.p = _context3.n) {
136
+ case 0:
137
+ if (o) {
138
+ _context3.n = 1;
139
+ break;
140
+ }
141
+ return _context3.a(2, null);
142
+ case 1:
143
+ t = o, a = Date.now(), i = $.get(t);
144
+ if (!(i && a - i.t <= S)) {
145
+ _context3.n = 2;
146
+ break;
147
+ }
148
+ return _context3.a(2, i.ok ? (_i$value = i.value) !== null && _i$value !== void 0 ? _i$value : null : null);
149
+ case 2:
150
+ if (!h.has(t)) {
151
+ _context3.n = 3;
152
+ break;
153
+ }
154
+ return _context3.a(2, h.get(t));
155
+ case 3:
156
+ u = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
157
+ var p, m;
158
+ return _regenerator().w(function (_context2) {
159
+ while (1) switch (_context2.n) {
160
+ case 0:
161
+ _context2.n = 1;
162
+ return M(t);
163
+ case 1:
164
+ p = _context2.v;
165
+ if (p) {
166
+ _context2.n = 2;
167
+ break;
168
+ }
169
+ return _context2.a(2, ($.set(t, {
170
+ ok: false,
171
+ value: null,
172
+ t: a
173
+ }), null));
174
+ case 2:
175
+ m = D(p);
176
+ return _context2.a(2, ($.set(t, {
177
+ ok: true,
178
+ value: m,
179
+ t: Date.now()
180
+ }), m !== null && m !== void 0 ? m : null));
181
+ }
182
+ }, _callee2);
183
+ }))();
184
+ h.set(t, u);
185
+ _context3.p = 4;
186
+ _context3.n = 5;
187
+ return u;
188
+ case 5:
189
+ return _context3.a(2, _context3.v);
190
+ case 6:
191
+ _context3.p = 6;
192
+ h["delete"](t);
193
+ return _context3.f(6);
194
+ case 7:
195
+ return _context3.a(2);
196
+ }
197
+ }, _callee3, null, [[4,, 6, 7]]);
198
+ }));
199
+ return function E(_x5) {
200
+ return _ref4.apply(this, arguments);
201
+ };
202
+ }();
203
+ _context4.n = 1;
204
+ return E(g);
205
+ case 1:
206
+ k = _context4.v;
207
+ if (!k) {
208
+ _context4.n = 2;
209
+ break;
210
+ }
211
+ return _context4.a(2, k);
67
212
  case 2:
68
- d = _context.v;
69
- return _context.a(2, (_ref3 = d == null ? void 0 : d["default"]) !== null && _ref3 !== void 0 ? _ref3 : null);
213
+ if (!(d && z(I))) {
214
+ _context4.n = 4;
215
+ break;
216
+ }
217
+ _context4.n = 3;
218
+ return E(d);
70
219
  case 3:
71
- _context.p = 3;
72
- _t = _context.v;
73
- if (!(s && w(E))) {
74
- _context.n = 7;
220
+ o = _context4.v;
221
+ if (!o) {
222
+ _context4.n = 4;
75
223
  break;
76
224
  }
77
- _context.p = 4;
78
- _context.n = 5;
79
- return p(/* @vite-ignore */"".concat(s));
80
- case 5:
81
- U = _context.v;
82
- return _context.a(2, (_ref4 = U == null ? void 0 : U["default"]) !== null && _ref4 !== void 0 ? _ref4 : null);
83
- case 6:
84
- _context.p = 6;
85
- _t2 = _context.v;
86
- case 7:
87
- return _context.a(2, null);
225
+ return _context4.a(2, o);
226
+ case 4:
227
+ return _context4.a(2, null);
88
228
  }
89
- }, _callee, null, [[4, 6], [1, 3]]);
229
+ }, _callee4);
90
230
  }));
91
- return function y(_x2, _x3) {
231
+ return function w(_x2, _x3) {
92
232
  return _ref2.apply(this, arguments);
93
233
  };
94
- }();
95
- if ($) {
96
- _context2.n = 2;
97
- break;
98
- }
99
- f = (n == null ? undefined : n.frontEndUrl) || "".concat(a, "web-front-end/i18n/").concat(l, "_").concat(t, ".js");
100
- s = !(n != null && n.frontEndUrl) && e ? "".concat(e, "web-front-end/i18n/").concat(l, "_").concat(t, ".js") : undefined;
101
- _context2.n = 1;
102
- return y(f, s, t, "前端业务语言资源");
234
+ }(), x = (n == null ? undefined : n.frontEndUrl) || "".concat(r, "front-end/i18n/front-end-page/").concat(c, "_").concat(e, ".js");
235
+ C = !(n != null && n.frontEndUrl) && s ? "".concat(s, "front-end/i18n/front-end-page/").concat(c, "_").concat(e, ".js") : undefined;
236
+ _context5.n = 1;
237
+ return w(x, C, e, "前端业务语言资源");
103
238
  case 1:
104
- i.frontEnd = _context2.v;
105
- i.frontEnd && true;
106
- case 2:
107
- if (!(u && i.frontEnd || n != null && n.backEndUrl)) {
108
- _context2.n = 4;
239
+ f.frontEnd = _context5.v;
240
+ f.frontEnd && true;
241
+ if (!(_ && f.frontEnd || n != null && n.backEndUrl)) {
242
+ _context5.n = 3;
109
243
  break;
110
244
  }
111
- _f = (n == null ? undefined : n.backEndUrl) || "".concat(a, "web-back-end/i18n/").concat(l, "_").concat(t, ".js");
112
- _s = !(n != null && n.backEndUrl) && e ? "".concat(e, "web-back-end/i18n/").concat(l, "_").concat(t, ".js") : undefined;
113
- _context2.n = 3;
114
- return y(_f, _s, t, "后端语言资源");
245
+ g = (n == null ? undefined : n.backEndUrl) || "".concat(r, "front-end/i18n/return-msg/").concat(c, "_").concat(e, ".js");
246
+ d = !(n != null && n.backEndUrl) && s ? "".concat(s, "front-end/i18n/return-msg/").concat(c, "_").concat(e, ".js") : undefined;
247
+ _context5.n = 2;
248
+ return w(g, d, e, "后端语言资源");
249
+ case 2:
250
+ f.backMsg = _context5.v;
251
+ f.backMsg && true;
115
252
  case 3:
116
- i.backMsg = _context2.v;
117
- i.backMsg && true;
118
- case 4:
119
- if (!$) {
120
- _context2.n = 6;
253
+ if (!L) {
254
+ _context5.n = 5;
121
255
  break;
122
256
  }
123
- _f2 = (n == null ? undefined : n.dasUiUrl) || "".concat(a, "web-front-end/i18n/dasui_").concat(t, ".js");
124
- _s2 = !(n != null && n.dasUiUrl) && e ? "".concat(e, "web-front-end/i18n/dasui_").concat(t, ".js") : undefined;
125
- _context2.n = 5;
126
- return y(_f2, _s2, t, "UI组件库语言资源");
257
+ _g = (n == null ? undefined : n.dasUiUrl) || "".concat(r, "front-end/i18n/front-end-page/dasui_").concat(e, ".js");
258
+ _d = !(n != null && n.dasUiUrl) && s ? "".concat(s, "front-end/i18n/front-end-page/dasui_").concat(e, ".js") : undefined;
259
+ _context5.n = 4;
260
+ return w(_g, _d, e, "UI组件库语言资源");
261
+ case 4:
262
+ f.dasUiEnd = _context5.v;
263
+ f.dasUiEnd && true;
127
264
  case 5:
128
- i.dasUiEnd = _context2.v;
129
- i.dasUiEnd && true;
130
- case 6:
131
- return _context2.a(2, i);
265
+ return _context5.a(2, f);
132
266
  }
133
- }, _callee2);
267
+ }, _callee5);
134
268
  }));
135
- return function b(_x) {
269
+ return function B(_x) {
136
270
  return _ref.apply(this, arguments);
137
271
  };
138
272
  }(),
139
- L = /*#__PURE__*/function () {
140
- var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
141
- var r,
142
- o,
143
- a,
144
- _args3 = arguments;
145
- return _regenerator().w(function (_context3) {
146
- while (1) switch (_context3.n) {
273
+ P = /*#__PURE__*/function () {
274
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
275
+ var l,
276
+ y,
277
+ r,
278
+ _args6 = arguments;
279
+ return _regenerator().w(function (_context6) {
280
+ while (1) switch (_context6.n) {
147
281
  case 0:
148
- r = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : "front-end";
149
- o = {};
150
- _context3.n = 1;
282
+ l = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : "front-end";
283
+ y = {};
284
+ _context6.n = 1;
151
285
  return function (specifier) {
152
286
  return new Promise(function (r) {
153
287
  return r(specifier);
154
288
  }).then(function (s) {
155
289
  return _interopRequireWildcard(require(s));
156
290
  });
157
- }(/* @vite-ignore */"/i18n/".concat(r, "/global.js"));
291
+ }(/* @vite-ignore */"/i18n/".concat(l, "/global.js"));
158
292
  case 1:
159
- a = _context3.v;
160
- return _context3.a(2, (o = (a == null ? undefined : a["default"]) || {}, o));
293
+ r = _context6.v;
294
+ return _context6.a(2, (y = (r == null ? undefined : r["default"]) || {}, y));
161
295
  }
162
- }, _callee3);
296
+ }, _callee6);
163
297
  }));
164
- return function L() {
165
- return _ref5.apply(this, arguments);
298
+ return function P() {
299
+ return _ref6.apply(this, arguments);
166
300
  };
167
301
  }();
168
- exports.handleGlobalI18n = L;
169
- exports.handleI18nData = b;
170
- exports.isCurrentLangInSysLang = w;
171
- exports.isEmpty = m;
302
+ exports.handleGlobalI18n = P;
303
+ exports.handleI18nData = B;
304
+ exports.isCurrentLangInSysLang = z;
305
+ exports.isEmpty = b;
@@ -1,73 +1,115 @@
1
- import { getConfig as k } from "@das-fed/upf-utils/config";
2
- const m = (r) => r === null || typeof r > "u" || r === "", w = (r) => {
3
- var t;
4
- return (((t = k()) == null ? void 0 : t.systemLangList) || []).includes(r);
5
- }, b = async (r) => {
6
- const o = r || {};
1
+ import { getConfig as N } from "@das-fed/upf-utils/config";
2
+ const h = /* @__PURE__ */ new Map(), $ = /* @__PURE__ */ new Map(), S = 3e5, b = (l) => l === null || typeof l > "u" || l === "", z = (l) => {
3
+ var e;
4
+ return (((e = N()) == null ? void 0 : e.systemLangList) || ["zh-CN", "en-US", "zh-MO"]).includes(l);
5
+ }, B = async (l) => {
6
+ const y = l || {};
7
7
  let {
8
- currentLang: t = "zh-CN",
9
- baseUrl: a = "/",
10
- appName: l = "jc",
11
- isPullBack: u = !1,
12
- isDasUI: $ = !1,
8
+ currentLang: e = "zh-CN",
9
+ baseUrl: r = "/",
10
+ appName: c = "jc",
11
+ isPullBack: _ = !1,
12
+ isDasUI: L = !1,
13
13
  urlObj: n = { frontEndUrl: "", backEndUrl: "", dasUiUrl: "" },
14
14
  // 新增:当主地址加载失败时,用于针对失败项的本地回退地址
15
- fallbackBaseUrl: e = ""
16
- } = o;
17
- (typeof t != "string" || !t) && (t = "zh-CN"), (typeof l != "string" || !l) && (l = "jc"), typeof a != "string" && (a = "/"), a || (a = "/"), a.endsWith("/") || (a = a + "/"), typeof e != "string" && (e = ""), e && !e.endsWith("/") && (e = e + "/");
18
- const i = {
15
+ fallbackBaseUrl: s = ""
16
+ } = y;
17
+ (typeof e != "string" || !e) && (e = "zh-CN"), (typeof c != "string" || !c) && (c = "jc"), typeof r != "string" && (r = "/"), r || (r = "/"), r.endsWith("/") || (r = r + "/"), typeof s != "string" && (s = ""), s && !s.endsWith("/") && (s = s + "/");
18
+ const f = {
19
19
  frontEnd: null,
20
20
  dasUiEnd: null,
21
21
  backMsg: null
22
22
  };
23
- let c = !1;
24
- const y = async (f, s, E = "zh-CN", g = "资源") => {
25
- const p = window.importShim ? (d) => window.importShim(d) : (d) => import(
26
- /* @vite-ignore */
27
- d
28
- );
29
- try {
30
- const d = await p(`${f}`);
31
- return (d == null ? void 0 : d.default) ?? null;
32
- } catch {
33
- if (s && w(E))
34
- try {
35
- const U = await p(
36
- /* @vite-ignore */
37
- `${s}`
38
- );
39
- return (U == null ? void 0 : U.default) ?? null;
40
- } catch {
23
+ let U = !1;
24
+ const w = async (g, d, I = "zh-CN", F = "资源") => {
25
+ const M = async (o) => {
26
+ try {
27
+ if (typeof window < "u" && typeof window.fetch == "function") {
28
+ const t = await window.fetch(o, { cache: "no-cache" });
29
+ return !t || !t.ok ? null : await t.text();
30
+ } else
31
+ return await new Promise((t) => {
32
+ try {
33
+ const a = new XMLHttpRequest();
34
+ a.open("GET", o, !0), a.onreadystatechange = function() {
35
+ a.readyState === 4 && t(a.status >= 200 && a.status < 300 ? a.responseText : null);
36
+ }, a.onerror = function() {
37
+ t(null);
38
+ }, a.send();
39
+ } catch {
40
+ t(null);
41
+ }
42
+ });
43
+ } catch {
44
+ return null;
45
+ }
46
+ }, D = (o) => {
47
+ const t = (o || "").replace(/^\uFEFF/, "");
48
+ try {
49
+ const a = t.trim();
50
+ if (/^export\s+default\s*\{[\s\S]*\}\s*;?$/m.test(a)) {
51
+ let i = a.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(^|\n)\s*\/\/.*(?=\n|$)/g, "$1");
52
+ const u = i.indexOf("{"), p = i.lastIndexOf("}");
53
+ if (u !== -1 && p !== -1 && p > u)
54
+ return i = i.slice(u, p + 1), i = i.replace(/,\s*([}\]])/g, "$1"), JSON.parse(i);
41
55
  }
42
- return null;
56
+ } catch {
57
+ return null;
58
+ }
59
+ }, E = async (o) => {
60
+ if (!o) return null;
61
+ const t = o, a = Date.now(), i = $.get(t);
62
+ if (i && a - i.t <= S)
63
+ return i.ok ? i.value ?? null : null;
64
+ if (h.has(t)) return h.get(t);
65
+ const u = (async () => {
66
+ const p = await M(t);
67
+ if (!p)
68
+ return $.set(t, { ok: !1, value: null, t: a }), null;
69
+ const m = D(p);
70
+ return $.set(t, { ok: !0, value: m, t: Date.now() }), m ?? null;
71
+ })();
72
+ h.set(t, u);
73
+ try {
74
+ return await u;
75
+ } finally {
76
+ h.delete(t);
77
+ }
78
+ }, k = await E(g);
79
+ if (k) return k;
80
+ if (d && z(I)) {
81
+ const o = await E(d);
82
+ if (o) return o;
43
83
  }
44
- };
45
- if (!$) {
46
- const f = (n == null ? void 0 : n.frontEndUrl) || `${a}web-front-end/i18n/${l}_${t}.js`;
47
- let s = !(n != null && n.frontEndUrl) && e ? `${e}web-front-end/i18n/${l}_${t}.js` : void 0;
48
- i.frontEnd = await y(f, s, t, "前端业务语言资源"), i.frontEnd && (c = !0);
49
- }
50
- if (u && i.frontEnd || n != null && n.backEndUrl) {
51
- const f = (n == null ? void 0 : n.backEndUrl) || `${a}web-back-end/i18n/${l}_${t}.js`;
52
- let s = !(n != null && n.backEndUrl) && e ? `${e}web-back-end/i18n/${l}_${t}.js` : void 0;
53
- i.backMsg = await y(f, s, t, "后端语言资源"), i.backMsg && (c = !0);
84
+ return null;
85
+ }, x = (n == null ? void 0 : n.frontEndUrl) || `${r}front-end/i18n/front-end-page/${c}_${e}.js`;
86
+ let C = !(n != null && n.frontEndUrl) && s ? `${s}front-end/i18n/front-end-page/${c}_${e}.js` : void 0;
87
+ if (f.frontEnd = await w(
88
+ x,
89
+ C,
90
+ e,
91
+ "前端业务语言资源"
92
+ ), f.frontEnd && (U = !0), _ && f.frontEnd || n != null && n.backEndUrl) {
93
+ const g = (n == null ? void 0 : n.backEndUrl) || `${r}front-end/i18n/return-msg/${c}_${e}.js`;
94
+ let d = !(n != null && n.backEndUrl) && s ? `${s}front-end/i18n/return-msg/${c}_${e}.js` : void 0;
95
+ f.backMsg = await w(g, d, e, "后端语言资源"), f.backMsg && (U = !0);
54
96
  }
55
- if ($) {
56
- const f = (n == null ? void 0 : n.dasUiUrl) || `${a}web-front-end/i18n/dasui_${t}.js`;
57
- let s = !(n != null && n.dasUiUrl) && e ? `${e}web-front-end/i18n/dasui_${t}.js` : void 0;
58
- i.dasUiEnd = await y(f, s, t, "UI组件库语言资源"), i.dasUiEnd && (c = !0);
97
+ if (L) {
98
+ const g = (n == null ? void 0 : n.dasUiUrl) || `${r}front-end/i18n/front-end-page/dasui_${e}.js`;
99
+ let d = !(n != null && n.dasUiUrl) && s ? `${s}front-end/i18n/front-end-page/dasui_${e}.js` : void 0;
100
+ f.dasUiEnd = await w(g, d, e, "UI组件库语言资源"), f.dasUiEnd && (U = !0);
59
101
  }
60
- return i;
61
- }, L = async (r = "front-end") => {
62
- let o = {}, a = await import(
102
+ return f;
103
+ }, P = async (l = "front-end") => {
104
+ let y = {}, r = await import(
63
105
  /* @vite-ignore */
64
- `/i18n/${r}/global.js`
106
+ `/i18n/${l}/global.js`
65
107
  );
66
- return o = (a == null ? void 0 : a.default) || {}, o;
108
+ return y = (r == null ? void 0 : r.default) || {}, y;
67
109
  };
68
110
  export {
69
- L as handleGlobalI18n,
70
- b as handleI18nData,
71
- w as isCurrentLangInSysLang,
72
- m as isEmpty
111
+ P as handleGlobalI18n,
112
+ B as handleI18nData,
113
+ z as isCurrentLangInSysLang,
114
+ b as isEmpty
73
115
  };