@feedmepos/mf-connect 0.1.126-prod → 0.1.127-dev

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 (155) hide show
  1. package/dist/{App-DRHHPaMz.js → App-CLrxVFgX.js} +224 -216
  2. package/dist/AuditLogs-DYlfToAk.js +2016 -0
  3. package/dist/{Bin-FkcYLSTm.js → Bin-C0CugBW4.js} +8 -8
  4. package/dist/{Broadcast-Cgqp_BMa.js → Broadcast-DhVQa_WW.js} +22 -21
  5. package/dist/{CampaignAnalytic-kKZ_BwW0.js → CampaignAnalytic-6jeG5U90.js} +97 -97
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CX0mWLjO.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cxydrkof.js} +9 -10
  7. package/dist/{Card-Bu1y37hV.js → Card-cpLj34Oy.js} +23 -23
  8. package/dist/{Collections-B3mJkBCT.js → Collections-CdRpJuHO.js} +197 -185
  9. package/dist/{Credit-Bn-2EcVy.js → Credit-E_N_yfnJ.js} +21 -20
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cz7pZ7LD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Dq-2vUqT.js} +1 -1
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CSXO2bYC.js +4584 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js → EffectSheet.vue_vue_type_style_index_0_lang-BeQZjLIw.js} +33 -33
  13. package/dist/{Experience-CunbmoAu.js → Experience-D9i0ax4C.js} +32 -31
  14. package/dist/{FileSaver.min-ChFSxYyS.js → FileSaver.min-BOE2RBne.js} +1 -1
  15. package/dist/{Game-dFDwx_UJ.js → Game-CirwX_l1.js} +19 -18
  16. package/dist/{GiftCardSetup-DYpEqqX0.js → GiftCardSetup-DpJb_azW.js} +31 -31
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxJdI6gc.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-ff6Nfvxe.js} +140 -128
  18. package/dist/{Goals-DuZzgM_K.js → Goals-TejbPs-I.js} +4 -4
  19. package/dist/Grab-CeUX-LlF.js +301 -0
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js → ImageInput.vue_vue_type_script_setup_true_lang-CnZzRDGS.js} +1 -1
  21. package/dist/{Index-BxB2ohT0.js → Index-gqWBDZBN.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-9sKJE1A5.js → LocationPicker.vue_vue_type_script_setup_true_lang-CzobgD7L.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CxBNYzcz.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DgeD1RQq.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DQzGvQ7j.js → LoyaltyDashboard-R22oQHTd.js} +82 -82
  25. package/dist/{MainLayout-MAZ1S06H.js → MainLayout-pJBEBaM-.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-CeF3LU-N.js → MainLayout.vue_vue_type_script_setup_true_lang-IX_utv2Z.js} +3 -3
  27. package/dist/{Marketing-ACF6F7be.js → Marketing-5gMwO1jV.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-B8NfkoHg.js → MarketingMaterialEdit-BaHNX_qE.js} +214 -211
  29. package/dist/{Member-rLxDUOr8.js → Member-Cd0oraEq.js} +7 -7
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DzyM1fW_.js +1322 -0
  31. package/dist/{MemberImportHistory-BuG6DmdV.js → MemberImportHistory-C_RkY3fg.js} +7 -7
  32. package/dist/{MemberList-CC6zm_I6.js → MemberList-CJK1akUC.js} +103 -105
  33. package/dist/{MemberTransactions-Bw2xu6jZ.js → MemberTransactions-DP6schuy.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js → MessageInput.vue_vue_type_script_setup_true_lang-BaivunRx.js} +12 -12
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8wdY4FnI.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DOdYyPp2.js} +1 -1
  36. package/dist/{Mission-DnEcbALs.js → Mission-DJ40IcG9.js} +22 -21
  37. package/dist/{Overview-DShFohlk.js → Overview-CaQlLSBg.js} +145 -144
  38. package/dist/{Overview-COytI5xN.js → Overview-DXHjNmIO.js} +21 -21
  39. package/dist/{Point-CWYwlx0i.js → Point-D0Qqmgai.js} +22 -21
  40. package/dist/{Promotion-LBrQYtad.js → Promotion-CQU2-tpG.js} +137 -131
  41. package/dist/{Queue-DKg5EvDM.js → Queue-B-Uki3qh.js} +46 -46
  42. package/dist/{Record--lYpawLN.js → Record-BvQ0nVja.js} +9 -9
  43. package/dist/{Review-C4pNmJ7n.js → Review-DMfBPU_D.js} +2 -2
  44. package/dist/ReviewFacebookCallback-Bq6JQ7LR.js +225 -0
  45. package/dist/{ReviewGoogleCallback-ge8fL_A-.js → ReviewGoogleCallback-Bg9PFxog.js} +5 -5
  46. package/dist/{Reward-B67r1Bpz.js → Reward-CNC0z98e.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt0Kx2--.js → RewardGroup.vue_vue_type_script_setup_true_lang-DXr-5wJE.js} +14 -14
  48. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-OznhirAU.js +1923 -0
  49. package/dist/{Segment-DeSC3z5G.js → Segment-V0ZQJkN-.js} +304 -307
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DdjC7X1V.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmFp2pst.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Crys59UO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C0IbEZMG.js} +4 -4
  52. package/dist/{Setting-DiDcMU5E.js → Setting-DCb6IIrk.js} +17 -17
  53. package/dist/{SettingAdvertisements-3wMI9egH.js → SettingAdvertisements-Dc9XfzVl.js} +12 -12
  54. package/dist/Settings-BIjIfmFI.js +286 -0
  55. package/dist/{Store-DgefqByH.js → Store-DkoB_5IF.js} +29 -29
  56. package/dist/{StoreRewards-CS2h5RVB.js → StoreRewards-a4ujLMfY.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-gPR8sn4k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UbMY0RzG.js} +25 -25
  58. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BWjb1wHV.js +7007 -0
  59. package/dist/{Tier-Cye6888q.js → Tier-1WKuUirS.js} +2583 -688
  60. package/dist/{Title-B1eJh5oy.js → Title-CznZg4jL.js} +96 -95
  61. package/dist/{Transaction-ouzdsBUx.js → Transaction-DBRQDmA3.js} +2 -2
  62. package/dist/{Upselling-CdQd2Fuk.js → Upselling-CjZvUUqn.js} +3 -3
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DS4hdSE9.js} +26 -26
  64. package/dist/{Voucher-CJJt8VlJ.js → Voucher-Di6VhoSM.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BjSzCnBw.js} +12 -12
  66. package/dist/{WhatsappAccount-DIxSP6Tp.js → WhatsappAccount-DdXadlHI.js} +6 -6
  67. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-L9Y5lAft.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-Cnlvi-GG.js} +1 -1
  68. package/dist/WhatsappBot-DwhQmZLJ.js +882 -0
  69. package/dist/{WhatsappBotLogs-D8IfLHk3.js → WhatsappBotLogs-BAglKUAZ.js} +66 -66
  70. package/dist/WhatsappBotSettings-DslJTj2X.js +945 -0
  71. package/dist/{WhatsappLayout-3rWwmGRd.js → WhatsappLayout-14847AOz.js} +3 -3
  72. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-C3N-loYJ.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-otzgv6Jh.js} +3 -3
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-D1dORvMi.js → ZodTextField.vue_vue_type_script_setup_true_lang-BEY-LOVu.js} +2 -2
  74. package/dist/{app-BXqas0p1.js → app-KbxCI4gY.js} +4204 -3400
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-DQCZiS2E.js → base.export-DH8OxNrx.js} +2 -2
  77. package/dist/business-DuKNr9P7.js +83 -0
  78. package/dist/{campaign-C2X6aa7B.js → campaign-DR5xHhgA.js} +31 -25
  79. package/dist/{campaign-DASPASQ0.js → campaign-Ddv-RZgo.js} +121 -94
  80. package/dist/{campaign.enum-BqekIiiN.js → campaign.enum-DsaSpHDQ.js} +3 -2
  81. package/dist/campaign.fn-CJlEovlZ.js +776 -0
  82. package/dist/{collectible.enum-Liy2wH3s.js → collectible.enum-CDHT9uk3.js} +1 -1
  83. package/dist/{collection.fn-C7jNdh0A.js → collection.fn-DTZs-hUX.js} +2 -2
  84. package/dist/{currency-BvBM_Io9.js → currency-1-Yhpyv5.js} +1 -1
  85. package/dist/duplicateCampaign-BncSxYSg.js +51 -0
  86. package/dist/{effect-BA1yh6Mj.js → effect-TTD5--LN.js} +1 -1
  87. package/dist/{email-addresses-haS5P7hq.js → email-addresses-pxXp67Al.js} +2 -2
  88. package/dist/{feature-flag-B4bJnuei.js → feature-flag-CFVZl4ed.js} +84 -84
  89. package/dist/google-BQK68wbe.js +5 -0
  90. package/dist/{helper-BtTBvFuA.js → helper-BC_Cl5VR.js} +1 -1
  91. package/dist/{index-ChGZ_S3V.js → index-42Wl_5UE.js} +1 -1
  92. package/dist/{index-Dm2Dvxph.js → index-BRl7Besd.js} +23 -23
  93. package/dist/{index-DAtVp1NI.js → index-BxUMqeaY.js} +2700 -2614
  94. package/dist/{index-Dg972Dfv.js → index-ByFFDLTo.js} +1 -1
  95. package/dist/{index-DtbR7I4C.js → index-CBKbnJRo.js} +9 -9
  96. package/dist/index-CGtlXLTG.js +10767 -0
  97. package/dist/{index-CH-uRaZH.js → index-CRKdLbXL.js} +71 -52
  98. package/dist/{index-B1dAoOWi.js → index-CaHkqz0W.js} +19 -6
  99. package/dist/{index-DeomfIu9.js → index-CcXMYJxc.js} +609 -252
  100. package/dist/{index-B6A6sHpy.js → index-CkiP4iG6.js} +1 -1
  101. package/dist/{index-g_SHjVWE.js → index-D1iOPNg3.js} +1 -1
  102. package/dist/{index-D-D0s8PB.js → index-D2Nq0UoL.js} +381 -235
  103. package/dist/index-D4nA0Z7e.js +19528 -0
  104. package/dist/{index-BV-YiCDM.js → index-DHw8wo7T.js} +2 -2
  105. package/dist/{index-C2rjmdar.js → index-DKOoRHPf.js} +4 -4
  106. package/dist/{index-Q-iHraJ3.js → index-DcbPYZkw.js} +26 -19
  107. package/dist/{index-C7UBk5gq.js → index-DjwrfZk3.js} +35 -17
  108. package/dist/{index-BvFq5REc.js → index-EuZfRdBT.js} +10 -10
  109. package/dist/{index-CJ-BZCvB.js → index-H4XJDOoT.js} +1315 -1243
  110. package/dist/{index-CXznvd79.js → index-ImU7YXN7.js} +4 -4
  111. package/dist/{index-BRTy6G9c.js → index-N4EzkcEu.js} +2 -2
  112. package/dist/{index-CBfVFFME.js → index-j7eLKJK3.js} +198 -198
  113. package/dist/{index.esm2017-B7iE1Ggr.js → index.esm2017-CBo4j3U1.js} +93 -93
  114. package/dist/{loading-BvlSfSVK.js → loading-COAu2l7W.js} +1 -1
  115. package/dist/{lodash-Daey2k0N.js → lodash-Bu1ipIkR.js} +1 -1
  116. package/dist/{member-import-CF9aym_y.js → member-import-CkiTJIqy.js} +2 -2
  117. package/dist/{membership-DfG-fl80.js → membership-BSEeYyiz.js} +3 -3
  118. package/dist/{money-SBIQhxqf.js → money-BOaGQSGa.js} +1 -1
  119. package/dist/{number-Cp1bFK9U.js → number-B2AC2EMT.js} +1 -1
  120. package/dist/objectid-BKw48v5L.js +145 -0
  121. package/dist/{onboarding-bjc7C8O-.js → onboarding-ClA8xAnH.js} +25 -25
  122. package/dist/{onboardingSetup-BAu9TDI6.js → onboardingSetup-DHjnq0H1.js} +2 -2
  123. package/dist/{plugins-Def73Eyk.js → plugins-DewN43sP.js} +3 -3
  124. package/dist/{reward-KecVeztH.js → reward-deDdPQiR.js} +1 -1
  125. package/dist/{rule-kMIC0vOi.js → rule-B8ifutnO.js} +572 -492
  126. package/dist/style.css +1 -1
  127. package/dist/template-z3VMmWei.js +227 -0
  128. package/dist/timezone-BxJDy-bY.js +19 -0
  129. package/dist/{transaction.fn-Bjy5utxD.js → transaction.fn-CBBhq01K.js} +2 -2
  130. package/dist/{trigger-DnnOJVUi.js → trigger-B_quLwWr.js} +9 -9
  131. package/dist/{useMarketingMaterialActions-DMrNOpok.js → useMarketingMaterialActions-DqoRLx1M.js} +4 -4
  132. package/dist/{usePagination-BCY4a-dh.js → usePagination-Q1fPttcp.js} +1 -1
  133. package/dist/{user-BTc0S1Vx.js → user-Bw6h9xn-.js} +1 -1
  134. package/dist/vue-i18n-DpCS1FnK.js +2365 -0
  135. package/dist/{xlsx-DR5oLrEs.js → xlsx--toeD6hC.js} +1 -1
  136. package/dist/{zod-CMq39HWn.js → zod-BkNAcpay.js} +1 -1
  137. package/package.json +6 -2
  138. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DIUEjCFW.js +0 -3638
  139. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Bq3UKX7v.js +0 -1308
  140. package/dist/ReviewFacebookCallback-BYXwKQNG.js +0 -238
  141. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js +0 -1884
  142. package/dist/Settings-BR6Y1DBZ.js +0 -179
  143. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js +0 -142
  144. package/dist/WhatsappBot-BXxoaz7-.js +0 -878
  145. package/dist/WhatsappBotSettings-Bq9C7pNZ.js +0 -704
  146. package/dist/business-RsRhXSh8.js +0 -82
  147. package/dist/campaign.fn-BEX99lsa.js +0 -776
  148. package/dist/google-C3S8u0mT.js +0 -4
  149. package/dist/index-C_H8jFYf.js +0 -2743
  150. package/dist/index-D9zjHXFU.js +0 -27551
  151. package/dist/objectid-BMRA1fIL.js +0 -145
  152. package/dist/rule-builder-DgU6P24U.js +0 -102
  153. package/dist/template-BH9vS8A9.js +0 -275
  154. package/dist/timezone-CMX1sJ0a.js +0 -20
  155. package/dist/vue-i18n-7BKLPLxj.js +0 -2365
