@feedmepos/mf-connect 0.1.0-beta.8 → 0.1.0-beta.81

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 (127) hide show
  1. package/dist/Analytic-C9JWdPcg.js +761 -0
  2. package/dist/{App-SRz4257n.js → App-BVEfQEjU.js} +441 -420
  3. package/dist/AuditLogs-qbqxB_Oz.js +1887 -0
  4. package/dist/Bin-DPfStHeL.js +166 -0
  5. package/dist/{Broadcast-DmkrJGp2.js → Broadcast-CrQZDeiZ.js} +56 -54
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CZXSxA9u.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fpcw9NWs.js} +14 -10
  7. package/dist/Card-d7rnO53X.js +905 -0
  8. package/dist/Collections-5rEy2lvX.js +464 -0
  9. package/dist/{Credit-CcNrq9qk.js → Credit-CHyEsV7R.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-CLqubY_R.js +2182 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BIZDiLns.js → EffectSheet.vue_vue_type_style_index_0_lang-DEmIYpS6.js} +49 -49
  14. package/dist/{Experience-DNsQLzDH.js → Experience-DhDLyUFN.js} +32 -30
  15. package/dist/FileSaver.min-NlMItPOc.js +74 -0
  16. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js +118 -0
  17. package/dist/Game-CoOZBnN-.js +278 -0
  18. package/dist/Index-BxzvptzX.js +259 -0
  19. package/dist/Marketing-CwxJ5Upf.js +20071 -0
  20. package/dist/Member-D1SRjLZd.js +287 -0
  21. package/dist/MemberList-C-8mcfuk.js +1606 -0
  22. package/dist/MemberTransactions-C7uwJdn8.js +45 -0
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-GCEQCVOt.js → MessageInput.vue_vue_type_script_setup_true_lang-ChQ3zuj7.js} +152 -137
  24. package/dist/Mission-CtF_zohU.js +296 -0
  25. package/dist/Overview-g9HqRUmv.js +1079 -0
  26. package/dist/{Point-Ck8EG_3k.js → Point-BrifiJTO.js} +55 -53
  27. package/dist/Promotion-D-VpO9Y1.js +289 -0
  28. package/dist/Queue-V6tLLO52.js +260 -0
  29. package/dist/Record-C_eSy9Pl.js +341 -0
  30. package/dist/Reward-BcS5W2o6.js +442 -0
  31. package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-B_g46hrr.js +150 -0
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CFvxrx8L.js +1728 -0
  33. package/dist/Segment-B7JtvneQ.js +880 -0
  34. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-BX-E0sDn.js +181 -0
  35. package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-DPByAnL2.js +188 -0
  36. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DE7ROhd5.js +147 -0
  37. package/dist/Setting-1KOQwRHn.js +1932 -0
  38. package/dist/Store-Dj84K8ZK.js +1842 -0
  39. package/dist/StoreRewards-7rXn3J0B.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-D7zdyg9d.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrzmjYmU.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-D6T7vFXj.js} +1 -1
  42. package/dist/{Tier-CJ9-d8Zg.js → Tier-CwS_A8F5.js} +350 -334
  43. package/dist/{Title-DZCpvg4q.js → Title-YAj_vykl.js} +245 -222
  44. package/dist/{Transaction-DpnTxlbf.js → Transaction-CvbHHpIT.js} +2 -2
  45. package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-CYXM679D.js +130 -0
  46. package/dist/Voucher-C0V9koK8.js +354 -0
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DwfF_8uQ.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-SukfoJpU.js → ZodTextField.vue_vue_type_script_setup_true_lang-D3mmtmvI.js} +1 -1
  49. package/dist/{app-DzAexOqx.js → app-D5BiHqr1.js} +2712 -1266
  50. package/dist/app-TANcLG-R.js +33357 -0
  51. package/dist/app.js +1 -1
  52. package/dist/business-DxNWLRXa.js +79 -0
  53. package/dist/{campaign-winsqufa.js → campaign-DhEbMRyc.js} +2 -2
  54. package/dist/campaign-DqFW5qoE.js +1810 -0
  55. package/dist/campaign.enum-DGpeHkL2.js +20 -0
  56. package/dist/campaign.fn-BqP9eKCL.js +758 -0
  57. package/dist/collectible.enum-CSFqER3H.js +19 -0
  58. package/dist/{collection.fn-CI5Llblg.js → collection.fn-CA112Q3U.js} +2 -2
  59. package/dist/dto-UeacqOxr.js +214 -0
  60. package/dist/{effect-CdkrIYgX.js → effect-CEB8v8KY.js} +33 -16
  61. package/dist/email-addresses-DLDeL77c.js +705 -0
  62. package/dist/{export-DGxfief1.js → export-B_8_zEGl.js} +5 -5
  63. package/dist/{helper-B8RqcTNu.js → helper-BN4JZQLv.js} +1 -1
  64. package/dist/index-B-O8sm9u.js +54 -0
  65. package/dist/index-B-WW-LtM.js +56 -0
  66. package/dist/index-BOQonmqm.js +32 -0
  67. package/dist/{index-9w43_U1v.js → index-CboHpXNN.js} +1506 -1480
  68. package/dist/{index-A34xEz20.js → index-CjJOf_Ko.js} +2246 -871
  69. package/dist/index-CsU66Lo8.js +115 -0
  70. package/dist/index-CsaQJMAR.js +66 -0
  71. package/dist/index-Csb4GQq-.js +29556 -0
  72. package/dist/{index-wzdbEEcZ.js → index-Cv54KpqR.js} +1 -1
  73. package/dist/{index-Cw_aXFH6.js → index-D-9zLobO.js} +269 -173
  74. package/dist/{index-HZC9LLAX.js → index-DLEuoM6n.js} +48 -4
  75. package/dist/{index-CZgQVRsm.js → index-DX1pCi2M.js} +1 -1
  76. package/dist/{index-OzicErwL.js → index-Dtvx0B0f.js} +24 -21
  77. package/dist/index-vh86FiIQ.js +10 -0
  78. package/dist/{loading-DuEFUCwF.js → index-wwxalEHE.js} +4609 -4886
  79. package/dist/{index.esm2017-CppSMh_U.js → index.esm2017-B8lg2TL9.js} +206 -206
  80. package/dist/loading-C7yV_Gjh.js +71 -0
  81. package/dist/{membership-nsMtWeTC.js → membership-DVqBNqdx.js} +80 -66
  82. package/dist/money-DlG5z_tl.js +15 -0
  83. package/dist/number-CEbwCzov.js +12 -0
  84. package/dist/objectid-Du3yg6Vv.js +145 -0
  85. package/dist/plugins-D_RKZlC6.js +208 -0
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/reward-Bv14VitO.js +36 -0
  88. package/dist/{rule-CPIMqt1h.js → rule-BR5ZUIKH.js} +185 -178
  89. package/dist/{rule-builder-CSs5XRKP.js → rule-builder-CITle0qo.js} +1 -1
  90. package/dist/style.css +1 -1
  91. package/dist/{template-CJZoYavu.js → template-ybPO7TWN.js} +5 -5
  92. package/dist/trigger-5C6n0ORq.js +144 -0
  93. package/dist/user-CP3tloTS.js +54 -0
  94. package/dist/vue-i18n-DGew8_SZ.js +2365 -0
  95. package/dist/{xlsx-BZlnYinX.js → xlsx-CsBnmxHp.js} +1 -1
  96. package/package.json +11 -7
  97. package/dist/Analytic-5QztrYSp.js +0 -622
  98. package/dist/Card-BsjFTVsH.js +0 -825
  99. package/dist/Collections-7wqZHOax.js +0 -453
  100. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cuklmxur.js +0 -2813
  101. package/dist/Game-DlzDerT7.js +0 -255
  102. package/dist/Marketing-BqhpaG4o.js +0 -316
  103. package/dist/Member-AFgZcdtz.js +0 -69
  104. package/dist/MemberList-BKgrLz2C.js +0 -1733
  105. package/dist/MemberTransactions-BwT3zE2a.js +0 -38
  106. package/dist/Mission-BTAia7AS.js +0 -261
  107. package/dist/Promotion-0v3kvsK3.js +0 -247
  108. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BkFm7tXq.js +0 -1753
  109. package/dist/Segment-BenLupqV.js +0 -437
  110. package/dist/Setting-0fpREqpJ.js +0 -1901
  111. package/dist/Store-BDGwe4ar.js +0 -1511
  112. package/dist/StoreRewards-TDZt9H1V.js +0 -401
  113. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BqpsMcl1.js +0 -890
  114. package/dist/Voucher-DsP_rh8I.js +0 -490
  115. package/dist/app-Cg2pTZJK.js +0 -53428
  116. package/dist/business-Cw_qGw8y.js +0 -78
  117. package/dist/dto-ozu1smC3.js +0 -2770
  118. package/dist/index-BLACZ3-L.js +0 -206
  119. package/dist/index-BaozRfWB.js +0 -762
  120. package/dist/index-CjVmULNd.js +0 -99
  121. package/dist/index-CuvNtC_M.js +0 -61
  122. package/dist/index-DAEmawcj.js +0 -298
  123. package/dist/index-Oxr-mU6h.js +0 -29193
  124. package/dist/money-BGZPFtUc.js +0 -15
  125. package/dist/number-4J0xvXP9.js +0 -12
  126. package/dist/user-Bm4KttFq.js +0 -37
  127. package/dist/vue-i18n-CCyiVzOE.js +0 -2365
