@feedmepos/mf-connect 0.0.16-beta.1 → 0.0.16-beta.11

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 (95) hide show
  1. package/dist/{Analytic-C-zZmF5N.js → Analytic-Gq7PoNer.js} +368 -365
  2. package/dist/App-Cikl5jnp.js +177 -0
  3. package/dist/Broadcast-DU3JnBwZ.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-VWLBlxy1.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0I8IZIR.js} +20 -20
  5. package/dist/Card-hIeQ5XUH.js +825 -0
  6. package/dist/Collections-B1SC1rr7.js +453 -0
  7. package/dist/Credit-BgwI8DR3.js +216 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D9VR3P2d.js} +1026 -1022
  9. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-AhWnHG02.js → EffectSheet.vue_vue_type_style_index_0_lang-DPgu45MD.js} +29 -29
  10. package/dist/Experience-C2Q-zqV6.js +221 -0
  11. package/dist/Game-DU2pZDGk.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/JsonViewer-v8_C7l5N.js +87 -0
  14. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DykNOOFD.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +1 -1
  15. package/dist/{MainLayout-D0AoA1tk.js → MainLayout-B1aJoR95.js} +2 -2
  16. package/dist/Marketing-DWiTQp9I.js +316 -0
  17. package/dist/Member-BEXKBFry.js +69 -0
  18. package/dist/MemberList-DzMdajIf.js +1733 -0
  19. package/dist/MemberOverview-wL_ailso.js +58 -0
  20. package/dist/{MemberTransactions-CTAx5jIV.js → MemberTransactions-Bciankuu.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C-BtHxSc.js → MessageInput.vue_vue_type_script_setup_true_lang-DH25Hfk3.js} +46 -46
  22. package/dist/Mission-KzwRlaA5.js +259 -0
  23. package/dist/Point-CSKvZXHc.js +222 -0
  24. package/dist/Promotion-IiwPhx8p.js +221 -0
  25. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CrpJySSp.js → RuleGroup.vue_vue_type_script_setup_true_lang-4zIO3oCr.js} +545 -544
  26. package/dist/Segment-2Q0PonBb.js +447 -0
  27. package/dist/{Setting-Zrj5P_4m.js → Setting-Df5vVRt4.js} +600 -598
  28. package/dist/Store-C0WXCKs6.js +1503 -0
  29. package/dist/StoreRewards-eSSIO0nk.js +401 -0
  30. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DS4APaHw.js → StoreTransactions.vue_vue_type_script_setup_true_lang-BjnCRKGX.js} +106 -108
  31. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ZYjWlDJ1.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-b0xTcoEp.js} +1 -1
  32. package/dist/{Tier-DVWJyQ9S.js → Tier-v-1FkRU-.js} +464 -449
  33. package/dist/{Title-B5kX64vs.js → Title-CQ2JWqBW.js} +315 -299
  34. package/dist/Transaction-0OouN_6s.js +39 -0
  35. package/dist/Voucher-CL0cgogx.js +488 -0
  36. package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
  37. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  38. package/dist/app-Bd19eW7X.js +5381 -0
  39. package/dist/app-CfS25Z66.js +34797 -0
  40. package/dist/app-wDQR6dpb.js +39 -0
  41. package/dist/app.js +5 -3
  42. package/dist/business-dQh3AEot.js +78 -0
  43. package/dist/{campaign-BZJuknWK.js → campaign-BOl8AgKA.js} +12 -12
  44. package/dist/{collection.fn-DoCkZ6z4.js → collection.fn-B_YsXmrP.js} +2 -2
  45. package/dist/dto-B8NfyVPG.js +1169 -0
  46. package/dist/{effect-B8kmnKvY.js → effect-C2jCStXO.js} +1 -1
  47. package/dist/{export-Dm6LYnWo.js → export-BtZc3Yzh.js} +3 -3
  48. package/dist/{helper-DR4XK3nv.js → helper-8oGsrM56.js} +1 -1
  49. package/dist/{index-DcUrk07Q.js → index-6FkKY3q0.js} +3 -3
  50. package/dist/{index-Bu4_26qI.js → index-C7oeXRUl.js} +1 -1
  51. package/dist/{index-CuL5-ORK.js → index-CZKYIefW.js} +6 -7
  52. package/dist/{index-yxJMhfxj.js → index-C_0IFnwi.js} +5 -5
  53. package/dist/{index-BryrRq8O.js → index-DCixRRvz.js} +36 -30
  54. package/dist/{index-CkiYkbXb.js → index-DFgt4-VW.js} +1 -1
  55. package/dist/{index-CWf0mh3a.js → index-DYDhH9bi.js} +177 -168
  56. package/dist/{index-boor8e80.js → index-Di-kWSmf.js} +3 -3
  57. package/dist/{app-DkI7dYRN.js → index-Dn0jdj0o.js} +9665 -13024
  58. package/dist/index-DwKqFNF6.js +3 -0
  59. package/dist/{index-BobRgQrE.js → index-HoacsZDk.js} +2 -2
  60. package/dist/{index-BxkxVtgm.js → index-UTQHDUdW.js} +1 -1
  61. package/dist/{loading-BzV5acUX.js → loading-D_AN6p24.js} +6807 -6805
  62. package/dist/{lodash-mg4435Qq.js → lodash-B5I3zXaY.js} +1 -1
  63. package/dist/{membership-CqbsLHqx.js → membership-Ccrx9R6r.js} +3 -3
  64. package/dist/{money-DA_gtp3q.js → money-waD-f-Zz.js} +1 -1
  65. package/dist/{number-C388eyOu.js → number-CwTGGsh9.js} +1 -1
  66. package/dist/{rule-Clmr5y4j.js → rule-DJ07h3Gh.js} +2 -2
  67. package/dist/{rule-builder-BgqNbM-P.js → rule-builder-DJ-acvVD.js} +1 -1
  68. package/dist/style.css +1 -1
  69. package/dist/template-clxvNnbF.js +190 -0
  70. package/dist/{usePagination-o5fgsZwU.js → usePagination-BeF5K3M7.js} +86 -86
  71. package/dist/vue-i18n-BxwiXSkp.js +2365 -0
  72. package/dist/{xlsx-BRdh9e2p.js → xlsx-BB366cdN.js} +1945 -1945
  73. package/package.json +9 -5
  74. package/dist/Broadcast-X69Mtv3b.js +0 -216
  75. package/dist/Card-D0X3v1UF.js +0 -822
  76. package/dist/Collections-umR6Ehqf.js +0 -452
  77. package/dist/Credit-C1EWF7R0.js +0 -214
  78. package/dist/Experience-CqL8wyPm.js +0 -211
  79. package/dist/Game--kYe64EV.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BjOJ3XSL.js +0 -144
  81. package/dist/Marketing-CTCQ5ZmZ.js +0 -308
  82. package/dist/Member-DCduX7zP.js +0 -91
  83. package/dist/MemberList-B0EkXZJu.js +0 -1729
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/Mission-CVr9rS_D.js +0 -248
  86. package/dist/Point-BnZ6M74y.js +0 -220
  87. package/dist/Promotion-B0PUve5S.js +0 -218
  88. package/dist/Segment-B-XpkyM5.js +0 -445
  89. package/dist/Store-B2gywCt2.js +0 -1503
  90. package/dist/StoreRewards-D8410Q_-.js +0 -434
  91. package/dist/Transaction-CZBO4v4d.js +0 -36
  92. package/dist/Voucher-se-4JF9B.js +0 -481
  93. package/dist/app-B2ImSO3V.js +0 -53382
  94. package/dist/dto-BWpvRpK2.js +0 -1151
  95. package/dist/template-Dwp7heBA.js +0 -190
