@feedmepos/mf-connect 0.1.38-beta.25 → 0.1.38-beta.27

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 (98) hide show
  1. package/dist/{Analytic-CnNFr3FF.js → Analytic-Dgpp4zkU.js} +13 -13
  2. package/dist/{App-Bs4Lgw2l.js → App-DNRzPvQb.js} +7 -7
  3. package/dist/{AuditLogs-BLoAipFo.js → AuditLogs-BhG5wShL.js} +10 -10
  4. package/dist/{Bin-CGTdlBny.js → Bin-BSmAVdOX.js} +8 -8
  5. package/dist/Broadcast-DZ-qedno.js +233 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B2Rodvvf.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BS5HDnfb.js} +6 -6
  7. package/dist/{Card-CkP5_s5B.js → Card-CLTczC6l.js} +16 -16
  8. package/dist/{Collections-Czp-eFqo.js → Collections-CZIk5DSy.js} +6 -6
  9. package/dist/Credit-DGGU3d68.js +228 -0
  10. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-CD_HmVtT.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-FxEXBhTK.js} +110 -109
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CeJtGIq8.js → EffectSheet.vue_vue_type_style_index_0_lang-Bx_7FAYn.js} +6 -6
  12. package/dist/Experience-Dd0Xkp_z.js +229 -0
  13. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  14. package/dist/{Game-BU19eUZe.js → Game-N6iQZPqM.js} +103 -97
  15. package/dist/{Grab-DrgKhQ-n.js → Grab-Dn8pP3Vy.js} +10 -10
  16. package/dist/{Index-j750egzP.js → Index-Do0nSsYj.js} +10 -10
  17. package/dist/{Marketing-DxBCWgGW.js → Marketing-BG8L2AVq.js} +6 -6
  18. package/dist/{Member-BlpnS-gt.js → Member-HQWOfz1g.js} +10 -10
  19. package/dist/{MemberList-XolPpdeh.js → MemberList-jfgCK6k3.js} +25 -25
  20. package/dist/{MemberTransactions-mE7RmB-H.js → MemberTransactions-DYOBM90W.js} +1 -1
  21. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CnIWWNgD.js → MessageInput.vue_vue_type_script_setup_true_lang-DdaqUEEb.js} +7 -7
  22. package/dist/{Mission-BtavZVDY.js → Mission-CkXM1dNO.js} +112 -106
  23. package/dist/{Overview-AnvTfXXo.js → Overview-BJWncUrN.js} +18 -18
  24. package/dist/Point-CfuVogKH.js +232 -0
  25. package/dist/{Promotion-By1szSrB.js → Promotion-TtgchqMU.js} +11 -11
  26. package/dist/{Queue-CDNcLHGr.js → Queue-xaCqQVUP.js} +11 -11
  27. package/dist/{Record-D7CLYo3F.js → Record-D6z_Pywk.js} +8 -8
  28. package/dist/{Reward-BfCNtJE1.js → Reward-DBzn5tRP.js} +15 -15
  29. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BIsAuAN2.js → RewardGroup.vue_vue_type_script_setup_true_lang-CRv8xHpU.js} +11 -11
  30. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DFZsY5Wx.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bd8pXLRT.js} +13 -13
  31. package/dist/{Segment-Cx4Y8niG.js → Segment-gxBRnKo7.js} +22 -22
  32. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-BZ_J5OFJ.js → SelectItems.vue_vue_type_script_setup_true_lang-DbC6xTWH.js} +2 -2
  33. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJGAnjDZ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAraQhKS.js} +11 -11
  34. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CJ5lkVPN.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CFnFyNya.js} +3 -3
  35. package/dist/{Setting-CZ-ZoCbx.js → Setting-DX7hLnTQ.js} +11 -11
  36. package/dist/{Store-BEolF_8B.js → Store-C3GZXKuC.js} +19 -19
  37. package/dist/{StoreRewards-Dad1Zg2s.js → StoreRewards-CCWDGKLp.js} +13 -13
  38. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BioIIRWp.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNgDoMR9.js} +21 -21
  39. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DFck5Zap.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DQmZE9_V.js} +1 -1
  40. package/dist/{Tier-DkMdCg4f.js → Tier-DbWQM6De.js} +20 -20
  41. package/dist/{Title-CE4vkjCt.js → Title-a2bTIZi0.js} +19 -19
  42. package/dist/{Transaction-DQOdYA5y.js → Transaction-f8XwfBob.js} +2 -2
  43. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CLIhaeAY.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DUQ0fU5s.js} +6 -6
  44. package/dist/{Voucher-BNCkPTeD.js → Voucher-C7Dfsqk6.js} +14 -14
  45. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BCG4LuXq.js → VoucherEditor.vue_vue_type_script_setup_true_lang-C5fm0K4i.js} +10 -10
  46. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DZPz72YM.js → ZodTextField.vue_vue_type_script_setup_true_lang-A-h4HUTJ.js} +1 -1
  47. package/dist/{app-CGyViOA2.js → app-BOG1dC8a.js} +32 -32
  48. package/dist/{app-DuuQV4iK.js → app-jGPh064M.js} +1 -1
  49. package/dist/app.js +1 -1
  50. package/dist/{business-CT9f5Mcu.js → business--P6e14wH.js} +11 -8
  51. package/dist/{campaign-DruWV9_z.js → campaign-CR_hUukZ.js} +9 -9
  52. package/dist/{campaign-QNfednQV.js → campaign-C_gQlNNb.js} +2 -2
  53. package/dist/{campaign.enum-BfqWuf2f.js → campaign.enum-Dj5o3Gnx.js} +1 -1
  54. package/dist/{campaign.fn-CdyLr0Xa.js → campaign.fn-DQZ0W-EB.js} +63 -63
  55. package/dist/{collectible.enum-C4SBy9ie.js → collectible.enum-DQgguzyG.js} +1 -1
  56. package/dist/{collection.fn-DGmard-T.js → collection.fn-1jzRWzrr.js} +2 -2
  57. package/dist/{dto-AdHaYlrt.js → dto-C3jWvc1e.js} +4 -4
  58. package/dist/{effect-BxLYXWa0.js → effect-dA2mpaCE.js} +1 -1
  59. package/dist/{email-addresses-BywpJOyH.js → email-addresses-37_SE2AF.js} +1 -1
  60. package/dist/{export-CaCjWJbv.js → export-Cn7Elq59.js} +3 -3
  61. package/dist/{helper-1sDGGcCs.js → helper-1FmJd7OP.js} +1 -1
  62. package/dist/{index-Ce7luA3z.js → index-B4j34swO.js} +1 -1
  63. package/dist/{index-DOeqRIlL.js → index-B9iL1w4-.js} +3 -3
  64. package/dist/{index-xV0yJaxT.js → index-BRALrcjU.js} +1452 -1452
  65. package/dist/{index-_mZAUf_O.js → index-BcEhSpSd.js} +1 -1
  66. package/dist/{index-ILVT0cch.js → index-Bv04ElXo.js} +6 -6
  67. package/dist/{index-DKsWTRyN.js → index-BwBDTG0U.js} +4 -4
  68. package/dist/{index-BWINkCFC.js → index-C0TBodx0.js} +1 -1
  69. package/dist/{index-DWRBSads.js → index-C0uZD6Fb.js} +1 -1
  70. package/dist/{index-J-gYw1zz.js → index-CCzzmRaK.js} +3 -3
  71. package/dist/{index-AYw2MTFM.js → index-Cq9x3KEB.js} +1 -1
  72. package/dist/{index-DJZ-kqpE.js → index-DIup5B2H.js} +1 -1
  73. package/dist/{index-DZ3vwqCm.js → index-Da1osm0C.js} +1 -1
  74. package/dist/{index-BGWAVguX.js → index-Oly5lYMA.js} +1 -1
  75. package/dist/{index-Cur9hyPV.js → index-YhB238q9.js} +2 -2
  76. package/dist/{index.esm2017-Bo-H9Epv.js → index.esm2017-pcImat1a.js} +1 -1
  77. package/dist/{loading-Bqjqslgf.js → loading-BIAeRmZo.js} +1 -1
  78. package/dist/{membership-CqhEppfS.js → membership-D74wSltj.js} +3 -3
  79. package/dist/{money-CooAqk_P.js → money-DQuZChef.js} +1 -1
  80. package/dist/{number-C6cARyqZ.js → number-DORW-adL.js} +1 -1
  81. package/dist/objectid-CPqo6DS_.js +145 -0
  82. package/dist/{plugins-BaVr4Awd.js → plugins-BVLU2dc_.js} +2 -2
  83. package/dist/{reward-43EpLVnK.js → reward-CsZQy2b1.js} +1 -1
  84. package/dist/{rule-CECnGrxI.js → rule-CtYg9lgQ.js} +3 -3
  85. package/dist/{rule-builder-C58mHAaP.js → rule-builder-TwHL3OPZ.js} +1 -1
  86. package/dist/{template-CMZziR_-.js → template-DlLEQKFu.js} +4 -4
  87. package/dist/{timezone-DpcMMfGn.js → timezone-DGJqaz8e.js} +1 -1
  88. package/dist/{trigger-D99PwOLC.js → trigger-B4JMJKDj.js} +4 -4
  89. package/dist/{user-C1NEGH5J.js → user-ZU2f1nbT.js} +1 -1
  90. package/dist/{vue-i18n-CzjqSUwt.js → vue-i18n-BtpjMXUM.js} +301 -301
  91. package/dist/{xlsx-DOkzrP7b.js → xlsx-BiJUMUcX.js} +1 -1
  92. package/package.json +1 -1
  93. package/dist/Broadcast-B3W5RzRy.js +0 -227
  94. package/dist/Credit-BcaIvY_C.js +0 -222
  95. package/dist/Experience-CqpT4RKC.js +0 -223
  96. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  97. package/dist/Point-Bw1G73vZ.js +0 -226
  98. package/dist/objectid-DiYL018Z.js +0 -145
