@feedmepos/mf-connect 0.1.0-beta.22 → 0.1.0-beta.24
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.
- package/dist/{Analytic-D2rd3fW1.js → Analytic-BGHwfe8y.js} +8 -8
- package/dist/{App-DRCxxf_2.js → App-BXeInbOn.js} +6 -6
- package/dist/{Broadcast-BVr2nICs.js → Broadcast-DHzSNUOX.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-meTyd2fy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cp3MEEHh.js} +8 -8
- package/dist/{Card-chRsepYM.js → Card-lF1K-rNW.js} +15 -15
- package/dist/{Collections-2Etoeczp.js → Collections-BbXYncse.js} +4 -4
- package/dist/{Credit-Dq86WUD-.js → Credit-DUlNSEou.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BsH3HbLB.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-02UOqiCW.js} +27 -27
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C2Hqa8eR.js → EffectSheet.vue_vue_type_style_index_0_lang-BzBmvk4X.js} +6 -6
- package/dist/{Experience-Q7dsr0NN.js → Experience-BkPcfGme.js} +8 -8
- package/dist/{Game-CYG3CXcR.js → Game-BHk897qu.js} +8 -8
- package/dist/Index-DGDiIs4-.js +255 -0
- package/dist/{Marketing-Dd7AqXi5.js → Marketing-CFbx8XyS.js} +5 -5
- package/dist/{Member-0_78MbML.js → Member-FTPScHYg.js} +4 -4
- package/dist/{MemberList-C4LQ4bj1.js → MemberList-CIoGwQoH.js} +14 -14
- package/dist/{MemberTransactions-DlRhSSJN.js → MemberTransactions-CYZCTnUg.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CFYwPtG4.js → MessageInput.vue_vue_type_script_setup_true_lang-C6nqufmL.js} +2 -2
- package/dist/{Mission-BlLsczAV.js → Mission-BjBaGQwe.js} +8 -8
- package/dist/{Overview-VCBBU1YW.js → Overview-BumR0wKz.js} +264 -254
- package/dist/{Point-DpIDxrvJ.js → Point-qtTwRO4B.js} +8 -8
- package/dist/{Promotion-C3ebqW34.js → Promotion-BJJ6GeQ_.js} +9 -9
- package/dist/{Record-DrnEJ5z2.js → Record-DSKsHHuR.js} +4 -4
- package/dist/{Reward-D5lhhJ-N.js → Reward-D2IaJe68.js} +79 -79
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CDC9p6LD.js → RewardGroup.vue_vue_type_script_setup_true_lang-BVayF0UI.js} +12 -12
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DdaotwiY.js → RuleGroup.vue_vue_type_script_setup_true_lang-X1J5AJUO.js} +383 -341
- package/dist/{Segment-B_UiubGw.js → Segment-BroinGRV.js} +13 -13
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Cxa1yAbP.js → SelectItems.vue_vue_type_script_setup_true_lang-VNRjXDrG.js} +2 -2
- package/dist/{Setting-ofM4mT_R.js → Setting-DxI2vvOQ.js} +8 -8
- package/dist/{Store-ovwzJgxT.js → Store-uZhvdQu2.js} +19 -19
- package/dist/{StoreRewards-D09t7hGn.js → StoreRewards-BgDawQpI.js} +12 -12
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-enbynhZG.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DErl8VM7.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-1RmfqP0u.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-PRmabsgS.js} +1 -1
- package/dist/{Tier-CV1NPRXS.js → Tier-ywLpOTC5.js} +15 -15
- package/dist/{Title-ChjjbpSL.js → Title-B_1N7WbH.js} +15 -15
- package/dist/{Transaction-Cbpgm2JY.js → Transaction-BfnydJEk.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-B-cjjDwB.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DxY40ppg.js} +6 -6
- package/dist/{Voucher-D2w6Z8YT.js → Voucher-DC3BFpt_.js} +11 -11
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-C-M9HHHv.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BH_o1H1R.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bpiq2H6-.js → ZodTextField.vue_vue_type_script_setup_true_lang-Cx1NSSCO.js} +1 -1
- package/dist/{app-B3iXfxa0.js → app-CPAvOc6v.js} +32 -28
- package/dist/{app-D_GYnoU8.js → app-DCoeSeFh.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{business-olDfFU8_.js → business-Dk0g0MTT.js} +1 -1
- package/dist/{campaign-D2nV5URO.js → campaign-CDIbjXrX.js} +2 -2
- package/dist/{collectible.enum-BrQ1MdCX.js → collectible.enum-D3iSKWKD.js} +1 -1
- package/dist/{collection.fn-tmN9Kszx.js → collection.fn-Clqllg0e.js} +2 -2
- package/dist/{dto-CTYhP7qQ.js → dto-Bfv1Q_1p.js} +51 -51
- package/dist/{effect-iLrpPMc3.js → effect-CAw2hbV1.js} +1 -1
- package/dist/{email-addresses-MX7iDQgY.js → email-addresses-C2powe2O.js} +1 -1
- package/dist/{export-CWk6FFUD.js → export-48FIWl-y.js} +3 -3
- package/dist/{helper-Dqgn8m_C.js → helper-CUflThOf.js} +1 -1
- package/dist/{index-CoO9Rt30.js → index-BDR6gyA3.js} +1 -1
- package/dist/{index-XWa7Re80.js → index-BzUTz_f5.js} +3 -3
- package/dist/{index-D2PJeTZN.js → index-C9s5LGWo.js} +1 -1
- package/dist/{index-CA3ry7KV.js → index-CHAxmOpZ.js} +4 -4
- package/dist/{index-BFCvNlPf.js → index-Cwfg1E0O.js} +1 -1
- package/dist/{index-CSUgytuI.js → index-D1veosa1.js} +2 -2
- package/dist/{index-D6wlE0if.js → index-DCmImPRu.js} +1 -1
- package/dist/{index-DVmX1XKB.js → index-DDnotVHT.js} +8 -8
- package/dist/{index-DuhwB_77.js → index-DHK1GNFS.js} +3 -3
- package/dist/{index-a-RJ9mPY.js → index-DTk6tgu3.js} +4 -4
- package/dist/{index-0rGwpvFu.js → index-Dmuja8kq.js} +3 -3
- package/dist/{index-Olr6peI3.js → index-DpF2mO8S.js} +1 -1
- package/dist/{index-BFKji6uM.js → index-YxGM0sYn.js} +1 -1
- package/dist/{index.esm2017-rSVl0NJ1.js → index.esm2017-B6jyMj2I.js} +1 -1
- package/dist/{loading-DH_Oslj_.js → loading-5TfQs5SR.js} +4 -4
- package/dist/{membership-DvGibVw8.js → membership-BCMMOGZz.js} +3 -3
- package/dist/{money-uMV9bKW_.js → money-BavhjpvU.js} +1 -1
- package/dist/{number-prhBB6Cx.js → number-B4tdJr4Z.js} +1 -1
- package/dist/{objectid-BXCxmWH8.js → objectid-C40r-rFp.js} +8 -8
- package/dist/{reward-CS8GA2Em.js → reward-DjXyYMBi.js} +1 -1
- package/dist/{rule-DWywBqMy.js → rule-DhNwPN-d.js} +3 -3
- package/dist/{rule-builder-DqbLY4ex.js → rule-builder-DmD22HBN.js} +1 -1
- package/dist/{template-DbSK_KPb.js → template-BXp7Uglk.js} +4 -4
- package/dist/{trigger-BdN5rF98.js → trigger-BdDXyHZg.js} +4 -4
- package/dist/{vue-i18n-C6HFQh05.js → vue-i18n-Tmy5Z8fL.js} +248 -248
- package/dist/{xlsx-qV7YVbEu.js → xlsx-Ct43S4H1.js} +1 -1
- package/package.json +1 -1
- package/dist/Index-DHCwmDVK.js +0 -226
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { defineComponent as Y, resolveComponent as _, openBlock as
|
|
1
|
+
import { defineComponent as Y, resolveComponent as _, openBlock as C, createElementBlock as B, Fragment as H, createVNode as d, withCtx as k, createElementVNode as a, toDisplayString as E, unref as r, renderSlot as pe, ref as x, computed as D, watch as se, createBlock as j, isRef as z, resolveDynamicComponent as ne, renderList as te, normalizeClass as ie, createTextVNode as he, createCommentVNode as Z, h as re, onMounted as ve } from "vue";
|
|
2
2
|
import { _ as ge } from "./campaign-CpzFl8Vr.js";
|
|
3
|
-
import { u as W } from "./vue-i18n-
|
|
4
|
-
import { p as K, u as
|
|
3
|
+
import { u as W } from "./vue-i18n-Tmy5Z8fL.js";
|
|
4
|
+
import { c as we, p as K, u as de } from "./loading-5TfQs5SR.js";
|
|
5
5
|
import { J as X } from "./JsonViewer-v8_C7l5N.js";
|
|
6
|
-
import { Z as
|
|
6
|
+
import { Z as M } from "./zod-Bg2FbC-D.js";
|
|
7
7
|
import { u as q } from "./app-wDQR6dpb.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import "./index-
|
|
11
|
-
import "./index-
|
|
12
|
-
import { l as
|
|
13
|
-
import "./index-
|
|
14
|
-
import { a as
|
|
15
|
-
import "./index-
|
|
16
|
-
import "./index-
|
|
17
|
-
import { C as
|
|
18
|
-
import { t as ee } from "./helper-
|
|
8
|
+
import { u as Q, _ as _e } from "./RewardGroup.vue_vue_type_script_setup_true_lang-BVayF0UI.js";
|
|
9
|
+
import { u as ce } from "./reward-DjXyYMBi.js";
|
|
10
|
+
import "./index-Dmuja8kq.js";
|
|
11
|
+
import "./index-D1veosa1.js";
|
|
12
|
+
import { l as le, m as ye } from "./index-DTk6tgu3.js";
|
|
13
|
+
import "./index-CHAxmOpZ.js";
|
|
14
|
+
import { a as be, b as xe } from "./index-DDnotVHT.js";
|
|
15
|
+
import "./index-YxGM0sYn.js";
|
|
16
|
+
import "./index-DHK1GNFS.js";
|
|
17
|
+
import { C as ue } from "./membership-BCMMOGZz.js";
|
|
18
|
+
import { t as ee } from "./helper-CUflThOf.js";
|
|
19
19
|
import { c as N } from "./object-qECH92oz.js";
|
|
20
|
-
import { useDialog as
|
|
21
|
-
import { _ as
|
|
22
|
-
import { a as
|
|
23
|
-
import { O as
|
|
24
|
-
import { r as me } from "./index-
|
|
25
|
-
import { u as $e } from "./business-
|
|
26
|
-
const
|
|
20
|
+
import { useDialog as Ce, components as oe } from "@feedmepos/ui-library";
|
|
21
|
+
import { _ as Re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-Cx1NSSCO.js";
|
|
22
|
+
import { a as Se, _ as Fe } from "./trigger-BdDXyHZg.js";
|
|
23
|
+
import { O as ke } from "./objectid-C40r-rFp.js";
|
|
24
|
+
import { r as me } from "./index-C9s5LGWo.js";
|
|
25
|
+
import { u as $e } from "./business-Dk0g0MTT.js";
|
|
26
|
+
const Pe = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ve = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Ie = { class: "flex-1" }, Te = { class: "flex items-center gap-8" }, Ue = { class: "fm-typo-en-title-sm-800" }, Ae = { class: "flex gap-8 items-center" }, Le = { class: "space-y-4 hidden xs:block border-b border-fm-color-neutral-gray-100 px-16 flex-1 pb-24" }, Be = { class: "flex items-center justify-between" }, Ee = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Oe = { class: "flex-1 space-y-4" }, je = { class: "fm-typo-en-body-lg-600" }, De = /* @__PURE__ */ Y({
|
|
27
27
|
__name: "ReferralRewadGroupCard",
|
|
28
28
|
props: {
|
|
29
29
|
rewardGroup: {
|
|
@@ -36,64 +36,64 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
emits: ["edit", "addCount", "remove"],
|
|
39
|
-
setup(
|
|
40
|
-
const { t:
|
|
39
|
+
setup(R, { emit: f }) {
|
|
40
|
+
const { t: $ } = W(), p = f;
|
|
41
41
|
return (g, m) => {
|
|
42
42
|
const n = _("FmButton"), c = _("FmListItem");
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
onClick: m[4] || (m[4] = (u) => p("edit",
|
|
43
|
+
return C(), B(H, null, [
|
|
44
|
+
d(c, {
|
|
45
|
+
onClick: m[4] || (m[4] = (u) => p("edit", R.level)),
|
|
46
46
|
class: "!p-0"
|
|
47
47
|
}, {
|
|
48
|
-
default:
|
|
49
|
-
a("div",
|
|
50
|
-
a("div",
|
|
51
|
-
a("div",
|
|
52
|
-
a("div",
|
|
53
|
-
a("div",
|
|
48
|
+
default: k(() => [
|
|
49
|
+
a("div", Pe, [
|
|
50
|
+
a("div", Ve, [
|
|
51
|
+
a("div", Ie, [
|
|
52
|
+
a("div", Te, [
|
|
53
|
+
a("div", Ue, E(R.rewardGroup.name), 1)
|
|
54
54
|
])
|
|
55
55
|
])
|
|
56
56
|
]),
|
|
57
|
-
a("div",
|
|
58
|
-
|
|
57
|
+
a("div", Ae, [
|
|
58
|
+
d(n, {
|
|
59
59
|
variant: "secondary",
|
|
60
|
-
label: r(
|
|
60
|
+
label: r($)("connect.referral.reward.add_count"),
|
|
61
61
|
icon: "add",
|
|
62
62
|
onClick: m[0] || (m[0] = (u) => {
|
|
63
|
-
u.stopPropagation(), p("addCount",
|
|
63
|
+
u.stopPropagation(), p("addCount", R.level);
|
|
64
64
|
})
|
|
65
65
|
}, null, 8, ["label"]),
|
|
66
|
-
|
|
66
|
+
d(n, {
|
|
67
67
|
icon: "delete",
|
|
68
68
|
onClick: m[1] || (m[1] = (u) => {
|
|
69
|
-
u.stopPropagation(), p("remove",
|
|
69
|
+
u.stopPropagation(), p("remove", R.level);
|
|
70
70
|
}),
|
|
71
71
|
variant: "tertiary"
|
|
72
72
|
})
|
|
73
73
|
])
|
|
74
74
|
]),
|
|
75
|
-
a("div",
|
|
76
|
-
a("div",
|
|
77
|
-
a("div",
|
|
78
|
-
a("div",
|
|
75
|
+
a("div", Le, [
|
|
76
|
+
a("div", Be, [
|
|
77
|
+
a("div", Ee, [
|
|
78
|
+
a("div", Oe, [
|
|
79
79
|
a("div", null, [
|
|
80
|
-
a("div",
|
|
80
|
+
a("div", je, E(R.rewardGroup.name), 1)
|
|
81
81
|
])
|
|
82
82
|
])
|
|
83
83
|
]),
|
|
84
|
-
|
|
84
|
+
d(n, {
|
|
85
85
|
variant: "tertiary",
|
|
86
86
|
icon: "delete",
|
|
87
|
-
onClick: m[2] || (m[2] = (u) => (u.stopPropagation(), p("remove",
|
|
87
|
+
onClick: m[2] || (m[2] = (u) => (u.stopPropagation(), p("remove", R.level)))
|
|
88
88
|
})
|
|
89
89
|
]),
|
|
90
|
-
|
|
90
|
+
d(n, {
|
|
91
91
|
class: "w-full",
|
|
92
92
|
variant: "secondary",
|
|
93
93
|
label: "Add count",
|
|
94
94
|
disabled: !0,
|
|
95
95
|
icon: "add",
|
|
96
|
-
onClick: m[3] || (m[3] = (u) => (u.stopPropagation(), p("addCount",
|
|
96
|
+
onClick: m[3] || (m[3] = (u) => (u.stopPropagation(), p("addCount", R.level)))
|
|
97
97
|
})
|
|
98
98
|
])
|
|
99
99
|
]),
|
|
@@ -103,13 +103,13 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
103
103
|
], 64);
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
}),
|
|
106
|
+
}), Ge = { class: "flex flex-col space-y-16 pr-12" }, Me = { class: "flex gap-16 items-center" }, Ne = { class: "fm-typo-en-title-sm-800" }, He = { class: "flex items-center gap-8" }, Ye = /* @__PURE__ */ Y({
|
|
107
107
|
__name: "EditReferralCountSheet",
|
|
108
108
|
emits: ["update"],
|
|
109
|
-
setup(
|
|
110
|
-
const { t: p } = W(), g =
|
|
111
|
-
var U, A, v, I, L, J,
|
|
112
|
-
const
|
|
109
|
+
setup(R, { expose: f, emit: $ }) {
|
|
110
|
+
const { t: p } = W(), g = $, m = x(!1), n = x({}), c = x(-1), u = x(-1), S = Q(), V = be.superRefine((e, t) => {
|
|
111
|
+
var U, A, v, I, L, J, ae;
|
|
112
|
+
const i = u.value == -1 ? ((v = (A = (U = S.referralProgram) == null ? void 0 : U.reward[c.value]) == null ? void 0 : A.rewards) == null ? void 0 : v.length) || 0 : u.value, F = (L = (I = S.referralProgram) == null ? void 0 : I.reward[c.value]) == null ? void 0 : L.rewards[i - 1], b = (ae = (J = S.referralProgram) == null ? void 0 : J.reward[c.value]) == null ? void 0 : ae.rewards[i + 1];
|
|
113
113
|
F && e.threshold.from < F.threshold.from + 1 && t.addIssue({
|
|
114
114
|
code: "custom",
|
|
115
115
|
message: `The min referral must be at least ${F.threshold.from + 1}`,
|
|
@@ -119,11 +119,11 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
119
119
|
message: `The max referral must be at most ${b.threshold.to - 2}`,
|
|
120
120
|
path: ["option"]
|
|
121
121
|
});
|
|
122
|
-
}), P =
|
|
122
|
+
}), P = D(() => {
|
|
123
123
|
const e = V.safeParse(n.value);
|
|
124
124
|
return e.success ? [] : e.error.errors;
|
|
125
125
|
});
|
|
126
|
-
function
|
|
126
|
+
function G() {
|
|
127
127
|
const e = V.safeParse(n.value);
|
|
128
128
|
e.success && g("update", {
|
|
129
129
|
groupIndex: c.value,
|
|
@@ -132,9 +132,9 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
async function O(e, t) {
|
|
135
|
-
var
|
|
135
|
+
var i;
|
|
136
136
|
m.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0 ? (c.value = t.groupIndex, u.value = t.countIndex, n.value = N(
|
|
137
|
-
(
|
|
137
|
+
(i = S.referralProgram) == null ? void 0 : i.reward[t.groupIndex].rewards[t.countIndex]
|
|
138
138
|
)) : (c.value = t.groupIndex, u.value = -1, n.value = {
|
|
139
139
|
threshold: {
|
|
140
140
|
from: 0,
|
|
@@ -158,7 +158,7 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
158
158
|
id: "type",
|
|
159
159
|
header: "Reward type",
|
|
160
160
|
cell(e) {
|
|
161
|
-
return
|
|
161
|
+
return ue[e.row.original.collectibleConfig.type].chip();
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
{
|
|
@@ -170,7 +170,7 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
170
170
|
return t.description;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
], s =
|
|
173
|
+
], s = ce(), o = x([]), l = D(() => s.rewards.map((e) => {
|
|
174
174
|
let t = "No expiry";
|
|
175
175
|
switch (e.option.type) {
|
|
176
176
|
case "VOUCHER":
|
|
@@ -188,60 +188,60 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
188
188
|
description: t
|
|
189
189
|
};
|
|
190
190
|
}));
|
|
191
|
-
|
|
191
|
+
D(() => []);
|
|
192
192
|
function y() {
|
|
193
193
|
const e = l.value;
|
|
194
194
|
for (let t = 0; t < e.length; t++) {
|
|
195
|
-
const
|
|
196
|
-
F && !n.value.rewards.includes(
|
|
197
|
-
(b) => b !=
|
|
195
|
+
const i = e[t], F = h.value[t];
|
|
196
|
+
F && !n.value.rewards.includes(i.id) && n.value.rewards.push(i.id), !F && n.value.rewards.includes(i.id) && (n.value.rewards = n.value.rewards.filter(
|
|
197
|
+
(b) => b != i.id
|
|
198
198
|
));
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
const h = x({});
|
|
202
|
-
return
|
|
202
|
+
return se(h, y, { deep: !0 }), f({
|
|
203
203
|
showSheet: O,
|
|
204
204
|
hideSheet: T,
|
|
205
205
|
data: n
|
|
206
206
|
}), (e, t) => {
|
|
207
|
-
const
|
|
208
|
-
return
|
|
207
|
+
const i = _("FmStepperField"), F = _("FmHelperText"), b = _("FmTable"), U = _("FmButton"), A = _("FmSideSheet");
|
|
208
|
+
return C(), j(A, {
|
|
209
209
|
"max-width": 1e3,
|
|
210
210
|
modelValue: r(m),
|
|
211
211
|
"onUpdate:modelValue": t[4] || (t[4] = (v) => z(m) ? m.value = v : null),
|
|
212
212
|
header: `${r(u) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
|
|
213
213
|
}, {
|
|
214
|
-
"side-sheet-footer":
|
|
215
|
-
a("div",
|
|
216
|
-
|
|
214
|
+
"side-sheet-footer": k(() => [
|
|
215
|
+
a("div", He, [
|
|
216
|
+
d(U, {
|
|
217
217
|
label: r(p)("connect.editTierSheet.submit"),
|
|
218
|
-
onClick:
|
|
218
|
+
onClick: G,
|
|
219
219
|
disabled: r(P).length > 0 || r(q)().isLoading,
|
|
220
220
|
loading: r(q)().isLoading
|
|
221
221
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
222
|
-
|
|
222
|
+
d(U, {
|
|
223
223
|
label: r(p)("connect.editTierSheet.cancel"),
|
|
224
224
|
onClick: t[3] || (t[3] = (v) => T()),
|
|
225
225
|
variant: "tertiary"
|
|
226
226
|
}, null, 8, ["label"])
|
|
227
227
|
])
|
|
228
228
|
]),
|
|
229
|
-
default:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
a("div",
|
|
229
|
+
default: k(() => [
|
|
230
|
+
d(X, { json: r(n) }, null, 8, ["json"]),
|
|
231
|
+
d(X, { json: r(P) }, null, 8, ["json"]),
|
|
232
|
+
a("div", Ge, [
|
|
233
233
|
a("div", null, [
|
|
234
|
-
a("div",
|
|
235
|
-
i
|
|
234
|
+
a("div", Me, [
|
|
235
|
+
d(i, {
|
|
236
236
|
modelValue: r(n).threshold.from,
|
|
237
237
|
"onUpdate:modelValue": t[0] || (t[0] = (v) => r(n).threshold.from = v),
|
|
238
238
|
"show-steppers": !1,
|
|
239
|
-
rules: [r(
|
|
239
|
+
rules: [r(M).ruleAtPath(r(V), "threshold.from")]
|
|
240
240
|
}, {
|
|
241
|
-
label:
|
|
242
|
-
(
|
|
243
|
-
r(
|
|
244
|
-
r(
|
|
241
|
+
label: k(() => [
|
|
242
|
+
(C(), j(ne(
|
|
243
|
+
r(M).toInputLabel(
|
|
244
|
+
r(M).typeAtPath(r(V), "threshold.from"),
|
|
245
245
|
r(p)(
|
|
246
246
|
"connect.referral.editReferralCountSheet.min_referral_count"
|
|
247
247
|
)
|
|
@@ -250,16 +250,16 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
250
250
|
]),
|
|
251
251
|
_: 1
|
|
252
252
|
}, 8, ["modelValue", "rules"]),
|
|
253
|
-
i
|
|
253
|
+
d(i, {
|
|
254
254
|
modelValue: r(n).threshold.to,
|
|
255
255
|
"onUpdate:modelValue": t[1] || (t[1] = (v) => r(n).threshold.to = v),
|
|
256
256
|
"show-steppers": !1,
|
|
257
|
-
rules: [r(
|
|
257
|
+
rules: [r(M).ruleAtPath(r(V), "threshold.to")]
|
|
258
258
|
}, {
|
|
259
|
-
label:
|
|
260
|
-
(
|
|
261
|
-
r(
|
|
262
|
-
r(
|
|
259
|
+
label: k(() => [
|
|
260
|
+
(C(), j(ne(
|
|
261
|
+
r(M).toInputLabel(
|
|
262
|
+
r(M).typeAtPath(r(V), "threshold.to"),
|
|
263
263
|
r(p)(
|
|
264
264
|
"connect.referral.editReferralCountSheet.max_referral_count"
|
|
265
265
|
)
|
|
@@ -269,14 +269,14 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
269
269
|
_: 1
|
|
270
270
|
}, 8, ["modelValue", "rules"])
|
|
271
271
|
]),
|
|
272
|
-
|
|
273
|
-
text: r(
|
|
274
|
-
state: r(
|
|
272
|
+
d(F, {
|
|
273
|
+
text: r(M).helperText(r(P), "option"),
|
|
274
|
+
state: r(M).helperState(r(P), "option")
|
|
275
275
|
}, null, 8, ["text", "state"]),
|
|
276
276
|
t[5] || (t[5] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " When max. referral count is not set, it will default unlimited ", -1))
|
|
277
277
|
]),
|
|
278
|
-
a("div",
|
|
279
|
-
|
|
278
|
+
a("div", Ne, E(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
|
|
279
|
+
d(b, {
|
|
280
280
|
modelValue: r(h),
|
|
281
281
|
"onUpdate:modelValue": t[2] || (t[2] = (v) => z(h) ? h.value = v : null),
|
|
282
282
|
selection: "multiple",
|
|
@@ -291,7 +291,7 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
291
291
|
}, 8, ["modelValue", "header"]);
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
}),
|
|
294
|
+
}), ze = { class: "space-y-16" }, qe = { class: "grid grid-cols-3 gap-16" }, We = { class: "fm-typo-en-title-sm-800" }, Je = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ Y({
|
|
295
295
|
__name: "CriteriaTriggerInput",
|
|
296
296
|
props: {
|
|
297
297
|
modelValue: {
|
|
@@ -303,32 +303,32 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
303
303
|
}
|
|
304
304
|
},
|
|
305
305
|
emits: ["update:model-value"],
|
|
306
|
-
setup(
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
].map((m) =>
|
|
306
|
+
setup(R, { emit: f }) {
|
|
307
|
+
const $ = R, p = f, g = D(() => [
|
|
308
|
+
le.enum.BILL_COMPLETED,
|
|
309
|
+
le.enum.FEEDBACK
|
|
310
|
+
].map((m) => Se[m]));
|
|
311
311
|
return (m, n) => {
|
|
312
312
|
const c = _("FmCard");
|
|
313
|
-
return
|
|
313
|
+
return C(), B("div", ze, [
|
|
314
314
|
n[0] || (n[0] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
|
|
315
|
-
a("div",
|
|
316
|
-
(
|
|
315
|
+
a("div", qe, [
|
|
316
|
+
(C(!0), B(H, null, te(r(g), (u) => (C(), j(c, {
|
|
317
317
|
key: u.name,
|
|
318
318
|
variant: "outlined",
|
|
319
|
-
disabled:
|
|
320
|
-
class:
|
|
319
|
+
disabled: $.disabled,
|
|
320
|
+
class: ie(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
321
321
|
"col-span-3": r(g).length == 1,
|
|
322
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]":
|
|
323
|
-
"hover:bg-fm-color-opacity-sm":
|
|
322
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": R.modelValue == u.value,
|
|
323
|
+
"hover:bg-fm-color-opacity-sm": R.modelValue != u.value
|
|
324
324
|
}]),
|
|
325
325
|
onClick: () => {
|
|
326
|
-
|
|
326
|
+
$.modelValue != u.value && !$.disabled && p("update:model-value", u.value);
|
|
327
327
|
}
|
|
328
328
|
}, {
|
|
329
|
-
default:
|
|
330
|
-
a("div",
|
|
331
|
-
a("div",
|
|
329
|
+
default: k(() => [
|
|
330
|
+
a("div", We, E(u.name), 1),
|
|
331
|
+
a("div", Je, E(u.description), 1)
|
|
332
332
|
]),
|
|
333
333
|
_: 2
|
|
334
334
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -336,14 +336,14 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
336
336
|
]);
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
}),
|
|
339
|
+
}), Ze = { class: "flex items-center gap-x-8" }, Qe = { class: "flex flex-col space-y-16 pr-12" }, Xe = {
|
|
340
340
|
key: 0,
|
|
341
341
|
class: "space-y-16"
|
|
342
|
-
},
|
|
342
|
+
}, et = { class: "flex items-center gap-8" }, tt = /* @__PURE__ */ Y({
|
|
343
343
|
__name: "EditCriteriaSheet",
|
|
344
344
|
emits: ["update"],
|
|
345
|
-
setup(
|
|
346
|
-
const { t: p } = W(), g =
|
|
345
|
+
setup(R, { expose: f, emit: $ }) {
|
|
346
|
+
const { t: p } = W(), g = $, m = x(!1), n = x(-1), c = x({}), u = Q(), S = xe.superRefine((w, s) => {
|
|
347
347
|
w.name.length >= 50 && s.addIssue({
|
|
348
348
|
code: "custom",
|
|
349
349
|
message: "Name must be less than 50 characters"
|
|
@@ -351,8 +351,8 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
351
351
|
code: "custom",
|
|
352
352
|
message: "Name is required"
|
|
353
353
|
});
|
|
354
|
-
}), V =
|
|
355
|
-
const w =
|
|
354
|
+
}), V = D(() => {
|
|
355
|
+
const w = S.safeParse(c.value);
|
|
356
356
|
return w.success ? [] : w.error.errors;
|
|
357
357
|
});
|
|
358
358
|
function P(w, s) {
|
|
@@ -360,17 +360,17 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
360
360
|
m.value = w, w && typeof s == "number" && s >= 0 ? (n.value = s, c.value = N(
|
|
361
361
|
(o = u.referralProgram) == null ? void 0 : o.criteria[s]
|
|
362
362
|
)) : (n.value = -1, c.value = {
|
|
363
|
-
_id: new
|
|
363
|
+
_id: new ke().toString(),
|
|
364
364
|
name: "",
|
|
365
365
|
type: "AUTO",
|
|
366
366
|
event: { type: "BILL_COMPLETED" }
|
|
367
367
|
});
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function G() {
|
|
370
370
|
m.value = !1;
|
|
371
371
|
}
|
|
372
372
|
function O() {
|
|
373
|
-
const w =
|
|
373
|
+
const w = S.safeParse(c.value);
|
|
374
374
|
w.success && g("update", n.value, w.data);
|
|
375
375
|
}
|
|
376
376
|
function T(w) {
|
|
@@ -378,18 +378,18 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
378
378
|
}
|
|
379
379
|
return f({
|
|
380
380
|
showSheet: P,
|
|
381
|
-
hideSheet:
|
|
381
|
+
hideSheet: G,
|
|
382
382
|
data: c
|
|
383
383
|
}), (w, s) => {
|
|
384
384
|
const o = _("FmButton"), l = _("FmRadio"), y = _("FmRadioGroup"), h = _("FmSideSheet");
|
|
385
|
-
return
|
|
385
|
+
return C(), j(h, {
|
|
386
386
|
"max-width": 768,
|
|
387
387
|
modelValue: r(m),
|
|
388
388
|
"onUpdate:modelValue": s[5] || (s[5] = (e) => z(m) ? m.value = e : null)
|
|
389
389
|
}, {
|
|
390
|
-
"side-sheet-header":
|
|
391
|
-
a("div",
|
|
392
|
-
|
|
390
|
+
"side-sheet-header": k(() => [
|
|
391
|
+
a("div", Ze, [
|
|
392
|
+
d(o, {
|
|
393
393
|
icon: "arrow_back",
|
|
394
394
|
variant: "tertiary",
|
|
395
395
|
onClick: s[0] || (s[0] = (e) => P(!1))
|
|
@@ -397,44 +397,44 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
397
397
|
s[6] || (s[6] = he("Add Criteria "))
|
|
398
398
|
])
|
|
399
399
|
]),
|
|
400
|
-
"side-sheet-footer":
|
|
401
|
-
a("div",
|
|
402
|
-
|
|
400
|
+
"side-sheet-footer": k(() => [
|
|
401
|
+
a("div", et, [
|
|
402
|
+
d(o, {
|
|
403
403
|
label: r(p)("connect.editTierSheet.submit"),
|
|
404
404
|
onClick: O,
|
|
405
405
|
disabled: r(V).length > 0 || r(q)().isLoading,
|
|
406
406
|
loading: r(q)().isLoading
|
|
407
407
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
408
|
-
|
|
408
|
+
d(o, {
|
|
409
409
|
label: r(p)("connect.editTierSheet.cancel"),
|
|
410
410
|
onClick: s[4] || (s[4] = (e) => P(!1)),
|
|
411
411
|
variant: "tertiary"
|
|
412
412
|
}, null, 8, ["label"])
|
|
413
413
|
])
|
|
414
414
|
]),
|
|
415
|
-
default:
|
|
416
|
-
|
|
417
|
-
a("div",
|
|
415
|
+
default: k(() => [
|
|
416
|
+
d(X, { json: r(c) }, null, 8, ["json"]),
|
|
417
|
+
a("div", Qe, [
|
|
418
418
|
s[10] || (s[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
|
|
419
|
-
|
|
419
|
+
d(Re, {
|
|
420
420
|
modelValue: r(c).name,
|
|
421
421
|
"onUpdate:modelValue": s[1] || (s[1] = (e) => r(c).name = e),
|
|
422
422
|
label: r(p)("connect.referral.editReferralTierSheet.name"),
|
|
423
|
-
schema: r(
|
|
423
|
+
schema: r(M).typeAtPath(r(S), "name")
|
|
424
424
|
}, null, 8, ["modelValue", "label", "schema"]),
|
|
425
425
|
s[11] || (s[11] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
|
|
426
|
-
|
|
426
|
+
d(y, {
|
|
427
427
|
"model-value": r(c).type,
|
|
428
428
|
label: "Verify status",
|
|
429
429
|
"onUpdate:modelValue": T
|
|
430
430
|
}, {
|
|
431
|
-
default:
|
|
432
|
-
|
|
431
|
+
default: k(() => [
|
|
432
|
+
d(l, {
|
|
433
433
|
value: "AUTO",
|
|
434
434
|
label: "Auto",
|
|
435
435
|
sublabel: "Verify based on rule configuration"
|
|
436
436
|
}),
|
|
437
|
-
|
|
437
|
+
d(l, {
|
|
438
438
|
value: "MANUAL",
|
|
439
439
|
label: "Manual",
|
|
440
440
|
sublabel: "Verify based on manual inspection"
|
|
@@ -442,21 +442,21 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
442
442
|
]),
|
|
443
443
|
_: 1
|
|
444
444
|
}, 8, ["model-value"]),
|
|
445
|
-
r(c).type == "AUTO" ? (
|
|
445
|
+
r(c).type == "AUTO" ? (C(), B(H, { key: 0 }, [
|
|
446
446
|
s[8] || (s[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
|
|
447
447
|
s[9] || (s[9] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
|
|
448
|
-
|
|
448
|
+
d(Ke, {
|
|
449
449
|
"model-value": r(c).event.type,
|
|
450
450
|
"onUpdate:modelValue": s[2] || (s[2] = (e) => r(c).event.type = e)
|
|
451
451
|
}, null, 8, ["model-value"]),
|
|
452
|
-
r(c).event.type == r(
|
|
452
|
+
r(c).event.type == r(ye).enum.BILL_COMPLETED ? (C(), B("div", Xe, [
|
|
453
453
|
s[7] || (s[7] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
|
|
454
|
-
|
|
454
|
+
d(Fe, {
|
|
455
455
|
"model-value": r(c).event.rule,
|
|
456
456
|
"onUpdate:modelValue": s[3] || (s[3] = (e) => r(c).event.rule = e)
|
|
457
457
|
}, null, 8, ["model-value"])
|
|
458
|
-
])) :
|
|
459
|
-
], 64)) :
|
|
458
|
+
])) : Z("", !0)
|
|
459
|
+
], 64)) : Z("", !0)
|
|
460
460
|
])
|
|
461
461
|
]),
|
|
462
462
|
_: 1
|
|
@@ -465,7 +465,7 @@ const ke = { class: "flex items-center justify-between flex-1 xs:hidden" }, Pe =
|
|
|
465
465
|
}
|
|
466
466
|
});
|
|
467
467
|
function fe() {
|
|
468
|
-
const
|
|
468
|
+
const R = x(!1), f = Ce();
|
|
469
469
|
return {
|
|
470
470
|
confirmUpdateReferralRecord: async () => {
|
|
471
471
|
await new Promise((p) => {
|
|
@@ -475,21 +475,21 @@ function fe() {
|
|
|
475
475
|
primaryActions: { text: "Update all", close: !0 },
|
|
476
476
|
secondaryActions: { text: "Update future only", close: !0 }
|
|
477
477
|
}).onPrimary(async () => {
|
|
478
|
-
|
|
478
|
+
R.value = !0, p();
|
|
479
479
|
}).onSecondary(async () => {
|
|
480
|
-
|
|
480
|
+
R.value = !1, p();
|
|
481
481
|
});
|
|
482
482
|
});
|
|
483
483
|
},
|
|
484
|
-
updateReferralRecord:
|
|
484
|
+
updateReferralRecord: R
|
|
485
485
|
};
|
|
486
486
|
}
|
|
487
|
-
const
|
|
487
|
+
const rt = { class: "flex flex-col space-y-16 mt-24" }, ot = { class: "flex justify-between items-center" }, at = /* @__PURE__ */ Y({
|
|
488
488
|
__name: "ManageCriteriaSheet",
|
|
489
|
-
setup(
|
|
490
|
-
const { t:
|
|
489
|
+
setup(R, { expose: f }) {
|
|
490
|
+
const { t: $ } = W(), { minor: p } = de, { confirmUpdateReferralRecord: g, updateReferralRecord: m } = fe(), n = x(!1), c = x({}), u = Q(), S = x(
|
|
491
491
|
null
|
|
492
|
-
), V =
|
|
492
|
+
), V = D(() => {
|
|
493
493
|
var o;
|
|
494
494
|
return (o = u.referralProgram) == null ? void 0 : o.criteria;
|
|
495
495
|
});
|
|
@@ -501,22 +501,22 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
501
501
|
}), await u.readReferralProgram();
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
|
-
async function
|
|
504
|
+
async function G(o, l) {
|
|
505
505
|
var e, t;
|
|
506
506
|
const y = o == -1 ? ((e = u.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = N(u.referralProgram);
|
|
507
|
-
h.criteria[y] = l, await P(h), (t =
|
|
507
|
+
h.criteria[y] = l, await P(h), (t = S.value) == null || t.showSheet(!1);
|
|
508
508
|
}
|
|
509
509
|
async function O(o) {
|
|
510
510
|
var h, e;
|
|
511
511
|
if (!await K.remove(
|
|
512
512
|
"Are you sure to remove criteria",
|
|
513
513
|
"Remove criteria",
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
$("connect.prompt.confirm"),
|
|
515
|
+
$("connect.prompt.cancel")
|
|
516
516
|
))
|
|
517
517
|
return;
|
|
518
518
|
const l = o == -1 ? ((h = u.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, y = N(u.referralProgram);
|
|
519
|
-
y.criteria.splice(l, 1), await P(y), (e =
|
|
519
|
+
y.criteria.splice(l, 1), await P(y), (e = S.value) == null || e.showSheet(!1);
|
|
520
520
|
}
|
|
521
521
|
const T = [
|
|
522
522
|
{
|
|
@@ -525,13 +525,18 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
525
525
|
},
|
|
526
526
|
{
|
|
527
527
|
header: "Validity method",
|
|
528
|
-
|
|
528
|
+
cell(o) {
|
|
529
|
+
return re(oe.FmChip, {
|
|
530
|
+
label: we.title(o.row.original.type),
|
|
531
|
+
variant: "plain"
|
|
532
|
+
});
|
|
533
|
+
}
|
|
529
534
|
},
|
|
530
535
|
{
|
|
531
536
|
header: "Actions",
|
|
532
537
|
cell(o) {
|
|
533
538
|
return [
|
|
534
|
-
|
|
539
|
+
re(oe.FmButton, {
|
|
535
540
|
variant: "tertiary",
|
|
536
541
|
icon: "delete",
|
|
537
542
|
iconColor: "neutral-gray-400",
|
|
@@ -555,61 +560,62 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
555
560
|
data: c
|
|
556
561
|
}), (o, l) => {
|
|
557
562
|
const y = _("FmButton"), h = _("FmTable"), e = _("FmSideSheet");
|
|
558
|
-
return
|
|
559
|
-
|
|
563
|
+
return C(), B(H, null, [
|
|
564
|
+
d(e, {
|
|
560
565
|
"max-width": 768,
|
|
561
566
|
modelValue: r(n),
|
|
562
567
|
"onUpdate:modelValue": l[2] || (l[2] = (t) => z(n) ? n.value = t : null),
|
|
563
568
|
header: "Manage Criteria"
|
|
564
569
|
}, {
|
|
565
|
-
default:
|
|
566
|
-
a("div",
|
|
567
|
-
a("div",
|
|
570
|
+
default: k(() => [
|
|
571
|
+
a("div", rt, [
|
|
572
|
+
a("div", ot, [
|
|
568
573
|
l[3] || (l[3] = a("div", null, [
|
|
569
574
|
a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
|
|
570
575
|
a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
|
|
571
576
|
], -1)),
|
|
572
|
-
|
|
577
|
+
d(y, {
|
|
573
578
|
label: "Add Criteria",
|
|
574
579
|
icon: "add",
|
|
575
580
|
variant: "secondary",
|
|
576
581
|
onClick: l[0] || (l[0] = (t) => {
|
|
577
|
-
var
|
|
578
|
-
return (
|
|
582
|
+
var i;
|
|
583
|
+
return (i = r(S)) == null ? void 0 : i.showSheet(!0);
|
|
579
584
|
})
|
|
580
585
|
})
|
|
581
586
|
]),
|
|
582
|
-
|
|
587
|
+
d(h, {
|
|
583
588
|
"row-data": r(V),
|
|
584
589
|
"hide-footer": !0,
|
|
585
590
|
"page-size": 100,
|
|
591
|
+
"shrink-at": !1,
|
|
586
592
|
"column-defs": T,
|
|
587
593
|
onRowClick: l[1] || (l[1] = (t) => {
|
|
588
|
-
var
|
|
589
|
-
return (
|
|
594
|
+
var i;
|
|
595
|
+
return (i = r(S)) == null ? void 0 : i.showSheet(!0, t.index);
|
|
590
596
|
})
|
|
591
597
|
}, null, 8, ["row-data"])
|
|
592
598
|
])
|
|
593
599
|
]),
|
|
594
600
|
_: 1
|
|
595
601
|
}, 8, ["modelValue"]),
|
|
596
|
-
|
|
602
|
+
d(tt, {
|
|
597
603
|
ref_key: "editCriteriaSheetRef",
|
|
598
|
-
ref:
|
|
599
|
-
onUpdate:
|
|
604
|
+
ref: S,
|
|
605
|
+
onUpdate: G
|
|
600
606
|
}, null, 512)
|
|
601
607
|
], 64);
|
|
602
608
|
};
|
|
603
609
|
}
|
|
604
|
-
}),
|
|
610
|
+
}), nt = { class: "flex flex-col space-y-16 pr-12" }, lt = { class: "fm-typo-en-title-sm-800" }, st = { class: "flex items-center gap-8" }, it = /* @__PURE__ */ Y({
|
|
605
611
|
__name: "EditRefereeRewardSheet",
|
|
606
612
|
emits: ["update"],
|
|
607
|
-
setup(
|
|
608
|
-
const { t: p } = W(), g =
|
|
613
|
+
setup(R, { expose: f, emit: $ }) {
|
|
614
|
+
const { t: p } = W(), g = $, m = x(!1), n = x([]), c = Q();
|
|
609
615
|
function u() {
|
|
610
616
|
g("update", n.value);
|
|
611
617
|
}
|
|
612
|
-
async function
|
|
618
|
+
async function S(o) {
|
|
613
619
|
var l, y;
|
|
614
620
|
m.value = o, n.value = ((y = (l = c.referralProgram) == null ? void 0 : l.refereeReward) == null ? void 0 : y.map((h) => h.toString())) || [], s.value = T.value.map((h) => n.value.includes(h.id));
|
|
615
621
|
}
|
|
@@ -626,7 +632,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
626
632
|
id: "type",
|
|
627
633
|
header: "Reward type",
|
|
628
634
|
cell(o) {
|
|
629
|
-
return
|
|
635
|
+
return ue[o.row.original.collectibleConfig.type].chip();
|
|
630
636
|
}
|
|
631
637
|
},
|
|
632
638
|
{
|
|
@@ -638,7 +644,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
638
644
|
return l.description;
|
|
639
645
|
}
|
|
640
646
|
}
|
|
641
|
-
],
|
|
647
|
+
], G = ce(), O = x([]), T = D(() => G.rewards.map((o) => {
|
|
642
648
|
let l = "No expiry";
|
|
643
649
|
switch (o.option.type) {
|
|
644
650
|
case "VOUCHER":
|
|
@@ -656,7 +662,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
656
662
|
description: l
|
|
657
663
|
};
|
|
658
664
|
}));
|
|
659
|
-
|
|
665
|
+
D(() => []);
|
|
660
666
|
function w() {
|
|
661
667
|
const o = T.value;
|
|
662
668
|
for (let l = 0; l < o.length; l++) {
|
|
@@ -665,38 +671,38 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
665
671
|
}
|
|
666
672
|
}
|
|
667
673
|
const s = x({});
|
|
668
|
-
return
|
|
669
|
-
showSheet:
|
|
674
|
+
return se(s, w, { deep: !0 }), f({
|
|
675
|
+
showSheet: S,
|
|
670
676
|
hideSheet: V,
|
|
671
677
|
data: n
|
|
672
678
|
}), (o, l) => {
|
|
673
679
|
const y = _("FmTable"), h = _("FmButton"), e = _("FmSideSheet");
|
|
674
|
-
return
|
|
680
|
+
return C(), j(e, {
|
|
675
681
|
"max-width": 1e3,
|
|
676
682
|
modelValue: r(m),
|
|
677
683
|
"onUpdate:modelValue": l[2] || (l[2] = (t) => z(m) ? m.value = t : null),
|
|
678
684
|
header: "Referee reward"
|
|
679
685
|
}, {
|
|
680
|
-
"side-sheet-footer":
|
|
681
|
-
a("div",
|
|
682
|
-
|
|
683
|
-
label: r(p)("connect.
|
|
686
|
+
"side-sheet-footer": k(() => [
|
|
687
|
+
a("div", st, [
|
|
688
|
+
d(h, {
|
|
689
|
+
label: r(p)("connect.common.save"),
|
|
684
690
|
onClick: u,
|
|
685
691
|
disabled: r(q)().isLoading,
|
|
686
692
|
loading: r(q)().isLoading
|
|
687
693
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
688
|
-
|
|
689
|
-
label: r(p)("connect.
|
|
694
|
+
d(h, {
|
|
695
|
+
label: r(p)("connect.common.cancel"),
|
|
690
696
|
onClick: l[1] || (l[1] = (t) => V()),
|
|
691
697
|
variant: "tertiary"
|
|
692
698
|
}, null, 8, ["label"])
|
|
693
699
|
])
|
|
694
700
|
]),
|
|
695
|
-
default:
|
|
696
|
-
|
|
697
|
-
a("div",
|
|
698
|
-
a("div",
|
|
699
|
-
|
|
701
|
+
default: k(() => [
|
|
702
|
+
d(X, { json: r(n) }, null, 8, ["json"]),
|
|
703
|
+
a("div", nt, [
|
|
704
|
+
a("div", lt, E(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
|
|
705
|
+
d(y, {
|
|
700
706
|
modelValue: r(s),
|
|
701
707
|
"onUpdate:modelValue": l[0] || (l[0] = (t) => z(s) ? s.value = t : null),
|
|
702
708
|
selection: "multiple",
|
|
@@ -711,19 +717,19 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
711
717
|
}, 8, ["modelValue"]);
|
|
712
718
|
};
|
|
713
719
|
}
|
|
714
|
-
}),
|
|
720
|
+
}), dt = { class: "fm-typo-en-title-sm-600" }, ct = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, ut = { class: "flex gap-x-8" }, mt = { class: "fm-typo-body-lg-600" }, ft = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pt = { class: "mb-40" }, ht = {
|
|
715
721
|
key: 0,
|
|
716
722
|
class: "flex flex-col items-center justify-center gap-y-16 p-24"
|
|
717
|
-
},
|
|
723
|
+
}, vt = { class: "flex flex-col gap-16 text-center" }, gt = { class: "fm-typo-en-title-sm-800" }, wt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = /* @__PURE__ */ Y({
|
|
718
724
|
__name: "Overview",
|
|
719
|
-
setup(
|
|
720
|
-
const { t: f } = W(), { minor:
|
|
725
|
+
setup(R) {
|
|
726
|
+
const { t: f } = W(), { minor: $ } = de, p = $e(), g = Q(), { confirmUpdateReferralRecord: m, updateReferralRecord: n } = fe(), c = D(() => {
|
|
721
727
|
var e;
|
|
722
728
|
return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
|
|
723
729
|
}), u = x(null);
|
|
724
730
|
x(null);
|
|
725
|
-
const
|
|
726
|
-
var e, t,
|
|
731
|
+
const S = x(null), V = x(null), P = x(null), G = D(() => {
|
|
732
|
+
var e, t, i, F;
|
|
727
733
|
return [
|
|
728
734
|
{
|
|
729
735
|
label: "connect.referral.how_it_works.generate_link",
|
|
@@ -732,7 +738,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
732
738
|
},
|
|
733
739
|
{
|
|
734
740
|
label: "connect.referral.how_it_works.referee_join_reward",
|
|
735
|
-
sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.
|
|
741
|
+
sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} reward(s)`,
|
|
736
742
|
action: f("connect.referral.actions.manage_reward"),
|
|
737
743
|
onClick: () => {
|
|
738
744
|
var b;
|
|
@@ -742,7 +748,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
742
748
|
},
|
|
743
749
|
{
|
|
744
750
|
label: "connect.referral.how_it_works.referee_meet_criteria",
|
|
745
|
-
sublabel: `${(
|
|
751
|
+
sublabel: `${(i = g.referralProgram) == null ? void 0 : i.criteria.length} criteria`,
|
|
746
752
|
action: f("connect.referral.actions.manage_criteria"),
|
|
747
753
|
onClick: () => {
|
|
748
754
|
var b;
|
|
@@ -763,56 +769,56 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
763
769
|
}
|
|
764
770
|
function T(e) {
|
|
765
771
|
var t;
|
|
766
|
-
(t =
|
|
772
|
+
(t = S.value) == null || t.showSheet(!0, {
|
|
767
773
|
groupIndex: e.groupIndex,
|
|
768
774
|
countIndex: e.countIndex
|
|
769
775
|
});
|
|
770
776
|
}
|
|
771
777
|
async function w(e) {
|
|
772
778
|
var v, I, L, J;
|
|
773
|
-
const t = e.countIndex == -1 ? ((I = (v = g.referralProgram) == null ? void 0 : v.reward[e.groupIndex]) == null ? void 0 : I.rewards.length) || 0 : e.countIndex || 0,
|
|
779
|
+
const t = e.countIndex == -1 ? ((I = (v = g.referralProgram) == null ? void 0 : v.reward[e.groupIndex]) == null ? void 0 : I.rewards.length) || 0 : e.countIndex || 0, i = e.referralCount, F = N(
|
|
774
780
|
g.referralProgram
|
|
775
781
|
), b = F.reward[e.groupIndex];
|
|
776
782
|
b.rewards[t] = e.referralCount;
|
|
777
783
|
const U = b.rewards[t - 1], A = b.rewards[t + 1];
|
|
778
|
-
if (U && U.threshold.to !=
|
|
784
|
+
if (U && U.threshold.to != i.threshold.from - 1) {
|
|
779
785
|
if (!await K.confirm(
|
|
780
786
|
f("connect.program.tier.update.range_discontinuous.previous", {
|
|
781
787
|
name: U.threshold.from,
|
|
782
788
|
from: U.threshold.from ?? 0,
|
|
783
789
|
to: U.threshold.to ?? 1 / 0,
|
|
784
|
-
newTo:
|
|
790
|
+
newTo: i.threshold.from - 1
|
|
785
791
|
}),
|
|
786
792
|
f("connect.program.tier.title"),
|
|
787
793
|
f("connect.program.tier.remove.next_range")
|
|
788
794
|
))
|
|
789
795
|
return;
|
|
790
|
-
U.threshold.to =
|
|
796
|
+
U.threshold.to = i.threshold.from - 1;
|
|
791
797
|
}
|
|
792
|
-
if (A && A.threshold.from - 1 !=
|
|
798
|
+
if (A && A.threshold.from - 1 != i.threshold.to) {
|
|
793
799
|
if (!await K.confirm(
|
|
794
800
|
f("connect.program.tier.update.range_discontinuous.next", {
|
|
795
801
|
name: A.threshold.from,
|
|
796
802
|
from: A.threshold.from ?? 0,
|
|
797
803
|
to: A.threshold.to ?? 1 / 0,
|
|
798
|
-
newFrom:
|
|
804
|
+
newFrom: i.threshold.to ?? 1
|
|
799
805
|
}),
|
|
800
806
|
f("connect.program.tier.title"),
|
|
801
807
|
f("connect.program.tier.remove.next_range"),
|
|
802
808
|
f("connect.prompt.cancel")
|
|
803
809
|
))
|
|
804
810
|
return;
|
|
805
|
-
A.threshold.from = (
|
|
811
|
+
A.threshold.from = (i.threshold.to ?? 0) + 1;
|
|
806
812
|
}
|
|
807
|
-
!A && !((L =
|
|
813
|
+
!A && !((L = i.threshold) != null && L.to) && (i.threshold.to = void 0), await o(F), (J = S.value) == null || J.hideSheet();
|
|
808
814
|
}
|
|
809
815
|
async function s(e) {
|
|
810
|
-
var
|
|
816
|
+
var i;
|
|
811
817
|
const t = N(g.referralProgram);
|
|
812
|
-
t.refereeReward = e, await o(t), (
|
|
818
|
+
t.refereeReward = e, await o(t), (i = P.value) == null || i.hideSheet();
|
|
813
819
|
}
|
|
814
820
|
async function o(e) {
|
|
815
|
-
await m(), await
|
|
821
|
+
await m(), await $(
|
|
816
822
|
async () => {
|
|
817
823
|
await me.update({
|
|
818
824
|
...e,
|
|
@@ -844,8 +850,8 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
844
850
|
f("connect.prompt.cancel")
|
|
845
851
|
))
|
|
846
852
|
return;
|
|
847
|
-
const
|
|
848
|
-
|
|
853
|
+
const i = N(g.referralProgram);
|
|
854
|
+
i.reward[e].rewards.splice(t, 1), await o(i);
|
|
849
855
|
}
|
|
850
856
|
const h = [
|
|
851
857
|
{
|
|
@@ -855,7 +861,10 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
855
861
|
{
|
|
856
862
|
header: "Rewards",
|
|
857
863
|
accessorKey: "type",
|
|
858
|
-
accessorFn: (e) =>
|
|
864
|
+
accessorFn: (e) => {
|
|
865
|
+
var t;
|
|
866
|
+
return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
|
|
867
|
+
}
|
|
859
868
|
},
|
|
860
869
|
{
|
|
861
870
|
id: "actions",
|
|
@@ -863,7 +872,7 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
863
872
|
textAlign: "right"
|
|
864
873
|
},
|
|
865
874
|
cell(e) {
|
|
866
|
-
return
|
|
875
|
+
return re(oe.FmButton, {
|
|
867
876
|
variant: "tertiary",
|
|
868
877
|
icon: "delete",
|
|
869
878
|
iconColor: "neutral-gray-400",
|
|
@@ -878,36 +887,37 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
878
887
|
return ve(async () => {
|
|
879
888
|
await g.readReferralProgram();
|
|
880
889
|
}), (e, t) => {
|
|
881
|
-
const
|
|
882
|
-
return
|
|
883
|
-
|
|
884
|
-
i
|
|
890
|
+
const i = _("FmCard"), F = _("FmIcon"), b = _("FmButton"), U = _("FmTable"), A = _("FmList");
|
|
891
|
+
return C(), B(H, null, [
|
|
892
|
+
Z("", !0),
|
|
893
|
+
d(i, {
|
|
885
894
|
variant: "outlined",
|
|
886
895
|
class: "flex flex-col gap-16 p-16"
|
|
887
896
|
}, {
|
|
888
|
-
default:
|
|
889
|
-
a("div",
|
|
890
|
-
a("div",
|
|
891
|
-
(
|
|
897
|
+
default: k(() => [
|
|
898
|
+
a("div", dt, E(r(f)("connect.referral.how_it_works.title")), 1),
|
|
899
|
+
a("div", ct, [
|
|
900
|
+
(C(!0), B(H, null, te(r(G), (v, I) => (C(), B("div", {
|
|
892
901
|
key: I,
|
|
893
|
-
class:
|
|
902
|
+
class: ie(["px-8", { "xs:!border-r": I % 2 == 0 }])
|
|
894
903
|
}, [
|
|
895
|
-
a("div",
|
|
896
|
-
|
|
904
|
+
a("div", ut, [
|
|
905
|
+
d(F, {
|
|
897
906
|
name: v.icon,
|
|
898
907
|
color: "primary",
|
|
899
908
|
class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
|
|
900
909
|
}, null, 8, ["name"]),
|
|
901
910
|
a("div", null, [
|
|
902
|
-
a("div",
|
|
903
|
-
a("div",
|
|
904
|
-
|
|
911
|
+
a("div", mt, E(r(f)(v.label)), 1),
|
|
912
|
+
a("div", ft, E(v.sublabel), 1),
|
|
913
|
+
v.action ? (C(), j(b, {
|
|
914
|
+
key: 0,
|
|
905
915
|
variant: "plain",
|
|
906
916
|
label: v.action,
|
|
907
917
|
disabled: !r(p).isPremium,
|
|
908
918
|
class: "fm-typo-en-body-md-400 !p-0",
|
|
909
919
|
onClick: v.onClick
|
|
910
|
-
}, null, 8, ["label", "disabled", "onClick"])
|
|
920
|
+
}, null, 8, ["label", "disabled", "onClick"])) : Z("", !0)
|
|
911
921
|
])
|
|
912
922
|
])
|
|
913
923
|
], 2))), 128))
|
|
@@ -915,15 +925,15 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
915
925
|
]),
|
|
916
926
|
_: 1
|
|
917
927
|
}),
|
|
918
|
-
r(c) && r(c).length > 0 ? (
|
|
928
|
+
r(c) && r(c).length > 0 ? (C(), j(i, {
|
|
919
929
|
key: 1,
|
|
920
930
|
variant: "outlined",
|
|
921
931
|
class: "flex flex-col gap-16 p-16"
|
|
922
932
|
}, {
|
|
923
|
-
default:
|
|
924
|
-
|
|
925
|
-
default:
|
|
926
|
-
(
|
|
933
|
+
default: k(() => [
|
|
934
|
+
d(A, { separator: !0 }, {
|
|
935
|
+
default: k(() => [
|
|
936
|
+
(C(!0), B(H, null, te(r(c), (v, I) => (C(), j(De, {
|
|
927
937
|
key: I,
|
|
928
938
|
"reward-group": v,
|
|
929
939
|
level: I,
|
|
@@ -933,9 +943,9 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
933
943
|
T({ groupIndex: L, countIndex: -1 });
|
|
934
944
|
})
|
|
935
945
|
}, {
|
|
936
|
-
default:
|
|
937
|
-
a("div",
|
|
938
|
-
|
|
946
|
+
default: k(() => [
|
|
947
|
+
a("div", pt, [
|
|
948
|
+
d(U, {
|
|
939
949
|
"row-data": v.rewards.map((L) => ({ ...L, groupIndex: I })),
|
|
940
950
|
"column-defs": h,
|
|
941
951
|
"hide-footer": !0,
|
|
@@ -943,12 +953,12 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
943
953
|
onRowClick: (L) => T({ groupIndex: I, countIndex: L.index })
|
|
944
954
|
}, null, 8, ["row-data", "onRowClick"])
|
|
945
955
|
]),
|
|
946
|
-
v.rewards.length ?
|
|
956
|
+
v.rewards.length ? Z("", !0) : (C(), B("div", ht, [
|
|
947
957
|
t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
|
|
948
958
|
a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
|
|
949
959
|
a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Add referral count to configure progression reward to the referral program ")
|
|
950
960
|
], -1)),
|
|
951
|
-
|
|
961
|
+
d(b, {
|
|
952
962
|
variant: "secondary",
|
|
953
963
|
label: "Add count",
|
|
954
964
|
icon: "add",
|
|
@@ -963,21 +973,21 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
963
973
|
})
|
|
964
974
|
]),
|
|
965
975
|
_: 1
|
|
966
|
-
})) : (
|
|
976
|
+
})) : (C(), j(i, {
|
|
967
977
|
key: 2,
|
|
968
978
|
variant: "outlined",
|
|
969
979
|
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
970
980
|
}, {
|
|
971
|
-
default:
|
|
981
|
+
default: k(() => [
|
|
972
982
|
t[4] || (t[4] = a("img", {
|
|
973
983
|
src: ge,
|
|
974
984
|
class: "aspect-square w-[150px]"
|
|
975
985
|
}, null, -1)),
|
|
976
|
-
a("div",
|
|
977
|
-
a("div",
|
|
978
|
-
a("div",
|
|
986
|
+
a("div", vt, [
|
|
987
|
+
a("div", gt, E(r(f)("connect.referral.referral_tier_title")), 1),
|
|
988
|
+
a("div", wt, E(r(f)("connect.referral.referral_tier_description")), 1)
|
|
979
989
|
]),
|
|
980
|
-
|
|
990
|
+
d(b, {
|
|
981
991
|
variant: "primary",
|
|
982
992
|
label: r(f)("connect.referral.add_referral_tier"),
|
|
983
993
|
icon: "add",
|
|
@@ -987,20 +997,20 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
987
997
|
]),
|
|
988
998
|
_: 1
|
|
989
999
|
})),
|
|
990
|
-
|
|
1000
|
+
d(_e, {
|
|
991
1001
|
ref_key: "rewardGroupRef",
|
|
992
1002
|
ref: u
|
|
993
1003
|
}, null, 512),
|
|
994
|
-
|
|
1004
|
+
d(Ye, {
|
|
995
1005
|
ref_key: "editReferralCountSheetRef",
|
|
996
|
-
ref:
|
|
1006
|
+
ref: S,
|
|
997
1007
|
onUpdate: w
|
|
998
1008
|
}, null, 512),
|
|
999
|
-
|
|
1009
|
+
d(at, {
|
|
1000
1010
|
ref_key: "manageCriteriaSheetRef",
|
|
1001
1011
|
ref: V
|
|
1002
1012
|
}, null, 512),
|
|
1003
|
-
|
|
1013
|
+
d(it, {
|
|
1004
1014
|
ref_key: "editRefereeRewardSheetRef",
|
|
1005
1015
|
ref: P,
|
|
1006
1016
|
onUpdate: s
|
|
@@ -1010,5 +1020,5 @@ const tt = { class: "flex flex-col space-y-16 pr-12" }, rt = { class: "flex just
|
|
|
1010
1020
|
}
|
|
1011
1021
|
});
|
|
1012
1022
|
export {
|
|
1013
|
-
|
|
1023
|
+
Ht as default
|
|
1014
1024
|
};
|