@feedmepos/mf-connect 0.1.0-beta.7 → 0.1.0-beta.71

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 (126) hide show
  1. package/dist/Analytic-CnF_WeRZ.js +427 -0
  2. package/dist/{App-DalxIjTu.js → App-DJwSTuRa.js} +445 -420
  3. package/dist/AuditLogs-RarW2PHL.js +1886 -0
  4. package/dist/Bin-BaixTvHW.js +166 -0
  5. package/dist/{Broadcast-uMAvsC--.js → Broadcast-8DEAMhyM.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-JxbENan8.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DPXoOupI.js} +6 -8
  7. package/dist/Card-DRwLZ-Mn.js +896 -0
  8. package/dist/Collections-WsPM9v03.js +459 -0
  9. package/dist/{Credit-QlnatflM.js → Credit-DMxRdTzt.js} +36 -34
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +108 -0
  11. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bcj6o4Xi.js +2181 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BE07lc4M.js → EffectSheet.vue_vue_type_style_index_0_lang-CuJ8curT.js} +49 -49
  14. package/dist/{Experience-Czy41ifp.js → Experience-B0BV4Tc_.js} +32 -30
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  16. package/dist/Game-Bu6kJJHx.js +278 -0
  17. package/dist/Index-CX-aPFQt.js +259 -0
  18. package/dist/Marketing-CiVFwl6S.js +20071 -0
  19. package/dist/Member-DZfTtt13.js +333 -0
  20. package/dist/MemberList-CscwsZnv.js +1598 -0
  21. package/dist/MemberTransactions-BWNs6bUm.js +45 -0
  22. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CtM73bcN.js → MessageInput.vue_vue_type_script_setup_true_lang-BrbRudIU.js} +134 -122
  23. package/dist/Mission-CyJ-9Qfl.js +296 -0
  24. package/dist/Overview-DLyt6VId.js +1078 -0
  25. package/dist/{Point-By6ogYy_.js → Point-Cc_0-RKm.js} +55 -53
  26. package/dist/Promotion-KqA8nev2.js +289 -0
  27. package/dist/Queue-i8--zps9.js +249 -0
  28. package/dist/Record-CLUO1JVc.js +340 -0
  29. package/dist/Reward-BEdUKQ3M.js +442 -0
  30. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B9vnSbWj.js +150 -0
  31. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-B8zw1TmO.js +1727 -0
  32. package/dist/Segment-B8sYajZG.js +568 -0
  33. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CmmI5Vwl.js +181 -0
  34. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-CIcXjbJG.js +186 -0
  35. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DY3FMuIf.js +147 -0
  36. package/dist/Setting-DT8dRb2A.js +1931 -0
  37. package/dist/Store-BhsPWRkR.js +1841 -0
  38. package/dist/StoreRewards-Cx2WDZ3p.js +423 -0
  39. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Byb7GOoh.js +1028 -0
  40. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-nEdCD6la.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cb-FGTO9.js} +1 -1
  41. package/dist/{Tier-DvAs0-yx.js → Tier-kQy1vGwo.js} +327 -318
  42. package/dist/{Title-B_Trr39o.js → Title-DKv8FqpX.js} +224 -209
  43. package/dist/{Transaction-DCJw-b3H.js → Transaction-CSLllOgl.js} +2 -2
  44. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CvpBdNBn.js +130 -0
  45. package/dist/Voucher-BP6fmSwu.js +354 -0
  46. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CxQEg_HW.js +419 -0
  47. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXkhu8e9.js → ZodTextField.vue_vue_type_script_setup_true_lang-aurdXO2X.js} +1 -1
  48. package/dist/app-B3qgrQOd.js +7079 -0
  49. package/dist/app-s3iL79De.js +33357 -0
  50. package/dist/app.js +1 -1
  51. package/dist/business-DG2w8U-i.js +79 -0
  52. package/dist/campaign-BP6Rz-AH.js +1810 -0
  53. package/dist/{campaign--0_yMbMV.js → campaign-WPRZ4BRF.js} +2 -2
  54. package/dist/campaign.enum-CoqrWNTZ.js +20 -0
  55. package/dist/campaign.fn-BRPigTOA.js +758 -0
  56. package/dist/collectible.enum-Dy4sxF43.js +19 -0
  57. package/dist/{collection.fn-3TwPe7aF.js → collection.fn-DGnLyYgV.js} +2 -2
  58. package/dist/dto-xZ9I6-Jr.js +214 -0
  59. package/dist/{effect-BeR0LK61.js → effect-C0XoYTus.js} +33 -16
  60. package/dist/email-addresses-CJ87c7W1.js +705 -0
  61. package/dist/{export-xeLLhqvh.js → export-qlV-AbEl.js} +5 -5
  62. package/dist/{helper-B5iqfKh8.js → helper-DzYe8aNx.js} +1 -1
  63. package/dist/{index-BOdtpNkP.js → index-4vdSri7m.js} +266 -173
  64. package/dist/{index-CU_d8jjU.js → index-BfSj7cUl.js} +1 -1
  65. package/dist/index-Bj0ULpXi.js +29556 -0
  66. package/dist/index-BnZ4yaMH.js +115 -0
  67. package/dist/index-Bo5DJXxs.js +54 -0
  68. package/dist/{index-Ct_wR519.js → index-BuvJH6SU.js} +24 -21
  69. package/dist/index-C2GEs8di.js +32 -0
  70. package/dist/{index-CyKZ-SsN.js → index-CJuOTcCE.js} +1 -1
  71. package/dist/index-CsaQJMAR.js +66 -0
  72. package/dist/{index-DP-dGMJC.js → index-DReysUPw.js} +2230 -871
  73. package/dist/{index-CAn5heDe.js → index-DgCjRb3o.js} +48 -4
  74. package/dist/index-IwITtvVu.js +56 -0
  75. package/dist/{index-Bh-uaaBG.js → index-n3wiQlbk.js} +1506 -1480
  76. package/dist/index-vh86FiIQ.js +10 -0
  77. package/dist/{index.esm2017-5jeDA5Zo.js → index.esm2017-CkJhTmme.js} +154 -154
  78. package/dist/loading-DwJdwl4G.js +71 -0
  79. package/dist/{membership-D0nqqWNZ.js → membership-DvPK3h8f.js} +54 -46
  80. package/dist/money-C_WIbr_x.js +15 -0
  81. package/dist/number-ZeVoGhzP.js +12 -0
  82. package/dist/objectid-8lkX6otO.js +145 -0
  83. package/dist/{loading-C-JDVajU.js → plugins-D20keyDW.js} +2990 -3062
  84. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  85. package/dist/reward-CqnMEq_w.js +36 -0
  86. package/dist/{rule-Dn_GgBCe.js → rule-D7htGgWz.js} +185 -178
  87. package/dist/{rule-builder-BXt29Es4.js → rule-builder-BbJpYQ0n.js} +1 -1
  88. package/dist/style.css +1 -1
  89. package/dist/{template-D2Oi3dxP.js → template-BWQCVHm7.js} +5 -5
  90. package/dist/trigger-DMuv0_O7.js +144 -0
  91. package/dist/user-C_v2C0qN.js +54 -0
  92. package/dist/vue-i18n-N8_TEEd0.js +2365 -0
  93. package/dist/{xlsx-CCRCidY2.js → xlsx-CsPDNSTo.js} +1 -1
  94. package/package.json +11 -7
  95. package/dist/Analytic-BMpS6jWb.js +0 -622
  96. package/dist/Card-DV8-g69L.js +0 -825
  97. package/dist/Collections-DRafEHT1.js +0 -453
  98. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js +0 -2813
  99. package/dist/Game-CD3zSitz.js +0 -255
  100. package/dist/Marketing-NNes8z6Q.js +0 -316
  101. package/dist/Member-CTqBgYuV.js +0 -69
  102. package/dist/MemberList-B99tS5ce.js +0 -1733
  103. package/dist/MemberTransactions-D1YCXPOg.js +0 -38
  104. package/dist/Mission-XbBVKBiE.js +0 -261
  105. package/dist/Promotion-DKcBr-RI.js +0 -247
  106. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D1ESqEFO.js +0 -1753
  107. package/dist/Segment-B8cszL-F.js +0 -437
  108. package/dist/Setting-aZYABlMW.js +0 -1901
  109. package/dist/Store-Bx2tyJwe.js +0 -1511
  110. package/dist/StoreRewards-DTp9G6gw.js +0 -401
  111. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js +0 -890
  112. package/dist/Voucher-jqv3ji90.js +0 -490
  113. package/dist/app-WlcUVbFb.js +0 -5764
  114. package/dist/app-_w0hjM7u.js +0 -53428
  115. package/dist/business-BC4-i1cU.js +0 -78
  116. package/dist/dto-Ns2dLn1B.js +0 -2770
  117. package/dist/index-BWb9vRCi.js +0 -29193
  118. package/dist/index-CpU9aqyW.js +0 -206
  119. package/dist/index-CqO_ZvtD.js +0 -99
  120. package/dist/index-CuvNtC_M.js +0 -61
  121. package/dist/index-DsNsA2uX.js +0 -298
  122. package/dist/index-WAMr3npT.js +0 -762
  123. package/dist/money-hdbrblud.js +0 -15
  124. package/dist/number-CRWGOZaW.js +0 -12
  125. package/dist/user-Bm4KttFq.js +0 -37
  126. package/dist/vue-i18n-Dud8fvmw.js +0 -2365