@@ -1,223 +0,0 @@
1
- import { defineComponent as D, ref as S, computed as E, onMounted as U, resolveComponent as i, openBlock as m, createElementBlock as _, Fragment as x, createVNode as c, unref as t, createElementVNode as n, withCtx as h, renderList as j, createBlock as w, resolveDynamicComponent as M, toDisplayString as p, 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 { p as J } from "./plugins-BaVr4Awd.js";
5
- import { u as Q } from "./loading-Bqjqslgf.js";
6
- import { u as W } from "./business-CT9f5Mcu.js";
7
- import { u as X } from "./campaign-QNfednQV.js";
8
- import { a as L, b as V, g as Y } from "./campaign-DruWV9_z.js";
9
- import { u as Z } from "./vue-i18n-CzjqSUwt.js";
10
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CD_HmVtT.js";
12
- import { u as oe } from "./template-CMZziR_-.js";
13
- import { c as g } from "./index-DWRBSads.js";
14
- const 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" }, re = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, ie = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, le = { class: "space-y-4" }, me = { class: "fm-typo-en-body-lg-600" }, pe = { 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 = { class: "flex flex-col gap-16 text-center" }, fe = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = /* @__PURE__ */ D({
15
- __name: "Experience",
16
- setup(ge) {
17
- const { t: s } = Z(), I = {
18
- label: s("connect.program.common.actions.create", {
19
- type: s("connect.program.experience.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, P = oe("POINT", z()), B = W(), l = X(), { global: T, minor: v } = Q, r = S({
25
- searchKey: "",
26
- location: null
27
- }), f = E(
28
- () => l.campaigns.experience.filter(
29
- (e) => !r.value.location || !e.targetLocation || e.targetLocation.includes(r.value.location)
30
- )
31
- ), K = [
32
- {
33
- header: "Program title",
34
- accessorFn: (e) => e.name
35
- },
36
- {
37
- header: "Status",
38
- accessorFn: (e) => Y(e),
39
- cell(e) {
40
- return L(e.row.original);
41
- }
42
- },
43
- {
44
- header: "Summary",
45
- accessorFn: (e) => V(e)
46
- //v.effect,
47
- },
48
- {
49
- header: "Actions",
50
- cell(e) {
51
- return H(G.FmButton, {
52
- variant: "tertiary",
53
- icon: "delete",
54
- iconColor: "neutral-gray-400",
55
- onClick: (o) => {
56
- o.stopPropagation(), C(e.row.original);
57
- }
58
- });
59
- }
60
- }
61
- ], b = S();
62
- async function C(e) {
63
- await J.remove(`Are you sure you want to remove ${e.name}?`) && await v(
64
- async () => {
65
- await g.delete(e._id), await l.read("POINT");
66
- },
67
- {
68
- message: `Removing ${e.name}`,
69
- successMessage: `Removed ${e.name} successfully`
70
- }
71
- );
72
- }
73
- async function y(e) {
74
- e ? await o() : P.open(async (d) => {
75
- await o(d);
76
- });
77
- async function o(d) {
78
- var u;
79
- (u = b.value) == null || u.showSheet(
80
- !0,
81
- "POINT",
82
- e ? await g.readById(e._id) : void 0,
83
- d
84
- );
85
- }
86
- }
87
- async function N(e) {
88
- await v(
89
- async () => {
90
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await l.read("POINT");
91
- },
92
- {
93
- message: s("connect.program.common.update.updating", {
94
- type: s("connect.program.experience.title")
95
- }),
96
- successMessage: s("connect.program.common.update.success", {
97
- type: s("connect.program.experience.title"),
98
- action: e.campaign._id ? "updated" : "created"
99
- })
100
- }
101
- );
102
- }
103
- return U(async () => {
104
- await T(async () => {
105
- await l.read("POINT");
106
- });
107
- }), (e, o) => {
108
- const d = i("FmPageHead"), u = i("FmSearch"), R = i("FmTable"), F = i("FmButton"), $ = i("FmListItem"), O = i("FmList"), A = i("FmCard");
109
- return m(), _(x, null, [
110
- c(d, {
111
- title: t(s)("connect.program.experience.title"),
112
- actions: t(f).length > 0 ? [I] : [],
113
- "onClick:action": o[0] || (o[0] = () => y())
114
- }, null, 8, ["title", "actions"]),
115
- n("div", ae, [
116
- c(u, {
117
- modelValue: t(r).searchKey,
118
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(r).searchKey = a),
119
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
120
- placeholder: t(s)("connect.program.common.search"),
121
- collapsible: ""
122
- }, null, 8, ["modelValue", "placeholder"]),
123
- t(l).campaigns.experience && t(l).campaigns.experience.length > 0 ? (m(), _(x, { key: 0 }, [
124
- n("div", ne, [
125
- n("div", se, [
126
- c(ee, {
127
- modelValue: t(r).location,
128
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(r).location = a),
129
- label: "Location: ",
130
- "show-item-label": !0,
131
- icon: "storefront",
132
- placement: "bottom-start",
133
- items: t(B).locationItems
134
- }, null, 8, ["modelValue", "items"])
135
- ]),
136
- c(u, {
137
- modelValue: t(r).searchKey,
138
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(r).searchKey = a),
139
- class: "xs:hidden",
140
- placeholder: "search",
141
- collapsible: ""
142
- }, null, 8, ["modelValue"])
143
- ]),
144
- c(R, {
145
- class: "xs:hidden",
146
- "row-data": t(f),
147
- "column-defs": K,
148
- "search-value": t(r).searchKey,
149
- "column-filter": [],
150
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
151
- "hide-footer": t(f).length < 10
152
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
- c(O, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
- default: h(() => [
155
- (m(!0), _(x, null, j(t(f).filter(
156
- (a) => a.name.toLowerCase().includes(t(r).searchKey.toLowerCase())
157
- ), (a) => (m(), w($, {
158
- key: a._id.toString(),
159
- onClick: (k) => y(a),
160
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
161
- }, {
162
- default: h(() => [
163
- n("div", re, [
164
- n("div", ce, [
165
- (m(), w(M(t(L)(a)))),
166
- n("div", ie, p(a.currentReceive ?? 0) + " used ", 1)
167
- ]),
168
- n("div", le, [
169
- n("div", me, p(a.name), 1),
170
- n("div", pe, p(t(V)(a)), 1)
171
- ]),
172
- n("div", de, p(t(s)("connect.program.experience.received", {
173
- count: a.currentReceive ?? 0
174
- })), 1)
175
- ]),
176
- c(F, {
177
- icon: "delete",
178
- "icon-color": "neutral-gray-400",
179
- variant: "tertiary",
180
- onClick: (k) => (k.stopPropagation(), C(a))
181
- }, null, 8, ["onClick"])
182
- ]),
183
- _: 2
184
- }, 1032, ["onClick"]))), 128))
185
- ]),
186
- _: 1
187
- })
188
- ], 64)) : (m(), w(A, {
189
- key: 1,
190
- variant: "outlined",
191
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
192
- }, {
193
- default: h(() => [
194
- o[6] || (o[6] = n("img", {
195
- src: q,
196
- class: "aspect-square w-[150px]"
197
- }, null, -1)),
198
- n("div", ue, [
199
- n("div", fe, p(t(s)("connect.program.experience.empty_state.title")), 1),
200
- n("div", ye, p(t(s)("connect.program.experience.empty_state.description")), 1)
201
- ]),
202
- c(F, {
203
- variant: "primary",
204
- label: "Create experience program",
205
- icon: "add",
206
- onClick: o[5] || (o[5] = (a) => y())
207
- })
208
- ]),
209
- _: 1
210
- })),
211
- c(te, {
212
- ref_key: "sheetRef",
213
- ref: b,
214
- "onSubmit:modelValue": N
215
- }, null, 512)
216
- ])
217
- ], 64);
218
- };
219
- }
220
- });
221
- export {
222
- Pe as default
223
- };
@@ -1,114 +0,0 @@
1
- import { defineComponent as V, ref as y, computed as q, onMounted as x, resolveComponent as s, openBlock as r, createBlock as m, unref as u, withCtx as d, createVNode as i, normalizeClass as p, createCommentVNode as j, createElementVNode as I, toDisplayString as h, createElementBlock as M, Fragment as O, renderList as S } from "vue";
2
- const A = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, N = /* @__PURE__ */ V({
3
- __name: "FilterChip",
4
- props: {
5
- modelValue: {
6
- type: Array,
7
- required: !1
8
- },
9
- label: {
10
- type: String,
11
- required: !1,
12
- default: ""
13
- },
14
- showItemLabel: {
15
- type: Boolean,
16
- default: !1
17
- },
18
- placement: {
19
- type: String,
20
- required: !1,
21
- default: "bottom-end"
22
- },
23
- class: {
24
- type: String,
25
- required: !1
26
- },
27
- disabled: {
28
- type: Boolean,
29
- required: !1
30
- },
31
- items: {
32
- type: Array,
33
- required: !0
34
- },
35
- icon: {
36
- type: String,
37
- required: !1
38
- }
39
- },
40
- emits: ["update:model-value"],
41
- setup(o, { emit: g }) {
42
- const t = o, v = g, c = y(!1), e = y({}), k = q(() => {
43
- const l = Object.keys(e.value).length;
44
- return !e.value || Object.keys(e.value).length == t.items.length || l === 0 ? "All" : `${l > 0 ? l : "None"} selected`;
45
- });
46
- function _(l) {
47
- e.value[l] ? delete e.value[l] : e.value[l] = !0, v("update:model-value", Object.keys(e.value));
48
- }
49
- function C() {
50
- Object.keys(e.value).length > 0 ? e.value = {} : e.value = t.items.reduce((l, n) => (l[n.value] = !0, l), {}), v("update:model-value", Object.keys(e.value));
51
- }
52
- return x(() => {
53
- e.value = t.modelValue.reduce(
54
- (l, n) => (l[n] = !0, l),
55
- {}
56
- ), t.modelValue.length == 0;
57
- }), (l, n) => {
58
- const b = s("FmIcon"), F = s("FmChip"), f = s("FmMenuItem"), w = s("FmMenu");
59
- return r(), m(w, {
60
- placement: o.placement || "bottom-end",
61
- disabled: o.disabled == !0,
62
- "model-value": u(c),
63
- onMenuChanged: n[0] || (n[0] = (a) => c.value = a),
64
- "close-on-click": !1
65
- }, {
66
- "menu-button": d(() => [
67
- i(F, {
68
- label: o.label,
69
- class: p(t.class || "text-fm-color-neutral-gray-400 cursor-pointer")
70
- }, {
71
- default: d(() => [
72
- t.icon ? (r(), m(b, {
73
- key: 0,
74
- name: t.icon,
75
- class: p(t.class),
76
- outline: "",
77
- size: "sm"
78
- }, null, 8, ["name", "class"])) : j("", !0),
79
- I("div", A, h(t.label) + " " + h(o.showItemLabel ? u(k) : ""), 1),
80
- i(b, {
81
- name: u(c) ? "keyboard_arrow_up" : "keyboard_arrow_down",
82
- class: p(t.class),
83
- outline: "",
84
- size: "sm"
85
- }, null, 8, ["name", "class"])
86
- ]),
87
- _: 1
88
- }, 8, ["label", "class"])
89
- ]),
90
- default: d(() => [
91
- i(f, {
92
- "model-value": Object.keys(u(e)).length === t.items.length,
93
- label: "All",
94
- "has-checkbox": !0,
95
- indeterminate: !0,
96
- onClick: C
97
- }, null, 8, ["model-value"]),
98
- (r(!0), M(O, null, S(t.items ?? [], (a) => (r(), m(f, {
99
- key: a.value,
100
- value: a.value,
101
- label: a.label,
102
- "has-checkbox": !0,
103
- "model-value": u(e)[a.value],
104
- "onUpdate:modelValue": (B) => _(a.value)
105
- }, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
106
- ]),
107
- _: 1
108
- }, 8, ["placement", "disabled", "model-value"]);
109
- };
110
- }
111
- });
112
- export {
113
- N as _
114
- };
@@ -1,226 +0,0 @@
1
- import { defineComponent as j, ref as P, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as b, Fragment as w, createVNode as r, unref as t, withCtx as y, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as C, resolveDynamicComponent as q } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q } from "./plugins-BaVr4Awd.js";
5
- import { u as W } from "./loading-Bqjqslgf.js";
6
- import { u as X } from "./business-CT9f5Mcu.js";
7
- import { u as Y } from "./campaign-QNfednQV.js";
8
- import { g as Z, a as V, b as I } from "./campaign-DruWV9_z.js";
9
- import { _ as ee } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
- import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CD_HmVtT.js";
11
- import { u as oe } from "./template-CMZziR_-.js";
12
- import { u as ae } from "./vue-i18n-CzjqSUwt.js";
13
- import { c as _ } from "./index-DWRBSads.js";
14
- const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, ie = { class: "px-24 flex flex-col gap-y-16" }, re = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, me = { class: "flex w-full gap-4 items-center" }, de = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pe = { class: "space-y-4" }, ue = { class: "fm-typo-en-body-lg-600" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, _e = { class: "fm-typo-en-title-sm-800" }, he = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ j({
15
- __name: "Point",
16
- setup(be) {
17
- const { t: s } = ae(), B = {
18
- label: s("connect.program.common.actions.create", {
19
- type: s("connect.program.point.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, $ = oe("COIN", G()), h = X(), m = Y(), { global: K, minor: x } = W, i = P({
25
- searchKey: "",
26
- location: null
27
- }), u = A(
28
- () => m.campaigns.point.filter(
29
- (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
30
- )
31
- ), N = [
32
- {
33
- header: s("connect.program.common.table.title"),
34
- accessorFn: (e) => e.name
35
- },
36
- {
37
- header: s("connect.program.common.table.status"),
38
- accessorFn: (e) => Z(e),
39
- cell(e) {
40
- return V(e.row.original);
41
- }
42
- },
43
- {
44
- header: s("connect.program.common.table.summary"),
45
- accessorFn: (e) => I(e)
46
- },
47
- {
48
- header: s("connect.program.common.table.actions"),
49
- cell(e) {
50
- return E(J.FmButton, {
51
- variant: "tertiary",
52
- icon: "delete",
53
- iconColor: "neutral-gray-400",
54
- onClick: (o) => {
55
- o.stopPropagation(), F(e.row.original);
56
- }
57
- });
58
- }
59
- }
60
- ], v = P();
61
- async function F(e) {
62
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await x(
63
- async () => {
64
- await _.delete(e._id), await m.read("COIN");
65
- },
66
- {
67
- message: `Removing ${e.name}`,
68
- successMessage: `Removed ${e.name} successfully`
69
- }
70
- );
71
- }
72
- async function f(e) {
73
- e ? await o() : $.open(async (p) => {
74
- await o(p);
75
- });
76
- async function o(p) {
77
- var g;
78
- (g = v.value) == null || g.showSheet(
79
- !0,
80
- "COIN",
81
- e ? await _.readById(e._id) : void 0,
82
- p
83
- );
84
- }
85
- }
86
- async function R(e) {
87
- await x(
88
- async () => {
89
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
90
- },
91
- {
92
- message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
93
- successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
94
- }
95
- );
96
- }
97
- return M(async () => {
98
- await K(async () => {
99
- await m.read("COIN");
100
- });
101
- }), (e, o) => {
102
- const p = l("FmPill"), g = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
103
- return d(), b(w, null, [
104
- r(g, {
105
- title: t(s)("connect.program.point.title"),
106
- actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
107
- "onClick:action": o[0] || (o[0] = () => f())
108
- }, {
109
- title: y(() => [
110
- n("div", ne, [
111
- n("span", se, c(t(s)("connect.program.point.title")), 1),
112
- r(p, { variant: "premium" })
113
- ])
114
- ]),
115
- _: 1
116
- }, 8, ["title", "actions"]),
117
- n("div", ie, [
118
- r(k, {
119
- modelValue: t(i).searchKey,
120
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
121
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
122
- placeholder: "search",
123
- collapsible: ""
124
- }, null, 8, ["modelValue"]),
125
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), b(w, { key: 0 }, [
126
- n("div", re, [
127
- n("div", le, [
128
- r(ee, {
129
- modelValue: t(i).location,
130
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
131
- label: "Location: ",
132
- "show-item-label": !0,
133
- icon: "storefront",
134
- placement: "bottom-start",
135
- items: t(h).locationItems
136
- }, null, 8, ["modelValue", "items"])
137
- ]),
138
- r(k, {
139
- modelValue: t(i).searchKey,
140
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
141
- class: "xs:hidden",
142
- placeholder: "search",
143
- collapsible: ""
144
- }, null, 8, ["modelValue"])
145
- ]),
146
- r(O, {
147
- class: "xs:hidden",
148
- "row-data": t(u),
149
- "column-defs": N,
150
- "search-value": t(i).searchKey,
151
- "column-filter": [],
152
- onRowClick: o[4] || (o[4] = (a) => f(a.original)),
153
- "hide-footer": t(u).length < 10
154
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
155
- r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
156
- default: y(() => [
157
- (d(!0), b(w, null, H(t(u).filter(
158
- (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
159
- ), (a) => (d(), C(U, {
160
- key: a._id.toString(),
161
- onClick: (L) => f(a),
162
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
163
- }, {
164
- default: y(() => [
165
- n("div", ce, [
166
- n("div", me, [
167
- (d(), C(q(t(V)(a)))),
168
- n("div", de, c(t(s)("connect.program.point.used", {
169
- count: a.currentReceive ?? 0
170
- })), 1)
171
- ]),
172
- n("div", pe, [
173
- n("div", ue, c(a.name), 1),
174
- n("div", fe, c(t(I)(a)), 1)
175
- ]),
176
- n("div", ge, " Point received: " + c(a.currentReceive ?? 0), 1)
177
- ]),
178
- r(S, {
179
- icon: "delete",
180
- "icon-color": "neutral-gray-400",
181
- variant: "tertiary",
182
- onClick: (L) => (L.stopPropagation(), F(a))
183
- }, null, 8, ["onClick"])
184
- ]),
185
- _: 2
186
- }, 1032, ["onClick"]))), 128))
187
- ]),
188
- _: 1
189
- })
190
- ], 64)) : (d(), C(T, {
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: y(() => [
196
- o[6] || (o[6] = n("img", {
197
- src: z,
198
- class: "aspect-square w-[150px]"
199
- }, null, -1)),
200
- n("div", ye, [
201
- n("div", _e, c(t(s)("connect.program.point.empty_state.title")), 1),
202
- n("div", he, c(t(s)("connect.program.point.empty_state.description")), 1)
203
- ]),
204
- r(S, {
205
- variant: "primary",
206
- label: "Create point program",
207
- disabled: !t(h).isPremium,
208
- icon: "add",
209
- onClick: o[5] || (o[5] = (a) => f())
210
- }, null, 8, ["disabled"])
211
- ]),
212
- _: 1
213
- })),
214
- r(te, {
215
- ref_key: "sheetRef",
216
- ref: v,
217
- "onSubmit:modelValue": R
218
- }, null, 512)
219
- ])
220
- ], 64);
221
- };
222
- }
223
- });
224
- export {
225
- Ke as default
226
- };