@feedmepos/mf-connect 0.1.81-prod → 0.1.83-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 (104) hide show
  1. package/dist/{Analytic-D4C4cuzb.js → Analytic-1OYb8L9c.js} +11 -11
  2. package/dist/{App-BKC-UTfE.js → App-oQ4_lEV2.js} +7 -7
  3. package/dist/{Bin-B23fmL4B.js → Bin-CQ8CYWAf.js} +8 -8
  4. package/dist/Broadcast-BLq5lca6.js +265 -0
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BEr6i1H7.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-0BKgyMxn.js} +6 -6
  6. package/dist/{Card-CjmquMQ8.js → Card-BbcMCzvO.js} +19 -19
  7. package/dist/{Collections-e324VpKx.js → Collections-0LOyEUoF.js} +8 -8
  8. package/dist/Credit-Crrc3MSu.js +259 -0
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-NtZKuPgi.js} +245 -241
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CLcPRqzn.js → EffectSheet.vue_vue_type_style_index_0_lang-DQaMkTla.js} +6 -6
  11. package/dist/Experience-DJiUmONI.js +258 -0
  12. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-CFEGc8v5.js} +1 -1
  13. package/dist/Game-ChHy4S4P.js +329 -0
  14. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-BpNCfgI8.js → ImageInput.vue_vue_type_script_setup_true_lang-BBavh70d.js} +1 -1
  15. package/dist/{Index-Dq_dt4zZ.js → Index-CL5auUCN.js} +10 -10
  16. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-H5IjhmOA.js} +1 -1
  17. package/dist/{MainLayout-B1aJoR95.js → MainLayout-Bf4G5U5F.js} +1 -1
  18. package/dist/{Marketing-Z2EXHTDq.js → Marketing-cNwSm-dt.js} +6 -6
  19. package/dist/{Member-BZq2ZPU1.js → Member-fT7a7zFo.js} +11 -11
  20. package/dist/{MemberList-DamLQWem.js → MemberList-gEN36Erj.js} +27 -27
  21. package/dist/{MemberTransactions-BfGIKXWt.js → MemberTransactions-C4YgiUw-.js} +1 -1
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BMLAp7P0.js → MessageInput.vue_vue_type_script_setup_true_lang-BNDrmYqp.js} +9 -9
  23. package/dist/Mission-Bz9P2pjX.js +333 -0
  24. package/dist/{Overview-DKNSKwjw.js → Overview-BG3Z7Daz.js} +19 -19
  25. package/dist/Point-BBeSJ5p5.js +261 -0
  26. package/dist/Promotion-VmaOESn2.js +390 -0
  27. package/dist/{Queue-CnHJt7BI.js → Queue-DKtUhOBh.js} +11 -11
  28. package/dist/{Record-asuDl00z.js → Record-Cb45m9I8.js} +9 -9
  29. package/dist/{Reward-BqemiBwU.js → Reward-D_uvCEMe.js} +16 -16
  30. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B98IW85o.js → RewardGroup.vue_vue_type_script_setup_true_lang-yUUMGEUJ.js} +12 -12
  31. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CVnNlpHa.js → RuleGroup.vue_vue_type_script_setup_true_lang-CIb7igvo.js} +15 -15
  32. package/dist/{Segment-Q86KMN-k.js → Segment-BJ8XUyeG.js} +25 -25
  33. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CCjoSgCt.js → SelectItems.vue_vue_type_script_setup_true_lang-ht4qyiQM.js} +2 -2
  34. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CttKxzGJ.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DC6OQ7Zb.js} +12 -12
  35. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D_pLIyjo.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-i_BRgBRC.js} +4 -4
  36. package/dist/{Setting-D-H3wwqK.js → Setting-CS1wSxO9.js} +14 -14
  37. package/dist/{SettingAdvertisements-CLys7tUI.js → SettingAdvertisements-CWP7VthZ.js} +12 -12
  38. package/dist/{Store-CDTaq9Cl.js → Store-cy0uZfSE.js} +22 -22
  39. package/dist/{StoreRewards-BDbL39N5.js → StoreRewards-DDAvmlEn.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BnagjBBu.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CevWXAb6.js} +20 -20
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Dk7yazat.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CPJ4fCu-.js} +1 -1
  42. package/dist/{Tier-BpDxFiVl.js → Tier-CUT_0eYp.js} +22 -22
  43. package/dist/{Title-BC8toEO3.js → Title-DcelZU7H.js} +20 -20
  44. package/dist/{Transaction-Ci7D5pSG.js → Transaction-CwcJnFIO.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DfKxwLyD.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BuDS-vUd.js} +6 -6
  46. package/dist/{Voucher-vnKyiKiV.js → Voucher-z6o5rwFx.js} +162 -141
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CCg8d72J.js → VoucherEditor.vue_vue_type_script_setup_true_lang-FVdeM5pH.js} +12 -12
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-JTpA5O1m.js → ZodTextField.vue_vue_type_script_setup_true_lang-BGuVeHZU.js} +2 -2
  49. package/dist/{app-1E5G1GpN.js → app-BUFlIAB5.js} +13926 -11655
  50. package/dist/app.js +1 -1
  51. package/dist/{business-BUpIHd4Z.js → business-CEL6Cxr7.js} +1 -1
  52. package/dist/{campaign-CZx-8rcc.js → campaign-Bz3O-DFr.js} +1 -1
  53. package/dist/{campaign-D_l_eCaG.js → campaign-CfB7ZWIg.js} +8 -8
  54. package/dist/{campaign.enum-DzMJ_QtT.js → campaign.enum-CCKHGvL9.js} +1 -1
  55. package/dist/{campaign.fn-BfLZqPyL.js → campaign.fn-Cu0sRSpP.js} +154 -154
  56. package/dist/{collectible.enum-CQB3E2Fm.js → collectible.enum-DeWSJ9OK.js} +1 -1
  57. package/dist/{collection.fn-DkJHn6mL.js → collection.fn-hPDt2qvz.js} +2 -2
  58. package/dist/{dto-DUY1vguv.js → dto-BKwcpb4T.js} +4 -4
  59. package/dist/{effect-CpXEk9Dk.js → effect-D070CPN_.js} +1 -1
  60. package/dist/{email-addresses-CVWW3Trx.js → email-addresses-C0fE6EMy.js} +2 -2
  61. package/dist/{export-1cM7yPV3.js → export-CG1ypExs.js} +3 -3
  62. package/dist/{helper-DZwCmt7C.js → helper-C9NBolO7.js} +1 -1
  63. package/dist/{index-BkpYy6m3.js → index-4gCsL8Hl.js} +6 -6
  64. package/dist/{index-Iwu0Pf7N.js → index-6rFsv3Yg.js} +1 -1
  65. package/dist/{index-DcCaSh1B.js → index-B30LtrWw.js} +1 -1
  66. package/dist/{index-DxGLhSm4.js → index-B613auFn.js} +1 -1
  67. package/dist/{index-CL_mVbcg.js → index-BGi7UFjn.js} +1 -1
  68. package/dist/{index-Cu69tDgg.js → index-BXSp11TE.js} +4 -4
  69. package/dist/{index-BWqzh2C4.js → index-CM-qkxMr.js} +11329 -10472
  70. package/dist/{index-UX1BjWKt.js → index-CZoTFXja.js} +3 -3
  71. package/dist/{index-CJQk_hJX.js → index-D7AT7i0e.js} +3 -3
  72. package/dist/{index-yPNsQag2.js → index-DDMr6_UT.js} +4 -4
  73. package/dist/{index-BhGXbniw.js → index-DGNPGZh4.js} +1 -1
  74. package/dist/{index-DikxFmIA.js → index-DLnZyneY.js} +1 -1
  75. package/dist/{index-CnqIH2O9.js → index-DcfdUpTw.js} +1 -1
  76. package/dist/{index.esm2017-DGkosyWY.js → index.esm2017-D0u5JnGx.js} +1 -1
  77. package/dist/{loading-BeO6W824.js → loading-Rn4BXFlo.js} +1 -1
  78. package/dist/{lodash-B5I3zXaY.js → lodash-Ds-QoR_N.js} +1 -1
  79. package/dist/{membership-CdkNnSzC.js → membership-BjklIT2n.js} +3 -3
  80. package/dist/{money-BmJpJ3UM.js → money-DMyZXL-e.js} +1 -1
  81. package/dist/{number-DNxJZHn4.js → number-Cyny8l0t.js} +1 -1
  82. package/dist/{objectid-Dz4U2FAo.js → objectid-Bs1Sha1n.js} +11 -11
  83. package/dist/{plugins-BWUWdHwy.js → plugins-BdQ8LmZm.js} +3 -3
  84. package/dist/{reward-Cg4x-YOj.js → reward-ZGs3fpY1.js} +1 -1
  85. package/dist/{rule-SBzFsmzN.js → rule-BH0ICJcx.js} +3 -3
  86. package/dist/{rule-builder-C12N5APu.js → rule-builder-D2sz7Xd9.js} +1 -1
  87. package/dist/template-_QJbP7yG.js +236 -0
  88. package/dist/{timezone-BdnFtiYJ.js → timezone-ulqdIvC-.js} +2 -2
  89. package/dist/{trigger-ZZWC4YWG.js → trigger-BiXZCT3j.js} +5 -5
  90. package/dist/{usePagination-Ds-cuHop.js → usePagination-Ck7buuI_.js} +1 -1
  91. package/dist/{user-DZARAXiI.js → user-BWTfkoD6.js} +1 -1
  92. package/dist/{vue-i18n-DOqqi883.js → vue-i18n-CmMTYitu.js} +2 -2
  93. package/dist/{xlsx-BQxGGmFn.js → xlsx-BF8PJO-P.js} +1 -1
  94. package/dist/{zod-D_MtMi4T.js → zod-C5iXeYjP.js} +1 -1
  95. package/package.json +2 -1
  96. package/dist/Broadcast-C9kxxthU.js +0 -232
  97. package/dist/Credit-7GDoQ6Ch.js +0 -225
  98. package/dist/Experience-_gbPd2cN.js +0 -224
  99. package/dist/Game-BotH7q2X.js +0 -299
  100. package/dist/Mission-DZBOFfZE.js +0 -303
  101. package/dist/Point-BTCdwbGb.js +0 -227
  102. package/dist/Promotion-BqWbXRrK.js +0 -358
  103. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  104. package/dist/template-B1S6b9tH.js +0 -188
