@feedmepos/mf-connect 0.1.36-prod → 0.1.38-beta.1

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 (113) hide show
  1. package/dist/Analytic-O-qZWrFp.js +761 -0
  2. package/dist/{App-JwvQzmaf.js → App-BWZ2EE71.js} +364 -352
  3. package/dist/AuditLogs-DlmcFEta.js +1887 -0
  4. package/dist/{Bin-Boq091DE.js → Bin-C-Ha-4yF.js} +8 -8
  5. package/dist/{Broadcast-D7BIjPzg.js → Broadcast-Bo3QS8lS.js} +27 -25
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZFe69JWe.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-4vUMzH-l.js} +18 -18
  7. package/dist/{Card-C7v8otBk.js → Card-Bs1TDE0e.js} +159 -159
  8. package/dist/{Collections-C_pyDZJp.js → Collections-Dy5RN7Js.js} +103 -91
  9. package/dist/{Credit-B6I7vIo2.js → Credit-Bqc4dw1s.js} +74 -74
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js +58 -0
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DHQBxqsk.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js} +490 -488
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-cqK2WTuO.js → EffectSheet.vue_vue_type_style_index_0_lang-BzwADnKp.js} +91 -89
  13. package/dist/{Experience-RU6iI7eH.js → Experience-C2e2T7B-.js} +42 -42
  14. package/dist/{FilterChip.vue_vue_type_script_setup_true_lang-BrPLkFX8.js → FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js} +2 -6
  15. package/dist/{Game-B9Ojuamc.js → Game-C86eEhcx.js} +32 -32
  16. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  17. package/dist/{Index-Dv-YN9YC.js → Index-BRGweFco.js} +10 -10
  18. package/dist/Marketing-CnnrnXbS.js +20073 -0
  19. package/dist/{Member-BX81V3ON.js → Member-B3o0Zhcw.js} +76 -76
  20. package/dist/MemberList-BpE1IjED.js +1606 -0
  21. package/dist/MemberOverview-wL_ailso.js +58 -0
  22. package/dist/{MemberTransactions-C0FinB5E.js → MemberTransactions-C4hao-d9.js} +1 -1
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DZS17c8D.js → MessageInput.vue_vue_type_script_setup_true_lang-D9zfmqLs.js} +36 -36
  24. package/dist/{Mission-BV76Qq3Y.js → Mission-BURXfzjd.js} +21 -21
  25. package/dist/{Overview-CMK4VRZl.js → Overview-D_hrrM4O.js} +335 -335
  26. package/dist/{Point-CQWKh1jv.js → Point-CJXkJY5Q.js} +43 -41
  27. package/dist/Promotion-CunJrh42.js +289 -0
  28. package/dist/{Queue-CFNfJSux.js → Queue-v5Itg9J4.js} +52 -52
  29. package/dist/{Record-7_ssnQnB.js → Record-DJe4tg9R.js} +9 -9
  30. package/dist/{Reward-DOe1Tn2f.js → Reward-Y9aHpny5.js} +173 -173
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BsgR-dCL.js → RewardGroup.vue_vue_type_script_setup_true_lang-1KAjCblO.js} +11 -11
  32. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BPw5L06B.js → RuleGroup.vue_vue_type_script_setup_true_lang-Cr99ikbK.js} +635 -548
  33. package/dist/Segment-DVT8uDn8.js +882 -0
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DPsLdEU8.js → SelectItems.vue_vue_type_script_setup_true_lang-BhJ-oVMb.js} +2 -2
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BAJLRxOM.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-b5bjfBvc.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DUUzFkIc.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DoKAgSLE.js} +3 -3
  37. package/dist/{Setting-Bojfmtwf.js → Setting-BU5778gG.js} +432 -432
  38. package/dist/{Store-dfiUtq-f.js → Store-IWg0POAU.js} +211 -211
  39. package/dist/StoreRewards-CIjHcVoh.js +423 -0
  40. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cx05-OPF.js +1029 -0
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D8ey57Te.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BcOvr526.js} +1 -1
  42. package/dist/{Tier-BIDShXJ6.js → Tier-iN30KD7g.js} +107 -107
  43. package/dist/{Title-CDdkVwEu.js → Title-Duh_Srek.js} +133 -131
  44. package/dist/{Transaction-lAUnd1c_.js → Transaction-DLBA7Svl.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BwaD8Nwy.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DLD5d43d.js} +6 -6
  46. package/dist/{Voucher-BARDbixZ.js → Voucher-cTvlMN0Y.js} +153 -123
  47. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DkjojUvD.js +419 -0
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CIk3GKLH.js → ZodTextField.vue_vue_type_script_setup_true_lang-C5S-bi5J.js} +1 -1
  49. package/dist/{app-Cq8zUKBx.js → app-A3oEKLq5.js} +1 -1
  50. package/dist/{app-KtD-iU16.js → app-De-yQ1CJ.js} +164 -125
  51. package/dist/app.js +4 -3
  52. package/dist/business-B2JBpm4y.js +79 -0
  53. package/dist/{campaign-NqTts9bj.js → campaign-Bhur0NJx.js} +9 -9
  54. package/dist/{campaign-DwArKZ1r.js → campaign-vkzui6F2.js} +5 -3
  55. package/dist/{campaign.enum-DQayyk1f.js → campaign.enum-DCYkKGhd.js} +1 -1
  56. package/dist/{campaign.fn-6uf_Z5m1.js → campaign.fn--affTEi5.js} +161 -161
  57. package/dist/{collectible.enum-CgjtJh8V.js → collectible.enum-CLBCnfev.js} +1 -1
  58. package/dist/{collection.fn-DuqcY399.js → collection.fn-bA8q0KYy.js} +2 -2
  59. package/dist/{dto-CQRn2lAW.js → dto-RCcWeYE0.js} +4 -4
  60. package/dist/{effect-B-sUUnjd.js → effect-D7qRfPe_.js} +1 -1
  61. package/dist/{email-addresses-D-kPsNBn.js → email-addresses-a8PqViID.js} +1 -1
  62. package/dist/{export-B28oHptg.js → export-BneqNRn4.js} +3 -3
  63. package/dist/{helper-DuBp_oW-.js → helper-DfvvxOyO.js} +1 -1
  64. package/dist/{index-CCNfzZ5t.js → index-2LpkG8Ye.js} +1 -1
  65. package/dist/{index-C2wsUy05.js → index-4kMeSNTr.js} +11447 -10969
  66. package/dist/{index-BgdUU6Za.js → index-B0T9GDIZ.js} +1 -1
  67. package/dist/{index-CczG_ilB.js → index-BWTvsoH0.js} +1 -1
  68. package/dist/index-CMBPIb8x.js +32260 -0
  69. package/dist/{index-DF4V4vur.js → index-CTKMdxSm.js} +1 -1
  70. package/dist/index-CVAWGMus.js +56 -0
  71. package/dist/index-CbsJ6vMJ.js +31 -0
  72. package/dist/{index-CSWnS__O.js → index-CrFUhsZO.js} +1 -1
  73. package/dist/index-CsaQJMAR.js +66 -0
  74. package/dist/{index-CmOaBe_x.js → index-CtDqXnOp.js} +535 -460
  75. package/dist/{index-CECYN1oL.js → index-D0GnMoag.js} +181 -79
  76. package/dist/{index-BCslSeGm.js → index-DMrIQqFt.js} +1 -1
  77. package/dist/{index-BZYbNzed.js → index-DeXvASjP.js} +3 -3
  78. package/dist/{index-CUdis4Jl.js → index-y-7yUm2e.js} +10 -9
  79. package/dist/{index.esm2017-CVwbgLS0.js → index.esm2017-JtyypweZ.js} +127 -127
  80. package/dist/{loading-C-BSh5_w.js → loading-a-FqrwqI.js} +1 -1
  81. package/dist/{membership-BPpTsVq5.js → membership-CGVtil5J.js} +3 -3
  82. package/dist/{money-BSxQcP_f.js → money-CTc1l_Cq.js} +1 -1
  83. package/dist/{number-p7RPdTQ7.js → number-W3R-0nYP.js} +1 -1
  84. package/dist/objectid-BU0Y8iAN.js +145 -0
  85. package/dist/{plugins-5mIceCPA.js → plugins-D2sSgTSl.js} +2 -2
  86. package/dist/remy-vue-client-Cpppk9h-.js +1693 -0
  87. package/dist/{reward-CaZY5kqg.js → reward-atP8vnNn.js} +1 -1
  88. package/dist/{rule-builder-yn_upY7a.js → rule-builder-BB29ZJ_C.js} +17 -17
  89. package/dist/{rule-DB6XK-iD.js → rule-eA5IvnjB.js} +3 -3
  90. package/dist/style.css +1 -1
  91. package/dist/{template-DbmV0nWD.js → template-DhBeDaAm.js} +64 -64
  92. package/dist/{trigger-DPl3HG2o.js → trigger-Bq_pZj1J.js} +7 -7
  93. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  94. package/dist/{user-DzwHXhvX.js → user-B-bhVFIG.js} +1 -1
  95. package/dist/{vue-i18n-BnN9jlFK.js → vue-i18n-D-h8VDSx.js} +343 -343
  96. package/dist/{xlsx-CrsYUgcS.js → xlsx-DsByAcZl.js} +226 -226
  97. package/package.json +5 -3
  98. package/dist/Analytic-C1LCniPD.js +0 -427
  99. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  100. package/dist/Marketing-CFgCJV0g.js +0 -317
  101. package/dist/MemberList-BjX8ND1p.js +0 -1606
  102. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  103. package/dist/Promotion-CnFaEvhL.js +0 -255
  104. package/dist/Segment-DUP0JWK5.js +0 -882
  105. package/dist/StoreRewards-DJj-oM2n.js +0 -423
  106. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-oRUpDbZ_.js +0 -995
  107. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-bDQs5ACo.js +0 -419
  108. package/dist/business-CFMUx5qO.js +0 -78
  109. package/dist/index-CuJ5OZqA.js +0 -29566
  110. package/dist/index-CuvNtC_M.js +0 -61
  111. package/dist/index-Dbd4WA4r.js +0 -61
  112. package/dist/index-mtAI1Gyn.js +0 -44
  113. package/dist/objectid-DkD1hn1F.js +0 -145