@@ -1,26 +1,27 @@
1
- import { defineComponent as j, ref as V, computed as A, h as E, onMounted as M, resolveComponent as l, openBlock as d, createElementBlock as h, Fragment as b, createVNode as r, unref as t, withCtx as g, createElementVNode as n, toDisplayString as c, renderList as H, createBlock as w, resolveDynamicComponent as q } from "vue";
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
2
  import { _ as z } from "./campaign-CpzFl8Vr.js";
3
3
  import { useDialog as G, components as J } from "@feedmepos/ui-library";
4
- import { p as Q, u as W } from "./loading-DuEFUCwF.js";
5
- import { u as X } from "./business-Cw_qGw8y.js";
6
- import { u as Y } from "./campaign-winsqufa.js";
7
- import { g as I, b as P } from "./dto-ozu1smC3.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-Cuklmxur.js";
10
- import { u as te } from "./template-CJZoYavu.js";
11
- import { u as oe } from "./vue-i18n-CCyiVzOE.js";
12
- import { c as _ } from "./index-CjVmULNd.js";
13
- const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, se = { class: "px-24 flex flex-col gap-y-16" }, ie = { class: "flex items-center justify-between w-full" }, re = { class: "flex gap-8 overflow-x-auto" }, le = { class: "space-y-8" }, ce = { class: "flex w-full gap-4 items-center" }, me = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, de = { class: "space-y-4" }, pe = { class: "fm-typo-en-body-lg-600" }, ue = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-16 text-center" }, ge = { class: "fm-typo-en-title-sm-800" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = /* @__PURE__ */ j({
4
+ import { p as Q } from "./plugins-D_RKZlC6.js";
5
+ import { u as W } from "./loading-C7yV_Gjh.js";
6
+ import { u as X } from "./business-DxNWLRXa.js";
7
+ import { u as Y } from "./campaign-DhEbMRyc.js";
8
+ import { g as Z, a as V, b as I } from "./campaign-DqFW5qoE.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-CLqubY_R.js";
11
+ import { u as oe } from "./template-ybPO7TWN.js";
12
+ import { u as ae } from "./vue-i18n-DGew8_SZ.js";
13
+ import { c as _ } from "./index-CsU66Lo8.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({
14
15
  __name: "Point",
