@feedmepos/mf-connect 0.1.98-beta.13 → 0.1.98-beta.15
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/package.json +1 -1
- package/dist/App-DQqZfak3.js +0 -4782
- package/dist/AuditLogs-C19m85wp.js +0 -2013
- package/dist/Bin-GjJ5Q2ae.js +0 -166
- package/dist/Broadcast-CVTBL0T0.js +0 -266
- package/dist/CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B6BYvVmq.js +0 -120
- package/dist/Card-DzYit3v6.js +0 -910
- package/dist/ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js +0 -97
- package/dist/Collections-CaU7auvn.js +0 -540
- package/dist/Credit-B_eUMV0R.js +0 -260
- package/dist/CustomSelect.vue_vue_type_script_setup_true_lang-Du7fRSZC.js +0 -128
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Bgcm1S_g.js +0 -3377
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CZLoCJM4.js +0 -351
- package/dist/Experience-B7kxE07l.js +0 -259
- package/dist/FileSaver.min-BBvy4uPh.js +0 -74
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/FmTableSelection.vue_vue_type_script_setup_true_lang-DzcUc0_w.js +0 -52
- package/dist/Game-B98hcWvR.js +0 -330
- package/dist/Grab-RdxV7xhM.js +0 -300
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-BBYekrJp.js +0 -145
- package/dist/Index-CvMVxCY5.js +0 -259
- package/dist/JsonViewer-v8_C7l5N.js +0 -87
- package/dist/LocationPicker.vue_vue_type_script_setup_true_lang-D4-wjMg6.js +0 -48
- package/dist/LottieAnimation.vue_vue_type_script_setup_true_lang-Jir8zY8e.js +0 -18737
- package/dist/LoyaltyDashboard-B1OzFT4q.js +0 -1082
- package/dist/MainLayout-De_edc-D.js +0 -41
- package/dist/Marketing-B7-To3XF.js +0 -235
- package/dist/MarketingMaterialEdit-DGONncxn.js +0 -1035
- package/dist/Member-DEGCrqnh.js +0 -280
- package/dist/MemberList-vKYbpLVu.js +0 -1601
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MemberTransactions-CGC3vYKC.js +0 -45
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-BP9YtuPA.js +0 -60802
- package/dist/Mission-hxf_AIGL.js +0 -334
- package/dist/Overview-NvgUuMYp.js +0 -949
- package/dist/Overview-iRLMLoAo.js +0 -1079
- package/dist/Point-tkUTXOCe.js +0 -262
- package/dist/Promotion-DNUcMKJQ.js +0 -397
- package/dist/Queue-5XYiIuG8.js +0 -260
- package/dist/Record-B5aYp7eF.js +0 -342
- package/dist/Review-BqaHlzXV.js +0 -45
- package/dist/ReviewFacebookCallback-BqlFkSB7.js +0 -248
- package/dist/ReviewGoogleCallback-ssKL4jh4.js +0 -213
- package/dist/Reward-1xOMowTW.js +0 -442
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Db3FSfIc.js +0 -149
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cmrp2Tia.js +0 -1911
- package/dist/Segment-BMBwsUug.js +0 -1014
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DSfdei-h.js +0 -181
- package/dist/SendCollectionSheet.vue_vue_type_script_setup_true_lang-BJVeGJ5J.js +0 -188
- package/dist/SendVoucherSheet.vue_vue_type_script_setup_true_lang-OBZubKUy.js +0 -226
- package/dist/Setting-DWygYkHW.js +0 -2047
- package/dist/SettingAdvertisements-TYB1b7dB.js +0 -264
- package/dist/Settings-DynjmCPL.js +0 -220
- package/dist/Store-DRYkmigC.js +0 -1996
- package/dist/StoreRewards-DU8eWbXE.js +0 -540
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BkqBjEFm.js +0 -1130
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-l6KmXVBZ.js +0 -7007
- package/dist/Tier-4k8SxKtl.js +0 -969
- package/dist/Title-B9lWQ_jl.js +0 -566
- package/dist/Transaction-C38Yd0tf.js +0 -39
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D6tgpKpc.js +0 -130
- package/dist/Voucher-BQbqC7RV.js +0 -421
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-erwpbvYi.js +0 -421
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-Dt05b7fU.js +0 -56
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-BTm9mz0r.js +0 -59940
- package/dist/app-wDQR6dpb.js +0 -39
- package/dist/app.js +0 -7
- package/dist/business-B7GwHLce.js +0 -82
- package/dist/campaign-BCdKDHgz.js +0 -277
- package/dist/campaign-CpzFl8Vr.js +0 -4
- package/dist/campaign-DWlsbsKQ.js +0 -219
- package/dist/campaign.enum-BgK4maXz.js +0 -26
- package/dist/campaign.fn-DxnwGCB2.js +0 -776
- package/dist/collectible.enum-CdOSUDwG.js +0 -19
- package/dist/duplicateCampaign-BSHe0P-g.js +0 -51
- package/dist/effect-C7wkN_13.js +0 -89
- package/dist/email-addresses-DJycNI7L.js +0 -705
- package/dist/export-uIHWDxuh.js +0 -97
- package/dist/feedme.ico +0 -0
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/helper-czpAhAIw.js +0 -86
- package/dist/index-5Sa4xS2m.js +0 -151
- package/dist/index-5WGEWCcI.js +0 -3
- package/dist/index-B2C7kc4z.js +0 -31
- package/dist/index-B5eb6_bi.js +0 -3678
- package/dist/index-B7nE1Pb2.js +0 -67
- package/dist/index-BFAHLexA.js +0 -32
- package/dist/index-BanxlNli.js +0 -8910
- package/dist/index-ByHoFriu.js +0 -85
- package/dist/index-Ca2bBJuR.js +0 -54
- package/dist/index-CuvNtC_M.js +0 -61
- package/dist/index-D-kYrDAi.js +0 -30289
- package/dist/index-D2gAYMIp.js +0 -28900
- package/dist/index-DWxmK2NJ.js +0 -61
- package/dist/index-U_rwkNKU.js +0 -2819
- package/dist/index-knizSLfz.js +0 -1157
- package/dist/index-vh86FiIQ.js +0 -10
- package/dist/index.esm2017-DFVkiPjd.js +0 -3069
- package/dist/loading-B3OgwEC8.js +0 -72
- package/dist/lodash-CiRTkvui.js +0 -3678
- package/dist/membership-s2VKnu_8.js +0 -255
- package/dist/moment-D7p2TMB-.js +0 -2583
- package/dist/money-DqxOXYd0.js +0 -15
- package/dist/number-Bt4sacaM.js +0 -12
- package/dist/object-BYyQ0PZp.js +0 -18
- package/dist/objectId-dwaoBfJX.js +0 -7
- package/dist/objectid-CxCupSWP.js +0 -145
- package/dist/plugins-CQ1JAqJB.js +0 -1788
- package/dist/reward-pjbal-XX.js +0 -36
- package/dist/rule-CzU2GAur.js +0 -1969
- package/dist/string-Gcy5IM_H.js +0 -32
- package/dist/style.css +0 -4
- package/dist/template-7yiMSL1f.js +0 -188
- package/dist/tier-BJDhpH6X.js +0 -4
- package/dist/tiers/tier=1.png +0 -0
- package/dist/tiers/tier=2.png +0 -0
- package/dist/tiers/tier=3.png +0 -0
- package/dist/tiers/tier=4.png +0 -0
- package/dist/titles/type=diamond.png +0 -0
- package/dist/titles/type=drinks.png +0 -0
- package/dist/titles/type=food.png +0 -0
- package/dist/titles/type=heart.png +0 -0
- package/dist/titles/type=medal.png +0 -0
- package/dist/titles/type=spend.png +0 -0
- package/dist/titles/type=thank-you.png +0 -0
- package/dist/titles/type=thumbs-up.png +0 -0
- package/dist/titles/type=years.png +0 -0
- package/dist/trigger-C5bqlYHn.js +0 -213
- package/dist/tslib.es6-BCqqvLQ_.js +0 -44
- package/dist/type_drinks-D6jnpvwV.js +0 -4
- package/dist/useMarketingMaterialActions-CW_QRtQb.js +0 -107
- package/dist/usePagination-D2pke4vy.js +0 -220
- package/dist/user-BcXrT_t5.js +0 -55
- package/dist/vue-i18n-CFNkj6JK.js +0 -2365
- package/dist/xlsx-DyVY5_Qx.js +0 -15491
- package/dist/zod-BD_8DRqQ.js +0 -91
package/dist/app-wDQR6dpb.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { ref as u, computed as a } from "vue";
|
|
2
|
-
import { defineStore as v } from "pinia";
|
|
3
|
-
const b = v("mf-connect-app", () => {
|
|
4
|
-
const e = u([]), l = u(null), t = u(null), i = u(localStorage.getItem("debugMode") === "true"), r = a(
|
|
5
|
-
() => e.value.some((o) => o.isGlobal === !0) || !1
|
|
6
|
-
), s = a(() => e.value.length > 0);
|
|
7
|
-
function c(o) {
|
|
8
|
-
e.value = [...e.value, ...o];
|
|
9
|
-
}
|
|
10
|
-
function d() {
|
|
11
|
-
e.value = [];
|
|
12
|
-
}
|
|
13
|
-
function f(o) {
|
|
14
|
-
e.value = e.value.filter(
|
|
15
|
-
(n) => !o.includes(n.id)
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
function g(o, n) {
|
|
19
|
-
l.value = o, t.value = n;
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
// state
|
|
23
|
-
loadingQueue: e,
|
|
24
|
-
snackbar: l,
|
|
25
|
-
dialog: t,
|
|
26
|
-
debugMode: i,
|
|
27
|
-
// getters
|
|
28
|
-
isGlobalLoading: r,
|
|
29
|
-
isLoading: s,
|
|
30
|
-
// actions
|
|
31
|
-
addLoadingQueues: c,
|
|
32
|
-
clearLoadingQueue: d,
|
|
33
|
-
resolveQueues: f,
|
|
34
|
-
initProvider: g
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
export {
|
|
38
|
-
b as u
|
|
39
|
-
};
|
package/dist/app.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
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 { a as I, g as r, A as b, S, b as D } from "./index-D2gAYMIp.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 v() {
|
|
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 d() {
|
|
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: v,
|
|
71
|
-
readLocations: d,
|
|
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,277 +0,0 @@
|
|
|
1
|
-
import "./index-BanxlNli.js";
|
|
2
|
-
import "./index-D-kYrDAi.js";
|
|
3
|
-
import { h as s } from "./moment-D7p2TMB-.js";
|
|
4
|
-
import "./index-B5eb6_bi.js";
|
|
5
|
-
import { e as f } from "./effect-C7wkN_13.js";
|
|
6
|
-
import { components as l } from "@feedmepos/ui-library";
|
|
7
|
-
import { i as h } from "./index-U_rwkNKU.js";
|
|
8
|
-
import { c as O } from "./rule-CzU2GAur.js";
|
|
9
|
-
import { u as C } from "./business-B7GwHLce.js";
|
|
10
|
-
import { C as m } from "./campaign.fn-DxnwGCB2.js";
|
|
11
|
-
import { c as g } from "./string-Gcy5IM_H.js";
|
|
12
|
-
import { i as d } from "./plugins-CQ1JAqJB.js";
|
|
13
|
-
import { h as p } from "vue";
|
|
14
|
-
import { F as a } from "./campaign.enum-BgK4maXz.js";
|
|
15
|
-
function E(e) {
|
|
16
|
-
switch (e) {
|
|
17
|
-
case "PROMOTION":
|
|
18
|
-
return "Promotion";
|
|
19
|
-
case "VOUCHER":
|
|
20
|
-
return "Voucher";
|
|
21
|
-
case "CREDIT":
|
|
22
|
-
return "Credit";
|
|
23
|
-
case "POINT":
|
|
24
|
-
return "Experience";
|
|
25
|
-
case "COIN":
|
|
26
|
-
return "Point";
|
|
27
|
-
case "GAME":
|
|
28
|
-
return "Game";
|
|
29
|
-
default:
|
|
30
|
-
return e;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
const G = {
|
|
34
|
-
formattedType: E
|
|
35
|
-
}, o = d.global.t;
|
|
36
|
-
function I() {
|
|
37
|
-
const e = d.global.locale;
|
|
38
|
-
return typeof e == "string" ? e : e.value;
|
|
39
|
-
}
|
|
40
|
-
function u(e) {
|
|
41
|
-
return new Intl.DateTimeFormat(I(), {
|
|
42
|
-
day: "2-digit",
|
|
43
|
-
month: "short",
|
|
44
|
-
year: "numeric"
|
|
45
|
-
}).format(new Date(e));
|
|
46
|
-
}
|
|
47
|
-
function c(e) {
|
|
48
|
-
return p(
|
|
49
|
-
"div",
|
|
50
|
-
{
|
|
51
|
-
class: `${e.chipClass} gap-4 h-[22px] inline-flex items-center justify-center min-w-min px-8 rounded-md`
|
|
52
|
-
},
|
|
53
|
-
[
|
|
54
|
-
p(l.FmIcon, { size: "sm", name: e.icon, outline: !0 }),
|
|
55
|
-
p("span", { class: "fm-typo-en-body-md-600" }, e.name)
|
|
56
|
-
]
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
const H = {
|
|
60
|
-
[a.enum.CREDIT]: {
|
|
61
|
-
chipClass: "!text-fm-color-secondary-plum !bg-[#f2ebfe]",
|
|
62
|
-
icon: "local_activity",
|
|
63
|
-
get name() {
|
|
64
|
-
return o("connect.campaign.common.typeName.CREDIT");
|
|
65
|
-
},
|
|
66
|
-
chip() {
|
|
67
|
-
return c(this);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
[a.enum.PROMOTION]: {
|
|
71
|
-
chipClass: "!text-fm-color-secondary-citrus !bg-fm-color-system-warning-100",
|
|
72
|
-
icon: "loyalty",
|
|
73
|
-
get name() {
|
|
74
|
-
return o("connect.campaign.common.typeName.PROMOTION");
|
|
75
|
-
},
|
|
76
|
-
chip() {
|
|
77
|
-
return c(this);
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
[a.enum.VOUCHER]: {
|
|
81
|
-
chipClass: "!text-fm-color-secondary-halite !bg-[#fff0f6]",
|
|
82
|
-
icon: "sell",
|
|
83
|
-
get name() {
|
|
84
|
-
return o("connect.campaign.common.typeName.VOUCHER");
|
|
85
|
-
},
|
|
86
|
-
chip() {
|
|
87
|
-
return c(this);
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
[a.enum.POINT]: {
|
|
91
|
-
chipClass: "!text-fm-color-secondary-cocoa !bg-[#fff9e6]",
|
|
92
|
-
icon: "award_star",
|
|
93
|
-
get name() {
|
|
94
|
-
return o("connect.campaign.common.typeName.POINT");
|
|
95
|
-
},
|
|
96
|
-
chip() {
|
|
97
|
-
return c(this);
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
[a.enum.BROADCAST]: {
|
|
101
|
-
chipClass: "!text-fm-color-typo-info !bg-fm-color-system-info-100",
|
|
102
|
-
icon: "campaign",
|
|
103
|
-
get name() {
|
|
104
|
-
return o("connect.campaign.common.typeName.BROADCAST");
|
|
105
|
-
},
|
|
106
|
-
chip() {
|
|
107
|
-
return c(this);
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
[a.enum.GAME]: {
|
|
111
|
-
chipClass: "!text-fm-color-secondary-mint !bg-fm-color-system-success-100",
|
|
112
|
-
icon: "database",
|
|
113
|
-
get name() {
|
|
114
|
-
return o("connect.campaign.common.typeName.GAME");
|
|
115
|
-
},
|
|
116
|
-
chip() {
|
|
117
|
-
return c(this);
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
[a.enum.REWARD_POOL]: {
|
|
121
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
122
|
-
icon: "editor_choice",
|
|
123
|
-
get name() {
|
|
124
|
-
return o("connect.campaign.common.typeName.REWARD_POOL");
|
|
125
|
-
},
|
|
126
|
-
chip() {
|
|
127
|
-
return c(this);
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
[a.enum.COIN]: {
|
|
131
|
-
chipClass: "!text-fm-color-system-success-400 !bg-fm-color-system-success-100",
|
|
132
|
-
icon: "monetization_on",
|
|
133
|
-
get name() {
|
|
134
|
-
return o("connect.campaign.common.typeName.COIN");
|
|
135
|
-
},
|
|
136
|
-
chip() {
|
|
137
|
-
return c(this);
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
[a.enum.MEMBERSHIP]: {
|
|
141
|
-
chipClass: "",
|
|
142
|
-
icon: "",
|
|
143
|
-
get name() {
|
|
144
|
-
return o("connect.campaign.common.typeName.MEMBERSHIP");
|
|
145
|
-
},
|
|
146
|
-
chip() {
|
|
147
|
-
return c(this);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
[a.enum.MISSION]: {
|
|
151
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
152
|
-
icon: "editor_choice",
|
|
153
|
-
get name() {
|
|
154
|
-
return o("connect.campaign.common.typeName.MISSION");
|
|
155
|
-
},
|
|
156
|
-
chip() {
|
|
157
|
-
return c(this);
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
[a.enum.GRAB]: {
|
|
161
|
-
chipClass: "!text-fm-color-secondary-tuna !bg-[#e3f4f9]",
|
|
162
|
-
icon: "editor_choice",
|
|
163
|
-
name: "Grab",
|
|
164
|
-
chip() {
|
|
165
|
-
return c(this);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
function U(e) {
|
|
170
|
-
const t = R(e), r = {
|
|
171
|
-
active: "text-fm-color-typo-success bg-fm-color-system-success-100",
|
|
172
|
-
upcoming: "text-fm-color-typo-info bg-fm-color-system-info-100",
|
|
173
|
-
expired: "text-fm-color-typo-error bg-fm-color-system-error-100"
|
|
174
|
-
};
|
|
175
|
-
return e.type == "VOUCHER" ? p(l.FmChip, {
|
|
176
|
-
class: r[t],
|
|
177
|
-
label: g.title(o(`connect.campaign.common.status.${t}`)),
|
|
178
|
-
compact: !0
|
|
179
|
-
}) : p(l.FmChip, {
|
|
180
|
-
class: r[t],
|
|
181
|
-
label: g.title(o(`connect.campaign.common.status.${t}`)),
|
|
182
|
-
compact: !0
|
|
183
|
-
});
|
|
184
|
-
}
|
|
185
|
-
function B(e) {
|
|
186
|
-
const t = e.timeframeOptions;
|
|
187
|
-
if (!t || !t.start && !t.end)
|
|
188
|
-
return o("connect.campaign.common.always_active");
|
|
189
|
-
if (!t.start && t.end)
|
|
190
|
-
return o("connect.campaign.common.valid_until", {
|
|
191
|
-
date: u(t.end)
|
|
192
|
-
});
|
|
193
|
-
const r = u(t.start), n = t.end ? u(t.end) : o("connect.campaign.common.unlimited");
|
|
194
|
-
return `${r} -> ${n}`;
|
|
195
|
-
}
|
|
196
|
-
function F(e) {
|
|
197
|
-
const { campaign: t } = e;
|
|
198
|
-
function r(n) {
|
|
199
|
-
if (!n || !n.start && !n.end)
|
|
200
|
-
return "connect.campaign.common.always";
|
|
201
|
-
const i = n.start ? u(n.start) : "From campaign creation", y = n.end ? u(n.end) : "Never ends";
|
|
202
|
-
return `${i} - ${y}`;
|
|
203
|
-
}
|
|
204
|
-
return {
|
|
205
|
-
"connect.campaign.common.campaign_name": t.name,
|
|
206
|
-
"connect.campaign.common.campaign_period": r(
|
|
207
|
-
t.timeframeOptions
|
|
208
|
-
),
|
|
209
|
-
get "connect.campaign.common.next_schedule_at"() {
|
|
210
|
-
if ((t == null ? void 0 : t.event.type) != "SCHEDULE" || !t.event.rule || !h(t.event.rule))
|
|
211
|
-
return;
|
|
212
|
-
const n = O(
|
|
213
|
-
t.event.rule.rules.g_schedule
|
|
214
|
-
);
|
|
215
|
-
return n ? s(n).format("ddd, DD MMM YYYY, hh:mmA") : void 0;
|
|
216
|
-
},
|
|
217
|
-
get "connect.campaign.common.discount_type"() {
|
|
218
|
-
if (t.type == "PROMOTION") return f(t.effect);
|
|
219
|
-
if ("configs" in e && e.configs.type == "VOUCHER")
|
|
220
|
-
return f(e.configs.extras.effect);
|
|
221
|
-
},
|
|
222
|
-
get "connect.campaign.common.available_at"() {
|
|
223
|
-
return t.targetLocation ? t.targetLocation.length > 0 ? t.targetLocation.map(
|
|
224
|
-
(n) => C().locationItems.find((i) => i.value == n).label
|
|
225
|
-
).join(",") : "connect.campaign.common.no_location" : "connect.campaign.common.all_locations";
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
function R(e) {
|
|
230
|
-
return e.timeframeOptions && e.timeframeOptions.type == "timeframe" ? s().isBetween(
|
|
231
|
-
e.timeframeOptions.start ?? s().subtract(1, "d"),
|
|
232
|
-
e.timeframeOptions.end ?? s().add(1, "d")
|
|
233
|
-
) ? "active" : s().isAfter(e.timeframeOptions.end) ? "expired" : "upcoming" : "active";
|
|
234
|
-
}
|
|
235
|
-
function V(e) {
|
|
236
|
-
var t, r;
|
|
237
|
-
switch (e.event.type) {
|
|
238
|
-
case "BILL_COMPLETED":
|
|
239
|
-
const n = `Spend to get ${m.formattedType(e.type)}`;
|
|
240
|
-
switch (e.type) {
|
|
241
|
-
case "POINT":
|
|
242
|
-
case "CREDIT":
|
|
243
|
-
case "COIN":
|
|
244
|
-
return e.earningOption.type == "FIXED" ? `Spend to get ${e.earningOption.amount} ${m.formattedType(e.type)}` : `Every ${e.earningOption.every} amount spent get ${e.earningOption.amount} ${m.formattedType(e.type)}`;
|
|
245
|
-
case "VOUCHER":
|
|
246
|
-
const i = (r = (t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.extras) == null ? void 0 : r.effect;
|
|
247
|
-
return i ? `${n} - ${f(i)}` : n;
|
|
248
|
-
default:
|
|
249
|
-
return n;
|
|
250
|
-
}
|
|
251
|
-
case "FEEDBACK":
|
|
252
|
-
return `Give feedback to receive ${m.formattedType(e.type)}`;
|
|
253
|
-
case "SCHEDULE":
|
|
254
|
-
return `Receive ${m.formattedType(e.type)} on scheduled time`;
|
|
255
|
-
case "SIMPLE_CLAIM":
|
|
256
|
-
return "Simple claim voucher";
|
|
257
|
-
case "TIER_UPGRADED":
|
|
258
|
-
return `Receive ${m.formattedType(e.type)} when member tier upgraded`;
|
|
259
|
-
case "MEMBERSHIP_JOINED":
|
|
260
|
-
return `Receive ${m.formattedType(e.type)} when member joined`;
|
|
261
|
-
case "MAKING_ORDER":
|
|
262
|
-
return e.type !== "PROMOTION" ? void 0 : f(e.effect);
|
|
263
|
-
default:
|
|
264
|
-
throw new Error(
|
|
265
|
-
`Not implemented ${JSON.stringify({ cause: e.event.type })}`
|
|
266
|
-
);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
export {
|
|
270
|
-
H as C,
|
|
271
|
-
R as a,
|
|
272
|
-
U as b,
|
|
273
|
-
V as c,
|
|
274
|
-
G as d,
|
|
275
|
-
F as e,
|
|
276
|
-
B as g
|
|
277
|
-
};
|