@feedmepos/mf-connect 0.1.128-dev → 0.1.128-prod

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 (149) hide show
  1. package/dist/{App-CPSC0ccq.js → App-DFXou0ZK.js} +215 -223
  2. package/dist/{Bin-Cn7sCPql.js → Bin-ril4yEp7.js} +8 -8
  3. package/dist/{Broadcast-bR7HAyV2.js → Broadcast-CcseZmao.js} +21 -22
  4. package/dist/{CampaignAnalytic-Dnpw_Jwo.js → CampaignAnalytic-DaJ5a6G1.js} +6 -6
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-HaWMLA4s.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CsmgbhtH.js} +10 -9
  6. package/dist/{Card-BE3Y0KHF.js → Card-D7sTDXgf.js} +23 -23
  7. package/dist/{Collections-CLSp9Uah.js → Collections-C6d4vkox.js} +185 -197
  8. package/dist/{Credit-DgMyKROt.js → Credit-B9JCYQYi.js} +20 -21
  9. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-D8eCQE4D.js → DateRangeChip.vue_vue_type_script_setup_true_lang-CwD5dRnJ.js} +1 -1
  10. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Cteezb57.js +3638 -0
  11. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CXw7yS8N.js → EffectSheet.vue_vue_type_style_index_0_lang-BMxA26t5.js} +33 -33
  12. package/dist/{Experience-CCeRbvIe.js → Experience-pBNjY5aC.js} +31 -32
  13. package/dist/{FileSaver.min-D8Rw2VVN.js → FileSaver.min-BdA7jj3J.js} +1 -1
  14. package/dist/{Game-CYGg8vWQ.js → Game-Ba1LqaLj.js} +18 -19
  15. package/dist/{GiftCardSetup-rzea90xr.js → GiftCardSetup-DteySO0t.js} +31 -31
  16. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-BFUBfL-S.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxFGFA_U.js} +128 -140
  17. package/dist/{Goals-BnZfK7a3.js → Goals-D4rLwe3y.js} +4 -4
  18. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-Cw2imjlQ.js → ImageInput.vue_vue_type_script_setup_true_lang-C-1uplPm.js} +1 -1
  19. package/dist/{Index-DjZi_lVg.js → Index-DZ9bEViq.js} +10 -10
  20. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B1q4NtuM.js → LocationPicker.vue_vue_type_script_setup_true_lang-DS3y4uib.js} +1 -1
  21. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CUjzbMcb.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BTHmofSe.js} +1 -1
  22. package/dist/{LoyaltyDashboard-C3TZSSQz.js → LoyaltyDashboard-CBMyLX7W.js} +14 -14
  23. package/dist/{MainLayout-uNGpBpJi.js → MainLayout-B3-DumYs.js} +1 -1
  24. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-0PcswtGl.js → MainLayout.vue_vue_type_script_setup_true_lang-BWOWZMYx.js} +3 -3
  25. package/dist/{Marketing-SXmxcw3-.js → Marketing-CJiu6eP4.js} +4 -4
  26. package/dist/{MarketingMaterialEdit-DK0tjHpF.js → MarketingMaterialEdit-BuHpXGwZ.js} +211 -214
  27. package/dist/{Member-BFSwupq6.js → Member-AOxxLQ-x.js} +7 -7
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-cGglvqwB.js +1308 -0
  29. package/dist/{MemberImportHistory-z12l_IAQ.js → MemberImportHistory-o-ruPMEe.js} +7 -7
  30. package/dist/{MemberList-DfN7ur0J.js → MemberList-BkX_jgos.js} +105 -103
  31. package/dist/{MemberTransactions-Bntt4bRR.js → MemberTransactions-Bnc3BWr5.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-ComtYItw.js → MessageInput.vue_vue_type_script_setup_true_lang-DoUw4U88.js} +12 -12
  33. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-_Imnj16x.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BHprSEKu.js} +1 -1
  34. package/dist/{Mission-CvpeYVjB.js → Mission-D80DxR7z.js} +21 -22
  35. package/dist/{Overview-BtTkltlY.js → Overview-9gdETQLU.js} +144 -145
  36. package/dist/{Overview-BkaFC5La.js → Overview-jb3HWI09.js} +21 -21
  37. package/dist/{Point-CpNAFABM.js → Point-Pf_s2Ggb.js} +21 -22
  38. package/dist/{Promotion-B_vD_9UF.js → Promotion-BjjugEKH.js} +131 -137
  39. package/dist/{Queue-D5jDhI0f.js → Queue-CVWdBEvK.js} +46 -46
  40. package/dist/{Record-EsNXzy4D.js → Record-BS9lp0Cs.js} +9 -9
  41. package/dist/{Review-ByMrkymf.js → Review-1MRQGLAX.js} +2 -2
  42. package/dist/ReviewFacebookCallback-DuuQxEIK.js +238 -0
  43. package/dist/{ReviewGoogleCallback-BzU-hUy5.js → ReviewGoogleCallback-8kzG-TMh.js} +5 -5
  44. package/dist/{Reward-kxAuVGDE.js → Reward-UPonEShz.js} +16 -16
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-i9B1R3XP.js → RewardGroup.vue_vue_type_script_setup_true_lang-CW-EEgDZ.js} +14 -14
  46. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BmTEULNC.js +1884 -0
  47. package/dist/{Segment-C5SJs7al.js → Segment-BsNstBo-.js} +307 -304
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-RIerABcb.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-3uc5TjrH.js} +15 -15
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-D8jS4gee.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CKc0Q7pK.js} +4 -4
  50. package/dist/{Setting-zmlu3QcR.js → Setting-BD-fl3v8.js} +17 -17
  51. package/dist/{SettingAdvertisements-DewXGZoE.js → SettingAdvertisements-DG1btpAQ.js} +12 -12
  52. package/dist/Settings-LPdO0Djy.js +179 -0
  53. package/dist/{Store-CiTwDcgr.js → Store-CQe1YA-D.js} +29 -29
  54. package/dist/{StoreRewards-DaOJxsVm.js → StoreRewards-C7z5eJc4.js} +15 -15
  55. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-BTqxeKR4.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CvX_M1KW.js} +25 -25
  56. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DmeOGncB.js +142 -0
  57. package/dist/{Tier-lNI7GWMP.js → Tier-BBb_E8_V.js} +688 -2583
  58. package/dist/{Title-CDxDztnl.js → Title-CjJaca4P.js} +95 -96
  59. package/dist/{Transaction-CcsUvIns.js → Transaction-Dn-EPCom.js} +2 -2
  60. package/dist/{Upselling-BDirPkWX.js → Upselling-DB8HU6B_.js} +3 -3
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hqzfBpop.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BG2o3Nip.js} +26 -26
  62. package/dist/{Voucher-CJDo5U_P.js → Voucher-Cwg3WelV.js} +19 -19
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-WjsLHh_E.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CRz0wdSO.js} +12 -12
  64. package/dist/{WhatsappAccount-CQBti7RJ.js → WhatsappAccount--SMCex1D.js} +6 -6
  65. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DVNZ774z.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BpZ0_NtK.js} +1 -1
  66. package/dist/{WhatsappBot-91lIlikm.js → WhatsappBot-2BTZU0cI.js} +7 -7
  67. package/dist/{WhatsappBotLogs-PQTwT8e5.js → WhatsappBotLogs-nGIYzZCU.js} +5 -5
  68. package/dist/{WhatsappBotSettings-CUES9UL-.js → WhatsappBotSettings-DBx7ezqA.js} +5 -5
  69. package/dist/{WhatsappLayout-pZGYJj0J.js → WhatsappLayout-DK2idBeB.js} +3 -3
  70. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DAoonwsO.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-B-pAId0k.js} +3 -3
  71. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-HEIeZYCP.js → ZodTextField.vue_vue_type_script_setup_true_lang-DYpCPJDx.js} +2 -2
  72. package/dist/{app--pRyBODF.js → app-DjtVpjOD.js} +3522 -4286
  73. package/dist/app.js +3 -4
  74. package/dist/{base.export-CSdCmt-6.js → base.export-Dc9I7xbt.js} +2 -2
  75. package/dist/business-C0Ej4JRP.js +82 -0
  76. package/dist/{campaign-CwQjWU63.js → campaign-BNgMmhg6.js} +94 -121
  77. package/dist/{campaign-t9ubUkjB.js → campaign-U8KBANd_.js} +25 -31
  78. package/dist/{campaign.enum-Damu7hgo.js → campaign.enum-mYG3oWwU.js} +2 -3
  79. package/dist/campaign.fn-BaBPV7He.js +776 -0
  80. package/dist/{collectible.enum-C8LbgIQ7.js → collectible.enum-BtBBkbIB.js} +1 -1
  81. package/dist/{collection.fn-BV7pDqa5.js → collection.fn-lFr9HoHC.js} +2 -2
  82. package/dist/{currency-pS0xeJA6.js → currency-B6GBpIWb.js} +1 -1
  83. package/dist/{effect-B532leFF.js → effect-DmzU8TpX.js} +1 -1
  84. package/dist/{email-addresses-CKkT_5O5.js → email-addresses-s_oiQY8W.js} +2 -2
  85. package/dist/{feature-flag-25oDCLLB.js → feature-flag-CRbNgxfa.js} +84 -84
  86. package/dist/google-C3S8u0mT.js +4 -0
  87. package/dist/{helper-DxOj04aq.js → helper-0o3cPptM.js} +1 -1
  88. package/dist/{index-BViMt33t.js → index-B6BmfoiZ.js} +1 -1
  89. package/dist/{index-BLRv_4gJ.js → index-BECZ4ORu.js} +1 -1
  90. package/dist/{index-uCkkfjE3.js → index-BMG5fllq.js} +4 -4
  91. package/dist/{index-ClD2-18P.js → index-BXi5bQbd.js} +6 -19
  92. package/dist/{index-DqQ1q8sX.js → index-Bql1JMH9.js} +19 -26
  93. package/dist/{index-DBT1f1M3.js → index-BvoYHJ0i.js} +2 -2
  94. package/dist/{index-CBYY3VEG.js → index-C9MKLJzw.js} +2614 -2700
  95. package/dist/{index-C_qmnOKQ.js → index-CPByCjHI.js} +9 -9
  96. package/dist/{index-DSAEs8u0.js → index-CZWCtODZ.js} +1 -1
  97. package/dist/{index-BCgTcZ7c.js → index-CigqpRCP.js} +252 -609
  98. package/dist/{index-BFJ2FmB4.js → index-Cnl3vaVR.js} +2 -2
  99. package/dist/{index-DVlo0TO9.js → index-CxxWGkQz.js} +23 -23
  100. package/dist/{index-BX6lcJDB.js → index-DLcl6mHQ.js} +1 -1
  101. package/dist/{index-DEENB4la.js → index-DMgSW1aH.js} +664 -664
  102. package/dist/{index-DBzCfWxW.js → index-DNx-iJd1.js} +2 -2
  103. package/dist/{index-ip2EqUEW.js → index-DQLDjCeb.js} +1 -1
  104. package/dist/{index-B3sR1LMa.js → index-DXV_Kdhp.js} +7 -7
  105. package/dist/{index-DiYuhtNS.js → index-Df5CnMjC.js} +4 -4
  106. package/dist/{index-Diw9710S.js → index-DphGTJkl.js} +4 -4
  107. package/dist/{index-BHnMLtU2.js → index-NOeUp1Wc.js} +235 -381
  108. package/dist/{index-C6pr4oIv.js → index-NhHbOATm.js} +1243 -1315
  109. package/dist/{index-C7wVaeC1.js → index-iEzy3892.js} +1 -1
  110. package/dist/{index.esm2017-DRrIFPLo.js → index.esm2017-DpKkF6uX.js} +57 -57
  111. package/dist/{loading--SZI7Tpo.js → loading-nQaPRntd.js} +1 -1
  112. package/dist/{lodash-BZqvXM_P.js → lodash-B6558zRv.js} +1 -1
  113. package/dist/{member-import-Bmt1OdRW.js → member-import-DWDpO4uU.js} +2 -2
  114. package/dist/{membership-BTFpH7Mg.js → membership-BY1-idAv.js} +3 -3
  115. package/dist/{money-BVtlYyxo.js → money-DE62jPYV.js} +1 -1
  116. package/dist/{number-DrOdGSrF.js → number-C9mUt-Ac.js} +1 -1
  117. package/dist/objectid-DyUyXFvt.js +145 -0
  118. package/dist/{onboarding-BjcSBC8v.js → onboarding-OTAVtlNj.js} +25 -25
  119. package/dist/{onboardingSetup-Dcv8i8qd.js → onboardingSetup-DhwhJk-r.js} +2 -2
  120. package/dist/{plugins-Iw52rJ1s.js → plugins-CpxP-Bn_.js} +3 -3
  121. package/dist/{reward-DF9tE7iA.js → reward-yx-Ttob3.js} +1 -1
  122. package/dist/{rule-rCPhlgAq.js → rule-C_T37PuL.js} +492 -572
  123. package/dist/rule-builder-WoEQdgK2.js +102 -0
  124. package/dist/style.css +1 -1
  125. package/dist/template-AnoXsK9Y.js +275 -0
  126. package/dist/{transaction.fn-Cp3ylqFD.js → transaction.fn-4IcKHgri.js} +2 -2
  127. package/dist/{trigger-O6JvCms4.js → trigger-8zSNA5H1.js} +9 -9
  128. package/dist/{useMarketingMaterialActions-Cnadk3AO.js → useMarketingMaterialActions-CXjA7dhm.js} +4 -4
  129. package/dist/{usePagination-C5lSxdqt.js → usePagination-BECgW_Yq.js} +1 -1
  130. package/dist/{user-B7iv0TRE.js → user-Czn9R1f-.js} +1 -1
  131. package/dist/vue-i18n-BJWf_QrH.js +2365 -0
  132. package/dist/{xlsx-DTJ6bUKL.js → xlsx-3kbv63FT.js} +440 -440
  133. package/dist/{zod-cIIx_Ng9.js → zod-DMdtnaR4.js} +1 -1
  134. package/package.json +3 -7
  135. package/dist/AuditLogs-CgrYStwa.js +0 -2016
  136. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BB2gszsG.js +0 -4584
  137. package/dist/Grab-BRbn6ffm.js +0 -301
  138. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-Dvcasf5O.js +0 -1322
  139. package/dist/ReviewFacebookCallback-BDl6NBkw.js +0 -225
  140. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D3MZsh4A.js +0 -1923
  141. package/dist/Settings-5HU_uY6B.js +0 -286
  142. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DlFCI1BT.js +0 -7007
  143. package/dist/business-BtEfH8Mt.js +0 -83
  144. package/dist/campaign.fn-D3_OzyyQ.js +0 -776
  145. package/dist/duplicateCampaign-19CDT2kM.js +0 -51
  146. package/dist/google-BQK68wbe.js +0 -5
  147. package/dist/objectid-DdJFC6TI.js +0 -145
  148. package/dist/template-v1F1rvUU.js +0 -227
  149. package/dist/vue-i18n-CYFvlTTS.js +0 -2365
