@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-beta.80

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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-LOK5TzX0.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-Bk5Z5u5_.js} +617 -607
  3. package/dist/AuditLogs-Rezf9EeA.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-B8yzS5bD.js} +10 -10
  5. package/dist/Broadcast-CZ0QCvua.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-iJQS2Ck9.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-BQOv5yB9.js} +145 -140
  8. package/dist/Collections-qenPlCd2.js +540 -0
  9. package/dist/Credit-BJLskbVu.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DKWCWOU_.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-Dw1qQfnG.js +351 -0
  15. package/dist/Experience-BjfEiGT8.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-C013Tr1o.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-Gw_tFjen.js +330 -0
  20. package/dist/Grab-Bdv7SaB9.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-Ba4L39GL.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-C67U3YDJ.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-pQ8sF5KW.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-o-eN3J4i.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-DPjqCyJ5.js} +1 -1
  26. package/dist/Marketing-DtEooXof.js +166 -0
  27. package/dist/MarketingMaterialEdit-Balw055Y.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-QA7TQnyw.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-CSJQFYlh.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-D-46vda_.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-6a7_lw74.js} +13443 -10607
  32. package/dist/Mission-DJVxFbX5.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-Btkh3oiI.js} +24 -25
  34. package/dist/Point-CVdF9GtN.js +262 -0
  35. package/dist/Promotion-BtmlvUd3.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-BfiCMsLC.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B07QGPli.js} +10 -10
  38. package/dist/Review-BeZ90jW9.js +621 -0
  39. package/dist/ReviewFacebookCallback-CwAcKaib.js +243 -0
  40. package/dist/ReviewGoogleCallback-CVK6Yc5E.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-CyXqNpAa.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-BICsdgSh.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BgKGNK7y.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-B9g57O7g.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-BwDOXE87.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DXDcJLYF.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-CROBk6cD.js +226 -0
  48. package/dist/Setting-BHteqZv6.js +2039 -0
  49. package/dist/SettingAdvertisements-CubrbuSL.js +264 -0
  50. package/dist/Store-u6LYUnmp.js +1996 -0
  51. package/dist/StoreRewards-D9h0YnEx.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-vrYqDGOa.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-WgNstmNx.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-CBdi4sPT.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-BegmN7hs.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-C6XMd9_r.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BBf4BP4m.js} +7 -7
  58. package/dist/Voucher-D6hSas_z.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-ZOlAZ_q5.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bs8TNiCY.js} +2 -2
  61. package/dist/app-Duwed9mD.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-6oZ8Rgui.js} +11 -8
  64. package/dist/campaign-CzenWLhs.js +219 -0
  65. package/dist/campaign-PYce7g0o.js +253 -0
  66. package/dist/campaign.enum-KHniCp5a.js +26 -0
  67. package/dist/campaign.fn-dOSgHJcU.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-BZA1DKIB.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-CyfrdKBf.js} +2 -2
  70. package/dist/dto-DYmM2ud_.js +222 -0
  71. package/dist/duplicateCampaign-BXaDK8Q6.js +51 -0
  72. package/dist/effect-DBI_JHbP.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-BNs-WN79.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DTCCKE2m.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CeYr7Anh.js} +22 -7
  76. package/dist/index-38u-cCwD.js +3431 -0
  77. package/dist/{index-Cm2sBagk.js → index-BdjY7GRO.js} +1 -1
  78. package/dist/index-CGMiuxyf.js +85 -0
  79. package/dist/index-CQZbm9P5.js +8912 -0
  80. package/dist/index-Cal60fAm.js +48 -0
  81. package/dist/{index-DT2viYsL.js → index-CnRLkzpg.js} +617 -191
  82. package/dist/index-CuvNtC_M.js +61 -0
  83. package/dist/{index-CSQY21Zb.js → index-D-kPBF9C.js} +3 -3
  84. package/dist/{index-DVQnrex_.js → index-DcFYm1fy.js} +3 -3
  85. package/dist/index-DjONNxbl.js +30289 -0
  86. package/dist/{index-26SopNpv.js → index-ItaoypTr.js} +1 -1
  87. package/dist/index-_jxXI4_v.js +28899 -0
  88. package/dist/{index-DwT9RLst.js → index-nXfjG8UQ.js} +23 -12
  89. package/dist/{index-BIRmS75g.js → index-pHQfP2e7.js} +1 -1
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-CokFPnqn.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-fZQi5zP8.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-R-DIRmbj.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CApN5ZJ1.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-C6I6vVy2.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-Dq4d381U.js} +1 -1
  97. package/dist/objectid-Kv5GREBk.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-9_UvAdJ2.js} +784 -777
  99. package/dist/remy-NLAa-9Qg.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-DXHGeGYY.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-B_XgRDr-.js} +505 -487
  102. package/dist/rule-builder-BMXyzu8k.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-CnyTUzQU.js +188 -0
  105. package/dist/timezone-Izs3ibB-.js +1156 -0
  106. package/dist/trigger-Dda3NmaE.js +213 -0
  107. package/dist/usePagination-Byxk4XVn.js +220 -0
  108. package/dist/user-BZxO8qdh.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DDbkmbSf.js} +433 -433
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-D8yNl8dN.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-Xp7TePRP.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -1,423 +0,0 @@
1
- import { defineComponent as G, ref as F, computed as N, onMounted as q, resolveComponent as R, openBlock as d, createBlock as C, unref as e, isRef as Y, withCtx as S, createElementVNode as l, createVNode as c, createElementBlock as P, createTextVNode as z, resolveDynamicComponent as H, toDisplayString as T, Fragment as j, createCommentVNode as U, h } from "vue";
2
- import { _ as J } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Q, components as k } from "@feedmepos/ui-library";
4
- import "./index-Cm2sBagk.js";
5
- import { u as X } from "./loading-C6Ouh0mG.js";
6
- import { C as Z, u as ee } from "./membership-DU0BwIj8.js";
7
- import { p as M, f as B } from "./plugins-C-CRzeyC.js";
8
- import { u as te } from "./vue-i18n-DVmD9I_o.js";
9
- import { F as oe } from "./index-DOfLDlI8.js";
10
- import { c as ae } from "./object-qECH92oz.js";
11
- import { u as K } from "./app-wDQR6dpb.js";
12
- import { u as ne } from "./business-Bc-EMd2p.js";
13
- import { useCoreStore as se } from "@feedmepos/mf-common";
14
- import { Z as b } from "./zod-Bg2FbC-D.js";
15
- import { _ as re } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js";
16
- import { _ as ie } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
17
- import { _ as le } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js";
18
- import { _ as me, a as ce } from "./EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js";
19
- import { i as de, t as ue } from "./helper-B1vFwohM.js";
20
- import { useRouter as pe } from "vue-router";
21
- import { m as D } from "./index-BIRmS75g.js";
22
- import { R as O } from "./app-BGaUIdCr.js";
23
- const fe = {
24
- key: 0,
25
- class: "flex flex-col space-y-16 pr-12"
26
- }, ye = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, ge = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, we = { class: "flex items-center gap-8" }, ve = /* @__PURE__ */ G({
27
- __name: "EditRewardSheet",
28
- emits: ["update"],
29
- setup(W, { expose: s, emit: $ }) {
30
- const A = $, y = ne(), I = se(), _ = F(!1), a = F(), g = F(), u = oe, p = N(
31
- () => {
32
- var i;
33
- return Z[((i = a.value) == null ? void 0 : i.type) || "VOUCHER"];
34
- }
35
- ), w = N(() => {
36
- const i = u.safeParse(a.value);
37
- return i.success ? [] : i.error.errors;
38
- });
39
- function L() {
40
- const i = u.safeParse(a.value);
41
- i.success && A("update", i.data);
42
- }
43
- function V(i, n, t = {
44
- isStoreReward: !1,
45
- type: "VOUCHER"
46
- }) {
47
- _.value = i, i && (g.value = void 0, a.value = n || de(t.type, {
48
- business: I.currentBusiness.value._id,
49
- noCampaign: t.isStoreReward == !0
50
- }));
51
- }
52
- return q(async () => {
53
- await y.readLocations();
54
- }), s({
55
- showSheet: V,
56
- data: a,
57
- rewardImage: g
58
- }), (i, n) => {
59
- const t = R("FmTextarea"), o = R("FmHelperText"), m = R("FmButton"), v = R("FmSideSheet");
60
- return d(), C(v, {
61
- "max-width": 560,
62
- modelValue: e(_),
63
- "onUpdate:modelValue": n[7] || (n[7] = (f) => Y(_) ? _.value = f : null),
64
- header: "Store setting"
65
- }, {
66
- "side-sheet-footer": S(() => [
67
- l("div", we, [
68
- c(m, {
69
- label: "Submit",
70
- onClick: L,
71
- disabled: e(w).length > 0 || e(K)().isLoading,
72
- loading: e(K)().isLoading
73
- }, null, 8, ["disabled", "loading"]),
74
- c(m, {
75
- label: "Cancel",
76
- onClick: n[6] || (n[6] = (f) => V(!1)),
77
- variant: "tertiary"
78
- })
79
- ])
80
- ]),
81
- default: S(() => {
82
- var f, x, E;
83
- return [
84
- e(a) ? (d(), P("div", fe, [
85
- l("div", ye, [
86
- n[8] || (n[8] = z(" Reward information ")),
87
- (d(), C(H(e(p).chip())))
88
- ]),
89
- c(re, {
90
- modelValue: e(a).name,
91
- "onUpdate:modelValue": n[0] || (n[0] = (r) => e(a).name = r),
92
- label: `${e(p).name} name`,
93
- schema: e(b).typeAtPath(e(u), "name", [e(a).type])
94
- }, null, 8, ["modelValue", "label", "schema"]),
95
- c(t, {
96
- class: "!mb-[-16px]",
97
- modelValue: e(a).description,
98
- "onUpdate:modelValue": n[1] || (n[1] = (r) => e(a).description = r),
99
- rules: [e(b).ruleAtPath(e(u), "description", [e(a).type])]
100
- }, {
101
- label: S(() => [
102
- (d(), C(H(
103
- e(b).toInputLabel(
104
- e(b).typeAtPath(e(u), "description", [e(a).type]),
105
- `${e(p).name} description`
106
- )
107
- )))
108
- ]),
109
- _: 1
110
- }, 8, ["modelValue", "rules"]),
111
- l("div", ge, [
112
- l("div", null, T(e(p).name) + " description should not exceed 200 characters. ", 1),
113
- l("div", null, T(((f = e(a).description) == null ? void 0 : f.length) ?? 0) + "/200", 1)
114
- ]),
115
- c(ie, {
116
- class: "w-1/2 xs:w-2/3",
117
- "aspect-ratio": "16/9",
118
- file: e(g) ?? void 0,
119
- thumbnail: e(a).image ?? void 0,
120
- "onUpdate:file": n[2] || (n[2] = async (r) => {
121
- g.value = r, r || (e(a).image = null);
122
- })
123
- }, {
124
- label: S(() => [
125
- (d(), C(H(
126
- e(b).toInputLabel(
127
- e(b).typeAtPath(e(u), "image", [e(a).type]),
128
- `${e(p).name} image`
129
- )
130
- )))
131
- ]),
132
- _: 1
133
- }, 8, ["file", "thumbnail"]),
134
- e(a).type === "VOUCHER" ? (d(), P(j, { key: 0 }, [
135
- n[9] || (n[9] = l("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
136
- c(me, {
137
- "model-value": e(a).extras.effect,
138
- "onUpdate:modelValue": n[3] || (n[3] = (r) => {
139
- e(a).extras.effect = r;
140
- })
141
- }, null, 8, ["model-value"]),
142
- e(a).extras.effect == null ? (d(), C(o, {
143
- key: 0,
144
- class: "!mt-8",
145
- text: "Effect is required",
146
- state: "error"
147
- })) : U("", !0),
148
- n[10] || (n[10] = l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, " Usage configuration ", -1)),
149
- c(ce, {
150
- "model-value": e(a).options,
151
- "no-campaign": e(a).noCampaign,
152
- "onUpdate:modelValue": n[4] || (n[4] = (r) => e(a).options = r),
153
- schema: e(b).typeAtPath(e(u), "options", ["VOUCHER"])
154
- }, null, 8, ["model-value", "no-campaign", "schema"])
155
- ], 64)) : U("", !0),
156
- n[11] || (n[11] = l("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
157
- e(a).type === "VOUCHER" ? (d(), C(le, {
158
- key: 1,
159
- "model-value": ((E = (x = e(a).extras) == null ? void 0 : x.targetLocation) == null ? void 0 : E.map(String)) ?? null,
160
- type: "select",
161
- "onUpdate:modelValue": n[5] || (n[5] = (r) => {
162
- e(a).extras.targetLocation = r;
163
- }),
164
- rules: [
165
- e(b).ruleAtPath(e(u), "extras.targetLocation", ["VOUCHER"])
166
- ]
167
- }, null, 8, ["model-value", "rules"])) : U("", !0)
168
- ])) : U("", !0)
169
- ];
170
- }),
171
- _: 1
172
- }, 8, ["modelValue"]);
173
- };
174
- }
175
- }), Re = { class: "px-24 flex flex-col gap-y-16" }, be = { class: "flex items-center justify-between w-full" }, _e = { class: "flex flex-col gap-16 text-center" }, xe = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qe = /* @__PURE__ */ G({
176
- __name: "StoreRewards",
177
- setup(W) {
178
- const { t: s } = te(), $ = Q(), A = {
179
- label: s("connect.storeRewards.create"),
180
- value: "create",
181
- isPrimary: !0,
182
- prependIcon: "add"
183
- }, y = ee(), { global: I, minor: _ } = X, a = pe(), g = F({
184
- searchKey: "",
185
- columnFilters: []
186
- }), u = [
187
- {
188
- header: s("connect.storeRewards.table.name"),
189
- accessorFn: (t) => t.name
190
- },
191
- {
192
- id: "type",
193
- header: s("connect.storeRewards.table.type"),
194
- accessorFn: (t) => t.type,
195
- cell(t) {
196
- return Z[t.row.original.type].chip();
197
- }
198
- },
199
- {
200
- header: s("connect.storeRewards.table.validity"),
201
- accessorFn: (t) => ue(
202
- "validityOption" in t.options ? t.options.validityOption || {} : {}
203
- )
204
- },
205
- {
206
- header: s("connect.storeRewards.table.used"),
207
- meta: {
208
- textAlign: "left"
209
- },
210
- accessorFn: (t) => t.currentReceive ?? 0
211
- },
212
- {
213
- header: s("connect.storeRewards.table.actions"),
214
- cell(t) {
215
- return h("div", { class: "flex items-center justify-end gap-4" }, [
216
- h(
217
- k.FmMenu,
218
- {
219
- placement: "bottom-end",
220
- onClick: (o) => {
221
- o.stopPropagation();
222
- }
223
- },
224
- {
225
- "menu-button": () => h(k.FmButton, {
226
- icon: "more_vert",
227
- iconColor: "neutral-gray-400",
228
- variant: "tertiary"
229
- }),
230
- default: () => [
231
- h(k.FmMenuItem, {
232
- label: "View collections",
233
- onClick: async (o) => {
234
- o.stopPropagation(), L(t.row.original._id);
235
- }
236
- }),
237
- // h(components.FmMenuItem, {
238
- // label: 'View transactions',
239
- // onClick: async (event: Event) => {
240
- // event.stopPropagation();
241
- // onViewTransactions(props.row.original._id as string);
242
- // },
243
- // }),
244
- h(
245
- k.FmMenuItem,
246
- {
247
- onClick: async (o) => {
248
- o.stopPropagation(), V(t.row.original);
249
- }
250
- },
251
- {
252
- label: h(
253
- "div",
254
- {
255
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
256
- },
257
- "Remove"
258
- )
259
- }
260
- )
261
- ]
262
- }
263
- )
264
- ]);
265
- }
266
- }
267
- ], p = N(
268
- () => y.bundleRewards.filter((t) => t.type == "VOUCHER")
269
- ), w = F();
270
- function L(t) {
271
- a.push({
272
- name: O["$connect-STORE_REWARD_COLLECTIONS"],
273
- params: { id: t }
274
- });
275
- }
276
- async function V(t) {
277
- if (t.type === "TITLE") {
278
- await M.confirm(
279
- s("connect.storeRewards.remove.message"),
280
- s("connect.storeRewards.remove.title"),
281
- s("connect.storeRewards.remove.action")
282
- ) && await a.push({ name: O["$connect-PROGRAM_TITLE"] });
283
- return;
284
- }
285
- await M.remove(
286
- s("connect.storeRewards.delete.confirm"),
287
- s("connect.storeRewards.delete.title")
288
- ) && await _(
289
- async () => {
290
- await D.deleteReward(t._id), await y.readMembership(), await y.readRewards();
291
- },
292
- {
293
- message: s("connect.storeRewards.delete.message"),
294
- successMessage: s("connect.storeRewards.delete.success")
295
- }
296
- );
297
- }
298
- async function i(t) {
299
- var m;
300
- const o = t ? ae(y.bundleRewards.find((v) => v._id === t)) : void 0;
301
- if ((o == null ? void 0 : o.type) === "TITLE") {
302
- await M.confirm(
303
- "You cannot edit a title here, please edit it at the Program > Title section.",
304
- "Update reward",
305
- "Go to title section"
306
- ) && await a.push({ name: O["$connect-PROGRAM_TITLE"] });
307
- return;
308
- }
309
- (m = w.value) == null || m.showSheet(!0, o, {
310
- isStoreReward: !0,
311
- type: "VOUCHER"
312
- });
313
- }
314
- async function n(t) {
315
- let o = !1;
316
- t._id && t.type === "VOUCHER" && await new Promise((m) => {
317
- $.open({
318
- title: "Confirmation",
319
- message: s("connect.campaign.voucher.updateConfirm.message"),
320
- primaryActions: {
321
- text: s("connect.campaign.voucher.updateConfirm.updateAll"),
322
- close: !0
323
- },
324
- secondaryActions: {
325
- text: s("connect.campaign.voucher.updateConfirm.updateFuture"),
326
- close: !0
327
- }
328
- }).onPrimary(async () => {
329
- o = !0, m();
330
- }).onSecondary(async () => {
331
- m();
332
- });
333
- }), await _(
334
- async () => {
335
- var m, v, f, x;
336
- (m = w.value) != null && m.rewardImage && t.image ? await B.delete(t.image) : (v = w.value) != null && v.rewardImage && (t.image = await B.update(
337
- t.image || B.collectibleImagePath(
338
- void 0,
339
- w.value.rewardImage
340
- ),
341
- (f = w.value) == null ? void 0 : f.rewardImage
342
- )), t._id ? await D.updateReward(t._id, {
343
- ...t,
344
- updateCollection: o
345
- }) : await D.createReward(t), await y.readRewards(), (x = w.value) == null || x.showSheet(!1);
346
- },
347
- {
348
- message: "Updating reward",
349
- successMessage: "Reward updated successfully"
350
- }
351
- );
352
- }
353
- return q(async () => {
354
- await I(async () => {
355
- await y.readMembership(), await y.readRewards();
356
- });
357
- }), (t, o) => {
358
- const m = R("FmPageHead"), v = R("FmSearch"), f = R("FmTable"), x = R("FmButton"), E = R("FmCard");
359
- return d(), P(j, null, [
360
- c(m, {
361
- title: e(s)("connect.storeRewards.title"),
362
- description: e(s)("connect.storeRewards.description"),
363
- actions: [A],
364
- "back-button": !0,
365
- "onClick:action": o[0] || (o[0] = () => i()),
366
- "onClick:back": o[1] || (o[1] = () => e(a).push({ name: e(O)["$connect-STORE"] }))
367
- }, null, 8, ["title", "description", "actions"]),
368
- l("div", Re, [
369
- e(p) && e(p).length > 0 ? (d(), P(j, { key: 0 }, [
370
- l("div", be, [
371
- o[6] || (o[6] = l("div", { class: "flex gap-8" }, null, -1)),
372
- c(v, {
373
- modelValue: e(g).searchKey,
374
- "onUpdate:modelValue": o[2] || (o[2] = (r) => e(g).searchKey = r),
375
- class: "",
376
- placeholder: "search",
377
- collapsible: ""
378
- }, null, 8, ["modelValue"])
379
- ]),
380
- c(f, {
381
- "row-data": e(p),
382
- "column-defs": u,
383
- "search-value": e(g).searchKey,
384
- "column-filter": e(g).columnFilters,
385
- onRowClick: o[3] || (o[3] = (r) => i(r.original._id)),
386
- "hide-footer": e(p).length < 10
387
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
388
- ], 64)) : (d(), C(E, {
389
- key: 1,
390
- variant: "outlined",
391
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
392
- }, {
393
- default: S(() => [
394
- o[7] || (o[7] = l("img", {
395
- src: J,
396
- class: "aspect-square w-[150px]"
397
- }, null, -1)),
398
- l("div", _e, [
399
- l("div", xe, T(e(s)("connect.storeRewards.empty.title")), 1),
400
- l("div", Ce, T(e(s)("connect.storeRewards.empty.description")), 1)
401
- ]),
402
- c(x, {
403
- variant: "primary",
404
- label: e(s)("connect.storeRewards.empty.action"),
405
- onClick: o[4] || (o[4] = (r) => i()),
406
- icon: "add"
407
- }, null, 8, ["label"])
408
- ]),
409
- _: 1
410
- })),
411
- c(ve, {
412
- ref_key: "rewardSheetRef",
413
- ref: w,
414
- onUpdate: o[5] || (o[5] = (r) => n(r))
415
- }, null, 512)
416
- ])
417
- ], 64);
418
- };
419
- }
420
- });
421
- export {
422
- qe as default
423
- };