package/dist/app.js CHANGED
@@ -1,6 +1,7 @@
1
- import { F as e, i as r, r as o } from "./app-BXqas0p1.js";
1
+ import "vue";
2
+ import { F as e, i as o, r as p } from "./app-KbxCI4gY.js";
2
3
  export {
3
4
  e as FmApp,
4
- r as i18nMessages,
5
- o as routes
5
+ o as i18nMessages,
6
+ p as routes
6
7
  };
@@ -1,8 +1,8 @@
1
1
  var w = Object.defineProperty;
2
2
  var y = (e, s, o) => s in e ? w(e, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[s] = o;
3
3
  var n = (e, s, o) => y(e, typeof s != "symbol" ? s + "" : s, o);
4
- import { u as x } from "./loading-BvlSfSVK.js";
5
- import { w as h, u as a } from "./xlsx-DR5oLrEs.js";
4
+ import { u as x } from "./loading-COAu2l7W.js";
5
+ import { w as h, u as a } from "./xlsx--toeD6hC.js";
6
6
  const t = {
7
7
  sortBy: "_id",
8
8
  descending: !1,
@@ -0,0 +1,83 @@
1
+ import { ref as r, computed as l } from "vue";
2
+ import { defineStore as y } from "pinia";
3
+ import { useCoreStore as I } from "@feedmepos/mf-common";
4
+ import { d as b, g as i, A as S, S as C, b as D } from "./index-EuZfRdBT.js";
5
+ const $ = {
6
+ async readSettings(e) {
7
+ try {
8
+ return i(await b(`marketing-v2/${e}/setting`).get(""));
9
+ } catch (s) {
10
+ if (console.error(JSON.stringify(s)), s instanceof S)
11
+ return {
12
+ _id: e,
13
+ business: e,
14
+ apiVersion: "v1"
15
+ };
16
+ throw s;
17
+ }
18
+ }
19
+ }, o = () => {
20
+ const e = C.getBusinessId();
21
+ if (!e) throw new Error("Invalid business ID");
22
+ return D(`businesses/${e}/location`, {
23
+ noIdRequired: !0
24
+ });
25
+ }, v = {
26
+ async read() {
27
+ return i(await o().get(""));
28
+ },
29
+ async readDevices() {
30
+ return i(await o().get("devices"));
31
+ },
32
+ async unregisterDevice(e) {
33
+ await i(await o().delete(`devices/${e}`));
34
+ },
35
+ async getOtp(e) {
36
+ return i(await o().post(`${e}/otp`));
37
+ }
38
+ }, E = y("mf-connect-business", () => {
39
+ const e = r("v2"), s = r(!1), c = r(!1), a = r([]), u = r([]);
40
+ async function d() {
41
+ const n = I().currentBusiness.value, t = await $.readSettings(n == null ? void 0 : n.id);
42
+ return c.value = t && "business" in t && t.premium == !0 || !1, s.value = t && "profileSource" in t && t.profileSource === "CRM" || !1, e.value = (t == null ? void 0 : t.apiVersion) || "v1", c.value;
43
+ }
44
+ async function p() {
45
+ return a.value = await v.read(), a.value;
46
+ }
47
+ async function f() {
48
+ return u.value = await v.readDevices(), u.value;
49
+ }
50
+ function m(n) {
51
+ return a.value.find((t) => t._id === n);
52
+ }
53
+ const g = l(() => [
54
+ { label: "All", value: null },
55
+ ...a.value.map((n) => ({
56
+ label: n.name,
57
+ value: n._id
58
+ }))
59
+ ]), w = l(() => a.value.map((n) => ({
60
+ label: `${n.code ? `${n.code} - ` : ""} ${n.name}`,
61
+ value: n._id
62
+ })));
63
+ return {
64
+ // state
65
+ version: e,
66
+ isCrmProfile: s,
67
+ isPremium: c,
68
+ locations: a,
69
+ locationDevices: u,
70
+ // actions
71
+ readPremium: d,
72
+ readLocations: p,
73
+ readLocationDevices: f,
74
+ locationById: m,
75
+ // getters
76
+ locationItems: g,
77
+ locationOptions: w
78
+ };
79
+ });
80
+ export {
81
+ v as l,
82
+ E as u
83
+ };
@@ -1,14 +1,14 @@
1
1
  import { defineStore as d } from "pinia";
2
- import { reactive as f, onMounted as b, ref as a } from "vue";
3
- import { c } from "./index-BV-YiCDM.js";
4
- import { g as i, S as I, b as g } from "./index-BvFq5REc.js";
2
+ import { reactive as b, onMounted as f, ref as s } from "vue";
3
+ import { c } from "./index-DHw8wo7T.js";
4
+ import { g as i, S as g, b as h } from "./index-EuZfRdBT.js";
5
5
  const p = () => {
6
- const e = I.getBusinessId();
6
+ const e = g.getBusinessId();
7
7
  if (!e) throw new Error("Invalid business ID");
8
- return g(`businesses/${e}/campaigns`, {
8
+ return h(`businesses/${e}/campaigns`, {
9
9
  noIdRequired: !0
10
10
  });
11
- }, h = {
11
+ }, I = {
12
12
  async readAll() {
13
13
  return i(await p().get("templates"));
14
14
  },
@@ -17,8 +17,8 @@ const p = () => {
17
17
  await p().get(`templates/${e}`)
18
18
  );
19
19
  }
20
- }, S = d("mf-connect-campaign", () => {
21
- const e = f({
20
+ }, A = d("mf-connect-campaign", () => {
21
+ const e = b({
22
22
  promotion: [],
23
23
  voucher: [],
24
24
  broadcast: [],
@@ -27,12 +27,13 @@ const p = () => {
27
27
  credit: [],
28
28
  token: [],
29
29
  mission: [],
30
+ grab: [],
30
31
  all: []
31
32
  });
32
- b(() => {
33
+ f(() => {
33
34
  console.log("🔧 CampaignStore Installed");
34
35
  });
35
- const t = a([]), r = a([]), n = a([]);
36
+ const t = s([]), r = s([]), n = s([]);
36
37
  async function u(k) {
37
38
  const o = await c.readAll({
38
39
  limit: 1e3,
@@ -40,34 +41,39 @@ const p = () => {
40
41
  sortBy: "_id",
41
42
  descending: !0
42
43
  });
43
- Object.keys(e).forEach((s) => {
44
- e[s] = [];
45
- }), e.all = o.resources.filter((s) => s.type !== "MEMBERSHIP");
46
- for (const s of o.resources)
47
- switch (s.type) {
44
+ Object.keys(e).forEach((a) => {
45
+ e[a] = [];
46
+ }), e.all = o.resources.filter(
47
+ (a) => a.type !== "MEMBERSHIP"
48
+ );
49
+ for (const a of o.resources)
50
+ switch (a.type) {
48
51
  case "PROMOTION":
49
- e.promotion.push(s);
52
+ e.promotion.push(a);
50
53
  break;
51
54
  case "VOUCHER":
52
- e.voucher.push(s), n.value.push(s);
55
+ e.voucher.push(a), n.value.push(a);
53
56
  break;
54
57
  case "BROADCAST":
55
- ["SCHEDULE", "FEEDBACK"].includes(s.event.type) && e.broadcast.push(s);
58
+ ["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
56
59
  break;
57
60
  case "POINT":
58
- e.experience.push(s);
61
+ e.experience.push(a);
59
62
  break;
60
63
  case "COIN":
61
- e.point.push(s);
64
+ e.point.push(a);
62
65
  break;
63
66
  case "CREDIT":
64
- e.credit.push(s);
67
+ e.credit.push(a);
65
68
  break;
66
69
  case "GAME":
67
- e.token.push(s);
70
+ e.token.push(a);
68
71
  break;
69
72
  case "MISSION":
70
- e.mission.push(s);
73
+ e.mission.push(a);
74
+ break;
75
+ case "GRAB":
76
+ e.grab.push(a);
71
77
  break;
72
78
  }
73
79
  }
@@ -75,7 +81,7 @@ const p = () => {
75
81
  r.value = await c.readGroups();
76
82
  }
77
83
  async function m() {
78
- t.value = await h.readAll();
84
+ t.value = await I.readAll();
79
85
  }
80
86
  return {
81
87
  // State
@@ -90,5 +96,5 @@ const p = () => {
90
96
  };
91
97
  });
92
98
  export {
93
- S as u
99
+ A as u
94
100
  };
@@ -1,27 +1,27 @@
1
1
  import { h as u } from "./moment-D7p2TMB-.js";
2
- import "./index-D-D0s8PB.js";
3
- import { e as f } from "./effect-BA1yh6Mj.js";
4
- import { components as g } from "@feedmepos/ui-library";
5
- import { i as b } from "./rule-builder-DgU6P24U.js";
6
- import { c as O } from "./rule-kMIC0vOi.js";
7
- import { u as E } from "./business-RsRhXSh8.js";
8
- import { C as m } from "./campaign.fn-BEX99lsa.js";
9
- import { g as h, t as d } from "./index-CBfVFFME.js";
10
- import { c as y } from "./string-Gcy5IM_H.js";
11
- import { i as c } from "./plugins-Def73Eyk.js";
12
- import { h as p } from "vue";
13
- import { F as s } from "./campaign.enum-BqekIiiN.js";
14
- const N = [
2
+ import "./index-D2Nq0UoL.js";
3
+ import { e as f } from "./effect-TTD5--LN.js";
4
+ import { components as h } from "@feedmepos/ui-library";
5
+ import { a as E } from "./index-CcXMYJxc.js";
6
+ import { c as N } from "./rule-B8ifutnO.js";
7
+ import { u as I } from "./business-DuKNr9P7.js";
8
+ import { C as m } from "./campaign.fn-CJlEovlZ.js";
9
+ import { g as C, t as y } from "./index-j7eLKJK3.js";
10
+ import { c as O } from "./string-Gcy5IM_H.js";
11
+ import { i as g } from "./plugins-DewN43sP.js";
12
+ import { h as l } from "vue";
13
+ import { F as s } from "./campaign.enum-DsaSpHDQ.js";
14
+ const S = [
15
15
  "APP_INBOX",
16
16
  "PUSH",
17
17
  "SMS",
18
18
  "EMAIL",
19
19
  "WHATSAPP"
20
- ], I = [...N];
21
- function G(t) {
22
- return I.includes(t);
20
+ ], R = [...S];
21
+ function X(t) {
22
+ return R.includes(t);
23
23
  }
24
- function C(t, e) {
24
+ function b(t, e) {
25
25
  return t === "APP_INBOX" ? {
26
26
  title: "",
27
27
  previewText: "",
@@ -40,17 +40,17 @@ function C(t, e) {
40
40
  variables: e
41
41
  };
42
42
  }
43
- function j(t, e, n = []) {
43
+ function z(t, e, n = []) {
44
44
  return t.channels.includes(e) ? t : {
45
45
  ...t,
46
46
  channels: [...t.channels, e],
47
47
  content: {
48
48
  ...t.content,
49
- [e]: t.content[e] ?? C(e, n)
49
+ [e]: t.content[e] ?? b(e, n)
50
50
  }
51
51
  };
52
52
  }
53
- function V(t, e) {
53
+ function W(t, e) {
54
54
  const n = { ...t.content };
55
55
  return delete n[e], {
56
56
  ...t,
@@ -58,99 +58,111 @@ function V(t, e) {
58
58
  content: n
59
59
  };
60
60
  }
61
- function X(t, e, n) {
61
+ function J(t, e, n) {
62
62
  return {
63
63
  ...t,
64
64
  content: { ...t.content, [e]: n }
65
65
  };
66
66
  }
67
- function z(t, e, n) {
67
+ function K(t, e, n) {
68
68
  const o = t.channels.indexOf(e), r = o + n;
69
69
  if (o < 0 || r < 0 || r >= t.channels.length) return t;
70
70
  const a = [...t.channels];
71
71
  return [a[o], a[r]] = [a[r], a[o]], { ...t, channels: a };
72
72
  }
73
- function W(t, e, n = []) {
73
+ function q(t, e, n = []) {
74
74
  const [o, ...r] = t.channels;
75
75
  if (o === e) return t;
76
76
  const a = {
77
77
  ...t.content,
78
- [e]: t.content[e] ?? C(e, n)
78
+ [e]: t.content[e] ?? b(e, n)
79
79
  };
80
80
  return o && delete a[o], {
81
81
  ...t,
82
- channels: [e, ...r.filter((l) => l !== e)],
82
+ channels: [e, ...r.filter((p) => p !== e)],
83
83
  content: a
84
84
  };
85
85
  }
86
- function J(t, e) {
86
+ function Q(t, e) {
87
87
  if (!e) return !1;
88
88
  const n = t.content[e];
89
89
  return n ? ["title", "previewText", "content", "body"].some(
90
90
  (o) => typeof n[o] == "string" && !!n[o].trim()
91
91
  ) : !1;
92
92
  }
93
- function K(t, e) {
93
+ function Z(t, e) {
94
94
  return { ...t, mode: e };
95
95
  }
96
- function q(t, e) {
96
+ function tt(t, e) {
97
97
  const n = t.content[e];
98
98
  if (!n) return !1;
99
99
  if (e === "APP_INBOX") {
100
100
  const o = n, r = (o.buttons ?? []).every(
101
- (a) => a.label.trim().length > 0 && h.safeParse(a.url ?? "").success
101
+ (a) => a.label.trim().length > 0 && C.safeParse(a.url ?? "").success
102
102
  );
103
103
  return o.title.trim().length > 0 && o.previewText.trim().length > 0 && r;
104
104
  }
105
105
  if (e === "PUSH") {
106
- const o = n, r = o.title.trim().length > 0 && o.body.trim().length > 0, a = o.destination !== "EXTERNAL" || h.safeParse(o.url ?? "").success;
106
+ const o = n, r = o.title.trim().length > 0 && o.body.trim().length > 0, a = o.destination !== "EXTERNAL" || C.safeParse(o.url ?? "").success;
107
107
  return r && a;
108
108
  }
109
109
  return n.content.trim().length > 0;
110
110
  }
111
- function S(t, e) {
111
+ function A(t, e) {
112
112
  return t.channels.map(e).join(t.mode === "fallback" ? " → " : " + ");
113
113
  }
114
- function Q(t) {
114
+ function et(t) {
115
115
  var e, n;
116
116
  if (!(!t || t.delivery)) {
117
117
  if ((n = (e = t.message) == null ? void 0 : e.content) != null && n.trim()) {
118
- t.delivery = d(t);
118
+ t.delivery = y(t);
119
119
  return;
120
120
  }
121
121
  delete t.message, t.delivery = { mode: "fallback", channels: [], content: {} };
122
122
  }
123
123
  }
124
- const R = 5;
125
- function A(t, e) {
124
+ const _ = 5;
125
+ function D(t, e) {
126
126
  if (!t) return { kind: "all" };
127
127
  const n = new Map(e.map((a) => [String(a._id), a])), o = [];
128
128
  for (const a of t) {
129
- const l = n.get(String(a));
130
- l && o.push({ id: String(a), code: l.code, name: l.name });
129
+ const p = n.get(String(a));
130
+ p && o.push({ id: String(a), code: p.code, name: p.name });
131
131
  }
132
132
  if (t.length === 0) return { kind: "none" };
133
133
  const r = t.length - o.length;
134
- return r === 0 && o.length <= R ? { kind: "names", names: o.map((a) => a.name) } : { kind: "count", rows: o, total: e.length, unavailable: r };
134
+ return r === 0 && o.length <= _ ? { kind: "names", names: o.map((a) => a.name) } : { kind: "count", rows: o, total: e.length, unavailable: r };
135
+ }
136
+ const c = g.global.t;
137
+ function P() {
138
+ const t = g.global.locale;
139
+ return typeof t == "string" ? t : t.value;
140
+ }
141
+ function d(t) {
142
+ return new Intl.DateTimeFormat(P(), {
143
+ day: "2-digit",
144
+ month: "short",
145
+ year: "numeric"
146
+ }).format(new Date(t));
135
147
  }
136
148
  function i(t) {
137
- return p(
149
+ return l(
138
150
  "div",
139
151
  {
140
152
  class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
141
153
  },
142
154
  [
143
- p(g.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
144
- p("span", { class: "fm-typo-en-body-md-600" }, t.name)
155
+ l(h.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
156
+ l("span", { class: "fm-typo-en-body-md-600" }, t.name)
145
157
  ]
146
158
  );
147
159
  }
148
- const Z = {
160
+ const nt = {
149
161
  [s.enum.CREDIT]: {
150
162
  chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
151
163
  icon: "local_activity",
152
164
  get name() {
153
- return c.global.t("connect.campaign.common.typeName.CREDIT");
165
+ return c("connect.campaign.common.typeName.CREDIT");
154
166
  },
155
167
  chip() {
156
168
  return i(this);
@@ -160,7 +172,7 @@ const Z = {
160
172
  chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
161
173
  icon: "loyalty",
162
174
  get name() {
163
- return c.global.t("connect.campaign.common.typeName.PROMOTION");
175
+ return c("connect.campaign.common.typeName.PROMOTION");
164
176
  },
165
177
  chip() {
166
178
  return i(this);
@@ -170,7 +182,7 @@ const Z = {
170
182
  chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
171
183
  icon: "sell",
172
184
  get name() {
173
- return c.global.t("connect.campaign.common.typeName.VOUCHER");
185
+ return c("connect.campaign.common.typeName.VOUCHER");
174
186
  },
175
187
  chip() {
176
188
  return i(this);
@@ -180,7 +192,7 @@ const Z = {
180
192
  chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
181
193
  icon: "award_star",
182
194
  get name() {
183
- return c.global.t("connect.campaign.common.typeName.POINT");
195
+ return c("connect.campaign.common.typeName.POINT");
184
196
  },
185
197
  chip() {
186
198
  return i(this);
@@ -190,7 +202,7 @@ const Z = {
190
202
  chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
191
203
  icon: "campaign",
192
204
  get name() {
193
- return c.global.t("connect.campaign.common.typeName.BROADCAST");
205
+ return c("connect.campaign.common.typeName.BROADCAST");
194
206
  },
195
207
  chip() {
196
208
  return i(this);
@@ -200,7 +212,7 @@ const Z = {
200
212
  chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
201
213
  icon: "database",
202
214
  get name() {
203
- return c.global.t("connect.campaign.common.typeName.GAME");
215
+ return c("connect.campaign.common.typeName.GAME");
204
216
  },
205
217
  chip() {
206
218
  return i(this);
@@ -210,7 +222,7 @@ const Z = {
210
222
  chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
211
223
  icon: "editor_choice",
212
224
  get name() {
213
- return c.global.t("connect.campaign.common.typeName.REWARD_POOL");
225
+ return c("connect.campaign.common.typeName.REWARD_POOL");
214
226
  },
215
227
  chip() {
216
228
  return i(this);
@@ -220,7 +232,7 @@ const Z = {
220
232
  chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
221
233
  icon: "monetization_on",
222
234
  get name() {
223
- return c.global.t("connect.campaign.common.typeName.COIN");
235
+ return c("connect.campaign.common.typeName.COIN");
224
236
  },
225
237
  chip() {
226
238
  return i(this);
@@ -230,61 +242,75 @@ const Z = {
230
242
  chipClass: "",
231
243
  icon: "",
232
244
  get name() {
233
- return c.global.t("connect.campaign.common.typeName.MEMBERSHIP");
245
+ return c("connect.campaign.common.typeName.MEMBERSHIP");
234
246
  },
235
247
  chip() {
236
248
  return i(this);
237
249
  }
238
250
  },
239
- // TODO: confirm color
240
251
  [s.enum.MISSION]: {
241
252
  chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
242
253
  icon: "editor_choice",
243
254
  get name() {
244
- return c.global.t("connect.campaign.common.typeName.MISSION");
255
+ return c("connect.campaign.common.typeName.MISSION");
245
256
  },
246
257
  chip() {
247
258
  return i(this);
248
259
  }
260
+ },
261
+ [s.enum.GRAB]: {
262
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
263
+ icon: "editor_choice",
264
+ name: "Grab",
265
+ chip() {
266
+ return i(this);
267
+ }
249
268
  }
250
269
  };
251
- function tt(t) {
270
+ function ot(t) {
252
271
  const e = M(t), n = {
253
272
  active: "text-fm-color-typo-success bg-fm-color-system-success-100",
254
273
  upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
255
274
  expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
256
275
  };
257
- return t.type == "VOUCHER" ? p(g.FmChip, {
276
+ return t.type == "VOUCHER" ? l(h.FmChip, {
258
277
  class: n[e],
259
- label: y.title(
260
- c.global.t(`connect.campaign.common.status.${e}`)
261
- ),
278
+ label: O.title(c(`connect.campaign.common.status.${e}`)),
262
279
  compact: !0
263
- }) : p(g.FmChip, {
280
+ }) : l(h.FmChip, {
264
281
  class: n[e],
265
- label: y.title(
266
- c.global.t(`connect.campaign.common.status.${e}`)
267
- ),
282
+ label: O.title(c(`connect.campaign.common.status.${e}`)),
268
283
  compact: !0
269
284
  });
270
285
  }
271
- function P(t) {
286
+ function at(t) {
287
+ const e = t.timeframeOptions;
288
+ if (!e || !e.start && !e.end)
289
+ return c("connect.campaign.common.always_active");
290
+ if (!e.start && e.end)
291
+ return c("connect.campaign.common.valid_until", {
292
+ date: d(e.end)
293
+ });
294
+ const n = d(e.start), o = e.end ? d(e.end) : c("connect.campaign.common.unlimited");
295
+ return `${n} -> ${o}`;
296
+ }
297
+ function T(t) {
272
298
  if (!t || !t.start && !t.end)
273
299
  return "connect.campaign.common.always";
274
300
  const e = t.start ? u(t.start).format("DD MMM YYYY") : "From campaign creation", n = t.end ? u(t.end).format("DD MMM YYYY") : "Never ends";
275
301
  return `${e} - ${n}`;
276
302
  }
277
- function et(t) {
303
+ function rt(t) {
278
304
  const { campaign: e } = t;
279
305
  return {
280
306
  "connect.campaign.common.campaign_name": e.name,
281
- "connect.campaign.common.campaign_period": P(
307
+ "connect.campaign.common.campaign_period": T(
282
308
  e.timeframeOptions
283
309
  ),
284
310
  get "connect.campaign.common.next_schedule_at"() {
285
- if (e.event.type != "SCHEDULE" || !e.event.rule || !b(e.event.rule))
311
+ if ((e == null ? void 0 : e.event.type) != "SCHEDULE" || !e.event.rule || !E(e.event.rule))
286
312
  return;
287
- const n = O(
313
+ const n = N(
288
314
  e.event.rule.rules.g_schedule
289
315
  );
290
316
  return n ? u(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
@@ -296,19 +322,19 @@ function et(t) {
296
322
  },
297
323
  get "connect.campaign.broadcast.summary.delivery"() {
298
324
  if (e.type != "BROADCAST") return;
299
- const n = d(e);
325
+ const n = y(e);
300
326
  if (!(n.channels.length < 2))
301
327
  return `connect.campaign.broadcast.mode.${n.mode}.label`;
302
328
  },
303
329
  get "connect.campaign.broadcast.summary.channels"() {
304
330
  var n;
305
331
  if (e.type == "BROADCAST")
306
- return ((n = T(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
332
+ return ((n = x(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
307
333
  },
308
334
  get "connect.campaign.common.available_at"() {
309
- const n = A(
335
+ const n = D(
310
336
  e.targetLocation,
311
- E().locations
337
+ I().locations
312
338
  );
313
339
  return n.kind === "all" ? "connect.campaign.common.all_locations" : n.kind === "none" ? "connect.campaign.common.no_location" : n.kind === "names" ? n.names.join(", ") : n;
314
340
  }
@@ -320,18 +346,18 @@ function M(t) {
320
346
  t.timeframeOptions.end ?? u().add(1, "d")
321
347
  ) ? "active" : u().isAfter(t.timeframeOptions.end) ? "expired" : "upcoming" : "active";
322
348
  }
323
- function T(t) {
324
- const e = d(t);
349
+ function x(t) {
350
+ const e = y(t);
325
351
  if (!e.channels.length) return null;
326
- const o = S(e, (r) => c.global.t(`connect.campaign.broadcast.channel.${r}`));
352
+ const o = A(e, (r) => g.global.t(`connect.campaign.broadcast.channel.${r}`));
327
353
  return {
328
- strategy: e.channels.length > 1 ? c.global.t(
354
+ strategy: e.channels.length > 1 ? g.global.t(
329
355
  `connect.campaign.broadcast.strategy.${e.mode}`
330
356
  ) : null,
331
357
  route: o
332
358
  };
333
359
  }
334
- function nt(t) {
360
+ function ct(t) {
335
361
  var e, n;
336
362
  switch (t.event.type) {
337
363
  case "BILL_COMPLETED":
@@ -366,22 +392,23 @@ function nt(t) {
366
392
  }
367
393
  }
368
394
  export {
369
- Z as C,
370
- tt as a,
371
- nt as b,
372
- T as c,
373
- N as d,
374
- q as e,
375
- K as f,
376
- M as g,
377
- j as h,
378
- G as i,
379
- J as j,
380
- W as k,
381
- X as l,
382
- z as m,
383
- et as n,
384
- Q as o,
385
- V as r,
386
- P as s
395
+ nt as C,
396
+ M as a,
397
+ ot as b,
398
+ ct as c,
399
+ x as d,
400
+ S as e,
401
+ tt as f,
402
+ at as g,
403
+ Z as h,
404
+ X as i,
405
+ z as j,
406
+ Q as k,
407
+ q as l,
408
+ K as m,
409
+ J as n,
410
+ rt as o,
411
+ et as p,
412
+ W as r,
413
+ T as s
387
414
  };
@@ -1,4 +1,4 @@
1
- import { z as E } from "./index-C_H8jFYf.js";
1
+ import { z as E } from "./index-CGtlXLTG.js";
2
2
  const M = E.enum([
3
3
  "VOUCHER",
4
4
  "PROMOTION",
@@ -9,7 +9,8 @@ const M = E.enum([
9
9
  "COIN",
10
10
  "REWARD_POOL",
11
11
  "GAME",
12
- "MISSION"
12
+ "MISSION",
13
+ "GRAB"
13
14
  ]), O = E.enum([
14
15
  "TIME_BASED_PROMOTION",
15
16
  "GAME_PROMOTION",