package/dist/app.js CHANGED
@@ -1,7 +1,6 @@
1
- import "vue";
2
- import { F as e, i as o, r as p } from "./app--pRyBODF.js";
1
+ import { F as e, i as r, r as o } from "./app-DjtVpjOD.js";
3
2
  export {
4
3
  e as FmApp,
5
- o as i18nMessages,
6
- p as routes
4
+ r as i18nMessages,
5
+ o as routes
7
6
  };
@@ -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--SZI7Tpo.js";
5
- import { w as h, u as a } from "./xlsx-DTJ6bUKL.js";
4
+ import { u as x } from "./loading-nQaPRntd.js";
5
+ import { w as h, u as a } from "./xlsx-3kbv63FT.js";
6
6
  const t = {
7
7
  sortBy: "_id",
8
8
  descending: !1,
@@ -0,0 +1,82 @@
1
+ import { ref as i, computed as u } from "vue";
2
+ import { defineStore as w } from "pinia";
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-DXV_Kdhp.js";
5
+ const $ = {
6
+ async readSettings(e) {
7
+ try {
8
+ return r(await I(`marketing-v2/${e}/setting`).get(""));
9
+ } catch (t) {
10
+ if (console.error(JSON.stringify(t)), t instanceof b)
11
+ return {
12
+ _id: e,
13
+ business: e,
14
+ apiVersion: "v1"
15
+ };
16
+ throw t;
17
+ }
18
+ }
19
+ }, o = () => {
20
+ const e = S.getBusinessId();
21
+ if (!e) throw new Error("Invalid business ID");
22
+ return D(`businesses/${e}/location`, {
23
+ noIdRequired: !0
24
+ });
25
+ }, l = {
26
+ async read() {
27
+ return r(await o().get(""));
28
+ },
29
+ async readDevices() {
30
+ return r(await o().get("devices"));
31
+ },
32
+ async unregisterDevice(e) {
33
+ await r(await o().delete(`devices/${e}`));
34
+ },
35
+ async getOtp(e) {
36
+ return r(await o().post(`${e}/otp`));
37
+ }
38
+ }, h = w("mf-connect-business", () => {
39
+ const e = i("v2"), t = i(!1), a = i([]), c = i([]);
40
+ async function d() {
41
+ const n = y().currentBusiness.value, s = await $.readSettings(n == null ? void 0 : n.id);
42
+ return t.value = s && "business" in s && s.premium == !0 || !1, e.value = (s == null ? void 0 : s.apiVersion) || "v1", t.value;
43
+ }
44
+ async function v() {
45
+ return a.value = await l.read(), a.value;
46
+ }
47
+ async function p() {
48
+ return c.value = await l.readDevices(), c.value;
49
+ }
50
+ function m(n) {
51
+ return a.value.find((s) => s._id === n);
52
+ }
53
+ const f = u(() => [
54
+ { label: "All", value: null },
55
+ ...a.value.map((n) => ({
56
+ label: n.name,
57
+ value: n._id
58
+ }))
59
+ ]), g = u(() => 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
+ isPremium: t,
67
+ locations: a,
68
+ locationDevices: c,
69
+ // actions
70
+ readPremium: d,
71
+ readLocations: v,
72
+ readLocationDevices: p,
73
+ locationById: m,
74
+ // getters
75
+ locationItems: f,
76
+ locationOptions: g
77
+ };
78
+ });
79
+ export {
80
+ l,
81
+ h as u
82
+ };
@@ -1,27 +1,27 @@
1
1
  import { h as u } from "./moment-D7p2TMB-.js";
2
- import "./index-BHnMLtU2.js";
3
- import { e as f } from "./effect-B532leFF.js";
4
- import { components as h } from "@feedmepos/ui-library";
5
- import { a as E } from "./index-BCgTcZ7c.js";
6
- import { c as N } from "./rule-rCPhlgAq.js";
7
- import { u as I } from "./business-BtEfH8Mt.js";
8
- import { C as m } from "./campaign.fn-D3_OzyyQ.js";
9
- import { g as C, t as y } from "./index-DEENB4la.js";
10
- import { c as O } from "./string-Gcy5IM_H.js";
11
- import { i as g } from "./plugins-Iw52rJ1s.js";
12
- import { h as l } from "vue";
13
- import { F as s } from "./campaign.enum-Damu7hgo.js";
14
- const S = [
2
+ import "./index-NOeUp1Wc.js";
3
+ import { e as f } from "./effect-DmzU8TpX.js";
4
+ import { components as g } from "@feedmepos/ui-library";
5
+ import { i as b } from "./rule-builder-WoEQdgK2.js";
6
+ import { c as O } from "./rule-C_T37PuL.js";
7
+ import { u as E } from "./business-C0Ej4JRP.js";
8
+ import { C as m } from "./campaign.fn-BaBPV7He.js";
9
+ import { g as h, t as d } from "./index-DMgSW1aH.js";
10
+ import { c as y } from "./string-Gcy5IM_H.js";
11
+ import { i as c } from "./plugins-CpxP-Bn_.js";
12
+ import { h as p } from "vue";
13
+ import { F as s } from "./campaign.enum-mYG3oWwU.js";
14
+ const N = [
15
15
  "APP_INBOX",
16
16
  "PUSH",
17
17
  "SMS",
18
18
  "EMAIL",
19
19
  "WHATSAPP"
20
- ], R = [...S];
21
- function X(t) {
22
- return R.includes(t);
20
+ ], I = [...N];
21
+ function G(t) {
22
+ return I.includes(t);
23
23
  }
24
- function b(t, e) {
24
+ function C(t, e) {
25
25
  return t === "APP_INBOX" ? {
26
26
  title: "",
27
27
  previewText: "",
@@ -40,17 +40,17 @@ function b(t, e) {
40
40
  variables: e
41
41
  };
42
42
  }
43
- function z(t, e, n = []) {
43
+ function j(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] ?? b(e, n)
49
+ [e]: t.content[e] ?? C(e, n)
50
50
  }
51
51
  };
52
52
  }
53
- function W(t, e) {
53
+ function V(t, e) {
54
54
  const n = { ...t.content };
55
55
  return delete n[e], {
56
56
  ...t,
@@ -58,111 +58,99 @@ function W(t, e) {
58
58
  content: n
59
59
  };
60
60
  }
61
- function J(t, e, n) {
61
+ function X(t, e, n) {
62
62
  return {
63
63
  ...t,
64
64
  content: { ...t.content, [e]: n }
65
65
  };
66
66
  }
67
- function K(t, e, n) {
67
+ function z(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 q(t, e, n = []) {
73
+ function W(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] ?? b(e, n)
78
+ [e]: t.content[e] ?? C(e, n)
79
79
  };
80
80
  return o && delete a[o], {
81
81
  ...t,
82
- channels: [e, ...r.filter((p) => p !== e)],
82
+ channels: [e, ...r.filter((l) => l !== e)],
83
83
  content: a
84
84
  };
85
85
  }
86
- function Q(t, e) {
86
+ function J(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 Z(t, e) {
93
+ function K(t, e) {
94
94
  return { ...t, mode: e };
95
95
  }
96
- function tt(t, e) {
96
+ function q(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 && C.safeParse(a.url ?? "").success
101
+ (a) => a.label.trim().length > 0 && h.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" || C.safeParse(o.url ?? "").success;
106
+ const o = n, r = o.title.trim().length > 0 && o.body.trim().length > 0, a = o.destination !== "EXTERNAL" || h.safeParse(o.url ?? "").success;
107
107
  return r && a;
108
108
  }
109
109
  return n.content.trim().length > 0;
110
110
  }
111
- function A(t, e) {
111
+ function S(t, e) {
112
112
  return t.channels.map(e).join(t.mode === "fallback" ? " → " : " + ");
113
113
  }
114
- function et(t) {
114
+ function Q(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 = y(t);
118
+ t.delivery = d(t);
119
119
  return;
120
120
  }
121
121
  delete t.message, t.delivery = { mode: "fallback", channels: [], content: {} };
122
122
  }
123
123
  }
124
- const _ = 5;
125
- function D(t, e) {
124
+ const R = 5;
125
+ function A(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 p = n.get(String(a));
130
- p && o.push({ id: String(a), code: p.code, name: p.name });
129
+ const l = n.get(String(a));
130
+ l && o.push({ id: String(a), code: l.code, name: l.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 <= _ ? { 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));
134
+ return r === 0 && o.length <= R ? { kind: "names", names: o.map((a) => a.name) } : { kind: "count", rows: o, total: e.length, unavailable: r };
147
135
  }
148
136
  function i(t) {
149
- return l(
137
+ return p(
150
138
  "div",
151
139
  {
152
140
  class: `${t.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
153
141
  },
154
142
  [
155
- l(h.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
156
- l("span", { class: "fm-typo-en-body-md-600" }, t.name)
143
+ p(g.FmIcon, { size: "sm", name: t.icon, outline: !0 }),
144
+ p("span", { class: "fm-typo-en-body-md-600" }, t.name)
157
145
  ]
158
146
  );
159
147
  }
160
- const nt = {
148
+ const Z = {
161
149
  [s.enum.CREDIT]: {
162
150
  chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
163
151
  icon: "local_activity",
164
152
  get name() {
165
- return c("connect.campaign.common.typeName.CREDIT");
153
+ return c.global.t("connect.campaign.common.typeName.CREDIT");
166
154
  },
167
155
  chip() {
168
156
  return i(this);
@@ -172,7 +160,7 @@ const nt = {
172
160
  chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
173
161
  icon: "loyalty",
174
162
  get name() {
175
- return c("connect.campaign.common.typeName.PROMOTION");
163
+ return c.global.t("connect.campaign.common.typeName.PROMOTION");
176
164
  },
177
165
  chip() {
178
166
  return i(this);
@@ -182,7 +170,7 @@ const nt = {
182
170
  chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
183
171
  icon: "sell",
184
172
  get name() {
185
- return c("connect.campaign.common.typeName.VOUCHER");
173
+ return c.global.t("connect.campaign.common.typeName.VOUCHER");
186
174
  },
187
175
  chip() {
188
176
  return i(this);
@@ -192,7 +180,7 @@ const nt = {
192
180
  chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
193
181
  icon: "award_star",
194
182
  get name() {
195
- return c("connect.campaign.common.typeName.POINT");
183
+ return c.global.t("connect.campaign.common.typeName.POINT");
196
184
  },
197
185
  chip() {
198
186
  return i(this);
@@ -202,7 +190,7 @@ const nt = {
202
190
  chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
203
191
  icon: "campaign",
204
192
  get name() {
205
- return c("connect.campaign.common.typeName.BROADCAST");
193
+ return c.global.t("connect.campaign.common.typeName.BROADCAST");
206
194
  },
207
195
  chip() {
208
196
  return i(this);
@@ -212,7 +200,7 @@ const nt = {
212
200
  chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
213
201
  icon: "database",
214
202
  get name() {
215
- return c("connect.campaign.common.typeName.GAME");
203
+ return c.global.t("connect.campaign.common.typeName.GAME");
216
204
  },
217
205
  chip() {
218
206
  return i(this);
@@ -222,7 +210,7 @@ const nt = {
222
210
  chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
223
211
  icon: "editor_choice",
224
212
  get name() {
225
- return c("connect.campaign.common.typeName.REWARD_POOL");
213
+ return c.global.t("connect.campaign.common.typeName.REWARD_POOL");
226
214
  },
227
215
  chip() {
228
216
  return i(this);
@@ -232,7 +220,7 @@ const nt = {
232
220
  chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
233
221
  icon: "monetization_on",
234
222
  get name() {
235
- return c("connect.campaign.common.typeName.COIN");
223
+ return c.global.t("connect.campaign.common.typeName.COIN");
236
224
  },
237
225
  chip() {
238
226
  return i(this);
@@ -242,75 +230,61 @@ const nt = {
242
230
  chipClass: "",
243
231
  icon: "",
244
232
  get name() {
245
- return c("connect.campaign.common.typeName.MEMBERSHIP");
233
+ return c.global.t("connect.campaign.common.typeName.MEMBERSHIP");
246
234
  },
247
235
  chip() {
248
236
  return i(this);
249
237
  }
250
238
  },
239
+ // TODO: confirm color
251
240
  [s.enum.MISSION]: {
252
241
  chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
253
242
  icon: "editor_choice",
254
243
  get name() {
255
- return c("connect.campaign.common.typeName.MISSION");
244
+ return c.global.t("connect.campaign.common.typeName.MISSION");
256
245
  },
257
246
  chip() {
258
247
  return i(this);
259
248
  }
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
- }
268
249
  }
269
250
  };
270
- function ot(t) {
251
+ function tt(t) {
271
252
  const e = M(t), n = {
272
253
  active: "text-fm-color-typo-success bg-fm-color-system-success-100",
273
254
  upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
274
255
  expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
275
256
  };
276
- return t.type == "VOUCHER" ? l(h.FmChip, {
257
+ return t.type == "VOUCHER" ? p(g.FmChip, {
277
258
  class: n[e],
278
- label: O.title(c(`connect.campaign.common.status.${e}`)),
259
+ label: y.title(
260
+ c.global.t(`connect.campaign.common.status.${e}`)
261
+ ),
279
262
  compact: !0
280
- }) : l(h.FmChip, {
263
+ }) : p(g.FmChip, {
281
264
  class: n[e],
282
- label: O.title(c(`connect.campaign.common.status.${e}`)),
265
+ label: y.title(
266
+ c.global.t(`connect.campaign.common.status.${e}`)
267
+ ),
283
268
  compact: !0
284
269
  });
285
270
  }
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) {
271
+ function P(t) {
298
272
  if (!t || !t.start && !t.end)
299
273
  return "connect.campaign.common.always";
300
274
  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";
301
275
  return `${e} - ${n}`;
302
276
  }
303
- function rt(t) {
277
+ function et(t) {
304
278
  const { campaign: e } = t;
305
279
  return {
306
280
  "connect.campaign.common.campaign_name": e.name,
307
- "connect.campaign.common.campaign_period": T(
281
+ "connect.campaign.common.campaign_period": P(
308
282
  e.timeframeOptions
309
283
  ),
310
284
  get "connect.campaign.common.next_schedule_at"() {
311
- if ((e == null ? void 0 : e.event.type) != "SCHEDULE" || !e.event.rule || !E(e.event.rule))
285
+ if (e.event.type != "SCHEDULE" || !e.event.rule || !b(e.event.rule))
312
286
  return;
313
- const n = N(
287
+ const n = O(
314
288
  e.event.rule.rules.g_schedule
315
289
  );
316
290
  return n ? u(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
@@ -322,19 +296,19 @@ function rt(t) {
322
296
  },
323
297
  get "connect.campaign.broadcast.summary.delivery"() {
324
298
  if (e.type != "BROADCAST") return;
325
- const n = y(e);
299
+ const n = d(e);
326
300
  if (!(n.channels.length < 2))
327
301
  return `connect.campaign.broadcast.mode.${n.mode}.label`;
328
302
  },
329
303
  get "connect.campaign.broadcast.summary.channels"() {
330
304
  var n;
331
305
  if (e.type == "BROADCAST")
332
- return ((n = x(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
306
+ return ((n = T(e)) == null ? void 0 : n.route) ?? "connect.campaign.broadcast.noChannelsSelected";
333
307
  },
334
308
  get "connect.campaign.common.available_at"() {
335
- const n = D(
309
+ const n = A(
336
310
  e.targetLocation,
337
- I().locations
311
+ E().locations
338
312
  );
339
313
  return n.kind === "all" ? "connect.campaign.common.all_locations" : n.kind === "none" ? "connect.campaign.common.no_location" : n.kind === "names" ? n.names.join(", ") : n;
340
314
  }
@@ -346,18 +320,18 @@ function M(t) {
346
320
  t.timeframeOptions.end ?? u().add(1, "d")
347
321
  ) ? "active" : u().isAfter(t.timeframeOptions.end) ? "expired" : "upcoming" : "active";
348
322
  }
349
- function x(t) {
350
- const e = y(t);
323
+ function T(t) {
324
+ const e = d(t);
351
325
  if (!e.channels.length) return null;
352
- const o = A(e, (r) => g.global.t(`connect.campaign.broadcast.channel.${r}`));
326
+ const o = S(e, (r) => c.global.t(`connect.campaign.broadcast.channel.${r}`));
353
327
  return {
354
- strategy: e.channels.length > 1 ? g.global.t(
328
+ strategy: e.channels.length > 1 ? c.global.t(
355
329
  `connect.campaign.broadcast.strategy.${e.mode}`
356
330
  ) : null,
357
331
  route: o
358
332
  };
359
333
  }
360
- function ct(t) {
334
+ function nt(t) {
361
335
  var e, n;
362
336
  switch (t.event.type) {
363
337
  case "BILL_COMPLETED":
@@ -392,23 +366,22 @@ function ct(t) {
392
366
  }
393
367
  }
394
368
  export {
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
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
414
387
  };
@@ -1,14 +1,14 @@
1
1
  import { defineStore as d } from "pinia";
2
- import { reactive as b, onMounted as f, ref as s } from "vue";
3
- import { c } from "./index-DBzCfWxW.js";
4
- import { g as i, S as g, b as h } from "./index-B3sR1LMa.js";
2
+ import { reactive as f, onMounted as b, ref as a } from "vue";
3
+ import { c } from "./index-DNx-iJd1.js";
4
+ import { g as i, S as I, b as g } from "./index-DXV_Kdhp.js";
5
5
  const p = () => {
6
- const e = g.getBusinessId();
6
+ const e = I.getBusinessId();
7
7
  if (!e) throw new Error("Invalid business ID");
8
- return h(`businesses/${e}/campaigns`, {
8
+ return g(`businesses/${e}/campaigns`, {
9
9
  noIdRequired: !0
10
10
  });
11
- }, I = {
11
+ }, h = {
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
- }, A = d("mf-connect-campaign", () => {
21
- const e = b({
20
+ }, S = d("mf-connect-campaign", () => {
21
+ const e = f({
22
22
  promotion: [],
23
23
  voucher: [],
24
24
  broadcast: [],
@@ -27,13 +27,12 @@ const p = () => {
27
27
  credit: [],
28
28
  token: [],
29
29
  mission: [],
30
- grab: [],
31
30
  all: []
32
31
  });
33
- f(() => {
32
+ b(() => {
34
33
  console.log("🔧 CampaignStore Installed");
35
34
  });
36
- const t = s([]), r = s([]), n = s([]);
35
+ const t = a([]), r = a([]), n = a([]);
37
36
  async function u(k) {
38
37
  const o = await c.readAll({
39
38
  limit: 1e3,
@@ -41,39 +40,34 @@ const p = () => {
41
40
  sortBy: "_id",
42
41
  descending: !0
43
42
  });
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) {
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) {
51
48
  case "PROMOTION":
52
- e.promotion.push(a);
49
+ e.promotion.push(s);
53
50
  break;
54
51
  case "VOUCHER":
55
- e.voucher.push(a), n.value.push(a);
52
+ e.voucher.push(s), n.value.push(s);
56
53
  break;
57
54
  case "BROADCAST":
58
- ["SCHEDULE", "FEEDBACK"].includes(a.event.type) && e.broadcast.push(a);
55
+ ["SCHEDULE", "FEEDBACK"].includes(s.event.type) && e.broadcast.push(s);
59
56
  break;
60
57
  case "POINT":
61
- e.experience.push(a);
58
+ e.experience.push(s);
62
59
  break;
63
60
  case "COIN":
64
- e.point.push(a);
61
+ e.point.push(s);
65
62
  break;
66
63
  case "CREDIT":
67
- e.credit.push(a);
64
+ e.credit.push(s);
68
65
  break;
69
66
  case "GAME":
70
- e.token.push(a);
67
+ e.token.push(s);
71
68
  break;
72
69
  case "MISSION":
73
- e.mission.push(a);
74
- break;
75
- case "GRAB":
76
- e.grab.push(a);
70
+ e.mission.push(s);
77
71
  break;
78
72
  }
79
73
  }
@@ -81,7 +75,7 @@ const p = () => {
81
75
  r.value = await c.readGroups();
82
76
  }
83
77
  async function m() {
84
- t.value = await I.readAll();
78
+ t.value = await h.readAll();
85
79
  }
86
80
  return {
87
81
  // State
@@ -96,5 +90,5 @@ const p = () => {
96
90
  };
97
91
  });
98
92
  export {
99
- A as u
93
+ S as u
100
94
  };
@@ -1,4 +1,4 @@
1
- import { z as E } from "./index-BViMt33t.js";
1
+ import { z as E } from "./index-B6BmfoiZ.js";
2
2
  const M = E.enum([
3
3
  "VOUCHER",
4
4
  "PROMOTION",
@@ -9,8 +9,7 @@ const M = E.enum([
9
9
  "COIN",
10
10
  "REWARD_POOL",
11
11
  "GAME",
12
- "MISSION",
13
- "GRAB"
12
+ "MISSION"
14
13
  ]), O = E.enum([
15
14
  "TIME_BASED_PROMOTION",
16
15
  "GAME_PROMOTION",