@feedmepos/mf-connect 0.1.0-beta.3 → 0.1.0-beta.31

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 (99) hide show
  1. package/dist/Analytic-C-QC9ivZ.js +424 -0
  2. package/dist/{App-gzbM97vW.js → App-NASVRSh2.js} +397 -384
  3. package/dist/{Broadcast-BwYZkTs0.js → Broadcast-Cffg7nbY.js} +32 -32
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DIh9rz6T.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CA4kVwMl.js} +8 -8
  5. package/dist/Card-CmYFb1_Y.js +897 -0
  6. package/dist/{Collections-Df6tlo8S.js → Collections-CibvGIpU.js} +4 -4
  7. package/dist/{Credit-BPel8vA9.js → Credit-Ck6i9ySs.js} +14 -14
  8. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  9. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B35zbHHI.js +2198 -0
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BT8ucS5G.js → EffectSheet.vue_vue_type_style_index_0_lang-CQV77_cx.js} +8 -8
  11. package/dist/{Experience-CPpz1Zwx.js → Experience-CWUX2QvS.js} +8 -8
  12. package/dist/{Game-ByLblISC.js → Game-D3cdZrlc.js} +15 -15
  13. package/dist/Index-CWLZiYXT.js +255 -0
  14. package/dist/Marketing-Bol8eY5d.js +20070 -0
  15. package/dist/{Member-CCc_FEZY.js → Member-Cso-T2Xk.js} +4 -4
  16. package/dist/MemberList-Bqns9wko.js +1045 -0
  17. package/dist/{MemberTransactions-DD5ahSbY.js → MemberTransactions-zNw-30Xu.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DSPvWk4C.js → MessageInput.vue_vue_type_script_setup_true_lang-BLS5fNr6.js} +2 -2
  19. package/dist/{Mission-VH4057I-.js → Mission-C0-K0A_5.js} +98 -86
  20. package/dist/Overview-fZ9NvFKz.js +1024 -0
  21. package/dist/{Point-Bu3IlpH4.js → Point-D3gGhQlP.js} +23 -23
  22. package/dist/{Promotion-B45AOHis.js → Promotion-COCJIfu-.js} +53 -47
  23. package/dist/Record-C0a4Cn1U.js +209 -0
  24. package/dist/Reward-D0G4CBYd.js +411 -0
  25. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-zSOwxAcS.js +151 -0
  26. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AmIdaAeX.js +1639 -0
  27. package/dist/Segment-eBM3aveX.js +567 -0
  28. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BgMuKAjE.js +181 -0
  29. package/dist/{Setting-CF09eRQJ.js → Setting-Dfye6fs5.js} +8 -8
  30. package/dist/Store-rQfwc8d6.js +1745 -0
  31. package/dist/{StoreRewards-0iGExjqQ.js → StoreRewards-DVTNMWdG.js} +12 -12
  32. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3dvBoXz2.js +957 -0
  33. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BEfxin47.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DxGIUrmO.js} +1 -1
  34. package/dist/{Tier-IaeWe7rM.js → Tier-DekrYu5l.js} +327 -317
  35. package/dist/{Title-DD67Zxh5.js → Title-oAWsBqoM.js} +199 -183
  36. package/dist/{Transaction-BsPDnLzB.js → Transaction-Ss2XCksi.js} +2 -2
  37. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-BMIqnBts.js +130 -0
  38. package/dist/{Voucher-M7JfcKo0.js → Voucher-CjPJxdw8.js} +31 -31
  39. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DlWCpoOp.js +419 -0
  40. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-k0lprU2i.js → ZodTextField.vue_vue_type_script_setup_true_lang-FXQNhMrv.js} +1 -1
  41. package/dist/{app-HFICF0vL.js → app-C_zlbFNe.js} +1285 -1283
  42. package/dist/{app-DwujUNP-.js → app-WUJQRyEM.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/{business-BaF1QJXa.js → business-C0e_E2xp.js} +1 -1
  45. package/dist/{campaign-CTDtmAE9.js → campaign-iWzbtNA5.js} +2 -2
  46. package/dist/collectible.enum-QITAo8Jg.js +19 -0
  47. package/dist/{collection.fn-DMW03W4R.js → collection.fn-R3hvasuZ.js} +2 -2
  48. package/dist/{dto-gpaNZHzQ.js → dto-D_tjJ72q.js} +78 -86
  49. package/dist/{effect-CBUmtwet.js → effect-_bpW5fmr.js} +9 -9
  50. package/dist/email-addresses-DUKn8uD0.js +705 -0
  51. package/dist/{export-Bdh_PbsW.js → export-CEBWZ8ko.js} +3 -3
  52. package/dist/{helper-Cu9elRvl.js → helper-CuF45pbY.js} +1 -1
  53. package/dist/{index-NXiDu42U.js → index-BO8RnVxy.js} +1 -1
  54. package/dist/{index-CArqG03W.js → index-BPc3wxOE.js} +39 -35
  55. package/dist/index-BXTQ6onZ.js +1067 -0
  56. package/dist/index-C4aPU80a.js +38 -0
  57. package/dist/{index-At6yms5t.js → index-CBzSPD25.js} +30 -26
  58. package/dist/{index-Ch6XwPzF.js → index-CR0ZVZQG.js} +1 -1
  59. package/dist/{index-DrGrOgZB.js → index-CXFwMV0s.js} +13 -1
  60. package/dist/index-CsaQJMAR.js +66 -0
  61. package/dist/{index-Dfdg2Q3E.js → index-Dh6xIUXJ.js} +1 -1
  62. package/dist/{index-ogzk-Mj4.js → index-LMvyNoHf.js} +1 -1
  63. package/dist/{index-Crw-Vgo5.js → index-S6sFiBxK.js} +1500 -1479
  64. package/dist/index-SpDFfOz_.js +54 -0
  65. package/dist/{index-CtH2S49l.js → index-Urbp7cdO.js} +203 -195
  66. package/dist/index-pHbs1GrF.js +29000 -0
  67. package/dist/{index.esm2017-CeJpvUbA.js → index.esm2017-BunOalUj.js} +33 -33
  68. package/dist/{loading-Cn8ml_vy.js → loading-CYFsZ9UB.js} +591 -597
  69. package/dist/{membership-CX4AKMlH.js → membership-C9089j0H.js} +51 -43
  70. package/dist/money-D-zGFohv.js +15 -0
  71. package/dist/number-UFl4zW6h.js +12 -0
  72. package/dist/objectid-BKIyQ5iE.js +145 -0
  73. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  74. package/dist/reward-LYKGLzXz.js +36 -0
  75. package/dist/{rule-Cv83Y59R.js → rule-BUUKmR4_.js} +180 -177
  76. package/dist/{rule-builder-Dew4yB5Q.js → rule-builder-9JUuOcMH.js} +1 -1
  77. package/dist/style.css +1 -1
  78. package/dist/{template-CSnbgM1o.js → template-CkXuF0cN.js} +5 -5
  79. package/dist/trigger-DjAx9efN.js +114 -0
  80. package/dist/user-DbsZta3D.js +54 -0
  81. package/dist/{vue-i18n-CNH_IhVd.js → vue-i18n-yYO72Mbp.js} +2 -2
  82. package/dist/{xlsx-D4DUZHix.js → xlsx-Dagi6ArS.js} +1 -1
  83. package/package.json +8 -7
  84. package/dist/Analytic-BC5BA6pN.js +0 -622
  85. package/dist/Card-CBYQGKwY.js +0 -825
  86. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-PsrS7I0r.js +0 -2809
  87. package/dist/Marketing-D0vm80e_.js +0 -316
  88. package/dist/MemberList-CrnipE9y.js +0 -1733
  89. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ijc2OYh9.js +0 -1753
  90. package/dist/Segment-ZWsp48aC.js +0 -437
  91. package/dist/Store-B_G6Dhmq.js +0 -1511
  92. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CaxUr9zl.js +0 -890
  93. package/dist/index-8MaN7rez.js +0 -762
  94. package/dist/index-BjdHxGDn.js +0 -298
  95. package/dist/index-CuvNtC_M.js +0 -61
  96. package/dist/index-RP0XOPRL.js +0 -29193
  97. package/dist/money-BTejgvKu.js +0 -15
  98. package/dist/number-Cen5TucC.js +0 -12
  99. package/dist/user-Bm4KttFq.js +0 -37
@@ -0,0 +1,1024 @@
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
+ import { _ as ge } from "./campaign-CpzFl8Vr.js";
3
+ import { u as W } from "./vue-i18n-yYO72Mbp.js";
4
+ import { c as we, p as K, u as de } from "./loading-CYFsZ9UB.js";
5
+ import { J as X } from "./JsonViewer-v8_C7l5N.js";
6
+ import { Z as M } from "./zod-Bg2FbC-D.js";
7
+ import { u as q } from "./app-wDQR6dpb.js";
8
+ import { u as Q, _ as _e } from "./RewardGroup.vue_vue_type_script_setup_true_lang-zSOwxAcS.js";
9
+ import { u as ce } from "./reward-LYKGLzXz.js";
10
+ import "./index-CBzSPD25.js";
11
+ import "./index-S6sFiBxK.js";
12
+ import { l as le, m as ye } from "./index-BXTQ6onZ.js";
13
+ import "./index-BPc3wxOE.js";
14
+ import { a as be, b as xe } from "./index-Urbp7cdO.js";
15
+ import "./index-LMvyNoHf.js";
16
+ import "./index-SpDFfOz_.js";
17
+ import { C as ue } from "./membership-C9089j0H.js";
18
+ import { t as ee } from "./helper-CuF45pbY.js";
19
+ import { c as N } from "./object-qECH92oz.js";
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-FXQNhMrv.js";
22
+ import { a as Se, _ as Fe } from "./trigger-DjAx9efN.js";
23
+ import { O as ke } from "./objectid-BKIyQ5iE.js";
24
+ import { r as me } from "./index-C4aPU80a.js";
25
+ import { u as $e } from "./business-C0e_E2xp.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
+ __name: "ReferralRewadGroupCard",
28
+ props: {
29
+ rewardGroup: {
30
+ type: Object,
31
+ required: !0
32
+ },
33
+ level: {
34
+ type: Number,
35
+ required: !0
36
+ }
37
+ },
38
+ emits: ["edit", "addCount", "remove"],
39
+ setup(R, { emit: f }) {
40
+ const { t: $ } = W(), p = f;
41
+ return (g, m) => {
42
+ const n = _("FmButton"), c = _("FmListItem");
43
+ return C(), B(H, null, [
44
+ d(c, {
45
+ onClick: m[4] || (m[4] = (u) => p("edit", R.level)),
46
+ class: "!p-0"
47
+ }, {
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
+ ])
55
+ ])
56
+ ]),
57
+ a("div", Ae, [
58
+ d(n, {
59
+ variant: "secondary",
60
+ label: r($)("connect.referral.reward.add_count"),
61
+ icon: "add",
62
+ onClick: m[0] || (m[0] = (u) => {
63
+ u.stopPropagation(), p("addCount", R.level);
64
+ })
65
+ }, null, 8, ["label"]),
66
+ d(n, {
67
+ icon: "delete",
68
+ onClick: m[1] || (m[1] = (u) => {
69
+ u.stopPropagation(), p("remove", R.level);
70
+ }),
71
+ variant: "tertiary"
72
+ })
73
+ ])
74
+ ]),
75
+ a("div", Le, [
76
+ a("div", Be, [
77
+ a("div", Ee, [
78
+ a("div", Oe, [
79
+ a("div", null, [
80
+ a("div", je, E(R.rewardGroup.name), 1)
81
+ ])
82
+ ])
83
+ ]),
84
+ d(n, {
85
+ variant: "tertiary",
86
+ icon: "delete",
87
+ onClick: m[2] || (m[2] = (u) => (u.stopPropagation(), p("remove", R.level)))
88
+ })
89
+ ]),
90
+ d(n, {
91
+ class: "w-full",
92
+ variant: "secondary",
93
+ label: "Add count",
94
+ disabled: !0,
95
+ icon: "add",
96
+ onClick: m[3] || (m[3] = (u) => (u.stopPropagation(), p("addCount", R.level)))
97
+ })
98
+ ])
99
+ ]),
100
+ _: 1
101
+ }),
102
+ pe(g.$slots, "default")
103
+ ], 64);
104
+ };
105
+ }
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
+ __name: "EditReferralCountSheet",
108
+ emits: ["update"],
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
+ F && e.threshold.from < F.threshold.from + 1 && t.addIssue({
114
+ code: "custom",
115
+ message: `The min referral must be at least ${F.threshold.from + 1}`,
116
+ path: ["option"]
117
+ }), b && e.threshold.to && b.threshold.to && e.threshold.to > b.threshold.to - 1 && t.addIssue({
118
+ code: "custom",
119
+ message: `The max referral must be at most ${b.threshold.to - 2}`,
120
+ path: ["option"]
121
+ });
122
+ }), P = D(() => {
123
+ const e = V.safeParse(n.value);
124
+ return e.success ? [] : e.error.errors;
125
+ });
126
+ function G() {
127
+ const e = V.safeParse(n.value);
128
+ e.success && g("update", {
129
+ groupIndex: c.value,
130
+ countIndex: u.value,
131
+ referralCount: e.data
132
+ });
133
+ }
134
+ async function O(e, t) {
135
+ var i;
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
+ (i = S.referralProgram) == null ? void 0 : i.reward[t.groupIndex].rewards[t.countIndex]
138
+ )) : (c.value = t.groupIndex, u.value = -1, n.value = {
139
+ threshold: {
140
+ from: 1,
141
+ to: null
142
+ },
143
+ rewards: []
144
+ }), h.value = [], h.value = l.value.map(
145
+ (F) => n.value.rewards.includes(F.id)
146
+ );
147
+ }
148
+ function T() {
149
+ m.value = !1;
150
+ }
151
+ const w = [
152
+ {
153
+ header: "Reward title",
154
+ accessorFn: (e) => e.name,
155
+ enableSorting: !0
156
+ },
157
+ {
158
+ id: "type",
159
+ header: "Reward type",
160
+ cell(e) {
161
+ return ue[e.row.original.collectibleConfig.type].chip();
162
+ }
163
+ },
164
+ {
165
+ header: "Description",
166
+ accessorFn: (e) => e.description,
167
+ cell(e) {
168
+ const t = e.row.original;
169
+ if (t.collectible.type == "VOUCHER" || t.selectedReward == null)
170
+ return t.description;
171
+ }
172
+ }
173
+ ], s = ce(), o = x([]), l = D(() => s.rewards.map((e) => {
174
+ let t = "No expiry";
175
+ switch (e.option.type) {
176
+ case "VOUCHER":
177
+ t = `${e.option.collectibleConfig.options.maxUse} use(s), ${ee(e.option.collectibleConfig.options.validityOption || {})}`;
178
+ break;
179
+ case "LOYALTY":
180
+ t = `${e.option.earningOption.amount}, ${ee(e.option.validityOption || {})}`;
181
+ break;
182
+ }
183
+ return {
184
+ id: e._id,
185
+ name: e.name,
186
+ collectible: e.option,
187
+ collectibleConfig: e.collectibleConfig,
188
+ description: t
189
+ };
190
+ }));
191
+ D(() => []);
192
+ function y() {
193
+ const e = l.value;
194
+ for (let t = 0; t < e.length; t++) {
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
+ ));
199
+ }
200
+ }
201
+ const h = x({});
202
+ return se(h, y, { deep: !0 }), f({
203
+ showSheet: O,
204
+ hideSheet: T,
205
+ data: n
206
+ }), (e, t) => {
207
+ const i = _("FmStepperField"), F = _("FmHelperText"), b = _("FmTable"), U = _("FmButton"), A = _("FmSideSheet");
208
+ return C(), j(A, {
209
+ "max-width": 1e3,
210
+ modelValue: r(m),
211
+ "onUpdate:modelValue": t[4] || (t[4] = (v) => z(m) ? m.value = v : null),
212
+ header: `${r(u) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
213
+ }, {
214
+ "side-sheet-footer": k(() => [
215
+ a("div", He, [
216
+ d(U, {
217
+ label: r(p)("connect.editTierSheet.submit"),
218
+ onClick: G,
219
+ disabled: r(P).length > 0 || r(q)().isLoading,
220
+ loading: r(q)().isLoading
221
+ }, null, 8, ["label", "disabled", "loading"]),
222
+ d(U, {
223
+ label: r(p)("connect.editTierSheet.cancel"),
224
+ onClick: t[3] || (t[3] = (v) => T()),
225
+ variant: "tertiary"
226
+ }, null, 8, ["label"])
227
+ ])
228
+ ]),
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
+ a("div", null, [
234
+ a("div", Me, [
235
+ d(i, {
236
+ modelValue: r(n).threshold.from,
237
+ "onUpdate:modelValue": t[0] || (t[0] = (v) => r(n).threshold.from = v),
238
+ "show-steppers": !1,
239
+ rules: [r(M).ruleAtPath(r(V), "threshold.from")]
240
+ }, {
241
+ label: k(() => [
242
+ (C(), j(ne(
243
+ r(M).toInputLabel(
244
+ r(M).typeAtPath(r(V), "threshold.from"),
245
+ r(p)(
246
+ "connect.referral.editReferralCountSheet.min_referral_count"
247
+ )
248
+ )
249
+ )))
250
+ ]),
251
+ _: 1
252
+ }, 8, ["modelValue", "rules"]),
253
+ d(i, {
254
+ modelValue: r(n).threshold.to,
255
+ "onUpdate:modelValue": t[1] || (t[1] = (v) => r(n).threshold.to = v),
256
+ "show-steppers": !1,
257
+ rules: [r(M).ruleAtPath(r(V), "threshold.to")]
258
+ }, {
259
+ label: k(() => [
260
+ (C(), j(ne(
261
+ r(M).toInputLabel(
262
+ r(M).typeAtPath(r(V), "threshold.to"),
263
+ r(p)(
264
+ "connect.referral.editReferralCountSheet.max_referral_count"
265
+ )
266
+ )
267
+ )))
268
+ ]),
269
+ _: 1
270
+ }, 8, ["modelValue", "rules"])
271
+ ]),
272
+ d(F, {
273
+ text: r(M).helperText(r(P), "option"),
274
+ state: r(M).helperState(r(P), "option")
275
+ }, null, 8, ["text", "state"]),
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
+ ]),
278
+ a("div", Ne, E(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
279
+ d(b, {
280
+ modelValue: r(h),
281
+ "onUpdate:modelValue": t[2] || (t[2] = (v) => z(h) ? h.value = v : null),
282
+ selection: "multiple",
283
+ "column-filter": r(o),
284
+ "column-defs": w,
285
+ "row-data": r(l),
286
+ "page-size": 10
287
+ }, null, 8, ["modelValue", "column-filter", "row-data"])
288
+ ])
289
+ ]),
290
+ _: 1
291
+ }, 8, ["modelValue", "header"]);
292
+ };
293
+ }
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
+ __name: "CriteriaTriggerInput",
296
+ props: {
297
+ modelValue: {
298
+ type: String
299
+ },
300
+ disabled: {
301
+ type: Boolean,
302
+ default: !1
303
+ }
304
+ },
305
+ emits: ["update:model-value"],
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
+ return (m, n) => {
312
+ const c = _("FmCard");
313
+ return C(), B("div", ze, [
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", qe, [
316
+ (C(!0), B(H, null, te(r(g), (u) => (C(), j(c, {
317
+ key: u.name,
318
+ variant: "outlined",
319
+ disabled: $.disabled,
320
+ class: ie(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
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)]": R.modelValue == u.value,
323
+ "hover:bg-fm-color-opacity-sm": R.modelValue != u.value
324
+ }]),
325
+ onClick: () => {
326
+ $.modelValue != u.value && !$.disabled && p("update:model-value", u.value);
327
+ }
328
+ }, {
329
+ default: k(() => [
330
+ a("div", We, E(u.name), 1),
331
+ a("div", Je, E(u.description), 1)
332
+ ]),
333
+ _: 2
334
+ }, 1032, ["disabled", "class", "onClick"]))), 128))
335
+ ])
336
+ ]);
337
+ };
338
+ }
339
+ }), Ze = { class: "flex items-center gap-x-8" }, Qe = { class: "flex flex-col space-y-16 pr-12" }, Xe = {
340
+ key: 0,
341
+ class: "space-y-16"
342
+ }, et = { class: "flex items-center gap-8" }, tt = /* @__PURE__ */ Y({
343
+ __name: "EditCriteriaSheet",
344
+ emits: ["update"],
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
+ w.name.length >= 50 && s.addIssue({
348
+ code: "custom",
349
+ message: "Name must be less than 50 characters"
350
+ }), w.name.length < 1 && s.addIssue({
351
+ code: "custom",
352
+ message: "Name is required"
353
+ });
354
+ }), V = D(() => {
355
+ const w = S.safeParse(c.value);
356
+ return w.success ? [] : w.error.errors;
357
+ });
358
+ function P(w, s) {
359
+ var o;
360
+ m.value = w, w && typeof s == "number" && s >= 0 ? (n.value = s, c.value = N(
361
+ (o = u.referralProgram) == null ? void 0 : o.criteria[s]
362
+ )) : (n.value = -1, c.value = {
363
+ _id: new ke().toString(),
364
+ name: "",
365
+ type: "AUTO",
366
+ event: { type: "BILL_COMPLETED" }
367
+ });
368
+ }
369
+ function G() {
370
+ m.value = !1;
371
+ }
372
+ function O() {
373
+ const w = S.safeParse(c.value);
374
+ w.success && g("update", n.value, w.data);
375
+ }
376
+ function T(w) {
377
+ c.value.type = w, w == "AUTO" ? c.value.event = { type: "BILL_COMPLETED" } : c.value.event = void 0;
378
+ }
379
+ return f({
380
+ showSheet: P,
381
+ hideSheet: G,
382
+ data: c
383
+ }), (w, s) => {
384
+ const o = _("FmButton"), l = _("FmRadio"), y = _("FmRadioGroup"), h = _("FmSideSheet");
385
+ return C(), j(h, {
386
+ "max-width": 768,
387
+ modelValue: r(m),
388
+ "onUpdate:modelValue": s[5] || (s[5] = (e) => z(m) ? m.value = e : null)
389
+ }, {
390
+ "side-sheet-header": k(() => [
391
+ a("div", Ze, [
392
+ d(o, {
393
+ icon: "arrow_back",
394
+ variant: "tertiary",
395
+ onClick: s[0] || (s[0] = (e) => P(!1))
396
+ }),
397
+ s[6] || (s[6] = he("Add Criteria "))
398
+ ])
399
+ ]),
400
+ "side-sheet-footer": k(() => [
401
+ a("div", et, [
402
+ d(o, {
403
+ label: r(p)("connect.editTierSheet.submit"),
404
+ onClick: O,
405
+ disabled: r(V).length > 0 || r(q)().isLoading,
406
+ loading: r(q)().isLoading
407
+ }, null, 8, ["label", "disabled", "loading"]),
408
+ d(o, {
409
+ label: r(p)("connect.editTierSheet.cancel"),
410
+ onClick: s[4] || (s[4] = (e) => P(!1)),
411
+ variant: "tertiary"
412
+ }, null, 8, ["label"])
413
+ ])
414
+ ]),
415
+ default: k(() => [
416
+ d(X, { json: r(c) }, null, 8, ["json"]),
417
+ a("div", Qe, [
418
+ s[10] || (s[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
419
+ d(Re, {
420
+ modelValue: r(c).name,
421
+ "onUpdate:modelValue": s[1] || (s[1] = (e) => r(c).name = e),
422
+ label: r(p)("connect.referral.editReferralTierSheet.name"),
423
+ schema: r(M).typeAtPath(r(S), "name")
424
+ }, null, 8, ["modelValue", "label", "schema"]),
425
+ s[11] || (s[11] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
426
+ d(y, {
427
+ "model-value": r(c).type,
428
+ label: "Verify status",
429
+ "onUpdate:modelValue": T
430
+ }, {
431
+ default: k(() => [
432
+ d(l, {
433
+ value: "AUTO",
434
+ label: "Auto",
435
+ sublabel: "Verify based on rule configuration"
436
+ }),
437
+ d(l, {
438
+ value: "MANUAL",
439
+ label: "Manual",
440
+ sublabel: "Verify based on manual inspection"
441
+ })
442
+ ]),
443
+ _: 1
444
+ }, 8, ["model-value"]),
445
+ r(c).type == "AUTO" ? (C(), B(H, { key: 0 }, [
446
+ s[8] || (s[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
447
+ s[9] || (s[9] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
448
+ d(Ke, {
449
+ "model-value": r(c).event.type,
450
+ "onUpdate:modelValue": s[2] || (s[2] = (e) => r(c).event.type = e)
451
+ }, null, 8, ["model-value"]),
452
+ r(c).event.type == r(ye).enum.BILL_COMPLETED ? (C(), B("div", Xe, [
453
+ s[7] || (s[7] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
454
+ d(Fe, {
455
+ "model-value": r(c).event.rule,
456
+ "onUpdate:modelValue": s[3] || (s[3] = (e) => r(c).event.rule = e)
457
+ }, null, 8, ["model-value"])
458
+ ])) : Z("", !0)
459
+ ], 64)) : Z("", !0)
460
+ ])
461
+ ]),
462
+ _: 1
463
+ }, 8, ["modelValue"]);
464
+ };
465
+ }
466
+ });
467
+ function fe() {
468
+ const R = x(!1), f = Ce();
469
+ return {
470
+ confirmUpdateReferralRecord: async () => {
471
+ await new Promise((p) => {
472
+ f.open({
473
+ title: "Confirmation",
474
+ message: "This will change all referral settings? Would you like to update previous referral record?",
475
+ primaryActions: { text: "Update all", close: !0 },
476
+ secondaryActions: { text: "Update future only", close: !0 }
477
+ }).onPrimary(async () => {
478
+ R.value = !0, p();
479
+ }).onSecondary(async () => {
480
+ R.value = !1, p();
481
+ });
482
+ });
483
+ },
484
+ updateReferralRecord: R
485
+ };
486
+ }
487
+ const rt = { class: "flex flex-col space-y-16 mt-24" }, ot = { class: "flex justify-between items-center" }, at = /* @__PURE__ */ Y({
488
+ __name: "ManageCriteriaSheet",
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
+ null
492
+ ), V = D(() => {
493
+ var o;
494
+ return (o = u.referralProgram) == null ? void 0 : o.criteria;
495
+ });
496
+ async function P(o) {
497
+ await g(), await p(async () => {
498
+ await me.update({
499
+ ...o,
500
+ updateReferralRecord: m.value
501
+ }), await u.readReferralProgram();
502
+ });
503
+ }
504
+ async function G(o, l) {
505
+ var e, t;
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 = S.value) == null || t.showSheet(!1);
508
+ }
509
+ async function O(o) {
510
+ var h, e;
511
+ if (!await K.remove(
512
+ "Are you sure to remove criteria",
513
+ "Remove criteria",
514
+ $("connect.prompt.confirm"),
515
+ $("connect.prompt.cancel")
516
+ ))
517
+ return;
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 = S.value) == null || e.showSheet(!1);
520
+ }
521
+ const T = [
522
+ {
523
+ header: "Criteria title",
524
+ accessorFn: (o) => o.name
525
+ },
526
+ {
527
+ header: "Validity method",
528
+ cell(o) {
529
+ return re(oe.FmChip, {
530
+ label: we.title(o.row.original.type),
531
+ variant: "plain"
532
+ });
533
+ }
534
+ },
535
+ {
536
+ header: "Actions",
537
+ cell(o) {
538
+ return [
539
+ re(oe.FmButton, {
540
+ variant: "tertiary",
541
+ icon: "delete",
542
+ iconColor: "neutral-gray-400",
543
+ onClick: (l) => {
544
+ l.stopPropagation(), O(o.row.index);
545
+ }
546
+ })
547
+ ];
548
+ }
549
+ }
550
+ ];
551
+ function w(o) {
552
+ n.value = o;
553
+ }
554
+ function s() {
555
+ n.value = !1;
556
+ }
557
+ return f({
558
+ showSheet: w,
559
+ hideSheet: s,
560
+ data: c
561
+ }), (o, l) => {
562
+ const y = _("FmButton"), h = _("FmTable"), e = _("FmSideSheet");
563
+ return C(), B(H, null, [
564
+ d(e, {
565
+ "max-width": 768,
566
+ modelValue: r(n),
567
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => z(n) ? n.value = t : null),
568
+ header: "Manage Criteria"
569
+ }, {
570
+ default: k(() => [
571
+ a("div", rt, [
572
+ a("div", ot, [
573
+ l[3] || (l[3] = a("div", null, [
574
+ a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
575
+ a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
576
+ ], -1)),
577
+ d(y, {
578
+ label: "Add Criteria",
579
+ icon: "add",
580
+ variant: "secondary",
581
+ onClick: l[0] || (l[0] = (t) => {
582
+ var i;
583
+ return (i = r(S)) == null ? void 0 : i.showSheet(!0);
584
+ })
585
+ })
586
+ ]),
587
+ d(h, {
588
+ "row-data": r(V),
589
+ "hide-footer": !0,
590
+ "page-size": 100,
591
+ "shrink-at": !1,
592
+ "column-defs": T,
593
+ onRowClick: l[1] || (l[1] = (t) => {
594
+ var i;
595
+ return (i = r(S)) == null ? void 0 : i.showSheet(!0, t.index);
596
+ })
597
+ }, null, 8, ["row-data"])
598
+ ])
599
+ ]),
600
+ _: 1
601
+ }, 8, ["modelValue"]),
602
+ d(tt, {
603
+ ref_key: "editCriteriaSheetRef",
604
+ ref: S,
605
+ onUpdate: G
606
+ }, null, 512)
607
+ ], 64);
608
+ };
609
+ }
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({
611
+ __name: "EditRefereeRewardSheet",
612
+ emits: ["update"],
613
+ setup(R, { expose: f, emit: $ }) {
614
+ const { t: p } = W(), g = $, m = x(!1), n = x([]), c = Q();
615
+ function u() {
616
+ g("update", n.value);
617
+ }
618
+ async function S(o) {
619
+ var l, y;
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));
621
+ }
622
+ function V() {
623
+ m.value = !1;
624
+ }
625
+ const P = [
626
+ {
627
+ header: "Reward title",
628
+ accessorFn: (o) => o.name,
629
+ enableSorting: !0
630
+ },
631
+ {
632
+ id: "type",
633
+ header: "Reward type",
634
+ cell(o) {
635
+ return ue[o.row.original.collectibleConfig.type].chip();
636
+ }
637
+ },
638
+ {
639
+ header: "Description",
640
+ accessorFn: (o) => o.description,
641
+ cell(o) {
642
+ const l = o.row.original;
643
+ if (l.collectible.type == "VOUCHER" || l.selectedReward == null)
644
+ return l.description;
645
+ }
646
+ }
647
+ ], G = ce(), O = x([]), T = D(() => G.rewards.map((o) => {
648
+ let l = "No expiry";
649
+ switch (o.option.type) {
650
+ case "VOUCHER":
651
+ l = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
652
+ break;
653
+ case "LOYALTY":
654
+ l = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
655
+ break;
656
+ }
657
+ return {
658
+ id: o._id,
659
+ name: o.name,
660
+ collectible: o.option,
661
+ collectibleConfig: o.collectibleConfig,
662
+ description: l
663
+ };
664
+ }));
665
+ D(() => []);
666
+ function w() {
667
+ const o = T.value;
668
+ for (let l = 0; l < o.length; l++) {
669
+ const y = o[l], h = s.value[l];
670
+ h && !n.value.includes(y.id) && n.value.push(y.id), !h && n.value.includes(y.id) && (n.value = n.value.filter((e) => e != y.id));
671
+ }
672
+ }
673
+ const s = x({});
674
+ return se(s, w, { deep: !0 }), f({
675
+ showSheet: S,
676
+ hideSheet: V,
677
+ data: n
678
+ }), (o, l) => {
679
+ const y = _("FmTable"), h = _("FmButton"), e = _("FmSideSheet");
680
+ return C(), j(e, {
681
+ "max-width": 1e3,
682
+ modelValue: r(m),
683
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => z(m) ? m.value = t : null),
684
+ header: "Referee reward"
685
+ }, {
686
+ "side-sheet-footer": k(() => [
687
+ a("div", st, [
688
+ d(h, {
689
+ label: r(p)("connect.common.save"),
690
+ onClick: u,
691
+ disabled: r(q)().isLoading,
692
+ loading: r(q)().isLoading
693
+ }, null, 8, ["label", "disabled", "loading"]),
694
+ d(h, {
695
+ label: r(p)("connect.common.cancel"),
696
+ onClick: l[1] || (l[1] = (t) => V()),
697
+ variant: "tertiary"
698
+ }, null, 8, ["label"])
699
+ ])
700
+ ]),
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, {
706
+ modelValue: r(s),
707
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => z(s) ? s.value = t : null),
708
+ selection: "multiple",
709
+ "column-filter": r(O),
710
+ "column-defs": P,
711
+ "row-data": r(T),
712
+ "page-size": 10
713
+ }, null, 8, ["modelValue", "column-filter", "row-data"])
714
+ ])
715
+ ]),
716
+ _: 1
717
+ }, 8, ["modelValue"]);
718
+ };
719
+ }
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 = {
721
+ key: 0,
722
+ class: "flex flex-col items-center justify-center gap-y-16 p-24"
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({
724
+ __name: "Overview",
725
+ setup(R) {
726
+ const { t: f } = W(), { minor: $ } = de, p = $e(), g = Q(), { confirmUpdateReferralRecord: m, updateReferralRecord: n } = fe(), c = D(() => {
727
+ var e;
728
+ return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
729
+ }), u = x(null);
730
+ x(null);
731
+ const S = x(null), V = x(null), P = x(null), G = D(() => {
732
+ var e, t, i, F;
733
+ return [
734
+ {
735
+ label: "connect.referral.how_it_works.generate_link",
736
+ sublabel: f("connect.referral.how_it_works.generate_link_for_member"),
737
+ icon: "offline_share"
738
+ },
739
+ {
740
+ label: "connect.referral.how_it_works.referee_join_reward",
741
+ sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} reward(s)`,
742
+ action: f("connect.referral.actions.manage_reward"),
743
+ onClick: () => {
744
+ var b;
745
+ return (b = P.value) == null ? void 0 : b.showSheet(!0);
746
+ },
747
+ icon: "group_add"
748
+ },
749
+ {
750
+ label: "connect.referral.how_it_works.referee_meet_criteria",
751
+ sublabel: `${(i = g.referralProgram) == null ? void 0 : i.criteria.length} criteria`,
752
+ action: f("connect.referral.actions.manage_criteria"),
753
+ onClick: () => {
754
+ var b;
755
+ return (b = V.value) == null ? void 0 : b.showSheet(!0);
756
+ },
757
+ icon: "checklist_rtl"
758
+ },
759
+ {
760
+ label: "connect.referral.how_it_works.referer_get_reward",
761
+ sublabel: `${(F = g.referralProgram) == null ? void 0 : F.reward.length} configured tier(s)`,
762
+ icon: "featured_seasonal_and_gifts"
763
+ }
764
+ ];
765
+ });
766
+ function O(e) {
767
+ var t;
768
+ (t = u.value) == null || t.onManageRewardGroup(e);
769
+ }
770
+ function T(e) {
771
+ var t;
772
+ (t = S.value) == null || t.showSheet(!0, {
773
+ groupIndex: e.groupIndex,
774
+ countIndex: e.countIndex
775
+ });
776
+ }
777
+ async function w(e) {
778
+ var v, I, L, J;
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(
780
+ g.referralProgram
781
+ ), b = F.reward[e.groupIndex];
782
+ b.rewards[t] = e.referralCount;
783
+ const U = b.rewards[t - 1], A = b.rewards[t + 1];
784
+ if (U && U.threshold.to != i.threshold.from - 1) {
785
+ if (!await K.confirm(
786
+ f("connect.program.tier.update.range_discontinuous.previous", {
787
+ name: U.threshold.from,
788
+ from: U.threshold.from ?? 0,
789
+ to: U.threshold.to ?? 1 / 0,
790
+ newTo: i.threshold.from - 1
791
+ }),
792
+ f("connect.program.tier.title"),
793
+ f("connect.program.tier.remove.next_range")
794
+ ))
795
+ return;
796
+ U.threshold.to = i.threshold.from - 1;
797
+ }
798
+ if (A && A.threshold.from - 1 != i.threshold.to) {
799
+ if (!await K.confirm(
800
+ f("connect.program.tier.update.range_discontinuous.next", {
801
+ name: A.threshold.from,
802
+ from: A.threshold.from ?? 0,
803
+ to: A.threshold.to ?? 1 / 0,
804
+ newFrom: i.threshold.to ?? 1
805
+ }),
806
+ f("connect.program.tier.title"),
807
+ f("connect.program.tier.remove.next_range"),
808
+ f("connect.prompt.cancel")
809
+ ))
810
+ return;
811
+ A.threshold.from = (i.threshold.to ?? 0) + 1;
812
+ }
813
+ !A && !((L = i.threshold) != null && L.to) && (i.threshold.to = void 0), await o(F), (J = S.value) == null || J.hideSheet();
814
+ }
815
+ async function s(e) {
816
+ var i;
817
+ const t = N(g.referralProgram);
818
+ t.refereeReward = e, await o(t), (i = P.value) == null || i.hideSheet();
819
+ }
820
+ async function o(e) {
821
+ await m(), await $(
822
+ async () => {
823
+ await me.update({
824
+ ...e,
825
+ updateReferralRecord: n.value
826
+ }), await g.readReferralProgram();
827
+ },
828
+ {
829
+ message: "Updating referral program",
830
+ successMessage: "Referral program updated successfully"
831
+ }
832
+ );
833
+ }
834
+ async function l(e) {
835
+ if (!await K.remove(
836
+ "Are you sure to remove referral tier",
837
+ "Remove referral tier",
838
+ f("connect.prompt.confirm"),
839
+ f("connect.prompt.cancel")
840
+ ))
841
+ return;
842
+ const t = N(g.referralProgram);
843
+ t.reward.splice(e, 1), await o(t);
844
+ }
845
+ async function y(e, t) {
846
+ if (!await K.remove(
847
+ "Are you sure to remove referral count",
848
+ "Remove referral tier",
849
+ f("connect.prompt.confirm"),
850
+ f("connect.prompt.cancel")
851
+ ))
852
+ return;
853
+ const i = N(g.referralProgram);
854
+ i.reward[e].rewards.splice(t, 1), await o(i);
855
+ }
856
+ const h = [
857
+ {
858
+ header: "Referral Count",
859
+ accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
860
+ },
861
+ {
862
+ header: "Rewards",
863
+ accessorKey: "type",
864
+ accessorFn: (e) => {
865
+ var t;
866
+ return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
867
+ }
868
+ },
869
+ {
870
+ id: "actions",
871
+ meta: {
872
+ textAlign: "right"
873
+ },
874
+ cell(e) {
875
+ return re(oe.FmButton, {
876
+ variant: "tertiary",
877
+ icon: "delete",
878
+ iconColor: "neutral-gray-400",
879
+ class: "ml-auto",
880
+ onClick: (t) => {
881
+ t.stopPropagation(), console.log(e.row), y(e.row.original.groupIndex, e.row.index);
882
+ }
883
+ });
884
+ }
885
+ }
886
+ ];
887
+ return ve(async () => {
888
+ await g.readReferralProgram();
889
+ }), (e, t) => {
890
+ const i = _("FmCard"), F = _("FmIcon"), b = _("FmButton"), U = _("FmTable"), A = _("FmList");
891
+ return C(), B(H, null, [
892
+ Z("", !0),
893
+ d(i, {
894
+ variant: "outlined",
895
+ class: "flex flex-col gap-16 p-16"
896
+ }, {
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", {
901
+ key: I,
902
+ class: ie(["px-8", { "xs:!border-r": I % 2 == 0 }])
903
+ }, [
904
+ a("div", ut, [
905
+ d(F, {
906
+ name: v.icon,
907
+ color: "primary",
908
+ class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
909
+ }, null, 8, ["name"]),
910
+ a("div", null, [
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,
915
+ variant: "plain",
916
+ label: v.action,
917
+ disabled: !r(p).isPremium,
918
+ class: "fm-typo-en-body-md-400 !p-0",
919
+ onClick: v.onClick
920
+ }, null, 8, ["label", "disabled", "onClick"])) : Z("", !0)
921
+ ])
922
+ ])
923
+ ], 2))), 128))
924
+ ])
925
+ ]),
926
+ _: 1
927
+ }),
928
+ r(c) && r(c).length > 0 ? (C(), j(i, {
929
+ key: 1,
930
+ variant: "outlined",
931
+ class: "flex flex-col gap-16 p-16"
932
+ }, {
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, {
937
+ key: I,
938
+ "reward-group": v,
939
+ level: I,
940
+ onEdit: (L) => O(I),
941
+ onRemove: (L) => l(I),
942
+ onAddCount: t[0] || (t[0] = (L) => {
943
+ T({ groupIndex: L, countIndex: -1 });
944
+ })
945
+ }, {
946
+ default: k(() => [
947
+ a("div", pt, [
948
+ d(U, {
949
+ "row-data": v.rewards.map((L) => ({ ...L, groupIndex: I })),
950
+ "column-defs": h,
951
+ "hide-footer": !0,
952
+ "page-size": 50,
953
+ onRowClick: (L) => T({ groupIndex: I, countIndex: L.index })
954
+ }, null, 8, ["row-data", "onRowClick"])
955
+ ]),
956
+ v.rewards.length ? Z("", !0) : (C(), B("div", ht, [
957
+ t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
958
+ a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
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 ")
960
+ ], -1)),
961
+ d(b, {
962
+ variant: "secondary",
963
+ label: "Add count",
964
+ icon: "add",
965
+ onClick: (L) => T({ groupIndex: I, countIndex: -1 })
966
+ }, null, 8, ["onClick"])
967
+ ]))
968
+ ]),
969
+ _: 2
970
+ }, 1032, ["reward-group", "level", "onEdit", "onRemove"]))), 128))
971
+ ]),
972
+ _: 1
973
+ })
974
+ ]),
975
+ _: 1
976
+ })) : (C(), j(i, {
977
+ key: 2,
978
+ variant: "outlined",
979
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
980
+ }, {
981
+ default: k(() => [
982
+ t[4] || (t[4] = a("img", {
983
+ src: ge,
984
+ class: "aspect-square w-[150px]"
985
+ }, null, -1)),
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)
989
+ ]),
990
+ d(b, {
991
+ variant: "primary",
992
+ label: r(f)("connect.referral.add_referral_tier"),
993
+ icon: "add",
994
+ disabled: !r(p).isPremium,
995
+ onClick: t[1] || (t[1] = (v) => O(-1))
996
+ }, null, 8, ["label", "disabled"])
997
+ ]),
998
+ _: 1
999
+ })),
1000
+ d(_e, {
1001
+ ref_key: "rewardGroupRef",
1002
+ ref: u
1003
+ }, null, 512),
1004
+ d(Ye, {
1005
+ ref_key: "editReferralCountSheetRef",
1006
+ ref: S,
1007
+ onUpdate: w
1008
+ }, null, 512),
1009
+ d(at, {
1010
+ ref_key: "manageCriteriaSheetRef",
1011
+ ref: V
1012
+ }, null, 512),
1013
+ d(it, {
1014
+ ref_key: "editRefereeRewardSheetRef",
1015
+ ref: P,
1016
+ onUpdate: s
1017
+ }, null, 512)
1018
+ ], 64);
1019
+ };
1020
+ }
1021
+ });
1022
+ export {
1023
+ Ht as default
1024
+ };