@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-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 (101) hide show
  1. package/dist/Analytic-D1vIDmhJ.js +620 -0
  2. package/dist/{App-DQUbRsdA.js → App-DHrfWG8l.js} +249 -250
  3. package/dist/Broadcast-B2rxZAZi.js +216 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
  5. package/dist/Card-Dr6pTTM0.js +824 -0
  6. package/dist/Collections-0tbg0MFt.js +441 -0
  7. package/dist/Credit-KbB_7Jq-.js +214 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
  10. package/dist/Experience-C_Q9Iml8.js +211 -0
  11. package/dist/Game-BwODw7M6.js +250 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
  13. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
  14. package/dist/Marketing-QOKTAS_T.js +309 -0
  15. package/dist/Member-d7RIGRm1.js +92 -0
  16. package/dist/MemberList-CK9629ew.js +1737 -0
  17. package/dist/MemberOverview-C2n9oJZh.js +58 -0
  18. package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-D-pnlXiP.js} +1 -1
  19. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
  20. package/dist/Mission-BAKDm4VZ.js +248 -0
  21. package/dist/Point-Puu0jKz0.js +220 -0
  22. package/dist/Promotion-DRIaUvJi.js +244 -0
  23. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
  24. package/dist/Segment-DpBxGuuu.js +435 -0
  25. package/dist/Setting-DLB2ywCp.js +1870 -0
  26. package/dist/Store-8DO6ITWc.js +1513 -0
  27. package/dist/StoreRewards-DZfqUeYR.js +429 -0
  28. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
  29. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
  30. package/dist/{Tier-Cpl0FV8L.js → Tier-BnQRujpX.js} +453 -481
  31. package/dist/{Title-CbMDd1Et.js → Title-BPf1tUFx.js} +295 -314
  32. package/dist/Transaction-ese0oNrz.js +36 -0
  33. package/dist/Voucher--gtOZQx1.js +485 -0
  34. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
  35. package/dist/app-Bt59niI-.js +2974 -0
  36. package/dist/{app-VxaUCtgl.js → app-DHE61XdR.js} +1 -1
  37. package/dist/app.js +3 -5
  38. package/dist/{business-DR7jpnLz.js → business-BSo7EPan.js} +1 -1
  39. package/dist/{campaign-MqcTb329.js → campaign-CsOje3Ap.js} +3 -5
  40. package/dist/{collection.fn-CvEoe61K.js → collection.fn-BYQfFJOr.js} +2 -2
  41. package/dist/dto-CfEXSCq6.js +1145 -0
  42. package/dist/{effect-BjjQeiQg.js → effect-Bn_ofYS3.js} +9 -9
  43. package/dist/{export-B8cvWh5n.js → export-CMR243CF.js} +3 -3
  44. package/dist/{helper-DfgVNY7B.js → helper-BqOQRtvW.js} +1 -1
  45. package/dist/index-BLDYTxnc.js +28058 -0
  46. package/dist/{index-C2JNcGc-.js → index-BWnFs-Cb.js} +281 -299
  47. package/dist/{index-B5NufbUt.js → index-BaBNmzUb.js} +1 -1
  48. package/dist/{index-CWR3qYjb.js → index-Boo5np6l.js} +1 -1
  49. package/dist/{index-BsfWRB8R.js → index-CC1GV8OW.js} +1 -1
  50. package/dist/{index-0UYoh1-7.js → index-CHO4_zsT.js} +1 -1
  51. package/dist/{index-2P9w5u3m.js → index-DEZsrQ2f.js} +3 -3
  52. package/dist/{index-C7zMfUgy.js → index-D_f2lmK2.js} +1 -1
  53. package/dist/{index-Dap5R3vr.js → index-Da142OER.js} +66 -78
  54. package/dist/index-DbP04yeg.js +11 -0
  55. package/dist/{index-DBy30v8N.js → index-DtPe-TEm.js} +3 -3
  56. package/dist/{index-CJ8Uh2Ja.js → index-FvlaxwGB.js} +3 -3
  57. package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-ePm--Atp.js} +55 -55
  58. package/dist/{loading-CJ3nOovJ.js → loading-KNmEMBUB.js} +460 -469
  59. package/dist/{membership-B1cmSRyk.js → membership-DKoVIS1a.js} +3 -3
  60. package/dist/money-CkD3zl5C.js +15 -0
  61. package/dist/number-BDsGpOXm.js +12 -0
  62. package/dist/{rule-ChWyR-0j.js → rule-CzamI50_.js} +2 -2
  63. package/dist/{rule-builder-CSmOONdb.js → rule-builder-DHf6wfaQ.js} +1 -1
  64. package/dist/style.css +1 -1
  65. package/dist/{template-Cug7aRK0.js → template-CFAIPoD7.js} +63 -63
  66. package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
  67. package/dist/{xlsx-CfgPFFvp.js → xlsx-BDJMaozs.js} +517 -517
  68. package/package.json +4 -7
  69. package/dist/Analytic-CMXUjK_F.js +0 -622
  70. package/dist/Broadcast-DowFtHv6.js +0 -223
  71. package/dist/Card-C7rhL0pV.js +0 -825
  72. package/dist/Collections-B-1wlk3r.js +0 -453
  73. package/dist/Credit-DDjozmoF.js +0 -220
  74. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
  75. package/dist/Experience-BbE-c1Op.js +0 -221
  76. package/dist/Game-DQdRpaN-.js +0 -255
  77. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
  78. package/dist/MainLayout-B1aJoR95.js +0 -41
  79. package/dist/Marketing-Dgmxzg4h.js +0 -316
  80. package/dist/Member-w23oRVwN.js +0 -69
  81. package/dist/MemberList-BLIdjznQ.js +0 -1735
  82. package/dist/MemberOverview-wL_ailso.js +0 -58
  83. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
  84. package/dist/Mission-Cjt0E083.js +0 -261
  85. package/dist/Point-CQJL3Ewu.js +0 -222
  86. package/dist/Promotion-BYViH3bu.js +0 -247
  87. package/dist/Segment-B9Jj1ak0.js +0 -437
  88. package/dist/Setting-DXWbgRxs.js +0 -1901
  89. package/dist/Store-Dswk2e_z.js +0 -1511
  90. package/dist/StoreRewards-CNUhG_Ue.js +0 -401
  91. package/dist/Transaction-BB-kk-84.js +0 -39
  92. package/dist/Voucher-b1_Jlm6X.js +0 -490
  93. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
  94. package/dist/app-DCHKJoql.js +0 -5639
  95. package/dist/dto-jcK3TGB7.js +0 -2770
  96. package/dist/index-Cv7pLAYq.js +0 -3
  97. package/dist/index-LrSSauN2.js +0 -29193
  98. package/dist/money-BEATdGS6.js +0 -15
  99. package/dist/number-CeAYAKCp.js +0 -12
  100. package/dist/vue-i18n-BRhKDHdF.js +0 -2365
  101. package/dist/zod-Bg2FbC-D.js +0 -90
