@feedmepos/mf-connect 0.1.117-prod → 0.1.118-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 (154) hide show
  1. package/README.md +68 -1
  2. package/dist/{App-CAo1izHr.js → App-CBFNBDb2.js} +435 -418
  3. package/dist/AuditLogs-BtSA8b08.js +2016 -0
  4. package/dist/{Bin-DDDfjisJ.js → Bin-CjmS_Tfn.js} +8 -8
  5. package/dist/{Broadcast-BsCulZhE.js → Broadcast-BeePmZa1.js} +22 -21
  6. package/dist/{CampaignAnalytic-CnVYFSkT.js → CampaignAnalytic-CZlnyvOi.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-ZTHyZ_0y.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Du3Ah4HP.js} +9 -9
  8. package/dist/{Card-DPyQH9qZ.js → Card-C8SzQQ0z.js} +25 -24
  9. package/dist/{Collections-CZCVA969.js → Collections-BXNWTSZH.js} +197 -185
  10. package/dist/{Credit-BTg364-i.js → Credit-CK0-0yD1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BJx8K6Ja.js → DateRangeChip.vue_vue_type_script_setup_true_lang-BXYpYC7Y.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CdpnNDzR.js +4439 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js → EffectSheet.vue_vue_type_style_index_0_lang--Oyj3KYg.js} +32 -32
  14. package/dist/{Experience-Bk_eUcSX.js → Experience-CWJaj62g.js} +32 -31
  15. package/dist/{FileSaver.min-CXFiZAp7.js → FileSaver.min-lV9H82L5.js} +1 -1
  16. package/dist/{Game-CBnKpFdl.js → Game-zBV1LYAg.js} +19 -18
  17. package/dist/{GiftCardSetup-q75wNV_F.js → GiftCardSetup-Cnq9353j.js} +75 -75
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Cga0Th2O.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CdgSBdrX.js} +7 -7
  19. package/dist/{Goals-Bbbgurfd.js → Goals-Utk08egN.js} +4 -4
  20. package/dist/Grab-DwMmWmbT.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CZS05h1r.js → ImageInput.vue_vue_type_script_setup_true_lang-CNPeU9xm.js} +1 -1
  22. package/dist/{Index-C8_OWllb.js → Index-Bjgs18xf.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BlCg-jI7.js → LocationPicker.vue_vue_type_script_setup_true_lang-DWnf4lXH.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CACxChIo.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Dy_oWJaZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-DJlE0371.js → LoyaltyDashboard-DmUfujX_.js} +15 -15
  26. package/dist/MainLayout-DlDZQJfy.js +4 -0
  27. package/dist/{MainLayout-Bs2UPvFx.js → MainLayout.vue_vue_type_script_setup_true_lang-yAflY70k.js} +5 -4
  28. package/dist/Marketing-B0iKlHP-.js +269 -0
  29. package/dist/MarketingMaterialEdit-BNHxVb8A.js +1037 -0
  30. package/dist/{Member-C4yqwsMH.js → Member-Bcm3_pWB.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-BbumjyC_.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CPp4OpOx.js} +43 -50
  32. package/dist/{MemberImportHistory-CbuXCdxC.js → MemberImportHistory-AQgLzB3g.js} +7 -7
  33. package/dist/{MemberList-CpAepPBe.js → MemberList-CkMTo2uD.js} +103 -105
  34. package/dist/{MemberTransactions-BbpXvsSk.js → MemberTransactions-CxLCVjvw.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BaWgxbad.js → MessageInput.vue_vue_type_script_setup_true_lang-4N20f8Sj.js} +14 -14
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CEgMElLo.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DghbYpSQ.js} +1 -1
  37. package/dist/{Mission-Bdb9KVeP.js → Mission-CQS1CoDN.js} +22 -21
  38. package/dist/{Overview-CEiyGMcf.js → Overview-NQ287sgq.js} +23 -22
  39. package/dist/{Overview-D_9JwnFU.js → Overview-UG1IjY7-.js} +145 -144
  40. package/dist/{Point-Bd5cMXQx.js → Point-krMa_mb1.js} +22 -21
  41. package/dist/{Promotion-D9gZDvgR.js → Promotion-vFBmJSti.js} +137 -131
  42. package/dist/{Queue-BnAOL_rp.js → Queue-BusxSPt-.js} +46 -45
  43. package/dist/{Record-D6TWFKe0.js → Record-DjKqn0za.js} +9 -9
  44. package/dist/{Review-DLEgvnc-.js → Review-CqLp8l7U.js} +2 -2
  45. package/dist/ReviewFacebookCallback-D2kMSVFC.js +225 -0
  46. package/dist/{ReviewGoogleCallback-BgAbO3pI.js → ReviewGoogleCallback-B1cHR-o2.js} +5 -5
  47. package/dist/Reward-FeSxgzuS.js +444 -0
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-Bt-EqsiH.js → RewardGroup.vue_vue_type_script_setup_true_lang-CCxVjBsO.js} +16 -15
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-U403emCF.js +1923 -0
  50. package/dist/{Segment-B9Se5FFw.js → Segment-Nj59F9Nr.js} +304 -305
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-f7AS5vwv.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Kg9m-0DS.js} +31 -30
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-3BKA0UFI.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLbDApPL.js} +4 -4
  53. package/dist/Setting-CCIzNxv-.js +574 -0
  54. package/dist/{SettingAdvertisements-CLw-dqiA.js → SettingAdvertisements-CkPyAg5y.js} +12 -12
  55. package/dist/Settings-CYjKGCpa.js +286 -0
  56. package/dist/{Store-B5PPP5zM.js → Store-Bp8Zkzi2.js} +31 -30
  57. package/dist/{StoreRewards-DllyaVBY.js → StoreRewards-DXW5nVyW.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BYVezFI2.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-CS6b1cM3.js +7007 -0
  60. package/dist/{Tier-M_TApfju.js → Tier-B8Utn9Qb.js} +2576 -687
  61. package/dist/{Title-Cpltm-I2.js → Title-CwaNSFer.js} +94 -92
  62. package/dist/{Transaction-BYfAYRpv.js → Transaction-ieciAdXP.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BOhfGxVj.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CMwZl4E6.js} +26 -26
  64. package/dist/{Voucher-DHoyg0YZ.js → Voucher-BKfujj6r.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CkH-rNqZ.js} +16 -16
  66. package/dist/WhatsappAccount-D73WDP7a.js +161 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-C3L7vWZE.js +39 -0
  68. package/dist/WhatsappBot-DTWZAXhi.js +878 -0
  69. package/dist/WhatsappBotLogs-DtDcrjs9.js +372 -0
  70. package/dist/WhatsappBotSettings-7_mH9U4y.js +704 -0
  71. package/dist/WhatsappLayout-BVpaFJ8H.js +21 -0
  72. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-CMeaNKJt.js +261 -0
  73. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js → ZodTextField.vue_vue_type_script_setup_true_lang-BO1zA9AR.js} +2 -2
  74. package/dist/{app-B_doYklh.js → app-DX7OWVY2.js} +9159 -7383
  75. package/dist/app.js +4 -3
  76. package/dist/{base.export-DmbnT_bp.js → base.export-bamzzexi.js} +2 -2
  77. package/dist/browser-BSAOEeIM.js +1478 -0
  78. package/dist/{business-DdVGtTvx.js → business-D3U9HSu9.js} +1 -1
  79. package/dist/{campaign-jEhKmpKg.js → campaign-BqRf2VUO.js} +121 -94
  80. package/dist/{campaign-CVkA08zl.js → campaign-CKfeN2xN.js} +31 -25
  81. package/dist/{campaign.enum-DWu6-kOo.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  82. package/dist/{campaign.fn-BlgEyeFz.js → campaign.fn-DQe5LZuT.js} +82 -82
  83. package/dist/{collectible.enum-CVLkXKml.js → collectible.enum-Liy2wH3s.js} +1 -1
  84. package/dist/{collection.fn-DLNGTrPf.js → collection.fn-BcGqExuE.js} +2 -2
  85. package/dist/{currency-DKS1md4e.js → currency-sjMYWoI8.js} +1 -1
  86. package/dist/duplicateCampaign-CJF3ZLNd.js +51 -0
  87. package/dist/{effect-Bk-zYexf.js → effect-Cv8ugBR3.js} +1 -1
  88. package/dist/{email-addresses-I9A5iLzf.js → email-addresses-CWqtseTn.js} +2 -2
  89. package/dist/{feature-flag-DQti61iR.js → feature-flag-BIh6MM4i.js} +152 -136
  90. package/dist/google-BQK68wbe.js +5 -0
  91. package/dist/{helper-9cPlo6ae.js → helper-WnxOxoRK.js} +1 -1
  92. package/dist/{index-DuvnRxeo.js → index-5TTGGDnF.js} +1 -1
  93. package/dist/{index-CuyzSc1l.js → index-B3CkAr-6.js} +1 -1
  94. package/dist/{index-cgtAlOl9.js → index-B9XVyhtC.js} +8028 -10767
  95. package/dist/{index-ClYX4COd.js → index-BGguMtc0.js} +4 -3
  96. package/dist/{index-CNUXbXvG.js → index-Bdg48Cus.js} +19 -6
  97. package/dist/{index-fHiFL1dW.js → index-BoAmM8QH.js} +29 -15
  98. package/dist/{index-C-OnJpT8.js → index-BtmVXdRR.js} +1 -1
  99. package/dist/{index-1Cdj34z1.js → index-CDTETsXQ.js} +1 -1
  100. package/dist/index-C_H8jFYf.js +2743 -0
  101. package/dist/{index-BxpbI0GH.js → index-CeafUn1o.js} +7 -7
  102. package/dist/{index-Dj51vqab.js → index-CiSTQhs9.js} +4 -4
  103. package/dist/{index-CIwdXphn.js → index-ClvaVYkG.js} +2700 -2613
  104. package/dist/{index-Cj6oxbl0.js → index-CnsSd5Dg.js} +11 -10
  105. package/dist/{index-oNMFyOGe.js → index-D3yYjyaj.js} +8 -7
  106. package/dist/{index-BRm0LMTo.js → index-DDzi_-Lu.js} +611 -252
  107. package/dist/{index-3V8E9GaZ.js → index-DOgDR_QH.js} +2 -2
  108. package/dist/{index-DOE2VR99.js → index-DqZX-A6e.js} +198 -198
  109. package/dist/{index-vKvGJ4Ve.js → index-DxhNNZ-a.js} +2 -2
  110. package/dist/index-DzYFQGSw.js +74 -0
  111. package/dist/index-I9lmcd2w.js +109 -0
  112. package/dist/{index-728mP6kW.js → index-iiWxryxo.js} +683 -581
  113. package/dist/{index-DWkuIfHy.js → index-qI1yx02a.js} +390 -232
  114. package/dist/{index.esm2017-CsF37oA-.js → index.esm2017-GI2alVO5.js} +177 -177
  115. package/dist/{loading-BJJmTFoe.js → loading-Qx5K2WL0.js} +1 -1
  116. package/dist/{lodash-BMJ6_hsa.js → lodash-CeSjJptg.js} +1 -1
  117. package/dist/{member-import-DrGxVJt9.js → member-import-Cq8G7SsW.js} +6 -5
  118. package/dist/{membership-CAqKihwy.js → membership-BbeavSNs.js} +3 -3
  119. package/dist/{money-Bf9d2ZUH.js → money-D8YIFaGA.js} +1 -1
  120. package/dist/{number-CWXlGZa5.js → number-DAubZ5bt.js} +1 -1
  121. package/dist/objectid-DeXFWDMh.js +145 -0
  122. package/dist/{onboarding-Dn9O7r3a.js → onboarding-SyFxaTJY.js} +25 -25
  123. package/dist/{onboardingSetup-BMkDoGy-.js → onboardingSetup-CLpHlBn8.js} +2 -2
  124. package/dist/{plugins-KDgceFWV.js → plugins-BHuaMEYA.js} +3 -3
  125. package/dist/{MarketingMaterialEdit-o88sdvTM.js → remy-icon-BhUGu2NI.js} +2 -1031
  126. package/dist/{reward-eilGRaXi.js → reward-dYWnmAC8.js} +1 -1
  127. package/dist/{rule-Dr9Zjg_o.js → rule-BVsfOP2h.js} +572 -492
  128. package/dist/style.css +1 -1
  129. package/dist/template-BcdtbhUJ.js +188 -0
  130. package/dist/{timezone-C5CIfvHs.js → timezone-CUc7q5Ii.js} +1 -1
  131. package/dist/{transaction.fn-Cr-FLjh0.js → transaction.fn-jF9u_cBy.js} +2 -2
  132. package/dist/{trigger-B0Fv6wbN.js → trigger-COlbQlaB.js} +8 -8
  133. package/dist/useMarketingMaterialActions-Dq6-gsOW.js +125 -0
  134. package/dist/{usePagination-BcA-imTr.js → usePagination-BYZB6ORK.js} +1 -1
  135. package/dist/{user-DRvLwlBE.js → user-DK7L8VFR.js} +1 -1
  136. package/dist/vue-i18n-CDSTH7g5.js +2365 -0
  137. package/dist/{xlsx-CBObn76o.js → xlsx-CKxXlDzD.js} +224 -224
  138. package/dist/{zod-DWU5EdQV.js → zod-DjtAaF0U.js} +1 -1
  139. package/package.json +6 -2
  140. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ijya9Cho.js +0 -3494
  141. package/dist/Marketing-BvRYzFV8.js +0 -236
  142. package/dist/ReviewFacebookCallback-jVlm2O8f.js +0 -238
  143. package/dist/Reward-DBheQiFu.js +0 -442
  144. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CKL8MEld.js +0 -1883
  145. package/dist/Setting-B92JT_Y4.js +0 -2037
  146. package/dist/Settings-BmmM8ZnR.js +0 -179
  147. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-3Vvqf6_H.js +0 -1264
  148. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-7ZZ0e5tQ.js +0 -142
  149. package/dist/google-C3S8u0mT.js +0 -4
  150. package/dist/objectid-2DN5a9sY.js +0 -145
  151. package/dist/rule-builder-cz6Dy-no.js +0 -102
  152. package/dist/template-DwbazO8p.js +0 -236
  153. package/dist/useMarketingMaterialActions-CNk3LR9M.js +0 -96
  154. package/dist/vue-i18n-y7bHQpNx.js +0 -2365
@@ -1,442 +0,0 @@
1
- import { defineComponent as X, ref as x, computed as H, resolveComponent as w, openBlock as b, createBlock as h, unref as t, isRef as Z, withCtx as A, createElementVNode as f, createVNode as d, createCommentVNode as k, createElementBlock as M, Fragment as Y, h as _, onMounted as q, toDisplayString as B } from "vue";
2
- import { _ as z } from "./campaign-CpzFl8Vr.js";
3
- import { useDialog as Q, components as L } from "@feedmepos/ui-library";
4
- import { u as G } from "./loading-BJJmTFoe.js";
5
- import { u as J, C as ee } from "./membership-CAqKihwy.js";
6
- import { f as j, p as te } from "./plugins-KDgceFWV.js";
7
- import { u as oe } from "./vue-i18n-y7bHQpNx.js";
8
- import { c as ae } from "./object-BYyQ0PZp.js";
9
- import { Z as F } from "./zod-DWU5EdQV.js";
10
- import "./index-CIwdXphn.js";
11
- import { a as N } from "./index-oNMFyOGe.js";
12
- import { useCoreStore as le } from "@feedmepos/mf-common";
13
- import { _ as ne, a as ie } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DWHwM6AJ.js";
14
- import { b as re } from "./EffectSheet.vue_vue_type_style_index_0_lang-CfEnSXzg.js";
15
- import { J as K } from "./JsonViewer-v8_C7l5N.js";
16
- import { _ as se } from "./ZodTextField.vue_vue_type_script_setup_true_lang-B6tTjLAZ.js";
17
- import { i as de } from "./helper-9cPlo6ae.js";
18
- import { u as pe, r as P } from "./reward-eilGRaXi.js";
19
- import "./index-CuyzSc1l.js";
20
- import { C as ce } from "./campaign.fn-BlgEyeFz.js";
21
- import { e as me } from "./effect-Bk-zYexf.js";
22
- import { useRouter as ue } from "vue-router";
23
- import { R as ye } from "./app-B_doYklh.js";
24
- const fe = { class: "flex gap-8 items-center justify-start" }, we = /* @__PURE__ */ X({
25
- __name: "EditRewardSheet",
26
- emits: ["update"],
27
- setup(W, { expose: n, emit: I }) {
28
- const p = J(), { minor: C } = G, v = x(!1), a = x({}), y = x(), R = H(() => {
29
- var l;
30
- return ((l = a.value.option) == null ? void 0 : l.collectibleType) === "CREDIT" ? N.superRefine((e, o) => {
31
- var i, m, g, r;
32
- !((m = (i = e.option) == null ? void 0 : i.validityOption) != null && m.validForDay) && !((r = (g = e.option) == null ? void 0 : g.validityOption) != null && r.validBefore) && o.addIssue({
33
- code: "custom",
34
- path: [],
35
- message: "Credit validity must be set"
36
- });
37
- }) : N;
38
- }), u = H(() => {
39
- const l = R.value.safeParse(a.value);
40
- return l.success ? [] : l.error.errors;
41
- });
42
- function O(l, e) {
43
- l && (y.value = void 0, a.value = e), v.value = l;
44
- }
45
- const D = I;
46
- async function S() {
47
- const l = R.value.safeParse(a.value);
48
- !l.success || !l.data || (await C(
49
- async () => {
50
- var e;
51
- l.data.option.type === "VOUCHER" && y.value && (l.data.option.collectibleConfig.image = await j.update(
52
- ((e = l.data.option.collectibleConfig) == null ? void 0 : e.image) || j.collectibleImagePath(void 0, y.value),
53
- y.value
54
- ));
55
- },
56
- {
57
- message: "Uploading reward image",
58
- successMessage: "Reward image updated"
59
- }
60
- ), D("update", l.data));
61
- }
62
- function T(l) {
63
- l === "VOUCHER" ? a.value.option = {
64
- collectible: null,
65
- type: "VOUCHER",
66
- collectibleConfig: de("VOUCHER", {
67
- business: le().currentBusiness.value._id
68
- }),
69
- earningOption: {
70
- amount: 1,
71
- type: "FIXED"
72
- },
73
- validityOption: {
74
- validForDay: 7
75
- }
76
- } : a.value.option = {
77
- collectible: p.loyaltyRewards.raw[0]._id,
78
- collectibleType: p.loyaltyRewards.raw[0].type,
79
- type: "LOYALTY",
80
- earningOption: {
81
- amount: 1,
82
- type: "FIXED"
83
- },
84
- validityOption: {
85
- validForDay: 7
86
- }
87
- };
88
- }
89
- function $(l) {
90
- a.value.option.collectible = l, a.value.option.collectibleType = p.loyaltyRewards.raw.find(
91
- (e) => e._id === l
92
- ).type;
93
- }
94
- const V = x();
95
- return n({
96
- showSheet: O
97
- }), (l, e) => {
98
- const o = w("FmSelect"), i = w("FmForm"), m = w("FmButton"), g = w("FmSideSheet");
99
- return b(), h(g, {
100
- "max-width": 560,
101
- modelValue: t(v),
102
- "onUpdate:modelValue": [
103
- e[8] || (e[8] = (r) => Z(v) ? v.value = r : null),
104
- e[9] || (e[9] = (r) => v.value = r)
105
- ],
106
- header: "Edit reward"
107
- }, {
108
- "side-sheet-footer": A(() => [
109
- f("div", fe, [
110
- d(m, {
111
- variant: "primary",
112
- type: "button",
113
- label: "Confirm",
114
- disabled: t(u).length > 0,
115
- onClick: e[6] || (e[6] = (r) => S())
116
- }, null, 8, ["disabled"]),
117
- d(m, {
118
- variant: "secondary",
119
- type: "button",
120
- label: "Cancel",
121
- onClick: e[7] || (e[7] = (r) => v.value = !1)
122
- })
123
- ])
124
- ]),
125
- default: A(() => [
126
- d(K, { json: t(a) }, null, 8, ["json"]),
127
- d(i, {
128
- class: "flex flex-col gap-y-24",
129
- ref_key: "formRef",
130
- ref: V,
131
- onValidationSuccess: e[5] || (e[5] = (r) => S())
132
- }, {
133
- default: A(() => {
134
- var r, E, c;
135
- return [
136
- d(se, {
137
- modelValue: t(a).name,
138
- "onUpdate:modelValue": e[0] || (e[0] = (s) => t(a).name = s),
139
- label: "Reward Name",
140
- schema: t(F).typeAtPath(t(R), "name", []),
141
- "error-text": t(F).helperText(t(u), "name")
142
- }, null, 8, ["modelValue", "schema", "error-text"]),
143
- d(o, {
144
- label: "Reward Type",
145
- disabled: !!t(a)._id,
146
- items: [
147
- { label: "Voucher", value: "VOUCHER" },
148
- { label: "Loyalty", value: "LOYALTY" }
149
- ],
150
- "model-value": t(a).option.type,
151
- "onUpdate:modelValue": T
152
- }, null, 8, ["disabled", "model-value"]),
153
- t(a).option.type == "LOYALTY" ? (b(), h(o, {
154
- key: 0,
155
- label: "Loyalty type",
156
- items: t(p).loyaltyRewards.items,
157
- "model-value": t(a).option.collectible,
158
- "onUpdate:modelValue": $
159
- }, null, 8, ["items", "model-value"])) : k("", !0),
160
- t(a).option.type === "LOYALTY" ? (b(), M(Y, { key: 1 }, [
161
- e[10] || (e[10] = f("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
162
- ((r = t(p).loyaltyRewards.items.find(
163
- (s) => {
164
- var U;
165
- return s.value === ((U = t(a)) == null ? void 0 : U.option.collectible);
166
- }
167
- )) == null ? void 0 : r.raw.type) !== "TITLE" ? (b(), h(ne, {
168
- key: 0,
169
- class: "mt-[-8px]",
170
- rules: [
171
- t(F).ruleAtPath(t(R), "option.earningOption", [
172
- t(a).option.type
173
- ])
174
- ],
175
- "helper-state": t(F).helperState(t(u), "option.earningOption"),
176
- "error-text": t(F).helperText(t(u), "option.earningOption"),
177
- "fixed-type": !0,
178
- "model-value": t(a).option.earningOption,
179
- "onUpdate:modelValue": e[1] || (e[1] = (s) => t(a).option.earningOption = s)
180
- }, null, 8, ["rules", "helper-state", "error-text", "model-value"])) : k("", !0),
181
- d(re, {
182
- class: "!gap-24",
183
- "for-credit": t(a).option.type === "LOYALTY" && ((E = t(p).loyaltyRewards.items.find(
184
- (s) => {
185
- var U;
186
- return s.value === ((U = t(a).option) == null ? void 0 : U.collectible);
187
- }
188
- )) == null ? void 0 : E.raw.type) === "CREDIT",
189
- type: t(a).option.type === "VOUCHER" ? "range" : "custom",
190
- rules: [
191
- t(F).ruleAtPath(t(R), "option.validityOption", [
192
- t(a).option.type
193
- ])
194
- ],
195
- "model-value": t(a).option.validityOption,
196
- "onUpdate:modelValue": e[2] || (e[2] = (s) => t(a).option.validityOption = s)
197
- }, null, 8, ["for-credit", "type", "rules", "model-value"])
198
- ], 64)) : k("", !0),
199
- t(a).option.type === "VOUCHER" ? (b(), h(ie, {
200
- key: 2,
201
- "reward-image": t(y),
202
- "model-value": ((c = t(a)) == null ? void 0 : c.option.collectibleConfig) ?? void 0,
203
- "onUpdate:modelValue": e[3] || (e[3] = (s) => t(a).option.collectibleConfig = s),
204
- "onUpdate:rewardImage": e[4] || (e[4] = (s) => y.value = s)
205
- }, null, 8, ["reward-image", "model-value"])) : k("", !0),
206
- d(K, { json: t(u) }, null, 8, ["json"])
207
- ];
208
- }),
209
- _: 1
210
- }, 512)
211
- ]),
212
- _: 1
213
- }, 8, ["modelValue"]);
214
- };
215
- }
216
- }), ve = { class: "px-24 flex flex-col gap-y-16" }, ge = { class: "flex items-center justify-between w-full" }, be = { class: "flex flex-col gap-16 text-center" }, Re = { class: "fm-typo-en-title-sm-800" }, Ce = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ke = /* @__PURE__ */ X({
217
- __name: "Reward",
218
- setup(W) {
219
- const { t: n } = oe(), I = {
220
- label: n("connect.storeRewards.create"),
221
- value: "create",
222
- isPrimary: !0,
223
- prependIcon: "add"
224
- }, p = J(), C = pe(), { global: v, minor: a } = G, y = ue(), R = Q(), u = x({
225
- searchKey: "",
226
- columnFilters: []
227
- }), O = H(() => C.rewards);
228
- function D(e) {
229
- y.push({
230
- name: ye["$connect-STORE_REWARD_COLLECTIONS"],
231
- params: { id: e }
232
- });
233
- }
234
- const S = [
235
- {
236
- header: n("connect.storeRewards.table.name"),
237
- accessorFn: (e) => e.name
238
- },
239
- {
240
- header: n("connect.storeRewards.table.type"),
241
- cell(e) {
242
- return e.row.original.collectibleConfig ? ee[e.row.original.collectibleConfig.type].chip() : "N/A";
243
- }
244
- },
245
- {
246
- header: n("connect.storeRewards.table.summary"),
247
- accessorFn: (e) => {
248
- var o, i;
249
- if (e.option.type === "VOUCHER")
250
- return me((i = (o = e.option.collectibleConfig) == null ? void 0 : o.extras) == null ? void 0 : i.effect);
251
- if (e.option.collectibleType == "TITLE") {
252
- const m = p.sortedTitles.find(
253
- (g) => g._id == e.option.collectible
254
- );
255
- return `Get ${m == null ? void 0 : m.name} valid for ${e.option.validityOption.validForDay} days`;
256
- }
257
- return `Get ${e.option.earningOption.amount} ${ce.formattedType(e.option.collectibleType)}`;
258
- }
259
- },
260
- {
261
- header: n("connect.storeRewards.table.actions"),
262
- cell(e) {
263
- return _("div", { class: "flex items-center justify-end gap-4" }, [
264
- _(
265
- L.FmMenu,
266
- {
267
- placement: "bottom-end",
268
- onClick: (o) => {
269
- o.stopPropagation();
270
- }
271
- },
272
- {
273
- "menu-button": () => _(L.FmButton, {
274
- icon: "more_vert",
275
- iconColor: "neutral-gray-400",
276
- variant: "tertiary"
277
- }),
278
- default: () => [
279
- e.row.original.option.type === "VOUCHER" && _(L.FmMenuItem, {
280
- label: "View collections",
281
- onClick: async (o) => {
282
- o.stopPropagation(), D(
283
- e.row.original.option.collectible
284
- );
285
- }
286
- }),
287
- _(
288
- L.FmMenuItem,
289
- {
290
- onClick: async (o) => {
291
- o.stopPropagation(), $(e.row.original);
292
- }
293
- },
294
- {
295
- label: _(
296
- "div",
297
- {
298
- class: "text-fm-color-typo-error fm-typo-en-body-md-400"
299
- },
300
- "Delete"
301
- )
302
- }
303
- )
304
- ]
305
- }
306
- )
307
- ]);
308
- }
309
- }
310
- ], T = x();
311
- async function $(e) {
312
- await te.remove(
313
- n("connect.storeRewards.delete.confirm"),
314
- n("connect.storeRewards.delete.title")
315
- ) && await a(
316
- async () => {
317
- await P.deleteReward(e._id), await C.readRewards();
318
- },
319
- {
320
- message: n("connect.storeRewards.delete.message"),
321
- successMessage: n("connect.storeRewards.delete.success")
322
- }
323
- );
324
- }
325
- async function V(e) {
326
- var o;
327
- e || (e = {
328
- name: "",
329
- option: {
330
- type: "LOYALTY",
331
- collectible: p.loyaltyRewards.items[0].value,
332
- collectibleType: p.loyaltyRewards.items[0].raw.type,
333
- validityOption: {
334
- validForDay: 7
335
- },
336
- earningOption: {
337
- type: "FIXED",
338
- amount: 1
339
- }
340
- }
341
- }), (o = T.value) == null || o.showSheet(!0, ae(e));
342
- }
343
- async function l(e) {
344
- let o = !1;
345
- e._id && e.option.type === "VOUCHER" && await new Promise((i) => {
346
- R.open({
347
- title: "Confirmation",
348
- message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
349
- primaryActions: { text: "Update all", close: !0 },
350
- secondaryActions: { text: "Update future only", close: !0 }
351
- }).onPrimary(async () => {
352
- o = !0, i();
353
- }).onSecondary(async () => {
354
- i();
355
- });
356
- }), await a(
357
- async () => {
358
- var i;
359
- e.collectibleConfig = void 0, e._id ? await P.updateReward(e._id, {
360
- ...e,
361
- updateCollection: o
362
- }) : await P.createReward(e), await C.readRewards(), (i = T.value) == null || i.showSheet(!1);
363
- },
364
- {
365
- message: "Updating reward",
366
- successMessage: "Reward updated successfully"
367
- }
368
- );
369
- }
370
- return q(async () => {
371
- await v(async () => {
372
- await p.readMembership(), await p.readRewards(), await C.readRewards();
373
- });
374
- }), (e, o) => {
375
- const i = w("FmPageHead"), m = w("FmSearch"), g = w("FmTable"), r = w("FmButton"), E = w("FmCard");
376
- return b(), M(Y, null, [
377
- d(i, {
378
- title: t(n)("connect.reward.title"),
379
- actions: [I],
380
- "back-button": !0,
381
- "onClick:action": o[0] || (o[0] = () => V()),
382
- "onClick:back": o[1] || (o[1] = () => {
383
- var c;
384
- return (c = t(y)) == null ? void 0 : c.back();
385
- })
386
- }, null, 8, ["title", "actions"]),
387
- f("div", ve, [
388
- t(O) && t(O).length > 0 ? (b(), M(Y, { key: 0 }, [
389
- f("div", ge, [
390
- o[6] || (o[6] = f("div", { class: "flex gap-8" }, null, -1)),
391
- d(m, {
392
- modelValue: t(u).searchKey,
393
- "onUpdate:modelValue": o[2] || (o[2] = (c) => t(u).searchKey = c),
394
- class: "",
395
- placeholder: "search",
396
- collapsible: ""
397
- }, null, 8, ["modelValue"])
398
- ]),
399
- d(g, {
400
- "row-data": t(O),
401
- "column-defs": S,
402
- "search-value": t(u).searchKey,
403
- "column-filter": t(u).columnFilters,
404
- onRowClick: o[3] || (o[3] = (c) => V(c.original)),
405
- "hide-footer": t(O).length < 10
406
- }, null, 8, ["row-data", "search-value", "column-filter", "hide-footer"])
407
- ], 64)) : (b(), h(E, {
408
- key: 1,
409
- variant: "outlined",
410
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
411
- }, {
412
- default: A(() => [
413
- o[7] || (o[7] = f("img", {
414
- src: z,
415
- class: "aspect-square w-[150px]"
416
- }, null, -1)),
417
- f("div", be, [
418
- f("div", Re, B(t(n)("connect.storeRewards.empty.title")), 1),
419
- f("div", Ce, B(t(n)("connect.storeRewards.empty.description")), 1)
420
- ]),
421
- d(r, {
422
- variant: "primary",
423
- label: t(n)("connect.storeRewards.empty.action"),
424
- onClick: o[4] || (o[4] = (c) => V()),
425
- icon: "add"
426
- }, null, 8, ["label"])
427
- ]),
428
- _: 1
429
- })),
430
- d(we, {
431
- ref_key: "rewardSheetRef",
432
- ref: T,
433
- onUpdate: o[5] || (o[5] = (c) => l(c))
434
- }, null, 512)
435
- ])
436
- ], 64);
437
- };
438
- }
439
- });
440
- export {
441
- Ke as default
442
- };