@feedmepos/mf-connect 0.1.98-beta.6 → 0.1.98-beta.61
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/dist/{App-CvJ0ASlp.js → App-BPFhGsvV.js} +812 -666
- package/dist/{AuditLogs-Bt9S2LKL.js → AuditLogs-CW8vs5kM.js} +14 -13
- package/dist/{Bin-ZSCDSioa.js → Bin-CgdkmL0M.js} +8 -8
- package/dist/Broadcast-CoRRvfXh.js +302 -0
- package/dist/CampaignAnalytic-UAwVz0E3.js +1830 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-LweQ57aG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B_IbtQLp.js} +6 -5
- package/dist/Card-D3-MgguK.js +1084 -0
- package/dist/{Collections-H7zhe9zN.js → Collections-BU7-Lz_-.js} +14 -13
- package/dist/Credit-C9gf6eCr.js +286 -0
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-UK9GcPFC.js +53 -0
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B9A98JpX.js +4213 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-qNmiKaJc.js → EffectSheet.vue_vue_type_style_index_0_lang-nKD6CT3U.js} +35 -35
- package/dist/{Experience-CH5tg-tm.js → Experience-dKvKT4v4.js} +112 -86
- package/dist/{FileSaver.min-DNFqiyZb.js → FileSaver.min-CI8hZvUL.js} +1 -1
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
- package/dist/Game-CBjdeb6F.js +356 -0
- package/dist/GiftCardSetup-DA9yMwPR.js +662 -0
- package/dist/{Grab-3s_sLewD.js → Grab-zCeZMSNI.js} +33 -32
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fbmoN1e9.js → ImageInput.vue_vue_type_script_setup_true_lang-CxhlYuM9.js} +1 -1
- package/dist/{Index-zTWZCiEo.js → Index-UGpjUfjV.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BOxYPkf5.js → LocationPicker.vue_vue_type_script_setup_true_lang-D21fIVUX.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-wjJ_cwft.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DrB7xzy1.js} +1 -1
- package/dist/LoyaltyDashboard-CBPnQReU.js +2865 -0
- package/dist/MainLayout-BBJUWsAz.js +143 -0
- package/dist/{Marketing-Bto1OvK1.js → Marketing-BjQG6Q41.js} +7 -6
- package/dist/{MarketingMaterialEdit-D7rIqF5U.js → MarketingMaterialEdit-CMUbiKjd.js} +15 -14
- package/dist/Member-B-7tGoFW.js +649 -0
- package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-BLmafK0n.js +1287 -0
- package/dist/MemberImportHistory-CDyHKO1L.js +187 -0
- package/dist/MemberList-f0dMdOF8.js +336 -0
- package/dist/{MemberTransactions-CjTtGB2y.js → MemberTransactions-DVcRoyxv.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DvKL7BL5.js → MessageInput.vue_vue_type_script_setup_true_lang-CnpXUVvO.js} +5682 -5479
- package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BTBXutpq.js +40 -0
- package/dist/Mission-CrrXaD8F.js +360 -0
- package/dist/{Overview-mxGLyFvE.js → Overview-CAIxshHU.js} +21 -20
- package/dist/Overview-Y_hxLN7Y.js +1316 -0
- package/dist/Point-CE0G4oxW.js +288 -0
- package/dist/Promotion-C_NQWWOT.js +423 -0
- package/dist/{Queue-DgaFyyyH.js → Queue-BfZGOOsa.js} +14 -13
- package/dist/{Record-BRol__6_.js → Record-BR3Su26B.js} +9 -9
- package/dist/Review-FrIgV7vH.js +45 -0
- package/dist/ReviewFacebookCallback-DOyee73-.js +238 -0
- package/dist/ReviewGoogleCallback-CX0cbT4r.js +213 -0
- package/dist/{Reward-DQI0PvmR.js → Reward-COkgkVT-.js} +35 -35
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-B6bvQNsU.js → RewardGroup.vue_vue_type_script_setup_true_lang-CUd-Gy5a.js} +14 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DgAU7jGo.js → RuleGroup.vue_vue_type_script_setup_true_lang-eBVDv0Qy.js} +103 -109
- package/dist/{Segment-DFaLx0QZ.js → Segment-kh3FuWRP.js} +30 -29
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cpb2i9iV.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUoiQlba.js} +31 -30
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-MvoepHn9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BkylJ859.js} +4 -4
- package/dist/{Setting-D2NjFJvq.js → Setting-UDrEIdF9.js} +14 -14
- package/dist/{SettingAdvertisements-CPWgSMaA.js → SettingAdvertisements-Dic4fC0u.js} +12 -12
- package/dist/Settings-Ct_ESMn8.js +230 -0
- package/dist/Store-CyG1FPWq.js +2612 -0
- package/dist/{StoreRewards-Ccj12pyq.js → StoreRewards-C9b_rMRT.js} +15 -15
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-DaGFayps.js +1329 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CfWTn0Xd.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dew6rC4d.js} +2 -2
- package/dist/{Tier-vaJoohiM.js → Tier-DgLEHrFJ.js} +2296 -750
- package/dist/{Title-BqHC7-v9.js → Title-C_8gMnYS.js} +39 -37
- package/dist/Transaction-B9E0jWw9.js +45 -0
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Dporb9KE.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DgW4dSkV.js} +26 -26
- package/dist/{Voucher-DeN6C6DQ.js → Voucher-DR3Eteh4.js} +156 -133
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-De16fuC4.js → VoucherEditor.vue_vue_type_script_setup_true_lang-JexB74ky.js} +115 -121
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DAC-j0Ln.js → ZodTextField.vue_vue_type_script_setup_true_lang-ChOd_di8.js} +2 -2
- package/dist/{app-n4Y2jMee.js → app-BIjITpNJ.js} +29593 -25208
- package/dist/app.js +1 -1
- package/dist/base.export-DqZ38Nx2.js +75 -0
- package/dist/{business-jn-_l48y.js → business-j4ZuiLuJ.js} +5 -5
- package/dist/campaign-DxhXoOvw.js +100 -0
- package/dist/campaign-MS9awZ18.js +368 -0
- package/dist/{campaign.enum-C9HvoKuq.js → campaign.enum-Bk6qcWR3.js} +1 -1
- package/dist/campaign.fn-DR_X38U8.js +776 -0
- package/dist/{collectible.enum-_HVU4lWn.js → collectible.enum-C_E4CCGR.js} +1 -1
- package/dist/collection.fn-BfyWr7cC.js +26 -0
- package/dist/currency-DZzC-632.js +7 -0
- package/dist/{duplicateCampaign-gzVwrnWb.js → duplicateCampaign-BgTmR0T2.js} +11 -11
- package/dist/{effect-DhpIv1L3.js → effect-DPCjkqDR.js} +1 -1
- package/dist/{email-addresses-DPxYLSoa.js → email-addresses-BoPJkP5p.js} +209 -201
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-WYHUnHVy.js → helper-DwJK1iKj.js} +1 -1
- package/dist/{index-BPsofsGt.js → index-8vHynDvo.js} +1933 -2560
- package/dist/{index-BdqRrCt8.js → index-Bd4ErVnX.js} +5 -5
- package/dist/index-BkFxLxI6.js +137 -0
- package/dist/index-BvxBDSzh.js +72 -0
- package/dist/{index-DUTFNEn9.js → index-C5Jm1Was.js} +4 -4
- package/dist/{index-xao4ggML.js → index-CIuQyo1z.js} +5 -5
- package/dist/{index-C-5YgmkC.js → index-CMJCsyXT.js} +7 -5
- package/dist/index-CTo26AN3.js +14530 -0
- package/dist/{index-Cte6dHHy.js → index-CVMsPseO.js} +14 -14
- package/dist/{index-BdnHQSDd.js → index-CXbojcfi.js} +5 -4
- package/dist/index-Cso1GrEu.js +53 -0
- package/dist/{index-Cvfavr2M.js → index-DD24eHtV.js} +351 -216
- package/dist/index-DGOX45St.js +151 -0
- package/dist/index-DP6WMBRq.js +900 -0
- package/dist/{index-7HizF3GI.js → index-DfwXt9fy.js} +1588 -1522
- package/dist/{index--fNMSXUf.js → index-Dn2mOB0A.js} +1 -1
- package/dist/{index-BuLfxJyC.js → index-LJrZDUgh.js} +105 -123
- package/dist/{index-BN-FP9kx.js → index-a15EaBn7.js} +1 -1
- package/dist/{index.esm2017-CjzFPUCa.js → index.esm2017-CWii-ZqX.js} +164 -164
- package/dist/{loading-CojnK00V.js → loading-CibOtJVR.js} +1 -1
- package/dist/{lodash-CLkg5jTT.js → lodash-oHoQ9t6u.js} +1 -1
- package/dist/member-import-BgJP811X.js +187 -0
- package/dist/membership-CqFY6ya6.js +274 -0
- package/dist/{money-CyaLaEKo.js → money-tVvfE8ha.js} +1 -1
- package/dist/{number-DEtI4bEX.js → number-B4p37H0W.js} +1 -1
- package/dist/objectid-reVda6sT.js +145 -0
- package/dist/{plugins-MnP1vCcg.js → plugins-S4qmcyLz.js} +13 -12
- package/dist/remy-Qz_pNsUS.js +13 -0
- package/dist/{reward-Dk3D26xC.js → reward-CgHNw9uj.js} +1 -1
- package/dist/{rule-B1Agad1n.js → rule-BECsW_aD.js} +335 -275
- package/dist/style.css +1 -1
- package/dist/{template-DpqLCq1p.js → template-jOqP_F7D.js} +6 -6
- package/dist/timezone-BBXko2_m.js +20 -0
- package/dist/transaction.fn-3DOFgJNT.js +64 -0
- package/dist/{trigger-cwPN-4Ia.js → trigger-DBIaHlqi.js} +17 -17
- package/dist/useMarketingMaterialActions-Dnln39_O.js +96 -0
- package/dist/{usePagination-D8zBMxdJ.js → usePagination-BKN2uLM2.js} +1 -1
- package/dist/{user-EUGwaL2f.js → user-CTKTBdLx.js} +1 -1
- package/dist/{vue-i18n-BBj45p9N.js → vue-i18n-Di-6yoyq.js} +233 -233
- package/dist/{xlsx-DiMIlKmu.js → xlsx-Z1jRdg68.js} +584 -584
- package/dist/{zod-B1cU167C.js → zod-BmQ5EO9I.js} +1 -1
- package/package.json +6 -5
- package/dist/Broadcast-BT0R11RB.js +0 -266
- package/dist/Card-Wdh8lyUv.js +0 -910
- package/dist/Credit-BuKLrFtM.js +0 -260
- package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-B2sZFWUF.js +0 -3377
- package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
- package/dist/Game-C9s4qZz4.js +0 -330
- package/dist/LoyaltyDashboard-tOOk6zvV.js +0 -1082
- package/dist/MainLayout-iWi1DzXS.js +0 -41
- package/dist/Member-BdgdT-sa.js +0 -280
- package/dist/MemberList-DBIE-RWC.js +0 -1601
- package/dist/Mission-CWR6FBvN.js +0 -334
- package/dist/Point-BIt82fJk.js +0 -262
- package/dist/Promotion-Cl1vPi0B.js +0 -397
- package/dist/Review-DmV2YnFd.js +0 -1076
- package/dist/ReviewFacebookCallback-B5XgAWXo.js +0 -243
- package/dist/ReviewGoogleCallback-CYR03Wfd.js +0 -208
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-CAImd3yc.js +0 -181
- package/dist/Store-DjUe8ady.js +0 -1996
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-B7w69A3j.js +0 -1130
- package/dist/Transaction-BOmDOGnD.js +0 -39
- package/dist/campaign-BnI7-ceP.js +0 -219
- package/dist/campaign-rgDnocfT.js +0 -277
- package/dist/campaign.fn-D21ettpH.js +0 -776
- package/dist/export-CWAxYj7W.js +0 -97
- package/dist/index-B6EBgIUx.js +0 -85
- package/dist/index-CxR1baaG.js +0 -52
- package/dist/membership-CeX8E_I9.js +0 -255
- package/dist/objectid-CMau7CW-.js +0 -145
- package/dist/useMarketingMaterialActions-CGzfJ68e.js +0 -107
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { defineComponent as I, ref as i, computed as g, onMounted as j, resolveComponent as r, openBlock as c, createBlock as d, unref as o, withCtx as p, createVNode as b, normalizeClass as f, createCommentVNode as k, createElementVNode as B, toDisplayString as F, isRef as M, createElementBlock as O, Fragment as A, renderList as z } from "vue";
|
|
2
|
+
const N = { class: "fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap" }, E = /* @__PURE__ */ I({
|
|
3
|
+
__name: "FilterChip",
|
|
4
|
+
props: {
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: Array,
|
|
7
|
+
required: !1
|
|
8
|
+
},
|
|
9
|
+
label: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: !1,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
showItemLabel: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
placement: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: "bottom-end"
|
|
22
|
+
},
|
|
23
|
+
class: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: !1
|
|
26
|
+
},
|
|
27
|
+
disabled: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: !1
|
|
30
|
+
},
|
|
31
|
+
items: {
|
|
32
|
+
type: Array,
|
|
33
|
+
required: !0
|
|
34
|
+
},
|
|
35
|
+
icon: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: !1
|
|
38
|
+
},
|
|
39
|
+
searchable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
required: !1,
|
|
42
|
+
default: !0
|
|
43
|
+
},
|
|
44
|
+
allLabel: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: "All"
|
|
47
|
+
},
|
|
48
|
+
selectedLabel: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "{count} selected"
|
|
51
|
+
},
|
|
52
|
+
searchPlaceholder: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: "Search locations"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
emits: ["update:model-value"],
|
|
58
|
+
setup(u, { emit: C }) {
|
|
59
|
+
const e = u, v = C, m = i(!1), t = i({}), s = i(""), V = g(() => {
|
|
60
|
+
const l = Object.keys(t.value).length;
|
|
61
|
+
return !t.value || Object.keys(t.value).length == e.items.length || l === 0 ? e.allLabel : e.selectedLabel.replace("{count}", String(l));
|
|
62
|
+
});
|
|
63
|
+
function w(l) {
|
|
64
|
+
t.value[l] ? delete t.value[l] : t.value[l] = !0, v("update:model-value", Object.keys(t.value));
|
|
65
|
+
}
|
|
66
|
+
function L() {
|
|
67
|
+
Object.keys(t.value).length > 0 ? t.value = {} : t.value = e.items.reduce((l, n) => (l[n.value] = !0, l), {}), v("update:model-value", Object.keys(t.value));
|
|
68
|
+
}
|
|
69
|
+
const S = g(() => s.value && s.value.length > 0 ? e.items.filter(
|
|
70
|
+
(l) => l.label.toLowerCase().includes(s.value.trim().toLowerCase())
|
|
71
|
+
) : e.items);
|
|
72
|
+
return j(() => {
|
|
73
|
+
t.value = e.modelValue.reduce((l, n) => (l[n] = !0, l), {}), e.modelValue.length == 0;
|
|
74
|
+
}), (l, n) => {
|
|
75
|
+
const y = r("FmIcon"), _ = r("FmChip"), x = r("FmTextField"), h = r("FmMenuItem"), q = r("FmMenu");
|
|
76
|
+
return c(), d(q, {
|
|
77
|
+
placement: u.placement || "bottom-end",
|
|
78
|
+
disabled: u.disabled == !0,
|
|
79
|
+
"model-value": o(m),
|
|
80
|
+
onMenuChanged: n[1] || (n[1] = (a) => m.value = a),
|
|
81
|
+
"close-on-click": !1
|
|
82
|
+
}, {
|
|
83
|
+
"menu-button": p(() => [
|
|
84
|
+
b(_, {
|
|
85
|
+
label: u.label,
|
|
86
|
+
class: f(e.class || "text-fm-color-neutral-gray-400 cursor-pointer")
|
|
87
|
+
}, {
|
|
88
|
+
default: p(() => [
|
|
89
|
+
e.icon ? (c(), d(y, {
|
|
90
|
+
key: 0,
|
|
91
|
+
name: e.icon,
|
|
92
|
+
class: f(e.class),
|
|
93
|
+
outline: "",
|
|
94
|
+
size: "sm"
|
|
95
|
+
}, null, 8, ["name", "class"])) : k("", !0),
|
|
96
|
+
B("div", N, F(e.label) + " " + F(u.showItemLabel ? o(V) : ""), 1),
|
|
97
|
+
b(y, {
|
|
98
|
+
name: o(m) ? "keyboard_arrow_up" : "keyboard_arrow_down",
|
|
99
|
+
class: f(e.class),
|
|
100
|
+
outline: "",
|
|
101
|
+
size: "sm"
|
|
102
|
+
}, null, 8, ["name", "class"])
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
}, 8, ["label", "class"])
|
|
106
|
+
]),
|
|
107
|
+
default: p(() => [
|
|
108
|
+
u.searchable ? (c(), d(x, {
|
|
109
|
+
key: 0,
|
|
110
|
+
modelValue: o(s),
|
|
111
|
+
"onUpdate:modelValue": n[0] || (n[0] = (a) => M(s) ? s.value = a : null),
|
|
112
|
+
placeholder: e.searchPlaceholder,
|
|
113
|
+
class: "my-8"
|
|
114
|
+
}, null, 8, ["modelValue", "placeholder"])) : k("", !0),
|
|
115
|
+
b(h, {
|
|
116
|
+
"model-value": Object.keys(o(t)).length === e.items.length,
|
|
117
|
+
label: e.allLabel,
|
|
118
|
+
"has-checkbox": !0,
|
|
119
|
+
indeterminate: !0,
|
|
120
|
+
onClick: L
|
|
121
|
+
}, null, 8, ["model-value", "label"]),
|
|
122
|
+
(c(!0), O(A, null, z(o(S) ?? [], (a) => (c(), d(h, {
|
|
123
|
+
key: a.value,
|
|
124
|
+
value: a.value,
|
|
125
|
+
label: a.label,
|
|
126
|
+
"has-checkbox": !0,
|
|
127
|
+
"model-value": o(t)[a.value],
|
|
128
|
+
"onUpdate:modelValue": (T) => w(a.value)
|
|
129
|
+
}, null, 8, ["value", "label", "model-value", "onUpdate:modelValue"]))), 128))
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}, 8, ["placement", "disabled", "model-value"]);
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
export {
|
|
137
|
+
E as _
|
|
138
|
+
};
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { defineComponent as J, ref as A, computed as Q, onMounted as X, resolveComponent as m, openBlock as f, createElementBlock as P, Fragment as R, createVNode as r, unref as o, withCtx as b, createElementVNode as n, toDisplayString as g, renderList as Z, createBlock as V, resolveDynamicComponent as ee, h as l } from "vue";
|
|
2
|
+
import { _ as te } from "./campaign-CpzFl8Vr.js";
|
|
3
|
+
import { useDialog as oe, components as y } from "@feedmepos/ui-library";
|
|
4
|
+
import { c as ae, p as ne } from "./plugins-S4qmcyLz.js";
|
|
5
|
+
import { u as ie } from "./loading-CibOtJVR.js";
|
|
6
|
+
import { u as re } from "./business-j4ZuiLuJ.js";
|
|
7
|
+
import { u as se } from "./campaign-DxhXoOvw.js";
|
|
8
|
+
import { b as T, c as U, a as le } from "./campaign-MS9awZ18.js";
|
|
9
|
+
import { c as ce, p as me } from "./duplicateCampaign-BgTmR0T2.js";
|
|
10
|
+
import { _ as de } from "./FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js";
|
|
11
|
+
import { _ as ue } from "./EditCampaignSheet.vue_vue_type_script_setup_true_lang-B9A98JpX.js";
|
|
12
|
+
import { u as pe } from "./template-jOqP_F7D.js";
|
|
13
|
+
import { u as fe } from "./vue-i18n-Di-6yoyq.js";
|
|
14
|
+
import { _ as ge } from "./SendCollectionSheet.vue_vue_type_script_setup_true_lang-CUoiQlba.js";
|
|
15
|
+
import "./index-Dn2mOB0A.js";
|
|
16
|
+
import { useRouter as ye } from "vue-router";
|
|
17
|
+
import { c as h } from "./index-DGOX45St.js";
|
|
18
|
+
import { R as _e } from "./app-BIjITpNJ.js";
|
|
19
|
+
const he = { class: "flex items-center" }, we = { class: "fm-typo-en-title-md-600 fm-step-title line-clamp-2 mr-8" }, Ce = { class: "px-24 flex flex-col gap-y-16" }, ve = { class: "flex items-center justify-between w-full" }, xe = { class: "flex gap-8 overflow-x-auto" }, be = { class: "space-y-8" }, ke = { class: "flex w-full gap-4 items-center" }, Fe = { class: "space-y-4" }, Se = { class: "fm-typo-en-body-lg-600" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Re = { class: "flex items-center gap-8" }, Ve = { class: "flex flex-col gap-16 text-center" }, Le = { class: "fm-typo-en-title-sm-800" }, Be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xe = /* @__PURE__ */ J({
|
|
20
|
+
__name: "Game",
|
|
21
|
+
setup(Ee) {
|
|
22
|
+
const { t: d } = fe(), D = ye(), I = {
|
|
23
|
+
label: d("connect.program.common.actions.create", {
|
|
24
|
+
type: d("connect.program.game.title").toLowerCase()
|
|
25
|
+
}),
|
|
26
|
+
value: "create",
|
|
27
|
+
isPrimary: !0,
|
|
28
|
+
prependIcon: "add"
|
|
29
|
+
}, L = oe(), K = pe("GAME", L), w = re(), u = se(), { global: j, minor: B } = ie, c = A({
|
|
30
|
+
searchKey: "",
|
|
31
|
+
location: []
|
|
32
|
+
});
|
|
33
|
+
function N(e) {
|
|
34
|
+
const t = c.value.location;
|
|
35
|
+
return !t || t.length === 0 || !e.targetLocation ? !0 : Array.isArray(t) ? t.some((s) => {
|
|
36
|
+
var i;
|
|
37
|
+
return (i = e == null ? void 0 : e.targetLocation) == null ? void 0 : i.includes(s);
|
|
38
|
+
}) : e.targetLocation.includes(t);
|
|
39
|
+
}
|
|
40
|
+
const C = Q(
|
|
41
|
+
() => u.campaigns.token.filter((e) => N(e))
|
|
42
|
+
), O = [
|
|
43
|
+
{
|
|
44
|
+
header: "Program title",
|
|
45
|
+
accessorKey: "name",
|
|
46
|
+
// accessorFn: (v) => v.name,
|
|
47
|
+
cell(e) {
|
|
48
|
+
return l("div", { class: "flex items-center justify-between gap-4" }, [
|
|
49
|
+
l("div", { class: "flex items-center" }, [
|
|
50
|
+
l(
|
|
51
|
+
y.FmTooltip,
|
|
52
|
+
{
|
|
53
|
+
content: e.row.original._id,
|
|
54
|
+
onClick: (t) => {
|
|
55
|
+
t.stopPropagation(), ae(e.row.original._id);
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
[
|
|
59
|
+
l(y.FmIcon, {
|
|
60
|
+
name: "info",
|
|
61
|
+
outline: !0,
|
|
62
|
+
size: "sm"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
)
|
|
66
|
+
]),
|
|
67
|
+
l("div", { class: "flex-1" }, e.row.original.name)
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
header: "Status",
|
|
73
|
+
accessorFn: (e) => le(e),
|
|
74
|
+
cell(e) {
|
|
75
|
+
return T(e.row.original);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
header: "Summary",
|
|
80
|
+
accessorFn: (e) => U(e)
|
|
81
|
+
//v.effect,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
header: "Token received",
|
|
85
|
+
accessorFn: (e) => {
|
|
86
|
+
var t;
|
|
87
|
+
return ((t = e == null ? void 0 : e.pf_collectible) == null ? void 0 : t.currentReceive) ?? 0;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
header: "Actions",
|
|
92
|
+
cell(e) {
|
|
93
|
+
return l("div", { class: "flex items-center gap-8" }, [
|
|
94
|
+
l(y.FmButton, {
|
|
95
|
+
variant: "tertiary",
|
|
96
|
+
icon: "insights",
|
|
97
|
+
iconColor: "neutral-gray-400",
|
|
98
|
+
onClick: async (t) => {
|
|
99
|
+
t.stopPropagation(), await G(e.row.original);
|
|
100
|
+
}
|
|
101
|
+
}),
|
|
102
|
+
l(y.FmButton, {
|
|
103
|
+
variant: "tertiary",
|
|
104
|
+
icon: "content_copy",
|
|
105
|
+
iconColor: "neutral-gray-400",
|
|
106
|
+
onClick: async (t) => {
|
|
107
|
+
t.stopPropagation(), await $(e.row.original);
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
l(y.FmButton, {
|
|
111
|
+
variant: "tertiary",
|
|
112
|
+
icon: "send",
|
|
113
|
+
iconColor: "neutral-gray-400",
|
|
114
|
+
onClick: (t) => {
|
|
115
|
+
t.stopPropagation(), q(e.row.original);
|
|
116
|
+
}
|
|
117
|
+
}),
|
|
118
|
+
l(y.FmButton, {
|
|
119
|
+
variant: "tertiary",
|
|
120
|
+
icon: "delete",
|
|
121
|
+
iconColor: "neutral-gray-400",
|
|
122
|
+
onClick: (t) => {
|
|
123
|
+
t.stopPropagation(), M(e.row.original);
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
], k = A(), E = A();
|
|
130
|
+
async function M(e) {
|
|
131
|
+
await ne.remove(`Are you sure you want to remove ${e.name}?`) && await B(
|
|
132
|
+
async () => {
|
|
133
|
+
await h.delete(e._id), await u.read("GAME");
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
message: `Removing ${e.name}`,
|
|
137
|
+
successMessage: `Removed ${e.name} successfully`
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
async function v(e) {
|
|
142
|
+
e ? await t() : K.open(async (s) => {
|
|
143
|
+
await t(s);
|
|
144
|
+
});
|
|
145
|
+
async function t(s) {
|
|
146
|
+
var i;
|
|
147
|
+
(i = k.value) == null || i.showSheet(
|
|
148
|
+
!0,
|
|
149
|
+
"GAME",
|
|
150
|
+
e ? await h.readById(e._id) : void 0,
|
|
151
|
+
s
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async function $(e) {
|
|
156
|
+
var i;
|
|
157
|
+
if (!await ce(e.name))
|
|
158
|
+
return;
|
|
159
|
+
const t = await h.readById(e._id), s = me(t);
|
|
160
|
+
(i = k.value) == null || i.showSheet(
|
|
161
|
+
!0,
|
|
162
|
+
"GAME",
|
|
163
|
+
s,
|
|
164
|
+
t.template
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
async function H(e) {
|
|
168
|
+
var t, s, i;
|
|
169
|
+
e.campaign._id && ((i = (s = (t = e.campaign) == null ? void 0 : t.game) == null ? void 0 : s.rewards) != null && i.some(
|
|
170
|
+
(p) => p.type === "VOUCHER"
|
|
171
|
+
)) && await new Promise((p) => {
|
|
172
|
+
L.open({
|
|
173
|
+
title: "Confirmation",
|
|
174
|
+
message: "This will change all future vouchers? Would you like to update previous claimed vouchers expiry date and discount?",
|
|
175
|
+
primaryActions: { text: "Update all", close: !0 },
|
|
176
|
+
secondaryActions: { text: "Update future only", close: !0 }
|
|
177
|
+
}).onPrimary(async () => {
|
|
178
|
+
e.updateCollections = !0, p();
|
|
179
|
+
}).onSecondary(async () => {
|
|
180
|
+
p();
|
|
181
|
+
});
|
|
182
|
+
}), await B(
|
|
183
|
+
async () => {
|
|
184
|
+
e.campaign._id ? await h.update(e.campaign._id, e) : await h.create(e), await u.read("GAME");
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
message: `${e.campaign._id ? "Updating" : "Creating"} game program`,
|
|
188
|
+
successMessage: `Game program ${e.campaign._id ? "updated" : "created"} successfully`
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
function q(e) {
|
|
193
|
+
var t;
|
|
194
|
+
(t = E.value) == null || t.showSheet({
|
|
195
|
+
campaign: e
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
async function G(e) {
|
|
199
|
+
await D.push({
|
|
200
|
+
name: _e["$connect-PROGRAM_GAME_ANALYTIC"],
|
|
201
|
+
params: { id: e._id }
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
return X(async () => {
|
|
205
|
+
await j(async () => {
|
|
206
|
+
await u.read("GAME"), await w.readPremium();
|
|
207
|
+
});
|
|
208
|
+
}), (e, t) => {
|
|
209
|
+
const s = m("FmPill"), i = m("FmPageHead"), F = m("FmSearch"), p = m("FmTable"), x = m("FmButton"), z = m("FmListItem"), W = m("FmList"), Y = m("FmCard");
|
|
210
|
+
return f(), P(R, null, [
|
|
211
|
+
r(i, {
|
|
212
|
+
actions: o(C).length > 0 && o(w).isPremium ? [I] : [],
|
|
213
|
+
"onClick:action": t[0] || (t[0] = () => v())
|
|
214
|
+
}, {
|
|
215
|
+
title: b(() => [
|
|
216
|
+
n("div", he, [
|
|
217
|
+
n("span", we, g(o(d)("connect.program.game.title")), 1),
|
|
218
|
+
r(s, { variant: "premium" })
|
|
219
|
+
])
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
}, 8, ["actions"]),
|
|
223
|
+
n("div", Ce, [
|
|
224
|
+
r(F, {
|
|
225
|
+
modelValue: o(c).searchKey,
|
|
226
|
+
"onUpdate:modelValue": t[1] || (t[1] = (a) => o(c).searchKey = a),
|
|
227
|
+
class: "hidden xs:!block sm:!block border-b-2 border-fm-color-neutral-gray-100",
|
|
228
|
+
placeholder: "search",
|
|
229
|
+
collapsible: ""
|
|
230
|
+
}, null, 8, ["modelValue"]),
|
|
231
|
+
o(u).campaigns.token && o(u).campaigns.token.length > 0 ? (f(), P(R, { key: 0 }, [
|
|
232
|
+
n("div", ve, [
|
|
233
|
+
n("div", xe, [
|
|
234
|
+
r(de, {
|
|
235
|
+
label: `${o(d)("connect.common.location")}: `,
|
|
236
|
+
"right-icon": "keyboard_arrow_down",
|
|
237
|
+
modelValue: o(c).location,
|
|
238
|
+
"onUpdate:modelValue": t[2] || (t[2] = (a) => o(c).location = a),
|
|
239
|
+
icon: "storefront",
|
|
240
|
+
"show-item-label": !0,
|
|
241
|
+
items: o(w).locationOptions
|
|
242
|
+
}, null, 8, ["label", "modelValue", "items"])
|
|
243
|
+
]),
|
|
244
|
+
r(F, {
|
|
245
|
+
modelValue: o(c).searchKey,
|
|
246
|
+
"onUpdate:modelValue": t[3] || (t[3] = (a) => o(c).searchKey = a),
|
|
247
|
+
class: "xs:hidden sm:hidden",
|
|
248
|
+
placeholder: "search",
|
|
249
|
+
collapsible: ""
|
|
250
|
+
}, null, 8, ["modelValue"])
|
|
251
|
+
]),
|
|
252
|
+
r(p, {
|
|
253
|
+
class: "xs:hidden sm:hidden",
|
|
254
|
+
"row-data": o(C),
|
|
255
|
+
"column-defs": O,
|
|
256
|
+
"search-value": o(c).searchKey,
|
|
257
|
+
"column-filter": [],
|
|
258
|
+
onRowClick: t[4] || (t[4] = (a) => v(a.original)),
|
|
259
|
+
"hide-footer": o(C).length < 10
|
|
260
|
+
}, null, 8, ["row-data", "search-value", "hide-footer"]),
|
|
261
|
+
r(W, { class: "hidden xs:!flex sm:!flex flex-col mx-[-24px]" }, {
|
|
262
|
+
default: b(() => [
|
|
263
|
+
(f(!0), P(R, null, Z(o(C).filter(
|
|
264
|
+
(a) => a.name.toLowerCase().includes(o(c).searchKey.toLowerCase())
|
|
265
|
+
), (a) => (f(), V(z, {
|
|
266
|
+
key: a._id.toString(),
|
|
267
|
+
onClick: (S) => v(a),
|
|
268
|
+
class: "py-12 px-16 flex items-center justify-between border-b border-fm-color-neutral-gray-100"
|
|
269
|
+
}, {
|
|
270
|
+
default: b(() => {
|
|
271
|
+
var S;
|
|
272
|
+
return [
|
|
273
|
+
n("div", be, [
|
|
274
|
+
n("div", ke, [
|
|
275
|
+
(f(), V(ee(o(T)(a))))
|
|
276
|
+
]),
|
|
277
|
+
n("div", Fe, [
|
|
278
|
+
n("div", Se, g(a.name), 1),
|
|
279
|
+
n("div", Ae, g(o(U)(a)), 1)
|
|
280
|
+
]),
|
|
281
|
+
n("div", Pe, g(o(d)("connect.program.game.token_received", {
|
|
282
|
+
count: ((S = a.pf_collectible) == null ? void 0 : S.currentReceive) ?? 0
|
|
283
|
+
})), 1)
|
|
284
|
+
]),
|
|
285
|
+
n("div", Re, [
|
|
286
|
+
r(x, {
|
|
287
|
+
icon: "insights",
|
|
288
|
+
"icon-color": "neutral-gray-400",
|
|
289
|
+
variant: "tertiary",
|
|
290
|
+
onClick: async (_) => {
|
|
291
|
+
_.stopPropagation(), await G(a);
|
|
292
|
+
}
|
|
293
|
+
}, null, 8, ["onClick"]),
|
|
294
|
+
r(x, {
|
|
295
|
+
icon: "content_copy",
|
|
296
|
+
"icon-color": "neutral-gray-400",
|
|
297
|
+
variant: "tertiary",
|
|
298
|
+
onClick: async (_) => {
|
|
299
|
+
_.stopPropagation(), await $(a);
|
|
300
|
+
}
|
|
301
|
+
}, null, 8, ["onClick"]),
|
|
302
|
+
r(x, {
|
|
303
|
+
icon: "delete",
|
|
304
|
+
"icon-color": "neutral-gray-400",
|
|
305
|
+
variant: "tertiary",
|
|
306
|
+
onClick: (_) => (_.stopPropagation(), M(a))
|
|
307
|
+
}, null, 8, ["onClick"])
|
|
308
|
+
])
|
|
309
|
+
];
|
|
310
|
+
}),
|
|
311
|
+
_: 2
|
|
312
|
+
}, 1032, ["onClick"]))), 128))
|
|
313
|
+
]),
|
|
314
|
+
_: 1
|
|
315
|
+
})
|
|
316
|
+
], 64)) : (f(), V(Y, {
|
|
317
|
+
key: 1,
|
|
318
|
+
variant: "outlined",
|
|
319
|
+
class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
|
|
320
|
+
}, {
|
|
321
|
+
default: b(() => [
|
|
322
|
+
t[6] || (t[6] = n("img", {
|
|
323
|
+
src: te,
|
|
324
|
+
class: "aspect-square w-[150px]"
|
|
325
|
+
}, null, -1)),
|
|
326
|
+
n("div", Ve, [
|
|
327
|
+
n("div", Le, g(o(d)("connect.program.game.empty_state.title")), 1),
|
|
328
|
+
n("div", Be, g(o(d)("connect.program.game.empty_state.description")), 1)
|
|
329
|
+
]),
|
|
330
|
+
r(x, {
|
|
331
|
+
variant: "primary",
|
|
332
|
+
label: "Create game program",
|
|
333
|
+
icon: "add",
|
|
334
|
+
disabled: !o(w).isPremium,
|
|
335
|
+
onClick: t[5] || (t[5] = (a) => v())
|
|
336
|
+
}, null, 8, ["disabled"])
|
|
337
|
+
]),
|
|
338
|
+
_: 1
|
|
339
|
+
})),
|
|
340
|
+
r(ue, {
|
|
341
|
+
ref_key: "sheetRef",
|
|
342
|
+
ref: k,
|
|
343
|
+
"onSubmit:modelValue": H
|
|
344
|
+
}, null, 512),
|
|
345
|
+
r(ge, {
|
|
346
|
+
ref_key: "sendCollectionSheetRef",
|
|
347
|
+
ref: E
|
|
348
|
+
}, null, 512)
|
|
349
|
+
])
|
|
350
|
+
], 64);
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
export {
|
|
355
|
+
Xe as default
|
|
356
|
+
};
|