@feedmepos/mf-connect 0.1.38-beta.8 → 0.1.38-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 (159) hide show
  1. package/dist/{Analytic-CJap-Cat.js → Analytic-FMehGs58.js} +31 -32
  2. package/dist/{App-CLTtX1QT.js → App-7cwNu3e0.js} +617 -607
  3. package/dist/AuditLogs-CpmLBHAR.js +1991 -0
  4. package/dist/{Bin-C2xMLxoE.js → Bin-D21tScmC.js} +10 -10
  5. package/dist/Broadcast-DrX9zS2Z.js +266 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BCkD7Xfn.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BvN7Q36X.js} +6 -6
  7. package/dist/{Card-BPrCNLQy.js → Card-Nk0KHSjb.js} +145 -140
  8. package/dist/Collections-BAnIaZRj.js +540 -0
  9. package/dist/Credit-BhU_Vd3l.js +260 -0
  10. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +128 -0
  11. package/dist/DateInput.vue_vue_type_script_setup_true_lang-BN4Q5Y3l.js +54 -0
  12. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
  13. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DUrvbUE4.js +3120 -0
  14. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CqBGsZmi.js +351 -0
  15. package/dist/Experience-B7Fl1uzk.js +259 -0
  16. package/dist/{FileSaver.min-NlMItPOc.js → FileSaver.min-DaCnYliS.js} +1 -1
  17. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +129 -0
  18. package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +52 -0
  19. package/dist/Game-BdkSBpyV.js +330 -0
  20. package/dist/Grab-y_ISAZvb.js +300 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js → ImageInput.vue_vue_type_script_setup_true_lang-WEsv0wME.js} +49 -48
  22. package/dist/{Index-DMdNgISh.js → Index-DZp0xkxW.js} +54 -54
  23. package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-DXMshwQu.js +48 -0
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → LottieAnimation.vue_vue_type_script_setup_true_lang-24MFkuKg.js} +1 -1
  25. package/dist/{MainLayout-B1aJoR95.js → MainLayout-B8VvzvAT.js} +1 -1
  26. package/dist/Marketing-BXfk7ZLc.js +166 -0
  27. package/dist/MarketingMaterialEdit-CoDx_QvV.js +1065 -0
  28. package/dist/{Member-CnSXGQi_.js → Member-DOP3Z4-m.js} +38 -37
  29. package/dist/{MemberList-DcpEKV1D.js → MemberList-BcMezuLM.js} +486 -491
  30. package/dist/{MemberTransactions-DeuuEcO5.js → MemberTransactions-BEG9Cfgw.js} +1 -1
  31. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DLAEPNsq.js → MessageInput.vue_vue_type_script_setup_true_lang-R6ImfcMO.js} +13443 -10607
  32. package/dist/Mission-C4eWldYu.js +334 -0
  33. package/dist/{Overview-elpi-jpI.js → Overview-0V1dmEPw.js} +24 -25
  34. package/dist/Point-s9t7_Iee.js +262 -0
  35. package/dist/Promotion-VZCoFHHx.js +396 -0
  36. package/dist/{Queue-GvBhNEFe.js → Queue-DdoHcsXv.js} +23 -24
  37. package/dist/{Record-CbSxgo8i.js → Record-B73AsvsB.js} +10 -10
  38. package/dist/Review-eEJG7-gc.js +621 -0
  39. package/dist/ReviewFacebookCallback-Cq1fGEP3.js +243 -0
  40. package/dist/ReviewGoogleCallback-C7BBKqnK.js +213 -0
  41. package/dist/{Reward-QCGlrq89.js → Reward-DKFT9MmI.js} +16 -16
  42. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DSRvoo9z.js → RewardGroup.vue_vue_type_script_setup_true_lang-vbTI-3-L.js} +13 -14
  43. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dc4daP4P.js +1912 -0
  44. package/dist/{Segment-5PndnEUa.js → Segment-RAMBNzZd.js} +273 -274
  45. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-DXR7bpzY.js → SelectItems.vue_vue_type_script_setup_true_lang-pQmd43cO.js} +23 -23
  46. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DmITlNtt.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-PwedwyBw.js} +12 -12
  47. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-rN37l0uX.js +226 -0
  48. package/dist/Setting--t7CPcWL.js +2039 -0
  49. package/dist/SettingAdvertisements-BzhckLOK.js +264 -0
  50. package/dist/Store-Dnax6l9z.js +1996 -0
  51. package/dist/StoreRewards-BIdtA-W4.js +535 -0
  52. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B__Nqwzg.js +1129 -0
  53. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-on00idd9.js +7007 -0
  54. package/dist/{Tier-BKKxG29r.js → Tier-Ch63LeNc.js} +561 -480
  55. package/dist/{Title-CReZgw8V.js → Title-wOMe2o3w.js} +151 -149
  56. package/dist/{Transaction-HWCmSVaJ.js → Transaction-CpkfV_sQ.js} +2 -2
  57. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D00AchXo.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-MPlAwheJ.js} +7 -7
  58. package/dist/Voucher-DlOZmlyt.js +421 -0
  59. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DBAk4tDY.js +421 -0
  60. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXF39yC1.js → ZodTextField.vue_vue_type_script_setup_true_lang-BhCfP2wn.js} +2 -2
  61. package/dist/app-nACimuOe.js +59309 -0
  62. package/dist/app.js +1 -1
  63. package/dist/{business-Bc-EMd2p.js → business-BpM7Eni_.js} +11 -8
  64. package/dist/campaign-BaSTB-19.js +219 -0
  65. package/dist/campaign-CN7MibEN.js +253 -0
  66. package/dist/campaign.enum-CW4ESvMk.js +26 -0
  67. package/dist/campaign.fn-DPMaaXjP.js +776 -0
  68. package/dist/{collectible.enum-C4dM8khp.js → collectible.enum-_Bg6BIol.js} +1 -1
  69. package/dist/{collection.fn-AjDNdFe1.js → collection.fn-D86VQVrc.js} +2 -2
  70. package/dist/dto-By8psmkB.js +222 -0
  71. package/dist/duplicateCampaign-AVfDsabR.js +51 -0
  72. package/dist/effect-CCB9eCEr.js +89 -0
  73. package/dist/{email-addresses-B0SzUCQM.js → email-addresses-CyMOiGPR.js} +2 -2
  74. package/dist/{export-Bgz6WcNZ.js → export-DPUTGKPb.js} +4 -4
  75. package/dist/{helper-B1vFwohM.js → helper-CYKFnu8y.js} +22 -7
  76. package/dist/index-43V5T9JA.js +28899 -0
  77. package/dist/{index-DVQnrex_.js → index-9FXa-6Mk.js} +3 -3
  78. package/dist/{index-26SopNpv.js → index-B9vArh0F.js} +1 -1
  79. package/dist/index-BF2vcn02.js +3431 -0
  80. package/dist/{index-BIRmS75g.js → index-BPBdEGEz.js} +1 -1
  81. package/dist/index-BTaTuuEo.js +48 -0
  82. package/dist/{index-Cm2sBagk.js → index-Beq-ShJI.js} +1 -1
  83. package/dist/{index-CSQY21Zb.js → index-BxGFddJP.js} +3 -3
  84. package/dist/index-C0veCCui.js +85 -0
  85. package/dist/index-C0yZzlB3.js +8912 -0
  86. package/dist/index-CJy_KEtq.js +30289 -0
  87. package/dist/{index-DwT9RLst.js → index-CZRA2IY5.js} +23 -12
  88. package/dist/{index-DT2viYsL.js → index-Cpff1wjo.js} +617 -191
  89. package/dist/index-CuvNtC_M.js +61 -0
  90. package/dist/{index.esm2017-BAIN70_n.js → index.esm2017-DHrbC5Ry.js} +185 -185
  91. package/dist/{loading-C6Ouh0mG.js → loading-BSMi2eIc.js} +1 -1
  92. package/dist/{lodash-B5I3zXaY.js → lodash-DZxxJH2N.js} +1 -1
  93. package/dist/{membership-DU0BwIj8.js → membership-CWkspNDR.js} +3 -3
  94. package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
  95. package/dist/{money-Bg7GuE5s.js → money-CSBC-3Ol.js} +1 -1
  96. package/dist/{number-Ddmqo5D_.js → number-CeqAGZy9.js} +1 -1
  97. package/dist/objectid-C_sYOjBD.js +145 -0
  98. package/dist/{campaign-BeF8kTyg.js → plugins-B37e5K6S.js} +784 -777
  99. package/dist/remy-DM_pSPd3.js +46 -0
  100. package/dist/{reward-CN4gvn4c.js → reward-BHf9o7F7.js} +1 -1
  101. package/dist/{rule-CpiqqR0c.js → rule-CAOC63go.js} +505 -487
  102. package/dist/rule-builder-BTxbYw5Z.js +102 -0
  103. package/dist/style.css +11 -2
  104. package/dist/template-DHmXFTjv.js +188 -0
  105. package/dist/timezone-C9EUfUmm.js +1156 -0
  106. package/dist/trigger--TbXeeFT.js +213 -0
  107. package/dist/usePagination-Lr6F7nYH.js +220 -0
  108. package/dist/user-DOc3B6F_.js +55 -0
  109. package/dist/{vue-i18n-DVmD9I_o.js → vue-i18n-DQbt3scE.js} +409 -409
  110. package/dist/{xlsx-qJHsnW7k.js → xlsx-QxmpwFgC.js} +1 -1
  111. package/dist/{zod-Bg2FbC-D.js → zod-OfQMlh-A.js} +32 -31
  112. package/package.json +14 -6
  113. package/dist/AuditLogs-DW4rwNOn.js +0 -1887
  114. package/dist/Broadcast-Dhc0j16O.js +0 -227
  115. package/dist/Collections-CsUJEmqz.js +0 -465
  116. package/dist/Credit-Mqa-0XJd.js +0 -222
  117. package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-DLnvDVgf.js +0 -108
  118. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DWWLxIq-.js +0 -2185
  119. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BiQGZeDc.js +0 -347
  120. package/dist/Experience-BD5C3old.js +0 -223
  121. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-d8rh38tD.js +0 -114
  122. package/dist/Game-D4xsi8Ym.js +0 -278
  123. package/dist/Marketing-axcQYl8k.js +0 -20073
  124. package/dist/Mission-BHZiL-GH.js +0 -296
  125. package/dist/Point-gKvdggAl.js +0 -226
  126. package/dist/Promotion-7x2F_sFX.js +0 -289
  127. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-AuN9NgcG.js +0 -1751
  128. package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-DTlv8ZAn.js +0 -147
  129. package/dist/Setting-Cab47wfH.js +0 -1936
  130. package/dist/Store-BFL3T9B5.js +0 -1842
  131. package/dist/StoreRewards-C43dCJtM.js +0 -423
  132. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-aAj5-nzZ.js +0 -1029
  133. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-K3OPSYrF.js +0 -139
  134. package/dist/Voucher-BhUAcPZg.js +0 -384
  135. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-C0YNez2L.js +0 -419
  136. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  137. package/dist/app-BGaUIdCr.js +0 -7086
  138. package/dist/app-DccKBdW_.js +0 -33357
  139. package/dist/campaign-DbJZEU7P.js +0 -96
  140. package/dist/campaign.enum-PBKYGUQY.js +0 -20
  141. package/dist/campaign.fn-Cq-4LfQj.js +0 -758
  142. package/dist/dto-8NvMMYAb.js +0 -214
  143. package/dist/effect-DZhcEQ5g.js +0 -78
  144. package/dist/index-CQQedv0M.js +0 -32260
  145. package/dist/index-CTgQRqQR.js +0 -30038
  146. package/dist/index-CsaQJMAR.js +0 -66
  147. package/dist/index-DGaywhpY.js +0 -76
  148. package/dist/index-DOfLDlI8.js +0 -8861
  149. package/dist/index-DVpAocyR.js +0 -3120
  150. package/dist/index-DlJGd8RC.js +0 -121
  151. package/dist/index-Dm65CTdy.js +0 -38
  152. package/dist/objectid-MCaJXAgq.js +0 -145
  153. package/dist/plugins-C-CRzeyC.js +0 -208
  154. package/dist/remy-vue-client-Cpppk9h-.js +0 -1693
  155. package/dist/rule-builder-DmkJng-x.js +0 -89
  156. package/dist/template-DTZgnkl5.js +0 -190
  157. package/dist/trigger-CPjJ73Rc.js +0 -144
  158. package/dist/usePagination-BeF5K3M7.js +0 -223
  159. package/dist/user-8VIt8A1x.js +0 -54