@@ -1,58 +0,0 @@
1
- import { defineComponent as d, resolveComponent as o, openBlock as r, createElementBlock as s, Fragment as a, createElementVNode as e, createVNode as c, withCtx as v, renderList as p, normalizeClass as _, toDisplayString as n, createCommentVNode as u } from "vue";
2
- const y = { class: "bg-gradient-to-r from-orange-200 p-24 to-blue-200 via-pink-100 mx-[-24px]" }, b = /* @__PURE__ */ e("div", { class: "fm-typo-en-body-lg-600" }, "Member overview", -1), g = { class: "grid grid-cols-6 xs:grid-cols-2 gap-4 divide-x xs:divide-x-0" }, x = { class: "fm-typo-body-md-400 fm-typo-en-body-md-400 mb-2 text-fm-color-typo-secondary" }, f = { class: "fm-typo-en-title-sm-800" }, F = /* @__PURE__ */ d({
3
- __name: "MemberOverview",
4
- setup(k) {
5
- const l = [
6
- {
7
- key: "Total member",
8
- value: 4
9
- },
10
- {
11
- key: "New member",
12
- value: 2
13
- },
14
- {
15
- key: "Member average spend",
16
- value: 100
17
- },
18
- {
19
- key: "Average visit time",
20
- value: 567
21
- },
22
- {
23
- key: "Member growth",
24
- value: "100%"
25
- },
26
- { key: "Inactive member", value: 0 }
27
- ];
28
- return (h, C) => {
29
- const i = o("FmCard");
30
- return o("FmButton"), r(), s(a, null, [
31
- e("div", y, [
32
- c(i, {
33
- variant: "outlined",
34
- class: "flex flex-col gap-16 p-16"
35
- }, {
36
- default: v(() => [
37
- b,
38
- e("div", g, [
39
- (r(), s(a, null, p(l, (t, m) => e("div", {
40
- key: t.key,
41
- class: _(["px-8", { "xs:!border-r": m % 2 == 0 }])
42
- }, [
43
- e("div", x, n(t.key), 1),
44
- e("div", f, n(t.value), 1)
45
- ], 2)), 64))
46
- ])
47
- ]),
48
- _: 1
49
- })
50
- ]),
51
- u("", !0)
52
- ], 64);
53
- };
54
- }
55
- });
56
- export {
57
- F as default
58
- };
@@ -1,248 +0,0 @@
1
- import { defineComponent as j, ref as I, computed as A, onMounted as D, resolveComponent as r, openBlock as c, createElementBlock as _, Fragment as h, createVNode as i, unref as a, createElementVNode as s, withCtx as w, renderList as E, createBlock as x, resolveDynamicComponent as H, toDisplayString as y, h as m } from "vue";
2
- import { _ as q } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as z, components as C } from "@feedmepos/ui-library";
4
- import { u as G, a as J, p as Q } from "./loading-BzV5acUX.js";
5
- import { a as W } from "./app-DkI7dYRN.js";
6
- import { u as X } from "./campaign-BZJuknWK.js";
7
- import { g as M, b as V } from "./dto-BWpvRpK2.js";
8
- import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js";
10
- import { u as ee } from "./template-Dwp7heBA.js";
11
- import { s as oe } from "./index-CuvNtC_M.js";
12
- import { c as g } from "./index-BxkxVtgm.js";
13
- const te = { class: "px-24 flex flex-col gap-y-16" }, ae = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ne = { class: "space-y-8" }, ie = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, ce = { class: "fm-typo-en-body-lg-600" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ s("img", {
14
- src: q,
15
- class: "aspect-square w-[150px]"
16
- }, null, -1), pe = /* @__PURE__ */ s("div", { class: "flex flex-col gap-16 text-center" }, [
17
- /* @__PURE__ */ s("div", { class: "fm-typo-en-title-sm-800" }, "Create your mission program"),
18
- /* @__PURE__ */ s("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " The mission feature adds a fun element to shopping, encouraging customers to engage more. ")
19
- ], -1), Ie = /* @__PURE__ */ j({
20
- __name: "Mission",
21
- setup(fe) {
22
- const L = {
23
- label: "Create campaign",
24
- value: "create",
25
- isPrimary: !0,
26
- prependIcon: "add"
27
- }, B = ee("MISSION", z()), $ = W(), l = X(), { global: K, minor: b } = G, n = I({
28
- searchKey: "",
29
- location: null
30
- }), d = A(
31
- () => l.campaigns.mission.filter(
32
- (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
33
- )
34
- ), R = [
35
- {
36
- header: "Program title",
37
- accessorKey: "name",
38
- // accessorFn: (v) => v.name,
39
- cell(e) {
40
- return m("div", { class: "flex items-center justify-between gap-4" }, [
41
- m("div", { class: "flex items-center" }, [
42
- m(
43
- C.FmTooltip,
44
- {
45
- content: e.row.original._id,
46
- onClick: (o) => {
47
- o.stopPropagation(), J(e.row.original._id);
48
- }
49
- },
50
- [
51
- m(C.FmIcon, {
52
- name: "info",
53
- outline: !0,
54
- size: "sm"
55
- })
56
- ]
57
- )
58
- ]),
59
- m("div", { class: "flex-1" }, e.row.original.name)
60
- ]);
61
- }
62
- },
63
- {
64
- header: "Mission type",
65
- accessorFn: (e) => oe(e.mission.type)
66
- //v.effect,
67
- },
68
- {
69
- header: "Status",
70
- cell(e) {
71
- return M(e.row.original);
72
- }
73
- },
74
- {
75
- header: "Summary",
76
- accessorFn: (e) => V(e)
77
- //v.effect,
78
- },
79
- {
80
- header: "Missions received",
81
- accessorFn: (e) => {
82
- var o;
83
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
84
- }
85
- },
86
- {
87
- header: "Actions",
88
- cell(e) {
89
- return m(C.FmButton, {
90
- variant: "tertiary",
91
- icon: "delete",
92
- iconColor: "neutral-gray-400",
93
- onClick: (o) => {
94
- o.stopPropagation(), S(e.row.original);
95
- }
96
- });
97
- }
98
- }
99
- ], v = I();
100
- async function S(e) {
101
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await b(
102
- async () => {
103
- await g.delete(e._id), await l.read("MISSION");
104
- },
105
- {
106
- message: `Removing ${e.name}`,
107
- successMessage: `Removed ${e.name} successfully`
108
- }
109
- );
110
- }
111
- async function f(e) {
112
- e ? await o() : B.open(async (u) => {
113
- await o(u);
114
- });
115
- async function o(u) {
116
- var p;
117
- (p = v.value) == null || p.showSheet(
118
- !0,
119
- "MISSION",
120
- e ? await g.readById(e._id) : void 0,
121
- u
122
- );
123
- }
124
- }
125
- async function N(e) {
126
- await b(
127
- async () => {
128
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("MISSION");
129
- },
130
- {
131
- message: `${e.campaign._id ? "Updating" : "Creating"} Mission program`,
132
- successMessage: `Mission program ${e.campaign._id ? "updated" : "created"} successfully`
133
- }
134
- );
135
- }
136
- return D(async () => {
137
- await K(async () => {
138
- await l.read("MISSION"), console.log(d);
139
- });
140
- }), (e, o) => {
141
- const u = r("FmPageHead"), p = r("FmSearch"), P = r("FmTable"), F = r("FmButton"), T = r("FmListItem"), O = r("FmList"), U = r("FmCard");
142
- return c(), _(h, null, [
143
- i(u, {
144
- title: "Mission",
145
- actions: a(d).length > 0 ? [L] : [],
146
- "onClick:action": o[0] || (o[0] = () => f())
147
- }, null, 8, ["actions"]),
148
- s("div", te, [
149
- i(p, {
150
- modelValue: a(n).searchKey,
151
- "onUpdate:modelValue": o[1] || (o[1] = (t) => a(n).searchKey = t),
152
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
153
- placeholder: "search",
154
- collapsible: ""
155
- }, null, 8, ["modelValue"]),
156
- a(l).campaigns.mission && a(l).campaigns.mission.length > 0 ? (c(), _(h, { key: 0 }, [
157
- s("div", ae, [
158
- s("div", se, [
159
- i(Y, {
160
- modelValue: a(n).location,
161
- "onUpdate:modelValue": o[2] || (o[2] = (t) => a(n).location = t),
162
- label: "Location: ",
163
- "show-item-label": !0,
164
- icon: "storefront",
165
- placement: "bottom-start",
166
- items: a($).locationItems
167
- }, null, 8, ["modelValue", "items"])
168
- ]),
169
- i(p, {
170
- modelValue: a(n).searchKey,
171
- "onUpdate:modelValue": o[3] || (o[3] = (t) => a(n).searchKey = t),
172
- class: "xs:hidden",
173
- placeholder: "search",
174
- collapsible: ""
175
- }, null, 8, ["modelValue"])
176
- ]),
177
- i(P, {
178
- class: "xs:hidden",
179
- "row-data": a(d),
180
- "column-defs": R,
181
- "search-value": a(n).searchKey,
182
- "column-filter": [],
183
- onRowClick: o[4] || (o[4] = (t) => f(t.original)),
184
- "hide-footer": a(d).length < 10
185
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
186
- i(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
187
- default: w(() => [
188
- (c(!0), _(h, null, E(a(d).filter(
189
- (t) => t.name.toLowerCase().includes(a(n).searchKey.toLowerCase())
190
- ), (t) => (c(), x(T, {
191
- key: t._id.toString(),
192
- onClick: (k) => f(t),
193
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
194
- }, {
195
- default: w(() => [
196
- s("div", ne, [
197
- s("div", ie, [
198
- (c(), x(H(a(M)(t)))),
199
- s("div", re, y(t.currentReceive ?? 0) + " used ", 1)
200
- ]),
201
- s("div", le, [
202
- s("div", ce, y(t.name), 1),
203
- s("div", me, y(a(V)(t)), 1)
204
- ]),
205
- s("div", de, " Token received: " + y(t.currentReceive ?? 0), 1)
206
- ]),
207
- i(F, {
208
- icon: "delete",
209
- "icon-color": "neutral-gray-400",
210
- variant: "tertiary",
211
- onClick: (k) => (k.stopPropagation(), S(t))
212
- }, null, 8, ["onClick"])
213
- ]),
214
- _: 2
215
- }, 1032, ["onClick"]))), 128))
216
- ]),
217
- _: 1
218
- })
219
- ], 64)) : (c(), x(U, {
220
- key: 1,
221
- variant: "outlined",
222
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
223
- }, {
224
- default: w(() => [
225
- ue,
226
- pe,
227
- i(F, {
228
- variant: "primary",
229
- label: "Create Mission program",
230
- icon: "add",
231
- onClick: o[5] || (o[5] = (t) => f())
232
- })
233
- ]),
234
- _: 1
235
- })),
236
- i(Z, {
237
- ref_key: "sheetRef",
238
- ref: v,
239
- "onSubmit:modelValue": N
240
- }, null, 512)
241
- ])
242
- ], 64);
243
- };
244
- }
245
- });
246
- export {
247
- Ie as default
248
- };
@@ -1,220 +0,0 @@
1
- import { defineComponent as D, ref as S, computed as T, onMounted as j, resolveComponent as l, openBlock as c, createElementBlock as g, Fragment as h, createVNode as i, unref as o, withCtx as f, createElementVNode as n, renderList as E, createBlock as C, resolveDynamicComponent as M, toDisplayString as y, h as H } from "vue";
2
- import { _ as q } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as z, components as G } from "@feedmepos/ui-library";
4
- import { u as J, p as Q } from "./loading-BzV5acUX.js";
5
- import { a as W } from "./app-DkI7dYRN.js";
6
- import { u as X } from "./campaign-BZJuknWK.js";
7
- import { g as V, b as L } from "./dto-BWpvRpK2.js";
8
- import { _ as Y } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as Z } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bz6TSmbW.js";
10
- import { u as ee } from "./template-Dwp7heBA.js";
11
- import { c as _ } from "./index-BxkxVtgm.js";
12
- const te = { class: "flex items-center" }, oe = /* @__PURE__ */ n("span", { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, "Point", -1), ae = { class: "px-24 flex flex-col gap-y-16" }, ne = { class: "flex items-center justify-between w-full" }, se = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, le = { class: "flex w-full gap-4 items-center" }, re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ce = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = /* @__PURE__ */ n("img", {
13
- src: q,
14
- class: "aspect-square w-[150px]"
15
- }, null, -1), fe = /* @__PURE__ */ n("div", { class: "flex flex-col gap-16 text-center" }, [
16
- /* @__PURE__ */ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your point program"),
17
- /* @__PURE__ */ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Points are virtual point that customers can earn and use to purchase bundle items. ")
18
- ], -1), Se = /* @__PURE__ */ D({
19
- __name: "Point",
20
- setup(ye) {
21
- const I = {
22
- label: "Create campaign",
23
- value: "create",
24
- isPrimary: !0,
25
- prependIcon: "add"
26
- }, B = ee("COIN", z()), v = W(), r = X(), { global: $, minor: w } = J, s = S({
27
- searchKey: "",
28
- location: null
29
- }), d = T(
30
- () => r.campaigns.point.filter(
31
- (e) => !s.value.location || !e.targetLocation || e.targetLocation.includes(s.value.location)
32
- )
33
- ), K = [
34
- {
35
- header: "Program title",
36
- accessorFn: (e) => e.name
37
- },
38
- {
39
- header: "Status",
40
- cell(e) {
41
- return V(e.row.original);
42
- }
43
- },
44
- {
45
- header: "Summary",
46
- accessorFn: (e) => L(e)
47
- //v.effect,
48
- },
49
- {
50
- header: "Actions",
51
- cell(e) {
52
- return H(G.FmButton, {
53
- variant: "tertiary",
54
- icon: "delete",
55
- iconColor: "neutral-gray-400",
56
- onClick: (a) => {
57
- a.stopPropagation(), b(e.row.original);
58
- }
59
- });
60
- }
61
- }
62
- ], x = S();
63
- async function b(e) {
64
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await w(
65
- async () => {
66
- await _.delete(e._id), await r.read("COIN");
67
- },
68
- {
69
- message: `Removing ${e.name}`,
70
- successMessage: `Removed ${e.name} successfully`
71
- }
72
- );
73
- }
74
- async function p(e) {
75
- e ? await a() : B.open(async (m) => {
76
- await a(m);
77
- });
78
- async function a(m) {
79
- var u;
80
- (u = x.value) == null || u.showSheet(
81
- !0,
82
- "COIN",
83
- e ? await _.readById(e._id) : void 0,
84
- m
85
- );
86
- }
87
- }
88
- async function N(e) {
89
- await w(
90
- async () => {
91
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await r.read("COIN");
92
- },
93
- {
94
- message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
95
- successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
96
- }
97
- );
98
- }
99
- return j(async () => {
100
- await $(async () => {
101
- await r.read("COIN");
102
- });
103
- }), (e, a) => {
104
- const m = l("FmPill"), u = l("FmPageHead"), F = l("FmSearch"), R = l("FmTable"), k = l("FmButton"), O = l("FmListItem"), U = l("FmList"), A = l("FmCard");
105
- return c(), g(h, null, [
106
- i(u, {
107
- title: "Point",
108
- actions: o(d).length > 0 ? [I] : [],
109
- "onClick:action": a[0] || (a[0] = () => p())
110
- }, {
111
- title: f(() => [
112
- n("div", te, [
113
- oe,
114
- i(m, { variant: "premium" })
115
- ])
116
- ]),
117
- _: 1
118
- }, 8, ["actions"]),
119
- n("div", ae, [
120
- i(F, {
121
- modelValue: o(s).searchKey,
122
- "onUpdate:modelValue": a[1] || (a[1] = (t) => o(s).searchKey = t),
123
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
124
- placeholder: "search",
125
- collapsible: ""
126
- }, null, 8, ["modelValue"]),
127
- o(r).campaigns.point && o(r).campaigns.point.length > 0 ? (c(), g(h, { key: 0 }, [
128
- n("div", ne, [
129
- n("div", se, [
130
- i(Y, {
131
- modelValue: o(s).location,
132
- "onUpdate:modelValue": a[2] || (a[2] = (t) => o(s).location = t),
133
- label: "Location: ",
134
- "show-item-label": !0,
135
- icon: "storefront",
136
- placement: "bottom-start",
137
- items: o(v).locationItems
138
- }, null, 8, ["modelValue", "items"])
139
- ]),
140
- i(F, {
141
- modelValue: o(s).searchKey,
142
- "onUpdate:modelValue": a[3] || (a[3] = (t) => o(s).searchKey = t),
143
- class: "xs:hidden",
144
- placeholder: "search",
145
- collapsible: ""
146
- }, null, 8, ["modelValue"])
147
- ]),
148
- i(R, {
149
- class: "xs:hidden",
150
- "row-data": o(d),
151
- "column-defs": K,
152
- "search-value": o(s).searchKey,
153
- "column-filter": [],
154
- onRowClick: a[4] || (a[4] = (t) => p(t.original)),
155
- "hide-footer": o(d).length < 10
156
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
157
- i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
158
- default: f(() => [
159
- (c(!0), g(h, null, E(o(d).filter(
160
- (t) => t.name.toLowerCase().includes(o(s).searchKey.toLowerCase())
161
- ), (t) => (c(), C(O, {
162
- key: t._id.toString(),
163
- onClick: (P) => p(t),
164
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
- }, {
166
- default: f(() => [
167
- n("div", ie, [
168
- n("div", le, [
169
- (c(), C(M(o(V)(t)))),
170
- n("div", re, y(t.currentReceive ?? 0) + " used ", 1)
171
- ]),
172
- n("div", ce, [
173
- n("div", me, y(t.name), 1),
174
- n("div", de, y(o(L)(t)), 1)
175
- ]),
176
- n("div", pe, " Point received: " + y(t.currentReceive ?? 0), 1)
177
- ]),
178
- i(k, {
179
- icon: "delete",
180
- "icon-color": "neutral-gray-400",
181
- variant: "tertiary",
182
- onClick: (P) => (P.stopPropagation(), b(t))
183
- }, null, 8, ["onClick"])
184
- ]),
185
- _: 2
186
- }, 1032, ["onClick"]))), 128))
187
- ]),
188
- _: 1
189
- })
190
- ], 64)) : (c(), C(A, {
191
- key: 1,
192
- variant: "outlined",
193
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
194
- }, {
195
- default: f(() => [
196
- ue,
197
- fe,
198
- i(k, {
199
- variant: "primary",
200
- label: "Create point program",
201
- disabled: !o(v).isPremium,
202
- icon: "add",
203
- onClick: a[5] || (a[5] = (t) => p())
204
- }, null, 8, ["disabled"])
205
- ]),
206
- _: 1
207
- })),
208
- i(Z, {
209
- ref_key: "sheetRef",
210
- ref: x,
211
- "onSubmit:modelValue": N
212
- }, null, 512)
213
- ])
214
- ], 64);
215
- };
216
- }
217
- });
218
- export {
219
- Se as default
220
- };