@@ -1,227 +0,0 @@
1
- import { defineComponent as j, ref as V, computed as E, h as M, onMounted as H, resolveComponent as l, openBlock as p, createElementBlock as w, Fragment as b, createVNode as i, unref as o, withCtx as y, createElementVNode as n, toDisplayString as u, renderList as q, createBlock as C, resolveDynamicComponent as z } from "vue";
2
- import { _ as G } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
- import { p as W } from "./plugins-BWUWdHwy.js";
5
- import { u as X } from "./loading-BeO6W824.js";
6
- import { u as Y } from "./business-BUpIHd4Z.js";
7
- import { u as Z, c as _ } from "./campaign-CZx-8rcc.js";
8
- import { g as ee, a as P, b as B } from "./campaign-D_l_eCaG.js";
9
- import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
10
- import { _ as oe } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
11
- import { u as ae } from "./template-B1S6b9tH.js";
12
- import { u as ne } from "./vue-i18n-DOqqi883.js";
13
- const se = { class: "flex items-center" }, ie = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, re = { class: "px-24 flex flex-col gap-y-16" }, le = { class: "flex items-center justify-between w-full" }, ce = { class: "flex gap-8 overflow-x-auto" }, me = { class: "space-y-8" }, de = { class: "flex w-full gap-4 items-center" }, 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: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = /* @__PURE__ */ j({
14
- __name: "Point",
15
- setup(he) {
16
- const { t: s } = ne(), I = {
17
- label: s("connect.program.common.actions.create", {
18
- type: s("connect.program.point.title").toLowerCase()
19
- }),
20
- value: "create",
21
- isPrimary: !0,
22
- prependIcon: "add"
23
- }, $ = ae("COIN", J()), h = Y(), d = Z(), { global: K, minor: x } = X, r = V({
24
- searchKey: "",
25
- location: []
26
- });
27
- function N(e) {
28
- const t = r.value.location;
29
- return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((c) => {
30
- var m;
31
- return (m = e == null ? void 0 : e.targetLocation) == null ? void 0 : m.includes(c);
32
- }) : e.targetLocation.includes(t);
33
- }
34
- const f = E(
35
- () => d.campaigns.point.filter((e) => N(e))
36
- ), O = [
37
- {
38
- header: s("connect.program.common.table.title"),
39
- accessorFn: (e) => e.name
40
- },
41
- {
42
- header: s("connect.program.common.table.status"),
43
- accessorFn: (e) => ee(e),
44
- cell(e) {
45
- return P(e.row.original);
46
- }
47
- },
48
- {
49
- header: s("connect.program.common.table.summary"),
50
- accessorFn: (e) => B(e)
51
- },
52
- {
53
- header: s("connect.program.common.table.actions"),
54
- cell(e) {
55
- return M(Q.FmButton, {
56
- variant: "tertiary",
57
- icon: "delete",
58
- iconColor: "neutral-gray-400",
59
- onClick: (t) => {
60
- t.stopPropagation(), F(e.row.original);
61
- }
62
- });
63
- }
64
- }
65
- ], v = V();
66
- async function F(e) {
67
- await W.remove(`Are you sure you want to remove ${e.name}?`) && await x(
68
- async () => {
69
- await _.delete(e._id), await d.read("COIN");
70
- },
71
- {
72
- message: `Removing ${e.name}`,
73
- successMessage: `Removed ${e.name} successfully`
74
- }
75
- );
76
- }
77
- async function g(e) {
78
- e ? await t() : $.open(async (c) => {
79
- await t(c);
80
- });
81
- async function t(c) {
82
- var m;
83
- (m = v.value) == null || m.showSheet(
84
- !0,
85
- "COIN",
86
- e ? await _.readById(e._id) : void 0,
87
- c
88
- );
89
- }
90
- }
91
- async function A(e) {
92
- await x(
93
- async () => {
94
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await d.read("COIN");
95
- },
96
- {
97
- message: `${e.campaign._id ? "Updating" : "Creating"} point program`,
98
- successMessage: `Point program ${e.campaign._id ? "updated" : "created"} successfully`
99
- }
100
- );
101
- }
102
- return H(async () => {
103
- await K(async () => {
104
- await d.read("COIN");
105
- });
106
- }), (e, t) => {
107
- const c = l("FmPill"), m = l("FmPageHead"), k = l("FmSearch"), R = l("FmTable"), L = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
108
- return p(), w(b, null, [
109
- i(m, {
110
- title: o(s)("connect.program.point.title"),
111
- actions: o(f).length > 0 && o(h).isPremium ? [I] : [],
112
- "onClick:action": t[0] || (t[0] = () => g())
113
- }, {
114
- title: y(() => [
115
- n("div", se, [
116
- n("span", ie, u(o(s)("connect.program.point.title")), 1),
117
- i(c, { variant: "premium" })
118
- ])
119
- ]),
120
- _: 1
121
- }, 8, ["title", "actions"]),
122
- n("div", re, [
123
- i(k, {
124
- modelValue: o(r).searchKey,
125
- "onUpdate:modelValue": t[1] || (t[1] = (a) => o(r).searchKey = a),
126
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
127
- placeholder: "search",
128
- collapsible: ""
129
- }, null, 8, ["modelValue"]),
130
- o(d).campaigns.point && o(d).campaigns.point.length > 0 ? (p(), w(b, { key: 0 }, [
131
- n("div", le, [
132
- n("div", ce, [
133
- i(te, {
134
- label: `${o(s)("connect.common.location")}: `,
135
- "right-icon": "keyboard_arrow_down",
136
- modelValue: o(r).location,
137
- "onUpdate:modelValue": t[2] || (t[2] = (a) => o(r).location = a),
138
- icon: "storefront",
139
- "show-item-label": !0,
140
- items: o(h).locationOptions
141
- }, null, 8, ["label", "modelValue", "items"])
142
- ]),
143
- i(k, {
144
- modelValue: o(r).searchKey,
145
- "onUpdate:modelValue": t[3] || (t[3] = (a) => o(r).searchKey = a),
146
- class: "xs:hidden sm:hidden",
147
- placeholder: "search",
148
- collapsible: ""
149
- }, null, 8, ["modelValue"])
150
- ]),
151
- i(R, {
152
- class: "xs:hidden sm:hidden",
153
- "row-data": o(f),
154
- "column-defs": O,
155
- "search-value": o(r).searchKey,
156
- "column-filter": [],
157
- onRowClick: t[4] || (t[4] = (a) => g(a.original)),
158
- "hide-footer": o(f).length < 10
159
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
160
- i(D, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
161
- default: y(() => [
162
- (p(!0), w(b, null, q(o(f).filter(
163
- (a) => a.name.toLowerCase().includes(o(r).searchKey.toLowerCase())
164
- ), (a) => (p(), C(U, {
165
- key: a._id.toString(),
166
- onClick: (S) => g(a),
167
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
168
- }, {
169
- default: y(() => [
170
- n("div", me, [
171
- n("div", de, [
172
- (p(), C(z(o(P)(a))))
173
- ]),
174
- n("div", pe, [
175
- n("div", ue, u(a.name), 1),
176
- n("div", fe, u(o(B)(a)), 1)
177
- ])
178
- ]),
179
- i(L, {
180
- icon: "delete",
181
- "icon-color": "neutral-gray-400",
182
- variant: "tertiary",
183
- onClick: (S) => (S.stopPropagation(), F(a))
184
- }, null, 8, ["onClick"])
185
- ]),
186
- _: 2
187
- }, 1032, ["onClick"]))), 128))
188
- ]),
189
- _: 1
190
- })
191
- ], 64)) : (p(), C(T, {
192
- key: 1,
193
- variant: "outlined",
194
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
195
- }, {
196
- default: y(() => [
197
- t[6] || (t[6] = n("img", {
198
- src: G,
199
- class: "aspect-square w-[150px]"
200
- }, null, -1)),
201
- n("div", ge, [
202
- n("div", ye, u(o(s)("connect.program.point.empty_state.title")), 1),
203
- n("div", _e, u(o(s)("connect.program.point.empty_state.description")), 1)
204
- ]),
205
- i(L, {
206
- variant: "primary",
207
- label: "Create point program",
208
- disabled: !o(h).isPremium,
209
- icon: "add",
210
- onClick: t[5] || (t[5] = (a) => g())
211
- }, null, 8, ["disabled"])
212
- ]),
213
- _: 1
214
- })),
215
- i(oe, {
216
- ref_key: "sheetRef",
217
- ref: v,
218
- "onSubmit:modelValue": A
219
- }, null, 512)
220
- ])
221
- ], 64);
222
- };
223
- }
224
- });
225
- export {
226
- Ie as default
227
- };
@@ -1,358 +0,0 @@
1
- import { defineComponent as K, ref as b, resolveComponent as u, openBlock as f, createBlock as F, unref as a, isRef as Y, withCtx as S, createElementVNode as l, createVNode as i, computed as Z, h as ee, onMounted as oe, createElementBlock as T, Fragment as V, renderList as te, resolveDynamicComponent as ne, toDisplayString as C } from "vue";
2
- import { _ as ae } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as se, components as re } from "@feedmepos/ui-library";
4
- import { c as M, p as $ } from "./plugins-BWUWdHwy.js";
5
- import { u as le } from "./loading-BeO6W824.js";
6
- import { u as ie } from "./business-BUpIHd4Z.js";
7
- import { c as g, u as ce } from "./campaign-CZx-8rcc.js";
8
- import { u as me } from "./vue-i18n-DOqqi883.js";
9
- import { g as ue, a as N } from "./campaign-D_l_eCaG.js";
10
- import { e as j } from "./effect-CpXEk9Dk.js";
11
- import { _ as de } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bsz4DfR2.js";
12
- import { u as pe } from "./template-B1S6b9tH.js";
13
- import { _ as q } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
14
- const fe = { class: "space-y-8" }, ye = /* @__PURE__ */ K({
15
- __name: "QueueSheet",
16
- emits: ["update:model-value"],
17
- setup(U, { expose: n, emit: O }) {
18
- const p = b(!1), h = b([]);
19
- async function k() {
20
- p.value = !0;
21
- const r = await g.getPromotionQueue();
22
- console.log(r, "jobs"), h.value = r;
23
- }
24
- const v = [
25
- {
26
- header: "Started At",
27
- accessorFn: (r) => r.createdAt,
28
- enableSorting: !0
29
- },
30
- {
31
- header: "Campaigns",
32
- accessorFn: (r) => r.campaigns
33
- // cell(props) {
34
- // const r = props.row.original;
35
- // return h('div', {
36
- // innerHTML: r.campaigns.map((c: any) => c.name).join(', '),
37
- // });
38
- // },
39
- }
40
- ];
41
- return n({
42
- showSheet: k
43
- }), (r, m) => {
44
- const _ = u("FmTable"), P = u("FmSideSheet");
45
- return f(), F(P, {
46
- "max-width": 550,
47
- header: "Promotion Sync Queue",
48
- modelValue: a(p),
49
- "onUpdate:modelValue": [
50
- m[1] || (m[1] = (s) => Y(p) ? p.value = s : null),
51
- m[2] || (m[2] = (s) => p.value = s)
52
- ]
53
- }, {
54
- default: S(() => [
55
- l("div", fe, [
56
- m[3] || (m[3] = l("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Promotion synchronizing to your restaurant(s) is queued here. Depending on the number of campaigns and restaurants, this process may take several minutes. No task displayed here means there are no pending promotions to sync. ", -1)),
57
- i(_, {
58
- modelValue: r.tableRef,
59
- "onUpdate:modelValue": m[0] || (m[0] = (s) => r.tableRef = s),
60
- "column-filter": r.jobFilters,
61
- "column-defs": v,
62
- "row-data": a(h),
63
- "hide-footer": a(h).length <= 10
64
- }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"])
65
- ])
66
- ]),
67
- _: 1
68
- }, 8, ["modelValue"]);
69
- };
70
- }
71
- }), ge = { class: "px-24 flex flex-col gap-y-16" }, he = { class: "flex items-center justify-between w-full" }, _e = { class: "flex gap-8 overflow-x-auto" }, be = { class: "space-y-8" }, ve = { class: "flex w-full gap-4 items-center" }, we = { class: "space-y-4" }, xe = { class: "fm-typo-en-body-lg-600" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fe = { class: "flex flex-col gap-16 text-center" }, Se = { class: "fm-typo-en-title-sm-800" }, ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qe = /* @__PURE__ */ K({
72
- __name: "Promotion",
73
- setup(U) {
74
- const { t: n } = me(), O = {
75
- label: n("connect.promotion.createCampaign"),
76
- value: "create",
77
- isPrimary: !0,
78
- prependIcon: "add"
79
- }, p = {
80
- label: "Force sync",
81
- value: "sync",
82
- isPrimary: !1,
83
- prependIcon: "refresh"
84
- }, h = {
85
- label: "Queue",
86
- value: "queue",
87
- isPrimary: !1,
88
- prependIcon: "work_history"
89
- }, k = pe("PROMOTION", se()), v = ie(), r = ce(), { global: m, minor: _ } = le, P = [
90
- {
91
- label: "Bill promotion",
92
- value: "BILL"
93
- },
94
- {
95
- label: "Item promotion",
96
- value: "ITEM"
97
- }
98
- ], s = b({
99
- searchKey: "",
100
- location: [],
101
- effectType: []
102
- });
103
- function D(e) {
104
- const o = s.value.location;
105
- return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((d) => {
106
- var c;
107
- return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(d);
108
- }) : e.targetLocation.includes(o);
109
- }
110
- function E(e) {
111
- var c, x;
112
- const o = s.value.effectType;
113
- if (!o || o.length === 0) return !0;
114
- const d = (x = (c = e.effect) == null ? void 0 : c.options) == null ? void 0 : x.target;
115
- return o.includes(d);
116
- }
117
- const y = Z(
118
- () => r.campaigns.promotion.filter(
119
- (e) => D(e) && E(e)
120
- )
121
- ), Q = [
122
- {
123
- header: n("connect.promotion.promotionTitle"),
124
- accessorFn: (e) => e.name
125
- },
126
- {
127
- header: n("connect.promotion.status"),
128
- accessorFn: (e) => ue(e),
129
- cell(e) {
130
- return N(e.row.original);
131
- }
132
- },
133
- {
134
- header: n("connect.promotion.type"),
135
- accessorFn: (e) => `${M.title(e.effect.options.target)} promotion`
136
- },
137
- {
138
- header: n("connect.promotion.summary"),
139
- accessorFn: (e) => j(e.effect)
140
- },
141
- {
142
- header: n("connect.promotion.actions"),
143
- cell(e) {
144
- return ee(re.FmButton, {
145
- variant: "tertiary",
146
- icon: "delete",
147
- iconColor: "neutral-gray-400",
148
- onClick: (o) => {
149
- o.stopPropagation(), R(e.row.original);
150
- }
151
- });
152
- }
153
- }
154
- ], L = b(), I = b();
155
- async function R(e) {
156
- await $.remove(
157
- n("connect.promotion.confirmRemove", { name: e.name })
158
- ) && await _(
159
- async () => {
160
- await g.delete(e._id), await r.read("PROMOTION");
161
- },
162
- {
163
- message: n("connect.promotion.removing", { name: e.name }),
164
- successMessage: n("connect.promotion.removedSuccessfully", {
165
- name: e.name
166
- })
167
- }
168
- );
169
- }
170
- async function w(e) {
171
- e ? await o() : k.open(async (d) => {
172
- await o(d);
173
- });
174
- async function o(d) {
175
- var c;
176
- (c = L.value) == null || c.showSheet(
177
- !0,
178
- "PROMOTION",
179
- e ? await g.readById(e._id) : void 0,
180
- d
181
- );
182
- }
183
- }
184
- async function H(e) {
185
- await _(
186
- async () => {
187
- e.campaign._id ? await g.update(e.campaign._id, e) : await g.create(e), await r.read("PROMOTION");
188
- },
189
- {
190
- message: n(
191
- e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
192
- ),
193
- successMessage: n(
194
- e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
195
- )
196
- }
197
- );
198
- }
199
- async function z(e) {
200
- var o;
201
- switch (e) {
202
- case "create":
203
- w();
204
- break;
205
- case "sync":
206
- await $.confirm(
207
- "Are you sure you want to synchronize all promotions to POS?",
208
- "Force sync"
209
- ) && _(
210
- async () => {
211
- await g.syncAllPromotion();
212
- },
213
- {
214
- message: "Syncing promotions...",
215
- successMessage: "All promotions synced"
216
- }
217
- );
218
- break;
219
- case "queue":
220
- (o = I.value) == null || o.showSheet();
221
- break;
222
- }
223
- }
224
- return oe(async () => {
225
- await m(async () => {
226
- await v.readLocations(), await r.read("PROMOTION");
227
- });
228
- }), (e, o) => {
229
- const d = u("FmPageHead"), c = u("FmSearch"), x = u("FmTable"), G = u("FmChip"), B = u("FmButton"), J = u("FmListItem"), W = u("FmList"), X = u("FmCard");
230
- return f(), T(V, null, [
231
- i(d, {
232
- title: a(n)("connect.promotion.title"),
233
- actions: a(y).length > 0 ? [O, p, h] : [],
234
- "onClick:action": z
235
- }, null, 8, ["title", "actions"]),
236
- l("div", ge, [
237
- i(c, {
238
- modelValue: s.value.searchKey,
239
- "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
240
- class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
241
- placeholder: a(n)("connect.promotion.search"),
242
- collapsible: ""
243
- }, null, 8, ["modelValue", "placeholder"]),
244
- a(y) && a(y).length > 0 ? (f(), T(V, { key: 0 }, [
245
- l("div", he, [
246
- l("div", _e, [
247
- i(q, {
248
- label: `${a(n)("connect.common.location")}: `,
249
- "right-icon": "keyboard_arrow_down",
250
- modelValue: s.value.location,
251
- "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
252
- icon: "storefront",
253
- "show-item-label": !0,
254
- items: a(v).locationOptions
255
- }, null, 8, ["label", "modelValue", "items"]),
256
- i(q, {
257
- label: "Type:",
258
- "right-icon": "keyboard_arrow_down",
259
- modelValue: s.value.effectType,
260
- "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
261
- icon: "filter_list",
262
- "show-item-label": !0,
263
- items: P
264
- }, null, 8, ["modelValue"])
265
- ]),
266
- i(c, {
267
- modelValue: s.value.searchKey,
268
- "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
269
- class: "xs:hidden sm:hidden",
270
- placeholder: "search",
271
- collapsible: ""
272
- }, null, 8, ["modelValue"])
273
- ]),
274
- i(x, {
275
- class: "xs:hidden sm:hidden",
276
- "row-data": a(y),
277
- "column-defs": Q,
278
- "search-value": s.value.searchKey,
279
- "column-filter": [],
280
- onRowClick: o[4] || (o[4] = (t) => w(t.original)),
281
- "hide-footer": a(y).length < 10
282
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
283
- i(W, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
284
- default: S(() => [
285
- (f(!0), T(V, null, te(a(y).filter(
286
- (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
287
- ), (t) => (f(), F(J, {
288
- key: t._id.toString(),
289
- onClick: (A) => w(t),
290
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
291
- }, {
292
- default: S(() => [
293
- l("div", be, [
294
- l("div", ve, [
295
- (f(), F(ne(a(N)(t)))),
296
- i(G, {
297
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
298
- compact: !0,
299
- label: `${a(M).title(t.effect.options.target)} promotion`
300
- }, null, 8, ["label"])
301
- ]),
302
- l("div", we, [
303
- l("div", xe, C(t.name), 1),
304
- l("div", Ce, C(a(j)(t.effect)), 1)
305
- ])
306
- ]),
307
- i(B, {
308
- icon: "delete",
309
- "icon-color": "neutral-gray-400",
310
- variant: "tertiary",
311
- onClick: (A) => (A.stopPropagation(), R(t))
312
- }, null, 8, ["onClick"])
313
- ]),
314
- _: 2
315
- }, 1032, ["onClick"]))), 128))
316
- ]),
317
- _: 1
318
- })
319
- ], 64)) : (f(), F(X, {
320
- key: 1,
321
- variant: "outlined",
322
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
323
- }, {
324
- default: S(() => [
325
- o[6] || (o[6] = l("img", {
326
- src: ae,
327
- class: "aspect-square w-[150px]"
328
- }, null, -1)),
329
- l("div", Fe, [
330
- l("div", Se, C(a(n)("connect.promotion.createPromotionCampaign")), 1),
331
- l("div", ke, C(a(n)("connect.promotion.description")), 1)
332
- ]),
333
- i(B, {
334
- variant: "primary",
335
- label: a(n)("connect.promotion.createPromotionCampaign"),
336
- icon: "add",
337
- onClick: o[5] || (o[5] = (t) => w())
338
- }, null, 8, ["label"])
339
- ]),
340
- _: 1
341
- }))
342
- ]),
343
- i(de, {
344
- ref_key: "sheetRef",
345
- ref: L,
346
- "onSubmit:modelValue": H
347
- }, null, 512),
348
- i(ye, {
349
- ref_key: "queueSheetRef",
350
- ref: I
351
- }, null, 512)
352
- ], 64);
353
- };
354
- }
355
- });
356
- export {
357
- qe as default
358
- };
@@ -1,28 +0,0 @@
1
- var u = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
- function f(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
5
- function l(e) {
6
- if (e.__esModule) return e;
7
- var r = e.default;
8
- if (typeof r == "function") {
9
- var t = function o() {
10
- return this instanceof o ? Reflect.construct(r, arguments, this.constructor) : r.apply(this, arguments);
11
- };
12
- t.prototype = r.prototype;
13
- } else t = {};
14
- return Object.defineProperty(t, "__esModule", { value: !0 }), Object.keys(e).forEach(function(o) {
15
- var n = Object.getOwnPropertyDescriptor(e, o);
16
- Object.defineProperty(t, o, n.get ? n : {
17
- enumerable: !0,
18
- get: function() {
19
- return e[o];
20
- }
21
- });
22
- }), t;
23
- }
24
- export {
25
- l as a,
26
- u as c,
27
- f as g
28
- };