@feedmepos/mf-connect 0.1.56-prod → 0.1.58-prod

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 (128) hide show
  1. package/package.json +1 -1
  2. package/dist/Analytic-XUI4rZyP.js +0 -427
  3. package/dist/App-vv5J1Ebe.js +0 -4630
  4. package/dist/Bin-D4V36uXK.js +0 -166
  5. package/dist/Broadcast-BvW27G77.js +0 -233
  6. package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2MC6Gy1.js +0 -121
  7. package/dist/Card-C7xLv1Fb.js +0 -911
  8. package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
  9. package/dist/Collections-BKfS-bGL.js +0 -458
  10. package/dist/Credit-CGmWQq0t.js +0 -228
  11. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C2p6_R01.js +0 -2194
  13. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BGlaqjWp.js +0 -348
  14. package/dist/Experience-CT7Yab3W.js +0 -229
  15. package/dist/FileSaver.min-NlMItPOc.js +0 -74
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  17. package/dist/Game-DtW4rtYQ.js +0 -284
  18. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js +0 -144
  19. package/dist/Index-Bs5ob9Km.js +0 -259
  20. package/dist/JsonViewer-v8_C7l5N.js +0 -87
  21. package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js +0 -18737
  22. package/dist/MainLayout-B1aJoR95.js +0 -41
  23. package/dist/Marketing-tA350rTd.js +0 -319
  24. package/dist/Member-CZoTXgKz.js +0 -279
  25. package/dist/MemberList-ChwyPtmW.js +0 -1607
  26. package/dist/MemberOverview-wL_ailso.js +0 -58
  27. package/dist/MemberTransactions-Cchtvxm9.js +0 -45
  28. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bo0EnHBx.js +0 -60553
  29. package/dist/Mission-DDpelLqN.js +0 -302
  30. package/dist/Overview-Da3ewBat.js +0 -1079
  31. package/dist/Point-CggE8VUk.js +0 -232
  32. package/dist/Promotion-DxvbZhgQ.js +0 -289
  33. package/dist/Queue-fIxlHrMd.js +0 -260
  34. package/dist/Record-Bv90_VUG.js +0 -341
  35. package/dist/Reward-BWYLk7aC.js +0 -442
  36. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-CjYEtENe.js +0 -150
  37. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Ak1R8Y2a.js +0 -1763
  38. package/dist/Segment-_VGdBy3a.js +0 -882
  39. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-Dm4hF1n1.js +0 -181
  40. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DWDMhmNr.js +0 -188
  41. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-Czy25PII.js +0 -147
  42. package/dist/Setting-7fTz1dJa.js +0 -1936
  43. package/dist/Store-TQHKR__B.js +0 -1842
  44. package/dist/StoreRewards-DZy1ZwiI.js +0 -423
  45. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cae25Vr6.js +0 -995
  46. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BVVEzpyP.js +0 -139
  47. package/dist/Tier-CK53vdbl.js +0 -895
  48. package/dist/Title-CGWPq_FF.js +0 -566
  49. package/dist/Transaction-DjJ03PfX.js +0 -39
  50. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-DNSdyxrF.js +0 -130
  51. package/dist/Voucher-D6RuJjNn.js +0 -384
  52. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-D4iCOq3V.js +0 -419
  53. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-BFz8RvY_.js +0 -56
  54. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  55. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
  56. package/dist/app-BLlAxdVk.js +0 -57962
  57. package/dist/app-_rmIFJ8M.js +0 -7057
  58. package/dist/app-wDQR6dpb.js +0 -39
  59. package/dist/app.js +0 -6
  60. package/dist/business-gJ9fK_2b.js +0 -82
  61. package/dist/campaign-BfznfcHc.js +0 -94
  62. package/dist/campaign-C_Yq-ffV.js +0 -1810
  63. package/dist/campaign-CpzFl8Vr.js +0 -4
  64. package/dist/campaign.enum-Dsbpz7BO.js +0 -20
  65. package/dist/campaign.fn-C6vKb-lp.js +0 -758
  66. package/dist/collectible.enum-DNpj_oyC.js +0 -19
  67. package/dist/collection.fn-Cgo0sPL2.js +0 -26
  68. package/dist/dto-CaSQ4Pp9.js +0 -216
  69. package/dist/effect-DuH74x-N.js +0 -78
  70. package/dist/email-addresses-DXr-Qqt9.js +0 -705
  71. package/dist/export-tMPFlVV0.js +0 -97
  72. package/dist/feedme.ico +0 -0
  73. package/dist/helper-CJTseW10.js +0 -71
  74. package/dist/index-8RETBwYy.js +0 -8861
  75. package/dist/index-B57kxqv7.js +0 -3
  76. package/dist/index-BNUuy_4R.js +0 -44
  77. package/dist/index-BSJ-4JYy.js +0 -146
  78. package/dist/index-BTpBLMHl.js +0 -3070
  79. package/dist/index-C6Iyn1Q6.js +0 -54
  80. package/dist/index-CWI06v9e.js +0 -31
  81. package/dist/index-CdnKwJuz.js +0 -30076
  82. package/dist/index-Cr_9Bqa1.js +0 -121
  83. package/dist/index-CuvNtC_M.js +0 -61
  84. package/dist/index-DTyfvK3U.js +0 -2130
  85. package/dist/index-Dn0gJspN.js +0 -32269
  86. package/dist/index-IHKkNyxb.js +0 -38
  87. package/dist/index-J3TDCX-5.js +0 -76
  88. package/dist/index-V9kRRAB1.js +0 -32
  89. package/dist/index-vh86FiIQ.js +0 -10
  90. package/dist/index.esm2017-P2nmohVw.js +0 -3069
  91. package/dist/loading-D5ZAAdUU.js +0 -71
  92. package/dist/lodash-B5I3zXaY.js +0 -3678
  93. package/dist/membership-xl9aKOQ_.js +0 -235
  94. package/dist/moment-D7p2TMB-.js +0 -2583
  95. package/dist/money-CIHN3jJZ.js +0 -15
  96. package/dist/number-BN4-Jdog.js +0 -12
  97. package/dist/object-qECH92oz.js +0 -26
  98. package/dist/objectId-dwaoBfJX.js +0 -7
  99. package/dist/objectid-Dh6RD0Tk.js +0 -145
  100. package/dist/plugins-CJlgzIv2.js +0 -208
  101. package/dist/reward-C8mezXzs.js +0 -36
  102. package/dist/rule-9VRIJFHZ.js +0 -1951
  103. package/dist/rule-builder-CZUgrDAw.js +0 -102
  104. package/dist/style.css +0 -4
  105. package/dist/template-aPJnNGLi.js +0 -190
  106. package/dist/tier-BJDhpH6X.js +0 -4
  107. package/dist/tiers/tier=1.png +0 -0
  108. package/dist/tiers/tier=2.png +0 -0
  109. package/dist/tiers/tier=3.png +0 -0
  110. package/dist/tiers/tier=4.png +0 -0
  111. package/dist/timezone-CpvXaiqq.js +0 -1151
  112. package/dist/titles/type=diamond.png +0 -0
  113. package/dist/titles/type=drinks.png +0 -0
  114. package/dist/titles/type=food.png +0 -0
  115. package/dist/titles/type=heart.png +0 -0
  116. package/dist/titles/type=medal.png +0 -0
  117. package/dist/titles/type=spend.png +0 -0
  118. package/dist/titles/type=thank-you.png +0 -0
  119. package/dist/titles/type=thumbs-up.png +0 -0
  120. package/dist/titles/type=years.png +0 -0
  121. package/dist/trigger-BfrtcBd-.js +0 -144
  122. package/dist/tslib.es6-BCqqvLQ_.js +0 -44
  123. package/dist/type_drinks-D6jnpvwV.js +0 -4
  124. package/dist/usePagination-Ds-cuHop.js +0 -223
  125. package/dist/user-Bt1C0yV5.js +0 -54
  126. package/dist/vue-i18n-OdHHHpEE.js +0 -2365
  127. package/dist/xlsx-BgB0dYfE.js +0 -15491
  128. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -1,1079 +0,0 @@
