@feedmepos/mf-connect 0.1.38-beta.3 → 0.1.38-beta.31

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 (110) hide show
  1. package/dist/{Analytic-DlzNe_iy.js → Analytic-C_nMR1Be.js} +15 -15
  2. package/dist/{App-S5t6byxx.js → App-s6O0r91S.js} +624 -618
  3. package/dist/{AuditLogs-FO7SmMm2.js → AuditLogs-BcVkpvGw.js} +14 -14
  4. package/dist/{Bin-D--pK-f4.js → Bin-C5g9jHoQ.js} +9 -9
  5. package/dist/Broadcast-JPTVWDJC.js +233 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C6MYdWnX.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CloO2B7A.js} +6 -6
  7. package/dist/{Card-DHL6WnwR.js → Card-Dgj6yukn.js} +143 -137
  8. package/dist/{Collections-DnonNjPT.js → Collections-D-aFYRCq.js} +82 -76
  9. package/dist/Credit-BZcRB9Wj.js +228 -0
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DnPPICf0.js +3117 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C4zzEOCb.js → EffectSheet.vue_vue_type_style_index_0_lang-DbSiVLaJ.js} +100 -99
  13. package/dist/Experience-DHQPxVv3.js +229 -0
  14. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  15. package/dist/{Game-Bkl0JnBq.js → Game-C1XnMgil.js} +103 -97
  16. package/dist/Grab-BbHccgZO.js +301 -0
  17. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js} +8 -8
  18. package/dist/{Index-BXTpF6kN.js → Index-DYZsN2H3.js} +54 -54
  19. package/dist/{Marketing-kk88gqDC.js → Marketing-DnsPHYpt.js} +7112 -5424
  20. package/dist/{Member-Cq-orpRf.js → Member-rkdV1fVo.js} +10 -10
  21. package/dist/{MemberList-B0K6Djc0.js → MemberList-QaB13bxO.js} +33 -33
  22. package/dist/{MemberTransactions-BCrJz8M9.js → MemberTransactions-Dw5qHQVW.js} +1 -1
  23. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BcGhTM5H.js → MessageInput.vue_vue_type_script_setup_true_lang-DGyv0LMu.js} +5789 -5515
  24. package/dist/{Mission-BF1Z-Veq.js → Mission-B7rAzf6O.js} +112 -106
  25. package/dist/{Overview-CLSBBnZz.js → Overview-Cg4Szz05.js} +21 -21
  26. package/dist/Point-DuKS8-0D.js +232 -0
  27. package/dist/{Promotion-CGwxt3l3.js → Promotion-CFtLq-LB.js} +11 -11
  28. package/dist/{Queue-Dihw6DCV.js → Queue-BZONVNCP.js} +13 -13
  29. package/dist/{Record-ChSb722p.js → Record-jNEahJNC.js} +10 -10
  30. package/dist/{Reward-8oKlHA-x.js → Reward-VS6C6NQO.js} +15 -15
  31. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D--YGFcF.js → RewardGroup.vue_vue_type_script_setup_true_lang-D4KMGgkv.js} +11 -11
  32. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cb-WJA0i.js +1763 -0
  33. package/dist/{Segment-BbYgbJ7w.js → Segment-DK5tqeOF.js} +274 -274
  34. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Dy_G8md1.js → SelectItems.vue_vue_type_script_setup_true_lang-AYAwO37B.js} +14 -14
  35. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BFhY3cve.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-K8js6fbo.js} +11 -11
  36. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-WEiXy4o1.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-lcPHPa4K.js} +3 -3
  37. package/dist/{Setting-B75a5DWV.js → Setting-BtiUlWRc.js} +459 -444
  38. package/dist/{Store-Cb8Et93b.js → Store-DqFW5hr_.js} +472 -465
  39. package/dist/{StoreRewards-DEI9VJHO.js → StoreRewards-g-3WtxwG.js} +15 -15
  40. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BGBl4Zla.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DNT4PWgl.js} +208 -222
  41. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-92NnMkro.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CXYnNSta.js} +1 -1
  42. package/dist/{Tier-BB4AyAZV.js → Tier-SHij9zKX.js} +230 -227
  43. package/dist/{Title-Cla1U1ye.js → Title-_2JVV1rW.js} +142 -139
  44. package/dist/{Transaction-fHFbemk-.js → Transaction-BHLb6hZN.js} +2 -2
  45. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-yS5qh7za.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DolBmHzN.js} +6 -6
  46. package/dist/{Voucher-CraCvVuq.js → Voucher-CJk8ZuCA.js} +14 -14
  47. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DqKT6Fep.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BviU3rz6.js} +86 -86
  48. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B14K5zel.js → ZodTextField.vue_vue_type_script_setup_true_lang-R4Xcn7gl.js} +1 -1
  49. package/dist/app-BpcIC6Ud.js +57962 -0
  50. package/dist/{app-B8hYhD6p.js → app-D9ygZVP0.js} +678 -597
  51. package/dist/app.js +1 -1
  52. package/dist/{business-CwtLYoAT.js → business-CzJxdKc-.js} +11 -8
  53. package/dist/{campaign-BwM5SLyy.js → campaign-RKjwSpJk.js} +29 -16
  54. package/dist/{campaign-Bea47E3G.js → campaign-s_7F9I6R.js} +29 -25
  55. package/dist/{campaign.enum-v4z9v1aa.js → campaign.enum-BlGYJ6p4.js} +3 -2
  56. package/dist/{campaign.fn-CV5s8XUt.js → campaign.fn-aH0pz1jU.js} +95 -95
  57. package/dist/{collectible.enum-BGt9xa0D.js → collectible.enum-DYV8J5Mg.js} +1 -1
  58. package/dist/{collection.fn-DFzVxsA9.js → collection.fn-lLG_rLyd.js} +2 -2
  59. package/dist/dto-Cx-z2h2_.js +222 -0
  60. package/dist/{effect-DQtWLIrF.js → effect-DV2GiHqM.js} +1 -1
  61. package/dist/{email-addresses-I8wDL9bh.js → email-addresses-DTfbKDsC.js} +1 -1
  62. package/dist/{export-BauRZnqp.js → export-hHjutAC3.js} +4 -4
  63. package/dist/{helper-B2Q1CLCG.js → helper-oy_DH4P5.js} +1 -1
  64. package/dist/{index-CCJqmSob.js → index-8t9y1bUZ.js} +1 -1
  65. package/dist/{index-B20y17xe.js → index-B1C5UjP5.js} +3 -3
  66. package/dist/{index-DQpw4Va-.js → index-B79nkieV.js} +1452 -1452
  67. package/dist/{index-DGuR3NRj.js → index-BA6oC2L9.js} +3 -3
  68. package/dist/{index-BdizAaMz.js → index-Ba05Naif.js} +16 -16
  69. package/dist/{index-B1Bdn9rV.js → index-BoRTW-dI.js} +196 -16
  70. package/dist/{index-CgYAHnlX.js → index-CUGS4y58.js} +861 -714
  71. package/dist/{index-IXY9hkrD.js → index-CV_3mltA.js} +1 -1
  72. package/dist/{index-DtfWwcp4.js → index-ClgsfK3Y.js} +1 -1
  73. package/dist/{index-dK8fMQ5h.js → index-CtxtD8HE.js} +1 -1
  74. package/dist/{index-aguYFa7D.js → index-CycW9ri6.js} +6347 -6305
  75. package/dist/{index-s1IB44jY.js → index-D8JDdV2w.js} +1 -1
  76. package/dist/{index-Bv3aqvRF.js → index-DJlZYwDo.js} +11 -4
  77. package/dist/{index-yOFbPJEE.js → index-sSxaqeIi.js} +1 -1
  78. package/dist/{index.esm2017-VwpfHNpU.js → index.esm2017-B3-oEraK.js} +34 -34
  79. package/dist/{loading-BFKvxqlx.js → loading-D98ofaCB.js} +1 -1
  80. package/dist/{membership-Cgzqg1Vw.js → membership-CwbI7ZrE.js} +3 -3
  81. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  82. package/dist/{money-DIh7Uegf.js → money-D5cHxcPB.js} +1 -1
  83. package/dist/{number-onslf0BL.js → number-CPEEKMZZ.js} +1 -1
  84. package/dist/objectid-Be_atBnH.js +145 -0
  85. package/dist/{plugins-hfoXoiK2.js → plugins-B55BRo5q.js} +2 -2
  86. package/dist/{reward-CYC7hCgM.js → reward-xrTcTYjt.js} +1 -1
  87. package/dist/rule-builder-NTDBB2kj.js +93 -0
  88. package/dist/{rule-C_M3oFLI.js → rule-w89XmfIg.js} +4 -4
  89. package/dist/style.css +1 -1
  90. package/dist/{template-C6URy7QF.js → template-Bt_auQZW.js} +5 -5
  91. package/dist/timezone-BcBn2Kb_.js +1151 -0
  92. package/dist/{trigger-CZAiHFT5.js → trigger-D_6mNiva.js} +4 -4
  93. package/dist/usePagination-Ds-cuHop.js +223 -0
  94. package/dist/{user-uo2wREaB.js → user-B6YOJ_7r.js} +1 -1
  95. package/dist/{vue-i18n-Ba5EWUgR.js → vue-i18n-QvFKKqSt.js} +418 -418
  96. package/dist/{xlsx-CIJPKm4G.js → xlsx-Dr9Ctrs4.js} +1 -1
  97. package/package.json +6 -5
  98. package/dist/Broadcast-BYL3w06w.js +0 -227
  99. package/dist/Credit-BMeykOe-.js +0 -222
  100. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-D6Ps8njr.js +0 -2185
  101. package/dist/Experience-Lu8sCso6.js +0 -223
  102. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  103. package/dist/Point-BZ2Bgfw8.js +0 -226
  104. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-GSqXPvRs.js +0 -1728
  105. package/dist/app-BVCw28s0.js +0 -33357
  106. package/dist/dto-BgJqr4qT.js +0 -214
  107. package/dist/objectid-vtlpVGBH.js +0 -145
  108. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  109. package/dist/rule-builder-BOG14MYK.js +0 -89
  110. package/dist/usePagination-BeF5K3M7.js +0 -223
