@feedmepos/mf-connect 0.1.113-prod → 0.1.114-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 (156) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-2J4yDonr.js → App-CIWTDYuZ.js} +700 -654
  3. package/dist/AuditLogs-BluLDXu9.js +2016 -0
  4. package/dist/{Bin-BU_hVuxJ.js → Bin-jS6pM4L3.js} +8 -8
  5. package/dist/Broadcast-DBqsSZ0S.js +306 -0
  6. package/dist/{CampaignAnalytic-DUUmFMvy.js → CampaignAnalytic-DJrjXD4H.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BZirReIy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js} +9 -9
  8. package/dist/{Card-DS2K_LFv.js → Card-B10nLilL.js} +25 -24
  9. package/dist/{Collections-BFdRdPHR.js → Collections-BN42A73p.js} +197 -185
  10. package/dist/{Credit-CODfiox3.js → Credit-0SS26HGE.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B2T5G1hZ.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-KvZebiOu.js → EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js} +32 -32
  14. package/dist/{Experience-BGBWc8Ep.js → Experience-D7qPzsrc.js} +32 -31
  15. package/dist/{FileSaver.min-DJAN3Eu0.js → FileSaver.min-BKWoklMK.js} +1 -1
  16. package/dist/{Game-6yyn0uAd.js → Game-BoYMwfog.js} +19 -18
  17. package/dist/{GiftCardSetup-B096bTm0.js → GiftCardSetup-B87O0xzo.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-ChvUXdF-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js} +7 -7
  19. package/dist/{Goals-Db2mwbRo.js → Goals-CVxf3xCA.js} +4 -4
  20. package/dist/Grab-mGL1Mue_.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-xdEzwMcS.js → ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js} +1 -1
  22. package/dist/{Index-580WNkG2.js → Index-Dptuy-6c.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BkAQXKNJ.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CR6sSnx4.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js} +1 -1
  25. package/dist/{LoyaltyDashboard-Clr2aiUP.js → LoyaltyDashboard-BxhI6RAE.js} +15 -15
  26. package/dist/MainLayout-YfDxvZXl.js +4 -0
  27. package/dist/{MainLayout-_iCyT5mw.js → MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js} +5 -4
  28. package/dist/{Marketing-fq1wxANq.js → Marketing-C2cVJacf.js} +4 -4
  29. package/dist/MarketingMaterialEdit-DkOEy_L-.js +1037 -0
  30. package/dist/{Member-BfRy196y.js → Member-DufbKDOh.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BAR44Qcp.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js} +43 -50
  32. package/dist/{MemberImportHistory-C4622Ivs.js → MemberImportHistory-DlFN-uQl.js} +7 -7
  33. package/dist/{MemberList-DqtsMN_N.js → MemberList-B344n8I4.js} +103 -105
  34. package/dist/{MemberTransactions-DsUoFg3z.js → MemberTransactions-BS7H640M.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CzFMUgXM.js → MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js} +4228 -4176
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CVQYcuQ6.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js} +1 -1
  37. package/dist/{Mission-B0GO4LiM.js → Mission-D2ed_oKn.js} +22 -21
  38. package/dist/{Overview-XpJJmHqs.js → Overview-CLh_T6YY.js} +145 -144
  39. package/dist/{Overview-CVITimwN.js → Overview-DJa-hXDC.js} +23 -22
  40. package/dist/{Point-B7aCrMkI.js → Point-DAPeg1VD.js} +22 -21
  41. package/dist/{Promotion-DfVcuXHy.js → Promotion-CPPCMMFl.js} +137 -131
  42. package/dist/{Queue-BT7O2cvj.js → Queue-BcPwCRcM.js} +47 -46
  43. package/dist/{Record-CAc030dz.js → Record-C5XKn--g.js} +9 -9
  44. package/dist/{Review-CyXo4GTY.js → Review-Cc51luIv.js} +2 -2
  45. package/dist/ReviewFacebookCallback-BSGInFB8.js +225 -0
  46. package/dist/{ReviewGoogleCallback-BxiFOl0B.js → ReviewGoogleCallback-C1gY4vcP.js} +5 -5
  47. package/dist/{Reward-ChfNtdwX.js → Reward-k1R3hLiF.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CpQu_QBQ.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js +1923 -0
  50. package/dist/{Segment-H2zBDZeh.js → Segment-DsBnIvje.js} +290 -291
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B0jCJ-Xq.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DW_ViNZM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js} +4 -4
  53. package/dist/Setting-BRueNgc4.js +574 -0
  54. package/dist/{SettingAdvertisements-DPQHP3-B.js → SettingAdvertisements-BrVcQyhF.js} +12 -12
  55. package/dist/Settings-fOvXd29Z.js +286 -0
  56. package/dist/{Store-B2f5HVQc.js → Store-rrh2pIHH.js} +661 -654
  57. package/dist/{StoreRewards-QxfaEt9f.js → StoreRewards-D-jivVKr.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js +7007 -0
  60. package/dist/{Tier-BSk4rBm8.js → Tier-DJiLtw3M.js} +2576 -687
  61. package/dist/{Title-CIzpB8TT.js → Title-s0bzA7yZ.js} +94 -92
  62. package/dist/{Transaction-BjxxNEHa.js → Transaction-CQ-CJ_eh.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BMutYxOU.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js} +26 -26
  64. package/dist/{Voucher-B2lFq21Y.js → Voucher-9vydRET7.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BWV631It.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js} +16 -16
  66. package/dist/WhatsappAccount-D12Hvzfl.js +159 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js +39 -0
  68. package/dist/WhatsappBot-o5b_0CnB.js +629 -0
  69. package/dist/WhatsappBotLogs-CK_V_iT5.js +372 -0
  70. package/dist/WhatsappBotSettings-BooibLUg.js +694 -0
  71. package/dist/WhatsappLayout-bOyNHGUI.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js +253 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BCoB0Fsa.js → ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js} +2 -2
  74. package/dist/{app-DgFVWdhA.js → app-DV3e2LkD.js} +10610 -8223
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-B6Rojjek.js → base.export-DQUUtGmy.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-C6ID0exl.js → business-BZ0boE-5.js} +1 -1
  79. package/dist/campaign-CsfFq2S-.js +400 -0
  80. package/dist/{campaign-BgSJXWdU.js → campaign-DMrtYWcs.js} +31 -25
  81. package/dist/{campaign.enum-CVvm0LMm.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/campaign.fn-C-CdNNdR.js +776 -0
  83. package/dist/{collectible.enum-DGQVW464.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-dV4F8R-j.js → collection.fn-C-rryKSc.js} +2 -2
  85. package/dist/{currency-DlHi_3WN.js → currency-BOd9iVZV.js} +1 -1
  86. package/dist/duplicateCampaign-ey_rW0Bz.js +51 -0
  87. package/dist/{effect-BJgmiWY4.js → effect-BP6Hkxmj.js} +1 -1
  88. package/dist/{email-addresses-3GTx_xTh.js → email-addresses-CO61QAq0.js} +2 -2
  89. package/dist/feature-flag-Bq1SgbYC.js +868 -0
  90. package/dist/feature-flag-lvPP0ED-.js +50 -0
  91. package/dist/google-BQK68wbe.js +5 -0
  92. package/dist/{helper-BX0JQP06.js → helper-BRpts-M-.js} +1 -1
  93. package/dist/{index-BIpAzktM.js → index-03WIXl-H.js} +8 -7
  94. package/dist/{index-BeCKw7Y3.js → index-B0RavybO.js} +19 -6
  95. package/dist/{index-DeNbsrQx.js → index-BDNkoALK.js} +1 -1
  96. package/dist/{index-Bl5aHABH.js → index-BV5aPSYo.js} +11 -10
  97. package/dist/{index-Cnw0B8Lc.js → index-Bk20uvPY.js} +1 -1
  98. package/dist/index-Bn19rfby.js +14571 -0
  99. package/dist/index-C_H8jFYf.js +2743 -0
  100. package/dist/{index-nmw7_9ZE.js → index-Cj-eugzc.js} +1 -1
  101. package/dist/{index-uXgPJlic.js → index-CoROn5OA.js} +2700 -2613
  102. package/dist/{index-DdMVrWZy.js → index-CrBhcMaL.js} +8028 -10767
  103. package/dist/{index-2xed2K8D.js → index-CsBjAM3E.js} +4 -3
  104. package/dist/{index-CiFReW-F.js → index-D1t4_KaG.js} +1 -1
  105. package/dist/{index-DRNdJ_KC.js → index-D3wGTCWf.js} +8 -7
  106. package/dist/{index-CtBLnWVG.js → index-D41kjcrZ.js} +683 -581
  107. package/dist/{index-CNULhBPM.js → index-DIZLkVe0.js} +691 -230
  108. package/dist/{index-QaWLGgEC.js → index-DucKyzrD.js} +2 -2
  109. package/dist/{index-o2OQljHs.js → index-R5WS21OL.js} +4 -4
  110. package/dist/index-RwNlbTO8.js +115 -0
  111. package/dist/{index-R0qlOO6J.js → index-VYI0zWNC.js} +29 -15
  112. package/dist/index-ZRE89TKq.js +80 -0
  113. package/dist/{index-BHT6cvWA.js → index-_Cj-bsd_.js} +396 -232
  114. package/dist/{index-Y2Pu1YkB.js → index-mToWKHVs.js} +2 -2
  115. package/dist/{index.esm2017-Dum0onrS.js → index.esm2017-B_Sag8Pg.js} +209 -209
  116. package/dist/{loading-B2mSdkfy.js → loading-C5fVI0ry.js} +1 -1
  117. package/dist/{lodash-DtOypaKt.js → lodash-COo8_xCU.js} +1 -1
  118. package/dist/{member-import-C2pLnh44.js → member-import-I_pKwUfF.js} +6 -5
  119. package/dist/{membership-BWyBGF4n.js → membership-BgfH9Kva.js} +3 -3
  120. package/dist/{money-3lCCVCeP.js → money-Cr07YDlV.js} +1 -1
  121. package/dist/{number-zlqy2MLG.js → number-DFsj0dkh.js} +1 -1
  122. package/dist/objectid-Cu89BzwI.js +145 -0
  123. package/dist/{onboarding-BqD3B4M1.js → onboarding-DlkJCm-5.js} +25 -25
  124. package/dist/{onboardingSetup-CCQ90jg7.js → onboardingSetup-BEhVj613.js} +2 -2
  125. package/dist/{plugins-Bj3npYnL.js → plugins-CPTtiKqf.js} +3 -3
  126. package/dist/{MarketingMaterialEdit-0h7E0n5e.js → remy-icon-BhUGu2NI.js} +2 -1031
  127. package/dist/{reward-5dDuZEb7.js → reward-DqY0mQ_5.js} +1 -1
  128. package/dist/{rule-NqLeSyoO.js → rule-mJJ48eKw.js} +572 -492
  129. package/dist/style.css +1 -1
  130. package/dist/template-C1QftpDG.js +188 -0
  131. package/dist/{timezone-B0lkgvh-.js → timezone-BBgBHels.js} +1 -1
  132. package/dist/{transaction.fn-CACuVUBe.js → transaction.fn-Sr0hj3kY.js} +2 -2
  133. package/dist/{trigger-BKJwKTJx.js → trigger-PUP0mwKM.js} +8 -8
  134. package/dist/{useMarketingMaterialActions-DERvOmen.js → useMarketingMaterialActions-faslwaHd.js} +3 -3
  135. package/dist/{usePagination-FkjroUq2.js → usePagination-Be6nIQ9y.js} +1 -1
  136. package/dist/{user-H9MnsLbu.js → user-DBSYzG_9.js} +1 -1
  137. package/dist/vue-i18n-C6c2jsH3.js +2365 -0
  138. package/dist/{xlsx-BVmtIl_i.js → xlsx-Bfo19lFv.js} +786 -786
  139. package/dist/{zod-DI7OBdxu.js → zod-CihbDg3N.js} +1 -1
  140. package/package.json +12 -3
  141. package/dist/Broadcast-CoirZUyr.js +0 -271
  142. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DyIOw_HH.js +0 -2431
  143. package/dist/ReviewFacebookCallback--IcyheQA.js +0 -238
  144. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang--5K-qagY.js +0 -1883
  145. package/dist/Setting-D4XOHSHT.js +0 -2036
  146. package/dist/Settings-Dt_oLoGl.js +0 -179
  147. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Db2cd6ny.js +0 -1264
  148. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D9L-AayN.js +0 -142
  149. package/dist/campaign-DDfFBFye.js +0 -228
  150. package/dist/campaign.fn-DRabv93K.js +0 -776
  151. package/dist/google-C3S8u0mT.js +0 -4
  152. package/dist/index-CmhDYsk6.js +0 -51
  153. package/dist/objectid-b2KGvMA7.js +0 -145
  154. package/dist/rule-builder-BzYwbbj4.js +0 -102
  155. package/dist/template-fjUz6xrU.js +0 -236
  156. package/dist/vue-i18n-DbJO6sZW.js +0 -2365
@@ -1,7 +1,7 @@
1
1
  import { ref as i, computed as u } from "vue";
2
2
  import { defineStore as w } from "pinia";
3
3
  import { useCoreStore as y } from "@feedmepos/mf-common";
4
- import { d as I, g as r, A as b, S, b as D } from "./index-BIpAzktM.js";
4
+ import { d as I, g as r, A as b, S, b as D } from "./index-03WIXl-H.js";
5
5
  const $ = {
6
6
  async readSettings(e) {
7
7
  try {
@@ -0,0 +1,400 @@
1
+ import { h as u } from "./moment-D7p2TMB-.js";
2
+ import "./index-_Cj-bsd_.js";
3
+ import { e as l } from "./effect-BP6Hkxmj.js";
4
+ import { components as d } from "@feedmepos/ui-library";
5
+ import { a as E } from "./index-DIZLkVe0.js";
6
+ import { c as N } from "./rule-mJJ48eKw.js";
7
+ import { u as I } from "./business-BZ0boE-5.js";
8
+ import { C as m } from "./campaign.fn-C-CdNNdR.js";
9
+ import { g as y, t as h } from "./index-Bn19rfby.js";
10
+ import { c as C } from "./string-Gcy5IM_H.js";
11
+ import { i as f } from "./plugins-CPTtiKqf.js";
12
+ import { h as p } from "vue";
13
+ import { F as s } from "./campaign.enum-Dx-Zo68Q.js";
14
+ const R = [
15
+ "APP_INBOX",
16
+ "PUSH",
17
+ "SMS",
18
+ "EMAIL",
19
+ "WHATSAPP"
20
+ ], S = [...R];
21
+ function j(t) {
22
+ return S.includes(t);
23
+ }
24
+ function O(t, e) {
25
+ return t === "APP_INBOX" ? {
26
+ title: "",
27
+ previewText: "",
28
+ content: "",
29
+ buttons: [],
30
+ variables: e
31
+ } : t === "PUSH" ? {
32
+ title: "",
33
+ body: "",
34
+ destination: "NONE",
35
+ variables: e
36
+ } : {
37
+ channel: t,
38
+ content: "",
39
+ language: "en",
40
+ variables: e
41
+ };
42
+ }
43
+ function V(t, e, n = []) {
44
+ return t.channels.includes(e) ? t : {
45
+ ...t,
46
+ channels: [...t.channels, e],
47
+ content: {
48
+ ...t.content,
49
+ [e]: t.content[e] ?? O(e, n)
50
+ }
51
+ };
52
+ }
53
+ function X(t, e) {
54
+ const n = { ...t.content };
55
+ return delete n[e], {
56
+ ...t,
57
+ channels: t.channels.filter((o) => o !== e),
58
+ content: n
59
+ };
60
+ }
61
+ function z(t, e, n) {
62
+ return {
63
+ ...t,
64
+ content: { ...t.content, [e]: n }
65
+ };
66
+ }
67
+ function W(t, e, n) {
68
+ const o = t.channels.indexOf(e), a = o + n;
69
+ if (o < 0 || a < 0 || a >= t.channels.length) return t;
70
+ const r = [...t.channels];
71
+ return [r[o], r[a]] = [r[a], r[o]], { ...t, channels: r };
72
+ }
73
+ function J(t, e, n = []) {
74
+ const [o, ...a] = t.channels;
75
+ if (o === e) return t;
76
+ const r = {
77
+ ...t.content,
78
+ [e]: t.content[e] ?? O(e, n)
79
+ };
80
+ return o && delete r[o], {
81
+ ...t,
82
+ channels: [e, ...a.filter((b) => b !== e)],
83
+ content: r
84
+ };
85
+ }
86
+ function K(t, e) {
87
+ if (!e) return !1;
88
+ const n = t.content[e];
89
+ return n ? ["title", "previewText", "content", "body"].some(
90
+ (o) => typeof n[o] == "string" && !!n[o].trim()
91
+ ) : !1;
92
+ }
93
+ function q(t, e) {
94
+ return { ...t, mode: e };
95
+ }
96
+ function Q(t, e) {
97
+ const n = t.content[e];
98
+ if (!n) return !1;
99
+ if (e === "APP_INBOX") {
100
+ const o = n, a = (o.buttons ?? []).every(
101
+ (r) => r.label.trim().length > 0 && y.safeParse(r.url ?? "").success
102
+ );
103
+ return o.title.trim().length > 0 && o.previewText.trim().length > 0 && a;
104
+ }
105
+ if (e === "PUSH") {
106
+ const o = n, a = o.title.trim().length > 0 && o.body.trim().length > 0, r = o.destination !== "EXTERNAL" || y.safeParse(o.url ?? "").success;
107
+ return a && r;
108
+ }
109
+ return n.content.trim().length > 0;
110
+ }
111
+ function A(t, e) {
112
+ return t.channels.map(e).join(t.mode === "fallback" ? " → " : " + ");
113
+ }
114
+ function Z(t) {
115
+ var e, n;
116
+ if (!(!t || t.delivery)) {
117
+ if ((n = (e = t.message) == null ? void 0 : e.content) != null && n.trim()) {
118
+ t.delivery = h(t);
119
+ return;
120
+ }
121
+ delete t.message, t.delivery = { mode: "fallback", channels: [], content: {} };
122
+ }
123
+ }
124
+ const c = f.global.t;
125
+ function D() {
126
+ const t = f.global.locale;
127
+ return typeof t == "string" ? t : t.value;
128
+ }
129
+ function g(t) {
130
+ return new Intl.DateTimeFormat(D(), {
131
+ day: "2-digit",
132
+ month: "short",
133
+ year: "numeric"
134
+ }).format(new Date(t));
135
+ }
136
+ function i(t) {
137
+ return p(
138
+ "div",
139
+ {
140
+ class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
141
+ },
142
+ [
143
+ p(d.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
144
+ p("span", { class: "fm-typo-en-body-md-600" }, t.name)
145
+ ]
146
+ );
147
+ }
148
+ const tt = {
149
+ [s.enum.CREDIT]: {
150
+ chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
151
+ icon: "local_activity",
152
+ get name() {
153
+ return c("connect.campaign.common.typeName.CREDIT");
154
+ },
155
+ chip() {
156
+ return i(this);
157
+ }
158
+ },
159
+ [s.enum.PROMOTION]: {
160
+ chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
161
+ icon: "loyalty",
162
+ get name() {
163
+ return c("connect.campaign.common.typeName.PROMOTION");
164
+ },
165
+ chip() {
166
+ return i(this);
167
+ }
168
+ },
169
+ [s.enum.VOUCHER]: {
170
+ chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
171
+ icon: "sell",
172
+ get name() {
173
+ return c("connect.campaign.common.typeName.VOUCHER");
174
+ },
175
+ chip() {
176
+ return i(this);
177
+ }
178
+ },
179
+ [s.enum.POINT]: {
180
+ chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
181
+ icon: "award_star",
182
+ get name() {
183
+ return c("connect.campaign.common.typeName.POINT");
184
+ },
185
+ chip() {
186
+ return i(this);
187
+ }
188
+ },
189
+ [s.enum.BROADCAST]: {
190
+ chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
191
+ icon: "campaign",
192
+ get name() {
193
+ return c("connect.campaign.common.typeName.BROADCAST");
194
+ },
195
+ chip() {
196
+ return i(this);
197
+ }
198
+ },
199
+ [s.enum.GAME]: {
200
+ chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
201
+ icon: "database",
202
+ get name() {
203
+ return c("connect.campaign.common.typeName.GAME");
204
+ },
205
+ chip() {
206
+ return i(this);
207
+ }
208
+ },
209
+ [s.enum.REWARD_POOL]: {
210
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
211
+ icon: "editor_choice",
212
+ get name() {
213
+ return c("connect.campaign.common.typeName.REWARD_POOL");
214
+ },
215
+ chip() {
216
+ return i(this);
217
+ }
218
+ },
219
+ [s.enum.COIN]: {
220
+ chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
221
+ icon: "monetization_on",
222
+ get name() {
223
+ return c("connect.campaign.common.typeName.COIN");
224
+ },
225
+ chip() {
226
+ return i(this);
227
+ }
228
+ },
229
+ [s.enum.MEMBERSHIP]: {
230
+ chipClass: "",
231
+ icon: "",
232
+ get name() {
233
+ return c("connect.campaign.common.typeName.MEMBERSHIP");
234
+ },
235
+ chip() {
236
+ return i(this);
237
+ }
238
+ },
239
+ [s.enum.MISSION]: {
240
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
241
+ icon: "editor_choice",
242
+ get name() {
243
+ return c("connect.campaign.common.typeName.MISSION");
244
+ },
245
+ chip() {
246
+ return i(this);
247
+ }
248
+ },
249
+ [s.enum.GRAB]: {
250
+ chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
251
+ icon: "editor_choice",
252
+ name: "Grab",
253
+ chip() {
254
+ return i(this);
255
+ }
256
+ }
257
+ };
258
+ function et(t) {
259
+ const e = _(t), n = {
260
+ active: "text-fm-color-typo-success bg-fm-color-system-success-100",
261
+ upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
262
+ expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
263
+ };
264
+ return t.type == "VOUCHER" ? p(d.FmChip, {
265
+ class: n[e],
266
+ label: C.title(c(`connect.campaign.common.status.${e}`)),
267
+ compact: !0
268
+ }) : p(d.FmChip, {
269
+ class: n[e],
270
+ label: C.title(c(`connect.campaign.common.status.${e}`)),
271
+ compact: !0
272
+ });
273
+ }
274
+ function nt(t) {
275
+ const e = t.timeframeOptions;
276
+ if (!e || !e.start && !e.end)
277
+ return c("connect.campaign.common.always_active");
278
+ if (!e.start && e.end)
279
+ return c("connect.campaign.common.valid_until", {
280
+ date: g(e.end)
281
+ });
282
+ const n = g(e.start), o = e.end ? g(e.end) : c("connect.campaign.common.unlimited");
283
+ return `${n} -> ${o}`;
284
+ }
285
+ function P(t) {
286
+ if (!t || !t.start && !t.end)
287
+ return "connect.campaign.common.always";
288
+ 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";
289
+ return `${e} - ${n}`;
290
+ }
291
+ function ot(t) {
292
+ const { campaign: e } = t;
293
+ return {
294
+ "connect.campaign.common.campaign_name": e.name,
295
+ "connect.campaign.common.campaign_period": P(
296
+ e.timeframeOptions
297
+ ),
298
+ get "connect.campaign.common.next_schedule_at"() {
299
+ if ((e == null ? void 0 : e.event.type) != "SCHEDULE" || !e.event.rule || !E(e.event.rule))
300
+ return;
301
+ const n = N(
302
+ e.event.rule.rules.g_schedule
303
+ );
304
+ return n ? u(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
305
+ },
306
+ get "connect.campaign.common.discount_type"() {
307
+ if (e.type == "PROMOTION") return l(e.effect);
308
+ if ("configs" in t && t.configs.type == "VOUCHER")
309
+ return l(t.configs.extras.effect);
310
+ },
311
+ get "connect.campaign.broadcast.summary.delivery"() {
312
+ if (e.type != "BROADCAST") return;
313
+ const n = h(e);
314
+ if (!(n.channels.length < 2))
315
+ return `connect.campaign.broadcast.mode.${n.mode}.label`;
316
+ },
317
+ get "connect.campaign.broadcast.summary.channels"() {
318
+ var n;
319
+ if (e.type == "BROADCAST")
320
+ return ((n = T(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
321
+ },
322
+ get "connect.campaign.common.available_at"() {
323
+ return e.targetLocation ? e.targetLocation.length > 0 ? e.targetLocation.map(
324
+ (n) => I().locationItems.find((o) => o.value == n).label
325
+ ).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
326
+ }
327
+ };
328
+ }
329
+ function _(t) {
330
+ return t.timeframeOptions && t.timeframeOptions.type == "timeframe" ? u().isBetween(
331
+ t.timeframeOptions.start ?? u().subtract(1, "d"),
332
+ t.timeframeOptions.end ?? u().add(1, "d")
333
+ ) ? "active" : u().isAfter(t.timeframeOptions.end) ? "expired" : "upcoming" : "active";
334
+ }
335
+ function T(t) {
336
+ const e = h(t);
337
+ if (!e.channels.length) return null;
338
+ const o = A(e, (a) => f.global.t(`connect.campaign.broadcast.channel.${a}`));
339
+ return {
340
+ strategy: e.channels.length > 1 ? f.global.t(
341
+ `connect.campaign.broadcast.strategy.${e.mode}`
342
+ ) : null,
343
+ route: o
344
+ };
345
+ }
346
+ function at(t) {
347
+ var e, n;
348
+ switch (t.event.type) {
349
+ case "BILL_COMPLETED":
350
+ const o = `Spend to get ${m.formattedType(t.type)}`;
351
+ switch (t.type) {
352
+ case "POINT":
353
+ case "CREDIT":
354
+ case "COIN":
355
+ return t.earningOption.type == "FIXED" ? `Spend to get ${t.earningOption.amount} ${m.formattedType(t.type)}` : `Every ${t.earningOption.every} amount spent get ${t.earningOption.amount} ${m.formattedType(t.type)}`;
356
+ case "VOUCHER":
357
+ const a = (n = (e = t == null ? void 0 : t.pf_collectible) == null ? void 0 : e.extras) == null ? void 0 : n.effect;
358
+ return a ? `${o} - ${l(a)}` : o;
359
+ default:
360
+ return o;
361
+ }
362
+ case "FEEDBACK":
363
+ return `Give feedback to receive ${m.formattedType(t.type)}`;
364
+ case "SCHEDULE":
365
+ return `Receive ${m.formattedType(t.type)} on scheduled time`;
366
+ case "SIMPLE_CLAIM":
367
+ return "Simple claim voucher";
368
+ case "TIER_UPGRADED":
369
+ return `Receive ${m.formattedType(t.type)} when member tier upgraded`;
370
+ case "MEMBERSHIP_JOINED":
371
+ return `Receive ${m.formattedType(t.type)} when member joined`;
372
+ case "MAKING_ORDER":
373
+ return t.type !== "PROMOTION" ? void 0 : l(t.effect);
374
+ default:
375
+ throw new Error(
376
+ `Not implemented ${JSON.stringify({ cause: t.event.type })}`
377
+ );
378
+ }
379
+ }
380
+ export {
381
+ tt as C,
382
+ _ as a,
383
+ et as b,
384
+ at as c,
385
+ T as d,
386
+ R as e,
387
+ Q as f,
388
+ nt as g,
389
+ q as h,
390
+ j as i,
391
+ V as j,
392
+ K as k,
393
+ J as l,
394
+ W as m,
395
+ z as n,
396
+ ot as o,
397
+ Z as p,
398
+ X as r,
399
+ P as s
400
+ };
@@ -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-Y2Pu1YkB.js";
4
- import { g as i, S as I, b as g } from "./index-BIpAzktM.js";
2
+ import { reactive as b, onMounted as f, ref as s } from "vue";
3
+ import { c } from "./index-mToWKHVs.js";
4
+ import { g as i, S as g, b as h } from "./index-03WIXl-H.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,4 +1,4 @@
1
- import { z as E } from "./index-DdMVrWZy.js";
1
+ import { z as E } from "./index-C_H8jFYf.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",