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