@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-D1vIDmhJ.js +620 -0
- package/dist/{App-DQUbRsdA.js → App-DHrfWG8l.js} +249 -250
- package/dist/Broadcast-B2rxZAZi.js +216 -0
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D-BFllvG.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D2a9rcXK.js} +20 -20
- package/dist/Card-Dr6pTTM0.js +824 -0
- package/dist/Collections-0tbg0MFt.js +441 -0
- package/dist/Credit-KbB_7Jq-.js +214 -0
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C_ZKNWzb.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-we7ADwFk.js} +999 -1018
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js +344 -0
- package/dist/Experience-C_Q9Iml8.js +211 -0
- package/dist/Game-BwODw7M6.js +250 -0
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +144 -0
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js → MainLayout-DpZC6o3R.js} +53 -19
- package/dist/Marketing-QOKTAS_T.js +309 -0
- package/dist/Member-d7RIGRm1.js +92 -0
- package/dist/MemberList-CK9629ew.js +1737 -0
- package/dist/MemberOverview-C2n9oJZh.js +58 -0
- package/dist/{MemberTransactions-zSxSnUkK.js → MemberTransactions-D-pnlXiP.js} +1 -1
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js +203 -0
- package/dist/Mission-BAKDm4VZ.js +248 -0
- package/dist/Point-Puu0jKz0.js +220 -0
- package/dist/Promotion-DRIaUvJi.js +244 -0
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CTKKhH-r.js → RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js} +557 -557
- package/dist/Segment-DpBxGuuu.js +435 -0
- package/dist/Setting-DLB2ywCp.js +1870 -0
- package/dist/Store-8DO6ITWc.js +1513 -0
- package/dist/StoreRewards-DZfqUeYR.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-2Jqj_rKv.js → StoreTransactions.vue_vue_type_script_setup_true_lang-RTfozD01.js} +10 -10
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-BkdSj0cX.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js} +1 -1
- package/dist/{Tier-Cpl0FV8L.js → Tier-BnQRujpX.js} +453 -481
- package/dist/{Title-CbMDd1Et.js → Title-BPf1tUFx.js} +295 -314
- package/dist/Transaction-ese0oNrz.js +36 -0
- package/dist/Voucher--gtOZQx1.js +485 -0
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/app-Bt59niI-.js +2974 -0
- package/dist/{app-VxaUCtgl.js → app-DHE61XdR.js} +1 -1
- package/dist/app.js +3 -5
- package/dist/{business-DR7jpnLz.js → business-BSo7EPan.js} +1 -1
- package/dist/{campaign-MqcTb329.js → campaign-CsOje3Ap.js} +3 -5
- package/dist/{collection.fn-CvEoe61K.js → collection.fn-BYQfFJOr.js} +2 -2
- package/dist/dto-CfEXSCq6.js +1145 -0
- package/dist/{effect-BjjQeiQg.js → effect-Bn_ofYS3.js} +9 -9
- package/dist/{export-B8cvWh5n.js → export-CMR243CF.js} +3 -3
- package/dist/{helper-DfgVNY7B.js → helper-BqOQRtvW.js} +1 -1
- package/dist/index-BLDYTxnc.js +28058 -0
- package/dist/{index-C2JNcGc-.js → index-BWnFs-Cb.js} +281 -299
- package/dist/{index-B5NufbUt.js → index-BaBNmzUb.js} +1 -1
- package/dist/{index-CWR3qYjb.js → index-Boo5np6l.js} +1 -1
- package/dist/{index-BsfWRB8R.js → index-CC1GV8OW.js} +1 -1
- package/dist/{index-0UYoh1-7.js → index-CHO4_zsT.js} +1 -1
- package/dist/{index-2P9w5u3m.js → index-DEZsrQ2f.js} +3 -3
- package/dist/{index-C7zMfUgy.js → index-D_f2lmK2.js} +1 -1
- package/dist/{index-Dap5R3vr.js → index-Da142OER.js} +66 -78
- package/dist/index-DbP04yeg.js +11 -0
- package/dist/{index-DBy30v8N.js → index-DtPe-TEm.js} +3 -3
- package/dist/{index-CJ8Uh2Ja.js → index-FvlaxwGB.js} +3 -3
- package/dist/{index.esm2017-D1X3PgpO.js → index.esm2017-ePm--Atp.js} +55 -55
- package/dist/{loading-CJ3nOovJ.js → loading-KNmEMBUB.js} +460 -469
- package/dist/{membership-B1cmSRyk.js → membership-DKoVIS1a.js} +3 -3
- package/dist/money-CkD3zl5C.js +15 -0
- package/dist/number-BDsGpOXm.js +12 -0
- package/dist/{rule-ChWyR-0j.js → rule-CzamI50_.js} +2 -2
- package/dist/{rule-builder-CSmOONdb.js → rule-builder-DHf6wfaQ.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-Cug7aRK0.js → template-CFAIPoD7.js} +63 -63
- package/dist/{usePagination-BeF5K3M7.js → usePagination-JoYaROkV.js} +85 -85
- package/dist/{xlsx-CfgPFFvp.js → xlsx-BDJMaozs.js} +517 -517
- package/package.json +4 -7
- package/dist/Analytic-CMXUjK_F.js +0 -622
- package/dist/Broadcast-DowFtHv6.js +0 -223
- package/dist/Card-C7rhL0pV.js +0 -825
- package/dist/Collections-B-1wlk3r.js +0 -453
- package/dist/Credit-DDjozmoF.js +0 -220
- package/dist/EffectSheet.vue_vue_type_style_index_0_lang-pwMuIgs5.js +0 -345
- package/dist/Experience-BbE-c1Op.js +0 -221
- package/dist/Game-DQdRpaN-.js +0 -255
- package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +0 -144
- package/dist/MainLayout-B1aJoR95.js +0 -41
- package/dist/Marketing-Dgmxzg4h.js +0 -316
- package/dist/Member-w23oRVwN.js +0 -69
- package/dist/MemberList-BLIdjznQ.js +0 -1735
- package/dist/MemberOverview-wL_ailso.js +0 -58
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Dy_lMdZA.js +0 -432
- package/dist/Mission-Cjt0E083.js +0 -261
- package/dist/Point-CQJL3Ewu.js +0 -222
- package/dist/Promotion-BYViH3bu.js +0 -247
- package/dist/Segment-B9Jj1ak0.js +0 -437
- package/dist/Setting-DXWbgRxs.js +0 -1901
- package/dist/Store-Dswk2e_z.js +0 -1511
- package/dist/StoreRewards-CNUhG_Ue.js +0 -401
- package/dist/Transaction-BB-kk-84.js +0 -39
- package/dist/Voucher-b1_Jlm6X.js +0 -490
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-pG-SrXp9.js +0 -56
- package/dist/app-DCHKJoql.js +0 -5639
- package/dist/dto-jcK3TGB7.js +0 -2770
- package/dist/index-Cv7pLAYq.js +0 -3
- package/dist/index-LrSSauN2.js +0 -29193
- package/dist/money-BEATdGS6.js +0 -15
- package/dist/number-CeAYAKCp.js +0 -12
- package/dist/vue-i18n-BRhKDHdF.js +0 -2365
- package/dist/zod-Bg2FbC-D.js +0 -90
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./
|
|
5
|
-
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-
|
|
9
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
3
|
+
import { z } from "./app-Bt59niI-.js";
|
|
4
|
+
import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-CfEXSCq6.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-DKoVIS1a.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-BSo7EPan.js";
|
|
8
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-D_f2lmK2.js";
|
|
9
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DHf6wfaQ.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
12
|
-
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-
|
|
13
|
-
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
15
|
-
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-
|
|
18
|
-
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { c as
|
|
22
|
-
import
|
|
23
|
-
import "./index-
|
|
24
|
-
import "./index-
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-B5NufbUt.js";
|
|
12
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-Da142OER.js";
|
|
13
|
+
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
14
|
+
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-VBNyvZCJ.js";
|
|
15
|
+
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BGI78ycg.js";
|
|
16
|
+
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-DTdfYGya.js";
|
|
17
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-KNmEMBUB.js";
|
|
18
|
+
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-BWnFs-Cb.js";
|
|
19
|
+
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-3VS7JnK6.js";
|
|
20
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CzamI50_.js";
|
|
21
|
+
import { c as core, S as SvcConfig } from "./index-BLDYTxnc.js";
|
|
22
|
+
import "./index-FvlaxwGB.js";
|
|
23
|
+
import "./index-DtPe-TEm.js";
|
|
24
|
+
import "./index-DEZsrQ2f.js";
|
|
25
|
+
import "./index-BaBNmzUb.js";
|
|
27
26
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { C as CollectionUtils } from "./collection.fn-CvEoe61K.js";
|
|
27
|
+
import { i as initCollectibleConfig } from "./helper-BqOQRtvW.js";
|
|
28
|
+
import { C as CollectionUtils } from "./collection.fn-BYQfFJOr.js";
|
|
31
29
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
32
30
|
import { useDialog } from "@feedmepos/ui-library";
|
|
33
|
-
import { u as useCampaignStore } from "./campaign-
|
|
31
|
+
import { u as useCampaignStore } from "./campaign-CsOje3Ap.js";
|
|
34
32
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
35
33
|
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
36
34
|
__name: "SegmentConfigurator",
|
|
@@ -41,27 +39,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
41
39
|
}
|
|
42
40
|
},
|
|
43
41
|
emits: ["update:model-value"],
|
|
44
|
-
setup(e, { emit:
|
|
45
|
-
const
|
|
46
|
-
var
|
|
47
|
-
const [
|
|
48
|
-
return (
|
|
49
|
-
}),
|
|
50
|
-
return (
|
|
42
|
+
setup(e, { emit: i }) {
|
|
43
|
+
const n = e, r = computed(() => {
|
|
44
|
+
var t;
|
|
45
|
+
const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
|
|
46
|
+
return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
47
|
+
}), o = i;
|
|
48
|
+
return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
|
|
51
49
|
multiselect: !0,
|
|
52
50
|
items: unref(useMembershipStore)().segmentOptions,
|
|
53
|
-
"model-value": unref(
|
|
54
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
51
|
+
"model-value": unref(r),
|
|
52
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => o(
|
|
55
53
|
"update:model-value",
|
|
56
54
|
unref(RuleBuilder).setRuleToGroup(
|
|
57
55
|
unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
58
|
-
unref(RuleBuilder).constructEntry("user.segment", "_hasAny",
|
|
56
|
+
unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
|
|
59
57
|
)
|
|
60
58
|
)),
|
|
61
59
|
label: "Select segment(s) to match"
|
|
62
60
|
}, null, 8, ["items", "model-value"]));
|
|
63
61
|
}
|
|
64
|
-
}), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$
|
|
62
|
+
}), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
65
63
|
__name: "UserRuleGroup",
|
|
66
64
|
props: {
|
|
67
65
|
modelValue: {
|
|
@@ -71,78 +69,75 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
71
69
|
}
|
|
72
70
|
},
|
|
73
71
|
emits: ["update:model-value"],
|
|
74
|
-
setup(e, { emit:
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
),
|
|
72
|
+
setup(e, { emit: i }) {
|
|
73
|
+
const n = e, r = i, o = ref(
|
|
74
|
+
n.modelValue ? RuleBuilder.getRules(n.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(n.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
75
|
+
), s = [
|
|
78
76
|
{
|
|
79
77
|
value: "all_users",
|
|
80
|
-
label:
|
|
78
|
+
label: "All audience"
|
|
81
79
|
},
|
|
82
80
|
{
|
|
83
81
|
value: "segment",
|
|
84
|
-
label:
|
|
82
|
+
label: "Member segment"
|
|
85
83
|
},
|
|
86
84
|
{
|
|
87
85
|
value: "custom",
|
|
88
|
-
label:
|
|
86
|
+
label: "Custom audience"
|
|
89
87
|
}
|
|
90
88
|
];
|
|
91
|
-
return watch(
|
|
92
|
-
var
|
|
93
|
-
if (
|
|
94
|
-
(
|
|
89
|
+
return watch(o, async (l, t) => {
|
|
90
|
+
var a;
|
|
91
|
+
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
92
|
+
(a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
95
93
|
).length > 0) {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
s("connect.common.confirm"),
|
|
99
|
-
s("connect.common.confirm"),
|
|
100
|
-
s("connect.common.cancel")
|
|
94
|
+
const c = await prompt.confirm(
|
|
95
|
+
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
101
96
|
);
|
|
102
|
-
|
|
97
|
+
c && r(
|
|
103
98
|
"update:model-value",
|
|
104
99
|
RuleBuilder.setRuleToGroup(
|
|
105
|
-
|
|
106
|
-
RuleBuilder.scaffoldGroup(
|
|
100
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
101
|
+
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
107
102
|
)
|
|
108
|
-
),
|
|
103
|
+
), o.value = c ? l : t;
|
|
109
104
|
}
|
|
110
|
-
}), (
|
|
111
|
-
var
|
|
112
|
-
const
|
|
105
|
+
}), (l, t) => {
|
|
106
|
+
var c, v;
|
|
107
|
+
const a = resolveComponent("FmRadio");
|
|
113
108
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
114
109
|
createElementVNode("div", null, [
|
|
115
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
116
|
-
key:
|
|
117
|
-
value:
|
|
118
|
-
label:
|
|
119
|
-
modelValue: unref(
|
|
120
|
-
"onUpdate:modelValue":
|
|
110
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(a, {
|
|
111
|
+
key: m.value,
|
|
112
|
+
value: m.value,
|
|
113
|
+
label: m.label,
|
|
114
|
+
modelValue: unref(o),
|
|
115
|
+
"onUpdate:modelValue": t[0] || (t[0] = (g) => isRef(o) ? o.value = g : null)
|
|
121
116
|
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
122
117
|
]),
|
|
123
|
-
unref(
|
|
118
|
+
unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
124
119
|
createVNode(_sfc_main$p, {
|
|
125
|
-
modelValue: ((
|
|
126
|
-
"onUpdate:modelValue":
|
|
120
|
+
modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
121
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
127
122
|
"update:model-value",
|
|
128
123
|
unref(RuleBuilder).setRuleToGroup(
|
|
129
124
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
130
|
-
|
|
125
|
+
m,
|
|
131
126
|
"&&"
|
|
132
127
|
)
|
|
133
128
|
))
|
|
134
129
|
}, null, 8, ["modelValue"])
|
|
135
130
|
])) : createCommentVNode("", !0),
|
|
136
|
-
unref(
|
|
131
|
+
unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
137
132
|
key: 1,
|
|
138
133
|
"include-only": "user",
|
|
139
134
|
"trigger-type": "MEMBERSHIP_JOINED",
|
|
140
|
-
"model-value": ((
|
|
141
|
-
"onUpdate:modelValue":
|
|
135
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
|
|
136
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
142
137
|
"update:model-value",
|
|
143
138
|
unref(RuleBuilder).setRuleToGroup(
|
|
144
139
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
145
|
-
|
|
140
|
+
m,
|
|
146
141
|
"&&"
|
|
147
142
|
)
|
|
148
143
|
))
|
|
@@ -160,83 +155,77 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
160
155
|
}
|
|
161
156
|
},
|
|
162
157
|
emits: ["update:model-value"],
|
|
163
|
-
setup(e, { emit:
|
|
164
|
-
const
|
|
165
|
-
!
|
|
158
|
+
setup(e, { emit: i }) {
|
|
159
|
+
const n = e, r = i, o = ref(
|
|
160
|
+
!n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
166
161
|
);
|
|
167
|
-
watch(
|
|
168
|
-
var
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
s("connect.common.confirm"),
|
|
173
|
-
s("connect.common.confirm"),
|
|
174
|
-
s("connect.common.cancel")
|
|
162
|
+
watch(o, async (l, t) => {
|
|
163
|
+
var a;
|
|
164
|
+
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
165
|
+
const c = await prompt.confirm(
|
|
166
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
175
167
|
);
|
|
176
|
-
|
|
168
|
+
c && r(
|
|
177
169
|
"update:model-value",
|
|
178
170
|
RuleBuilder.setRuleToGroup(
|
|
179
|
-
|
|
171
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
180
172
|
RuleBuilder.scaffoldGroup("g_time")
|
|
181
173
|
)
|
|
182
|
-
),
|
|
174
|
+
), o.value = c ? l : t;
|
|
183
175
|
}
|
|
184
176
|
});
|
|
185
|
-
async function l
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
177
|
+
async function s(l) {
|
|
178
|
+
var t;
|
|
179
|
+
if (l == "custom" && RuleBuilder.getRules((t = n.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
|
|
188
180
|
if (!await prompt.confirm(
|
|
189
|
-
|
|
190
|
-
s("connect.common.confirm"),
|
|
191
|
-
s("connect.common.confirm"),
|
|
192
|
-
s("connect.common.cancel")
|
|
181
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
193
182
|
)) {
|
|
194
|
-
|
|
183
|
+
o.value = "all_time";
|
|
195
184
|
return;
|
|
196
185
|
}
|
|
197
|
-
|
|
186
|
+
r(
|
|
198
187
|
"update:model-value",
|
|
199
188
|
RuleBuilder.setRuleToGroup(
|
|
200
|
-
|
|
189
|
+
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
201
190
|
RuleBuilder.scaffoldGroup("g_time")
|
|
202
191
|
)
|
|
203
192
|
);
|
|
204
193
|
}
|
|
205
194
|
}
|
|
206
|
-
return (
|
|
207
|
-
var
|
|
208
|
-
const
|
|
195
|
+
return (l, t) => {
|
|
196
|
+
var v;
|
|
197
|
+
const a = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
|
|
209
198
|
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
210
|
-
createVNode(
|
|
211
|
-
modelValue: unref(
|
|
199
|
+
createVNode(c, {
|
|
200
|
+
modelValue: unref(o),
|
|
212
201
|
"onUpdate:modelValue": [
|
|
213
|
-
|
|
214
|
-
|
|
202
|
+
t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
|
|
203
|
+
t[1] || (t[1] = (m) => s(m))
|
|
215
204
|
]
|
|
216
205
|
}, {
|
|
217
206
|
default: withCtx(() => [
|
|
218
|
-
createVNode(
|
|
219
|
-
label:
|
|
207
|
+
createVNode(a, {
|
|
208
|
+
label: "All time",
|
|
220
209
|
value: "all_time"
|
|
221
|
-
}
|
|
222
|
-
createVNode(
|
|
223
|
-
label:
|
|
210
|
+
}),
|
|
211
|
+
createVNode(a, {
|
|
212
|
+
label: "Custom date/time",
|
|
224
213
|
value: "custom"
|
|
225
|
-
}
|
|
214
|
+
})
|
|
226
215
|
]),
|
|
227
216
|
_: 1
|
|
228
217
|
}, 8, ["modelValue"]),
|
|
229
|
-
unref(
|
|
218
|
+
unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
230
219
|
key: 0,
|
|
231
220
|
class: "!mt-[0px]",
|
|
232
221
|
"include-only": "trigger",
|
|
233
222
|
"trigger-type": "SCHEDULE",
|
|
234
|
-
"model-value": ((
|
|
235
|
-
"onUpdate:modelValue":
|
|
223
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
224
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
236
225
|
"update:model-value",
|
|
237
226
|
unref(RuleBuilder).setRuleToGroup(
|
|
238
227
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
239
|
-
|
|
228
|
+
m,
|
|
240
229
|
"&&"
|
|
241
230
|
)
|
|
242
231
|
))
|
|
@@ -254,15 +243,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
254
243
|
}
|
|
255
244
|
},
|
|
256
245
|
emits: ["update:model-value"],
|
|
257
|
-
setup(e, { emit:
|
|
258
|
-
const
|
|
259
|
-
return (
|
|
260
|
-
var
|
|
246
|
+
setup(e, { emit: i }) {
|
|
247
|
+
const n = i;
|
|
248
|
+
return (r, o) => {
|
|
249
|
+
var s;
|
|
261
250
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
262
251
|
"include-only": "bill",
|
|
263
252
|
"trigger-type": "BILL_COMPLETED",
|
|
264
|
-
"model-value": ((
|
|
265
|
-
"onUpdate:modelValue":
|
|
253
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
|
|
254
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n(
|
|
266
255
|
"update:model-value",
|
|
267
256
|
unref(RuleBuilder).setRuleToGroup(
|
|
268
257
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -281,29 +270,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
281
270
|
}
|
|
282
271
|
},
|
|
283
272
|
emits: ["update:model-value"],
|
|
284
|
-
setup(e, { emit:
|
|
285
|
-
const
|
|
286
|
-
const { property:
|
|
287
|
-
|
|
273
|
+
setup(e, { emit: i }) {
|
|
274
|
+
const n = e, r = i, o = computed(() => {
|
|
275
|
+
const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
|
|
276
|
+
n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
288
277
|
op: "before",
|
|
289
278
|
x: 1
|
|
290
279
|
})
|
|
291
280
|
);
|
|
292
281
|
return {
|
|
293
|
-
property:
|
|
282
|
+
property: s,
|
|
294
283
|
operator: l,
|
|
295
|
-
equator:
|
|
284
|
+
equator: t
|
|
296
285
|
};
|
|
297
286
|
});
|
|
298
|
-
return (
|
|
299
|
-
const
|
|
287
|
+
return (s, l) => {
|
|
288
|
+
const t = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
|
|
300
289
|
return openBlock(), createElementBlock("div", null, [
|
|
301
|
-
createVNode(
|
|
290
|
+
createVNode(t, {
|
|
302
291
|
label: "On birthday",
|
|
303
292
|
value: "_isRange-day",
|
|
304
|
-
"model-value": `${unref(
|
|
293
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
305
294
|
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
306
|
-
|
|
295
|
+
r(
|
|
307
296
|
"update:model-value",
|
|
308
297
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
309
298
|
op: "this",
|
|
@@ -313,12 +302,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
313
302
|
);
|
|
314
303
|
})
|
|
315
304
|
}, null, 8, ["model-value"]),
|
|
316
|
-
createVNode(
|
|
305
|
+
createVNode(t, {
|
|
317
306
|
label: "N days before birthday",
|
|
318
307
|
value: "_isDay",
|
|
319
|
-
"model-value": unref(
|
|
308
|
+
"model-value": unref(o).operator,
|
|
320
309
|
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
321
|
-
|
|
310
|
+
r(
|
|
322
311
|
"update:model-value",
|
|
323
312
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
313
|
op: "after",
|
|
@@ -328,26 +317,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
328
317
|
);
|
|
329
318
|
})
|
|
330
319
|
}, null, 8, ["model-value"]),
|
|
331
|
-
unref(
|
|
320
|
+
unref(o).operator == "_isDay" ? (openBlock(), createBlock(a, {
|
|
332
321
|
key: 0,
|
|
333
322
|
label: "Days before birthday",
|
|
334
323
|
"show-steppers": !1,
|
|
335
|
-
"model-value": unref(
|
|
336
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
324
|
+
"model-value": unref(o).equator.x,
|
|
325
|
+
"onUpdate:modelValue": l[2] || (l[2] = (c) => r(
|
|
337
326
|
"update:model-value",
|
|
338
327
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
339
328
|
op: "after",
|
|
340
|
-
x:
|
|
329
|
+
x: c,
|
|
341
330
|
ignoreYear: !0
|
|
342
331
|
})
|
|
343
332
|
))
|
|
344
333
|
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
345
|
-
createVNode(
|
|
334
|
+
createVNode(t, {
|
|
346
335
|
label: "In birthday week",
|
|
347
336
|
value: "_isRange-week",
|
|
348
|
-
"model-value": `${unref(
|
|
337
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
349
338
|
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
350
|
-
|
|
339
|
+
r(
|
|
351
340
|
"update:model-value",
|
|
352
341
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
353
342
|
op: "this",
|
|
@@ -357,12 +346,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
357
346
|
);
|
|
358
347
|
})
|
|
359
348
|
}, null, 8, ["model-value"]),
|
|
360
|
-
createVNode(
|
|
349
|
+
createVNode(t, {
|
|
361
350
|
label: "In birthday month",
|
|
362
351
|
value: "_isRange-month",
|
|
363
|
-
"model-value": `${unref(
|
|
352
|
+
"model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
|
|
364
353
|
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
365
|
-
|
|
354
|
+
r(
|
|
366
355
|
"update:model-value",
|
|
367
356
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
368
357
|
op: "this",
|
|
@@ -385,15 +374,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
385
374
|
}
|
|
386
375
|
},
|
|
387
376
|
emits: ["update:model-value"],
|
|
388
|
-
setup(e, { emit:
|
|
389
|
-
const
|
|
390
|
-
return (
|
|
391
|
-
var
|
|
377
|
+
setup(e, { emit: i }) {
|
|
378
|
+
const n = i;
|
|
379
|
+
return (r, o) => {
|
|
380
|
+
var s;
|
|
392
381
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
393
382
|
"include-only": "feedback",
|
|
394
383
|
"trigger-type": "FEEDBACK",
|
|
395
|
-
"model-value": ((
|
|
396
|
-
"onUpdate:modelValue":
|
|
384
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
|
|
385
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n(
|
|
397
386
|
"update:model-value",
|
|
398
387
|
unref(RuleBuilder).setRuleToGroup(
|
|
399
388
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -472,13 +461,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
472
461
|
"GAME",
|
|
473
462
|
"MISSION"
|
|
474
463
|
].map((e) => {
|
|
475
|
-
const
|
|
464
|
+
const i = CAMPAIGN_TRIGGER[e];
|
|
476
465
|
return [
|
|
477
466
|
e,
|
|
478
|
-
(
|
|
467
|
+
(i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
|
|
479
468
|
];
|
|
480
469
|
})
|
|
481
|
-
), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$
|
|
470
|
+
), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
482
471
|
__name: "CampaignTriggerInput",
|
|
483
472
|
props: {
|
|
484
473
|
campaignType: {
|
|
@@ -494,31 +483,31 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
494
483
|
}
|
|
495
484
|
},
|
|
496
485
|
emits: ["update:model-value"],
|
|
497
|
-
setup(e, { emit:
|
|
498
|
-
const
|
|
499
|
-
(
|
|
500
|
-
) : TypeToTriggerOptions[
|
|
501
|
-
return (
|
|
502
|
-
const
|
|
486
|
+
setup(e, { emit: i }) {
|
|
487
|
+
const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
|
|
488
|
+
(s) => s.value == n.modelValue
|
|
489
|
+
) : TypeToTriggerOptions[n.campaignType]);
|
|
490
|
+
return (s, l) => {
|
|
491
|
+
const t = resolveComponent("FmCard");
|
|
503
492
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
504
|
-
|
|
505
|
-
createElementVNode("div",
|
|
506
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
493
|
+
_hoisted_2$g,
|
|
494
|
+
createElementVNode("div", _hoisted_3$e, [
|
|
495
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
507
496
|
variant: "outlined",
|
|
508
|
-
disabled:
|
|
497
|
+
disabled: n.disabled,
|
|
509
498
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
510
|
-
"col-span-3": unref(
|
|
511
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
512
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
499
|
+
"col-span-3": unref(o).length == 1,
|
|
500
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
501
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
513
502
|
}]),
|
|
514
503
|
onClick: () => {
|
|
515
|
-
|
|
504
|
+
n.modelValue != a.value && !n.disabled && r("update:model-value", a.value);
|
|
516
505
|
},
|
|
517
|
-
key:
|
|
506
|
+
key: a.name
|
|
518
507
|
}, {
|
|
519
508
|
default: withCtx(() => [
|
|
520
|
-
createElementVNode("div",
|
|
521
|
-
createElementVNode("div",
|
|
509
|
+
createElementVNode("div", _hoisted_4$d, toDisplayString(a.name), 1),
|
|
510
|
+
createElementVNode("div", _hoisted_5$8, toDisplayString(a.description), 1)
|
|
522
511
|
]),
|
|
523
512
|
_: 2
|
|
524
513
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -539,27 +528,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
539
528
|
}
|
|
540
529
|
},
|
|
541
530
|
emits: ["update:model-value"],
|
|
542
|
-
setup(e, { emit:
|
|
543
|
-
const
|
|
544
|
-
return (
|
|
545
|
-
const
|
|
546
|
-
return openBlock(), createBlock(
|
|
531
|
+
setup(e, { emit: i }) {
|
|
532
|
+
const n = i;
|
|
533
|
+
return (r, o) => {
|
|
534
|
+
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
|
|
535
|
+
return openBlock(), createBlock(t, {
|
|
547
536
|
label: e.label,
|
|
548
537
|
"model-value": e.modelValue || "",
|
|
549
|
-
"onUpdate:modelValue":
|
|
538
|
+
"onUpdate:modelValue": o[1] || (o[1] = (a) => n("update:model-value", a))
|
|
550
539
|
}, {
|
|
551
|
-
"trigger-button": withCtx(({ opened:
|
|
540
|
+
"trigger-button": withCtx(({ opened: a }) => [
|
|
552
541
|
createVNode(l, {
|
|
553
542
|
class: "flex items-center",
|
|
554
543
|
"prepend-icon": "calendar_month",
|
|
555
|
-
"icon-outlined": !
|
|
544
|
+
"icon-outlined": !a
|
|
556
545
|
}, {
|
|
557
546
|
append: withCtx(() => [
|
|
558
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
547
|
+
e.modelValue ? (openBlock(), createBlock(s, {
|
|
559
548
|
key: 0,
|
|
560
549
|
variant: "tertiary",
|
|
561
550
|
icon: "clear",
|
|
562
|
-
onClick:
|
|
551
|
+
onClick: o[0] || (o[0] = (c) => (c.stopPropagation(), n("update:model-value", null)))
|
|
563
552
|
})) : createCommentVNode("", !0)
|
|
564
553
|
]),
|
|
565
554
|
default: withCtx(() => [
|
|
@@ -574,7 +563,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
574
563
|
}, 8, ["label", "model-value"]);
|
|
575
564
|
};
|
|
576
565
|
}
|
|
577
|
-
}), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$
|
|
566
|
+
}), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
578
567
|
__name: "DateRangeInput",
|
|
579
568
|
props: {
|
|
580
569
|
modelValue: {
|
|
@@ -583,34 +572,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
583
572
|
}
|
|
584
573
|
},
|
|
585
574
|
emits: ["update:model-value"],
|
|
586
|
-
setup(e, { emit:
|
|
587
|
-
const
|
|
588
|
-
return (
|
|
589
|
-
var
|
|
575
|
+
setup(e, { emit: i }) {
|
|
576
|
+
const n = i;
|
|
577
|
+
return (r, o) => {
|
|
578
|
+
var s, l;
|
|
590
579
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
591
|
-
createElementVNode("div", _hoisted_2$
|
|
580
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
592
581
|
createVNode(_sfc_main$i, {
|
|
593
|
-
"model-value": ((
|
|
582
|
+
"model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
|
|
594
583
|
label: "Start date",
|
|
595
|
-
"onUpdate:modelValue":
|
|
596
|
-
var
|
|
597
|
-
return
|
|
598
|
-
startDate:
|
|
599
|
-
endDate: ((
|
|
584
|
+
"onUpdate:modelValue": o[0] || (o[0] = (t) => {
|
|
585
|
+
var a;
|
|
586
|
+
return n("update:model-value", {
|
|
587
|
+
startDate: t,
|
|
588
|
+
endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
|
|
600
589
|
});
|
|
601
590
|
})
|
|
602
591
|
}, null, 8, ["model-value"])
|
|
603
592
|
]),
|
|
604
|
-
|
|
605
|
-
createElementVNode("div",
|
|
593
|
+
_hoisted_3$d,
|
|
594
|
+
createElementVNode("div", _hoisted_4$c, [
|
|
606
595
|
createVNode(_sfc_main$i, {
|
|
607
596
|
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
608
597
|
label: "End date",
|
|
609
|
-
"onUpdate:modelValue":
|
|
610
|
-
var
|
|
611
|
-
return
|
|
612
|
-
startDate: ((
|
|
613
|
-
endDate:
|
|
598
|
+
"onUpdate:modelValue": o[1] || (o[1] = (t) => {
|
|
599
|
+
var a;
|
|
600
|
+
return n("update:model-value", {
|
|
601
|
+
startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
|
|
602
|
+
endDate: t
|
|
614
603
|
});
|
|
615
604
|
})
|
|
616
605
|
}, null, 8, ["model-value"])
|
|
@@ -618,10 +607,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
618
607
|
]);
|
|
619
608
|
};
|
|
620
609
|
}
|
|
621
|
-
}), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$
|
|
610
|
+
}), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
|
|
622
611
|
key: 0,
|
|
623
612
|
class: "space-y-4"
|
|
624
|
-
}, _hoisted_4$
|
|
613
|
+
}, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
625
614
|
__name: "ScheduleRuleInput",
|
|
626
615
|
props: {
|
|
627
616
|
modelValue: {
|
|
@@ -636,34 +625,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
636
625
|
}
|
|
637
626
|
},
|
|
638
627
|
emits: ["update:model-value"],
|
|
639
|
-
setup(e, { emit:
|
|
640
|
-
const
|
|
641
|
-
function
|
|
642
|
-
const
|
|
643
|
-
return
|
|
628
|
+
setup(e, { emit: i }) {
|
|
629
|
+
const n = e, r = i;
|
|
630
|
+
function o() {
|
|
631
|
+
const m = RuleBuilder.getRules(n.modelValue);
|
|
632
|
+
return m.length == 0 ? "fixed" : m.some(
|
|
644
633
|
(g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
|
|
645
634
|
) ? "repeating" : "fixed";
|
|
646
635
|
}
|
|
647
|
-
const
|
|
648
|
-
const
|
|
636
|
+
const s = ref(o()), l = ref(!1), t = computed(() => {
|
|
637
|
+
const m = RuleBuilder.getRules(n.modelValue), g = m.find(
|
|
649
638
|
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
|
|
650
|
-
),
|
|
639
|
+
), p = m.find(
|
|
651
640
|
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
|
|
652
641
|
);
|
|
653
642
|
return {
|
|
654
643
|
date: g ? RuleBuilder.simplify(g).equator : null,
|
|
655
|
-
time:
|
|
644
|
+
time: p ? RuleBuilder.simplify(p).equator : null
|
|
656
645
|
};
|
|
657
|
-
}),
|
|
646
|
+
}), a = computed(
|
|
658
647
|
() => calculateNextScheduleAt(
|
|
659
|
-
|
|
648
|
+
n.modelValue,
|
|
660
649
|
/* @__PURE__ */ new Date(),
|
|
661
|
-
|
|
662
|
-
|
|
650
|
+
n.startDate ? new Date(n.startDate) : void 0,
|
|
651
|
+
n.endDate ? new Date(n.endDate) : void 0
|
|
663
652
|
)
|
|
664
653
|
);
|
|
665
|
-
function
|
|
666
|
-
const g =
|
|
654
|
+
function c(m) {
|
|
655
|
+
const g = m.label.toLowerCase(), p = g == "fixed" ? [
|
|
667
656
|
RuleBuilder.constructEntry(
|
|
668
657
|
"trigger.date",
|
|
669
658
|
"_isOnDate",
|
|
@@ -678,73 +667,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
678
667
|
),
|
|
679
668
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
680
669
|
];
|
|
681
|
-
|
|
670
|
+
r(
|
|
682
671
|
"update:model-value",
|
|
683
672
|
RuleBuilder.setRuleToGroup(
|
|
684
673
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
685
|
-
|
|
674
|
+
p
|
|
686
675
|
)
|
|
687
|
-
),
|
|
676
|
+
), s.value = g;
|
|
688
677
|
}
|
|
689
|
-
function
|
|
690
|
-
|
|
678
|
+
function v(m) {
|
|
679
|
+
s.value == "fixed" ? r(
|
|
691
680
|
"update:model-value",
|
|
692
681
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
693
682
|
RuleBuilder.constructEntry(
|
|
694
683
|
"trigger.date",
|
|
695
684
|
"_isOnDate",
|
|
696
|
-
|
|
685
|
+
m.date
|
|
697
686
|
),
|
|
698
687
|
RuleBuilder.constructEntry(
|
|
699
688
|
"trigger.time",
|
|
700
689
|
"_isOnTime",
|
|
701
|
-
|
|
690
|
+
m.time
|
|
702
691
|
)
|
|
703
692
|
])
|
|
704
|
-
) :
|
|
693
|
+
) : r(
|
|
705
694
|
"update:model-value",
|
|
706
695
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
707
696
|
RuleBuilder.constructEntry(
|
|
708
697
|
"trigger.date",
|
|
709
698
|
"_rrule",
|
|
710
|
-
|
|
699
|
+
m.date
|
|
711
700
|
),
|
|
712
701
|
RuleBuilder.constructEntry(
|
|
713
702
|
"trigger.time",
|
|
714
703
|
"_isOnTime",
|
|
715
|
-
|
|
704
|
+
m.time
|
|
716
705
|
)
|
|
717
706
|
])
|
|
718
707
|
);
|
|
719
708
|
}
|
|
720
|
-
return (
|
|
721
|
-
const
|
|
709
|
+
return (m, g) => {
|
|
710
|
+
const p = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
|
|
722
711
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
723
|
-
createVNode(
|
|
712
|
+
createVNode(p, {
|
|
724
713
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
725
|
-
"model-value": { label: unref(cases).title(unref(
|
|
726
|
-
"onUpdate:modelValue":
|
|
714
|
+
"model-value": { label: unref(cases).title(unref(s)) },
|
|
715
|
+
"onUpdate:modelValue": c,
|
|
727
716
|
class: "mb-8"
|
|
728
717
|
}, null, 8, ["model-value"]),
|
|
729
718
|
createElementVNode("div", _hoisted_1$g, [
|
|
730
|
-
createElementVNode("div", _hoisted_2$
|
|
719
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
731
720
|
createVNode(d, {
|
|
732
721
|
label: "Notify time",
|
|
733
|
-
"model-value": unref(
|
|
734
|
-
"onUpdate:modelValue": g[0] || (g[0] = (
|
|
735
|
-
"helper-text": unref(
|
|
736
|
-
"helper-state": unref(
|
|
722
|
+
"model-value": unref(t).time,
|
|
723
|
+
"onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
|
|
724
|
+
"helper-text": unref(t).time ? void 0 : "Time is required",
|
|
725
|
+
"helper-state": unref(t).time ? void 0 : "error"
|
|
737
726
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
738
|
-
unref(
|
|
739
|
-
createElementVNode("div", _hoisted_4$
|
|
740
|
-
|
|
741
|
-
unref(
|
|
727
|
+
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
728
|
+
createElementVNode("div", _hoisted_4$b, [
|
|
729
|
+
_hoisted_5$7,
|
|
730
|
+
unref(t).date ? (openBlock(), createBlock(f, {
|
|
742
731
|
key: 0,
|
|
743
732
|
"z-index": 9999,
|
|
744
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
733
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
745
734
|
}, {
|
|
746
735
|
default: withCtx(() => [
|
|
747
|
-
createVNode(
|
|
736
|
+
createVNode(u, {
|
|
748
737
|
name: "info",
|
|
749
738
|
size: "sm",
|
|
750
739
|
outline: !0
|
|
@@ -753,30 +742,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
753
742
|
_: 1
|
|
754
743
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
755
744
|
]),
|
|
756
|
-
createVNode(
|
|
745
|
+
createVNode(C, {
|
|
757
746
|
"show-popover": unref(l),
|
|
758
|
-
onPopoverChanged: g[3] || (g[3] = (
|
|
747
|
+
onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
|
|
759
748
|
}, {
|
|
760
749
|
"popover-button": withCtx(() => [
|
|
761
|
-
createVNode(
|
|
750
|
+
createVNode(y, {
|
|
762
751
|
class: "cursor-pointer",
|
|
763
|
-
"helper-text": unref(
|
|
764
|
-
"helper-state": unref(
|
|
752
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
753
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
765
754
|
}, {
|
|
766
755
|
default: withCtx(() => [
|
|
767
|
-
createElementVNode("div",
|
|
756
|
+
createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
|
|
768
757
|
]),
|
|
769
758
|
_: 1
|
|
770
759
|
}, 8, ["helper-text", "helper-state"])
|
|
771
760
|
]),
|
|
772
761
|
default: withCtx(() => [
|
|
773
|
-
createVNode(
|
|
762
|
+
createVNode(k, { class: "elevated p-8 w-[450px]" }, {
|
|
774
763
|
default: withCtx(() => [
|
|
775
764
|
createVNode(_sfc_main$s, {
|
|
776
765
|
"apply-button": !0,
|
|
777
|
-
"model-value": unref(
|
|
778
|
-
onCancel: g[1] || (g[1] = (
|
|
779
|
-
"onUpdate:modelValue": g[2] || (g[2] = (
|
|
766
|
+
"model-value": unref(t).date || "",
|
|
767
|
+
onCancel: g[1] || (g[1] = (E) => l.value = !1),
|
|
768
|
+
"onUpdate:modelValue": g[2] || (g[2] = (E) => (v({ date: E, time: unref(t).time }), l.value = !1))
|
|
780
769
|
}, null, 8, ["model-value"])
|
|
781
770
|
]),
|
|
782
771
|
_: 1
|
|
@@ -784,19 +773,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
784
773
|
]),
|
|
785
774
|
_: 1
|
|
786
775
|
}, 8, ["show-popover"])
|
|
787
|
-
])) : (openBlock(), createBlock(
|
|
776
|
+
])) : (openBlock(), createBlock(b, {
|
|
788
777
|
key: 1,
|
|
789
778
|
label: "Notify date",
|
|
790
|
-
"model-value": unref(
|
|
791
|
-
"onUpdate:modelValue": g[4] || (g[4] = (
|
|
792
|
-
"helper-text": unref(
|
|
793
|
-
"helper-state": unref(
|
|
779
|
+
"model-value": unref(t).date || "",
|
|
780
|
+
"onUpdate:modelValue": g[4] || (g[4] = (E) => v({ date: E, time: unref(t).time })),
|
|
781
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
782
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
794
783
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
795
784
|
]),
|
|
796
|
-
unref(
|
|
785
|
+
unref(t).date && unref(t).time && unref(a) ? (openBlock(), createBlock(x, {
|
|
797
786
|
key: 0,
|
|
798
|
-
text: `${unref(hooks)(unref(
|
|
799
|
-
${unref(hooks)(unref(
|
|
787
|
+
text: `${unref(hooks)(unref(a)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(a)).format("dddd, DD MMM YYYY")} at
|
|
788
|
+
${unref(hooks)(unref(a)).format("hh:mmA")} (${unref(hooks)(unref(a)).fromNow()})`
|
|
800
789
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
801
790
|
])
|
|
802
791
|
], 64);
|
|
@@ -809,18 +798,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
809
798
|
filterItems: { type: Function }
|
|
810
799
|
},
|
|
811
800
|
emits: ["confirm"],
|
|
812
|
-
setup(e, { emit:
|
|
813
|
-
const
|
|
814
|
-
function
|
|
801
|
+
setup(e, { emit: i }) {
|
|
802
|
+
const n = ref(), r = ref(!1);
|
|
803
|
+
function o() {
|
|
815
804
|
var l;
|
|
816
|
-
(l =
|
|
805
|
+
(l = n.value) == null || l.onConfirm();
|
|
817
806
|
}
|
|
818
|
-
const
|
|
819
|
-
return (l,
|
|
820
|
-
const
|
|
821
|
-
return openBlock(), createBlock(
|
|
822
|
-
modelValue:
|
|
823
|
-
"onUpdate:modelValue":
|
|
807
|
+
const s = i;
|
|
808
|
+
return (l, t) => {
|
|
809
|
+
const a = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
|
|
810
|
+
return openBlock(), createBlock(v, {
|
|
811
|
+
modelValue: r.value,
|
|
812
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
|
|
824
813
|
title: "Select Items",
|
|
825
814
|
"close-button": !1,
|
|
826
815
|
"dismiss-away": !0,
|
|
@@ -828,7 +817,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
828
817
|
}, {
|
|
829
818
|
"side-sheet-button": withCtx(() => [
|
|
830
819
|
renderSlot(l.$slots, "side-sheet-button", {}, () => [
|
|
831
|
-
createVNode(
|
|
820
|
+
createVNode(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
|
|
832
821
|
default: withCtx(() => [
|
|
833
822
|
createTextVNode(toDisplayString(l.modelValue.length) + " item(s) selected ", 1)
|
|
834
823
|
]),
|
|
@@ -838,14 +827,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
838
827
|
]),
|
|
839
828
|
"side-sheet-footer": withCtx(() => [
|
|
840
829
|
createElementVNode("div", _hoisted_1$f, [
|
|
841
|
-
createVNode(
|
|
830
|
+
createVNode(c, {
|
|
842
831
|
variant: "tertiary",
|
|
843
|
-
onClick:
|
|
832
|
+
onClick: t[0] || (t[0] = (m) => r.value = !1),
|
|
844
833
|
label: "Cancel"
|
|
845
834
|
}),
|
|
846
|
-
createVNode(
|
|
835
|
+
createVNode(c, {
|
|
847
836
|
variant: "primary",
|
|
848
|
-
onClick:
|
|
837
|
+
onClick: o,
|
|
849
838
|
label: "Confirm"
|
|
850
839
|
})
|
|
851
840
|
])
|
|
@@ -855,11 +844,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
855
844
|
class: "h-full",
|
|
856
845
|
"max-height": 0,
|
|
857
846
|
ref_key: "selectItemRef",
|
|
858
|
-
ref:
|
|
847
|
+
ref: n,
|
|
859
848
|
"initial-value": l.modelValue,
|
|
860
849
|
"filter-items": l.filterItems,
|
|
861
|
-
"on-complete": (
|
|
862
|
-
|
|
850
|
+
"on-complete": (m) => {
|
|
851
|
+
s("confirm", m), r.value = !1;
|
|
863
852
|
}
|
|
864
853
|
}, null, 8, ["initial-value", "filter-items", "on-complete"])
|
|
865
854
|
]),
|
|
@@ -867,13 +856,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
867
856
|
}, 8, ["modelValue"]);
|
|
868
857
|
};
|
|
869
858
|
}
|
|
870
|
-
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$
|
|
859
|
+
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
|
|
871
860
|
key: 0,
|
|
872
861
|
class: "xs:!block flex gap-16 items-center pt-8"
|
|
873
|
-
},
|
|
862
|
+
}, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
|
|
874
863
|
key: 0,
|
|
875
864
|
class: "pt-8 space-y-8"
|
|
876
|
-
},
|
|
865
|
+
}, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
877
866
|
__name: "EarningOptionInput",
|
|
878
867
|
props: {
|
|
879
868
|
modelValue: {
|
|
@@ -890,9 +879,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
890
879
|
}
|
|
891
880
|
},
|
|
892
881
|
emits: ["update:model-value"],
|
|
893
|
-
setup(e, { emit:
|
|
894
|
-
var
|
|
895
|
-
const
|
|
882
|
+
setup(e, { emit: i }) {
|
|
883
|
+
var v, m, g;
|
|
884
|
+
const n = useBusinessStore(), r = e, o = i, s = [
|
|
896
885
|
{
|
|
897
886
|
label: "Based on spending",
|
|
898
887
|
sublabel: "Customers earn rewards based on how much they spend.",
|
|
@@ -903,22 +892,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
903
892
|
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
904
893
|
value: "FIXED"
|
|
905
894
|
}
|
|
906
|
-
].filter((
|
|
907
|
-
var d,
|
|
908
|
-
return
|
|
895
|
+
].filter((p) => {
|
|
896
|
+
var d, u;
|
|
897
|
+
return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? p.value == "FIXED" : !0;
|
|
909
898
|
}), l = computed(() => {
|
|
910
|
-
var d,
|
|
911
|
-
const
|
|
912
|
-
return (((
|
|
913
|
-
}),
|
|
914
|
-
const
|
|
915
|
-
return
|
|
899
|
+
var d, u;
|
|
900
|
+
const p = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
|
|
901
|
+
return (((u = CollectibleOptions[p]) == null ? void 0 : u.name) || "reward").toLowerCase();
|
|
902
|
+
}), t = computed(() => {
|
|
903
|
+
const p = FdoEarningOption.safeParse(r.modelValue);
|
|
904
|
+
return p.success ? [] : p.error.errors;
|
|
916
905
|
});
|
|
917
|
-
function
|
|
906
|
+
function a(p) {
|
|
918
907
|
var d;
|
|
919
|
-
|
|
908
|
+
p != ((d = r.modelValue) == null ? void 0 : d.type) && o(
|
|
920
909
|
"update:model-value",
|
|
921
|
-
|
|
910
|
+
p === "FIXED" ? {
|
|
922
911
|
type: "FIXED",
|
|
923
912
|
amount: 1
|
|
924
913
|
} : {
|
|
@@ -928,95 +917,95 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
928
917
|
}
|
|
929
918
|
);
|
|
930
919
|
}
|
|
931
|
-
const
|
|
932
|
-
((
|
|
920
|
+
const c = ref(
|
|
921
|
+
((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
|
|
933
922
|
);
|
|
934
|
-
return (
|
|
935
|
-
var
|
|
936
|
-
const
|
|
923
|
+
return (p, d) => {
|
|
924
|
+
var E, V, N;
|
|
925
|
+
const u = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
|
|
937
926
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
938
|
-
createElementVNode("div", _hoisted_2$
|
|
939
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
940
|
-
var
|
|
941
|
-
return openBlock(), createBlock(
|
|
927
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
928
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
|
|
929
|
+
var R, B;
|
|
930
|
+
return openBlock(), createBlock(u, {
|
|
942
931
|
variant: "outlined",
|
|
943
932
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
944
|
-
"col-span-2": unref(
|
|
945
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
946
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
933
|
+
"col-span-2": unref(s).length == 1,
|
|
934
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
|
|
935
|
+
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
|
|
947
936
|
}]),
|
|
948
|
-
onClick: (
|
|
949
|
-
key:
|
|
937
|
+
onClick: ($) => a(h.value),
|
|
938
|
+
key: h.value
|
|
950
939
|
}, {
|
|
951
940
|
default: withCtx(() => [
|
|
952
|
-
createElementVNode("div", _hoisted_3$
|
|
953
|
-
createElementVNode("div", _hoisted_4$
|
|
941
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
|
|
942
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
|
|
954
943
|
]),
|
|
955
944
|
_: 2
|
|
956
945
|
}, 1032, ["class", "onClick"]);
|
|
957
946
|
}), 128))
|
|
958
947
|
]),
|
|
959
|
-
createElementVNode("div", _hoisted_5$
|
|
960
|
-
((
|
|
948
|
+
createElementVNode("div", _hoisted_5$6, [
|
|
949
|
+
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(f, {
|
|
961
950
|
key: 0,
|
|
962
951
|
label: `Receive ${unref(l)}(s)`,
|
|
963
952
|
class: "flex-1",
|
|
964
|
-
"model-value": ((
|
|
965
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
953
|
+
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
954
|
+
"onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
|
|
966
955
|
...e.modelValue ?? { type: "FIXED" },
|
|
967
|
-
amount:
|
|
956
|
+
amount: h
|
|
968
957
|
}))
|
|
969
|
-
}, null, 8, ["label", "model-value"])) : ((
|
|
970
|
-
|
|
971
|
-
createVNode(
|
|
972
|
-
"model-value": unref(
|
|
973
|
-
"onUpdate:modelValue": d[6] || (d[6] = (
|
|
974
|
-
unref(
|
|
958
|
+
}, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
959
|
+
_hoisted_6$3,
|
|
960
|
+
createVNode(b, {
|
|
961
|
+
"model-value": unref(c),
|
|
962
|
+
"onUpdate:modelValue": d[6] || (d[6] = (h) => {
|
|
963
|
+
unref(c) != h && (o("update:model-value", {
|
|
975
964
|
...e.modelValue ?? {
|
|
976
965
|
type: "PROPORTIONAL",
|
|
977
966
|
amount: 1,
|
|
978
967
|
every: 1
|
|
979
968
|
},
|
|
980
|
-
property:
|
|
969
|
+
property: h ? [] : void 0,
|
|
981
970
|
every: 1
|
|
982
|
-
}),
|
|
971
|
+
}), c.value = h);
|
|
983
972
|
})
|
|
984
973
|
}, {
|
|
985
974
|
default: withCtx(() => [
|
|
986
|
-
createVNode(
|
|
975
|
+
createVNode(y, {
|
|
987
976
|
label: "Amount spent",
|
|
988
977
|
sublabel: `Receive ${unref(l)} by amount spent`,
|
|
989
978
|
value: !1
|
|
990
979
|
}, {
|
|
991
980
|
label: withCtx(() => {
|
|
992
|
-
var
|
|
981
|
+
var h, R;
|
|
993
982
|
return [
|
|
994
|
-
|
|
995
|
-
createElementVNode("div",
|
|
996
|
-
unref(
|
|
983
|
+
_hoisted_7$3,
|
|
984
|
+
createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
|
|
985
|
+
unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
997
986
|
createVNode(f, {
|
|
998
987
|
label: `Receive ${unref(l)}(s)`,
|
|
999
988
|
inputmode: "decimal",
|
|
1000
989
|
class: "flex-1",
|
|
1001
|
-
"model-value": ((
|
|
1002
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
990
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
991
|
+
"onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
|
|
1003
992
|
...e.modelValue ?? { type: "FIXED" },
|
|
1004
|
-
amount:
|
|
993
|
+
amount: B
|
|
1005
994
|
}))
|
|
1006
995
|
}, null, 8, ["label", "model-value"]),
|
|
1007
|
-
|
|
996
|
+
_hoisted_10$3,
|
|
1008
997
|
createVNode(f, {
|
|
1009
|
-
label: `Amount spend (${unref(
|
|
998
|
+
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1010
999
|
class: "flex-1",
|
|
1011
1000
|
inputmode: "decimal",
|
|
1012
|
-
"model-value": ((
|
|
1013
|
-
"onUpdate:modelValue": d[2] || (d[2] = (
|
|
1001
|
+
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1002
|
+
"onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
|
|
1014
1003
|
...e.modelValue,
|
|
1015
|
-
every:
|
|
1004
|
+
every: B
|
|
1016
1005
|
}))
|
|
1017
1006
|
}, {
|
|
1018
1007
|
prepend: withCtx(() => [
|
|
1019
|
-
createTextVNode(toDisplayString(unref(
|
|
1008
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1020
1009
|
]),
|
|
1021
1010
|
_: 1
|
|
1022
1011
|
}, 8, ["label", "model-value"])
|
|
@@ -1025,34 +1014,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1025
1014
|
}),
|
|
1026
1015
|
_: 1
|
|
1027
1016
|
}, 8, ["sublabel"]),
|
|
1028
|
-
createVNode(
|
|
1017
|
+
createVNode(y, {
|
|
1029
1018
|
label: "Product bought",
|
|
1030
1019
|
sublabel: `Receive ${unref(l)} by product bought`,
|
|
1031
1020
|
value: !0,
|
|
1032
|
-
disabled: !unref(
|
|
1021
|
+
disabled: !unref(n).isPremium
|
|
1033
1022
|
}, {
|
|
1034
1023
|
label: withCtx(() => {
|
|
1035
|
-
var
|
|
1024
|
+
var h, R;
|
|
1036
1025
|
return [
|
|
1037
|
-
createElementVNode("div",
|
|
1038
|
-
|
|
1039
|
-
createVNode(
|
|
1026
|
+
createElementVNode("div", _hoisted_11$1, [
|
|
1027
|
+
createTextVNode(" Product bought "),
|
|
1028
|
+
createVNode(k, { variant: "premium" })
|
|
1040
1029
|
]),
|
|
1041
|
-
createElementVNode("div",
|
|
1042
|
-
unref(
|
|
1043
|
-
createElementVNode("div",
|
|
1030
|
+
createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
|
|
1031
|
+
unref(c) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
1032
|
+
createElementVNode("div", _hoisted_14, [
|
|
1044
1033
|
createVNode(_sfc_main$f, {
|
|
1045
|
-
"model-value":
|
|
1046
|
-
onConfirm: d[3] || (d[3] = (
|
|
1034
|
+
"model-value": r.modelValue.property || [],
|
|
1035
|
+
onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
|
|
1047
1036
|
...e.modelValue,
|
|
1048
|
-
property:
|
|
1037
|
+
property: B
|
|
1049
1038
|
}))
|
|
1050
1039
|
}, {
|
|
1051
1040
|
"side-sheet-button": withCtx(() => {
|
|
1052
|
-
var
|
|
1041
|
+
var B, $;
|
|
1053
1042
|
return [
|
|
1054
|
-
createVNode(
|
|
1055
|
-
label: (
|
|
1043
|
+
createVNode(C, {
|
|
1044
|
+
label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
|
|
1056
1045
|
icon: "link",
|
|
1057
1046
|
variant: "secondary"
|
|
1058
1047
|
}, null, 8, ["label"])
|
|
@@ -1061,27 +1050,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1061
1050
|
_: 1
|
|
1062
1051
|
}, 8, ["model-value"])
|
|
1063
1052
|
]),
|
|
1064
|
-
createElementVNode("div",
|
|
1053
|
+
createElementVNode("div", _hoisted_15, [
|
|
1065
1054
|
createVNode(f, {
|
|
1066
1055
|
inputmode: "decimal",
|
|
1067
1056
|
label: `Receive ${unref(l)}(s)`,
|
|
1068
1057
|
class: "flex-1",
|
|
1069
|
-
"model-value": ((
|
|
1070
|
-
"onUpdate:modelValue": d[4] || (d[4] = (
|
|
1058
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
1059
|
+
"onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
|
|
1071
1060
|
...e.modelValue ?? { type: "FIXED" },
|
|
1072
|
-
amount:
|
|
1061
|
+
amount: B
|
|
1073
1062
|
}))
|
|
1074
1063
|
}, null, 8, ["label", "model-value"]),
|
|
1075
|
-
|
|
1064
|
+
_hoisted_16,
|
|
1076
1065
|
createVNode(f, {
|
|
1077
1066
|
label: "Item purchased",
|
|
1078
1067
|
class: "flex-1",
|
|
1079
|
-
"model-value": ((
|
|
1068
|
+
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1080
1069
|
inputmode: "numeric",
|
|
1081
1070
|
"max-fraction-digits": 0,
|
|
1082
|
-
"onUpdate:modelValue": d[5] || (d[5] = (
|
|
1071
|
+
"onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
|
|
1083
1072
|
...e.modelValue,
|
|
1084
|
-
every:
|
|
1073
|
+
every: B
|
|
1085
1074
|
}))
|
|
1086
1075
|
}, null, 8, ["model-value"])
|
|
1087
1076
|
])
|
|
@@ -1095,16 +1084,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1095
1084
|
}, 8, ["model-value"])
|
|
1096
1085
|
], 64)) : createCommentVNode("", !0)
|
|
1097
1086
|
]),
|
|
1098
|
-
e.errorText || unref(
|
|
1087
|
+
e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
|
|
1099
1088
|
key: 0,
|
|
1100
1089
|
class: "!mt-4",
|
|
1101
|
-
text: e.errorText || unref(ZodHelper).helperText(unref(
|
|
1090
|
+
text: e.errorText || unref(ZodHelper).helperText(unref(t), ""),
|
|
1102
1091
|
state: "error"
|
|
1103
1092
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1104
1093
|
]);
|
|
1105
1094
|
};
|
|
1106
1095
|
}
|
|
1107
|
-
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$
|
|
1096
|
+
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1108
1097
|
__name: "GameTypeInput",
|
|
1109
1098
|
props: {
|
|
1110
1099
|
modelValue: {
|
|
@@ -1112,8 +1101,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1112
1101
|
}
|
|
1113
1102
|
},
|
|
1114
1103
|
emits: ["update:model-value"],
|
|
1115
|
-
setup(e, { emit:
|
|
1116
|
-
const
|
|
1104
|
+
setup(e, { emit: i }) {
|
|
1105
|
+
const n = e, r = i, o = computed(
|
|
1117
1106
|
() => [
|
|
1118
1107
|
{
|
|
1119
1108
|
label: "Fortune Wheel",
|
|
@@ -1127,28 +1116,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1127
1116
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
1128
1117
|
hidden: !0
|
|
1129
1118
|
}
|
|
1130
|
-
].filter((
|
|
1119
|
+
].filter((s) => !s.hidden)
|
|
1131
1120
|
);
|
|
1132
|
-
return (
|
|
1133
|
-
const
|
|
1121
|
+
return (s, l) => {
|
|
1122
|
+
const t = resolveComponent("FmCard");
|
|
1134
1123
|
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1135
|
-
|
|
1136
|
-
createElementVNode("div",
|
|
1137
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1124
|
+
_hoisted_2$c,
|
|
1125
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
1126
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
1138
1127
|
variant: "outlined",
|
|
1139
1128
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1140
|
-
"col-span-2": unref(
|
|
1141
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1142
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1129
|
+
"col-span-2": unref(o).length == 1,
|
|
1130
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
1131
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1143
1132
|
}]),
|
|
1144
1133
|
onClick: () => {
|
|
1145
|
-
|
|
1134
|
+
n.modelValue != a.value && r("update:model-value", a.value);
|
|
1146
1135
|
},
|
|
1147
|
-
key:
|
|
1136
|
+
key: a.value
|
|
1148
1137
|
}, {
|
|
1149
1138
|
default: withCtx(() => [
|
|
1150
|
-
createElementVNode("div",
|
|
1151
|
-
createElementVNode("div",
|
|
1139
|
+
createElementVNode("div", _hoisted_4$9, toDisplayString(a.label), 1),
|
|
1140
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(a.description), 1)
|
|
1152
1141
|
]),
|
|
1153
1142
|
_: 2
|
|
1154
1143
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1156,7 +1145,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1156
1145
|
]);
|
|
1157
1146
|
};
|
|
1158
1147
|
}
|
|
1159
|
-
}), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1148
|
+
}), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1160
1149
|
__name: "VoucherEditor",
|
|
1161
1150
|
props: {
|
|
1162
1151
|
modelValue: {
|
|
@@ -1167,33 +1156,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1167
1156
|
}
|
|
1168
1157
|
},
|
|
1169
1158
|
emits: ["update:model-value", "update:reward-image"],
|
|
1170
|
-
setup(e, { emit:
|
|
1171
|
-
const
|
|
1159
|
+
setup(e, { emit: i }) {
|
|
1160
|
+
const r = ref(
|
|
1172
1161
|
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
1173
1162
|
business: useCoreStore().currentBusiness.value._id,
|
|
1174
1163
|
name: ""
|
|
1175
1164
|
})
|
|
1176
|
-
),
|
|
1177
|
-
return (
|
|
1178
|
-
var
|
|
1179
|
-
const
|
|
1165
|
+
), o = FdtoCollectibleConfig, s = i;
|
|
1166
|
+
return (l, t) => {
|
|
1167
|
+
var v, m, g;
|
|
1168
|
+
const a = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText");
|
|
1180
1169
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1181
1170
|
createVNode(_sfc_main$u, {
|
|
1182
|
-
modelValue: unref(
|
|
1183
|
-
"onUpdate:modelValue":
|
|
1171
|
+
modelValue: unref(r).name,
|
|
1172
|
+
"onUpdate:modelValue": t[0] || (t[0] = (p) => unref(r).name = p),
|
|
1184
1173
|
label: "Voucher name",
|
|
1185
|
-
schema: unref(ZodHelper).typeAtPath(unref(
|
|
1174
|
+
schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
|
|
1186
1175
|
}, null, 8, ["modelValue", "schema"]),
|
|
1187
|
-
createVNode(
|
|
1176
|
+
createVNode(a, {
|
|
1188
1177
|
class: "!mb-[-16px]",
|
|
1189
|
-
modelValue: unref(
|
|
1190
|
-
"onUpdate:modelValue":
|
|
1191
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1178
|
+
modelValue: unref(r).description,
|
|
1179
|
+
"onUpdate:modelValue": t[1] || (t[1] = (p) => unref(r).description = p),
|
|
1180
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
|
|
1192
1181
|
}, {
|
|
1193
1182
|
label: withCtx(() => [
|
|
1194
1183
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1195
1184
|
unref(ZodHelper).toInputLabel(
|
|
1196
|
-
unref(ZodHelper).typeAtPath(unref(
|
|
1185
|
+
unref(ZodHelper).typeAtPath(unref(o), "description", [unref(r).type]),
|
|
1197
1186
|
"Voucher description"
|
|
1198
1187
|
)
|
|
1199
1188
|
)))
|
|
@@ -1201,55 +1190,55 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1201
1190
|
_: 1
|
|
1202
1191
|
}, 8, ["modelValue", "rules"]),
|
|
1203
1192
|
createElementVNode("div", _hoisted_1$c, [
|
|
1204
|
-
|
|
1205
|
-
createElementVNode("div", null, toDisplayString(((
|
|
1193
|
+
_hoisted_2$b,
|
|
1194
|
+
createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
|
|
1206
1195
|
]),
|
|
1207
1196
|
createVNode(_sfc_main$v, {
|
|
1208
1197
|
class: "w-1/2 xs:w-2/3",
|
|
1209
1198
|
"aspect-ratio": "16/9",
|
|
1210
1199
|
file: e.rewardImage ?? void 0,
|
|
1211
|
-
thumbnail: unref(
|
|
1212
|
-
"onUpdate:file":
|
|
1213
|
-
|
|
1200
|
+
thumbnail: unref(r).image ?? void 0,
|
|
1201
|
+
"onUpdate:file": t[2] || (t[2] = async (p) => {
|
|
1202
|
+
s("update:reward-image", p), p || (unref(r).image = null);
|
|
1214
1203
|
})
|
|
1215
1204
|
}, {
|
|
1216
1205
|
label: withCtx(() => [
|
|
1217
1206
|
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1218
1207
|
unref(ZodHelper).toInputLabel(
|
|
1219
|
-
unref(ZodHelper).typeAtPath(unref(
|
|
1208
|
+
unref(ZodHelper).typeAtPath(unref(o), "image", [unref(r).type]),
|
|
1220
1209
|
"Voucher image"
|
|
1221
1210
|
)
|
|
1222
1211
|
)))
|
|
1223
1212
|
]),
|
|
1224
1213
|
_: 1
|
|
1225
1214
|
}, 8, ["file", "thumbnail"]),
|
|
1226
|
-
|
|
1215
|
+
_hoisted_3$9,
|
|
1227
1216
|
createVNode(_sfc_main$w, {
|
|
1228
|
-
"model-value": unref(
|
|
1229
|
-
"onUpdate:modelValue":
|
|
1217
|
+
"model-value": unref(r).extras.effect,
|
|
1218
|
+
"onUpdate:modelValue": t[3] || (t[3] = (p) => unref(r).extras.effect = p)
|
|
1230
1219
|
}, null, 8, ["model-value"]),
|
|
1231
|
-
unref(
|
|
1220
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(c, {
|
|
1232
1221
|
key: 0,
|
|
1233
1222
|
class: "!mt-8",
|
|
1234
|
-
text:
|
|
1223
|
+
text: "Effect is required",
|
|
1235
1224
|
state: "error"
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1225
|
+
})) : createCommentVNode("", !0),
|
|
1226
|
+
_hoisted_4$8,
|
|
1238
1227
|
createVNode(_sfc_main$x, {
|
|
1239
|
-
"model-value": unref(
|
|
1240
|
-
"no-campaign": unref(
|
|
1241
|
-
"onUpdate:modelValue":
|
|
1242
|
-
schema: unref(ZodHelper).typeAtPath(unref(
|
|
1228
|
+
"model-value": unref(r).options,
|
|
1229
|
+
"no-campaign": unref(r).noCampaign,
|
|
1230
|
+
"onUpdate:modelValue": t[4] || (t[4] = (p) => unref(r).options = p),
|
|
1231
|
+
schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
|
|
1243
1232
|
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1244
|
-
|
|
1245
|
-
unref(
|
|
1233
|
+
_hoisted_5$4,
|
|
1234
|
+
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1246
1235
|
key: 1,
|
|
1247
|
-
"model-value": ((
|
|
1236
|
+
"model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
|
|
1248
1237
|
type: "select",
|
|
1249
|
-
"onUpdate:modelValue":
|
|
1250
|
-
unref(
|
|
1238
|
+
"onUpdate:modelValue": t[5] || (t[5] = (p) => {
|
|
1239
|
+
unref(r).extras.targetLocation = p;
|
|
1251
1240
|
}),
|
|
1252
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1241
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
|
|
1253
1242
|
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
|
|
1254
1243
|
], 64);
|
|
1255
1244
|
};
|
|
@@ -1257,74 +1246,74 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1257
1246
|
}), _hoisted_1$b = {
|
|
1258
1247
|
key: 0,
|
|
1259
1248
|
class: "flex flex-col gap-y-24"
|
|
1260
|
-
}, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1249
|
+
}, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1261
1250
|
__name: "EditRewardPoolSheet",
|
|
1262
1251
|
emits: ["update:model-value"],
|
|
1263
|
-
setup(e, { expose:
|
|
1264
|
-
const
|
|
1265
|
-
var
|
|
1266
|
-
return ((
|
|
1252
|
+
setup(e, { expose: i, emit: n }) {
|
|
1253
|
+
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), c = computed(() => {
|
|
1254
|
+
var u;
|
|
1255
|
+
return ((u = r.loyaltyRewards.items.find(
|
|
1267
1256
|
(f) => {
|
|
1268
|
-
var
|
|
1269
|
-
return f.value === ((
|
|
1257
|
+
var y;
|
|
1258
|
+
return f.value === ((y = l.value) == null ? void 0 : y.collectible);
|
|
1270
1259
|
}
|
|
1271
|
-
)) == null ? void 0 :
|
|
1272
|
-
}),
|
|
1273
|
-
const d =
|
|
1260
|
+
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1261
|
+
}), v = computed(() => {
|
|
1262
|
+
const d = c.value.safeParse(l.value);
|
|
1274
1263
|
return d.success ? [] : d.error.errors;
|
|
1275
1264
|
});
|
|
1276
|
-
function
|
|
1277
|
-
d && (l.value =
|
|
1265
|
+
function m(d, u, f) {
|
|
1266
|
+
d && (l.value = u, a.value = f), s.value = d;
|
|
1278
1267
|
}
|
|
1279
|
-
const g =
|
|
1280
|
-
async function
|
|
1281
|
-
const d =
|
|
1282
|
-
d.success && (await
|
|
1268
|
+
const g = n;
|
|
1269
|
+
async function p() {
|
|
1270
|
+
const d = c.value.safeParse(l.value);
|
|
1271
|
+
d.success && (await o(
|
|
1283
1272
|
async () => {
|
|
1284
|
-
d.data.type === "VOUCHER" &&
|
|
1285
|
-
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
1286
|
-
|
|
1273
|
+
d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1274
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
|
|
1275
|
+
t.value
|
|
1287
1276
|
));
|
|
1288
1277
|
},
|
|
1289
1278
|
{
|
|
1290
1279
|
message: "Uploading reward image",
|
|
1291
1280
|
successMessage: "Reward image updated"
|
|
1292
1281
|
}
|
|
1293
|
-
), g("update:model-value", d.data,
|
|
1282
|
+
), g("update:model-value", d.data, a.value));
|
|
1294
1283
|
}
|
|
1295
|
-
return
|
|
1296
|
-
showSheet:
|
|
1297
|
-
}), (d,
|
|
1298
|
-
const f = resolveComponent("FmSelect"),
|
|
1299
|
-
return openBlock(), createBlock(
|
|
1284
|
+
return i({
|
|
1285
|
+
showSheet: m
|
|
1286
|
+
}), (d, u) => {
|
|
1287
|
+
const f = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1288
|
+
return openBlock(), createBlock(C, {
|
|
1300
1289
|
"max-width": 560,
|
|
1301
|
-
modelValue: unref(
|
|
1290
|
+
modelValue: unref(s),
|
|
1302
1291
|
"onUpdate:modelValue": [
|
|
1303
|
-
|
|
1304
|
-
|
|
1292
|
+
u[9] || (u[9] = (b) => isRef(s) ? s.value = b : null),
|
|
1293
|
+
u[10] || (u[10] = (b) => s.value = b)
|
|
1305
1294
|
],
|
|
1306
1295
|
header: "Edit reward",
|
|
1307
1296
|
"dismiss-away": ""
|
|
1308
1297
|
}, {
|
|
1309
1298
|
"side-sheet-footer": withCtx(() => [
|
|
1310
|
-
createElementVNode("div",
|
|
1311
|
-
createVNode(
|
|
1299
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
1300
|
+
createVNode(k, {
|
|
1312
1301
|
variant: "primary",
|
|
1313
1302
|
type: "button",
|
|
1314
|
-
disabled: unref(
|
|
1303
|
+
disabled: unref(v).length > 0,
|
|
1315
1304
|
label: "Confirm",
|
|
1316
|
-
onClick:
|
|
1305
|
+
onClick: u[7] || (u[7] = (b) => p())
|
|
1317
1306
|
}, null, 8, ["disabled"]),
|
|
1318
|
-
createVNode(
|
|
1307
|
+
createVNode(k, {
|
|
1319
1308
|
variant: "secondary",
|
|
1320
1309
|
type: "button",
|
|
1321
1310
|
label: "Cancel",
|
|
1322
|
-
onClick:
|
|
1311
|
+
onClick: u[8] || (u[8] = (b) => s.value = !1)
|
|
1323
1312
|
})
|
|
1324
1313
|
])
|
|
1325
1314
|
]),
|
|
1326
1315
|
default: withCtx(() => {
|
|
1327
|
-
var
|
|
1316
|
+
var b, x, E;
|
|
1328
1317
|
return [
|
|
1329
1318
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1330
1319
|
createVNode(f, {
|
|
@@ -1335,12 +1324,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1335
1324
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1336
1325
|
],
|
|
1337
1326
|
"model-value": unref(l).type,
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1339
|
-
|
|
1327
|
+
"onUpdate:modelValue": u[0] || (u[0] = (V) => {
|
|
1328
|
+
V == "NO_REWARD" ? l.value = {
|
|
1340
1329
|
type: "NO_REWARD",
|
|
1341
1330
|
collectible: null,
|
|
1342
1331
|
weight: 1
|
|
1343
|
-
} :
|
|
1332
|
+
} : V === "VOUCHER" ? l.value = {
|
|
1344
1333
|
collectible: null,
|
|
1345
1334
|
type: "VOUCHER",
|
|
1346
1335
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1355,7 +1344,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1355
1344
|
},
|
|
1356
1345
|
weight: 1
|
|
1357
1346
|
} : l.value = {
|
|
1358
|
-
collectible: unref(
|
|
1347
|
+
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
1359
1348
|
type: "LOYALTY",
|
|
1360
1349
|
earningOption: {
|
|
1361
1350
|
amount: 1,
|
|
@@ -1371,71 +1360,71 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1371
1360
|
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
|
|
1372
1361
|
key: 0,
|
|
1373
1362
|
label: "Loyalty type",
|
|
1374
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1375
|
-
items: unref(
|
|
1363
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
|
|
1364
|
+
items: unref(r).loyaltyRewards.items,
|
|
1376
1365
|
"model-value": unref(l).collectible,
|
|
1377
|
-
"onUpdate:modelValue":
|
|
1366
|
+
"onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
|
|
1378
1367
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1379
|
-
createVNode(
|
|
1368
|
+
createVNode(y, {
|
|
1380
1369
|
label: "Weight",
|
|
1381
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1370
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
|
|
1382
1371
|
"model-value": unref(l).weight,
|
|
1383
|
-
"onUpdate:modelValue":
|
|
1372
|
+
"onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
|
|
1384
1373
|
...unref(l),
|
|
1385
|
-
weight:
|
|
1374
|
+
weight: V
|
|
1386
1375
|
})
|
|
1387
1376
|
}, null, 8, ["rules", "model-value"]),
|
|
1388
1377
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1389
|
-
((
|
|
1390
|
-
(
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
1378
|
+
((b = unref(r).loyaltyRewards.items.find(
|
|
1379
|
+
(V) => {
|
|
1380
|
+
var N;
|
|
1381
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1393
1382
|
}
|
|
1394
|
-
)) == null ? void 0 :
|
|
1395
|
-
|
|
1383
|
+
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1384
|
+
_hoisted_2$a,
|
|
1396
1385
|
createVNode(_sfc_main$e, {
|
|
1397
1386
|
class: "mt-[-8px]",
|
|
1398
1387
|
rules: [
|
|
1399
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1388
|
+
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
|
|
1400
1389
|
],
|
|
1401
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1402
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1390
|
+
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1391
|
+
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
1403
1392
|
"fixed-type": !0,
|
|
1404
1393
|
"model-value": unref(l).earningOption,
|
|
1405
|
-
"onUpdate:modelValue":
|
|
1394
|
+
"onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
|
|
1406
1395
|
...unref(l),
|
|
1407
|
-
earningOption:
|
|
1396
|
+
earningOption: V
|
|
1408
1397
|
})
|
|
1409
1398
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1410
1399
|
], 64)) : createCommentVNode("", !0),
|
|
1411
|
-
|
|
1400
|
+
_hoisted_3$8,
|
|
1412
1401
|
createVNode(_sfc_main$z, {
|
|
1413
|
-
"for-credit": unref(l).type === "LOYALTY" && ((
|
|
1414
|
-
(
|
|
1415
|
-
var
|
|
1416
|
-
return
|
|
1402
|
+
"for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
|
|
1403
|
+
(V) => {
|
|
1404
|
+
var N;
|
|
1405
|
+
return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1417
1406
|
}
|
|
1418
|
-
)) == null ? void 0 :
|
|
1407
|
+
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
1419
1408
|
class: "!gap-24",
|
|
1420
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1409
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
|
|
1421
1410
|
"model-value": unref(l).validityOption,
|
|
1422
|
-
"onUpdate:modelValue":
|
|
1411
|
+
"onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
|
|
1423
1412
|
...unref(l),
|
|
1424
|
-
validityOption:
|
|
1413
|
+
validityOption: V
|
|
1425
1414
|
})
|
|
1426
1415
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1427
1416
|
], 64)) : createCommentVNode("", !0),
|
|
1428
1417
|
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1429
1418
|
key: 2,
|
|
1430
|
-
"reward-image": unref(
|
|
1431
|
-
"model-value": ((
|
|
1432
|
-
"onUpdate:modelValue":
|
|
1419
|
+
"reward-image": unref(t),
|
|
1420
|
+
"model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
|
|
1421
|
+
"onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
|
|
1433
1422
|
...unref(l),
|
|
1434
|
-
collectibleConfig:
|
|
1423
|
+
collectibleConfig: V
|
|
1435
1424
|
}),
|
|
1436
|
-
"onUpdate:rewardImage":
|
|
1425
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
|
|
1437
1426
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1438
|
-
createVNode(JsonViewer, { json: unref(
|
|
1427
|
+
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
1439
1428
|
])) : createCommentVNode("", !0)
|
|
1440
1429
|
];
|
|
1441
1430
|
}),
|
|
@@ -1447,7 +1436,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1447
1436
|
function isNullOrEmpty(e) {
|
|
1448
1437
|
return e == null || e === "";
|
|
1449
1438
|
}
|
|
1450
|
-
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$
|
|
1439
|
+
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1), _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1451
1440
|
__name: "RewardPoolInput",
|
|
1452
1441
|
props: {
|
|
1453
1442
|
modelValue: {
|
|
@@ -1462,37 +1451,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1462
1451
|
}
|
|
1463
1452
|
},
|
|
1464
1453
|
emits: ["update:model-value"],
|
|
1465
|
-
setup(e, { emit:
|
|
1466
|
-
const
|
|
1467
|
-
const d =
|
|
1454
|
+
setup(e, { emit: i }) {
|
|
1455
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
|
|
1456
|
+
const d = s.safeParse(l.value);
|
|
1468
1457
|
return d.success ? [] : d.error.errors;
|
|
1469
|
-
}),
|
|
1470
|
-
function
|
|
1471
|
-
var
|
|
1458
|
+
}), a = ref();
|
|
1459
|
+
function c(d, u) {
|
|
1460
|
+
var y;
|
|
1472
1461
|
const f = [...l.value];
|
|
1473
|
-
f[
|
|
1462
|
+
f[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", f);
|
|
1474
1463
|
}
|
|
1475
|
-
function
|
|
1476
|
-
const
|
|
1477
|
-
(
|
|
1478
|
-
), f = CollectionUtils.formattedType((
|
|
1464
|
+
function v(d) {
|
|
1465
|
+
const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
|
|
1466
|
+
(k) => k._id.toString() == d.collectible
|
|
1467
|
+
), f = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
|
|
1479
1468
|
return {
|
|
1480
1469
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1481
|
-
sublabel: `${
|
|
1470
|
+
sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
|
|
1482
1471
|
};
|
|
1483
1472
|
}
|
|
1484
|
-
function
|
|
1473
|
+
function m(d) {
|
|
1485
1474
|
var f;
|
|
1486
|
-
const
|
|
1487
|
-
(f =
|
|
1475
|
+
const u = [...l.value];
|
|
1476
|
+
(f = a.value) == null || f.showSheet(!0, u[d], d);
|
|
1488
1477
|
}
|
|
1489
1478
|
function g(d) {
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1479
|
+
const u = [...l.value];
|
|
1480
|
+
u.splice(d, 1), r("update:model-value", u);
|
|
1492
1481
|
}
|
|
1493
|
-
function
|
|
1482
|
+
function p() {
|
|
1494
1483
|
var d;
|
|
1495
|
-
(d =
|
|
1484
|
+
(d = a.value) == null || d.showSheet(
|
|
1496
1485
|
!0,
|
|
1497
1486
|
{
|
|
1498
1487
|
type: "NO_REWARD",
|
|
@@ -1502,52 +1491,52 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1502
1491
|
l.value.length
|
|
1503
1492
|
);
|
|
1504
1493
|
}
|
|
1505
|
-
return (d,
|
|
1506
|
-
const f = resolveComponent("FmButton"),
|
|
1494
|
+
return (d, u) => {
|
|
1495
|
+
const f = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1507
1496
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1508
|
-
|
|
1497
|
+
_hoisted_2$9,
|
|
1509
1498
|
createVNode(f, {
|
|
1510
1499
|
label: "Add Reward",
|
|
1511
|
-
onClick:
|
|
1500
|
+
onClick: u[0] || (u[0] = (C) => p()),
|
|
1512
1501
|
variant: "plain",
|
|
1513
1502
|
icon: "add"
|
|
1514
1503
|
}),
|
|
1515
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
1516
|
-
key:
|
|
1504
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
|
|
1505
|
+
key: b,
|
|
1517
1506
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1518
1507
|
variant: "outlined",
|
|
1519
|
-
onClick: (
|
|
1508
|
+
onClick: (x) => m(b)
|
|
1520
1509
|
}, {
|
|
1521
1510
|
default: withCtx(() => [
|
|
1522
1511
|
createElementVNode("div", null, [
|
|
1523
|
-
createElementVNode("div",
|
|
1524
|
-
createElementVNode("div",
|
|
1512
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
|
|
1513
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
|
|
1525
1514
|
]),
|
|
1526
1515
|
createVNode(f, {
|
|
1527
1516
|
icon: "delete",
|
|
1528
1517
|
variant: "tertiary",
|
|
1529
|
-
onClick: (
|
|
1518
|
+
onClick: (x) => (x.stopPropagation(), g(b))
|
|
1530
1519
|
}, null, 8, ["onClick"])
|
|
1531
1520
|
]),
|
|
1532
1521
|
_: 2
|
|
1533
1522
|
}, 1032, ["onClick"]))), 128)),
|
|
1534
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1535
|
-
key:
|
|
1536
|
-
text:
|
|
1523
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(k, {
|
|
1524
|
+
key: C.message,
|
|
1525
|
+
text: C.message,
|
|
1537
1526
|
state: "error"
|
|
1538
1527
|
}, null, 8, ["text"]))), 128)),
|
|
1539
1528
|
createVNode(_sfc_main$b, {
|
|
1540
1529
|
ref_key: "sheetRef",
|
|
1541
|
-
ref:
|
|
1542
|
-
"onUpdate:modelValue":
|
|
1530
|
+
ref: a,
|
|
1531
|
+
"onUpdate:modelValue": c
|
|
1543
1532
|
}, null, 512)
|
|
1544
1533
|
]);
|
|
1545
1534
|
};
|
|
1546
1535
|
}
|
|
1547
|
-
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$
|
|
1536
|
+
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$8 = {
|
|
1548
1537
|
key: 0,
|
|
1549
1538
|
class: "grid grid-cols-2 gap-16"
|
|
1550
|
-
}, _hoisted_3$
|
|
1539
|
+
}, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1551
1540
|
__name: "PromotionGameTypeInput",
|
|
1552
1541
|
props: {
|
|
1553
1542
|
modelValue: {
|
|
@@ -1555,48 +1544,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1555
1544
|
}
|
|
1556
1545
|
},
|
|
1557
1546
|
emits: ["update:model-value"],
|
|
1558
|
-
setup(e, { emit:
|
|
1559
|
-
const
|
|
1547
|
+
setup(e, { emit: i }) {
|
|
1548
|
+
const n = e, r = i, o = computed(() => [
|
|
1560
1549
|
{
|
|
1561
1550
|
label: "Rock paper scissor",
|
|
1562
1551
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
1563
1552
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1564
1553
|
}
|
|
1565
1554
|
]);
|
|
1566
|
-
return (
|
|
1567
|
-
var
|
|
1568
|
-
const
|
|
1555
|
+
return (s, l) => {
|
|
1556
|
+
var v, m, g;
|
|
1557
|
+
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
|
|
1569
1558
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1570
|
-
createVNode(
|
|
1559
|
+
createVNode(t, {
|
|
1571
1560
|
label: "Enable game",
|
|
1572
|
-
"model-value": !!((
|
|
1573
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
1561
|
+
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
1562
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => p ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1574
1563
|
}, null, 8, ["model-value"]),
|
|
1575
|
-
((
|
|
1576
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1577
|
-
var d,
|
|
1578
|
-
return openBlock(), createBlock(
|
|
1564
|
+
((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1565
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (p) => {
|
|
1566
|
+
var d, u;
|
|
1567
|
+
return openBlock(), createBlock(a, {
|
|
1579
1568
|
variant: "outlined",
|
|
1580
1569
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1581
|
-
"col-span-2": unref(
|
|
1582
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) ==
|
|
1583
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1570
|
+
"col-span-2": unref(o).length == 1,
|
|
1571
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == p.value,
|
|
1572
|
+
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != p.value
|
|
1584
1573
|
}]),
|
|
1585
1574
|
onClick: () => {
|
|
1586
1575
|
var f;
|
|
1587
|
-
((f =
|
|
1576
|
+
((f = n.modelValue) == null ? void 0 : f.gameType) != p.value && r("update:model-value", { gameType: p.value });
|
|
1588
1577
|
},
|
|
1589
|
-
key:
|
|
1578
|
+
key: p.value
|
|
1590
1579
|
}, {
|
|
1591
1580
|
default: withCtx(() => [
|
|
1592
|
-
createElementVNode("div", _hoisted_3$
|
|
1593
|
-
createElementVNode("div", _hoisted_4$
|
|
1581
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(p.label), 1),
|
|
1582
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(p.description), 1)
|
|
1594
1583
|
]),
|
|
1595
1584
|
_: 2
|
|
1596
1585
|
}, 1032, ["class", "onClick"]);
|
|
1597
1586
|
}), 128))
|
|
1598
1587
|
])) : createCommentVNode("", !0),
|
|
1599
|
-
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
1588
|
+
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
|
|
1600
1589
|
key: 1,
|
|
1601
1590
|
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
1602
1591
|
state: "warning"
|
|
@@ -1604,7 +1593,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1604
1593
|
]);
|
|
1605
1594
|
};
|
|
1606
1595
|
}
|
|
1607
|
-
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" },
|
|
1596
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$7 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1608
1597
|
__name: "MissionTypeInput",
|
|
1609
1598
|
props: {
|
|
1610
1599
|
modelValue: {
|
|
@@ -1612,8 +1601,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1612
1601
|
}
|
|
1613
1602
|
},
|
|
1614
1603
|
emits: ["update:model-value"],
|
|
1615
|
-
setup(e, { emit:
|
|
1616
|
-
const
|
|
1604
|
+
setup(e, { emit: i }) {
|
|
1605
|
+
const n = e, r = i, o = computed(() => [
|
|
1617
1606
|
{
|
|
1618
1607
|
label: "Stamp",
|
|
1619
1608
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -1625,26 +1614,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1625
1614
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1626
1615
|
}
|
|
1627
1616
|
]);
|
|
1628
|
-
return (
|
|
1629
|
-
const
|
|
1617
|
+
return (s, l) => {
|
|
1618
|
+
const t = resolveComponent("FmCard");
|
|
1630
1619
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1631
|
-
|
|
1632
|
-
createElementVNode("div",
|
|
1633
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1620
|
+
_hoisted_2$7,
|
|
1621
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
1622
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
|
|
1634
1623
|
variant: "outlined",
|
|
1635
1624
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1636
|
-
"col-span-2": unref(
|
|
1637
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1638
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1625
|
+
"col-span-2": unref(o).length == 1,
|
|
1626
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
|
|
1627
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != a.value
|
|
1639
1628
|
}]),
|
|
1640
1629
|
onClick: () => {
|
|
1641
|
-
|
|
1630
|
+
n.modelValue != a.value && r("update:model-value", a.value);
|
|
1642
1631
|
},
|
|
1643
|
-
key:
|
|
1632
|
+
key: a.value
|
|
1644
1633
|
}, {
|
|
1645
1634
|
default: withCtx(() => [
|
|
1646
|
-
createElementVNode("div",
|
|
1647
|
-
createElementVNode("div",
|
|
1635
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(a.label), 1),
|
|
1636
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
|
|
1648
1637
|
]),
|
|
1649
1638
|
_: 2
|
|
1650
1639
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1652,7 +1641,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1652
1641
|
]);
|
|
1653
1642
|
};
|
|
1654
1643
|
}
|
|
1655
|
-
}), _hoisted_1$7 = { class: "space-y-16" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1644
|
+
}), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1656
1645
|
__name: "MissionEndInput",
|
|
1657
1646
|
props: {
|
|
1658
1647
|
modelValue: {
|
|
@@ -1666,23 +1655,23 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1666
1655
|
}
|
|
1667
1656
|
},
|
|
1668
1657
|
emits: ["update:model-value"],
|
|
1669
|
-
setup(e, { emit:
|
|
1670
|
-
const
|
|
1671
|
-
return (
|
|
1672
|
-
const
|
|
1658
|
+
setup(e, { emit: i }) {
|
|
1659
|
+
const n = i;
|
|
1660
|
+
return (r, o) => {
|
|
1661
|
+
const s = resolveComponent("FmStepperField");
|
|
1673
1662
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1674
|
-
|
|
1675
|
-
createVNode(
|
|
1663
|
+
_hoisted_2$6,
|
|
1664
|
+
createVNode(s, {
|
|
1676
1665
|
label: "Maximum to collect",
|
|
1677
1666
|
"model-value": e.modelValue || null,
|
|
1678
|
-
"onUpdate:modelValue":
|
|
1667
|
+
"onUpdate:modelValue": o[0] || (o[0] = (l) => n("update:model-value", l)),
|
|
1679
1668
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1680
1669
|
"helper-state": e.helperState || "none"
|
|
1681
1670
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1682
1671
|
]);
|
|
1683
1672
|
};
|
|
1684
1673
|
}
|
|
1685
|
-
}), _hoisted_1$6 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1674
|
+
}), _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_2$5 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1686
1675
|
__name: "EditMissionPoolSheet",
|
|
1687
1676
|
props: {
|
|
1688
1677
|
maxThreshold: {
|
|
@@ -1691,103 +1680,103 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1691
1680
|
}
|
|
1692
1681
|
},
|
|
1693
1682
|
emits: ["update:model-value"],
|
|
1694
|
-
setup(e, { expose:
|
|
1695
|
-
const
|
|
1696
|
-
const f =
|
|
1683
|
+
setup(e, { expose: i, emit: n }) {
|
|
1684
|
+
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), c = ref(0), v = FdtoThresholdReward, m = computed(() => {
|
|
1685
|
+
const f = v.safeParse(t.value);
|
|
1697
1686
|
return f.success ? [] : f.error.errors;
|
|
1698
1687
|
});
|
|
1699
|
-
function g(f,
|
|
1700
|
-
f && (
|
|
1688
|
+
function g(f, y, k) {
|
|
1689
|
+
f && (t.value = y, c.value = k), l.value = f;
|
|
1701
1690
|
}
|
|
1702
|
-
const
|
|
1691
|
+
const p = n;
|
|
1703
1692
|
async function d() {
|
|
1704
|
-
console.log(
|
|
1705
|
-
const f =
|
|
1706
|
-
f.success && (await
|
|
1693
|
+
console.log(t.value);
|
|
1694
|
+
const f = v.safeParse(t.value);
|
|
1695
|
+
f.success && (await s(
|
|
1707
1696
|
async () => {
|
|
1708
|
-
f.data.type === "VOUCHER" &&
|
|
1709
|
-
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0,
|
|
1710
|
-
|
|
1697
|
+
f.data.type === "VOUCHER" && a.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1698
|
+
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
1699
|
+
a.value
|
|
1711
1700
|
));
|
|
1712
1701
|
},
|
|
1713
1702
|
{
|
|
1714
1703
|
message: "Uploading reward image",
|
|
1715
1704
|
successMessage: "Reward image updated"
|
|
1716
1705
|
}
|
|
1717
|
-
),
|
|
1706
|
+
), p("update:model-value", f.data, c.value));
|
|
1718
1707
|
}
|
|
1719
|
-
const
|
|
1720
|
-
return
|
|
1708
|
+
const u = ref();
|
|
1709
|
+
return i({
|
|
1721
1710
|
showSheet: g
|
|
1722
|
-
}), (f,
|
|
1723
|
-
const
|
|
1724
|
-
return openBlock(), createBlock(
|
|
1711
|
+
}), (f, y) => {
|
|
1712
|
+
const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
|
|
1713
|
+
return openBlock(), createBlock(E, {
|
|
1725
1714
|
"max-width": 560,
|
|
1726
1715
|
modelValue: unref(l),
|
|
1727
1716
|
"onUpdate:modelValue": [
|
|
1728
|
-
|
|
1729
|
-
|
|
1717
|
+
y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
|
|
1718
|
+
y[11] || (y[11] = (V) => l.value = V)
|
|
1730
1719
|
],
|
|
1731
1720
|
header: "Edit reward",
|
|
1732
1721
|
"dismiss-away": ""
|
|
1733
1722
|
}, {
|
|
1734
1723
|
"side-sheet-footer": withCtx(() => [
|
|
1735
|
-
createElementVNode("div",
|
|
1736
|
-
createVNode(
|
|
1724
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1725
|
+
createVNode(x, {
|
|
1737
1726
|
variant: "primary",
|
|
1738
1727
|
type: "button",
|
|
1739
1728
|
label: "Confirm",
|
|
1740
|
-
onClick:
|
|
1741
|
-
var
|
|
1742
|
-
return (
|
|
1729
|
+
onClick: y[8] || (y[8] = async () => {
|
|
1730
|
+
var V;
|
|
1731
|
+
return (V = unref(u)) == null ? void 0 : V.validateInputs();
|
|
1743
1732
|
})
|
|
1744
1733
|
}),
|
|
1745
|
-
createVNode(
|
|
1734
|
+
createVNode(x, {
|
|
1746
1735
|
variant: "secondary",
|
|
1747
1736
|
type: "button",
|
|
1748
1737
|
label: "Cancel",
|
|
1749
|
-
onClick:
|
|
1738
|
+
onClick: y[9] || (y[9] = (V) => l.value = !1)
|
|
1750
1739
|
})
|
|
1751
1740
|
])
|
|
1752
1741
|
]),
|
|
1753
1742
|
default: withCtx(() => [
|
|
1754
|
-
unref(
|
|
1743
|
+
unref(t) ? (openBlock(), createBlock(b, {
|
|
1755
1744
|
key: 0,
|
|
1756
1745
|
class: "flex flex-col gap-y-24",
|
|
1757
1746
|
ref_key: "formRef",
|
|
1758
|
-
ref:
|
|
1759
|
-
onValidationSuccess:
|
|
1747
|
+
ref: u,
|
|
1748
|
+
onValidationSuccess: y[7] || (y[7] = (V) => d())
|
|
1760
1749
|
}, {
|
|
1761
1750
|
default: withCtx(() => {
|
|
1762
|
-
var
|
|
1751
|
+
var V, N;
|
|
1763
1752
|
return [
|
|
1764
|
-
unref(
|
|
1753
|
+
unref(t).type ? (openBlock(), createBlock(k, {
|
|
1765
1754
|
key: 0,
|
|
1766
1755
|
label: "Threshold",
|
|
1767
1756
|
rules: [
|
|
1768
1757
|
unref(ZodHelper).toRule(
|
|
1769
1758
|
unref(z).number().min(1).max(
|
|
1770
|
-
|
|
1771
|
-
`Number cannot be more than ${
|
|
1759
|
+
r.maxThreshold,
|
|
1760
|
+
`Number cannot be more than ${r.maxThreshold}`
|
|
1772
1761
|
)
|
|
1773
1762
|
)
|
|
1774
1763
|
],
|
|
1775
|
-
"model-value": unref(
|
|
1776
|
-
"onUpdate:modelValue":
|
|
1777
|
-
...unref(
|
|
1778
|
-
threshold:
|
|
1764
|
+
"model-value": unref(t).threshold,
|
|
1765
|
+
"onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
|
|
1766
|
+
...unref(t),
|
|
1767
|
+
threshold: h
|
|
1779
1768
|
})
|
|
1780
1769
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1781
|
-
createVNode(
|
|
1770
|
+
createVNode(C, {
|
|
1782
1771
|
label: "Reward Type",
|
|
1783
1772
|
items: [
|
|
1784
1773
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1785
1774
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1786
1775
|
],
|
|
1787
|
-
"model-value": unref(
|
|
1788
|
-
"onUpdate:modelValue":
|
|
1789
|
-
var
|
|
1790
|
-
|
|
1776
|
+
"model-value": unref(t).type,
|
|
1777
|
+
"onUpdate:modelValue": y[1] || (y[1] = (h) => {
|
|
1778
|
+
var R, B;
|
|
1779
|
+
h === "VOUCHER" ? t.value = {
|
|
1791
1780
|
collectible: null,
|
|
1792
1781
|
type: "VOUCHER",
|
|
1793
1782
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1800,9 +1789,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1800
1789
|
validityOption: {
|
|
1801
1790
|
validForDay: 7
|
|
1802
1791
|
},
|
|
1803
|
-
threshold: (
|
|
1804
|
-
} :
|
|
1805
|
-
collectible: unref(
|
|
1792
|
+
threshold: (R = unref(t)) == null ? void 0 : R.threshold
|
|
1793
|
+
} : t.value = {
|
|
1794
|
+
collectible: unref(o).loyaltyRewards.raw[0]._id,
|
|
1806
1795
|
type: "LOYALTY",
|
|
1807
1796
|
earningOption: {
|
|
1808
1797
|
amount: 1,
|
|
@@ -1811,59 +1800,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1811
1800
|
validityOption: {
|
|
1812
1801
|
validForDay: 7
|
|
1813
1802
|
},
|
|
1814
|
-
threshold: (
|
|
1803
|
+
threshold: (B = unref(t)) == null ? void 0 : B.threshold
|
|
1815
1804
|
};
|
|
1816
1805
|
})
|
|
1817
1806
|
}, null, 8, ["model-value"]),
|
|
1818
|
-
unref(
|
|
1807
|
+
unref(t).type == "LOYALTY" ? (openBlock(), createBlock(C, {
|
|
1819
1808
|
key: 1,
|
|
1820
1809
|
label: "Loyalty type",
|
|
1821
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1822
|
-
items: unref(
|
|
1823
|
-
"model-value": unref(
|
|
1824
|
-
"onUpdate:modelValue":
|
|
1810
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
|
|
1811
|
+
items: unref(o).loyaltyRewards.items,
|
|
1812
|
+
"model-value": unref(t).collectible,
|
|
1813
|
+
"onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
|
|
1825
1814
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1826
|
-
unref(
|
|
1827
|
-
|
|
1815
|
+
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1816
|
+
_hoisted_1$6,
|
|
1828
1817
|
createVNode(_sfc_main$e, {
|
|
1829
1818
|
class: "mt-[-8px]",
|
|
1830
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1831
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1832
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1819
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(t).type])],
|
|
1820
|
+
"helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
|
|
1821
|
+
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1833
1822
|
"fixed-type": !0,
|
|
1834
|
-
"model-value": unref(
|
|
1835
|
-
"onUpdate:modelValue":
|
|
1836
|
-
...unref(
|
|
1837
|
-
earningOption:
|
|
1823
|
+
"model-value": unref(t).earningOption,
|
|
1824
|
+
"onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
|
|
1825
|
+
...unref(t),
|
|
1826
|
+
earningOption: h
|
|
1838
1827
|
})
|
|
1839
1828
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1840
1829
|
createVNode(_sfc_main$z, {
|
|
1841
1830
|
class: "!gap-24",
|
|
1842
|
-
"for-credit": unref(
|
|
1843
|
-
(
|
|
1844
|
-
var
|
|
1845
|
-
return
|
|
1831
|
+
"for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
|
|
1832
|
+
(h) => {
|
|
1833
|
+
var R;
|
|
1834
|
+
return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
|
|
1846
1835
|
}
|
|
1847
|
-
)) == null ? void 0 :
|
|
1848
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1849
|
-
"model-value": unref(
|
|
1850
|
-
"onUpdate:modelValue":
|
|
1851
|
-
...unref(
|
|
1852
|
-
validityOption:
|
|
1836
|
+
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1837
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
|
|
1838
|
+
"model-value": unref(t).validityOption,
|
|
1839
|
+
"onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
|
|
1840
|
+
...unref(t),
|
|
1841
|
+
validityOption: h
|
|
1853
1842
|
})
|
|
1854
1843
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1855
1844
|
], 64)) : createCommentVNode("", !0),
|
|
1856
|
-
unref(
|
|
1845
|
+
unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1857
1846
|
key: 3,
|
|
1858
|
-
"reward-image": unref(
|
|
1859
|
-
"model-value": ((
|
|
1860
|
-
"onUpdate:modelValue":
|
|
1861
|
-
...unref(
|
|
1862
|
-
collectibleConfig:
|
|
1847
|
+
"reward-image": unref(a),
|
|
1848
|
+
"model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1849
|
+
"onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
|
|
1850
|
+
...unref(t),
|
|
1851
|
+
collectibleConfig: h
|
|
1863
1852
|
}),
|
|
1864
|
-
"onUpdate:rewardImage":
|
|
1853
|
+
"onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
|
|
1865
1854
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1866
|
-
createVNode(JsonViewer, { json: unref(
|
|
1855
|
+
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1867
1856
|
];
|
|
1868
1857
|
}),
|
|
1869
1858
|
_: 1
|
|
@@ -1876,7 +1865,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1876
1865
|
}), _hoisted_1$5 = {
|
|
1877
1866
|
key: 0,
|
|
1878
1867
|
class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
|
|
1879
|
-
}, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1868
|
+
}, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", null, "🎁", -1), _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1880
1869
|
__name: "MissionProgress",
|
|
1881
1870
|
props: {
|
|
1882
1871
|
type: {
|
|
@@ -1897,19 +1886,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1897
1886
|
}
|
|
1898
1887
|
},
|
|
1899
1888
|
setup(e) {
|
|
1900
|
-
const
|
|
1901
|
-
() => Math.min(
|
|
1902
|
-
), l = (
|
|
1903
|
-
return (
|
|
1904
|
-
const
|
|
1889
|
+
const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
|
|
1890
|
+
() => Math.min(r.value / n.value * 100, 100)
|
|
1891
|
+
), l = (t) => t / n.value * 100;
|
|
1892
|
+
return (t, a) => {
|
|
1893
|
+
const c = resolveComponent("FmIcon");
|
|
1905
1894
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1906
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(
|
|
1895
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(c, {
|
|
1907
1896
|
class: normalizeClass(
|
|
1908
|
-
unref(
|
|
1897
|
+
unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1909
1898
|
),
|
|
1910
|
-
outline: unref(
|
|
1911
|
-
key:
|
|
1912
|
-
name: unref(
|
|
1899
|
+
outline: unref(r) < v,
|
|
1900
|
+
key: v,
|
|
1901
|
+
name: unref(o).some((m) => m === v) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1913
1902
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1914
1903
|
])) : (openBlock(), createElementBlock("div", {
|
|
1915
1904
|
key: 1,
|
|
@@ -1917,18 +1906,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1917
1906
|
}, [
|
|
1918
1907
|
createElementVNode("div", {
|
|
1919
1908
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1920
|
-
style: normalizeStyle({ width: unref(
|
|
1909
|
+
style: normalizeStyle({ width: unref(s) + "%" })
|
|
1921
1910
|
}, null, 4),
|
|
1922
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1923
|
-
key:
|
|
1911
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (v, m) => (openBlock(), createElementBlock("div", {
|
|
1912
|
+
key: m,
|
|
1924
1913
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1925
|
-
style: normalizeStyle({ left: l(
|
|
1914
|
+
style: normalizeStyle({ left: l(v) + "%" })
|
|
1926
1915
|
}, [
|
|
1927
1916
|
createElementVNode("div", _hoisted_2$4, [
|
|
1928
1917
|
createElementVNode("div", {
|
|
1929
1918
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
1930
1919
|
}),
|
|
1931
|
-
|
|
1920
|
+
_hoisted_3$4
|
|
1932
1921
|
])
|
|
1933
1922
|
], 4))), 128))
|
|
1934
1923
|
]));
|
|
@@ -1936,19 +1925,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1936
1925
|
}
|
|
1937
1926
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1938
1927
|
function changeKeysFactory(e) {
|
|
1939
|
-
return function
|
|
1940
|
-
if (
|
|
1941
|
-
return
|
|
1942
|
-
if (Array.isArray(
|
|
1943
|
-
return
|
|
1944
|
-
const
|
|
1945
|
-
return Object.keys(
|
|
1946
|
-
const
|
|
1947
|
-
|
|
1948
|
-
}),
|
|
1928
|
+
return function i(n, r = 1, o) {
|
|
1929
|
+
if (r === 0 || !isObject(n))
|
|
1930
|
+
return n;
|
|
1931
|
+
if (Array.isArray(n))
|
|
1932
|
+
return n.map((l) => i(l, r - 1, o));
|
|
1933
|
+
const s = Object.create(Object.getPrototypeOf(n));
|
|
1934
|
+
return Object.keys(n).forEach((l) => {
|
|
1935
|
+
const t = n[l], a = e(l, o), c = i(t, r - 1, o);
|
|
1936
|
+
s[a] = c;
|
|
1937
|
+
}), s;
|
|
1949
1938
|
};
|
|
1950
1939
|
}
|
|
1951
|
-
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
|
|
1940
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1952
1941
|
__name: "MissionPoolInput",
|
|
1953
1942
|
props: {
|
|
1954
1943
|
modelValue: {
|
|
@@ -1961,43 +1950,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1961
1950
|
}
|
|
1962
1951
|
},
|
|
1963
1952
|
emits: ["update:model-value"],
|
|
1964
|
-
setup(e, { emit:
|
|
1965
|
-
const
|
|
1966
|
-
() =>
|
|
1967
|
-
),
|
|
1968
|
-
const
|
|
1969
|
-
return
|
|
1970
|
-
}),
|
|
1971
|
-
function
|
|
1972
|
-
var
|
|
1973
|
-
const
|
|
1974
|
-
|
|
1953
|
+
setup(e, { emit: i }) {
|
|
1954
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1955
|
+
() => n.modelValue.sort((u, f) => u.threshold - f.threshold) ?? []
|
|
1956
|
+
), t = computed(() => {
|
|
1957
|
+
const u = s.safeParse(l.value);
|
|
1958
|
+
return u.success ? [] : u.error.errors;
|
|
1959
|
+
}), a = ref();
|
|
1960
|
+
function c(u, f) {
|
|
1961
|
+
var k;
|
|
1962
|
+
const y = [...l.value];
|
|
1963
|
+
y[f] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
|
|
1975
1964
|
}
|
|
1976
|
-
function
|
|
1977
|
-
const f =
|
|
1978
|
-
(
|
|
1979
|
-
),
|
|
1965
|
+
function v(u) {
|
|
1966
|
+
const f = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
|
|
1967
|
+
(k) => k._id.toString() == u.collectible
|
|
1968
|
+
), y = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
|
|
1980
1969
|
return {
|
|
1981
|
-
label: isNullOrEmpty(
|
|
1982
|
-
sublabel: `Reward at ${
|
|
1970
|
+
label: isNullOrEmpty(y) ? "NO REWARD" : y,
|
|
1971
|
+
sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
|
|
1983
1972
|
};
|
|
1984
1973
|
}
|
|
1985
|
-
function
|
|
1986
|
-
var
|
|
1974
|
+
function m(u) {
|
|
1975
|
+
var y;
|
|
1987
1976
|
const f = [...l.value];
|
|
1988
|
-
(
|
|
1977
|
+
(y = a.value) == null || y.showSheet(!0, f[u], u);
|
|
1989
1978
|
}
|
|
1990
|
-
function g(
|
|
1979
|
+
function g(u) {
|
|
1991
1980
|
const f = [...l.value];
|
|
1992
|
-
f.splice(
|
|
1981
|
+
f.splice(u, 1), r("update:model-value", f);
|
|
1993
1982
|
}
|
|
1994
|
-
function
|
|
1995
|
-
var
|
|
1996
|
-
(
|
|
1983
|
+
function p() {
|
|
1984
|
+
var u;
|
|
1985
|
+
(u = a.value) == null || u.showSheet(
|
|
1997
1986
|
!0,
|
|
1998
1987
|
{
|
|
1999
1988
|
type: "LOYALTY",
|
|
2000
|
-
collectible:
|
|
1989
|
+
collectible: o.loyaltyRewards.items[0].value,
|
|
2001
1990
|
threshold: null,
|
|
2002
1991
|
validityOption: {
|
|
2003
1992
|
validForDay: 7
|
|
@@ -2010,71 +1999,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2010
1999
|
l.value.length
|
|
2011
2000
|
);
|
|
2012
2001
|
}
|
|
2013
|
-
function d(
|
|
2014
|
-
var f,
|
|
2015
|
-
return
|
|
2016
|
-
((
|
|
2017
|
-
(
|
|
2018
|
-
)) == null ? void 0 :
|
|
2002
|
+
function d(u) {
|
|
2003
|
+
var f, y;
|
|
2004
|
+
return u.type == "VOUCHER" ? (f = u.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
|
|
2005
|
+
((y = o.loyaltyRewards.items.find(
|
|
2006
|
+
(k) => k.value == u.collectible
|
|
2007
|
+
)) == null ? void 0 : y.label) || ""
|
|
2019
2008
|
);
|
|
2020
2009
|
}
|
|
2021
|
-
return (
|
|
2022
|
-
const
|
|
2010
|
+
return (u, f) => {
|
|
2011
|
+
const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2023
2012
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2024
|
-
|
|
2025
|
-
createVNode(
|
|
2013
|
+
_hoisted_2$3,
|
|
2014
|
+
createVNode(y, {
|
|
2026
2015
|
label: "Add Reward",
|
|
2027
|
-
onClick: f[0] || (f[0] = (
|
|
2016
|
+
onClick: f[0] || (f[0] = (b) => p()),
|
|
2028
2017
|
variant: "plain",
|
|
2029
2018
|
icon: "add"
|
|
2030
2019
|
}),
|
|
2031
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (
|
|
2032
|
-
key:
|
|
2020
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (b, x) => (openBlock(), createBlock(k, {
|
|
2021
|
+
key: x,
|
|
2033
2022
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2034
2023
|
variant: "outlined",
|
|
2035
|
-
onClick: (
|
|
2024
|
+
onClick: (E) => m(x)
|
|
2036
2025
|
}, {
|
|
2037
2026
|
default: withCtx(() => [
|
|
2038
2027
|
createElementVNode("div", null, [
|
|
2039
|
-
createElementVNode("div",
|
|
2040
|
-
createElementVNode("div",
|
|
2028
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
|
|
2029
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
|
|
2041
2030
|
]),
|
|
2042
|
-
createVNode(
|
|
2031
|
+
createVNode(y, {
|
|
2043
2032
|
icon: "delete",
|
|
2044
2033
|
variant: "tertiary",
|
|
2045
|
-
onClick: (
|
|
2034
|
+
onClick: (E) => (E.stopPropagation(), g(x))
|
|
2046
2035
|
}, null, 8, ["onClick"])
|
|
2047
2036
|
]),
|
|
2048
2037
|
_: 2
|
|
2049
2038
|
}, 1032, ["onClick"]))), 128)),
|
|
2050
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2051
|
-
key:
|
|
2052
|
-
text:
|
|
2039
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(C, {
|
|
2040
|
+
key: b.message,
|
|
2041
|
+
text: b.message,
|
|
2053
2042
|
state: "error"
|
|
2054
2043
|
}, null, 8, ["text"]))), 128)),
|
|
2055
|
-
|
|
2056
|
-
(openBlock(), createBlock(
|
|
2044
|
+
_hoisted_5$2,
|
|
2045
|
+
(openBlock(), createBlock(k, {
|
|
2057
2046
|
key: 0,
|
|
2058
2047
|
variant: "outlined",
|
|
2059
2048
|
class: "p-24 space-y-16 w-fit"
|
|
2060
2049
|
}, {
|
|
2061
2050
|
default: withCtx(() => {
|
|
2062
|
-
var
|
|
2051
|
+
var b, x;
|
|
2063
2052
|
return [
|
|
2064
|
-
createElementVNode("div",
|
|
2053
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
2065
2054
|
createElementVNode("div", null, [
|
|
2066
|
-
createElementVNode("div",
|
|
2067
|
-
|
|
2055
|
+
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((b = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : b.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? d(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2056
|
+
_hoisted_8$2
|
|
2068
2057
|
])
|
|
2069
2058
|
]),
|
|
2070
|
-
createElementVNode("div",
|
|
2059
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
2071
2060
|
createVNode(_sfc_main$5, {
|
|
2072
2061
|
type: e.mission.type,
|
|
2073
2062
|
"max-range": e.mission.end,
|
|
2074
2063
|
currentRange: e.mission.end / 4,
|
|
2075
|
-
markers: e.modelValue.map((
|
|
2064
|
+
markers: e.modelValue.map((E) => E.threshold)
|
|
2076
2065
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2077
|
-
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div",
|
|
2066
|
+
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2078
2067
|
])
|
|
2079
2068
|
];
|
|
2080
2069
|
}),
|
|
@@ -2082,24 +2071,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2082
2071
|
})),
|
|
2083
2072
|
createVNode(_sfc_main$6, {
|
|
2084
2073
|
ref_key: "sheetRef",
|
|
2085
|
-
ref:
|
|
2086
|
-
"onUpdate:modelValue":
|
|
2074
|
+
ref: a,
|
|
2075
|
+
"onUpdate:modelValue": c,
|
|
2087
2076
|
"max-threshold": e.mission.end
|
|
2088
2077
|
}, null, 8, ["max-threshold"])
|
|
2089
2078
|
]);
|
|
2090
2079
|
};
|
|
2091
2080
|
}
|
|
2092
|
-
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" },
|
|
2081
|
+
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1), _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1), _hoisted_10$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2093
2082
|
__name: "MissionInput",
|
|
2094
2083
|
props: {
|
|
2095
2084
|
modelValue: Object
|
|
2096
2085
|
},
|
|
2097
2086
|
emits: ["update:model-value"],
|
|
2098
|
-
setup(e, { emit:
|
|
2099
|
-
const
|
|
2100
|
-
const l = FdoMission.safeParse(
|
|
2087
|
+
setup(e, { emit: i }) {
|
|
2088
|
+
const n = e, r = computed(() => {
|
|
2089
|
+
const l = FdoMission.safeParse(n.modelValue);
|
|
2101
2090
|
return l.success ? [] : l.error.errors;
|
|
2102
|
-
}),
|
|
2091
|
+
}), o = computed(() => [
|
|
2103
2092
|
{
|
|
2104
2093
|
label: "Stamp",
|
|
2105
2094
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -2110,59 +2099,59 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2110
2099
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
2111
2100
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2112
2101
|
}
|
|
2113
|
-
]),
|
|
2114
|
-
return (l,
|
|
2115
|
-
var
|
|
2116
|
-
const
|
|
2102
|
+
]), s = i;
|
|
2103
|
+
return (l, t) => {
|
|
2104
|
+
var v;
|
|
2105
|
+
const a = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
|
|
2117
2106
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2118
2107
|
createElementVNode("div", _hoisted_2$2, [
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
createElementVNode("div",
|
|
2122
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2123
|
-
var g,
|
|
2124
|
-
return openBlock(), createBlock(
|
|
2108
|
+
_hoisted_3$2,
|
|
2109
|
+
_hoisted_4$2,
|
|
2110
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
2111
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
|
|
2112
|
+
var g, p;
|
|
2113
|
+
return openBlock(), createBlock(a, {
|
|
2125
2114
|
variant: "outlined",
|
|
2126
2115
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2127
|
-
"col-span-2": unref(
|
|
2128
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) ==
|
|
2129
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2116
|
+
"col-span-2": unref(o).length == 1,
|
|
2117
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == m.value,
|
|
2118
|
+
"hover:bg-fm-color-opacity-sm": ((p = e.modelValue) == null ? void 0 : p.type) != m.value
|
|
2130
2119
|
}]),
|
|
2131
2120
|
onClick: () => {
|
|
2132
|
-
var d,
|
|
2133
|
-
((d = e.modelValue) == null ? void 0 : d.type) !=
|
|
2121
|
+
var d, u;
|
|
2122
|
+
((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
|
|
2134
2123
|
...e.modelValue,
|
|
2135
|
-
type:
|
|
2136
|
-
end: ((
|
|
2124
|
+
type: m.value,
|
|
2125
|
+
end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
|
|
2137
2126
|
});
|
|
2138
2127
|
},
|
|
2139
|
-
key:
|
|
2128
|
+
key: m.value
|
|
2140
2129
|
}, {
|
|
2141
2130
|
default: withCtx(() => [
|
|
2142
|
-
createElementVNode("div",
|
|
2143
|
-
createElementVNode("div",
|
|
2131
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
|
|
2132
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
|
|
2144
2133
|
]),
|
|
2145
2134
|
_: 2
|
|
2146
2135
|
}, 1032, ["class", "onClick"]);
|
|
2147
2136
|
}), 128))
|
|
2148
2137
|
])
|
|
2149
2138
|
]),
|
|
2150
|
-
createElementVNode("div",
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
createVNode(
|
|
2139
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
2140
|
+
_hoisted_9$1,
|
|
2141
|
+
_hoisted_10$1,
|
|
2142
|
+
createVNode(c, {
|
|
2154
2143
|
label: "Maximum to collect",
|
|
2155
|
-
"model-value": ((
|
|
2156
|
-
"onUpdate:modelValue":
|
|
2144
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2145
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
2157
2146
|
var g;
|
|
2158
|
-
return
|
|
2147
|
+
return s("update:model-value", {
|
|
2159
2148
|
...e.modelValue,
|
|
2160
2149
|
type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
|
|
2161
|
-
end:
|
|
2150
|
+
end: m
|
|
2162
2151
|
});
|
|
2163
2152
|
}),
|
|
2164
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
2165
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2153
|
+
"helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
|
|
2154
|
+
"helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
|
|
2166
2155
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
2167
2156
|
])
|
|
2168
2157
|
]);
|
|
@@ -2190,205 +2179,204 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2190
2179
|
}
|
|
2191
2180
|
},
|
|
2192
2181
|
emits: ["update:model-value", "update:file"],
|
|
2193
|
-
setup(e, { emit:
|
|
2194
|
-
const
|
|
2195
|
-
function
|
|
2196
|
-
switch (
|
|
2182
|
+
setup(e, { emit: i }) {
|
|
2183
|
+
const n = e, r = i;
|
|
2184
|
+
function o(a) {
|
|
2185
|
+
switch (n.field.type) {
|
|
2197
2186
|
case "timeframe":
|
|
2198
|
-
const
|
|
2199
|
-
|
|
2187
|
+
const c = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
|
|
2188
|
+
r("update:model-value", {
|
|
2200
2189
|
type: "timeframe",
|
|
2201
2190
|
property: "__now",
|
|
2202
|
-
start:
|
|
2203
|
-
end:
|
|
2191
|
+
start: c,
|
|
2192
|
+
end: v
|
|
2204
2193
|
});
|
|
2205
2194
|
break;
|
|
2206
2195
|
case "image": {
|
|
2207
|
-
|
|
2196
|
+
r(
|
|
2208
2197
|
"update:file",
|
|
2209
|
-
|
|
2210
|
-
|
|
2198
|
+
a,
|
|
2199
|
+
s.value || firebaseStorage.collectibleImagePath(void 0, a)
|
|
2211
2200
|
);
|
|
2212
2201
|
break;
|
|
2213
2202
|
}
|
|
2214
2203
|
default:
|
|
2215
|
-
|
|
2204
|
+
r("update:model-value", a);
|
|
2216
2205
|
break;
|
|
2217
2206
|
}
|
|
2218
2207
|
}
|
|
2219
|
-
const
|
|
2220
|
-
switch (
|
|
2208
|
+
const s = computed(() => {
|
|
2209
|
+
switch (n.field.type) {
|
|
2221
2210
|
case "timeframe": {
|
|
2222
|
-
const
|
|
2211
|
+
const a = n.modelValue;
|
|
2223
2212
|
return {
|
|
2224
|
-
startDate:
|
|
2225
|
-
endDate:
|
|
2213
|
+
startDate: a != null && a.start ? hooks(a == null ? void 0 : a.start).format("YYYY-MM-DD") : null,
|
|
2214
|
+
endDate: a != null && a.end ? hooks(a == null ? void 0 : a.end).format("YYYY-MM-DD") : null
|
|
2226
2215
|
};
|
|
2227
2216
|
}
|
|
2228
2217
|
default:
|
|
2229
|
-
return
|
|
2218
|
+
return n.modelValue;
|
|
2230
2219
|
}
|
|
2231
2220
|
});
|
|
2232
|
-
function
|
|
2233
|
-
if (!
|
|
2234
|
-
const
|
|
2235
|
-
return
|
|
2221
|
+
function l() {
|
|
2222
|
+
if (!t.value.schema) return [];
|
|
2223
|
+
const a = t.value.schema.safeParse(n.modelValue);
|
|
2224
|
+
return a.success ? [] : a.error.errors;
|
|
2236
2225
|
}
|
|
2237
|
-
const
|
|
2238
|
-
schema:
|
|
2239
|
-
unwrapped:
|
|
2240
|
-
rules:
|
|
2241
|
-
labelMark:
|
|
2242
|
-
zodLabel:
|
|
2226
|
+
const t = computed(() => ({
|
|
2227
|
+
schema: n.schema,
|
|
2228
|
+
unwrapped: n.schema ? ZodHelper.unwrap(n.schema) : void 0,
|
|
2229
|
+
rules: n.schema ? [ZodHelper.ruleAtPath(n.schema, "")] : void 0,
|
|
2230
|
+
labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
|
|
2231
|
+
zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
|
|
2243
2232
|
}));
|
|
2244
|
-
return (
|
|
2245
|
-
var
|
|
2246
|
-
const
|
|
2247
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
2233
|
+
return (a, c) => {
|
|
2234
|
+
var u, f, y, k, C;
|
|
2235
|
+
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2236
|
+
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
2248
2237
|
key: 0,
|
|
2249
|
-
label:
|
|
2250
|
-
"label-mark": unref(
|
|
2251
|
-
rules: unref(
|
|
2252
|
-
"model-value": unref(
|
|
2253
|
-
"onUpdate:modelValue":
|
|
2238
|
+
label: e.field.label,
|
|
2239
|
+
"label-mark": unref(t).labelMark,
|
|
2240
|
+
rules: unref(t).rules,
|
|
2241
|
+
"model-value": unref(s),
|
|
2242
|
+
"onUpdate:modelValue": o,
|
|
2254
2243
|
"helper-state": e.helperText ? "error" : void 0,
|
|
2255
2244
|
"helper-text": e.helperText
|
|
2256
2245
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2257
2246
|
createVNode(JsonViewer, {
|
|
2258
|
-
json: { schema: unref(
|
|
2247
|
+
json: { schema: unref(t).unwrapped, props: n }
|
|
2259
2248
|
}, null, 8, ["json"]),
|
|
2260
|
-
createVNode(
|
|
2261
|
-
label:
|
|
2262
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
2263
|
-
"model-value": unref(
|
|
2264
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
2265
|
-
"onUpdate:modelValue":
|
|
2249
|
+
createVNode(m, {
|
|
2250
|
+
label: e.field.label,
|
|
2251
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
|
|
2252
|
+
"model-value": unref(s),
|
|
2253
|
+
rules: e.field.isRuleChildren ? [] : unref(t).rules,
|
|
2254
|
+
"onUpdate:modelValue": o,
|
|
2266
2255
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2267
2256
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2268
2257
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2269
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
2258
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
|
|
2270
2259
|
key: 2,
|
|
2271
|
-
label:
|
|
2272
|
-
"label-mark": unref(
|
|
2273
|
-
rules: unref(
|
|
2274
|
-
"model-value": unref(
|
|
2275
|
-
"onUpdate:modelValue":
|
|
2260
|
+
label: e.field.label,
|
|
2261
|
+
"label-mark": unref(t).labelMark,
|
|
2262
|
+
rules: unref(t).rules,
|
|
2263
|
+
"model-value": unref(s),
|
|
2264
|
+
"onUpdate:modelValue": o,
|
|
2276
2265
|
"show-word-count": "",
|
|
2277
|
-
"max-length": (
|
|
2266
|
+
"max-length": (C = (k = (y = (f = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : f._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
|
|
2278
2267
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2279
2268
|
key: 3,
|
|
2280
2269
|
"campaign-type": e.extras,
|
|
2281
|
-
"model-value": unref(
|
|
2270
|
+
"model-value": unref(s),
|
|
2282
2271
|
disabled: e.disabled,
|
|
2283
|
-
"onUpdate:modelValue":
|
|
2272
|
+
"onUpdate:modelValue": o
|
|
2284
2273
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2285
2274
|
createVNode(_sfc_main$h, {
|
|
2286
|
-
"model-value": unref(
|
|
2287
|
-
"onUpdate:modelValue":
|
|
2275
|
+
"model-value": unref(s),
|
|
2276
|
+
"onUpdate:modelValue": o
|
|
2288
2277
|
}, null, 8, ["model-value"]),
|
|
2289
|
-
createVNode(
|
|
2278
|
+
createVNode(p, {
|
|
2290
2279
|
class: "!mt-[8px]",
|
|
2291
|
-
text: unref(ZodHelper).helperText(
|
|
2292
|
-
state: unref(ZodHelper).helperState(
|
|
2280
|
+
text: unref(ZodHelper).helperText(l(), ""),
|
|
2281
|
+
state: unref(ZodHelper).helperState(l(), "")
|
|
2293
2282
|
}, null, 8, ["text", "state"])
|
|
2294
2283
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
2295
2284
|
key: 5,
|
|
2296
|
-
thumbnail: unref(
|
|
2285
|
+
thumbnail: unref(s),
|
|
2297
2286
|
"aspect-ratio": "16 / 9",
|
|
2298
2287
|
class: "w-1/2 xs:w-2/3",
|
|
2299
|
-
"onUpdate:file":
|
|
2288
|
+
"onUpdate:file": o
|
|
2300
2289
|
}, {
|
|
2301
2290
|
label: withCtx(() => [
|
|
2302
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
2291
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
|
|
2303
2292
|
]),
|
|
2304
2293
|
_: 1
|
|
2305
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2294
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2306
2295
|
key: 6,
|
|
2307
|
-
label:
|
|
2296
|
+
label: e.field.label,
|
|
2308
2297
|
"label-placement": "right",
|
|
2309
2298
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2310
|
-
"label-mark": unref(
|
|
2311
|
-
rules: unref(
|
|
2312
|
-
"model-value": unref(
|
|
2313
|
-
"onUpdate:modelValue":
|
|
2299
|
+
"label-mark": unref(t).labelMark,
|
|
2300
|
+
rules: unref(t).rules,
|
|
2301
|
+
"model-value": unref(s),
|
|
2302
|
+
"onUpdate:modelValue": o
|
|
2314
2303
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2315
2304
|
key: 7,
|
|
2316
|
-
"model-value": unref(
|
|
2317
|
-
"onUpdate:modelValue":
|
|
2305
|
+
"model-value": unref(s),
|
|
2306
|
+
"onUpdate:modelValue": o,
|
|
2318
2307
|
"no-campaign": !1,
|
|
2319
|
-
schema: unref(
|
|
2308
|
+
schema: unref(t).schema,
|
|
2320
2309
|
"is-mission": e.extras === "MISSION"
|
|
2321
2310
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2322
2311
|
key: 8,
|
|
2323
|
-
"model-value": unref(
|
|
2324
|
-
"onUpdate:modelValue":
|
|
2312
|
+
"model-value": unref(s),
|
|
2313
|
+
"onUpdate:modelValue": o
|
|
2325
2314
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
2326
2315
|
createVNode(_sfc_main$w, {
|
|
2327
|
-
"model-value": unref(
|
|
2328
|
-
"onUpdate:modelValue":
|
|
2316
|
+
"model-value": unref(s),
|
|
2317
|
+
"onUpdate:modelValue": o,
|
|
2329
2318
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2330
2319
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2331
|
-
unref(
|
|
2320
|
+
unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
2332
2321
|
key: 0,
|
|
2333
2322
|
class: "!mt-[8px]",
|
|
2334
|
-
text:
|
|
2323
|
+
text: "Effect is required",
|
|
2335
2324
|
state: "error"
|
|
2336
|
-
}
|
|
2325
|
+
}))
|
|
2337
2326
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
2338
2327
|
key: 10,
|
|
2339
|
-
"
|
|
2340
|
-
"
|
|
2341
|
-
"
|
|
2342
|
-
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
2328
|
+
"model-value": unref(s),
|
|
2329
|
+
"onUpdate:modelValue": o,
|
|
2330
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2343
2331
|
"trigger-type": e.field.extras,
|
|
2344
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2332
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2345
2333
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2346
2334
|
key: 11,
|
|
2347
|
-
"model-value": unref(
|
|
2348
|
-
"onUpdate:modelValue":
|
|
2335
|
+
"model-value": unref(s),
|
|
2336
|
+
"onUpdate:modelValue": o,
|
|
2349
2337
|
extras: e.extras,
|
|
2350
2338
|
"error-text": e.helperText
|
|
2351
2339
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
|
|
2352
2340
|
key: 12,
|
|
2353
2341
|
type: "custom",
|
|
2354
|
-
"model-value": unref(
|
|
2355
|
-
"onUpdate:modelValue":
|
|
2356
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
2342
|
+
"model-value": unref(s),
|
|
2343
|
+
"onUpdate:modelValue": o,
|
|
2344
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
|
|
2357
2345
|
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
|
|
2358
2346
|
key: 13,
|
|
2359
|
-
"model-value": unref(
|
|
2360
|
-
"onUpdate:modelValue":
|
|
2347
|
+
"model-value": unref(s),
|
|
2348
|
+
"onUpdate:modelValue": o
|
|
2361
2349
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
2362
2350
|
key: 14,
|
|
2363
|
-
"model-value": unref(
|
|
2364
|
-
"onUpdate:modelValue":
|
|
2351
|
+
"model-value": unref(s),
|
|
2352
|
+
"onUpdate:modelValue": o
|
|
2365
2353
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
2366
2354
|
key: 15,
|
|
2367
|
-
"model-value": unref(
|
|
2368
|
-
"onUpdate:modelValue":
|
|
2355
|
+
"model-value": unref(s),
|
|
2356
|
+
"onUpdate:modelValue": o
|
|
2369
2357
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2370
2358
|
key: 16,
|
|
2371
|
-
"model-value": unref(
|
|
2372
|
-
"onUpdate:modelValue":
|
|
2359
|
+
"model-value": unref(s),
|
|
2360
|
+
"onUpdate:modelValue": o
|
|
2373
2361
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2374
2362
|
key: 17,
|
|
2375
|
-
"model-value": unref(
|
|
2376
|
-
"onUpdate:modelValue":
|
|
2377
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2378
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2363
|
+
"model-value": unref(s),
|
|
2364
|
+
"onUpdate:modelValue": o,
|
|
2365
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2366
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2379
2367
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2380
2368
|
key: 18,
|
|
2381
|
-
"model-value": unref(
|
|
2382
|
-
"onUpdate:modelValue":
|
|
2369
|
+
"model-value": unref(s),
|
|
2370
|
+
"onUpdate:modelValue": o,
|
|
2383
2371
|
mission: e.extras.mission
|
|
2384
2372
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
2385
2373
|
createVNode(_sfc_main$g, {
|
|
2386
|
-
"model-value": unref(
|
|
2387
|
-
"onUpdate:modelValue":
|
|
2374
|
+
"model-value": unref(s),
|
|
2375
|
+
"onUpdate:modelValue": o,
|
|
2388
2376
|
"start-date": e.extras.start,
|
|
2389
2377
|
"end-date": e.extras.end
|
|
2390
2378
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2391
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2379
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2392
2380
|
key: 0,
|
|
2393
2381
|
class: "!mt-[8px]",
|
|
2394
2382
|
text: e.helperText,
|
|
@@ -2396,26 +2384,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2396
2384
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2397
2385
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
2398
2386
|
createVNode(_sfc_main$o, {
|
|
2399
|
-
"model-value": unref(
|
|
2400
|
-
"onUpdate:modelValue":
|
|
2387
|
+
"model-value": unref(s),
|
|
2388
|
+
"onUpdate:modelValue": o
|
|
2401
2389
|
}, null, 8, ["model-value"]),
|
|
2402
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2390
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2403
2391
|
key: 0,
|
|
2404
2392
|
class: "!mt-[8px]",
|
|
2405
2393
|
text: e.helperText,
|
|
2406
2394
|
state: "error"
|
|
2407
2395
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2408
2396
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2409
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(
|
|
2397
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
|
|
2410
2398
|
key: 0,
|
|
2411
2399
|
state: "warning",
|
|
2412
2400
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2413
2401
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2414
2402
|
createVNode(_sfc_main$n, {
|
|
2415
|
-
"model-value": unref(
|
|
2416
|
-
"onUpdate:modelValue":
|
|
2403
|
+
"model-value": unref(s),
|
|
2404
|
+
"onUpdate:modelValue": o
|
|
2417
2405
|
}, null, 8, ["model-value"]),
|
|
2418
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2406
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2419
2407
|
key: 1,
|
|
2420
2408
|
class: "!mt-[8px]",
|
|
2421
2409
|
text: e.helperText,
|
|
@@ -2423,10 +2411,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2423
2411
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2424
2412
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
2425
2413
|
createVNode(_sfc_main$m, {
|
|
2426
|
-
"model-value": unref(
|
|
2427
|
-
"onUpdate:modelValue":
|
|
2414
|
+
"model-value": unref(s),
|
|
2415
|
+
"onUpdate:modelValue": o
|
|
2428
2416
|
}, null, 8, ["model-value"]),
|
|
2429
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2417
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2430
2418
|
key: 0,
|
|
2431
2419
|
class: "!mt-[8px]",
|
|
2432
2420
|
text: e.helperText,
|
|
@@ -2434,10 +2422,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2434
2422
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2435
2423
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
2436
2424
|
createVNode(_sfc_main$k, {
|
|
2437
|
-
"model-value": unref(
|
|
2438
|
-
"onUpdate:modelValue":
|
|
2425
|
+
"model-value": unref(s),
|
|
2426
|
+
"onUpdate:modelValue": o
|
|
2439
2427
|
}, null, 8, ["model-value"]),
|
|
2440
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2428
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2441
2429
|
key: 0,
|
|
2442
2430
|
class: "!mt-[8px]",
|
|
2443
2431
|
text: e.helperText,
|
|
@@ -2445,10 +2433,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2445
2433
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2446
2434
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
2447
2435
|
createVNode(_sfc_main$l, {
|
|
2448
|
-
"model-value": unref(
|
|
2449
|
-
"onUpdate:modelValue":
|
|
2436
|
+
"model-value": unref(s),
|
|
2437
|
+
"onUpdate:modelValue": o
|
|
2450
2438
|
}, null, 8, ["model-value"]),
|
|
2451
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2439
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2452
2440
|
key: 0,
|
|
2453
2441
|
class: "!mt-[8px]",
|
|
2454
2442
|
text: e.helperText,
|
|
@@ -2456,19 +2444,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2456
2444
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2457
2445
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
2458
2446
|
createVNode(_sfc_main$9, {
|
|
2459
|
-
"model-value": unref(
|
|
2460
|
-
"onUpdate:modelValue":
|
|
2447
|
+
"model-value": unref(s),
|
|
2448
|
+
"onUpdate:modelValue": o
|
|
2461
2449
|
}, null, 8, ["model-value"]),
|
|
2462
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2450
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2463
2451
|
key: 0,
|
|
2464
2452
|
class: "!mt-[8px]",
|
|
2465
2453
|
text: e.helperText,
|
|
2466
2454
|
state: "error"
|
|
2467
2455
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2468
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
2456
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(n.field), 1));
|
|
2469
2457
|
};
|
|
2470
2458
|
}
|
|
2471
|
-
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" },
|
|
2459
|
+
}), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2472
2460
|
__name: "CampaignSummary",
|
|
2473
2461
|
props: {
|
|
2474
2462
|
data: {
|
|
@@ -2477,23 +2465,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2477
2465
|
}
|
|
2478
2466
|
},
|
|
2479
2467
|
setup(e) {
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
return openBlock(), createBlock(i, {
|
|
2468
|
+
return (i, n) => {
|
|
2469
|
+
const r = resolveComponent("FmCard");
|
|
2470
|
+
return openBlock(), createBlock(r, {
|
|
2484
2471
|
variant: "outlined",
|
|
2485
2472
|
class: "p-16 space-y-8"
|
|
2486
2473
|
}, {
|
|
2487
2474
|
default: withCtx(() => [
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
2475
|
+
_hoisted_1$1,
|
|
2476
|
+
_hoisted_2$1,
|
|
2477
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, s) => (openBlock(), createElementBlock("div", {
|
|
2491
2478
|
class: "space-y-4",
|
|
2492
|
-
key:
|
|
2479
|
+
key: s
|
|
2493
2480
|
}, [
|
|
2494
|
-
|
|
2495
|
-
createElementVNode("div",
|
|
2496
|
-
createElementVNode("div",
|
|
2481
|
+
o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2482
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
|
|
2483
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(o), 1)
|
|
2497
2484
|
], 64)) : createCommentVNode("", !0)
|
|
2498
2485
|
]))), 128))
|
|
2499
2486
|
]),
|
|
@@ -2504,47 +2491,62 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2504
2491
|
}), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
|
|
2505
2492
|
key: 0,
|
|
2506
2493
|
class: "max-w-6xl mx-auto"
|
|
2507
|
-
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" },
|
|
2494
|
+
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
2495
|
+
/* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
2496
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2497
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2498
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2499
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2500
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2501
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2502
|
+
]),
|
|
2503
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2504
|
+
]),
|
|
2505
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2506
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2507
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2508
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2509
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2510
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2511
|
+
]),
|
|
2512
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2513
|
+
])
|
|
2514
|
+
])
|
|
2515
|
+
], -1), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2508
2516
|
__name: "EditCampaignSheet",
|
|
2509
2517
|
emits: ["submit:model-value"],
|
|
2510
2518
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2511
|
-
const Dialog = useDialog(), sheetVisible = ref(!1),
|
|
2519
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
2512
2520
|
TEMPLATES.VOUCHER
|
|
2513
2521
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
2514
2522
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2515
|
-
var e,
|
|
2523
|
+
var e, i;
|
|
2516
2524
|
if (sheetVisible.value = visible, visible == !0) {
|
|
2517
2525
|
try {
|
|
2518
2526
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2519
2527
|
} catch {
|
|
2520
2528
|
} finally {
|
|
2521
|
-
await new Promise((
|
|
2529
|
+
await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
|
|
2522
2530
|
}
|
|
2523
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2524
|
-
|
|
2525
|
-
(
|
|
2526
|
-
) &&
|
|
2531
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((n, r) => {
|
|
2532
|
+
n.campaign.type === "VOUCHER" && n.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
2533
|
+
(o) => o.code === n.campaign.code && o._id.toString() !== n.campaign._id.toString()
|
|
2534
|
+
) && r.addIssue({
|
|
2527
2535
|
code: "custom",
|
|
2528
2536
|
message: "Code already exists, please use another code",
|
|
2529
2537
|
path: ["campaign", "code"]
|
|
2530
2538
|
});
|
|
2531
2539
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2532
|
-
...(
|
|
2540
|
+
...(i = template.value) == null ? void 0 : i.defaultValue
|
|
2533
2541
|
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
|
|
2534
2542
|
}
|
|
2535
2543
|
}
|
|
2536
2544
|
async function hideSheet() {
|
|
2537
2545
|
Dialog.open({
|
|
2538
|
-
title:
|
|
2539
|
-
message:
|
|
2540
|
-
primaryActions: {
|
|
2541
|
-
|
|
2542
|
-
close: !0
|
|
2543
|
-
},
|
|
2544
|
-
secondaryActions: {
|
|
2545
|
-
text: t("connect.campaign.common.unsaved_changes_cancel"),
|
|
2546
|
-
close: !1
|
|
2547
|
-
}
|
|
2546
|
+
title: "Unsaved Changes",
|
|
2547
|
+
message: "Are you sure you want to discard this changes?",
|
|
2548
|
+
primaryActions: { text: "Discard", close: !0 },
|
|
2549
|
+
secondaryActions: { text: "Cancel", close: !1 }
|
|
2548
2550
|
}).onPrimary(() => {
|
|
2549
2551
|
sheetVisible.value = !1;
|
|
2550
2552
|
}).onSecondary(() => {
|
|
@@ -2556,10 +2558,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2556
2558
|
return e.success ? [] : e.error.errors;
|
|
2557
2559
|
});
|
|
2558
2560
|
function stepErrors(e = currentStep.value - 1) {
|
|
2559
|
-
const
|
|
2560
|
-
(
|
|
2561
|
+
const i = template.value.steps[e].groups.flatMap(
|
|
2562
|
+
(n) => n.fields.map((r) => r.property)
|
|
2561
2563
|
);
|
|
2562
|
-
return errors.value.filter((
|
|
2564
|
+
return errors.value.filter((n) => i.includes(n.path.join(".")));
|
|
2563
2565
|
}
|
|
2564
2566
|
__expose({ showSheet });
|
|
2565
2567
|
function showSummaryDialog() {
|
|
@@ -2571,9 +2573,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2571
2573
|
}
|
|
2572
2574
|
});
|
|
2573
2575
|
}
|
|
2574
|
-
function onUpdateProperty(e,
|
|
2575
|
-
if (_.set(data.value, e,
|
|
2576
|
-
const
|
|
2576
|
+
function onUpdateProperty(e, i) {
|
|
2577
|
+
if (_.set(data.value, e, i), e == "campaign.event.type") {
|
|
2578
|
+
const n = RuleBuilder.setRuleToGroup(
|
|
2577
2579
|
RuleBuilder.scaffoldGroup(),
|
|
2578
2580
|
[
|
|
2579
2581
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
@@ -2581,7 +2583,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2581
2583
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
2582
2584
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
2583
2585
|
]
|
|
2584
|
-
),
|
|
2586
|
+
), r = RuleBuilder.setRuleToGroup(
|
|
2585
2587
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2586
2588
|
[
|
|
2587
2589
|
RuleBuilder.constructEntry(
|
|
@@ -2593,29 +2595,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2593
2595
|
],
|
|
2594
2596
|
"&&"
|
|
2595
2597
|
);
|
|
2596
|
-
if (
|
|
2597
|
-
_.set(data.value, "campaign.event.rule",
|
|
2598
|
+
if (i != "SCHEDULE") {
|
|
2599
|
+
_.set(data.value, "campaign.event.rule", n);
|
|
2598
2600
|
return;
|
|
2599
2601
|
}
|
|
2600
2602
|
_.set(
|
|
2601
2603
|
data.value,
|
|
2602
2604
|
"campaign.event.rule",
|
|
2603
|
-
RuleBuilder.setRuleToGroup(
|
|
2605
|
+
RuleBuilder.setRuleToGroup(n, r)
|
|
2604
2606
|
);
|
|
2605
2607
|
}
|
|
2606
|
-
e == "campaign.notify" &&
|
|
2608
|
+
e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
2607
2609
|
}
|
|
2608
|
-
async function onUpdateFile(e,
|
|
2609
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
2610
|
+
async function onUpdateFile(e, i) {
|
|
2611
|
+
return e ? await minor(async () => firebaseStorage.update(i, e), {
|
|
2610
2612
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2611
2613
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2612
2614
|
}) : "";
|
|
2613
2615
|
}
|
|
2614
2616
|
function isDisable(e) {
|
|
2615
|
-
var
|
|
2617
|
+
var i, n;
|
|
2616
2618
|
switch (e == null ? void 0 : e.property) {
|
|
2617
2619
|
case "campaign.event.type":
|
|
2618
|
-
return ((
|
|
2620
|
+
return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
|
|
2619
2621
|
default:
|
|
2620
2622
|
return !1;
|
|
2621
2623
|
}
|
|
@@ -2624,30 +2626,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2624
2626
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2625
2627
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2626
2628
|
}
|
|
2627
|
-
return (e,
|
|
2628
|
-
const
|
|
2629
|
+
return (e, i) => {
|
|
2630
|
+
const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2629
2631
|
return openBlock(), createBlock(l, {
|
|
2630
2632
|
"fullscreen-size": "lg",
|
|
2631
2633
|
modelValue: unref(sheetVisible),
|
|
2632
2634
|
"onUpdate:modelValue": [
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
+
i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
|
|
2636
|
+
i[8] || (i[8] = (t) => sheetVisible.value = t)
|
|
2635
2637
|
]
|
|
2636
2638
|
}, createSlots({
|
|
2637
2639
|
"top-sheet-header": withCtx(() => [
|
|
2638
2640
|
createElementVNode("div", _hoisted_1, [
|
|
2639
2641
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2640
2642
|
createElementVNode("div", _hoisted_2, [
|
|
2641
|
-
createVNode(
|
|
2642
|
-
onClick:
|
|
2643
|
-
label:
|
|
2643
|
+
createVNode(n, {
|
|
2644
|
+
onClick: i[0] || (i[0] = (t) => hideSheet()),
|
|
2645
|
+
label: "Cancel",
|
|
2644
2646
|
variant: "tertiary"
|
|
2645
|
-
}
|
|
2646
|
-
createVNode(
|
|
2647
|
+
}),
|
|
2648
|
+
createVNode(n, {
|
|
2647
2649
|
onClick: onSubmit,
|
|
2648
|
-
label:
|
|
2650
|
+
label: "Save",
|
|
2649
2651
|
disabled: unref(errors).length > 0
|
|
2650
|
-
}, null, 8, ["
|
|
2652
|
+
}, null, 8, ["disabled"])
|
|
2651
2653
|
])
|
|
2652
2654
|
])
|
|
2653
2655
|
]),
|
|
@@ -2659,29 +2661,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2659
2661
|
createElementVNode("div", _hoisted_9, [
|
|
2660
2662
|
createElementVNode("div", _hoisted_10, [
|
|
2661
2663
|
createElementVNode("div", _hoisted_11, [
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2665
|
-
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2666
|
-
createElementVNode("div", { class: "space-y-3" }, [
|
|
2667
|
-
createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2668
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2669
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2670
|
-
]),
|
|
2671
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2672
|
-
]),
|
|
2673
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2674
|
-
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2675
|
-
createElementVNode("div", { class: "space-y-3" }, [
|
|
2676
|
-
createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2677
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2678
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2679
|
-
]),
|
|
2680
|
-
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2681
|
-
])
|
|
2682
|
-
])
|
|
2683
|
-
], -1)),
|
|
2684
|
-
createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2664
|
+
_hoisted_12,
|
|
2665
|
+
createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2685
2666
|
])
|
|
2686
2667
|
])
|
|
2687
2668
|
])
|
|
@@ -2691,51 +2672,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2691
2672
|
name: "default",
|
|
2692
2673
|
fn: withCtx(() => [
|
|
2693
2674
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2694
|
-
createVNode(
|
|
2675
|
+
createVNode(o, {
|
|
2695
2676
|
modelValue: unref(currentStep),
|
|
2696
|
-
"onUpdate:modelValue":
|
|
2677
|
+
"onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2697
2678
|
orientation: "horizontal",
|
|
2698
2679
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2699
2680
|
}, {
|
|
2700
2681
|
default: withCtx(() => [
|
|
2701
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2702
|
-
key:
|
|
2703
|
-
title:
|
|
2704
|
-
value:
|
|
2705
|
-
error: () => stepErrors(
|
|
2706
|
-
complete: () =>
|
|
2682
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
|
|
2683
|
+
key: t.name,
|
|
2684
|
+
title: t.name,
|
|
2685
|
+
value: a + 1,
|
|
2686
|
+
error: () => stepErrors(a).length > 0,
|
|
2687
|
+
complete: () => a + 1 <= unref(currentStep)
|
|
2707
2688
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
2708
2689
|
]),
|
|
2709
2690
|
_: 1
|
|
2710
2691
|
}, 8, ["modelValue"]),
|
|
2711
2692
|
createElementVNode("div", _hoisted_4, [
|
|
2712
|
-
createVNode(
|
|
2693
|
+
createVNode(n, {
|
|
2713
2694
|
icon: "close",
|
|
2714
2695
|
variant: "tertiary",
|
|
2715
|
-
onClick:
|
|
2696
|
+
onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
|
|
2716
2697
|
}),
|
|
2717
|
-
createVNode(
|
|
2698
|
+
createVNode(o, {
|
|
2718
2699
|
modelValue: unref(currentStep),
|
|
2719
|
-
"onUpdate:modelValue":
|
|
2700
|
+
"onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2720
2701
|
orientation: "horizontal",
|
|
2721
2702
|
class: "flex-1"
|
|
2722
2703
|
}, {
|
|
2723
2704
|
default: withCtx(() => [
|
|
2724
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2725
|
-
key:
|
|
2705
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
|
|
2706
|
+
key: t.name,
|
|
2726
2707
|
title: unref(sheetTitle),
|
|
2727
|
-
description:
|
|
2728
|
-
value:
|
|
2729
|
-
error: () => stepErrors(
|
|
2730
|
-
complete: () =>
|
|
2708
|
+
description: t.name,
|
|
2709
|
+
value: a + 1,
|
|
2710
|
+
error: () => stepErrors(a).length > 0,
|
|
2711
|
+
complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
2731
2712
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
2732
2713
|
]),
|
|
2733
2714
|
_: 1
|
|
2734
2715
|
}, 8, ["modelValue"]),
|
|
2735
|
-
createVNode(
|
|
2716
|
+
createVNode(n, {
|
|
2736
2717
|
icon: "info",
|
|
2737
2718
|
variant: "tertiary",
|
|
2738
|
-
onClick:
|
|
2719
|
+
onClick: i[4] || (i[4] = () => showSummaryDialog())
|
|
2739
2720
|
})
|
|
2740
2721
|
]),
|
|
2741
2722
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -2744,54 +2725,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2744
2725
|
json: {
|
|
2745
2726
|
data: unref(data),
|
|
2746
2727
|
errors: unref(errors).map(
|
|
2747
|
-
(
|
|
2728
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2748
2729
|
),
|
|
2749
2730
|
stepErrors: stepErrors().map(
|
|
2750
|
-
(
|
|
2731
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2751
2732
|
),
|
|
2752
2733
|
schema: unref(schema)
|
|
2753
2734
|
}
|
|
2754
2735
|
}, null, 8, ["json"]),
|
|
2755
2736
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2756
|
-
(
|
|
2757
|
-
), (
|
|
2758
|
-
key:
|
|
2737
|
+
(t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
|
|
2738
|
+
), (t, a) => (openBlock(), createElementBlock("div", {
|
|
2739
|
+
key: a,
|
|
2759
2740
|
class: "space-y-24"
|
|
2760
2741
|
}, [
|
|
2761
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2762
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2742
|
+
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2743
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (c, v) => (openBlock(), createElementBlock("div", { key: v }, [
|
|
2763
2744
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2764
|
-
key:
|
|
2765
|
-
field:
|
|
2766
|
-
modelValue: unref(_).get(unref(data),
|
|
2767
|
-
disabled: isDisable(
|
|
2768
|
-
"onUpdate:modelValue": (
|
|
2769
|
-
"onUpdate:file": async (
|
|
2770
|
-
const
|
|
2771
|
-
onUpdateProperty(
|
|
2745
|
+
key: v,
|
|
2746
|
+
field: c,
|
|
2747
|
+
modelValue: unref(_).get(unref(data), c.property),
|
|
2748
|
+
disabled: isDisable(c),
|
|
2749
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(c.property, m),
|
|
2750
|
+
"onUpdate:file": async (m, g) => {
|
|
2751
|
+
const p = await onUpdateFile(m, g);
|
|
2752
|
+
onUpdateProperty(c.property, p || "");
|
|
2772
2753
|
},
|
|
2773
2754
|
schema: unref(ZodHelper).typeAtPath(
|
|
2774
2755
|
unref(schema),
|
|
2775
|
-
|
|
2756
|
+
c.property,
|
|
2776
2757
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2777
2758
|
),
|
|
2778
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
2779
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2780
|
-
extras:
|
|
2759
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), c.property),
|
|
2760
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
|
|
2761
|
+
extras: c.extras != null ? c.extras == "" ? unref(data) : unref(_).get(unref(data), c.extras) : void 0
|
|
2781
2762
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
2782
2763
|
]))), 128))
|
|
2783
2764
|
]))), 128)),
|
|
2784
2765
|
createElementVNode("div", _hoisted_8, [
|
|
2785
|
-
createVNode(
|
|
2766
|
+
createVNode(n, {
|
|
2786
2767
|
label: "Back",
|
|
2787
2768
|
variant: "tertiary",
|
|
2788
2769
|
disabled: unref(currentStep) == 1,
|
|
2789
|
-
onClick:
|
|
2770
|
+
onClick: i[5] || (i[5] = (t) => currentStep.value--)
|
|
2790
2771
|
}, null, 8, ["disabled"]),
|
|
2791
|
-
createVNode(
|
|
2772
|
+
createVNode(n, {
|
|
2792
2773
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2793
2774
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2794
|
-
onClick:
|
|
2775
|
+
onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2795
2776
|
}, null, 8, ["disabled", "label"])
|
|
2796
2777
|
])
|
|
2797
2778
|
]),
|