@@ -1,8 +1,8 @@
1
- import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as S, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as j, createCommentVNode as B } from "vue";
2
- import { J as D } from "./app-DccKBdW_.js";
3
- import "./index-CQQedv0M.js";
1
+ import { defineComponent as N, computed as f, ref as V, onMounted as H, resolveComponent as _, openBlock as c, createElementBlock as u, createVNode as i, withCtx as F, createElementVNode as p, toDisplayString as q, normalizeClass as A, Fragment as x, renderList as S, createCommentVNode as B } from "vue";
2
+ import { F as D } from "./app-nACimuOe.js";
3
+ import "./index-CJy_KEtq.js";
4
4
  import { c as E } from "./object-qECH92oz.js";
5
- const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 items-center w-full" }, T = { class: "flex grow items-center" }, $ = { class: "grow text-fm-color-typo-secondary" }, z = { key: 0 }, K = { class: "px-16" }, X = /* @__PURE__ */ N({
5
+ const M = { class: "flex flex-col flex-nowrap" }, T = { class: "flex gap-16 items-center w-full" }, $ = { class: "flex grow items-center" }, z = { class: "grow text-fm-color-typo-secondary" }, K = { key: 0 }, J = { class: "px-16" }, X = /* @__PURE__ */ N({
6
6
  __name: "SelectItems",
7
7
  props: {
8
8
  initialValue: {
@@ -22,8 +22,8 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
22
22
  default: 380
23
23
  }
24
24
  },
25
- setup(F, { expose: O }) {
26
- const m = F, b = D(), w = f(() => b.menu.value || {
25
+ setup(j, { expose: O }) {
26
+ const m = j, b = D(), w = f(() => b.menu.value || {
27
27
  _id: "",
28
28
  modules: {
29
29
  catalog: [],
@@ -78,7 +78,7 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
78
78
  return n ? Object.entries(C.value).reduce((e, [t, l]) => {
79
79
  if (l.name.toLowerCase().includes(n))
80
80
  return e[t] = l, e;
81
- const a = Object.entries(l.items).reduce((d, [h, o]) => (o.name.toLowerCase().includes(n) && (d[h] = o), d), {});
81
+ const a = Object.entries(l.items).reduce((d, [g, o]) => (o.name.toLowerCase().includes(n) && (d[g] = o), d), {});
82
82
  return Object.keys(a).length > 0 && (e[t] = { ...l, items: a }), e;
83
83
  }, {}) : C.value;
84
84
  }), s = V({}), y = V(""), G = f(() => Object.values(s.value).filter((n) => !!n).length);
@@ -88,12 +88,12 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
88
88
  H(async () => {
89
89
  await b.store.getMenu(), I(m.initialValue);
90
90
  });
91
- function g(n) {
91
+ function h(n) {
92
92
  const e = Object.keys(v.value[n].items), t = e.filter((l) => s.value[l]);
93
93
  return t.length ? t.length === e.length ? !0 : null : !1;
94
94
  }
95
95
  function U(n) {
96
- const e = Object.keys(v.value[n].items), t = g(n), l = E(s.value);
96
+ const e = Object.keys(v.value[n].items), t = h(n), l = E(s.value);
97
97
  for (const a of e)
98
98
  l[a] = t !== !0;
99
99
  s.value = l;
@@ -107,21 +107,21 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
107
107
  m.onComplete(n);
108
108
  }
109
109
  }), (n, e) => {
110
- const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), h = _("fm-list");
111
- return c(), u("div", J, [
110
+ const t = _("fm-button"), l = _("FmTextField"), a = _("fm-list-item"), d = _("fm-checkbox"), g = _("fm-list");
111
+ return c(), u("div", M, [
112
112
  i(a, {
113
113
  tag: "div",
114
114
  clickable: !1
115
115
  }, {
116
- default: S(() => [
117
- p("div", M, [
118
- p("div", T, [
116
+ default: F(() => [
117
+ p("div", T, [
118
+ p("div", $, [
119
119
  i(t, {
120
120
  icon: "sync",
121
121
  variant: "tertiary",
122
122
  onClick: e[0] || (e[0] = () => I([]))
123
123
  }),
124
- p("span", $, q(G.value) + " product(s) selected ", 1)
124
+ p("span", z, q(G.value) + " product(s) selected ", 1)
125
125
  ]),
126
126
  i(l, {
127
127
  modelValue: y.value,
@@ -134,18 +134,18 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
134
134
  ]),
135
135
  _: 1
136
136
  }),
137
- i(h, {
137
+ i(g, {
138
138
  class: A(["grow overflow-y-auto", `max-h-${m.maxHeight ? `[${m.maxHeight}px]` : "full"}`])
139
139
  }, {
140
- default: S(() => [
141
- (c(!0), u(x, null, j(v.value, (o) => (c(), u(x, {
140
+ default: F(() => [
141
+ (c(!0), u(x, null, S(v.value, (o) => (c(), u(x, {
142
142
  key: o.id
143
143
  }, [
144
- Object.keys(o.items).length > 0 ? (c(), u("div", z, [
145
- p("div", K, [
144
+ Object.keys(o.items).length > 0 ? (c(), u("div", K, [
145
+ p("div", J, [
146
146
  i(d, {
147
- "model-value": g(o.id) ?? !1,
148
- indeterminate: g(o.id) === null,
147
+ "model-value": h(o.id) ?? !1,
148
+ indeterminate: h(o.id) === null,
149
149
  label: o.name,
150
150
  value: "",
151
151
  name: "",
@@ -154,7 +154,7 @@ const J = { class: "flex flex-col flex-nowrap" }, M = { class: "flex gap-16 item
154
154
  "onUpdate:modelValue": () => U(o.id)
155
155
  }, null, 8, ["model-value", "indeterminate", "label", "onUpdate:modelValue"])
156
156
  ]),
157
- (c(!0), u(x, null, j(o.items, (r) => (c(), u("div", {
157
+ (c(!0), u(x, null, S(o.items, (r) => (c(), u("div", {
158
158
  key: r.id,
159
159
  class: "pl-48"
160
160
  }, [
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as L, ref as p, computed as C, onMounted as P, resolveComponent as i, openBlock as $, createBlock as D, unref as e, isRef as H, withCtx as S, createElementVNode as v, createVNode as c, toDisplayString as w } from "vue";
2
- import { u as O } from "./loading-C6Ouh0mG.js";
3
- import { p as Z } from "./plugins-C-CRzeyC.js";
2
+ import { u as O } from "./loading-BSMi2eIc.js";
3
+ import { p as Z } from "./plugins-B37e5K6S.js";
4
4
  import { u as q } from "./app-wDQR6dpb.js";
5
- import { m as z } from "./index-DGaywhpY.js";
6
- import "./index-DT2viYsL.js";
7
- import { b as G } from "./index-DVpAocyR.js";
8
- import "./index-DOfLDlI8.js";
9
- import "./index-Dm65CTdy.js";
10
- import "./index-CSQY21Zb.js";
11
- import { Z as d } from "./zod-Bg2FbC-D.js";
12
- import { z as Y } from "./app-BGaUIdCr.js";
13
- import { u as j } from "./vue-i18n-DVmD9I_o.js";
14
- import { c as J } from "./index-DlJGd8RC.js";
5
+ import { m as z } from "./index-C0veCCui.js";
6
+ import "./index-Cpff1wjo.js";
7
+ import { b as G } from "./index-BF2vcn02.js";
8
+ import "./index-C0yZzlB3.js";
9
+ import "./index-CJy_KEtq.js";
10
+ import "./index-BxGFddJP.js";
11
+ import { Z as d } from "./zod-OfQMlh-A.js";
12
+ import { z as Y } from "./app-nACimuOe.js";
13
+ import { u as j } from "./vue-i18n-DQbt3scE.js";
14
+ import { c as J } from "./campaign-BaSTB-19.js";
15
15
  const K = { class: "fm-typo-en-body-lg-600" }, Q = { class: "fm-typo-en-body-lg-400" }, W = { class: "flex items-center gap-8" }, fe = /* @__PURE__ */ L({
16
16
  __name: "SendCollectionSheet",
17
17
  emits: ["success"],
@@ -0,0 +1,226 @@
1
+ import { defineComponent as O, ref as p, computed as g, watch as T, onMounted as q, resolveComponent as x, openBlock as I, createBlock as G, unref as t, isRef as k, withCtx as z, createElementVNode as n, createVNode as s, toDisplayString as f, createElementBlock as H, createCommentVNode as K } from "vue";
2
+ import { J as Q } from "./JsonViewer-v8_C7l5N.js";
3
+ import { _ as F } from "./FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js";
4
+ import { u as W } from "./loading-BSMi2eIc.js";
5
+ import { u as X } from "./app-wDQR6dpb.js";
6
+ import { l as Y } from "./lodash-DZxxJH2N.js";
7
+ import { m as Z } from "./index-C0veCCui.js";
8
+ import { c as ee } from "./campaign-BaSTB-19.js";
9
+ const ae = { class: "space-y-16" }, te = { class: "fm-typo-en-body-md-600" }, oe = { class: "flex items-center justify-end" }, le = {
10
+ key: 0,
11
+ class: "basis-72 bg-white flex items-center justify-between px-24 pt-6 border-t border-fm-color-border"
12
+ }, ne = { class: "flex gap-24 items-center justify-between xs:hidden xs:invisible" }, se = { class: "flex gap-8 items-center" }, ie = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, re = { class: "flex gap-8 items-center" }, ue = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary xs:mr-auto" }, de = { class: "flex gap-8" }, ce = { class: "flex items-center gap-8" }, Se = /* @__PURE__ */ O({
13
+ __name: "SendVoucherSheet",
14
+ emits: ["success"],
15
+ setup(me, { expose: M, emit: R }) {
16
+ const { minor: j } = W, h = p(""), r = p({}), N = R, m = p(!1), i = p([]);
17
+ function P(o) {
18
+ m.value = !0, h.value = o.campaignId, i.value = [];
19
+ }
20
+ function S() {
21
+ m.value = !1;
22
+ }
23
+ const B = [
24
+ {
25
+ header: "Name",
26
+ accessorFn: (o) => o.name || "No Profile"
27
+ },
28
+ {
29
+ header: "Phone",
30
+ accessorFn: (o) => o.phoneNumber || "-"
31
+ }
32
+ ], e = p({
33
+ searchValue: "",
34
+ pageSize: 10,
35
+ pageCount: 0,
36
+ pageIndex: 0,
37
+ totalRows: 0,
38
+ isLoading: !1
39
+ }), u = p([]), L = g(() => e.value.pageIndex + 1), _ = g(
40
+ () => e.value.pageIndex * e.value.pageSize
41
+ ), U = g(
42
+ () => Math.min(
43
+ _.value + e.value.pageSize,
44
+ e.value.totalRows
45
+ )
46
+ ), w = g(() => e.value.pageIndex > 0), C = g(
47
+ () => e.value.pageIndex < e.value.pageCount - 1
48
+ ), b = async (o) => {
49
+ e.value.pageSize = o.pageSize, e.value.pageIndex = o.pageIndex, e.value.isLoading = !0, u.value = [];
50
+ try {
51
+ const a = await Z.read({
52
+ limit: o.pageSize,
53
+ skip: o.pageIndex,
54
+ sortBy: "_id",
55
+ search: e.value.searchValue,
56
+ descending: !1
57
+ });
58
+ u.value = a.resources, e.value.totalRows = a.meta.totalResources ?? 0, e.value.pageCount = a.meta.totalPages ?? 0, r.value = {}, i.value.forEach((d) => {
59
+ const y = u.value.findIndex((c) => c._id == d);
60
+ y > -1 && (r.value[y] = !0);
61
+ });
62
+ } finally {
63
+ e.value.isLoading = !1;
64
+ }
65
+ }, $ = Y.debounce(async () => {
66
+ await b({ pageSize: e.value.pageSize, pageIndex: 0 });
67
+ }, 500), v = async (o) => {
68
+ await b({ pageSize: e.value.pageSize, pageIndex: o });
69
+ }, A = async (o) => {
70
+ await b({ pageSize: o, pageIndex: 0 });
71
+ };
72
+ function E() {
73
+ u.value.length > 0 && (i.value = i.value.filter(
74
+ (o) => !u.value.some((a) => a._id === o) || // Keep if not in current page
75
+ Object.entries(r.value).some(
76
+ ([a, d]) => d && u.value[a]._id === o
77
+ // Keep if selected in current page
78
+ )
79
+ ));
80
+ for (const [o, a] of Object.entries(r.value))
81
+ if (a) {
82
+ const d = u.value[o]._id;
83
+ i.value.includes(d) || i.value.push(d);
84
+ }
85
+ }
86
+ async function D(o) {
87
+ i.value.length < 1 || await j(
88
+ async () => {
89
+ await ee.sendCollection(h.value, {
90
+ memberId: i.value
91
+ }), await N("success"), S();
92
+ },
93
+ {
94
+ message: "Sending claim(s)",
95
+ successMessage: "Claim(s) created"
96
+ }
97
+ );
98
+ }
99
+ return T(r, E, { deep: !0 }), M({
100
+ showSheet: P,
101
+ hideSheet: S
102
+ }), q(async () => {
103
+ await b(e.value);
104
+ }), (o, a) => {
105
+ const d = x("FmSearch"), y = x("FmTable"), c = x("FmButton"), J = x("FmSideSheet");
106
+ return I(), G(J, {
107
+ "max-width": 560,
108
+ "dismiss-away": !0,
109
+ header: "Send voucher to",
110
+ modelValue: t(m),
111
+ "onUpdate:modelValue": [
112
+ a[8] || (a[8] = (l) => k(m) ? m.value = l : null),
113
+ a[9] || (a[9] = (l) => m.value = l)
114
+ ]
115
+ }, {
116
+ "side-sheet-footer": z(() => [
117
+ n("div", ce, [
118
+ s(c, {
119
+ label: "Send",
120
+ loading: t(X)().isLoading,
121
+ onClick: D
122
+ }, null, 8, ["loading"]),
123
+ s(c, {
124
+ label: "Cancel",
125
+ type: "button",
126
+ variant: "tertiary",
127
+ onClick: a[7] || (a[7] = (l) => m.value = !1)
128
+ })
129
+ ])
130
+ ]),
131
+ default: z(() => [
132
+ s(Q, { json: t(i) }, null, 8, ["json"]),
133
+ n("div", ae, [
134
+ n("div", te, f(t(i).length) + " members selected ", 1),
135
+ n("div", oe, [
136
+ s(d, {
137
+ class: "mt-4",
138
+ modelValue: t(e).searchValue,
139
+ "onUpdate:modelValue": [
140
+ a[0] || (a[0] = (l) => t(e).searchValue = l),
141
+ t($)
142
+ ],
143
+ placeholder: "Search Member",
144
+ collapsible: ""
145
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
146
+ ]),
147
+ s(y, {
148
+ modelValue: t(r),
149
+ "onUpdate:modelValue": a[1] || (a[1] = (l) => k(r) ? r.value = l : null),
150
+ selection: "multiple",
151
+ loading: t(e).isLoading,
152
+ "row-data": t(u),
153
+ "column-defs": B,
154
+ "page-size": t(e).pageSize,
155
+ "page-count": t(e).pageCount,
156
+ "fetch-fn": void 0,
157
+ "hide-footer": ""
158
+ }, null, 8, ["modelValue", "loading", "row-data", "page-size", "page-count"]),
159
+ t(e).totalRows > t(e).pageSize ? (I(), H("div", le, [
160
+ n("div", ne, [
161
+ n("div", se, [
162
+ a[10] || (a[10] = n("span", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, " Items per page: ", -1)),
163
+ s(F, {
164
+ items: [
165
+ { label: "10", value: 10 },
166
+ { label: "20", value: 20 },
167
+ { label: "50", value: 50 }
168
+ ],
169
+ value: t(e).pageSize,
170
+ "onUpdate:modelValue": A
171
+ }, null, 8, ["value"])
172
+ ]),
173
+ n("span", ie, f(t(_) + 1) + " - " + f(t(U)) + " of " + f(t(e).totalRows) + " items ", 1)
174
+ ]),
175
+ n("div", re, [
176
+ s(F, {
177
+ items: Array.from(Array(t(e).pageCount), (l, V) => ({
178
+ label: (V + 1).toString(),
179
+ value: V + 1
180
+ })),
181
+ value: t(L),
182
+ "onUpdate:modelValue": a[2] || (a[2] = (l) => v(l - 1))
183
+ }, null, 8, ["items", "value"]),
184
+ n("span", ue, " of " + f(t(e).pageCount) + " pages ", 1),
185
+ n("div", de, [
186
+ s(c, {
187
+ disabled: !t(w),
188
+ icon: "first_page",
189
+ "icon-color": "neutral-black",
190
+ variant: "tertiary",
191
+ onClick: a[3] || (a[3] = (l) => v(0))
192
+ }, null, 8, ["disabled"]),
193
+ s(c, {
194
+ disabled: !t(w),
195
+ icon: "chevron_left",
196
+ "icon-color": "neutral-black",
197
+ variant: "tertiary",
198
+ onClick: a[4] || (a[4] = (l) => v(t(e).pageIndex - 1))
199
+ }, null, 8, ["disabled"]),
200
+ s(c, {
201
+ disabled: !t(C),
202
+ icon: "chevron_right",
203
+ "icon-color": "neutral-black",
204
+ variant: "tertiary",
205
+ onClick: a[5] || (a[5] = (l) => v(t(e).pageIndex + 1))
206
+ }, null, 8, ["disabled"]),
207
+ s(c, {
208
+ disabled: !t(C),
209
+ icon: "last_page",
210
+ "icon-color": "neutral-black",
211
+ variant: "tertiary",
212
+ onClick: a[6] || (a[6] = (l) => v(t(e).pageCount - 1))
213
+ }, null, 8, ["disabled"])
214
+ ])
215
+ ])
216
+ ])) : K("", !0)
217
+ ])
218
+ ]),
219
+ _: 1
220
+ }, 8, ["modelValue"]);
221
+ };
222
+ }
223
+ });
224
+ export {
225
+ Se as _
226
+ };