@@ -0,0 +1,220 @@
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-KNmEMBUB.js";
5
+ import { u as W } from "./business-BSo7EPan.js";
6
+ import { u as X } from "./campaign-CsOje3Ap.js";
7
+ import { g as V, b as L } from "./dto-CfEXSCq6.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-we7ADwFk.js";
10
+ import { u as ee } from "./template-CFAIPoD7.js";
11
+ import { c as _ } from "./index-Boo5np6l.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
+ };
@@ -0,0 +1,244 @@
1
+ import { defineComponent as E, ref as P, computed as H, onMounted as q, resolveComponent as i, openBlock as c, createElementBlock as g, Fragment as _, createVNode as s, unref as l, createElementVNode as a, withCtx as h, renderList as z, createBlock as w, resolveDynamicComponent as G, toDisplayString as k, h as J } from "vue";
2
+ import { _ as Q } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as W, components as X } from "@feedmepos/ui-library";
4
+ import { c as S, u as Y, p as O } from "./loading-KNmEMBUB.js";
5
+ import { u as Z } from "./business-BSo7EPan.js";
6
+ import { u as ee } from "./campaign-CsOje3Ap.js";
7
+ import { g as L } from "./dto-CfEXSCq6.js";
8
+ import { e as V } from "./effect-Bn_ofYS3.js";
9
+ import { _ as oe } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
10
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js";
11
+ import { u as ae } from "./template-CFAIPoD7.js";
12
+ import { c as u } from "./index-Boo5np6l.js";
13
+ const ne = { class: "px-24 flex flex-col gap-y-16" }, se = { class: "flex items-center justify-between w-full" }, le = { class: "flex gap-8 overflow-x-auto" }, ie = { class: "space-y-8" }, re = { class: "flex w-full gap-4 items-center" }, 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" }, ue = /* @__PURE__ */ a("img", {
14
+ src: Q,
15
+ class: "aspect-square w-[150px]"
16
+ }, null, -1), pe = /* @__PURE__ */ a("div", { class: "flex flex-col gap-16 text-center" }, [
17
+ /* @__PURE__ */ a("div", { class: "fm-typo-en-title-sm-800" }, "Create promotion campaign"),
18
+ /* @__PURE__ */ a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Special offers or deals made available for a limited time to encourage user engagement and purchases. Promotions are generally available to all eligible users without the need for a specific code and are applied by merchant during the promotional period. ")
19
+ ], -1), Se = /* @__PURE__ */ E({
20
+ __name: "Promotion",
21
+ setup(fe) {
22
+ const I = {
23
+ label: "Create campaign",
24
+ value: "create",
25
+ isPrimary: !0,
26
+ prependIcon: "add"
27
+ }, T = {
28
+ label: "Force sync",
29
+ value: "sync",
30
+ isPrimary: !1,
31
+ prependIcon: "refresh"
32
+ }, $ = ae("PROMOTION", W()), v = Z(), p = ee(), { global: R, minor: y } = Y, n = P({
33
+ searchKey: "",
34
+ location: null
35
+ }), r = H(
36
+ () => p.campaigns.promotion.filter(
37
+ (e) => !n.value.location || !e.targetLocation || e.targetLocation.includes(n.value.location)
38
+ )
39
+ ), B = [
40
+ {
41
+ header: "Promotion title",
42
+ accessorFn: (e) => e.name
43
+ },
44
+ {
45
+ header: "Status",
46
+ cell(e) {
47
+ return L(e.row.original);
48
+ }
49
+ },
50
+ {
51
+ header: "Type",
52
+ accessorFn: (e) => `${S.title(e.effect.options.target)} promotion`
53
+ },
54
+ {
55
+ header: "Summary",
56
+ accessorFn: (e) => V(e.effect)
57
+ },
58
+ {
59
+ header: "Actions",
60
+ cell(e) {
61
+ return J(X.FmButton, {
62
+ variant: "tertiary",
63
+ icon: "delete",
64
+ iconColor: "neutral-gray-400",
65
+ onClick: (t) => {
66
+ t.stopPropagation(), x(e.row.original);
67
+ }
68
+ });
69
+ }
70
+ }
71
+ ], b = P();
72
+ async function x(e) {
73
+ await O.remove(`Are you sure you want to remove ${e.name}?`) && await y(
74
+ async () => {
75
+ await u.delete(e._id), await p.read("PROMOTION");
76
+ },
77
+ {
78
+ message: `Removing ${e.name}`,
79
+ successMessage: `Removed ${e.name} successfully`
80
+ }
81
+ );
82
+ }
83
+ async function f(e) {
84
+ e ? await t() : $.open(async (m) => {
85
+ await t(m);
86
+ });
87
+ async function t(m) {
88
+ var d;
89
+ (d = b.value) == null || d.showSheet(
90
+ !0,
91
+ "PROMOTION",
92
+ e ? await u.readById(e._id) : void 0,
93
+ m
94
+ );
95
+ }
96
+ }
97
+ async function M(e) {
98
+ await y(
99
+ async () => {
100
+ e.campaign._id ? await u.update(e.campaign._id, e) : await u.create(e), await p.read("PROMOTION");
101
+ },
102
+ {
103
+ message: `${e.campaign._id ? "Updating" : "Creating"} promotion`,
104
+ successMessage: `Promotion ${e.campaign._id ? "updated" : "created"} successfully`
105
+ }
106
+ );
107
+ }
108
+ async function A(e) {
109
+ switch (e) {
110
+ case "create":
111
+ f();
112
+ break;
113
+ case "sync":
114
+ await O.confirm(
115
+ "Are you sure you want to synchronize all promotions to POS?",
116
+ "Force sync"
117
+ ) && y(
118
+ async () => {
119
+ await u.syncAllPromotion();
120
+ },
121
+ {
122
+ message: "Syncing promotions...",
123
+ successMessage: "All promotions synced"
124
+ }
125
+ );
126
+ break;
127
+ }
128
+ }
129
+ return q(async () => {
130
+ await R(async () => {
131
+ await v.readLocations(), await p.read("PROMOTION");
132
+ });
133
+ }), (e, t) => {
134
+ const m = i("FmPageHead"), d = i("FmSearch"), K = i("FmTable"), N = i("FmChip"), C = i("FmButton"), U = i("FmListItem"), D = i("FmList"), j = i("FmCard");
135
+ return c(), g(_, null, [
136
+ s(m, {
137
+ title: "Promotion",
138
+ actions: l(r).length > 0 ? [I, T] : [],
139
+ "onClick:action": A
140
+ }, null, 8, ["actions"]),
141
+ a("div", ne, [
142
+ s(d, {
143
+ modelValue: n.value.searchKey,
144
+ "onUpdate:modelValue": t[0] || (t[0] = (o) => n.value.searchKey = o),
145
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
146
+ placeholder: "search",
147
+ collapsible: ""
148
+ }, null, 8, ["modelValue"]),
149
+ l(r) && l(r).length > 0 ? (c(), g(_, { key: 0 }, [
150
+ a("div", se, [
151
+ a("div", le, [
152
+ s(oe, {
153
+ modelValue: n.value.location,
154
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => n.value.location = o),
155
+ label: "Location: ",
156
+ "show-item-label": !0,
157
+ icon: "storefront",
158
+ placement: "bottom-start",
159
+ items: l(v).locationItems
160
+ }, null, 8, ["modelValue", "items"])
161
+ ]),
162
+ s(d, {
163
+ modelValue: n.value.searchKey,
164
+ "onUpdate:modelValue": t[2] || (t[2] = (o) => n.value.searchKey = o),
165
+ class: "xs:hidden",
166
+ placeholder: "search",
167
+ collapsible: ""
168
+ }, null, 8, ["modelValue"])
169
+ ]),
170
+ s(K, {
171
+ class: "xs:hidden",
172
+ "row-data": l(r),
173
+ "column-defs": B,
174
+ "search-value": n.value.searchKey,
175
+ "column-filter": [],
176
+ onRowClick: t[3] || (t[3] = (o) => f(o.original)),
177
+ "hide-footer": l(r).length < 10
178
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
179
+ s(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
180
+ default: h(() => [
181
+ (c(!0), g(_, null, z(l(r).filter(
182
+ (o) => o.name.toLowerCase().includes(n.value.searchKey.toLowerCase())
183
+ ), (o) => (c(), w(U, {
184
+ key: o._id.toString(),
185
+ onClick: (F) => f(o),
186
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
187
+ }, {
188
+ default: h(() => [
189
+ a("div", ie, [
190
+ a("div", re, [
191
+ (c(), w(G(l(L)(o)))),
192
+ s(N, {
193
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
194
+ compact: !0,
195
+ label: `${l(S).title(o.effect.options.target)} promotion`
196
+ }, null, 8, ["label"])
197
+ ]),
198
+ a("div", ce, [
199
+ a("div", me, k(o.name), 1),
200
+ a("div", de, k(l(V)(o.effect)), 1)
201
+ ])
202
+ ]),
203
+ s(C, {
204
+ icon: "delete",
205
+ "icon-color": "neutral-gray-400",
206
+ variant: "tertiary",
207
+ onClick: (F) => (F.stopPropagation(), x(o))
208
+ }, null, 8, ["onClick"])
209
+ ]),
210
+ _: 2
211
+ }, 1032, ["onClick"]))), 128))
212
+ ]),
213
+ _: 1
214
+ })
215
+ ], 64)) : (c(), w(j, {
216
+ key: 1,
217
+ variant: "outlined",
218
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
219
+ }, {
220
+ default: h(() => [
221
+ ue,
222
+ pe,
223
+ s(C, {
224
+ variant: "primary",
225
+ label: "Create promotion campaign",
226
+ icon: "add",
227
+ onClick: t[4] || (t[4] = (o) => f())
228
+ })
229
+ ]),
230
+ _: 1
231
+ }))
232
+ ]),
233
+ s(te, {
234
+ ref_key: "sheetRef",
235
+ ref: b,
236
+ "onSubmit:modelValue": M
237
+ }, null, 512)
238
+ ], 64);
239
+ };
240
+ }
241
+ });
242
+ export {
243
+ Se as default
244
+ };