@@ -1,28 +1,28 @@
1
1
  var ae = Object.defineProperty;
2
- var le = (f, i, d) => i in f ? ae(f, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : f[i] = d;
3
- var O = (f, i, d) => le(f, typeof i != "symbol" ? i + "" : i, d);
4
- import { defineComponent as J, ref as p, computed as Q, watch as K, resolveComponent as u, openBlock as x, createBlock as z, unref as o, isRef as j, withCtx as I, createElementVNode as v, createVNode as r, createElementBlock as N, Fragment as P, renderList as ne, createCommentVNode as R, onMounted as se, h as S } from "vue";
5
- import { h as G } from "./moment-BWErdI6_.js";
2
+ var le = (g, i, d) => i in g ? ae(g, i, { enumerable: !0, configurable: !0, writable: !0, value: d }) : g[i] = d;
3
+ var K = (g, i, d) => le(g, typeof i != "symbol" ? i + "" : i, d);
4
+ import { defineComponent as J, ref as f, computed as Q, watch as z, resolveComponent as u, openBlock as y, createBlock as Y, unref as o, isRef as j, withCtx as I, createElementVNode as h, createVNode as r, createElementBlock as N, Fragment as P, renderList as ne, createCommentVNode as R, onMounted as se, h as S } from "vue";
5
+ import { h as G } from "./moment-D7p2TMB-.js";
6
6
  import { components as H } from "@feedmepos/ui-library";
7
- import "./index-DQpw4Va-.js";
7
+ import "./index-B79nkieV.js";
8
8
  import { J as re } from "./JsonViewer-v8_C7l5N.js";
9
- import { u as W } from "./loading-BFKvxqlx.js";
9
+ import { u as W } from "./loading-D98ofaCB.js";
10
10
  import { u as ie } from "./app-wDQR6dpb.js";
11
11
  import { useRoute as X, useRouter as ue } from "vue-router";
12
- import { c as q } from "./index-yOFbPJEE.js";
13
- import { e as m } from "./index-vh86FiIQ.js";
14
- import { u as Y, w as de } from "./xlsx-CIJPKm4G.js";
15
- import { u as ce, _ as me } from "./usePagination-BeF5K3M7.js";
16
- import { a as pe } from "./plugins-hfoXoiK2.js";
17
- import { m as fe } from "./index-Bv3aqvRF.js";
12
+ import { c as q } from "./index-sSxaqeIi.js";
13
+ import { e as p } from "./index-vh86FiIQ.js";
14
+ import { u as $, w as de } from "./xlsx-Dr9Ctrs4.js";
15
+ import { u as ce, _ as me } from "./usePagination-Ds-cuHop.js";
16
+ import { a as pe } from "./plugins-B55BRo5q.js";
17
+ import { m as fe } from "./index-DJlZYwDo.js";
18
18
  import { o as ge } from "./objectId-dwaoBfJX.js";
19
- const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, ve = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ J({
19
+ const Ce = { class: "space-y-16" }, be = { class: "gap-16 grid grid-cols-2" }, ve = { class: "flex items-center gap-8" }, he = /* @__PURE__ */ J({
20
20
  __name: "CreateCollectionSheet",
21
21
  emits: ["success"],
22
- setup(f, { expose: i, emit: d }) {
23
- const { minor: w } = W, F = X(), k = p(), _ = p(!1), A = d, g = p(!1);
22
+ setup(g, { expose: i, emit: d }) {
23
+ const { minor: w } = W, F = X(), k = f(), _ = f(!1), A = d, C = f(!1);
24
24
  function D(s) {
25
- g.value = s, s && (a.value = {
25
+ C.value = s, s && (a.value = {
26
26
  quantity: 1,
27
27
  code: "",
28
28
  codeConfig: {
@@ -34,7 +34,7 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
34
34
  }
35
35
  });
36
36
  }
37
- const a = p({
37
+ const a = f({
38
38
  quantity: 1,
39
39
  code: "",
40
40
  codeConfig: {
@@ -68,7 +68,7 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
68
68
  { label: "Alphabetic Uppercase", value: "ABCDEFGHIJKLMNOPQRSTUVWXYZ" },
69
69
  { label: "Numbers", value: "0123456789" },
70
70
  { label: "Custom", value: "" }
71
- ], h = p(U[0].value), c = p("bulk"), y = p(!1), M = Q(() => F.params.id);
71
+ ], x = f(U[0].value), c = f("bulk"), V = f(!1), M = Q(() => F.params.id);
72
72
  async function n(s) {
73
73
  var e;
74
74
  await ((e = k.value) == null ? void 0 : e.validateInputs()), _.value && await w(
@@ -83,7 +83,7 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
83
83
  }
84
84
  i({
85
85
  showSheet: D
86
- }), K(
86
+ }), z(
87
87
  () => c.value,
88
88
  (s, e) => {
89
89
  e != s && (a.value.code = "", a.value.codeConfig.length = 8, a.value.codeConfig.charset = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", a.value.codeConfig.prefix = "", a.value.codeConfig.suffix = "", a.value.codeConfig.pattern = "########");
@@ -92,41 +92,46 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
92
92
  function l(s) {
93
93
  if (c.value !== "single") return !1;
94
94
  const e = s.split(`
95
- `).map((C) => C.trim()).filter(Boolean);
95
+ `).map((v) => v.trim()).filter(Boolean);
96
96
  return new Set(e).size !== e.length;
97
97
  }
98
98
  function b(s) {
99
99
  return /[ \t]/.test(s);
100
100
  }
101
- return K(
101
+ return z(
102
102
  () => a.value.codeConfig.length,
103
103
  (s, e) => {
104
104
  s != e && (a.value.codeConfig.pattern = "#".repeat(Math.min(16, Number(s))));
105
105
  }
106
+ ), z(
107
+ () => a.value.codeConfig.pattern,
108
+ (s, e) => {
109
+ s != e && (a.value.codeConfig.length = (a.value.codeConfig.pattern.match(/#/g) || []).length);
110
+ }
106
111
  ), (s, e) => {
107
- const C = u("FmRadio"), L = u("FmRadioGroup"), V = u("FmSwitch"), T = u("FmStepperField"), Z = u("FmSelect"), B = u("FmTextField"), ee = u("FmTextarea"), oe = u("FmForm"), $ = u("FmButton"), te = u("FmSideSheet");
108
- return x(), z(te, {
112
+ const v = u("FmRadio"), L = u("FmRadioGroup"), m = u("FmSwitch"), T = u("FmStepperField"), Z = u("FmSelect"), B = u("FmTextField"), ee = u("FmTextarea"), oe = u("FmForm"), O = u("FmButton"), te = u("FmSideSheet");
113
+ return y(), Y(te, {
109
114
  "max-width": 560,
110
115
  "dismiss-away": !0,
111
116
  header: "Create collection",
112
- modelValue: o(g),
117
+ modelValue: o(C),
113
118
  "onUpdate:modelValue": [
114
- e[14] || (e[14] = (t) => j(g) ? g.value = t : null),
115
- e[15] || (e[15] = (t) => g.value = t)
119
+ e[14] || (e[14] = (t) => j(C) ? C.value = t : null),
120
+ e[15] || (e[15] = (t) => C.value = t)
116
121
  ]
117
122
  }, {
118
123
  "side-sheet-footer": I(() => [
119
- v("div", ve, [
120
- r($, {
124
+ h("div", ve, [
125
+ r(O, {
121
126
  label: "Save",
122
127
  onClick: e[12] || (e[12] = (t) => n(o(a))),
123
128
  loading: o(ie)().isLoading
124
129
  }, null, 8, ["loading"]),
125
- r($, {
130
+ r(O, {
126
131
  label: "Cancel",
127
132
  type: "button",
128
133
  variant: "tertiary",
129
- onClick: e[13] || (e[13] = (t) => g.value = !1)
134
+ onClick: e[13] || (e[13] = (t) => C.value = !1)
130
135
  })
131
136
  ])
132
137
  ]),
@@ -140,15 +145,15 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
140
145
  onValidationFailed: e[11] || (e[11] = (t) => _.value = !1)
141
146
  }, {
142
147
  default: I(() => [
143
- v("div", null, [
144
- e[16] || (e[16] = v("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
148
+ h("div", null, [
149
+ e[16] || (e[16] = h("div", { class: "fm-typo-en-body-lg-600" }, "Code type", -1)),
145
150
  r(L, {
146
151
  modelValue: o(c),
147
152
  "onUpdate:modelValue": e[0] || (e[0] = (t) => j(c) ? c.value = t : null),
148
153
  inline: !1
149
154
  }, {
150
155
  default: I(() => [
151
- (x(), N(P, null, ne(E, (t) => r(C, {
156
+ (y(), N(P, null, ne(E, (t) => r(v, {
152
157
  key: t.value,
153
158
  value: t.value,
154
159
  label: t.label,
@@ -158,18 +163,18 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
158
163
  _: 1
159
164
  }, 8, ["modelValue"])
160
165
  ]),
161
- v("div", be, [
162
- e[17] || (e[17] = v("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
163
- o(c) === "bulk" ? (x(), N(P, { key: 0 }, [
164
- r(V, {
165
- "model-value": o(y),
166
+ h("div", Ce, [
167
+ e[17] || (e[17] = h("div", { class: "fm-typo-en-body-lg-600" }, "Settings", -1)),
168
+ o(c) === "bulk" ? (y(), N(P, { key: 0 }, [
169
+ r(m, {
170
+ "model-value": o(V),
166
171
  "label-placement": "right",
167
172
  value: "true",
168
173
  label: "Advance code setting",
169
174
  required: !0,
170
- "onUpdate:modelValue": e[1] || (e[1] = () => y.value = !o(y))
175
+ "onUpdate:modelValue": e[1] || (e[1] = () => V.value = !o(V))
171
176
  }, null, 8, ["model-value"]),
172
- o(y) ? (x(), N(P, { key: 0 }, [
177
+ o(V) ? (y(), N(P, { key: 0 }, [
173
178
  r(T, {
174
179
  modelValue: o(a).codeConfig.length,
175
180
  "onUpdate:modelValue": e[2] || (e[2] = (t) => o(a).codeConfig.length = t),
@@ -184,21 +189,21 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
184
189
  }, null, 8, ["modelValue", "rules"]),
185
190
  r(Z, {
186
191
  label: "Charset",
187
- "model-value": o(h),
192
+ "model-value": o(x),
188
193
  items: U,
189
194
  "helper-text": o(a).codeConfig.charset.length > 62 ? `${o(a).codeConfig.charset.substring(0, 62)}...` : o(a).codeConfig.charset,
190
195
  "onUpdate:modelValue": e[3] || (e[3] = (t) => {
191
- h.value = t, o(a).codeConfig.charset = t;
196
+ x.value = t, o(a).codeConfig.charset = t;
192
197
  })
193
198
  }, null, 8, ["model-value", "helper-text"]),
194
- o(h) === "" ? (x(), z(B, {
199
+ o(x) === "" ? (y(), Y(B, {
195
200
  key: 0,
196
201
  modelValue: o(a).codeConfig.charset,
197
202
  "onUpdate:modelValue": e[4] || (e[4] = (t) => o(a).codeConfig.charset = t),
198
203
  label: "Custom Charset",
199
204
  required: ""
200
205
  }, null, 8, ["modelValue"])) : R("", !0),
201
- v("div", Ce, [
206
+ h("div", be, [
202
207
  r(B, {
203
208
  modelValue: o(a).codeConfig.prefix,
204
209
  "onUpdate:modelValue": e[5] || (e[5] = (t) => o(a).codeConfig.prefix = t),
@@ -229,7 +234,7 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
229
234
  "helper-text": `${o(a).quantity} claim will be created`
230
235
  }, null, 8, ["modelValue", "rules", "helper-text"])
231
236
  ], 64)) : R("", !0),
232
- o(c) !== "bulk" ? (x(), z(ee, {
237
+ o(c) !== "bulk" ? (y(), Y(ee, {
233
238
  key: 1,
234
239
  modelValue: o(a).code,
235
240
  "onUpdate:modelValue": e[9] || (e[9] = (t) => o(a).code = t),
@@ -253,20 +258,20 @@ const be = { class: "space-y-16" }, Ce = { class: "gap-16 grid grid-cols-2" }, v
253
258
  });
254
259
  class xe {
255
260
  constructor() {
256
- O(this, "data", []);
261
+ K(this, "data", []);
257
262
  }
258
263
  addRecord(i) {
259
264
  this.data.push(i);
260
265
  }
261
266
  buildExcel() {
262
- const i = Y.book_new(), d = Y.json_to_sheet(this.data);
263
- return Y.book_append_sheet(i, d, "Collection"), i;
267
+ const i = $.book_new(), d = $.json_to_sheet(this.data);
268
+ return $.book_append_sheet(i, d, "Collection"), i;
264
269
  }
265
270
  }
266
271
  const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex items-center justify-end py-4 xs:hidden" }, Le = /* @__PURE__ */ J({
267
272
  __name: "Collections",
268
- setup(f) {
269
- const i = ue(), d = X(), w = p(), F = Q(() => d.params.id), k = p(!1), { custom: _ } = W, A = [
273
+ setup(g) {
274
+ const i = ue(), d = X(), w = f(), F = Q(() => d.params.id), k = f(!1), { custom: _ } = W, A = [
270
275
  {
271
276
  header: "ID/Code",
272
277
  accessorKey: "_id",
@@ -338,16 +343,16 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
338
343
  return n.expiryBalance && n.expiryBalance.length ? G((l = n.expiryBalance) == null ? void 0 : l[0].expiredAt).format("DD MMM YYYY") : "Never expires";
339
344
  }
340
345
  }
341
- ], g = {
346
+ ], C = {
342
347
  "$connect-STORE_REWARD_COLLECTIONS": fe.readCollectionsByRewardId,
343
348
  "$connect-CAMPAIGN_VOUCHER_COLLECTIONS": q.readCollectionsByCampaignId
344
349
  }, D = (n) => {
345
- const l = g[d.name];
350
+ const l = C[d.name];
346
351
  return (b) => l(n, b);
347
- }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: h, onSearch: c } = ce(D(F.value));
348
- async function y() {
352
+ }, { tableMeta: a, rowData: E, onSort: U, debouncedFetchData: x, onSearch: c } = ce(D(F.value));
353
+ async function V() {
349
354
  var n;
350
- await h(), (n = w.value) == null || n.showSheet(!1);
355
+ await x(), (n = w.value) == null || n.showSheet(!1);
351
356
  }
352
357
  async function M() {
353
358
  k.value || _(
@@ -356,27 +361,28 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
356
361
  const n = new xe(), l = (await q.readCollectionsByCampaignId(F.value, {
357
362
  limit: 1,
358
363
  skip: 0,
359
- sortBy: m.sortBy,
360
- descending: m.descending
361
- })).meta.totalResources ?? 0, b = m.rowsPerPage;
364
+ sortBy: p.sortBy,
365
+ descending: p.descending
366
+ })).meta.totalResources ?? 0, b = p.rowsPerPage;
362
367
  for (let e = 0; e < l; e += b) {
363
- const C = {
364
- ...m,
368
+ const v = {
369
+ ...p,
365
370
  limit: b,
366
- skip: m.page - 1,
367
- sortBy: m.sortBy,
368
- descending: m.descending
371
+ skip: p.page - 1,
372
+ sortBy: p.sortBy,
373
+ descending: p.descending
369
374
  }, L = await q.readCollectionsByCampaignId(
370
375
  F.value,
371
- C
376
+ v
372
377
  );
373
- for await (const V of L.resources) {
378
+ for await (const m of L.resources) {
374
379
  const T = {
375
- Id: (V == null ? void 0 : V.code) || ((s = V._id) == null ? void 0 : s.toString()) || ""
380
+ Id: (m == null ? void 0 : m.code) || ((s = m._id) == null ? void 0 : s.toString()) || "",
381
+ Balance: (m == null ? void 0 : m.balance) || 0
376
382
  };
377
383
  n.addRecord(T);
378
384
  }
379
- m.page++;
385
+ p.page++;
380
386
  }
381
387
  await de(
382
388
  n.buildExcel(),
@@ -386,7 +392,7 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
386
392
  bookSST: !1,
387
393
  type: "array"
388
394
  }
389
- ), m.page = 1;
395
+ ), p.page = 1;
390
396
  },
391
397
  {
392
398
  isLoading: k
@@ -394,10 +400,10 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
394
400
  );
395
401
  }
396
402
  return se(async () => {
397
- await h();
403
+ await x();
398
404
  }), (n, l) => {
399
405
  const b = u("FmPageHead"), s = u("FmSearch");
400
- return x(), N(P, null, [
406
+ return y(), N(P, null, [
401
407
  r(b, {
402
408
  title: "Collections",
403
409
  "back-button": !0,
@@ -411,11 +417,11 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
411
417
  ],
412
418
  "onClick:back": l[0] || (l[0] = (e) => o(i).back()),
413
419
  "onClick:action": l[1] || (l[1] = (e) => {
414
- var C;
415
- e === "create" && ((C = o(w)) == null || C.showSheet(!0)), e === "export" && M();
420
+ var v;
421
+ e === "create" && ((v = o(w)) == null || v.showSheet(!0)), e === "export" && M();
416
422
  })
417
423
  }),
418
- v("div", ye, [
424
+ h("div", ye, [
419
425
  r(s, {
420
426
  class: "hidden xs:flex border-b border-fm-color-neutral-gray-100",
421
427
  modelValue: o(a).searchValue,
@@ -426,7 +432,7 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
426
432
  placeholder: "Search",
427
433
  collapsible: ""
428
434
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
429
- v("div", Ve, [
435
+ h("div", Ve, [
430
436
  r(s, {
431
437
  modelValue: o(a).searchValue,
432
438
  "onUpdate:modelValue": [
@@ -447,12 +453,12 @@ const ye = { class: "px-24 flex flex-col gap-y-32 pb-24" }, Ve = { class: "flex
447
453
  "page-size": o(a).pageSize,
448
454
  "shrink-at": !1,
449
455
  onSortChange: o(U),
450
- onPageChange: l[4] || (l[4] = (e) => o(h)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
456
+ onPageChange: l[4] || (l[4] = (e) => o(x)({ pageSize: e.pageSize, pageIndex: e.pageIndex }))
451
457
  }, null, 8, ["loading", "row-data", "row-count", "page-count", "page-index", "page-size", "onSortChange"]),
452
458
  r(he, {
453
459
  ref_key: "sheetRef",
454
460
  ref: w,
455
- onSuccess: y
461
+ onSuccess: V
456
462
  }, null, 512)
457
463
  ])
458
464
  ], 64);
@@ -0,0 +1,228 @@
1
+ import { defineComponent as N, ref as L, computed as j, h as M, onMounted as H, resolveComponent as m, openBlock as d, createElementBlock as y, Fragment as h, createVNode as i, unref as t, createElementVNode as n, withCtx as C, renderList as q, createBlock as w, resolveDynamicComponent as O, toDisplayString as g, createCommentVNode as z } from "vue";
2
+ import { _ as G } from "./campaign-CpzFl8Vr.js";
3
+ import { useDialog as J, components as Q } from "@feedmepos/ui-library";
4
+ import { p as W } from "./plugins-B55BRo5q.js";
5
+ import { u as X } from "./loading-D98ofaCB.js";
6
+ import { u as Y } from "./business-CzJxdKc-.js";
7
+ import { u as Z } from "./campaign-s_7F9I6R.js";
8
+ import { g as ee, a as S, b as V } from "./campaign-RKjwSpJk.js";
9
+ import { u as oe } from "./vue-i18n-QvFKKqSt.js";
10
+ import { _ as te } from "./FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js";
11
+ import { _ as ae } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-DnPPICf0.js";
12
+ import { u as ne } from "./template-Bt_auQZW.js";
13
+ import { c as _ } from "./index-sSxaqeIi.js";
14
+ const re = { 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" }, le = { 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" }, ue = { class: "fm-typo-en-body-lg-600" }, pe = { 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 = { key: 0 }, Ie = /* @__PURE__ */ N({
15
+ __name: "Credit",
16
+ setup(ge) {
17
+ const { t: r } = oe(), B = {
18
+ label: r("connect.program.common.actions.create", {
19
+ type: r("connect.program.credit.title").toLowerCase()
20
+ }),
21
+ value: "create",
22
+ isPrimary: !0,
23
+ prependIcon: "add"
24
+ }, I = ne("CREDIT", J()), R = Y(), u = Z(), { global: D, minor: v } = X, s = L({
25
+ searchKey: "",
26
+ location: []
27
+ });
28
+ function T(e) {
29
+ const o = s.value.location;
30
+ return !o || o.length === 0 || !e.targetLocation ? !0 : Array.isArray(o) ? o.some((l) => {
31
+ var c;
32
+ return (c = e == null ? void 0 : e.targetLocation) == null ? void 0 : c.includes(l);
33
+ }) : e.targetLocation.includes(o);
34
+ }
35
+ const p = j(
36
+ () => u.campaigns.credit.filter((e) => T(e))
37
+ ), E = [
38
+ {
39
+ header: r("connect.program.common.table.title"),
40
+ accessorFn: (e) => e.name
41
+ },
42
+ {
43
+ header: r("connect.program.common.table.status"),
44
+ accessorFn: (e) => ee(e),
45
+ cell(e) {
46
+ return S(e.row.original);
47
+ }
48
+ },
49
+ {
50
+ header: r("connect.program.common.table.summary"),
51
+ accessorFn: (e) => V(e)
52
+ },
53
+ {
54
+ header: r("connect.program.common.table.actions"),
55
+ cell(e) {
56
+ return M(Q.FmButton, {
57
+ variant: "tertiary",
58
+ icon: "delete",
59
+ iconColor: "neutral-gray-400",
60
+ onClick: (o) => {
61
+ o.stopPropagation(), x(e.row.original);
62
+ }
63
+ });
64
+ }
65
+ }
66
+ ], b = L();
67
+ async function x(e) {
68
+ await W.remove(
69
+ r("connect.program.common.remove.confirm", { name: e.name })
70
+ ) && await v(
71
+ async () => {
72
+ await _.delete(e._id), await u.read("CREDIT");
73
+ },
74
+ {
75
+ message: r("connect.program.common.remove.removing", { name: e.name }),
76
+ successMessage: r("connect.program.common.remove.removed", {
77
+ name: e.name
78
+ })
79
+ }
80
+ );
81
+ }
82
+ async function f(e) {
83
+ e ? await o() : I.open(async (l) => {
84
+ await o(l);
85
+ });
86
+ async function o(l) {
87
+ var c;
88
+ (c = b.value) == null || c.showSheet(
89
+ !0,
90
+ "CREDIT",
91
+ e ? await _.readById(e._id) : void 0,
92
+ l
93
+ );
94
+ }
95
+ }
96
+ async function K(e) {
97
+ await v(
98
+ async () => {
99
+ e.campaign._id ? await _.update(e.campaign._id, e) : await _.create(e), await u.read("CREDIT");
100
+ },
101
+ {
102
+ message: `${e.campaign._id ? "Updating" : "Creating"} credit program`,
103
+ successMessage: `Credit program ${e.campaign._id ? "updated" : "created"} successfully`
104
+ }
105
+ );
106
+ }
107
+ return H(async () => {
108
+ await D(async () => {
109
+ await u.read("CREDIT");
110
+ });
111
+ }), (e, o) => {
112
+ const l = m("FmPageHead"), c = m("FmSearch"), $ = m("FmTable"), F = m("FmButton"), P = m("FmListItem"), U = m("FmList"), A = m("FmCard");
113
+ return d(), y(h, null, [
114
+ i(l, {
115
+ title: t(r)("connect.program.credit.title"),
116
+ actions: t(p).length > 0 ? [B] : [],
117
+ "onClick:action": o[0] || (o[0] = () => f())
118
+ }, null, 8, ["title", "actions"]),
119
+ n("div", re, [
120
+ i(c, {
121
+ modelValue: t(s).searchKey,
122
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => t(s).searchKey = a),
123
+ class: "hidden xs:block border-b-2 border-fm-color-neutral-gray-100",
124
+ placeholder: "search",
125
+ collapsible: ""
126
+ }, null, 8, ["modelValue"]),
127
+ t(u).campaigns.credit && t(u).campaigns.credit.length > 0 ? (d(), y(h, { key: 0 }, [
128
+ n("div", se, [
129
+ n("div", ie, [
130
+ i(te, {
131
+ label: `${t(r)("connect.common.location")}: `,
132
+ "right-icon": "keyboard_arrow_down",
133
+ modelValue: t(s).location,
134
+ "onUpdate:modelValue": o[2] || (o[2] = (a) => t(s).location = a),
135
+ icon: "storefront",
136
+ "show-item-label": !0,
137
+ items: t(R).locationOptions
138
+ }, null, 8, ["label", "modelValue", "items"])
139
+ ]),
140
+ i(c, {
141
+ modelValue: t(s).searchKey,
142
+ "onUpdate:modelValue": o[3] || (o[3] = (a) => t(s).searchKey = a),
143
+ class: "xs:hidden",
144
+ placeholder: "search",
145
+ collapsible: ""
146
+ }, null, 8, ["modelValue"])
147
+ ]),
148
+ i($, {
149
+ class: "xs:hidden",
150
+ "row-data": t(p),
151
+ "column-defs": E,
152
+ "search-value": t(s).searchKey,
153
+ "column-filter": [],
154
+ onRowClick: o[4] || (o[4] = (a) => f(a.original)),
155
+ "hide-footer": t(p).length < 10
156
+ }, null, 8, ["row-data", "search-value", "hide-footer"]),
157
+ i(U, { class: "hidden xs:flex flex-col mx-[-24px]" }, {
158
+ default: C(() => [
159
+ (d(!0), y(h, null, q(t(p).filter(
160
+ (a) => a.name.toLowerCase().includes(t(s).searchKey.toLowerCase())
161
+ ), (a) => (d(), w(P, {
162
+ key: a._id.toString(),
163
+ onClick: (k) => f(a),
164
+ class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
165
+ }, {
166
+ default: C(() => [
167
+ n("div", ce, [
168
+ n("div", le, [
169
+ (d(), w(O(t(S)(a)))),
170
+ n("div", me, g(a.currentReceive ?? 0) + " used ", 1)
171
+ ]),
172
+ n("div", de, [
173
+ n("div", ue, g(a.name), 1),
174
+ n("div", pe, g(t(V)(a)), 1)
175
+ ]),
176
+ n("div", fe, " Credit received: " + g(a.currentReceive ?? 0), 1)
177
+ ]),
178
+ i(F, {
179
+ icon: "delete",
180
+ "icon-color": "neutral-gray-400",
181
+ variant: "tertiary",
182
+ onClick: (k) => (k.stopPropagation(), x(a))
183
+ }, null, 8, ["onClick"])
184
+ ]),
185
+ _: 2
186
+ }, 1032, ["onClick"]))), 128))
187
+ ]),
188
+ _: 1
189
+ }),
190
+ t(p).length == 0 ? (d(), y("div", ye, [...o[6] || (o[6] = [
191
+ n("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-md-600" }, " No results found ", -1)
192
+ ])])) : z("", !0)
193
+ ], 64)) : (d(), w(A, {
194
+ key: 1,
195
+ variant: "outlined",
196
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
197
+ }, {
198
+ default: C(() => [
199
+ o[7] || (o[7] = n("img", {
200
+ src: G,
201
+ class: "aspect-square w-[150px]"
202
+ }, null, -1)),
203
+ o[8] || (o[8] = n("div", { class: "flex flex-col gap-16 text-center" }, [
204
+ n("div", { class: "fm-typo-en-title-sm-800" }, "Create your credit program"),
205
+ n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Credits are virtual money that customers can use to pay for their purchases, similar to cash within your store. ")
206
+ ], -1)),
207
+ i(F, {
208
+ variant: "primary",
209
+ label: "Create credit program",
210
+ icon: "add",
211
+ onClick: o[5] || (o[5] = (a) => f())
212
+ })
213
+ ]),
214
+ _: 1
215
+ })),
216
+ i(ae, {
217
+ ref_key: "sheetRef",
218
+ ref: b,
219
+ "onSubmit:modelValue": K
220
+ }, null, 512)
221
+ ])
222
+ ], 64);
223
+ };
224
+ }
225
+ });
226
+ export {
227
+ Ie as default
228
+ };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as f, mergeModels as l, useModel as g, computed as u, onMounted as _, watch as R, resolveComponent as m, openBlock as h, createBlock as V, withCtx as b, createVNode as k, unref as y } from "vue";
2
- import { h as t } from "./moment-BWErdI6_.js";
2
+ import { h as t } from "./moment-D7p2TMB-.js";
3
3
  const a = "YYYY-MM-DD", F = /* @__PURE__ */ f({
4
4
  __name: "DateRangeChip",
5
5
  props: /* @__PURE__ */ l({