@@ -1,22 +1,19 @@
1
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 } from "./plugins-5mIceCPA.js";
5
- import { u as W } from "./loading-C-BSh5_w.js";
6
- import { u as X } from "./business-CFMUx5qO.js";
7
- import { u as Y } from "./campaign-DwArKZ1r.js";
8
- import { g as Z, a as V, b as I } from "./campaign-NqTts9bj.js";
4
+ import { p as Q } from "./plugins-D2sSgTSl.js";
5
+ import { u as W } from "./loading-a-FqrwqI.js";
6
+ import { u as X } from "./business-B2JBpm4y.js";
7
+ import { u as Y } from "./campaign-vkzui6F2.js";
8
+ import { g as Z, a as V, b as I } from "./campaign-Bhur0NJx.js";
9
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-DHQBxqsk.js";
11
- import { u as oe } from "./template-DbmV0nWD.js";
12
- import { u as ae } from "./vue-i18n-BnN9jlFK.js";
13
- import { c as _ } from "./index-CczG_ilB.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 = /* @__PURE__ */ n("img", {
15
- src: z,
16
- class: "aspect-square w-[150px]"
17
- }, null, -1), _e = { class: "flex flex-col gap-16 text-center" }, he = { class: "fm-typo-en-title-sm-800" }, be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ne = /* @__PURE__ */ j({
10
+ import { _ as te } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js";
11
+ import { u as oe } from "./template-DhBeDaAm.js";
12
+ import { u as ae } from "./vue-i18n-D-h8VDSx.js";
13
+ import { c as _ } from "./index-BWTvsoH0.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({
18
15
  __name: "Point",
19
- setup(we) {
16
+ setup(be) {
20
17
  const { t: s } = ae(), B = {
21
18
  label: s("connect.program.common.actions.create", {
22
19
  type: s("connect.program.point.title").toLowerCase()
@@ -54,8 +51,8 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
54
51
  variant: "tertiary",
55
52
  icon: "delete",
56
53
  iconColor: "neutral-gray-400",
57
- onClick: (a) => {
58
- a.stopPropagation(), F(e.row.original);
54
+ onClick: (o) => {
55
+ o.stopPropagation(), F(e.row.original);
59
56
  }
60
57
  });
61
58
  }
@@ -73,10 +70,10 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
73
70
  );
74
71
  }
75
72
  async function f(e) {
76
- e ? await a() : $.open(async (p) => {
77
- await a(p);
73
+ e ? await o() : $.open(async (p) => {
74
+ await o(p);
78
75
  });
79
- async function a(p) {
76
+ async function o(p) {
80
77
  var g;
81
78
  (g = v.value) == null || g.showSheet(
82
79
  !0,
@@ -101,13 +98,13 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
101
98
  await K(async () => {
102
99
  await m.read("COIN");
103
100
  });
104
- }), (e, a) => {
101
+ }), (e, o) => {
105
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");
106
103
  return d(), b(w, null, [
107
104
  r(g, {
108
105
  title: t(s)("connect.program.point.title"),
109
106
  actions: t(u).length > 0 && t(h).isPremium ? [B] : [],
110
- "onClick:action": a[0] || (a[0] = () => f())
107
+ "onClick:action": o[0] || (o[0] = () => f())
111
108
  }, {
112
109
  title: y(() => [
113
110
  n("div", ne, [
@@ -120,7 +117,7 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
120
117
  n("div", ie, [
121
118
  r(k, {
122
119
  modelValue: t(i).searchKey,
123
- "onUpdate:modelValue": a[1] || (a[1] = (o) => t(i).searchKey = o),
120
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(i).searchKey = a),
124
121
  class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
125
122
  placeholder: "search",
126
123
  collapsible: ""
@@ -130,7 +127,7 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
130
127
  n("div", le, [
131
128
  r(ee, {
132
129
  modelValue: t(i).location,
133
- "onUpdate:modelValue": a[2] || (a[2] = (o) => t(i).location = o),
130
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(i).location = a),
134
131
  label: "Location: ",
135
132
  "show-item-label": !0,
136
133
  icon: "storefront",
@@ -140,7 +137,7 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
140
137
  ]),
141
138
  r(k, {
142
139
  modelValue: t(i).searchKey,
143
- "onUpdate:modelValue": a[3] || (a[3] = (o) => t(i).searchKey = o),
140
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(i).searchKey = a),
144
141
  class: "xs:hidden",
145
142
  placeholder: "search",
146
143
  collapsible: ""
@@ -152,35 +149,37 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
152
149
  "column-defs": N,
153
150
  "search-value": t(i).searchKey,
154
151
  "column-filter": [],
155
- onRowClick: a[4] || (a[4] = (o) => f(o.original)),
152
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
156
153
  "hide-footer": t(u).length < 10
157
154
  }, null, 8, ["row-data", "search-value", "hide-footer"]),
158
155
  r(D, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
159
156
  default: y(() => [
160
157
  (d(!0), b(w, null, H(t(u).filter(
161
- (o) => o.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
162
- ), (o) => (d(), C(U, {
163
- key: o._id.toString(),
164
- onClick: (L) => f(o),
158
+ (a) => a.name.toLowerCase().includes(t(i).searchKey.toLowerCase())
159
+ ), (a) => (d(), C(U, {
160
+ key: a._id.toString(),
161
+ onClick: (L) => f(a),
165
162
  class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
166
163
  }, {
167
164
  default: y(() => [
168
165
  n("div", ce, [
169
166
  n("div", me, [
170
- (d(), C(q(t(V)(o)))),
171
- n("div", de, c(t(s)("program.point.used", { count: o.currentReceive ?? 0 })), 1)
167
+ (d(), C(q(t(V)(a)))),
168
+ n("div", de, c(t(s)("connect.program.point.used", {
169
+ count: a.currentReceive ?? 0
170
+ })), 1)
172
171
  ]),
173
172
  n("div", pe, [
174
- n("div", ue, c(o.name), 1),
175
- n("div", fe, c(t(I)(o)), 1)
173
+ n("div", ue, c(a.name), 1),
174
+ n("div", fe, c(t(I)(a)), 1)
176
175
  ]),
177
- n("div", ge, " Point received: " + c(o.currentReceive ?? 0), 1)
176
+ n("div", ge, " Point received: " + c(a.currentReceive ?? 0), 1)
178
177
  ]),
179
178
  r(S, {
180
179
  icon: "delete",
181
180
  "icon-color": "neutral-gray-400",
182
181
  variant: "tertiary",
183
- onClick: (L) => (L.stopPropagation(), F(o))
182
+ onClick: (L) => (L.stopPropagation(), F(a))
184
183
  }, null, 8, ["onClick"])
185
184
  ]),
186
185
  _: 2
@@ -194,17 +193,20 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
194
193
  class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
195
194
  }, {
196
195
  default: y(() => [
197
- ye,
198
- n("div", _e, [
199
- n("div", he, c(t(s)("connect.program.point.empty_state.title")), 1),
200
- n("div", be, c(t(s)("connect.program.point.empty_state.description")), 1)
196
+ o[6] || (o[6] = n("img", {
197
+ src: z,
198
+ class: "aspect-square w-[150px]"
199
+ }, null, -1)),
200
+ n("div", ye, [
201
+ n("div", _e, c(t(s)("connect.program.point.empty_state.title")), 1),
202
+ n("div", he, c(t(s)("connect.program.point.empty_state.description")), 1)
201
203
  ]),
202
204
  r(S, {
203
205
  variant: "primary",
204
206
  label: "Create point program",
205
207
  disabled: !t(h).isPremium,
206
208
  icon: "add",
207
- onClick: a[5] || (a[5] = (o) => f())
209
+ onClick: o[5] || (o[5] = (a) => f())
208
210
  }, null, 8, ["disabled"])
209
211
  ]),
210
212
  _: 1
@@ -220,5 +222,5 @@ const ne = { class: "flex items-center" }, se = { class: "fm-typo-en-title-md-60
220
222
  }
221
223
  });
222
224
  export {
223
- Ne as default
225
+ Ke as default
224
226
  };
@@ -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-D2sSgTSl.js";
5
+ import { u as ne } from "./loading-a-FqrwqI.js";
6
+ import { u as ae } from "./business-B2JBpm4y.js";
7
+ import { u as se } from "./campaign-vkzui6F2.js";
8
+ import { u as re } from "./vue-i18n-D-h8VDSx.js";
9
+ import { g as ie, a as V } from "./campaign-Bhur0NJx.js";
10
+ import { e as I } from "./effect-D7qRfPe_.js";
11
+ import { _ as le } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6AmN3o3.js";
12
+ import { u as ce } from "./template-DhBeDaAm.js";
13
+ import { _ as B } from "./FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js";
14
+ import { c as d } from "./index-BWTvsoH0.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
+ };