@@ -1,38 +0,0 @@
1
- import { defineComponent as i, ref as p, resolveComponent as _, openBlock as l, createElementBlock as d, createVNode as f, unref as e, createBlock as r, createCommentVNode as v } from "vue";
2
- import { _ as b, a as k } from "./StoreTransactions.vue_vue_type_script_setup_true_lang-B2W7ly5Z.js";
3
- import { useRouter as x } from "vue-router";
4
- const C = { class: "flex flex-col gap-y-32 pb-24" }, N = /* @__PURE__ */ i({
5
- __name: "MemberTransactions",
6
- setup(T) {
7
- const s = x(), t = [
8
- {
9
- label: "Collection",
10
- value: "collection"
11
- },
12
- {
13
- label: "Store",
14
- value: "store"
15
- }
16
- ], o = p(t[0]), a = s.currentRoute.value.params.id;
17
- return (y, n) => {
18
- const u = _("FmTabs");
19
- return l(), d("div", C, [
20
- f(u, {
21
- "model-value": e(o).value,
22
- items: t,
23
- "onUpdate:modelValue": n[0] || (n[0] = (c) => o.value = t.find((m) => m.value === c))
24
- }, null, 8, ["model-value"]),
25
- e(o).value == "collection" ? (l(), r(b, {
26
- key: 0,
27
- user: e(a)
28
- }, null, 8, ["user"])) : e(o).value == "store" ? (l(), r(k, {
29
- key: 1,
30
- user: e(a)
31
- }, null, 8, ["user"])) : v("", !0)
32
- ]);
33
- };
34
- }
35
- });
36
- export {
37
- N as default
38
- };
@@ -1,261 +0,0 @@
1
- import { defineComponent as $, ref as V, computed as E, h as m, onMounted as A, resolveComponent as r, openBlock as d, createElementBlock as h, Fragment as b, createVNode as c, unref as t, createElementVNode as s, withCtx as w, renderList as H, createBlock as x, resolveDynamicComponent as q, toDisplayString as p } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as G, components as v } from "@feedmepos/ui-library";
4
- import { a as J, p as Q, u as W } from "./loading-C-JDVajU.js";
5
- import { u as X } from "./business-BC4-i1cU.js";
6
- import { u as Y } from "./campaign--0_yMbMV.js";
7
- import { g as L, b as M } from "./dto-Ns2dLn1B.js";
8
- import { _ as Z } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
9
- import { _ as ee } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js";
10
- import { u as oe } from "./template-D2Oi3dxP.js";
11
- import { s as te } from "./index-CuvNtC_M.js";
12
- import { u as ne } from "./vue-i18n-Dud8fvmw.js";
13
- import { c as _ } from "./index-CqO_ZvtD.js";
14
- const ae = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, ie = { class: "flex gap-8 overflow-x-auto" }, ce = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, le = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, me = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, ye = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ $({
15
- __name: "Mission",
16
- setup(_e) {
17
- const { t: n } = ne(), B = {
18
- label: n("connect.program.common.actions.create", {
19
- type: n("connect.program.mission.title").toLowerCase()
20
- }),
21
- value: "create",
22
- isPrimary: !0,
23
- prependIcon: "add"
24
- }, K = oe("MISSION", G()), N = X(), l = Y(), { global: P, minor: C } = W, i = V({
25
- searchKey: "",
26
- location: null
27
- }), u = E(
28
- () => l.campaigns.mission.filter(
29
- (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
30
- )
31
- ), R = [
32
- {
33
- header: n("connect.program.common.table.title"),
34
- accessorKey: "name",
35
- // accessorFn: (v) => v.name,
36
- cell(e) {
37
- return m("div", { class: "flex items-center justify-between gap-4" }, [
38
- m("div", { class: "flex items-center" }, [
39
- m(
40
- v.FmTooltip,
41
- {
42
- content: e.row.original._id,
43
- onClick: (o) => {
44
- o.stopPropagation(), J(e.row.original._id);
45
- }
46
- },
47
- [
48
- m(v.FmIcon, {
49
- name: "info",
50
- outline: !0,
51
- size: "sm"
52
- })
53
- ]
54
- )
55
- ]),
56
- m("div", { class: "flex-1" }, e.row.original.name)
57
- ]);
58
- }
59
- },
60
- {
61
- header: n("connect.campaign.mission.type"),
62
- accessorFn: (e) => te(e.mission.type)
63
- //v.effect,
64
- },
65
- {
66
- header: n("connect.program.common.table.status"),
67
- cell(e) {
68
- return L(e.row.original);
69
- }
70
- },
71
- {
72
- header: n("connect.program.common.table.summary"),
73
- accessorFn: (e) => M(e)
74
- //v.effect,
75
- },
76
- {
77
- header: n("connect.campaign.mission.received"),
78
- accessorFn: (e) => {
79
- var o;
80
- return ((o = e == null ? void 0 : e.pf_collectible) == null ? void 0 : o.currentReceive) ?? 0;
81
- }
82
- },
83
- {
84
- header: n("connect.program.common.table.actions"),
85
- cell(e) {
86
- return m(v.FmButton, {
87
- variant: "tertiary",
88
- icon: "delete",
89
- iconColor: "neutral-gray-400",
90
- onClick: (o) => {
91
- o.stopPropagation(), F(e.row.original);
92
- }
93
- });
94
- }
95
- }
96
- ], S = V();
97
- async function F(e) {
98
- await Q.remove(
99
- n("connect.program.common.remove.confirm", { name: e.name })
100
- ) && await C(
101
- async () => {
102
- await _.delete(e._id), await l.read("MISSION");
103
- },
104
- {
105
- message: n("connect.program.common.remove.removing", { name: e.name }),
106
- successMessage: n("connect.program.common.remove.removed", {
107
- name: e.name
108
- })
109
- }
110
- );
111
- }
112
- async function y(e) {
113
- e ? await o() : K.open(async (f) => {
114
- await o(f);
115
- });
116
- async function o(f) {
117
- var g;
118
- (g = S.value) == null || g.showSheet(
119
- !0,
120
- "MISSION",
121
- e ? await _.readById(e._id) : void 0,
122
- f
123
- );
124
- }
125
- }
126
- async function T(e) {
127
- await C(
128
- async () => {
129
- e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await l.read("MISSION");
130
- },
131
- {
132
- message: n(
133
- e.campaign._id ? "connect.program.common.update.updating" : "connect.program.common.update.creating",
134
- { type: "Mission" }
135
- ),
136
- successMessage: n("connect.program.common.update.success", {
137
- type: "Mission",
138
- action: e.campaign._id ? "updated" : "created"
139
- })
140
- }
141
- );
142
- }
143
- return A(async () => {
144
- await P(async () => {
145
- await l.read("MISSION"), console.log(u);
146
- });
147
- }), (e, o) => {
148
- const f = r("FmPageHead"), g = r("FmSearch"), O = r("FmTable"), k = r("FmButton"), j = r("FmListItem"), D = r("FmList"), U = r("FmCard");
149
- return d(), h(b, null, [
150
- c(f, {
151
- title: t(n)("connect.campaign.mission.title"),
152
- actions: t(u).length > 0 ? [B] : [],
153
- "onClick:action": o[0] || (o[0] = () => y())
154
- }, null, 8, ["title", "actions"]),
155
- s("div", ae, [
156
- c(g, {
157
- modelValue: t(i).searchKey,
158
- "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
159
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
160
- placeholder: t(n)("connect.program.common.search"),
161
- collapsible: ""
162
- }, null, 8, ["modelValue", "placeholder"]),
163
- t(l).campaigns.mission && t(l).campaigns.mission.length > 0 ? (d(), h(b, { key: 0 }, [
164
- s("div", se, [
165
- s("div", ie, [
166
- c(Z, {
167
- modelValue: t(i).location,
168
- "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
169
- label: t(n)("connect.program.common.location"),
170
- "show-item-label": !0,
171
- icon: "storefront",
172
- placement: "bottom-start",
173
- items: t(N).locationItems
174
- }, null, 8, ["modelValue", "label", "items"])
175
- ]),
176
- c(g, {
177
- modelValue: t(i).searchKey,
178
- "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
179
- class: "xs:hidden",
180
- placeholder: "search",
181
- collapsible: ""
182
- }, null, 8, ["modelValue"])
183
- ]),
184
- c(O, {
185
- class: "xs:hidden",
186
- "row-data": t(u),
187
- "column-defs": R,
188
- "search-value": t(i).searchKey,
189
- "column-filter": [],
190
- onRowClick: o[4] || (o[4] = (a) => y(a.original)),
191
- "hide-footer": t(u).length < 10
192
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
193
- c(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
194
- default: w(() => [
195
- (d(!0), h(b, null, H(t(u).filter(
196
- (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
197
- ), (a) => (d(), x(j, {
198
- key: a._id.toString(),
199
- onClick: (I) => y(a),
200
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
201
- }, {
202
- default: w(() => [
203
- s("div", ce, [
204
- s("div", re, [
205
- (d(), x(q(t(L)(a)))),
206
- s("div", le, p(a.currentReceive ?? 0) + " used ", 1)
207
- ]),
208
- s("div", me, [
209
- s("div", de, p(a.name), 1),
210
- s("div", pe, p(t(M)(a)), 1)
211
- ]),
212
- s("div", ue, " Token received: " + p(a.currentReceive ?? 0), 1)
213
- ]),
214
- c(k, {
215
- icon: "delete",
216
- "icon-color": "neutral-gray-400",
217
- variant: "tertiary",
218
- onClick: (I) => (I.stopPropagation(), F(a))
219
- }, null, 8, ["onClick"])
220
- ]),
221
- _: 2
222
- }, 1032, ["onClick"]))), 128))
223
- ]),
224
- _: 1
225
- })
226
- ], 64)) : (d(), x(U, {
227
- key: 1,
228
- variant: "outlined",
229
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
230
- }, {
231
- default: w(() => [
232
- o[6] || (o[6] = s("img", {
233
- src: z,
234
- class: "aspect-square w-[150px]"
235
- }, null, -1)),
236
- s("div", fe, [
237
- s("div", ge, p(t(n)("connect.campaign.mission.createProgram")), 1),
238
- s("div", ye, p(t(n)("connect.campaign.mission.description")), 1)
239
- ]),
240
- c(k, {
241
- variant: "primary",
242
- label: t(n)("connect.campaign.mission.create"),
243
- icon: "add",
244
- onClick: o[5] || (o[5] = (a) => y())
245
- }, null, 8, ["label"])
246
- ]),
247
- _: 1
248
- })),
249
- c(ee, {
250
- ref_key: "sheetRef",
251
- ref: S,
252
- "onSubmit:modelValue": T
253
- }, null, 512)
254
- ])
255
- ], 64);
256
- };
257
- }
258
- });
259
- export {
260
- Be as default
261
- };
@@ -1,247 +0,0 @@
1
- import { defineComponent as H, ref as S, computed as q, h as z, onMounted as G, resolveComponent as l, openBlock as m, createElementBlock as h, Fragment as w, createVNode as r, unref as a, createElementVNode as s, withCtx as v, renderList as J, createBlock as b, resolveDynamicComponent as Q, toDisplayString as g } from "vue";
2
- import { _ as W } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as X, components as Y } from "@feedmepos/ui-library";
4
- import { c as O, p as I, u as Z } from "./loading-C-JDVajU.js";
5
- import { u as ee } from "./business-BC4-i1cU.js";
6
- import { u as oe } from "./campaign--0_yMbMV.js";
7
- import { u as te } from "./vue-i18n-Dud8fvmw.js";
8
- import { g as V } from "./dto-Ns2dLn1B.js";
9
- import { e as L } from "./effect-BeR0LK61.js";
10
- import { _ as ne } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
11
- import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-TDoMehSB.js";
12
- import { u as se } from "./template-D2Oi3dxP.js";
13
- import { c as u } from "./index-CqO_ZvtD.js";
14
- const 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" }, pe = { class: "space-y-4" }, de = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-16 text-center" }, ye = { class: "fm-typo-en-title-sm-800" }, ge = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Le = /* @__PURE__ */ H({
15
- __name: "Promotion",
16
- setup(_e) {
17
- const { t } = te(), T = {
18
- label: t("connect.promotion.createCampaign"),
19
- value: "create",
20
- isPrimary: !0,
21
- prependIcon: "add"
22
- }, B = {
23
- label: "Force sync",
24
- value: "sync",
25
- isPrimary: !1,
26
- prependIcon: "refresh"
27
- }, M = se("PROMOTION", X()), x = ee(), f = oe(), { global: R, minor: _ } = Z, i = S({
28
- searchKey: "",
29
- location: null
30
- }), c = q(
31
- () => f.campaigns.promotion.filter(
32
- (e) => !i.value.location || !e.targetLocation || e.targetLocation.includes(i.value.location)
33
- )
34
- ), K = [
35
- {
36
- header: t("connect.promotion.promotionTitle"),
37
- accessorFn: (e) => e.name
38
- },
39
- {
40
- header: t("connect.promotion.status"),
41
- cell(e) {
42
- return V(e.row.original);
43
- }
44
- },
45
- {
46
- header: t("connect.promotion.type"),
47
- accessorFn: (e) => `${O.title(e.effect.options.target)} promotion`
48
- },
49
- {
50
- header: t("connect.promotion.summary"),
51
- accessorFn: (e) => L(e.effect)
52
- },
53
- {
54
- header: t("connect.promotion.actions"),
55
- cell(e) {
56
- return z(Y.FmButton, {
57
- variant: "tertiary",
58
- icon: "delete",
59
- iconColor: "neutral-gray-400",
60
- onClick: (n) => {
61
- n.stopPropagation(), F(e.row.original);
62
- }
63
- });
64
- }
65
- }
66
- ], C = S();
67
- async function F(e) {
68
- await I.remove(t("promotion.confirmRemove", { name: e.name })) && await _(
69
- async () => {
70
- await u.delete(e._id), await f.read("PROMOTION");
71
- },
72
- {
73
- message: t("promotion.removing", { name: e.name }),
74
- successMessage: t("promotion.removedSuccessfully", { name: e.name })
75
- }
76
- );
77
- }
78
- async function y(e) {
79
- e ? await n() : M.open(async (p) => {
80
- await n(p);
81
- });
82
- async function n(p) {
83
- var d;
84
- (d = C.value) == null || d.showSheet(
85
- !0,
86
- "PROMOTION",
87
- e ? await u.readById(e._id) : void 0,
88
- p
89
- );
90
- }
91
- }
92
- async function N(e) {
93
- await _(
94
- async () => {
95
- e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await f.read("PROMOTION");
96
- },
97
- {
98
- message: t(e.campaign._id ? "promotion.updating" : "promotion.creating"),
99
- successMessage: t(
100
- e.campaign._id ? "promotion.updatedSuccessfully" : "promotion.createdSuccessfully"
101
- )
102
- }
103
- );
104
- }
105
- async function A(e) {
106
- switch (e) {
107
- case "create":
108
- y();
109
- break;
110
- case "sync":
111
- await I.confirm(
112
- "Are you sure you want to synchronize all promotions to POS?",
113
- "Force sync"
114
- ) && _(
115
- async () => {
116
- await u.syncAllPromotion();
117
- },
118
- {
119
- message: "Syncing promotions...",
120
- successMessage: "All promotions synced"
121
- }
122
- );
123
- break;
124
- }
125
- }
126
- return G(async () => {
127
- await R(async () => {
128
- await x.readLocations(), await f.read("PROMOTION");
129
- });
130
- }), (e, n) => {
131
- const p = l("FmPageHead"), d = l("FmSearch"), $ = l("FmTable"), D = l("FmChip"), k = l("FmButton"), U = l("FmListItem"), j = l("FmList"), E = l("FmCard");
132
- return m(), h(w, null, [
133
- r(p, {
134
- title: a(t)("connect.promotion.title"),
135
- actions: a(c).length > 0 ? [T, B] : [],
136
- "onClick:action": A
137
- }, null, 8, ["title", "actions"]),
138
- s("div", ie, [
139
- r(d, {
140
- modelValue: i.value.searchKey,
141
- "onUpdate:modelValue": n[0] || (n[0] = (o) => i.value.searchKey = o),
142
- class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
143
- placeholder: a(t)("connect.promotion.search"),
144
- collapsible: ""
145
- }, null, 8, ["modelValue", "placeholder"]),
146
- a(c) && a(c).length > 0 ? (m(), h(w, { key: 0 }, [
147
- s("div", re, [
148
- s("div", le, [
149
- r(ne, {
150
- modelValue: i.value.location,
151
- "onUpdate:modelValue": n[1] || (n[1] = (o) => i.value.location = o),
152
- label: a(t)("connect.promotion.location"),
153
- "show-item-label": !0,
154
- icon: "storefront",
155
- placement: "bottom-start",
156
- items: a(x).locationItems
157
- }, null, 8, ["modelValue", "label", "items"])
158
- ]),
159
- r(d, {
160
- modelValue: i.value.searchKey,
161
- "onUpdate:modelValue": n[2] || (n[2] = (o) => i.value.searchKey = o),
162
- class: "xs:hidden",
163
- placeholder: "search",
164
- collapsible: ""
165
- }, null, 8, ["modelValue"])
166
- ]),
167
- r($, {
168
- class: "xs:hidden",
169
- "row-data": a(c),
170
- "column-defs": K,
171
- "search-value": i.value.searchKey,
172
- "column-filter": [],
173
- onRowClick: n[3] || (n[3] = (o) => y(o.original)),
174
- "hide-footer": a(c).length < 10
175
- }, null, 8, ["row-data", "search-value", "hide-footer"]),
176
- r(j, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
177
- default: v(() => [
178
- (m(!0), h(w, null, J(a(c).filter(
179
- (o) => o.name.toLowerCase().includes(i.value.searchKey.toLowerCase())
180
- ), (o) => (m(), b(U, {
181
- key: o._id.toString(),
182
- onClick: (P) => y(o),
183
- class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
184
- }, {
185
- default: v(() => [
186
- s("div", ce, [
187
- s("div", me, [
188
- (m(), b(Q(a(V)(o)))),
189
- r(D, {
190
- class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
191
- compact: !0,
192
- label: `${a(O).title(o.effect.options.target)} promotion`
193
- }, null, 8, ["label"])
194
- ]),
195
- s("div", pe, [
196
- s("div", de, g(o.name), 1),
197
- s("div", ue, g(a(L)(o.effect)), 1)
198
- ])
199
- ]),
200
- r(k, {
201
- icon: "delete",
202
- "icon-color": "neutral-gray-400",
203
- variant: "tertiary",
204
- onClick: (P) => (P.stopPropagation(), F(o))
205
- }, null, 8, ["onClick"])
206
- ]),
207
- _: 2
208
- }, 1032, ["onClick"]))), 128))
209
- ]),
210
- _: 1
211
- })
212
- ], 64)) : (m(), b(E, {
213
- key: 1,
214
- variant: "outlined",
215
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
216
- }, {
217
- default: v(() => [
218
- n[5] || (n[5] = s("img", {
219
- src: W,
220
- class: "aspect-square w-[150px]"
221
- }, null, -1)),
222
- s("div", fe, [
223
- s("div", ye, g(a(t)("connect.promotion.createPromotionCampaign")), 1),
224
- s("div", ge, g(a(t)("connect.promotion.description")), 1)
225
- ]),
226
- r(k, {
227
- variant: "primary",
228
- label: a(t)("connect.promotion.createPromotionCampaign"),
229
- icon: "add",
230
- onClick: n[4] || (n[4] = (o) => y())
231
- }, null, 8, ["label"])
232
- ]),
233
- _: 1
234
- }))
235
- ]),
236
- r(ae, {
237
- ref_key: "sheetRef",
238
- ref: C,
239
- "onSubmit:modelValue": N
240
- }, null, 512)
241
- ], 64);
242
- };
243
- }
244
- });
245
- export {
246
- Le as default
247
- };