15
- setup(he) {
16
- const { t: s } = oe(), B = {
16
+ setup(be) {
17
+ const { t: s } = ae(), B = {
17
18
  label: s("connect.program.common.actions.create", {
18
19
  type: s("connect.program.point.title").toLowerCase()
19
20
  }),
20
21
  value: "create",
21
22
  isPrimary: !0,
22
23
  prependIcon: "add"
23
- }, $ = te("COIN", G()), x = X(), m = Y(), { global: K, minor: C } = W, i = V({
24
+ }, $ = oe("COIN", G()), h = X(), m = Y(), { global: K, minor: x } = W, i = P({
24
25
  searchKey: "",
25
26
  location: null
26
27
  }), u = A(
@@ -34,13 +35,14 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
34
35
  },
35
36
  {
36
37
  header: s("connect.program.common.table.status"),
38
+ accessorFn: (e) => Z(e),
37
39
  cell(e) {
38
- return I(e.row.original);
40
+ return V(e.row.original);
39
41
  }
40
42
  },
41
43
  {
42
44
  header: s("connect.program.common.table.summary"),
43
- accessorFn: (e) => P(e)
45
+ accessorFn: (e) => I(e)
44
46
  },
45
47
  {
46
48
  header: s("connect.program.common.table.actions"),
@@ -55,9 +57,9 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
55
57
  });
56
58
  }
57
59
  }
58
- ], v = V();
60
+ ], v = P();
59
61
  async function F(e) {
60
- await Q.remove(`Are you sure you want to remove ${e.name}?`) && await C(
62
+ await Q.remove(`Are you sure you want to remove ${e.name}?`) && await x(
61
63
  async () => {
62
64
  await _.delete(e._id), await m.read("COIN");
63
65
  },
@@ -72,8 +74,8 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
72
74
  await o(p);
73
75
  });
74
76
  async function o(p) {
75
- var y;
76
- (y = v.value) == null || y.showSheet(
77
+ var g;
78
+ (g = v.value) == null || g.showSheet(
77
79
  !0,
78
80
  "COIN",
79
81
  e ? await _.readById(e._id) : void 0,
@@ -82,7 +84,7 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
82
84
  }
83
85
  }
84
86
  async function R(e) {
85
- await C(
87
+ await x(
86
88
  async () => {
87
89
  e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await m.read("COIN");
88
90
  },
@@ -97,22 +99,22 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
97
99
  await m.read("COIN");
98
100
  });
99
101
  }), (e, o) => {
100
- const p = l("FmPill"), y = l("FmPageHead"), k = l("FmSearch"), O = l("FmTable"), S = l("FmButton"), U = l("FmListItem"), D = l("FmList"), T = l("FmCard");
101
- return d(), h(b, null, [
102
- r(y, {
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, {
103
105
  title: t(s)("connect.program.point.title"),
104
- actions: t(u).length > 0 ? [B] : [],
106
+ actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
105
107
  "onClick:action": o[0] || (o[0] = () => f())
106
108
  }, {
107
- title: g(() => [
108
- n("div", ae, [
109
- n("span", ne, c(t(s)("connect.program.point.title")), 1),
109
+ title: y(() => [
110
+ n("div", ne, [
111
+ n("span", se, c(t(s)("connect.program.point.title")), 1),
110
112
  r(p, { variant: "premium" })
111
113
  ])
112
114
  ]),
113
115
  _: 1
114
116
  }, 8, ["title", "actions"]),
115
- n("div", se, [
117
+ n("div", ie, [
116
118
  r(k, {
117
119
  modelValue: t(i).searchKey,
118
120
  "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
@@ -120,17 +122,17 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
120
122
  placeholder: "search",
121
123
  collapsible: ""
122
124
  }, null, 8, ["modelValue"]),
123
- t(m).campaigns.point && t(m).campaigns.point.length > 0 ? (d(), h(b, { key: 0 }, [
124
- n("div", ie, [
125
- n("div", re, [
126
- r(Z, {
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, {
127
129
  modelValue: t(i).location,
128
130
  "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
129
131
  label: "Location: ",
130
132
  "show-item-label": !0,
131
133
  icon: "storefront",
132
134
  placement: "bottom-start",
133
- items: t(x).locationItems
135
+ items: t(h).locationItems
134
136
  }, null, 8, ["modelValue", "items"])
135
137
  ]),
136
138
  r(k, {
@@ -151,25 +153,25 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
151
153
  "hide-footer": t(u).length < 10
152
154
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
153
155
  r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
154
- default: g(() => [
155
- (d(!0), h(b, null, H(t(u).filter(
156
+ default: y(() => [
157
+ (d(!0), b(w, null, H(t(u).filter(
156
158
  (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
157
- ), (a) => (d(), w(U, {
159
+ ), (a) => (d(), C(U, {
158
160
  key: a._id.toString(),
159
161
  onClick: (L) => f(a),
160
162
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
161
163
  }, {
162
- default: g(() => [
163
- n("div", le, [
164
- n("div", ce, [
165
- (d(), w(q(t(I)(a)))),
166
- n("div", me, c(t(s)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
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)("program.point.used", { count: a.currentReceive ?? 0 })), 1)
167
169
  ]),
168
- n("div", de, [
169
- n("div", pe, c(a.name), 1),
170
- n("div", ue, c(t(P)(a)), 1)
170
+ n("div", pe, [
171
+ n("div", ue, c(a.name), 1),
172
+ n("div", fe, c(t(I)(a)), 1)
171
173
  ]),
172
- n("div", fe, " Point received: " + c(a.currentReceive ?? 0), 1)
174
+ n("div", ge, " Point received: " + c(a.currentReceive ?? 0), 1)
173
175
  ]),
174
176
  r(S, {
175
177
  icon: "delete",
@@ -183,31 +185,31 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
183
185
  ]),
184
186
  _: 1
185
187
  })
186
- ], 64)) : (d(), w(T, {
188
+ ], 64)) : (d(), C(T, {
187
189
  key: 1,
188
190
  variant: "outlined",
189
191
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
190
192
  }, {
191
- default: g(() => [
193
+ default: y(() => [
192
194
  o[6] || (o[6] = n("img", {
193
195
  src: z,
194
196
  class: "aspect-square w-[150px]"
195
197
  }, null, -1)),
196
198
  n("div", ye, [
197
- n("div", ge, c(t(s)("connect.program.point.empty_state.title")), 1),
198
- n("div", _e, c(t(s)("connect.program.point.empty_state.description")), 1)
199
+ n("div", _e, c(t(s)("connect.program.point.empty_state.title")), 1),
200
+ n("div", he, c(t(s)("connect.program.point.empty_state.description")), 1)
199
201
  ]),
200
202
  r(S, {
201
203
  variant: "primary",
202
204
  label: "Create point program",
203
- disabled: !t(x).isPremium,
205
+ disabled: !t(h).isPremium,
204
206
  icon: "add",
205
207
  onClick: o[5] || (o[5] = (a) => f())
206
208
  }, null, 8, ["disabled"])
207
209
  ]),
208
210
  _: 1
209
211
  })),
210
- r(ee, {
212
+ r(te, {
211
213
  ref_key: "sheetRef",
212
214
  ref: v,
213
215
  "onSubmit:modelValue": R
@@ -218,5 +220,5 @@ const ae = { class: "flex items-center" }, ne = { class: "fm-typo-en-title-md-60
218
220
  }
219
221
  });
220
222
  export {
221
- Be as default
223
+ Ke as default
222
224
  };
@@ -0,0 +1,289 @@
1
+ import { defineComponent as J, ref as S, computed as Q, h as W, onMounted as X, resolveComponent as m, openBlock as u, createElementBlock as w, Fragment as v, createVNode as l, unref as a, createElementVNode as r, withCtx as b, renderList as Y, createBlock as x, resolveDynamicComponent as Z, toDisplayString as _ } from "vue";
2
+ import { _ as ee } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as oe, components as te } from "@feedmepos/ui-library";
4
+ import { c as O, p as L } from "./plugins-D_RKZlC6.js";
5
+ import { u as ne } from "./loading-C7yV_Gjh.js";
6
+ import { u as ae } from "./business-DxNWLRXa.js";
7
+ import { u as se } from "./campaign-DhEbMRyc.js";
8
+ import { u as re } from "./vue-i18n-DGew8_SZ.js";
9
+ import { g as ie, a as V } from "./campaign-DqFW5qoE.js";
10
+ import { e as I } from "./effect-CEB8v8KY.js";
11
+ import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-CLqubY_R.js";
12
+ import { u as ce } from "./template-ybPO7TWN.js";
13
+ import { _ as B } from "./FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js";
14
+ import { c as d } from "./index-CsU66Lo8.js";
15
+ const me = { class: "px-24 flex flex-col gap-y-16" }, pe = { class: "flex items-center justify-between w-full" }, ue = { class: "flex gap-8 overflow-x-auto" }, de = { class: "space-y-8" }, fe = { class: "flex w-full gap-4 items-center" }, ye = { class: "space-y-4" }, ge = { class: "fm-typo-en-body-lg-600" }, _e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, he = { class: "flex flex-col gap-16 text-center" }, we = { class: "fm-typo-en-title-sm-800" }, ve = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ae = /* @__PURE__ */ J({
16
+ __name: "Promotion",
17
+ setup(be) {
18
+ const { t: n } = re(), M = {
19
+ label: n("connect.promotion.createCampaign"),
20
+ value: "create",
21
+ isPrimary: !0,
22
+ prependIcon: "add"
23
+ }, R = {
24
+ label: "Force sync",
25
+ value: "sync",
26
+ isPrimary: !1,
27
+ prependIcon: "refresh"
28
+ }, A = ce("PROMOTION", oe()), C = ae(), f = se(), { global: K, minor: h } = ne, N = [
29
+ {
30
+ label: "Bill promotion",
31
+ value: "BILL"
32
+ },
33
+ {
34
+ label: "Item promotion",
35
+ value: "ITEM"
36
+ }
37
+ ], s = S({
38
+ searchKey: "",
39
+ location: [],
40
+ effectType: []
41
+ });
42
+ function $(e) {
43
+ const o = s.value.location;
44
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((c) => {
45
+ var i;
46
+ return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(c);
47
+ }) : e.targetLocation.includes(o);
48
+ }
49
+ function U(e) {
50
+ var i, g;
51
+ const o = s.value.effectType;
52
+ if (!o || o.length === 0) return !0;
53
+ const c = (g = (i = e.effect) == null ? void 0 : i.options) == null ? void 0 : g.target;
54
+ return o.includes(c);
55
+ }
56
+ const p = Q(
57
+ () => f.campaigns.promotion.filter(
58
+ (e) => $(e) && U(e)
59
+ )
60
+ ), D = [
61
+ {
62
+ header: n("connect.promotion.promotionTitle"),
63
+ accessorFn: (e) => e.name
64
+ },
65
+ {
66
+ header: n("connect.promotion.status"),
67
+ accessorFn: (e) => ie(e),
68
+ cell(e) {
69
+ return V(e.row.original);
70
+ }
71
+ },
72
+ {
73
+ header: n("connect.promotion.type"),
74
+ accessorFn: (e) => `${O.title(e.effect.options.target)} promotion`
75
+ },
76
+ {
77
+ header: n("connect.promotion.summary"),
78
+ accessorFn: (e) => I(e.effect)
79
+ },
80
+ {
81
+ header: n("connect.promotion.actions"),
82
+ cell(e) {
83
+ return W(te.FmButton, {
84
+ variant: "tertiary",
85
+ icon: "delete",
86
+ iconColor: "neutral-gray-400",
87
+ onClick: (o) => {
88
+ o.stopPropagation(), k(e.row.original);
89
+ }
90
+ });
91
+ }
92
+ }
93
+ ], F = S();
94
+ async function k(e) {
95
+ await L.remove(
96
+ n("connect.promotion.confirmRemove", { name: e.name })
97
+ ) && await h(
98
+ async () => {
99
+ await d.delete(e._id), await f.read("PROMOTION");
100
+ },
101
+ {
102
+ message: n("connect.promotion.removing", { name: e.name }),
103
+ successMessage: n("connect.promotion.removedSuccessfully", {
104
+ name: e.name
105
+ })
106
+ }
107
+ );
108
+ }
109
+ async function y(e) {
110
+ e ? await o() : A.open(async (c) => {
111
+ await o(c);
112
+ });
113
+ async function o(c) {
114
+ var i;
115
+ (i = F.value) == null || i.showSheet(
116
+ !0,
117
+ "PROMOTION",
118
+ e ? await d.readById(e._id) : void 0,
119
+ c
120
+ );
121
+ }
122
+ }
123
+ async function E(e) {
124
+ await h(
125
+ async () => {
126
+ e.campaign._id ? await d.update(e.campaign._id, e) : await d.create(e), await f.read("PROMOTION");
127
+ },
128
+ {
129
+ message: n(
130
+ e.campaign._id ? "connect.promotion.updating" : "connect.promotion.creating"
131
+ ),
132
+ successMessage: n(
133
+ e.campaign._id ? "connect.promotion.updatedSuccessfully" : "connect.promotion.createdSuccessfully"
134
+ )
135
+ }
136
+ );
137
+ }
138
+ async function j(e) {
139
+ switch (e) {
140
+ case "create":
141
+ y();
142
+ break;
143
+ case "sync":
144
+ await L.confirm(
145
+ "Are you sure you want to synchronize all promotions to POS?",
146
+ "Force sync"
147
+ ) && h(
148
+ async () => {
149
+ await d.syncAllPromotion();
150
+ },
151
+ {
152
+ message: "Syncing promotions...",
153
+ successMessage: "All promotions synced"
154
+ }
155
+ );
156
+ break;
157
+ }
158
+ }
159
+ return X(async () => {
160
+ await K(async () => {
161
+ await C.readLocations(), await f.read("PROMOTION");
162
+ });
163
+ }), (e, o) => {
164
+ const c = m("FmPageHead"), i = m("FmSearch"), g = m("FmTable"), H = m("FmChip"), T = m("FmButton"), q = m("FmListItem"), z = m("FmList"), G = m("FmCard");
165
+ return u(), w(v, null, [
166
+ l(c, {
167
+ title: a(n)("connect.promotion.title"),
168
+ actions: a(p).length > 0 ? [M, R] : [],
169
+ "onClick:action": j
170
+ }, null, 8, ["title", "actions"]),
171
+ r("div", me, [
172
+ l(i, {
173
+ modelValue: s.value.searchKey,
174
+ "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value.searchKey = t),
175
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
176
+ placeholder: a(n)("connect.promotion.search"),
177
+ collapsible: ""
178
+ }, null, 8, ["modelValue", "placeholder"]),
179
+ a(p) && a(p).length > 0 ? (u(), w(v, { key: 0 }, [
180
+ r("div", pe, [
181
+ r("div", ue, [
182
+ l(B, {
183
+ label: `${a(n)("connect.common.location")}: `,
184
+ "right-icon": "keyboard_arrow_down",
185
+ modelValue: s.value.location,
186
+ "onUpdate:modelValue": o[1] || (o[1] = (t) => s.value.location = t),
187
+ icon: "storefront",
188
+ "show-item-label": !0,
189
+ items: a(C).locationOptions
190
+ }, null, 8, ["label", "modelValue", "items"]),
191
+ l(B, {
192
+ label: "Type:",
193
+ "right-icon": "keyboard_arrow_down",
194
+ modelValue: s.value.effectType,
195
+ "onUpdate:modelValue": o[2] || (o[2] = (t) => s.value.effectType = t),
196
+ icon: "filter_list",
197
+ "show-item-label": !0,
198
+ items: N
199
+ }, null, 8, ["modelValue"])
200
+ ]),
201
+ l(i, {
202
+ modelValue: s.value.searchKey,
203
+ "onUpdate:modelValue": o[3] || (o[3] = (t) => s.value.searchKey = t),
204
+ class: "xs:hidden",
205
+ placeholder: "search",
206
+ collapsible: ""
207
+ }, null, 8, ["modelValue"])
208
+ ]),
209
+ l(g, {
210
+ class: "xs:hidden",
211
+ "row-data": a(p),
212
+ "column-defs": D,
213
+ "search-value": s.value.searchKey,
214
+ "column-filter": [],
215
+ onRowClick: o[4] || (o[4] = (t) => y(t.original)),
216
+ "hide-footer": a(p).length < 10
217
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
218
+ l(z, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
219
+ default: b(() => [
220
+ (u(!0), w(v, null, Y(a(p).filter(
221
+ (t) => t.name.toLowerCase().includes(s.value.searchKey.toLowerCase())
222
+ ), (t) => (u(), x(q, {
223
+ key: t._id.toString(),
224
+ onClick: (P) => y(t),
225
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
226
+ }, {
227
+ default: b(() => [
228
+ r("div", de, [
229
+ r("div", fe, [
230
+ (u(), x(Z(a(V)(t)))),
231
+ l(H, {
232
+ class: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
233
+ compact: !0,
234
+ label: `${a(O).title(t.effect.options.target)} promotion`
235
+ }, null, 8, ["label"])
236
+ ]),
237
+ r("div", ye, [
238
+ r("div", ge, _(t.name), 1),
239
+ r("div", _e, _(a(I)(t.effect)), 1)
240
+ ])
241
+ ]),
242
+ l(T, {
243
+ icon: "delete",
244
+ "icon-color": "neutral-gray-400",
245
+ variant: "tertiary",
246
+ onClick: (P) => (P.stopPropagation(), k(t))
247
+ }, null, 8, ["onClick"])
248
+ ]),
249
+ _: 2
250
+ }, 1032, ["onClick"]))), 128))
251
+ ]),
252
+ _: 1
253
+ })
254
+ ], 64)) : (u(), x(G, {
255
+ key: 1,
256
+ variant: "outlined",
257
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
258
+ }, {
259
+ default: b(() => [
260
+ o[6] || (o[6] = r("img", {
261
+ src: ee,
262
+ class: "aspect-square w-[150px]"
263
+ }, null, -1)),
264
+ r("div", he, [
265
+ r("div", we, _(a(n)("connect.promotion.createPromotionCampaign")), 1),
266
+ r("div", ve, _(a(n)("connect.promotion.description")), 1)
267
+ ]),
268
+ l(T, {
269
+ variant: "primary",
270
+ label: a(n)("connect.promotion.createPromotionCampaign"),
271
+ icon: "add",
272
+ onClick: o[5] || (o[5] = (t) => y())
273
+ }, null, 8, ["label"])
274
+ ]),
275
+ _: 1
276
+ }))
277
+ ]),
278
+ l(le, {
279
+ ref_key: "sheetRef",
280
+ ref: F,
281
+ "onSubmit:modelValue": E
282
+ }, null, 512)
283
+ ], 64);
284
+ };
285
+ }
286
+ });
287
+ export {
288
+ Ae as default
289
+ };