@txgw/payout-components 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as __extends, l as __assign, n as __values, o as hooks, u as upperFirst, q as padStart, r as capitalize, t as escape, v as truncate, w as uniqBy, x as uniqWith, y as isEqual, z as get, A as isPlainObject, B as __awaiter, C as __generator, D as __read, E as __spreadArray, F as toFixed, G as groupBy, H as uniq, I as transform, J as template, K as isEmpty$2, L as startsWith, M as endsWith, N as isString, O as isObject$1, P as qs, Q as merge, S as isNaN$1, T as matchSorter, U as isNumber, V as isObservableArray, W as isObservable, X as compile, Y as last, Z as isAlive, $ as find, a0 as findIndex$1, a1 as types, a2 as getEnv, a3 as destroy, a4 as React__default, a5 as observer, a6 as reactDomExports, a7 as __decorate, a8 as observable, a9 as __metadata, aa as action, ab as reactExports, ac as cx, ad as autorun, ae as __rest, af as omit, ag as cloneDeep, ah as memoize, ai as findLastIndex, aj as flow, ak as debounce, al as throttle, am as flatten, an as pick, ao as toPairs, ap as getParent, aq as sortBy, ar as FileSaver_minExports, as as isEqualWith, at as reaction, au as addDisposer, av as setLivelinessChecking, aw as hoistNonReactStatic, ax as values, ay as InView, az as map, aA as kebabCase, aB as ReactDOM, aC as useRootClose, aD as Portal, aE as chunk, aF as mapValues, aG as camelCase, aH as uncontrollable$1, aI as toJS, aJ as CSSTransition, aK as difference$1, aL as reactIsExports, aM as keycode, aN as ENTERING, aO as ENTERED, aP as EXITING, aQ as Transition, aR as cjsExports, aS as EXITED, aT as isFunction, aU as Downshift$1, aV as extend, aW as each, aX as Sortable, aY as propTypesExports, aZ as comparer, a_ as range$1, a$ as keys, b0 as index$2, b1 as forEach, b2 as times, b3 as isInteger, b4 as intersectionWith, b5 as unionWith, b6 as includes, b7 as getMiniDecimal, b8 as InputNumber$1, b9 as getNumberPrecision, ba as chain, bb as intersection, bc as useForm, bd as FormProvider, be as Controller$1, bf as intersectionBy, bg as compact, bh as Circle, bi as useFieldArray, bj as useFormContext, bk as useFormState, bl as Draggable, bm as Item$1, bn as SubMenu$2, bo as MenuItemGroup, bp as Divider$2, bq as ExportMenu, br as SmoothSignature, bs as xor, bt as hotkeys, bu as getSnapshot, bv as observer$1, bw as useInView, bx as Dropzone, by as isNil, bz as accepts, bA as ErrorCode, bB as tinymce, bC as Froala, bD as omitBy, bE as pickBy, bF as partition, bG as inRange, bH as clone, bI as union, bJ as cjsExports$1, bK as assign, bL as libExports, bM as num2str, bN as update, bO as d, bP as SketchPicker, bQ as GithubPicker, bR as JsBarcode, bS as markdownIt, bT as libExports$1, bU as Document, bV as Page$2, bW as __webpack_exports__GlobalWorkerOptions } from "./vendor-
|
|
1
|
+
import { _ as __extends, l as __assign, n as __values, o as hooks, u as upperFirst, q as padStart, r as capitalize, t as escape, v as truncate, w as uniqBy, x as uniqWith, y as isEqual, z as get, A as isPlainObject, B as __awaiter, C as __generator, D as __read, E as __spreadArray, F as toFixed, G as groupBy, H as uniq, I as transform, J as template, K as isEmpty$2, L as startsWith, M as endsWith, N as isString, O as isObject$1, P as qs, Q as merge, S as isNaN$1, T as matchSorter, U as isNumber, V as isObservableArray, W as isObservable, X as compile, Y as last, Z as isAlive, $ as find, a0 as findIndex$1, a1 as types, a2 as getEnv, a3 as destroy, a4 as React__default, a5 as observer, a6 as reactDomExports, a7 as __decorate, a8 as observable, a9 as __metadata, aa as action, ab as reactExports, ac as cx, ad as autorun, ae as __rest, af as omit, ag as cloneDeep, ah as memoize, ai as findLastIndex, aj as flow, ak as debounce, al as throttle, am as flatten, an as pick, ao as toPairs, ap as getParent, aq as sortBy, ar as FileSaver_minExports, as as isEqualWith, at as reaction, au as addDisposer, av as setLivelinessChecking, aw as hoistNonReactStatic, ax as values, ay as InView, az as map, aA as kebabCase, aB as ReactDOM, aC as useRootClose, aD as Portal, aE as chunk, aF as mapValues, aG as camelCase, aH as uncontrollable$1, aI as toJS, aJ as CSSTransition, aK as difference$1, aL as reactIsExports, aM as keycode, aN as ENTERING, aO as ENTERED, aP as EXITING, aQ as Transition, aR as cjsExports, aS as EXITED, aT as isFunction, aU as Downshift$1, aV as extend, aW as each, aX as Sortable, aY as propTypesExports, aZ as comparer, a_ as range$1, a$ as keys, b0 as index$2, b1 as forEach, b2 as times, b3 as isInteger, b4 as intersectionWith, b5 as unionWith, b6 as includes, b7 as getMiniDecimal, b8 as InputNumber$1, b9 as getNumberPrecision, ba as chain, bb as intersection, bc as useForm, bd as FormProvider, be as Controller$1, bf as intersectionBy, bg as compact, bh as Circle, bi as useFieldArray, bj as useFormContext, bk as useFormState, bl as Draggable, bm as Item$1, bn as SubMenu$2, bo as MenuItemGroup, bp as Divider$2, bq as ExportMenu, br as SmoothSignature, bs as xor, bt as hotkeys, bu as getSnapshot, bv as observer$1, bw as useInView, bx as Dropzone, by as isNil, bz as accepts, bA as ErrorCode, bB as tinymce, bC as Froala, bD as omitBy, bE as pickBy, bF as partition, bG as inRange, bH as clone, bI as union, bJ as cjsExports$1, bK as assign, bL as libExports, bM as num2str, bN as update, bO as d, bP as SketchPicker, bQ as GithubPicker, bR as JsBarcode, bS as markdownIt, bT as libExports$1, bU as Document, bV as Page$2, bW as __webpack_exports__GlobalWorkerOptions } from "./vendor-DyrjuDU0.js";
|
|
2
2
|
var FormulaEvalError = (
|
|
3
3
|
/** @class */
|
|
4
4
|
(function(i) {
|
|
@@ -5245,7 +5245,7 @@ function position(i, a) {
|
|
|
5245
5245
|
});
|
|
5246
5246
|
}
|
|
5247
5247
|
var JsonView$1 = React__default.lazy(function() {
|
|
5248
|
-
return import("./vendor-
|
|
5248
|
+
return import("./vendor-DyrjuDU0.js").then((i) => i.m).then(importLazyComponent);
|
|
5249
5249
|
});
|
|
5250
5250
|
(function() {
|
|
5251
5251
|
function i() {
|
|
@@ -9808,7 +9808,7 @@ var Column$2 = types.model("Column", {
|
|
|
9808
9808
|
];
|
|
9809
9809
|
Array.isArray(O.data) ? R = O.data : R = O.data.rows || O.data.items, F.label = 2;
|
|
9810
9810
|
case 2:
|
|
9811
|
-
return import("./vendor-
|
|
9811
|
+
return import("./vendor-DyrjuDU0.js").then((k) => k.p).then(function(k) {
|
|
9812
9812
|
var M, D, P = [];
|
|
9813
9813
|
try {
|
|
9814
9814
|
for (var L = __values(R), U = L.next(); !U.done; U = L.next()) {
|
|
@@ -19069,13 +19069,6 @@ var ScopedRootRenderer = StatusScoped(HocScoped(Root)), ErrorBoundary = (
|
|
|
19069
19069
|
}, a;
|
|
19070
19070
|
})(React__default.Component)
|
|
19071
19071
|
);
|
|
19072
|
-
/** @license amis v@version
|
|
19073
|
-
*
|
|
19074
|
-
* Copyright Baidu
|
|
19075
|
-
*
|
|
19076
|
-
* This source code is licensed under the Apache license found in the
|
|
19077
|
-
* LICENSE file in the root directory of this source tree.
|
|
19078
|
-
*/
|
|
19079
19072
|
getClassPrefix();
|
|
19080
19073
|
window.amisVersionInfo = {
|
|
19081
19074
|
version: "6.13.0",
|
|
@@ -27143,7 +27136,7 @@ var Editor$1 = (
|
|
|
27143
27136
|
return this.container;
|
|
27144
27137
|
}, a.prototype.loadMonaco = function() {
|
|
27145
27138
|
var e = this;
|
|
27146
|
-
window.__amis_monaco_editor_locale = this.props.locale, import("./vendor-
|
|
27139
|
+
window.__amis_monaco_editor_locale = this.props.locale, import("./vendor-DyrjuDU0.js").then((t) => t.c5).then(function(t) {
|
|
27147
27140
|
return e.initMonaco(t);
|
|
27148
27141
|
});
|
|
27149
27142
|
}, a.prototype.initMonaco = function(e) {
|
|
@@ -36057,17 +36050,17 @@ var FuncList$1 = themeable(FuncList), CodeMirrorEditor = (
|
|
|
36057
36050
|
return __generator(this, function(u) {
|
|
36058
36051
|
switch (u.label) {
|
|
36059
36052
|
case 0:
|
|
36060
|
-
return [4, import("./vendor-
|
|
36053
|
+
return [4, import("./vendor-DyrjuDU0.js").then((c) => c.a)];
|
|
36061
36054
|
case 1:
|
|
36062
|
-
return s = u.sent().default, [4, import("./vendor-
|
|
36055
|
+
return s = u.sent().default, [4, import("./vendor-DyrjuDU0.js").then((c) => c.j)];
|
|
36063
36056
|
case 2:
|
|
36064
|
-
return u.sent(), [4, import("./vendor-
|
|
36057
|
+
return u.sent(), [4, import("./vendor-DyrjuDU0.js").then((c) => c.h)];
|
|
36065
36058
|
case 3:
|
|
36066
|
-
return u.sent(), [4, import("./vendor-
|
|
36059
|
+
return u.sent(), [4, import("./vendor-DyrjuDU0.js").then((c) => c.s)];
|
|
36067
36060
|
case 4:
|
|
36068
|
-
return u.sent(), [4, import("./vendor-
|
|
36061
|
+
return u.sent(), [4, import("./vendor-DyrjuDU0.js").then((c) => c.b)];
|
|
36069
36062
|
case 5:
|
|
36070
|
-
return u.sent(), [4, import("./vendor-
|
|
36063
|
+
return u.sent(), [4, import("./vendor-DyrjuDU0.js").then((c) => c.d)];
|
|
36071
36064
|
case 6:
|
|
36072
36065
|
return u.sent(), this.unmounted ? [
|
|
36073
36066
|
2
|
|
@@ -49447,7 +49440,7 @@ var VCell = observer$1(function(a) {
|
|
|
49447
49440
|
return l ? s("exportExcel", __assign(__assign({ label: o("CRUD.exportExcel") }, e), { type: "button" }), {
|
|
49448
49441
|
loading: r.exportExcelLoading,
|
|
49449
49442
|
onAction: function() {
|
|
49450
|
-
r.update({ exportExcelLoading: !0 }), import("./vendor-
|
|
49443
|
+
r.update({ exportExcelLoading: !0 }), import("./vendor-DyrjuDU0.js").then((u) => u.e).then(function(u) {
|
|
49451
49444
|
return __awaiter(t, void 0, void 0, function() {
|
|
49452
49445
|
var c, p;
|
|
49453
49446
|
return __generator(this, function(f) {
|
|
@@ -49480,7 +49473,7 @@ var VCell = observer$1(function(a) {
|
|
|
49480
49473
|
var t = this, n = this.props, r = n.store, o = n.translate, s = n.render, l = r.filteredColumns || [];
|
|
49481
49474
|
return l ? s("exportExcelTemplate", __assign(__assign({ label: o("CRUD.exportExcelTemplate") }, e), { type: "button" }), {
|
|
49482
49475
|
onAction: function() {
|
|
49483
|
-
import("./vendor-
|
|
49476
|
+
import("./vendor-DyrjuDU0.js").then((u) => u.e).then(function(u) {
|
|
49484
49477
|
return __awaiter(t, void 0, void 0, function() {
|
|
49485
49478
|
var c, p;
|
|
49486
49479
|
return __generator(this, function(f) {
|
|
@@ -52761,7 +52754,7 @@ const Image$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePrope
|
|
|
52761
52754
|
imagePlaceholder
|
|
52762
52755
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
52763
52756
|
var Cropper = React__default.lazy(function() {
|
|
52764
|
-
return import("./vendor-
|
|
52757
|
+
return import("./vendor-DyrjuDU0.js").then((i) => i.c6);
|
|
52765
52758
|
}), preventEvent = function(i) {
|
|
52766
52759
|
return i.stopPropagation();
|
|
52767
52760
|
};
|
|
@@ -73715,7 +73708,7 @@ var ExcelControl = (
|
|
|
73715
73708
|
}, v.readAsArrayBuffer(e);
|
|
73716
73709
|
})];
|
|
73717
73710
|
case 2:
|
|
73718
|
-
return r = f.sent(), o = e.name.toLowerCase().endsWith(".xls"), s = void 0, o ? [4, import("./vendor-
|
|
73711
|
+
return r = f.sent(), o = e.name.toLowerCase().endsWith(".xls"), s = void 0, o ? [4, import("./vendor-DyrjuDU0.js").then((h) => h.c7)] : [3, 4];
|
|
73719
73712
|
case 3:
|
|
73720
73713
|
return l = f.sent(), u = l.read(new Uint8Array(r), {
|
|
73721
73714
|
cellDates: !0
|
|
@@ -73747,7 +73740,7 @@ var ExcelControl = (
|
|
|
73747
73740
|
case 0:
|
|
73748
73741
|
n = this.props, r = n.allSheets, o = n.parseImage, s = n.plainText, l = n.translate, v.label = 1;
|
|
73749
73742
|
case 1:
|
|
73750
|
-
return v.trys.push([1, 4, , 5]), [4, import("./vendor-
|
|
73743
|
+
return v.trys.push([1, 4, , 5]), [4, import("./vendor-DyrjuDU0.js").then((_) => _.e)];
|
|
73751
73744
|
case 2:
|
|
73752
73745
|
return u = v.sent().default, this.ExcelJS = u, c = new u.Workbook(), p = typeof e == "string" ? new Uint8Array(e.split("").map(function(_) {
|
|
73753
73746
|
return _.charCodeAt(0);
|
|
@@ -80704,7 +80697,7 @@ const Status = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
80704
80697
|
StatusFieldRenderer
|
|
80705
80698
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
80706
80699
|
var JsonView = React__default.lazy(function() {
|
|
80707
|
-
return import("./vendor-
|
|
80700
|
+
return import("./vendor-DyrjuDU0.js").then((i) => i.m).then(importLazyComponent);
|
|
80708
80701
|
}), JSONField = (
|
|
80709
80702
|
/** @class */
|
|
80710
80703
|
(function(i) {
|
|
@@ -81664,14 +81657,14 @@ var Chart = (
|
|
|
81664
81657
|
r.data;
|
|
81665
81658
|
var p = this.props, f = p.mapURL, h = p.mapName, m = this.props.onChartMount || this.onChartMount;
|
|
81666
81659
|
e ? Promise.all([
|
|
81667
|
-
import("./vendor-
|
|
81668
|
-
import("./vendor-
|
|
81660
|
+
import("./vendor-DyrjuDU0.js").then((v) => v.c8),
|
|
81661
|
+
import("./vendor-DyrjuDU0.js").then((v) => v.i),
|
|
81669
81662
|
// @ts-ignore 官方没提供 type
|
|
81670
|
-
import("./vendor-
|
|
81663
|
+
import("./vendor-DyrjuDU0.js").then((v) => v.c9),
|
|
81671
81664
|
// @ts-ignore 官方没提供 type
|
|
81672
|
-
import("./vendor-
|
|
81665
|
+
import("./vendor-DyrjuDU0.js").then((v) => v.ca),
|
|
81673
81666
|
// @ts-ignore 官方没提供 type
|
|
81674
|
-
import("./vendor-
|
|
81667
|
+
import("./vendor-DyrjuDU0.js").then((v) => v.f)
|
|
81675
81668
|
]).then(function(v) {
|
|
81676
81669
|
var _ = __read(v, 2), g = _[0], b = _[1];
|
|
81677
81670
|
return __awaiter(t, void 0, void 0, function() {
|
|
@@ -82628,7 +82621,7 @@ var str2seconds = function(i) {
|
|
|
82628
82621
|
this.mpegtsPlayer && (this.mpegtsPlayer.destroy(), (t = (e = this.props).setError) === null || t === void 0 || t.call(e, ""));
|
|
82629
82622
|
}, a.prototype.initFlv = function(e) {
|
|
82630
82623
|
var t = this, n = e.video, r = e.manager, o = e.src, s = e.isLive, l = e.config, u = e.actions, c = e.setError, p = e.autoPlay;
|
|
82631
|
-
import("./vendor-
|
|
82624
|
+
import("./vendor-DyrjuDU0.js").then((f) => f.g).then(function(f) {
|
|
82632
82625
|
n = n || r.video && r.video.video;
|
|
82633
82626
|
var h = f.createPlayer({
|
|
82634
82627
|
type: "flv",
|
|
@@ -82688,7 +82681,7 @@ var str2seconds = function(i) {
|
|
|
82688
82681
|
}));
|
|
82689
82682
|
}, a.prototype.initHls = function(e) {
|
|
82690
82683
|
var t = this, n = e.video, r = e.manager, o = e.src, s = e.autoPlay, l = e.actions;
|
|
82691
|
-
import("./vendor-
|
|
82684
|
+
import("./vendor-DyrjuDU0.js").then((u) => u.k).then(function(u) {
|
|
82692
82685
|
var c = u.default;
|
|
82693
82686
|
if (c.isSupported()) {
|
|
82694
82687
|
n = n || r.video && r.video.video;
|
|
@@ -86122,7 +86115,7 @@ var Code = (
|
|
|
86122
86115
|
return anyChanged(a.propsList, this.props, e) || this.resolveLanguage(this.props) !== this.resolveLanguage(e) || getPropValue(this.props) !== getPropValue(e);
|
|
86123
86116
|
}, a.prototype.componentDidMount = function() {
|
|
86124
86117
|
var e = this;
|
|
86125
|
-
import("./vendor-
|
|
86118
|
+
import("./vendor-DyrjuDU0.js").then((t) => t.c5).then(function(t) {
|
|
86126
86119
|
return e.handleMonaco(t);
|
|
86127
86120
|
});
|
|
86128
86121
|
}, a.prototype.componentDidUpdate = function(e) {
|
|
@@ -88141,7 +88134,7 @@ var OfficeViewer = (
|
|
|
88141
88134
|
return __awaiter(this, void 0, void 0, function() {
|
|
88142
88135
|
var e, t, n = this;
|
|
88143
88136
|
return __generator(this, function(r) {
|
|
88144
|
-
return e = this.props, e.wordOptions, e.excelOptions, e.env, e.src, e.data, t = e.display, e.translate, this.document ? (import("./vendor-
|
|
88137
|
+
return e = this.props, e.wordOptions, e.excelOptions, e.env, e.src, e.data, t = e.display, e.translate, this.document ? (import("./vendor-DyrjuDU0.js").then((o) => o.cb).then(function(o) {
|
|
88145
88138
|
return __awaiter(n, void 0, void 0, function() {
|
|
88146
88139
|
var s, l, u;
|
|
88147
88140
|
return __generator(this, function(c) {
|
|
@@ -88179,7 +88172,7 @@ var OfficeViewer = (
|
|
|
88179
88172
|
var l = new FileReader();
|
|
88180
88173
|
l.onload = function(u) {
|
|
88181
88174
|
var c = l.result;
|
|
88182
|
-
import("./vendor-
|
|
88175
|
+
import("./vendor-DyrjuDU0.js").then((p) => p.cb).then(function(p) {
|
|
88183
88176
|
return __awaiter(e, void 0, void 0, function() {
|
|
88184
88177
|
var f, h, m;
|
|
88185
88178
|
return __generator(this, function(v) {
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
import { bX as h, bY as N, ab as p, bZ as L } from "./vendor-DyrjuDU0.js";
|
|
2
|
+
import { t as F, d as $, r as M, T as q } from "./amis-CGgHoXTI.js";
|
|
3
|
+
const D = "bankDetails";
|
|
4
|
+
async function b(t, n, o, c = 1) {
|
|
5
|
+
if (c < 0)
|
|
6
|
+
throw new Error("[payout-sdk] fetchWithAuth retries exceeded");
|
|
7
|
+
const { headers: i, authCode: l, domain: m, codeVerifier: y } = o, u = localStorage.getItem("access_token");
|
|
8
|
+
if (u)
|
|
9
|
+
n.access_token = u;
|
|
10
|
+
else {
|
|
11
|
+
const e = await O(
|
|
12
|
+
l,
|
|
13
|
+
m,
|
|
14
|
+
y
|
|
15
|
+
);
|
|
16
|
+
if (!e.access_token || !e.refresh_token)
|
|
17
|
+
throw localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), new Error(
|
|
18
|
+
"[payout-sdk] getAccessToken failed, check authCode validity"
|
|
19
|
+
);
|
|
20
|
+
n.access_token = e.access_token, localStorage.setItem("access_token", e.access_token), localStorage.setItem("refresh_token", e.refresh_token);
|
|
21
|
+
}
|
|
22
|
+
const g = await fetch(t, {
|
|
23
|
+
...o,
|
|
24
|
+
body: JSON.stringify(n),
|
|
25
|
+
headers: {
|
|
26
|
+
...i,
|
|
27
|
+
"Content-Type": "application/json"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
if (g.status === 400) {
|
|
31
|
+
const e = await g.json();
|
|
32
|
+
if (e.name != "INTERNAL_ERROR")
|
|
33
|
+
throw F.error(`${e.name}: ${e.message}`), new Error(`[payout-sdk] ${e.name}: ${e.message}`);
|
|
34
|
+
const C = localStorage.getItem("refresh_token");
|
|
35
|
+
if (C) {
|
|
36
|
+
const _ = await J(
|
|
37
|
+
C,
|
|
38
|
+
m
|
|
39
|
+
);
|
|
40
|
+
if (!_.access_token || !_.refresh_token)
|
|
41
|
+
localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token");
|
|
42
|
+
else
|
|
43
|
+
return localStorage.setItem(
|
|
44
|
+
"refresh_token",
|
|
45
|
+
_.refresh_token
|
|
46
|
+
), localStorage.setItem("access_token", _.access_token), b(t, n, o, --c);
|
|
47
|
+
}
|
|
48
|
+
const d = await O(
|
|
49
|
+
l,
|
|
50
|
+
m,
|
|
51
|
+
y
|
|
52
|
+
);
|
|
53
|
+
if (!d.access_token || !d.refresh_token)
|
|
54
|
+
throw new Error(
|
|
55
|
+
"[payout-sdk] getAccessToken failed, check authCode validity"
|
|
56
|
+
);
|
|
57
|
+
return localStorage.setItem("refresh_token", d.refresh_token), localStorage.setItem("access_token", d.access_token), b(t, n, o, --c);
|
|
58
|
+
}
|
|
59
|
+
return g;
|
|
60
|
+
}
|
|
61
|
+
async function O(t, n, o) {
|
|
62
|
+
const c = {
|
|
63
|
+
authorization_code: t,
|
|
64
|
+
code_verifier: o
|
|
65
|
+
};
|
|
66
|
+
return await (await fetch(`${n}/v1/payout/auth/token`, {
|
|
67
|
+
method: "POST",
|
|
68
|
+
body: JSON.stringify(c),
|
|
69
|
+
headers: {
|
|
70
|
+
"Content-Type": "application/json"
|
|
71
|
+
}
|
|
72
|
+
})).json();
|
|
73
|
+
}
|
|
74
|
+
async function J(t, n) {
|
|
75
|
+
const o = {
|
|
76
|
+
refresh_token: t
|
|
77
|
+
};
|
|
78
|
+
return await (await fetch(`${n}/v1/payout/auth/token/refresh`, {
|
|
79
|
+
method: "POST",
|
|
80
|
+
body: JSON.stringify(o),
|
|
81
|
+
headers: {
|
|
82
|
+
"Content-Type": "application/json"
|
|
83
|
+
}
|
|
84
|
+
})).json();
|
|
85
|
+
}
|
|
86
|
+
function j(t) {
|
|
87
|
+
return t && t.startsWith("zh") ? "zh_CN" : "en_US";
|
|
88
|
+
}
|
|
89
|
+
async function Y(t, n, o) {
|
|
90
|
+
return (await (await b(
|
|
91
|
+
"/v1/payout/beneficiary/token/countryinfos",
|
|
92
|
+
{},
|
|
93
|
+
{
|
|
94
|
+
method: "POST",
|
|
95
|
+
authCode: t,
|
|
96
|
+
domain: n,
|
|
97
|
+
codeVerifier: o
|
|
98
|
+
}
|
|
99
|
+
)).json()).country_infos || [];
|
|
100
|
+
}
|
|
101
|
+
async function W(t, n, o, c) {
|
|
102
|
+
return await (await b(
|
|
103
|
+
"/v1/payout/beneficiary/token/paymentmethodinfos",
|
|
104
|
+
{
|
|
105
|
+
region_code: t
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
method: "POST",
|
|
109
|
+
authCode: n,
|
|
110
|
+
domain: o,
|
|
111
|
+
codeVerifier: c
|
|
112
|
+
}
|
|
113
|
+
)).json();
|
|
114
|
+
}
|
|
115
|
+
function z({ inputPayoutType: t, inputCurrency: n }, o, c, i) {
|
|
116
|
+
const l = [];
|
|
117
|
+
for (const m of Object.values(o.countries)) {
|
|
118
|
+
const y = m.payoutTypes?.[t]?.currencies;
|
|
119
|
+
if (y)
|
|
120
|
+
for (const [u, g] of Object.entries(y))
|
|
121
|
+
u === n && l.push(g);
|
|
122
|
+
}
|
|
123
|
+
if (l.length !== 0)
|
|
124
|
+
return {
|
|
125
|
+
type: "list-select",
|
|
126
|
+
name: "inputPaymentMethod",
|
|
127
|
+
label: c("paymentMethodInputLabel", "Transfer method"),
|
|
128
|
+
options: l.map((m) => ({
|
|
129
|
+
value: m.payment_method,
|
|
130
|
+
body: /* @__PURE__ */ h.jsxs("div", { children: [
|
|
131
|
+
/* @__PURE__ */ h.jsx("span", { className: "flex font-bold", children: m.display_name }),
|
|
132
|
+
/* @__PURE__ */ h.jsx("span", { className: "flex mt-1", children: m.description })
|
|
133
|
+
] })
|
|
134
|
+
})),
|
|
135
|
+
value: i?.payment_method
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
async function K({
|
|
139
|
+
inputRegionCode: t,
|
|
140
|
+
inputCurrency: n,
|
|
141
|
+
inputPaymentMethod: o
|
|
142
|
+
}, c, i, l) {
|
|
143
|
+
if (!t || !n || !o || !c || !i || !l)
|
|
144
|
+
return;
|
|
145
|
+
const u = await (await b(
|
|
146
|
+
"/v1/payout/beneficiary/form/schema/token/query",
|
|
147
|
+
{
|
|
148
|
+
payment_method: o,
|
|
149
|
+
region: t,
|
|
150
|
+
currency: n,
|
|
151
|
+
local_clearing_system: "",
|
|
152
|
+
version: "v1",
|
|
153
|
+
entity_type: "ENTITY_TYPE_PERSONAL"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
method: "POST",
|
|
157
|
+
authCode: c,
|
|
158
|
+
domain: i,
|
|
159
|
+
codeVerifier: l
|
|
160
|
+
}
|
|
161
|
+
)).json();
|
|
162
|
+
return JSON.parse(
|
|
163
|
+
u.beneficiary_schema.amis_page.replace(/Area Code/g, "AREA_CODE")
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function Q({
|
|
167
|
+
authCode: t,
|
|
168
|
+
domain: n,
|
|
169
|
+
codeVerifier: o,
|
|
170
|
+
emitter: c,
|
|
171
|
+
defaultValues: i,
|
|
172
|
+
customizations: l,
|
|
173
|
+
locale: m
|
|
174
|
+
}) {
|
|
175
|
+
const { t: y } = N("beneficiaryForm"), [u, g] = p.useState([]), [e, C] = p.useState({
|
|
176
|
+
inputPayoutType: i?.payout_type || "B2P",
|
|
177
|
+
inputPaymentMethod: i?.payment_method,
|
|
178
|
+
inputRegionCode: i?.region_code,
|
|
179
|
+
inputCurrency: i?.currency
|
|
180
|
+
}), [d, _] = p.useState(), [T, x] = p.useState(), S = p.useMemo(() => !l?.layout?.find(
|
|
181
|
+
(a) => a.name === D
|
|
182
|
+
)?.hidden, [l?.layout]), I = p.useCallback(
|
|
183
|
+
(s) => {
|
|
184
|
+
if (!s) return;
|
|
185
|
+
const a = s.body.findIndex(
|
|
186
|
+
(f) => f.type === "form"
|
|
187
|
+
), r = s.body[a];
|
|
188
|
+
s.body[a].onFinished = (f) => {
|
|
189
|
+
const B = $(r.api.data, f, void 0, !0);
|
|
190
|
+
c.emit("submit", B.value);
|
|
191
|
+
}, x(s);
|
|
192
|
+
},
|
|
193
|
+
[c]
|
|
194
|
+
), P = p.useMemo(() => {
|
|
195
|
+
const s = /* @__PURE__ */ new Set();
|
|
196
|
+
return u.filter(
|
|
197
|
+
(r) => r.country_number && !s.has(r.country_number) && s.add(r.country_number)
|
|
198
|
+
).map((r) => ({
|
|
199
|
+
label: r.country_name_standard || r.country_name,
|
|
200
|
+
value: r.country_code
|
|
201
|
+
})).sort((r, f) => r.label.localeCompare(f.label));
|
|
202
|
+
}, [u]), [R, E] = p.useState();
|
|
203
|
+
p.useEffect(() => {
|
|
204
|
+
if (!e?.inputRegionCode || !e?.inputPayoutType) return;
|
|
205
|
+
const s = e.inputRegionCode;
|
|
206
|
+
W(s, t, n, o).then(
|
|
207
|
+
(a) => {
|
|
208
|
+
_(a);
|
|
209
|
+
const r = Object.keys(
|
|
210
|
+
a.countries?.[s].payoutTypes?.[e.inputPayoutType]?.currencies
|
|
211
|
+
);
|
|
212
|
+
r && r.length > 0 && E(
|
|
213
|
+
r.map((f) => ({
|
|
214
|
+
label: f,
|
|
215
|
+
value: f
|
|
216
|
+
}))
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
}, [
|
|
221
|
+
t,
|
|
222
|
+
o,
|
|
223
|
+
n,
|
|
224
|
+
e?.inputPayoutType,
|
|
225
|
+
e?.inputRegionCode
|
|
226
|
+
]);
|
|
227
|
+
const v = p.useMemo(() => Array.from(
|
|
228
|
+
new Set(u.map((a) => a.currency_code))
|
|
229
|
+
).map((a) => ({
|
|
230
|
+
label: a,
|
|
231
|
+
value: a
|
|
232
|
+
})).filter((a) => !!a.label && a.label !== "-").sort((a, r) => a.label.localeCompare(r.label)), [u]), k = p.useMemo(() => !e?.inputCurrency || !e?.inputPayoutType || !d ? void 0 : z(
|
|
233
|
+
{
|
|
234
|
+
inputPayoutType: e.inputPayoutType,
|
|
235
|
+
inputCurrency: e.inputCurrency
|
|
236
|
+
},
|
|
237
|
+
d,
|
|
238
|
+
y,
|
|
239
|
+
i
|
|
240
|
+
), [i, e, d, y]), w = p.useMemo(() => {
|
|
241
|
+
if (!(u.length === 0 || !k || !e?.inputPaymentMethod || !e?.inputRegionCode || !e?.inputCurrency))
|
|
242
|
+
return T;
|
|
243
|
+
}, [u, e, T, k]);
|
|
244
|
+
p.useEffect(() => {
|
|
245
|
+
K(
|
|
246
|
+
{
|
|
247
|
+
inputPaymentMethod: e.inputPaymentMethod,
|
|
248
|
+
inputRegionCode: e.inputRegionCode,
|
|
249
|
+
inputCurrency: e.inputCurrency
|
|
250
|
+
},
|
|
251
|
+
t,
|
|
252
|
+
n,
|
|
253
|
+
o
|
|
254
|
+
).then(I);
|
|
255
|
+
}, [
|
|
256
|
+
u,
|
|
257
|
+
k,
|
|
258
|
+
t,
|
|
259
|
+
n,
|
|
260
|
+
o,
|
|
261
|
+
I,
|
|
262
|
+
e.inputCurrency,
|
|
263
|
+
e.inputPaymentMethod,
|
|
264
|
+
e.inputRegionCode
|
|
265
|
+
]);
|
|
266
|
+
const A = p.useMemo(
|
|
267
|
+
() => ({
|
|
268
|
+
type: "page",
|
|
269
|
+
visible: S,
|
|
270
|
+
body: {
|
|
271
|
+
type: "spinner",
|
|
272
|
+
show: u.length === 0,
|
|
273
|
+
overlay: !0,
|
|
274
|
+
body: [
|
|
275
|
+
{
|
|
276
|
+
type: "form",
|
|
277
|
+
title: y("title", "Bank Details"),
|
|
278
|
+
submitText: "",
|
|
279
|
+
onChange: (s) => {
|
|
280
|
+
const a = s.inputRegionCode, r = s.inputRegionCode ? s.inputCurrency : "", f = s.inputRegionCode ? s.inputPaymentMethod : "";
|
|
281
|
+
C({
|
|
282
|
+
inputPayoutType: s.inputPayoutType,
|
|
283
|
+
inputPaymentMethod: f,
|
|
284
|
+
inputRegionCode: a,
|
|
285
|
+
inputCurrency: r
|
|
286
|
+
});
|
|
287
|
+
},
|
|
288
|
+
body: [
|
|
289
|
+
{
|
|
290
|
+
label: y("regionInputLabel", "Bank Location"),
|
|
291
|
+
type: "input-text",
|
|
292
|
+
creatable: !1,
|
|
293
|
+
name: "inputRegionCode",
|
|
294
|
+
options: P,
|
|
295
|
+
value: e?.inputRegionCode
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: y("payoutTypeInputLabel", "Bank account type"),
|
|
299
|
+
type: "radios",
|
|
300
|
+
name: "inputPayoutType",
|
|
301
|
+
selectFirst: !0,
|
|
302
|
+
options: [
|
|
303
|
+
{
|
|
304
|
+
label: "Individual",
|
|
305
|
+
value: "B2P"
|
|
306
|
+
}
|
|
307
|
+
],
|
|
308
|
+
value: e?.inputPayoutType
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
label: y("currencyInputLabel", "Account currency"),
|
|
312
|
+
type: "input-text",
|
|
313
|
+
creatable: !1,
|
|
314
|
+
name: "inputCurrency",
|
|
315
|
+
options: e.inputRegionCode ? R || v : [],
|
|
316
|
+
value: e?.inputCurrency
|
|
317
|
+
},
|
|
318
|
+
k
|
|
319
|
+
]
|
|
320
|
+
}
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
}),
|
|
324
|
+
[
|
|
325
|
+
u.length,
|
|
326
|
+
e,
|
|
327
|
+
v,
|
|
328
|
+
R,
|
|
329
|
+
P,
|
|
330
|
+
S,
|
|
331
|
+
y,
|
|
332
|
+
k
|
|
333
|
+
]
|
|
334
|
+
);
|
|
335
|
+
return p.useEffect(() => {
|
|
336
|
+
async function s() {
|
|
337
|
+
const a = await Y(
|
|
338
|
+
t,
|
|
339
|
+
n,
|
|
340
|
+
o
|
|
341
|
+
);
|
|
342
|
+
g(a);
|
|
343
|
+
}
|
|
344
|
+
s();
|
|
345
|
+
}, [t, o, n]), /* @__PURE__ */ h.jsxs(h.Fragment, { children: [
|
|
346
|
+
/* @__PURE__ */ h.jsx(q, {}),
|
|
347
|
+
M(A, {
|
|
348
|
+
locale: j(m)
|
|
349
|
+
}),
|
|
350
|
+
w && M(w, {
|
|
351
|
+
locale: j(m)
|
|
352
|
+
})
|
|
353
|
+
] });
|
|
354
|
+
}
|
|
355
|
+
function Z(t) {
|
|
356
|
+
const { mi18n: n } = t;
|
|
357
|
+
return /* @__PURE__ */ h.jsx(L, { mi18n: n, fallback: "Loading...", children: /* @__PURE__ */ h.jsx(Q, { ...t }) });
|
|
358
|
+
}
|
|
359
|
+
export {
|
|
360
|
+
Z as default
|
|
361
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b_ as m, b$ as u, c0 as c, c1 as h, c2 as l, c3 as f, c4 as p } from "./vendor-
|
|
1
|
+
import { b_ as m, b$ as u, c0 as c, c1 as h, c2 as l, c3 as f, c4 as p } from "./vendor-DyrjuDU0.js";
|
|
2
2
|
class d {
|
|
3
3
|
loader;
|
|
4
4
|
options;
|
|
@@ -11,7 +11,7 @@ class d {
|
|
|
11
11
|
}
|
|
12
12
|
async mount(t) {
|
|
13
13
|
if (this.mounted) return;
|
|
14
|
-
const n = await this.loader(), e = n.default ?? n, a = await import("./vendor-
|
|
14
|
+
const n = await this.loader(), e = n.default ?? n, a = await import("./vendor-DyrjuDU0.js").then((i) => i.R), r = (await import("./vendor-DyrjuDU0.js").then((i) => i.c)).createRoot(t);
|
|
15
15
|
r.render(
|
|
16
16
|
a.createElement(e, {
|
|
17
17
|
...this.options,
|
|
@@ -34,7 +34,7 @@ class d {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
const g = {
|
|
37
|
-
beneficiaryForm: () => import("./component-beneficiary-form-
|
|
37
|
+
beneficiaryForm: () => import("./component-beneficiary-form-CoKMkl0U.js")
|
|
38
38
|
}, w = {
|
|
39
39
|
staticData: {
|
|
40
40
|
en: () => import("./en-Cb5xUNU4.js")
|
|
@@ -45,9 +45,7 @@ function D(o) {
|
|
|
45
45
|
language: p() || o,
|
|
46
46
|
defaultLanguage: o,
|
|
47
47
|
fallbackLanguage: "en",
|
|
48
|
-
// availableLanguages: ["en", "zh-Hant", "ar", "ja", "th", "tr", "zh"],
|
|
49
48
|
availableLanguages: ["en"],
|
|
50
|
-
// 一期只支持英文
|
|
51
49
|
...w,
|
|
52
50
|
projectId: 181
|
|
53
51
|
});
|