1
- import { defineComponent as q, resolveComponent as w, openBlock as C, createElementBlock as B, Fragment as Y, createVNode as c, withCtx as V, createElementVNode as a, toDisplayString as O, unref as r, renderSlot as ve, ref as F, computed as G, watch as ie, createBlock as j, isRef as J, resolveDynamicComponent as ne, renderList as re, normalizeClass as de, createTextVNode as ce, createCommentVNode as z, h as te, onMounted as _e } from "vue";
2
- import { _ as ge } from "./campaign-CpzFl8Vr.js";
3
- import { u as Z } from "./vue-i18n-OdHHHpEE.js";
4
- import { u as ue } from "./loading-D5ZAAdUU.js";
5
- import { c as we, p as K } from "./plugins-CJlgzIv2.js";
6
- import { J as X } from "./JsonViewer-v8_C7l5N.js";
7
- import { Z as N } from "./zod-Bg2FbC-D.js";
8
- import { u as W } from "./app-wDQR6dpb.js";
9
- import { u as Q, _ as ye } from "./RewardGroup.vue_vue_type_script_setup_true_lang-CjYEtENe.js";
10
- import { u as me } from "./reward-C8mezXzs.js";
11
- import { l as le, c as se } from "./index-BTpBLMHl.js";
12
- import "./index-8RETBwYy.js";
13
- import { a as be, b as xe } from "./index-DTyfvK3U.js";
14
- import "./index-IHKkNyxb.js";
15
- import "./index-C6Iyn1Q6.js";
16
- import "./index-Dn0gJspN.js";
17
- import { C as fe } from "./membership-xl9aKOQ_.js";
18
- import { t as ee } from "./helper-CJTseW10.js";
19
- import { c as H } 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-BFz8RvY_.js";
22
- import { a as Se, _ as Fe, b as ke } from "./trigger-BfrtcBd-.js";
23
- import { O as $e } from "./objectid-Dh6RD0Tk.js";
24
- import { r as pe } from "./index-V9kRRAB1.js";
25
- import { u as Pe } from "./business-gJ9fK_2b.js";
26
- const Ve = { class: "flex items-center justify-between flex-1 xs:hidden" }, Ie = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, Te = { class: "flex-1" }, Ue = { class: "flex items-center gap-8" }, Ae = { class: "fm-typo-en-title-sm-800" }, Le = { class: "flex gap-8 items-center" }, Ee = { 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" }, Oe = { class: "flex items-center gap-x-24 h-[80px] p-8 flex-1" }, je = { class: "flex-1 space-y-4" }, De = { class: "fm-typo-en-body-lg-600" }, Ge = /* @__PURE__ */ q({
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(k, { emit: l }) {
40
- const { t: I } = Z(), p = l;
41
- return (g, f) => {
42
- const s = w("FmButton"), u = w("FmListItem");
43
- return C(), B(Y, null, [
44
- c(u, {
45
- onClick: f[4] || (f[4] = (m) => p("edit", k.level)),
46
- class: "!p-0"
47
- }, {
48
- default: V(() => [
49
- a("div", Ve, [
50
- a("div", Ie, [
51
- a("div", Te, [
52
- a("div", Ue, [
53
- a("div", Ae, O(k.rewardGroup.name), 1)
54
- ])
55
- ])
56
- ]),
57
- a("div", Le, [
58
- c(s, {
59
- variant: "secondary",
60
- label: r(I)("connect.referral.reward.add_count"),
61
- icon: "add",
62
- onClick: f[0] || (f[0] = (m) => {
63
- m.stopPropagation(), p("addCount", k.level);
64
- })
65
- }, null, 8, ["label"]),
66
- c(s, {
67
- icon: "delete",
68
- onClick: f[1] || (f[1] = (m) => {
69
- m.stopPropagation(), p("remove", k.level);
70
- }),
71
- variant: "tertiary"
72
- })
73
- ])
74
- ]),
75
- a("div", Ee, [
76
- a("div", Be, [
77
- a("div", Oe, [
78
- a("div", je, [
79
- a("div", null, [
80
- a("div", De, O(k.rewardGroup.name), 1)
81
- ])
82
- ])
83
- ]),
84
- c(s, {
85
- variant: "tertiary",
86
- icon: "delete",
87
- onClick: f[2] || (f[2] = (m) => (m.stopPropagation(), p("remove", k.level)))
88
- })
89
- ]),
90
- c(s, {
91
- class: "w-full",
92
- variant: "secondary",
93
- label: "Add count",
94
- disabled: !0,
95
- icon: "add",
96
- onClick: f[3] || (f[3] = (m) => (m.stopPropagation(), p("addCount", k.level)))
97
- })
98
- ])
99
- ]),
100
- _: 1
101
- }),
102
- ve(g.$slots, "default")
103
- ], 64);
104
- };
105
- }
106
- }), Me = { class: "flex flex-col space-y-16 pr-12" }, Ne = { class: "flex gap-16 items-center" }, He = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ze = { class: "fm-typo-en-title-sm-800" }, Ye = { class: "flex items-center gap-8" }, qe = /* @__PURE__ */ q({
107
- __name: "EditReferralCountSheet",
108
- emits: ["update"],
109
- setup(k, { expose: l, emit: I }) {
110
- const { t: p } = Z(), g = I, f = F(!1), s = F({}), u = F(-1), m = F(-1), R = Q(), A = be.superRefine((e, t) => {
111
- var $, U, P, x, v, E, ae;
112
- const d = m.value == -1 ? ((P = (U = ($ = R.referralProgram) == null ? void 0 : $.reward[u.value]) == null ? void 0 : U.rewards) == null ? void 0 : P.length) || 0 : m.value, _ = (v = (x = R.referralProgram) == null ? void 0 : x.reward[u.value]) == null ? void 0 : v.rewards[d - 1], b = (ae = (E = R.referralProgram) == null ? void 0 : E.reward[u.value]) == null ? void 0 : ae.rewards[d + 1];
113
- _ && e.threshold.from < _.threshold.from + 1 && t.addIssue({
114
- code: "custom",
115
- message: `The min referral must be at least ${_.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
- }), T = G(() => {
123
- const e = A.safeParse(s.value);
124
- return e.success ? [] : e.error.errors;
125
- });
126
- function M() {
127
- const e = A.safeParse(s.value);
128
- e.success && g("update", {
129
- groupIndex: u.value,
130
- countIndex: m.value,
131
- referralCount: e.data
132
- });
133
- }
134
- async function D(e, t) {
135
- var d, _, b, $, U, P;
136
- if (f.value = e, e && typeof (t == null ? void 0 : t.countIndex) == "number" && t.countIndex >= 0)
137
- u.value = t.groupIndex, m.value = t.countIndex, s.value = H(
138
- (d = R.referralProgram) == null ? void 0 : d.reward[t.groupIndex].rewards[t.countIndex]
139
- );
140
- else {
141
- u.value = t.groupIndex, m.value = -1;
142
- const x = m.value == -1 ? (($ = (b = (_ = R.referralProgram) == null ? void 0 : _.reward[u.value]) == null ? void 0 : b.rewards) == null ? void 0 : $.length) || 0 : m.value, v = (P = (U = R.referralProgram) == null ? void 0 : U.reward[u.value]) == null ? void 0 : P.rewards[x - 1];
143
- s.value = {
144
- threshold: {
145
- from: v != null && v.threshold ? v != null && v.threshold.to ? v.threshold.to + 1 : (v == null ? void 0 : v.threshold.from) + 1 : 1,
146
- to: null
147
- },
148
- rewards: []
149
- };
150
- }
151
- h.value = [], h.value = i.value.map(
152
- (x) => s.value.rewards.includes(x.id)
153
- );
154
- }
155
- function L() {
156
- f.value = !1;
157
- }
158
- const y = [
159
- {
160
- header: "Reward title",
161
- accessorFn: (e) => e.name,
162
- enableSorting: !0
163
- },
164
- {
165
- id: "type",
166
- header: "Reward type",
167
- cell(e) {
168
- return fe[e.row.original.collectibleConfig.type].chip();
169
- }
170
- },
171
- {
172
- header: "Description",
173
- accessorFn: (e) => e.description,
174
- cell(e) {
175
- const t = e.row.original;
176
- if (t.collectible.type == "VOUCHER" || t.selectedReward == null)
177
- return t.description;
178
- }
179
- }
180
- ], n = me(), o = F([]), i = G(() => n.rewards.map((e) => {
181
- let t = "No expiry";
182
- switch (e.option.type) {
183
- case "VOUCHER":
184
- t = `${e.option.collectibleConfig.options.maxUse} use(s), ${ee(e.option.collectibleConfig.options.validityOption || {})}`;
185
- break;
186
- case "LOYALTY":
187
- t = `${e.option.earningOption.amount}, ${ee(e.option.validityOption || {})}`;
188
- break;
189
- }
190
- return {
191
- id: e._id,
192
- name: e.name,
193
- collectible: e.option,
194
- collectibleConfig: e.collectibleConfig,
195
- description: t
196
- };
197
- }));
198
- G(() => []);
199
- function S() {
200
- const e = i.value;
201
- for (let t = 0; t < e.length; t++) {
202
- const d = e[t], _ = h.value[t];
203
- _ && !s.value.rewards.includes(d.id) && s.value.rewards.push(d.id), !_ && s.value.rewards.includes(d.id) && (s.value.rewards = s.value.rewards.filter(
204
- (b) => b != d.id
205
- ));
206
- }
207
- }
208
- const h = F({});
209
- return ie(h, S, { deep: !0 }), l({
210
- showSheet: D,
211
- hideSheet: L,
212
- data: s
213
- }), (e, t) => {
214
- const d = w("FmStepperField"), _ = w("FmHelperText"), b = w("FmTable"), $ = w("FmButton"), U = w("FmSideSheet");
215
- return C(), j(U, {
216
- "max-width": 1e3,
217
- modelValue: r(f),
218
- "onUpdate:modelValue": t[4] || (t[4] = (P) => J(f) ? f.value = P : null),
219
- header: `${r(m) == -1 ? r(p)("connect.referral.editReferralCountSheet.add") : r(p)("connect.referral.editReferralCountSheet.edit")}`
220
- }, {
221
- "side-sheet-footer": V(() => [
222
- a("div", Ye, [
223
- c($, {
224
- label: r(p)("connect.editTierSheet.submit"),
225
- onClick: M,
226
- disabled: r(T).length > 0 || r(W)().isLoading,
227
- loading: r(W)().isLoading
228
- }, null, 8, ["label", "disabled", "loading"]),
229
- c($, {
230
- label: r(p)("connect.editTierSheet.cancel"),
231
- onClick: t[3] || (t[3] = (P) => L()),
232
- variant: "tertiary"
233
- }, null, 8, ["label"])
234
- ])
235
- ]),
236
- default: V(() => [
237
- c(X, { json: r(s) }, null, 8, ["json"]),
238
- c(X, { json: r(T) }, null, 8, ["json"]),
239
- a("div", Me, [
240
- a("div", null, [
241
- a("div", Ne, [
242
- c(d, {
243
- modelValue: r(s).threshold.from,
244
- "onUpdate:modelValue": t[0] || (t[0] = (P) => r(s).threshold.from = P),
245
- "show-steppers": !1,
246
- rules: [r(N).ruleAtPath(r(A), "threshold.from")]
247
- }, {
248
- label: V(() => [
249
- (C(), j(ne(
250
- r(N).toInputLabel(
251
- r(N).typeAtPath(r(A), "threshold.from"),
252
- r(p)(
253
- "connect.referral.editReferralCountSheet.min_referral_count"
254
- )
255
- )
256
- )))
257
- ]),
258
- _: 1
259
- }, 8, ["modelValue", "rules"]),
260
- c(d, {
261
- modelValue: r(s).threshold.to,
262
- "onUpdate:modelValue": t[1] || (t[1] = (P) => r(s).threshold.to = P),
263
- "show-steppers": !1,
264
- rules: [r(N).ruleAtPath(r(A), "threshold.to")]
265
- }, {
266
- label: V(() => [
267
- (C(), j(ne(
268
- r(N).toInputLabel(
269
- r(N).typeAtPath(r(A), "threshold.to"),
270
- r(p)(
271
- "connect.referral.editReferralCountSheet.max_referral_count"
272
- )
273
- )
274
- )))
275
- ]),
276
- _: 1
277
- }, 8, ["modelValue", "rules"])
278
- ]),
279
- c(_, {
280
- text: r(N).helperText(r(T), "threshold"),
281
- state: r(N).helperState(r(T), "threshold")
282
- }, null, 8, ["text", "state"]),
283
- a("div", He, O(r(p)(
284
- "connect.referral.editReferralCountSheet.max_referral_count_description"
285
- )), 1)
286
- ]),
287
- a("div", ze, O(r(p)("connect.referral.editReferralCountSheet.referrer_reward")), 1),
288
- c(b, {
289
- modelValue: r(h),
290
- "onUpdate:modelValue": t[2] || (t[2] = (P) => J(h) ? h.value = P : null),
291
- selection: "multiple",
292
- "column-filter": r(o),
293
- "column-defs": y,
294
- "row-data": r(i),
295
- "page-size": 10
296
- }, null, 8, ["modelValue", "column-filter", "row-data"])
297
- ])
298
- ]),
299
- _: 1
300
- }, 8, ["modelValue", "header"]);
301
- };
302
- }
303
- }), Ke = { class: "space-y-16" }, Je = { class: "grid grid-cols-3 gap-16" }, We = { class: "fm-typo-en-title-sm-800" }, Ze = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Qe = /* @__PURE__ */ q({
304
- __name: "CriteriaTriggerInput",
305
- props: {
306
- modelValue: {
307
- type: String
308
- },
309
- disabled: {
310
- type: Boolean,
311
- default: !1
312
- }
313
- },
314
- emits: ["update:model-value"],
315
- setup(k, { emit: l }) {
316
- const I = k, p = l, g = G(() => [
317
- le.enum.BILL_COMPLETED,
318
- le.enum.FEEDBACK
319
- ].map((f) => Se[f]));
320
- return (f, s) => {
321
- const u = w("FmCard");
322
- return C(), B("div", Ke, [
323
- s[0] || (s[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)),
324
- a("div", Je, [
325
- (C(!0), B(Y, null, re(r(g), (m) => (C(), j(u, {
326
- key: m.name,
327
- variant: "outlined",
328
- disabled: I.disabled,
329
- class: de(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
330
- "col-span-3": r(g).length == 1,
331
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": k.modelValue == m.value,
332
- "hover:bg-fm-color-opacity-sm": k.modelValue != m.value
333
- }]),
334
- onClick: () => {
335
- I.modelValue != m.value && !I.disabled && p("update:model-value", m.value);
336
- }
337
- }, {
338
- default: V(() => [
339
- a("div", We, O(m.name), 1),
340
- a("div", Ze, O(m.description), 1)
341
- ]),
342
- _: 2
343
- }, 1032, ["disabled", "class", "onClick"]))), 128))
344
- ])
345
- ]);
346
- };
347
- }
348
- }), Xe = { class: "flex items-center gap-x-8" }, er = { class: "flex flex-col space-y-16 pr-12" }, rr = {
349
- key: 0,
350
- class: "space-y-16"
351
- }, tr = {
352
- key: 1,
353
- class: "space-y-16"
354
- }, or = { class: "flex items-center gap-8" }, ar = /* @__PURE__ */ q({
355
- __name: "EditCriteriaSheet",
356
- emits: ["update"],
357
- setup(k, { expose: l, emit: I }) {
358
- const { t: p } = Z(), g = I, f = F(!1), s = F(-1), u = F({}), m = Q(), R = xe.superRefine((y, n) => {
359
- y.name.length >= 50 && n.addIssue({
360
- code: "custom",
361
- message: "Name must be less than 50 characters"
362
- }), y.name.length < 1 && n.addIssue({
363
- code: "custom",
364
- message: "Name is required"
365
- });
366
- }), A = G(() => {
367
- const y = R.safeParse(u.value);
368
- return y.success ? [] : y.error.errors;
369
- });
370
- function T(y, n) {
371
- var o;
372
- f.value = y, y && typeof n == "number" && n >= 0 ? (s.value = n, u.value = H(
373
- (o = m.referralProgram) == null ? void 0 : o.criteria[n]
374
- )) : (s.value = -1, u.value = {
375
- _id: new $e().toString(),
376
- name: "",
377
- type: "AUTO",
378
- event: { type: "BILL_COMPLETED" }
379
- });
380
- }
381
- function M() {
382
- f.value = !1;
383
- }
384
- function D() {
385
- const y = R.safeParse(u.value);
386
- y.success && g("update", s.value, y.data);
387
- }
388
- function L(y) {
389
- u.value.type = y, y == "AUTO" ? u.value.event = { type: "BILL_COMPLETED" } : u.value.event = void 0;
390
- }
391
- return l({
392
- showSheet: T,
393
- hideSheet: M,
394
- data: u
395
- }), (y, n) => {
396
- const o = w("FmButton"), i = w("FmRadio"), S = w("FmRadioGroup"), h = w("FmSideSheet");
397
- return C(), j(h, {
398
- "max-width": 768,
399
- modelValue: r(f),
400
- "onUpdate:modelValue": n[6] || (n[6] = (e) => J(f) ? f.value = e : null)
401
- }, {
402
- "side-sheet-header": V(() => [
403
- a("div", Xe, [
404
- c(o, {
405
- icon: "arrow_back",
406
- variant: "tertiary",
407
- onClick: n[0] || (n[0] = (e) => T(!1))
408
- }),
409
- n[7] || (n[7] = ce("Add Criteria ", -1))
410
- ])
411
- ]),
412
- "side-sheet-footer": V(() => [
413
- a("div", or, [
414
- c(o, {
415
- label: r(p)("connect.editTierSheet.submit"),
416
- onClick: D,
417
- disabled: r(A).length > 0 || r(W)().isLoading,
418
- loading: r(W)().isLoading
419
- }, null, 8, ["label", "disabled", "loading"]),
420
- c(o, {
421
- label: r(p)("connect.editTierSheet.cancel"),
422
- onClick: n[5] || (n[5] = (e) => T(!1)),
423
- variant: "tertiary"
424
- }, null, 8, ["label"])
425
- ])
426
- ]),
427
- default: V(() => [
428
- c(X, { json: r(u) }, null, 8, ["json"]),
429
- a("div", er, [
430
- n[12] || (n[12] = a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria", -1)),
431
- c(Re, {
432
- modelValue: r(u).name,
433
- "onUpdate:modelValue": n[1] || (n[1] = (e) => r(u).name = e),
434
- label: r(p)("connect.referral.editReferralTierSheet.name"),
435
- schema: r(N).typeAtPath(r(R), "name")
436
- }, null, 8, ["modelValue", "label", "schema"]),
437
- n[13] || (n[13] = a("div", { class: "fm-typo-en-title-sm-600" }, "Configuration", -1)),
438
- c(S, {
439
- "model-value": r(u).type,
440
- label: "Verify status",
441
- "onUpdate:modelValue": L
442
- }, {
443
- default: V(() => [
444
- c(i, {
445
- value: "AUTO",
446
- label: "Auto",
447
- sublabel: "Verify based on rule configuration"
448
- }),
449
- c(i, {
450
- value: "MANUAL",
451
- label: "Manual",
452
- sublabel: "Verify based on manual inspection"
453
- })
454
- ]),
455
- _: 1
456
- }, 8, ["model-value"]),
457
- r(u).type == "AUTO" ? (C(), B(Y, { key: 0 }, [
458
- n[10] || (n[10] = a("div", { class: "fm-typo-en-title-sm-600" }, "Trigger", -1)),
459
- n[11] || (n[11] = a("div", null, " Select trigger what referee need to complete in order for referral to earn reward ", -1)),
460
- c(Qe, {
461
- "model-value": r(u).event.type,
462
- "onUpdate:modelValue": n[2] || (n[2] = (e) => r(u).event.type = e)
463
- }, null, 8, ["model-value"]),
464
- r(u).event.type == r(se).enum.BILL_COMPLETED ? (C(), B("div", rr, [
465
- n[8] || (n[8] = a("div", { class: "fm-typo-en-title-sm-600" }, "Spending Criteria", -1)),
466
- c(Fe, {
467
- "model-value": r(u).event.rule,
468
- "onUpdate:modelValue": n[3] || (n[3] = (e) => r(u).event.rule = e)
469
- }, null, 8, ["model-value"])
470
- ])) : z("", !0),
471
- r(u).event.type == r(se).enum.FEEDBACK ? (C(), B("div", tr, [
472
- n[9] || (n[9] = a("div", { class: "fm-typo-en-title-sm-600" }, "Feedback Criteria", -1)),
473
- c(ke, {
474
- "model-value": r(u).event.rule,
475
- "onUpdate:modelValue": n[4] || (n[4] = (e) => r(u).event.rule = e)
476
- }, null, 8, ["model-value"])
477
- ])) : z("", !0)
478
- ], 64)) : z("", !0)
479
- ])
480
- ]),
481
- _: 1
482
- }, 8, ["modelValue"]);
483
- };
484
- }
485
- });
486
- function he() {
487
- const k = F(!1), l = Ce();
488
- return {
489
- confirmUpdateReferralRecord: async () => {
490
- await new Promise((p) => {
491
- l.open({
492
- title: "Confirmation",
493
- message: "This will change all referral settings? Would you like to update previous referral record?",
494
- primaryActions: { text: "Update all", close: !0 },
495
- secondaryActions: { text: "Update future only", close: !0 }
496
- }).onPrimary(async () => {
497
- k.value = !0, p();
498
- }).onSecondary(async () => {
499
- k.value = !1, p();
500
- });
501
- });
502
- },
503
- updateReferralRecord: k
504
- };
505
- }
506
- const nr = { class: "flex flex-col space-y-16 mt-24" }, lr = { class: "flex justify-between items-center" }, sr = /* @__PURE__ */ q({
507
- __name: "ManageCriteriaSheet",
508
- setup(k, { expose: l }) {
509
- const { t: I } = Z(), { minor: p } = ue, { confirmUpdateReferralRecord: g, updateReferralRecord: f } = he(), s = F(!1), u = F({}), m = Q(), R = F(
510
- null
511
- ), A = G(() => {
512
- var o;
513
- return (o = m.referralProgram) == null ? void 0 : o.criteria;
514
- });
515
- async function T(o) {
516
- await g(), await p(async () => {
517
- await pe.update({
518
- ...o,
519
- updateReferralRecord: f.value
520
- }), await m.readReferralProgram();
521
- });
522
- }
523
- async function M(o, i) {
524
- var e, t;
525
- const S = o == -1 ? ((e = m.referralProgram) == null ? void 0 : e.criteria.length) || 0 : o, h = H(m.referralProgram);
526
- h.criteria[S] = i, await T(h), (t = R.value) == null || t.showSheet(!1);
527
- }
528
- async function D(o) {
529
- var h, e;
530
- if (!await K.remove(
531
- "Are you sure to remove criteria",
532
- "Remove criteria",
533
- I("connect.prompt.confirm"),
534
- I("connect.prompt.cancel")
535
- ))
536
- return;
537
- const i = o == -1 ? ((h = m.referralProgram) == null ? void 0 : h.criteria.length) || 0 : o, S = H(m.referralProgram);
538
- S.criteria.splice(i, 1), await T(S), (e = R.value) == null || e.showSheet(!1);
539
- }
540
- const L = [
541
- {
542
- header: "Criteria title",
543
- accessorFn: (o) => o.name
544
- },
545
- {
546
- header: "Validity method",
547
- cell(o) {
548
- return te(oe.FmChip, {
549
- label: we.title(o.row.original.type),
550
- variant: "plain"
551
- });
552
- }
553
- },
554
- {
555
- header: "Actions",
556
- cell(o) {
557
- return [
558
- te(oe.FmButton, {
559
- variant: "tertiary",
560
- icon: "delete",
561
- iconColor: "neutral-gray-400",
562
- onClick: (i) => {
563
- i.stopPropagation(), D(o.row.index);
564
- }
565
- })
566
- ];
567
- }
568
- }
569
- ];
570
- function y(o) {
571
- s.value = o;
572
- }
573
- function n() {
574
- s.value = !1;
575
- }
576
- return l({
577
- showSheet: y,
578
- hideSheet: n,
579
- data: u
580
- }), (o, i) => {
581
- const S = w("FmButton"), h = w("FmTable"), e = w("FmSideSheet");
582
- return C(), B(Y, null, [
583
- c(e, {
584
- "max-width": 768,
585
- modelValue: r(s),
586
- "onUpdate:modelValue": i[2] || (i[2] = (t) => J(s) ? s.value = t : null),
587
- header: "Manage Criteria"
588
- }, {
589
- default: V(() => [
590
- a("div", nr, [
591
- a("div", lr, [
592
- i[3] || (i[3] = a("div", null, [
593
- a("div", { class: "fm-typo-en-title-sm-600" }, "Program Criteria"),
594
- a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Set participation rules to start your referral program ")
595
- ], -1)),
596
- c(S, {
597
- label: "Add Criteria",
598
- icon: "add",
599
- variant: "secondary",
600
- onClick: i[0] || (i[0] = (t) => {
601
- var d;
602
- return (d = r(R)) == null ? void 0 : d.showSheet(!0);
603
- })
604
- })
605
- ]),
606
- c(h, {
607
- "row-data": r(A),
608
- "hide-footer": !0,
609
- "page-size": 100,
610
- "shrink-at": !1,
611
- "column-defs": L,
612
- onRowClick: i[1] || (i[1] = (t) => {
613
- var d;
614
- return (d = r(R)) == null ? void 0 : d.showSheet(!0, t.index);
615
- })
616
- }, null, 8, ["row-data"])
617
- ])
618
- ]),
619
- _: 1
620
- }, 8, ["modelValue"]),
621
- c(ar, {
622
- ref_key: "editCriteriaSheetRef",
623
- ref: R,
624
- onUpdate: M
625
- }, null, 512)
626
- ], 64);
627
- };
628
- }
629
- }), ir = { class: "flex flex-col space-y-16 pr-12" }, dr = { class: "fm-typo-en-title-sm-800" }, cr = { class: "flex items-center gap-8" }, ur = /* @__PURE__ */ q({
630
- __name: "EditRefereeRewardSheet",
631
- emits: ["update"],
632
- setup(k, { expose: l, emit: I }) {
633
- const { t: p } = Z(), g = I, f = F(!1), s = F([]), u = Q();
634
- function m() {
635
- g("update", s.value);
636
- }
637
- async function R(o) {
638
- var i, S;
639
- f.value = o, s.value = ((S = (i = u.referralProgram) == null ? void 0 : i.refereeReward) == null ? void 0 : S.map((h) => h.toString())) || [], n.value = L.value.map((h) => s.value.includes(h.id));
640
- }
641
- function A() {
642
- f.value = !1;
643
- }
644
- const T = [
645
- {
646
- header: "Reward title",
647
- accessorFn: (o) => o.name,
648
- enableSorting: !0
649
- },
650
- {
651
- id: "type",
652
- header: "Reward type",
653
- cell(o) {
654
- return fe[o.row.original.collectibleConfig.type].chip();
655
- }
656
- },
657
- {
658
- header: "Description",
659
- accessorFn: (o) => o.description,
660
- cell(o) {
661
- const i = o.row.original;
662
- if (i.collectible.type == "VOUCHER" || i.selectedReward == null)
663
- return i.description;
664
- }
665
- }
666
- ], M = me(), D = F([]), L = G(() => M.rewards.map((o) => {
667
- let i = "No expiry";
668
- switch (o.option.type) {
669
- case "VOUCHER":
670
- i = `${o.option.collectibleConfig.options.maxUse} use(s), ${ee(o.option.collectibleConfig.options.validityOption || {})}`;
671
- break;
672
- case "LOYALTY":
673
- i = `${o.option.earningOption.amount}, ${ee(o.option.validityOption || {})}`;
674
- break;
675
- }
676
- return {
677
- id: o._id,
678
- name: o.name,
679
- collectible: o.option,
680
- collectibleConfig: o.collectibleConfig,
681
- description: i
682
- };
683
- }));
684
- G(() => []);
685
- function y() {
686
- const o = L.value;
687
- for (let i = 0; i < o.length; i++) {
688
- const S = o[i], h = n.value[i];
689
- h && !s.value.includes(S.id) && s.value.push(S.id), !h && s.value.includes(S.id) && (s.value = s.value.filter((e) => e != S.id));
690
- }
691
- }
692
- const n = F({});
693
- return ie(n, y, { deep: !0 }), l({
694
- showSheet: R,
695
- hideSheet: A,
696
- data: s
697
- }), (o, i) => {
698
- const S = w("FmTable"), h = w("FmButton"), e = w("FmSideSheet");
699
- return C(), j(e, {
700
- "max-width": 1e3,
701
- modelValue: r(f),
702
- "onUpdate:modelValue": i[2] || (i[2] = (t) => J(f) ? f.value = t : null),
703
- header: "Referee reward"
704
- }, {
705
- "side-sheet-footer": V(() => [
706
- a("div", cr, [
707
- c(h, {
708
- label: r(p)("connect.common.save"),
709
- onClick: m,
710
- disabled: r(W)().isLoading,
711
- loading: r(W)().isLoading
712
- }, null, 8, ["label", "disabled", "loading"]),
713
- c(h, {
714
- label: r(p)("connect.common.cancel"),
715
- onClick: i[1] || (i[1] = (t) => A()),
716
- variant: "tertiary"
717
- }, null, 8, ["label"])
718
- ])
719
- ]),
720
- default: V(() => [
721
- c(X, { json: r(s) }, null, 8, ["json"]),
722
- a("div", ir, [
723
- a("div", dr, O(r(p)("connect.referral.refereeRewardSheet.referee_reward")), 1),
724
- c(S, {
725
- modelValue: r(n),
726
- "onUpdate:modelValue": i[0] || (i[0] = (t) => J(n) ? n.value = t : null),
727
- selection: "multiple",
728
- "column-filter": r(D),
729
- "column-defs": T,
730
- "row-data": r(L),
731
- "page-size": 10
732
- }, null, 8, ["modelValue", "column-filter", "row-data"])
733
- ])
734
- ]),
735
- _: 1
736
- }, 8, ["modelValue"]);
737
- };
738
- }
739
- }), mr = { class: "fm-typo-en-title-sm-600" }, fr = { class: "grid grid-cols-4 xs:grid-cols-1 gap-4 divide-x xs:divide-x-0" }, pr = { class: "flex gap-x-8" }, hr = { class: "fm-typo-body-lg-600 flex items-center gap-x-4" }, vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _r = { class: "mb-40" }, gr = {
740
- key: 0,
741
- class: "flex flex-col items-center justify-center gap-y-16 p-24"
742
- }, wr = { class: "flex flex-col gap-16 text-center" }, yr = { class: "fm-typo-en-title-sm-800" }, br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qr = /* @__PURE__ */ q({
743
- __name: "Overview",
744
- setup(k) {
745
- const { t: l } = Z(), { minor: I } = ue, p = Pe(), g = Q(), { confirmUpdateReferralRecord: f, updateReferralRecord: s } = he(), u = G(() => {
746
- var e;
747
- return ((e = g.referralProgram) == null ? void 0 : e.reward) ?? [];
748
- }), m = F(null);
749
- F(null);
750
- const R = F(null), A = F(null), T = F(null), M = G(() => {
751
- var e, t, d, _;
752
- return [
753
- {
754
- label: "connect.referral.how_it_works.generate_link",
755
- sublabel: l("connect.referral.how_it_works.generate_link_for_member"),
756
- icon: "offline_share"
757
- },
758
- {
759
- label: "connect.referral.how_it_works.referee_join_reward",
760
- sublabel: `${((t = (e = g.referralProgram) == null ? void 0 : e.pf_refereeReward) == null ? void 0 : t.length) || 0} ${l("connect.referral.how_it_works.reward")}`,
761
- action: l("connect.referral.actions.manage_reward"),
762
- onClick: () => {
763
- var b;
764
- return (b = T.value) == null ? void 0 : b.showSheet(!0);
765
- },
766
- helperText: l(
767
- "connect.referral.how_it_works.referee_join_reward_description"
768
- ),
769
- icon: "group_add"
770
- },
771
- {
772
- label: "connect.referral.how_it_works.referee_meet_criteria",
773
- sublabel: `${(d = g.referralProgram) == null ? void 0 : d.criteria.length} ${l("connect.referral.how_it_works.criteria")}`,
774
- action: l("connect.referral.actions.manage_criteria"),
775
- onClick: () => {
776
- var b;
777
- return (b = A.value) == null ? void 0 : b.showSheet(!0);
778
- },
779
- icon: "checklist_rtl"
780
- },
781
- {
782
- label: "connect.referral.how_it_works.referer_get_reward",
783
- sublabel: `${(_ = g.referralProgram) == null ? void 0 : _.reward.length} ${l("connect.referral.how_it_works.reward_tier")}`,
784
- helperText: l("connect.referral.how_it_works.referral_tier_description"),
785
- icon: "featured_seasonal_and_gifts"
786
- }
787
- ];
788
- });
789
- function D(e) {
790
- var t;
791
- (t = m.value) == null || t.onManageRewardGroup(e);
792
- }
793
- function L(e) {
794
- var t;
795
- (t = R.value) == null || t.showSheet(!0, {
796
- groupIndex: e.groupIndex,
797
- countIndex: e.countIndex
798
- });
799
- }
800
- async function y(e) {
801
- var P, x, v, E;
802
- const t = e.countIndex == -1 ? ((x = (P = g.referralProgram) == null ? void 0 : P.reward[e.groupIndex]) == null ? void 0 : x.rewards.length) || 0 : e.countIndex || 0, d = e.referralCount, _ = H(
803
- g.referralProgram
804
- ), b = _.reward[e.groupIndex];
805
- b.rewards[t] = e.referralCount;
806
- const $ = b.rewards[t - 1], U = b.rewards[t + 1];
807
- if ($ && $.threshold.to != d.threshold.from - 1) {
808
- if (!await K.confirm(
809
- l(
810
- "connect.referral.referral_count.update.range_discontinuous.previous",
811
- {
812
- name: $.threshold.from,
813
- from: $.threshold.from ?? 0,
814
- to: $.threshold.to ?? 1 / 0,
815
- newTo: d.threshold.from - 1
816
- }
817
- ),
818
- l("connect.referral.referral_count.title"),
819
- l("connect.referral.referral_count.remove.next_range")
820
- ))
821
- return;
822
- $.threshold.to = d.threshold.from - 1;
823
- }
824
- if (U && U.threshold.from - 1 != d.threshold.to) {
825
- if (!await K.confirm(
826
- l("connect.program.tier.update.range_discontinuous.next", {
827
- name: U.threshold.from,
828
- from: U.threshold.from ?? 0,
829
- to: U.threshold.to ?? 1 / 0,
830
- newFrom: d.threshold.to ?? 1
831
- }),
832
- l("connect.program.tier.title"),
833
- l("connect.program.tier.remove.next_range"),
834
- l("connect.prompt.cancel")
835
- ))
836
- return;
837
- U.threshold.from = (d.threshold.to ?? 0) + 1;
838
- }
839
- !U && !((v = d.threshold) != null && v.to) && (d.threshold.to = void 0), await o(_), (E = R.value) == null || E.hideSheet();
840
- }
841
- async function n(e) {
842
- var d;
843
- const t = H(g.referralProgram);
844
- t.refereeReward = e, await o(t), (d = T.value) == null || d.hideSheet();
845
- }
846
- async function o(e) {
847
- await f(), await I(
848
- async () => {
849
- await pe.update({
850
- ...e,
851
- updateReferralRecord: s.value
852
- }), await g.readReferralProgram();
853
- },
854
- {
855
- message: "Updating referral program",
856
- successMessage: "Referral program updated successfully"
857
- }
858
- );
859
- }
860
- async function i(e) {
861
- if (!await K.remove(
862
- l("connect.referral.reward.confirm_remove_referral_tier"),
863
- l("connect.referral.reward.remove_referral_tier"),
864
- l("connect.prompt.confirm"),
865
- l("connect.prompt.cancel")
866
- ))
867
- return;
868
- const t = H(g.referralProgram);
869
- t.reward.splice(e, 1), await o(t);
870
- }
871
- async function S(e, t) {
872
- if (!await K.remove(
873
- l("connect.referral.reward.confirm_remove_referral_count"),
874
- l("connect.referral.reward.remove_referral_count"),
875
- l("connect.prompt.confirm"),
876
- l("connect.prompt.cancel")
877
- ))
878
- return;
879
- const d = H(g.referralProgram), _ = d.reward[e].rewards[t + 1];
880
- if (_) {
881
- if (!await K.confirm(
882
- l("connect.referral.referral_count.update.range_discontinuous.next", {
883
- from: _.threshold.from ?? 0,
884
- to: _.threshold.to ?? 1 / 0,
885
- newFrom: d.reward[e].rewards[t].threshold.from
886
- }),
887
- l("connect.referral.referral_count.remove.title"),
888
- l("connect.referral.referral_count.remove.next_range"),
889
- l("connect.prompt.cancel")
890
- ))
891
- return;
892
- _.threshold.from = d.reward[e].rewards[t].threshold.from;
893
- }
894
- d.reward[e].rewards.splice(t, 1), await o(d);
895
- }
896
- const h = [
897
- {
898
- header: l("connect.referral.reward.table.count"),
899
- accessorFn: (e) => e.threshold.from == e.threshold.to ? `${e.threshold.from}` : e.threshold.to ? `${e.threshold.from} - ${e.threshold.to ?? "∞"}` : `${e.threshold.from}+`
900
- },
901
- {
902
- header: l("connect.referral.reward.table.reward"),
903
- accessorKey: "type",
904
- accessorFn: (e) => {
905
- var t;
906
- return `${((t = e.pf_reward) == null ? void 0 : t.length) || 0} reward(s)`;
907
- }
908
- },
909
- {
910
- id: "actions",
911
- meta: {
912
- textAlign: "right"
913
- },
914
- cell(e) {
915
- return te(oe.FmButton, {
916
- variant: "tertiary",
917
- icon: "delete",
918
- iconColor: "neutral-gray-400",
919
- class: "ml-auto",
920
- onClick: (t) => {
921
- t.stopPropagation(), console.log(e.row), S(e.row.original.groupIndex, e.row.index);
922
- }
923
- });
924
- }
925
- }
926
- ];
927
- return _e(async () => {
928
- await g.readReferralProgram();
929
- }), (e, t) => {
930
- const d = w("FmCard"), _ = w("FmIcon"), b = w("FmTooltip"), $ = w("FmButton"), U = w("FmTable"), P = w("FmList");
931
- return C(), B(Y, null, [
932
- z("", !0),
933
- c(d, {
934
- variant: "outlined",
935
- class: "flex flex-col gap-16 p-16"
936
- }, {
937
- default: V(() => [
938
- a("div", mr, O(r(l)("connect.referral.how_it_works.title")), 1),
939
- a("div", fr, [
940
- (C(!0), B(Y, null, re(r(M), (x, v) => (C(), B("div", {
941
- key: v,
942
- class: de(["px-8", { "xs:!border-r": v % 2 == 0 }])
943
- }, [
944
- a("div", pr, [
945
- c(_, {
946
- name: x.icon,
947
- color: "primary",
948
- class: "bg-fm-color-system-warning-100 p-8 fm-corner-radius-md max-h-40 max-w-40"
949
- }, null, 8, ["name"]),
950
- a("div", null, [
951
- a("div", hr, [
952
- ce(O(r(l)(x.label)) + " ", 1),
953
- x.helperText ? (C(), j(b, {
954
- key: 0,
955
- content: x.helperText
956
- }, {
957
- default: V(() => [
958
- c(_, {
959
- name: "help",
960
- size: "sm",
961
- outline: !0
962
- })
963
- ]),
964
- _: 1
965
- }, 8, ["content"])) : z("", !0)
966
- ]),
967
- a("div", vr, O(x.sublabel), 1),
968
- x.action ? (C(), j($, {
969
- key: 0,
970
- variant: "plain",
971
- label: x.action,
972
- disabled: !r(p).isPremium,
973
- class: "fm-typo-en-body-md-400 !p-0",
974
- onClick: x.onClick
975
- }, null, 8, ["label", "disabled", "onClick"])) : z("", !0)
976
- ])
977
- ])
978
- ], 2))), 128))
979
- ])
980
- ]),
981
- _: 1
982
- }),
983
- r(u) && r(u).length > 0 ? (C(), j(d, {
984
- key: 1,
985
- variant: "outlined",
986
- class: "flex flex-col gap-16 p-16"
987
- }, {
988
- default: V(() => [
989
- c(P, { separator: !0 }, {
990
- default: V(() => [
991
- (C(!0), B(Y, null, re(r(u), (x, v) => (C(), j(Ge, {
992
- key: v,
993
- "reward-group": x,
994
- level: v,
995
- onEdit: (E) => D(v),
996
- onRemove: (E) => i(v),
997
- onAddCount: t[0] || (t[0] = (E) => {
998
- L({ groupIndex: E, countIndex: -1 });
999
- })
1000
- }, {
1001
- default: V(() => [
1002
- a("div", _r, [
1003
- c(U, {
1004
- "row-data": x.rewards.map((E) => ({ ...E, groupIndex: v })),
1005
- "column-defs": h,
1006
- "hide-footer": !0,
1007
- "page-size": 50,
1008
- onRowClick: (E) => L({ groupIndex: v, countIndex: E.index })
1009
- }, null, 8, ["row-data", "onRowClick"])
1010
- ]),
1011
- x.rewards.length ? z("", !0) : (C(), B("div", gr, [
1012
- t[3] || (t[3] = a("div", { class: "flex flex-col gap-16 text-center" }, [
1013
- a("div", { class: "fm-typo-en-title-sm-800" }, "Create progressive reward"),
1014
- 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 ")
1015
- ], -1)),
1016
- c($, {
1017
- variant: "secondary",
1018
- label: "Add count",
1019
- icon: "add",
1020
- onClick: (E) => L({ groupIndex: v, countIndex: -1 })
1021
- }, null, 8, ["onClick"])
1022
- ]))
1023
- ]),
1024
- _: 2
1025
- }, 1032, ["reward-group", "level", "onEdit", "onRemove"]))), 128))
1026
- ]),
1027
- _: 1
1028
- })
1029
- ]),
1030
- _: 1
1031
- })) : (C(), j(d, {
1032
- key: 2,
1033
- variant: "outlined",
1034
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
1035
- }, {
1036
- default: V(() => [
1037
- t[4] || (t[4] = a("img", {
1038
- src: ge,
1039
- class: "aspect-square w-[150px]"
1040
- }, null, -1)),
1041
- a("div", wr, [
1042
- a("div", yr, O(r(l)("connect.referral.referral_tier_title")), 1),
1043
- a("div", br, O(r(l)("connect.referral.referral_tier_description")), 1)
1044
- ]),
1045
- c($, {
1046
- variant: "primary",
1047
- label: r(l)("connect.referral.add_referral_tier"),
1048
- icon: "add",
1049
- disabled: !r(p).isPremium,
1050
- onClick: t[1] || (t[1] = (x) => D(-1))
1051
- }, null, 8, ["label", "disabled"])
1052
- ]),
1053
- _: 1
1054
- })),
1055
- c(ye, {
1056
- ref_key: "rewardGroupRef",
1057
- ref: m
1058
- }, null, 512),
1059
- c(qe, {
1060
- ref_key: "editReferralCountSheetRef",
1061
- ref: R,
1062
- onUpdate: y
1063
- }, null, 512),
1064
- c(sr, {
1065
- ref_key: "manageCriteriaSheetRef",
1066
- ref: A
1067
- }, null, 512),
1068
- c(ur, {
1069
- ref_key: "editRefereeRewardSheetRef",
1070
- ref: T,
1071
- onUpdate: n
1072
- }, null, 512)
1073
- ], 64);
1074
- };
1075
- }
1076
- });
1077
- export {
1078
- qr as default
1079
- };