@feedmepos/mf-connect 0.1.9-prod → 0.1.11-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-8Ew7y5t9.js → Analytic-Bbt1kP2U.js} +24 -23
- package/dist/{App-3BVNH3r-.js → App-CVA65EVC.js} +56 -51
- package/dist/{Broadcast-CrsPUhLT.js → Broadcast-BJXK8OE5.js} +8 -8
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DE300Y56.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DDEx0cK9.js} +7 -7
- package/dist/Card-DFiUkfYj.js +895 -0
- package/dist/{Collections-djS9hLI8.js → Collections-qVnvveUf.js} +24 -29
- package/dist/{Credit-D4KEvIov.js → Credit-BWHTbAG-.js} +8 -8
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BjM81fmS.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-4_cHlWUJ.js} +648 -1284
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-aEWfdpCg.js → EffectSheet.vue_vue_type_style_index_0_lang-DLgZd4HU.js} +19 -19
- package/dist/{Experience-2FPLO7aV.js → Experience-BmGSus53.js} +8 -8
- package/dist/{Game-e_UjVJgU.js → Game-49w7XN5k.js} +8 -8
- package/dist/Index-D-7hsAaE.js +258 -0
- package/dist/{Marketing-B2hCjZ2r.js → Marketing-DtbJxS_j.js} +5 -5
- package/dist/{Member-D_ykRIBb.js → Member-jZks4pw_.js} +4 -4
- package/dist/{MemberList-LmzzYxEn.js → MemberList-BqO54kPC.js} +193 -189
- package/dist/{MemberTransactions-B2vqlKaP.js → MemberTransactions-CLK7VmPw.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DQ2ubF0N.js → MessageInput.vue_vue_type_script_setup_true_lang-ef2Qrdvd.js} +2 -2
- package/dist/Mission-LGC1CGrB.js +273 -0
- package/dist/Overview-Dm_ycoqZ.js +1078 -0
- package/dist/{Point-DFriwWWY.js → Point-BBNJ9cc5.js} +8 -8
- package/dist/{Promotion-Db3IEs2F.js → Promotion-DFh9IEmP.js} +9 -9
- package/dist/Record-oBmJTn3G.js +338 -0
- package/dist/Reward-DR_HzrrM.js +441 -0
- package/dist/RewardGroup.vue_vue_type_script_setup_true_lang-Du_0o2b9.js +150 -0
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-CxXugphA.js +1638 -0
- package/dist/{Segment-CE8q9JV2.js → Segment-DjyHLWZC.js} +13 -13
- package/dist/SelectItems.vue_vue_type_script_setup_true_lang-stTwgie4.js +181 -0
- package/dist/{Setting-Vcz1S27V.js → Setting-a7Tw-3ht.js} +31 -31
- package/dist/Store-HWGWswEm.js +1744 -0
- package/dist/{StoreRewards-Dt30AkWo.js → StoreRewards-s4cX1bFH.js} +12 -12
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Dq4qIXZu.js +1132 -0
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-f59onlgt.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BQpbScyf.js} +1 -1
- package/dist/{Tier-a6yXEtLd.js → Tier-C7kiLjzE.js} +19 -19
- package/dist/{Title-A3-2EI0w.js → Title-BPv1ZiHg.js} +19 -19
- package/dist/{Transaction-DswABr2P.js → Transaction-HdR7RiGY.js} +2 -2
- package/dist/UserRuleGroup.vue_vue_type_script_setup_true_lang-D3VgIQb-.js +130 -0
- package/dist/{Voucher-DEoVgZYa.js → Voucher-Y5Lh5xms.js} +11 -11
- package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-CFKID7mS.js +419 -0
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-ccc1vxjS.js → ZodTextField.vue_vue_type_script_setup_true_lang-6asSbt53.js} +1 -1
- package/dist/{app-C23GfQGq.js → app-Bh2mviM1.js} +1 -1
- package/dist/{app-C66C2KLW.js → app-MbHo43vs.js} +982 -698
- package/dist/app.js +1 -1
- package/dist/{business-DNAVZOSH.js → business-DMzeDNMd.js} +1 -1
- package/dist/{campaign-Cv0HaUD1.js → campaign-2swZVVbi.js} +2 -2
- package/dist/campaign.enum-CHI6p9lH.js +20 -0
- package/dist/campaign.fn-DNwV5ZWO.js +758 -0
- package/dist/collectible.enum-Y3ALLTcR.js +19 -0
- package/dist/{collection.fn-Dxzr2oPt.js → collection.fn-CfvnmVQa.js} +2 -2
- package/dist/dto-DseG41FR.js +2018 -0
- package/dist/{effect-CUuL8Tci.js → effect-BH4hGy1N.js} +1 -1
- package/dist/{email-addresses-Yt3s7i2b.js → email-addresses-doOfKmSj.js} +1 -1
- package/dist/{export-CNg5YWMm.js → export-DGrsZa4F.js} +3 -3
- package/dist/{helper-DzmKNFue.js → helper-3ohDu5Tn.js} +1 -1
- package/dist/{index-BK8X9RF6.js → index-B8HMoADH.js} +3 -3
- package/dist/{index-D0obMrAS.js → index-BUzeShnL.js} +173 -62
- package/dist/index-BWwF7uuk.js +1049 -0
- package/dist/index-BXw9yi-G.js +32 -0
- package/dist/{index-yzH5eyKW.js → index-C-ozJGq6.js} +1 -1
- package/dist/{index-CsCgQ8gt.js → index-CDT7BpQ3.js} +1 -1
- package/dist/{index-Dnf7j71V.js → index-CKfeyWFN.js} +9 -3
- package/dist/{index-9CXt2kbQ.js → index-CKji0U5N.js} +293 -287
- package/dist/{index-QuBsnXgx.js → index-CVlbqA1t.js} +1 -1
- package/dist/{index-B88e_9YI.js → index-D5CHO7oc.js} +1 -1
- package/dist/{index-O9lB54LY.js → index-rYTZxC9p.js} +1348 -1342
- package/dist/index-vh86FiIQ.js +10 -0
- package/dist/index-wBdTUnZ6.js +54 -0
- package/dist/{index.esm2017-TpBElhnN.js → index.esm2017-D-hthfW3.js} +1 -1
- package/dist/{loading-ChoC5E9d.js → loading-DQnXnCXT.js} +156 -153
- package/dist/{membership-CU-k0-Tf.js → membership-C3envHTy.js} +52 -44
- package/dist/{money-DANmyTBj.js → money-Dm7B8wUJ.js} +1 -1
- package/dist/{number-DrocTWDD.js → number-Swjcamr8.js} +1 -1
- package/dist/objectid-xH_8eWzr.js +145 -0
- package/dist/reward-DOggYNm3.js +36 -0
- package/dist/{rule-BQLmpER9.js → rule-BQy3e3DE.js} +4 -3
- package/dist/{rule-builder-3YRdr18A.js → rule-builder-CPWmw5lP.js} +1 -1
- package/dist/{template-DOKU1QkY.js → template-Dprn2jD_.js} +4 -4
- package/dist/trigger-BUY-zCBi.js +144 -0
- package/dist/{usePagination-JGI7x0W7.js → usePagination-CEQLUMQ7.js} +1 -1
- package/dist/user-DIK4sBIA.js +54 -0
- package/dist/{vue-i18n-Bch1JmhI.js → vue-i18n-B7ledd-g.js} +120 -120
- package/package.json +2 -2
- package/dist/Card-DndggRLr.js +0 -1036
- package/dist/Mission-CsLdMq1M.js +0 -261
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-_P2yImhi.js +0 -1804
- package/dist/Store-C8kT7JN5.js +0 -1531
- package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Cc2F_06x.js +0 -1065
- package/dist/dto-CcrufW2j.js +0 -2770
- package/dist/index-C7745kXl.js +0 -755
- package/dist/index-CZ28ywyB.js +0 -298
- package/dist/user-Bm4KttFq.js +0 -37
|
@@ -1,156 +1,41 @@
|
|
|
1
|
-
import { defineComponent,
|
|
1
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
|
|
2
2
|
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
-
import { z } from "./app-
|
|
3
|
+
import { z } from "./app-MbHo43vs.js";
|
|
4
4
|
import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
|
|
5
|
-
import {
|
|
6
|
-
import { u as useMembershipStore
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
5
|
+
import { b as getCampaignSummaryObject, c as campaignRefinement, d as CampaignDtos, C as CampaignOptions, e as campaignTransform } from "./dto-DseG41FR.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-C3envHTy.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-DMzeDNMd.js";
|
|
8
|
+
import "./index-rYTZxC9p.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-CPWmw5lP.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
12
|
-
import {
|
|
13
|
-
import { _ as _sfc_main$
|
|
14
|
-
import { _ as _sfc_main$
|
|
15
|
-
import { _ as _sfc_main$
|
|
16
|
-
import { _ as _sfc_main$
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { u as useI18n } from "./vue-i18n-
|
|
20
|
-
import { _ as _sfc_main$
|
|
21
|
-
import {
|
|
22
|
-
import { c as
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import "./index-
|
|
26
|
-
import "./index-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-CHI6p9lH.js";
|
|
13
|
+
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
14
|
+
import { _ as _sfc_main$m, a as _sfc_main$p, b as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-DLgZd4HU.js";
|
|
15
|
+
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BQpbScyf.js";
|
|
16
|
+
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-D3VgIQb-.js";
|
|
17
|
+
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CxXugphA.js";
|
|
18
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-DQnXnCXT.js";
|
|
19
|
+
import { u as useI18n } from "./vue-i18n-B7ledd-g.js";
|
|
20
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-BUY-zCBi.js";
|
|
21
|
+
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-ef2Qrdvd.js";
|
|
22
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BQy3e3DE.js";
|
|
23
|
+
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-CFKID7mS.js";
|
|
24
|
+
import "./index-CKji0U5N.js";
|
|
25
|
+
import { b as FdoCreditLoyaltyReward, c as FdtoRandomReward, d as F_MISSION_TYPE, e as FdoThresholdCreditReward, f as FdtoThresholdReward, g as FdoMission } from "./index-BWwF7uuk.js";
|
|
26
|
+
import { T as TEMPLATES } from "./index-BUzeShnL.js";
|
|
27
|
+
import "./index-CVlbqA1t.js";
|
|
28
|
+
import "./index-wBdTUnZ6.js";
|
|
29
|
+
import { F as F_GAME_TYPE } from "./collectible.enum-Y3ALLTcR.js";
|
|
27
30
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { C as CollectionUtils } from "./collection.fn-Dxzr2oPt.js";
|
|
31
|
+
import { i as initCollectibleConfig } from "./helper-3ohDu5Tn.js";
|
|
32
|
+
import { C as CollectionUtils } from "./collection.fn-CfvnmVQa.js";
|
|
31
33
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
32
34
|
import { useDialog } from "@feedmepos/ui-library";
|
|
33
|
-
import { u as useCampaignStore } from "./campaign-
|
|
35
|
+
import { u as useCampaignStore } from "./campaign-2swZVVbi.js";
|
|
36
|
+
import { S as SvcConfig } from "./index-B8HMoADH.js";
|
|
34
37
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
35
|
-
const _sfc_main$
|
|
36
|
-
__name: "SegmentConfigurator",
|
|
37
|
-
props: {
|
|
38
|
-
modelValue: {
|
|
39
|
-
type: Object,
|
|
40
|
-
required: !0
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
emits: ["update:model-value"],
|
|
44
|
-
setup(e, { emit: d }) {
|
|
45
|
-
const a = e, s = computed(() => {
|
|
46
|
-
var l;
|
|
47
|
-
const [u] = isRuleGroup(a.modelValue) ? Object.values(((l = a.modelValue) == null ? void 0 : l.rules) ?? {}) : [null];
|
|
48
|
-
return (u ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
49
|
-
}), r = d;
|
|
50
|
-
return (u, o) => (openBlock(), createBlock(_sfc_main$q, {
|
|
51
|
-
multiselect: !0,
|
|
52
|
-
items: unref(useMembershipStore)().segmentOptions,
|
|
53
|
-
"model-value": unref(s),
|
|
54
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) => r(
|
|
55
|
-
"update:model-value",
|
|
56
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
57
|
-
unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
58
|
-
unref(RuleBuilder).constructEntry("user.segment", "_hasAny", l)
|
|
59
|
-
)
|
|
60
|
-
)),
|
|
61
|
-
label: "Select segment(s) to match"
|
|
62
|
-
}, null, 8, ["items", "model-value"]));
|
|
63
|
-
}
|
|
64
|
-
}), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
65
|
-
__name: "UserRuleGroup",
|
|
66
|
-
props: {
|
|
67
|
-
modelValue: {
|
|
68
|
-
type: Object,
|
|
69
|
-
default: () => {
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
emits: ["update:model-value"],
|
|
74
|
-
setup(e, { emit: d }) {
|
|
75
|
-
const { t: a } = useI18n(), s = e, r = d, u = ref(
|
|
76
|
-
s.modelValue ? RuleBuilder.getRules(s.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(s.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
77
|
-
), o = [
|
|
78
|
-
{
|
|
79
|
-
value: "all_users",
|
|
80
|
-
label: a("connect.template.rule.audience.all")
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
value: "segment",
|
|
84
|
-
label: a("connect.template.rule.audience.member_segment")
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
value: "custom",
|
|
88
|
-
label: a("connect.template.rule.audience.custom_audience")
|
|
89
|
-
}
|
|
90
|
-
];
|
|
91
|
-
return watch(u, async (l, n) => {
|
|
92
|
-
var c;
|
|
93
|
-
if (n != "all_users" && n != l && RuleBuilder.getRules(
|
|
94
|
-
(c = s.modelValue) == null ? void 0 : c.rules[n == "custom" ? "g_user" : "g_segment"]
|
|
95
|
-
).length > 0) {
|
|
96
|
-
const g = await prompt.confirm(
|
|
97
|
-
a("connect.template.rule.audience.confirm_remove"),
|
|
98
|
-
a("connect.common.confirm"),
|
|
99
|
-
a("connect.common.confirm"),
|
|
100
|
-
a("connect.common.cancel")
|
|
101
|
-
);
|
|
102
|
-
g && r(
|
|
103
|
-
"update:model-value",
|
|
104
|
-
RuleBuilder.setRuleToGroup(
|
|
105
|
-
s.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
106
|
-
RuleBuilder.scaffoldGroup(n == "custom" ? "g_user" : "g_segment")
|
|
107
|
-
)
|
|
108
|
-
), u.value = g ? l : n;
|
|
109
|
-
}
|
|
110
|
-
}), (l, n) => {
|
|
111
|
-
var g, p;
|
|
112
|
-
const c = resolveComponent("FmRadio");
|
|
113
|
-
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
114
|
-
createElementVNode("div", null, [
|
|
115
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(o, (v) => createVNode(c, {
|
|
116
|
-
key: v.value,
|
|
117
|
-
value: v.value,
|
|
118
|
-
label: v.label,
|
|
119
|
-
modelValue: unref(u),
|
|
120
|
-
"onUpdate:modelValue": n[0] || (n[0] = (h) => isRef(u) ? u.value = h : null)
|
|
121
|
-
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
122
|
-
]),
|
|
123
|
-
unref(u) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
124
|
-
createVNode(_sfc_main$p, {
|
|
125
|
-
modelValue: ((g = e.modelValue) == null ? void 0 : g.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
126
|
-
"onUpdate:modelValue": n[1] || (n[1] = (v) => r(
|
|
127
|
-
"update:model-value",
|
|
128
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
129
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
130
|
-
v,
|
|
131
|
-
"&&"
|
|
132
|
-
)
|
|
133
|
-
))
|
|
134
|
-
}, null, 8, ["modelValue"])
|
|
135
|
-
])) : createCommentVNode("", !0),
|
|
136
|
-
unref(u) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
|
|
137
|
-
key: 1,
|
|
138
|
-
"include-only": "user",
|
|
139
|
-
"trigger-type": "MEMBERSHIP_JOINED",
|
|
140
|
-
"model-value": ((p = e.modelValue) == null ? void 0 : p.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
|
|
141
|
-
"onUpdate:modelValue": n[2] || (n[2] = (v) => r(
|
|
142
|
-
"update:model-value",
|
|
143
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
144
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
145
|
-
v,
|
|
146
|
-
"&&"
|
|
147
|
-
)
|
|
148
|
-
))
|
|
149
|
-
}, null, 8, ["model-value"])) : createCommentVNode("", !0)
|
|
150
|
-
]);
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}), _hoisted_1$j = { class: "space-y-24" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
38
|
+
const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
154
39
|
__name: "TimeRuleGroup",
|
|
155
40
|
props: {
|
|
156
41
|
modelValue: {
|
|
@@ -161,57 +46,57 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
161
46
|
},
|
|
162
47
|
emits: ["update:model-value"],
|
|
163
48
|
setup(e, { emit: d }) {
|
|
164
|
-
const { t: a } = useI18n(),
|
|
165
|
-
!
|
|
49
|
+
const { t: a } = useI18n(), r = e, u = d, i = ref(
|
|
50
|
+
!r.modelValue || !r.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(r.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
166
51
|
);
|
|
167
|
-
watch(
|
|
52
|
+
watch(i, async (o, n) => {
|
|
168
53
|
var c;
|
|
169
|
-
if (n == "custom" &&
|
|
54
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((c = r.modelValue) == null ? void 0 : c.rules.g_time).length > 0) {
|
|
170
55
|
const g = await prompt.confirm(
|
|
171
56
|
a("connect.template.rule.time.confirm_remove"),
|
|
172
57
|
a("connect.common.confirm"),
|
|
173
58
|
a("connect.common.confirm"),
|
|
174
59
|
a("connect.common.cancel")
|
|
175
60
|
);
|
|
176
|
-
g &&
|
|
61
|
+
g && u(
|
|
177
62
|
"update:model-value",
|
|
178
63
|
RuleBuilder.setRuleToGroup(
|
|
179
|
-
|
|
64
|
+
r.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
180
65
|
RuleBuilder.scaffoldGroup("g_time")
|
|
181
66
|
)
|
|
182
|
-
),
|
|
67
|
+
), i.value = g ? o : n;
|
|
183
68
|
}
|
|
184
69
|
});
|
|
185
|
-
async function o
|
|
70
|
+
async function l(o) {
|
|
186
71
|
var n;
|
|
187
|
-
if (
|
|
72
|
+
if (o == "custom" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
188
73
|
if (!await prompt.confirm(
|
|
189
74
|
a("connect.template.rule.time.confirm_remove"),
|
|
190
75
|
a("connect.common.confirm"),
|
|
191
76
|
a("connect.common.confirm"),
|
|
192
77
|
a("connect.common.cancel")
|
|
193
78
|
)) {
|
|
194
|
-
|
|
79
|
+
i.value = "all_time";
|
|
195
80
|
return;
|
|
196
81
|
}
|
|
197
|
-
|
|
82
|
+
u(
|
|
198
83
|
"update:model-value",
|
|
199
84
|
RuleBuilder.setRuleToGroup(
|
|
200
|
-
|
|
85
|
+
r.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
201
86
|
RuleBuilder.scaffoldGroup("g_time")
|
|
202
87
|
)
|
|
203
88
|
);
|
|
204
89
|
}
|
|
205
90
|
}
|
|
206
|
-
return (
|
|
207
|
-
var
|
|
91
|
+
return (o, n) => {
|
|
92
|
+
var y;
|
|
208
93
|
const c = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
|
|
209
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
94
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
210
95
|
createVNode(g, {
|
|
211
|
-
modelValue: unref(
|
|
96
|
+
modelValue: unref(i),
|
|
212
97
|
"onUpdate:modelValue": [
|
|
213
|
-
n[0] || (n[0] = (v) => isRef(
|
|
214
|
-
n[1] || (n[1] = (v) =>
|
|
98
|
+
n[0] || (n[0] = (v) => isRef(i) ? i.value = v : null),
|
|
99
|
+
n[1] || (n[1] = (v) => l(v))
|
|
215
100
|
]
|
|
216
101
|
}, {
|
|
217
102
|
default: withCtx(() => [
|
|
@@ -226,13 +111,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
226
111
|
]),
|
|
227
112
|
_: 1
|
|
228
113
|
}, 8, ["modelValue"]),
|
|
229
|
-
unref(
|
|
114
|
+
unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
230
115
|
key: 0,
|
|
231
116
|
class: "!mt-[0px]",
|
|
232
117
|
"include-only": "trigger",
|
|
233
118
|
"trigger-type": "SCHEDULE",
|
|
234
|
-
"model-value": ((
|
|
235
|
-
"onUpdate:modelValue": n[2] || (n[2] = (v) =>
|
|
119
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
120
|
+
"onUpdate:modelValue": n[2] || (n[2] = (v) => u(
|
|
236
121
|
"update:model-value",
|
|
237
122
|
unref(RuleBuilder).setRuleToGroup(
|
|
238
123
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
@@ -244,36 +129,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
244
129
|
]);
|
|
245
130
|
};
|
|
246
131
|
}
|
|
247
|
-
}), _sfc_main$
|
|
248
|
-
__name: "BillRuleGroup",
|
|
249
|
-
props: {
|
|
250
|
-
modelValue: {
|
|
251
|
-
type: Object,
|
|
252
|
-
default: () => {
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
},
|
|
256
|
-
emits: ["update:model-value"],
|
|
257
|
-
setup(e, { emit: d }) {
|
|
258
|
-
const a = d;
|
|
259
|
-
return (s, r) => {
|
|
260
|
-
var u;
|
|
261
|
-
return openBlock(), createBlock(_sfc_main$r, {
|
|
262
|
-
"include-only": "bill",
|
|
263
|
-
"trigger-type": "BILL_COMPLETED",
|
|
264
|
-
"model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
|
|
265
|
-
"onUpdate:modelValue": r[0] || (r[0] = (o) => a(
|
|
266
|
-
"update:model-value",
|
|
267
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
268
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
269
|
-
o,
|
|
270
|
-
"&&"
|
|
271
|
-
)
|
|
272
|
-
))
|
|
273
|
-
}, null, 8, ["model-value"]);
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
}), _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
132
|
+
}), _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
277
133
|
__name: "BirthdayInput",
|
|
278
134
|
props: {
|
|
279
135
|
modelValue: {
|
|
@@ -282,28 +138,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
282
138
|
},
|
|
283
139
|
emits: ["update:model-value"],
|
|
284
140
|
setup(e, { emit: d }) {
|
|
285
|
-
const a = e,
|
|
286
|
-
const { property:
|
|
141
|
+
const a = e, r = d, u = computed(() => {
|
|
142
|
+
const { property: i, operator: l, equator: o } = RuleBuilder.simplify(
|
|
287
143
|
a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
288
144
|
op: "before",
|
|
289
145
|
x: 1
|
|
290
146
|
})
|
|
291
147
|
);
|
|
292
148
|
return {
|
|
293
|
-
property:
|
|
294
|
-
operator:
|
|
295
|
-
equator:
|
|
149
|
+
property: i,
|
|
150
|
+
operator: l,
|
|
151
|
+
equator: o
|
|
296
152
|
};
|
|
297
153
|
});
|
|
298
|
-
return (
|
|
299
|
-
const
|
|
154
|
+
return (i, l) => {
|
|
155
|
+
const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
|
|
300
156
|
return openBlock(), createElementBlock("div", null, [
|
|
301
|
-
createVNode(
|
|
157
|
+
createVNode(o, {
|
|
302
158
|
label: "On birthday",
|
|
303
159
|
value: "_isRange-day",
|
|
304
|
-
"model-value": `${unref(
|
|
305
|
-
"onUpdate:modelValue":
|
|
306
|
-
|
|
160
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
161
|
+
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
162
|
+
r(
|
|
307
163
|
"update:model-value",
|
|
308
164
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
309
165
|
op: "this",
|
|
@@ -313,12 +169,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
313
169
|
);
|
|
314
170
|
})
|
|
315
171
|
}, null, 8, ["model-value"]),
|
|
316
|
-
createVNode(
|
|
172
|
+
createVNode(o, {
|
|
317
173
|
label: "N days before birthday",
|
|
318
174
|
value: "_isDay",
|
|
319
|
-
"model-value": unref(
|
|
320
|
-
"onUpdate:modelValue":
|
|
321
|
-
|
|
175
|
+
"model-value": unref(u).operator,
|
|
176
|
+
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
177
|
+
r(
|
|
322
178
|
"update:model-value",
|
|
323
179
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
180
|
op: "after",
|
|
@@ -328,12 +184,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
328
184
|
);
|
|
329
185
|
})
|
|
330
186
|
}, null, 8, ["model-value"]),
|
|
331
|
-
unref(
|
|
187
|
+
unref(u).operator == "_isDay" ? (openBlock(), createBlock(n, {
|
|
332
188
|
key: 0,
|
|
333
189
|
label: "Days before birthday",
|
|
334
190
|
"show-steppers": !1,
|
|
335
|
-
"model-value": unref(
|
|
336
|
-
"onUpdate:modelValue":
|
|
191
|
+
"model-value": unref(u).equator.x,
|
|
192
|
+
"onUpdate:modelValue": l[2] || (l[2] = (c) => r(
|
|
337
193
|
"update:model-value",
|
|
338
194
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
339
195
|
op: "after",
|
|
@@ -342,12 +198,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
342
198
|
})
|
|
343
199
|
))
|
|
344
200
|
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
345
|
-
createVNode(
|
|
201
|
+
createVNode(o, {
|
|
346
202
|
label: "In birthday week",
|
|
347
203
|
value: "_isRange-week",
|
|
348
|
-
"model-value": `${unref(
|
|
349
|
-
"onUpdate:modelValue":
|
|
350
|
-
|
|
204
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
205
|
+
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
206
|
+
r(
|
|
351
207
|
"update:model-value",
|
|
352
208
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
353
209
|
op: "this",
|
|
@@ -357,12 +213,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
357
213
|
);
|
|
358
214
|
})
|
|
359
215
|
}, null, 8, ["model-value"]),
|
|
360
|
-
createVNode(
|
|
216
|
+
createVNode(o, {
|
|
361
217
|
label: "In birthday month",
|
|
362
218
|
value: "_isRange-month",
|
|
363
|
-
"model-value": `${unref(
|
|
364
|
-
"onUpdate:modelValue":
|
|
365
|
-
|
|
219
|
+
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
220
|
+
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
221
|
+
r(
|
|
366
222
|
"update:model-value",
|
|
367
223
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
368
224
|
op: "this",
|
|
@@ -375,110 +231,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
375
231
|
]);
|
|
376
232
|
};
|
|
377
233
|
}
|
|
378
|
-
}), _sfc_main$
|
|
379
|
-
__name: "FeedbackRuleGroup",
|
|
380
|
-
props: {
|
|
381
|
-
modelValue: {
|
|
382
|
-
type: Object,
|
|
383
|
-
default: () => {
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
},
|
|
387
|
-
emits: ["update:model-value"],
|
|
388
|
-
setup(e, { emit: d }) {
|
|
389
|
-
const a = d;
|
|
390
|
-
return (s, r) => {
|
|
391
|
-
var u;
|
|
392
|
-
return openBlock(), createBlock(_sfc_main$r, {
|
|
393
|
-
"include-only": "feedback",
|
|
394
|
-
"trigger-type": "FEEDBACK",
|
|
395
|
-
"model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
|
|
396
|
-
"onUpdate:modelValue": r[0] || (r[0] = (o) => a(
|
|
397
|
-
"update:model-value",
|
|
398
|
-
unref(RuleBuilder).setRuleToGroup(
|
|
399
|
-
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
400
|
-
o,
|
|
401
|
-
"&&"
|
|
402
|
-
)
|
|
403
|
-
))
|
|
404
|
-
}, null, 8, ["model-value"]);
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
}), TriggerOptions = {
|
|
408
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED]: {
|
|
409
|
-
name: "Bill complete",
|
|
410
|
-
description: "Reward customers upon the completion of their bill.",
|
|
411
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED,
|
|
412
|
-
hidden: !1
|
|
413
|
-
},
|
|
414
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK]: {
|
|
415
|
-
name: "Feedback",
|
|
416
|
-
description: "Reward customers for providing feedback.",
|
|
417
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK,
|
|
418
|
-
hidden: !1
|
|
419
|
-
},
|
|
420
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED]: {
|
|
421
|
-
name: "Game complete",
|
|
422
|
-
description: "Reward customers upon the completion of a game.",
|
|
423
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED,
|
|
424
|
-
hidden: !1
|
|
425
|
-
},
|
|
426
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER]: {
|
|
427
|
-
name: "Making order",
|
|
428
|
-
description: "Reward customers upon the creation of their order.",
|
|
429
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER,
|
|
430
|
-
hidden: !1
|
|
431
|
-
},
|
|
432
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED]: {
|
|
433
|
-
name: "Member joined ",
|
|
434
|
-
description: "Trigger rewards when customers join your membership program.",
|
|
435
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED,
|
|
436
|
-
hidden: !1
|
|
437
|
-
},
|
|
438
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE]: {
|
|
439
|
-
name: "Schedule",
|
|
440
|
-
description: "Set rewards to be triggered at specific times or dates.",
|
|
441
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE,
|
|
442
|
-
hidden: !1
|
|
443
|
-
},
|
|
444
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM]: {
|
|
445
|
-
name: "Simple claim",
|
|
446
|
-
description: "Activate rewards when customers claim an offer",
|
|
447
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM,
|
|
448
|
-
hidden: !1
|
|
449
|
-
},
|
|
450
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED]: {
|
|
451
|
-
name: "Tier upgrade",
|
|
452
|
-
description: "Activate rewards when their membership tier gets upgraded.",
|
|
453
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED,
|
|
454
|
-
hidden: !1
|
|
455
|
-
},
|
|
456
|
-
[F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD]: {
|
|
457
|
-
name: "Issue reward",
|
|
458
|
-
description: "Triggers whenever customer receives a reward in any kind.",
|
|
459
|
-
value: F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD,
|
|
460
|
-
hidden: !0
|
|
461
|
-
}
|
|
462
|
-
}, TypeToTriggerOptions = Object.fromEntries(
|
|
463
|
-
[
|
|
464
|
-
"VOUCHER",
|
|
465
|
-
"PROMOTION",
|
|
466
|
-
"POINT",
|
|
467
|
-
"CREDIT",
|
|
468
|
-
"MEMBERSHIP",
|
|
469
|
-
"BROADCAST",
|
|
470
|
-
"COIN",
|
|
471
|
-
"REWARD_POOL",
|
|
472
|
-
"GAME",
|
|
473
|
-
"MISSION"
|
|
474
|
-
].map((e) => {
|
|
475
|
-
const d = CAMPAIGN_TRIGGER[e];
|
|
476
|
-
return [
|
|
477
|
-
e,
|
|
478
|
-
(d == null ? void 0 : d.map((a) => TriggerOptions[a]).filter((a) => !a.hidden)) ?? []
|
|
479
|
-
];
|
|
480
|
-
})
|
|
481
|
-
), _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({
|
|
234
|
+
}), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$e = /* @__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$c = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
482
235
|
__name: "CampaignTriggerInput",
|
|
483
236
|
props: {
|
|
484
237
|
campaignType: {
|
|
@@ -495,30 +248,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
495
248
|
},
|
|
496
249
|
emits: ["update:model-value"],
|
|
497
250
|
setup(e, { emit: d }) {
|
|
498
|
-
const a = e,
|
|
499
|
-
(
|
|
251
|
+
const a = e, r = d, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
|
|
252
|
+
(i) => i.value == a.modelValue
|
|
500
253
|
) : TypeToTriggerOptions[a.campaignType]);
|
|
501
|
-
return (
|
|
502
|
-
const
|
|
503
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
504
|
-
_hoisted_2$
|
|
505
|
-
createElementVNode("div", _hoisted_3$
|
|
506
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
254
|
+
return (i, l) => {
|
|
255
|
+
const o = resolveComponent("FmCard");
|
|
256
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
257
|
+
_hoisted_2$e,
|
|
258
|
+
createElementVNode("div", _hoisted_3$c, [
|
|
259
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
507
260
|
variant: "outlined",
|
|
508
261
|
disabled: a.disabled,
|
|
509
262
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
510
|
-
"col-span-3": unref(
|
|
263
|
+
"col-span-3": unref(u).length == 1,
|
|
511
264
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
|
|
512
265
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
513
266
|
}]),
|
|
514
267
|
onClick: () => {
|
|
515
|
-
a.modelValue != n.value && !a.disabled &&
|
|
268
|
+
a.modelValue != n.value && !a.disabled && r("update:model-value", n.value);
|
|
516
269
|
},
|
|
517
270
|
key: n.name
|
|
518
271
|
}, {
|
|
519
272
|
default: withCtx(() => [
|
|
520
|
-
createElementVNode("div", _hoisted_4$
|
|
521
|
-
createElementVNode("div", _hoisted_5$
|
|
273
|
+
createElementVNode("div", _hoisted_4$b, toDisplayString(n.name), 1),
|
|
274
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(n.description), 1)
|
|
522
275
|
]),
|
|
523
276
|
_: 2
|
|
524
277
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -526,7 +279,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
526
279
|
]);
|
|
527
280
|
};
|
|
528
281
|
}
|
|
529
|
-
}), _sfc_main$
|
|
282
|
+
}), _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
530
283
|
__name: "DateInput",
|
|
531
284
|
props: {
|
|
532
285
|
label: {
|
|
@@ -541,25 +294,25 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
541
294
|
emits: ["update:model-value"],
|
|
542
295
|
setup(e, { emit: d }) {
|
|
543
296
|
const a = d;
|
|
544
|
-
return (
|
|
545
|
-
const
|
|
546
|
-
return openBlock(), createBlock(
|
|
297
|
+
return (r, u) => {
|
|
298
|
+
const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
299
|
+
return openBlock(), createBlock(o, {
|
|
547
300
|
label: e.label,
|
|
548
301
|
"model-value": e.modelValue || "",
|
|
549
|
-
"onUpdate:modelValue":
|
|
302
|
+
"onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
|
|
550
303
|
}, {
|
|
551
304
|
"trigger-button": withCtx(({ opened: n }) => [
|
|
552
|
-
createVNode(
|
|
305
|
+
createVNode(l, {
|
|
553
306
|
class: "flex items-center",
|
|
554
307
|
"prepend-icon": "calendar_month",
|
|
555
308
|
"icon-outlined": !n
|
|
556
309
|
}, {
|
|
557
310
|
append: withCtx(() => [
|
|
558
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
311
|
+
e.modelValue ? (openBlock(), createBlock(i, {
|
|
559
312
|
key: 0,
|
|
560
313
|
variant: "tertiary",
|
|
561
314
|
icon: "clear",
|
|
562
|
-
onClick:
|
|
315
|
+
onClick: u[0] || (u[0] = (c) => (c.stopPropagation(), a("update:model-value", null)))
|
|
563
316
|
})) : createCommentVNode("", !0)
|
|
564
317
|
]),
|
|
565
318
|
default: withCtx(() => [
|
|
@@ -574,7 +327,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
574
327
|
}, 8, ["label", "model-value"]);
|
|
575
328
|
};
|
|
576
329
|
}
|
|
577
|
-
}), _hoisted_1$
|
|
330
|
+
}), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$d = { class: "flex-1 xs:w-full" }, _hoisted_3$b = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$a = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
578
331
|
__name: "DateRangeInput",
|
|
579
332
|
props: {
|
|
580
333
|
modelValue: {
|
|
@@ -585,32 +338,32 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
585
338
|
emits: ["update:model-value"],
|
|
586
339
|
setup(e, { emit: d }) {
|
|
587
340
|
const a = d;
|
|
588
|
-
return (
|
|
589
|
-
var
|
|
590
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
591
|
-
createElementVNode("div", _hoisted_2$
|
|
592
|
-
createVNode(_sfc_main$
|
|
593
|
-
"model-value": ((
|
|
341
|
+
return (r, u) => {
|
|
342
|
+
var i, l;
|
|
343
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
344
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
345
|
+
createVNode(_sfc_main$f, {
|
|
346
|
+
"model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
|
|
594
347
|
label: "Start date",
|
|
595
|
-
"onUpdate:modelValue":
|
|
348
|
+
"onUpdate:modelValue": u[0] || (u[0] = (o) => {
|
|
596
349
|
var n;
|
|
597
350
|
return a("update:model-value", {
|
|
598
|
-
startDate:
|
|
351
|
+
startDate: o,
|
|
599
352
|
endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
|
|
600
353
|
});
|
|
601
354
|
})
|
|
602
355
|
}, null, 8, ["model-value"])
|
|
603
356
|
]),
|
|
604
|
-
_hoisted_3$
|
|
605
|
-
createElementVNode("div", _hoisted_4$
|
|
606
|
-
createVNode(_sfc_main$
|
|
607
|
-
"model-value": ((
|
|
357
|
+
_hoisted_3$b,
|
|
358
|
+
createElementVNode("div", _hoisted_4$a, [
|
|
359
|
+
createVNode(_sfc_main$f, {
|
|
360
|
+
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
608
361
|
label: "End date",
|
|
609
|
-
"onUpdate:modelValue":
|
|
362
|
+
"onUpdate:modelValue": u[1] || (u[1] = (o) => {
|
|
610
363
|
var n;
|
|
611
364
|
return a("update:model-value", {
|
|
612
365
|
startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
|
|
613
|
-
endDate:
|
|
366
|
+
endDate: o
|
|
614
367
|
});
|
|
615
368
|
})
|
|
616
369
|
}, null, 8, ["model-value"])
|
|
@@ -618,10 +371,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
618
371
|
]);
|
|
619
372
|
};
|
|
620
373
|
}
|
|
621
|
-
}), _hoisted_1$
|
|
374
|
+
}), _hoisted_1$d = { class: "space-y-8" }, _hoisted_2$c = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$a = {
|
|
622
375
|
key: 0,
|
|
623
376
|
class: "space-y-4"
|
|
624
|
-
}, _hoisted_4$
|
|
377
|
+
}, _hoisted_4$9 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$5 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$3 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
625
378
|
__name: "ScheduleRuleInput",
|
|
626
379
|
props: {
|
|
627
380
|
modelValue: {
|
|
@@ -637,18 +390,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
637
390
|
},
|
|
638
391
|
emits: ["update:model-value"],
|
|
639
392
|
setup(e, { emit: d }) {
|
|
640
|
-
const a = e,
|
|
641
|
-
function
|
|
642
|
-
const
|
|
643
|
-
return
|
|
393
|
+
const a = e, r = d;
|
|
394
|
+
function u() {
|
|
395
|
+
const y = RuleBuilder.getRules(a.modelValue);
|
|
396
|
+
return y.length == 0 ? "fixed" : y.some(
|
|
644
397
|
(v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
|
|
645
398
|
) ? "repeating" : "fixed";
|
|
646
399
|
}
|
|
647
|
-
const
|
|
648
|
-
const
|
|
649
|
-
(
|
|
650
|
-
), h =
|
|
651
|
-
(
|
|
400
|
+
const i = ref(u()), l = ref(!1), o = computed(() => {
|
|
401
|
+
const y = RuleBuilder.getRules(a.modelValue), v = y.find(
|
|
402
|
+
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
|
|
403
|
+
), h = y.find(
|
|
404
|
+
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.time"
|
|
652
405
|
);
|
|
653
406
|
return {
|
|
654
407
|
date: v ? RuleBuilder.simplify(v).equator : null,
|
|
@@ -662,8 +415,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
662
415
|
a.endDate ? new Date(a.endDate) : void 0
|
|
663
416
|
)
|
|
664
417
|
);
|
|
665
|
-
function c(
|
|
666
|
-
const v =
|
|
418
|
+
function c(y) {
|
|
419
|
+
const v = y.label.toLowerCase(), h = v == "fixed" ? [
|
|
667
420
|
RuleBuilder.constructEntry(
|
|
668
421
|
"trigger.date",
|
|
669
422
|
"_isOnDate",
|
|
@@ -678,73 +431,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
678
431
|
),
|
|
679
432
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
680
433
|
];
|
|
681
|
-
|
|
434
|
+
r(
|
|
682
435
|
"update:model-value",
|
|
683
436
|
RuleBuilder.setRuleToGroup(
|
|
684
437
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
685
438
|
h
|
|
686
439
|
)
|
|
687
|
-
),
|
|
440
|
+
), i.value = v;
|
|
688
441
|
}
|
|
689
|
-
function g(
|
|
690
|
-
|
|
442
|
+
function g(y) {
|
|
443
|
+
i.value == "fixed" ? r(
|
|
691
444
|
"update:model-value",
|
|
692
445
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
693
446
|
RuleBuilder.constructEntry(
|
|
694
447
|
"trigger.date",
|
|
695
448
|
"_isOnDate",
|
|
696
|
-
|
|
449
|
+
y.date
|
|
697
450
|
),
|
|
698
451
|
RuleBuilder.constructEntry(
|
|
699
452
|
"trigger.time",
|
|
700
453
|
"_isOnTime",
|
|
701
|
-
|
|
454
|
+
y.time
|
|
702
455
|
)
|
|
703
456
|
])
|
|
704
|
-
) :
|
|
457
|
+
) : r(
|
|
705
458
|
"update:model-value",
|
|
706
459
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
707
460
|
RuleBuilder.constructEntry(
|
|
708
461
|
"trigger.date",
|
|
709
462
|
"_rrule",
|
|
710
|
-
|
|
463
|
+
y.date
|
|
711
464
|
),
|
|
712
465
|
RuleBuilder.constructEntry(
|
|
713
466
|
"trigger.time",
|
|
714
467
|
"_isOnTime",
|
|
715
|
-
|
|
468
|
+
y.time
|
|
716
469
|
)
|
|
717
470
|
])
|
|
718
471
|
);
|
|
719
472
|
}
|
|
720
|
-
return (
|
|
721
|
-
const h = resolveComponent("FmButtonGroup"),
|
|
473
|
+
return (y, v) => {
|
|
474
|
+
const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), s = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), m = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
|
|
722
475
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
723
476
|
createVNode(h, {
|
|
724
477
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
725
|
-
"model-value": { label: unref(cases).title(unref(
|
|
478
|
+
"model-value": { label: unref(cases).title(unref(i)) },
|
|
726
479
|
"onUpdate:modelValue": c,
|
|
727
480
|
class: "mb-8"
|
|
728
481
|
}, null, 8, ["model-value"]),
|
|
729
|
-
createElementVNode("div", _hoisted_1$
|
|
730
|
-
createElementVNode("div", _hoisted_2$
|
|
731
|
-
createVNode(
|
|
482
|
+
createElementVNode("div", _hoisted_1$d, [
|
|
483
|
+
createElementVNode("div", _hoisted_2$c, [
|
|
484
|
+
createVNode(p, {
|
|
732
485
|
label: "Notify time",
|
|
733
|
-
"model-value": unref(
|
|
734
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
735
|
-
"helper-text": unref(
|
|
736
|
-
"helper-state": unref(
|
|
486
|
+
"model-value": unref(o).time,
|
|
487
|
+
"onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(o).date, time: B })),
|
|
488
|
+
"helper-text": unref(o).time ? void 0 : "Time is required",
|
|
489
|
+
"helper-state": unref(o).time ? void 0 : "error"
|
|
737
490
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
738
|
-
unref(
|
|
739
|
-
createElementVNode("div", _hoisted_4$
|
|
740
|
-
_hoisted_5$
|
|
741
|
-
unref(
|
|
491
|
+
unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
|
|
492
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
493
|
+
_hoisted_5$5,
|
|
494
|
+
unref(o).date ? (openBlock(), createBlock(f, {
|
|
742
495
|
key: 0,
|
|
743
496
|
"z-index": 9999,
|
|
744
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
497
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options)
|
|
745
498
|
}, {
|
|
746
499
|
default: withCtx(() => [
|
|
747
|
-
createVNode(
|
|
500
|
+
createVNode(s, {
|
|
748
501
|
name: "info",
|
|
749
502
|
size: "sm",
|
|
750
503
|
outline: !0
|
|
@@ -753,30 +506,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
753
506
|
_: 1
|
|
754
507
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
755
508
|
]),
|
|
756
|
-
createVNode(
|
|
757
|
-
"show-popover": unref(
|
|
758
|
-
onPopoverChanged: v[3] || (v[3] = (
|
|
509
|
+
createVNode(x, {
|
|
510
|
+
"show-popover": unref(l),
|
|
511
|
+
onPopoverChanged: v[3] || (v[3] = (B) => l.value = B)
|
|
759
512
|
}, {
|
|
760
513
|
"popover-button": withCtx(() => [
|
|
761
|
-
createVNode(
|
|
514
|
+
createVNode(m, {
|
|
762
515
|
class: "cursor-pointer",
|
|
763
|
-
"helper-text": unref(
|
|
764
|
-
"helper-state": unref(
|
|
516
|
+
"helper-text": unref(o).date ? void 0 : "Date is required",
|
|
517
|
+
"helper-state": unref(o).date ? void 0 : "error"
|
|
765
518
|
}, {
|
|
766
519
|
default: withCtx(() => [
|
|
767
|
-
createElementVNode("div", _hoisted_6$
|
|
520
|
+
createElementVNode("div", _hoisted_6$3, toDisplayString(unref(o).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options) : "Set a repeating date"), 1)
|
|
768
521
|
]),
|
|
769
522
|
_: 1
|
|
770
523
|
}, 8, ["helper-text", "helper-state"])
|
|
771
524
|
]),
|
|
772
525
|
default: withCtx(() => [
|
|
773
|
-
createVNode(
|
|
526
|
+
createVNode(b, { class: "elevated p-8 w-[450px]" }, {
|
|
774
527
|
default: withCtx(() => [
|
|
775
|
-
createVNode(_sfc_main$
|
|
528
|
+
createVNode(_sfc_main$k, {
|
|
776
529
|
"apply-button": !0,
|
|
777
|
-
"model-value": unref(
|
|
778
|
-
onCancel: v[1] || (v[1] = (
|
|
779
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
530
|
+
"model-value": unref(o).date || "",
|
|
531
|
+
onCancel: v[1] || (v[1] = (B) => l.value = !1),
|
|
532
|
+
"onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(o).time }), l.value = !1))
|
|
780
533
|
}, null, 8, ["model-value"])
|
|
781
534
|
]),
|
|
782
535
|
_: 1
|
|
@@ -784,16 +537,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
784
537
|
]),
|
|
785
538
|
_: 1
|
|
786
539
|
}, 8, ["show-popover"])
|
|
787
|
-
])) : (openBlock(), createBlock(
|
|
540
|
+
])) : (openBlock(), createBlock(k, {
|
|
788
541
|
key: 1,
|
|
789
542
|
label: "Notify date",
|
|
790
|
-
"model-value": unref(
|
|
791
|
-
"onUpdate:modelValue": v[4] || (v[4] = (
|
|
792
|
-
"helper-text": unref(
|
|
793
|
-
"helper-state": unref(
|
|
543
|
+
"model-value": unref(o).date || "",
|
|
544
|
+
"onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(o).time })),
|
|
545
|
+
"helper-text": unref(o).date ? void 0 : "Date is required",
|
|
546
|
+
"helper-state": unref(o).date ? void 0 : "error"
|
|
794
547
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
795
548
|
]),
|
|
796
|
-
unref(
|
|
549
|
+
unref(o).date && unref(o).time && unref(n) ? (openBlock(), createBlock(C, {
|
|
797
550
|
key: 0,
|
|
798
551
|
text: `${unref(hooks)(unref(n)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(n)).format("dddd, DD MMM YYYY")} at
|
|
799
552
|
${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
|
|
@@ -802,309 +555,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
802
555
|
], 64);
|
|
803
556
|
};
|
|
804
557
|
}
|
|
805
|
-
}), _hoisted_1$
|
|
806
|
-
__name: "MenuSheet",
|
|
807
|
-
props: {
|
|
808
|
-
modelValue: {},
|
|
809
|
-
filterItems: { type: Function }
|
|
810
|
-
},
|
|
811
|
-
emits: ["confirm"],
|
|
812
|
-
setup(e, { emit: d }) {
|
|
813
|
-
const a = ref(), s = ref(!1);
|
|
814
|
-
function r() {
|
|
815
|
-
var o;
|
|
816
|
-
(o = a.value) == null || o.onConfirm();
|
|
817
|
-
}
|
|
818
|
-
const u = d;
|
|
819
|
-
return (o, l) => {
|
|
820
|
-
const n = resolveComponent("FmField"), c = resolveComponent("FmButton"), g = resolveComponent("FmSideSheet");
|
|
821
|
-
return openBlock(), createBlock(g, {
|
|
822
|
-
modelValue: s.value,
|
|
823
|
-
"onUpdate:modelValue": l[1] || (l[1] = (p) => s.value = p),
|
|
824
|
-
title: "Select Items",
|
|
825
|
-
"close-button": !1,
|
|
826
|
-
"dismiss-away": !0,
|
|
827
|
-
"max-width": 560
|
|
828
|
-
}, {
|
|
829
|
-
"side-sheet-button": withCtx(() => [
|
|
830
|
-
renderSlot(o.$slots, "side-sheet-button", {}, () => [
|
|
831
|
-
createVNode(n, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
|
|
832
|
-
default: withCtx(() => [
|
|
833
|
-
createTextVNode(toDisplayString(o.modelValue.length) + " item(s) selected ", 1)
|
|
834
|
-
]),
|
|
835
|
-
_: 1
|
|
836
|
-
})
|
|
837
|
-
])
|
|
838
|
-
]),
|
|
839
|
-
"side-sheet-footer": withCtx(() => [
|
|
840
|
-
createElementVNode("div", _hoisted_1$f, [
|
|
841
|
-
createVNode(c, {
|
|
842
|
-
variant: "tertiary",
|
|
843
|
-
onClick: l[0] || (l[0] = (p) => s.value = !1),
|
|
844
|
-
label: "Cancel"
|
|
845
|
-
}),
|
|
846
|
-
createVNode(c, {
|
|
847
|
-
variant: "primary",
|
|
848
|
-
onClick: r,
|
|
849
|
-
label: "Confirm"
|
|
850
|
-
})
|
|
851
|
-
])
|
|
852
|
-
]),
|
|
853
|
-
default: withCtx(() => [
|
|
854
|
-
createVNode(_sfc_main$t, {
|
|
855
|
-
class: "h-full",
|
|
856
|
-
"max-height": 0,
|
|
857
|
-
ref_key: "selectItemRef",
|
|
858
|
-
ref: a,
|
|
859
|
-
"initial-value": o.modelValue,
|
|
860
|
-
"filter-items": o.filterItems,
|
|
861
|
-
"on-complete": (p) => {
|
|
862
|
-
u("confirm", p), s.value = !1;
|
|
863
|
-
}
|
|
864
|
-
}, null, 8, ["initial-value", "filter-items", "on-complete"])
|
|
865
|
-
]),
|
|
866
|
-
_: 3
|
|
867
|
-
}, 8, ["modelValue"]);
|
|
868
|
-
};
|
|
869
|
-
}
|
|
870
|
-
}), _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
|
-
key: 0,
|
|
872
|
-
class: "xs:!block flex gap-16 items-center pt-8"
|
|
873
|
-
}, _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
|
-
key: 0,
|
|
875
|
-
class: "pt-8 space-y-8"
|
|
876
|
-
}, _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
|
-
__name: "EarningOptionInput",
|
|
878
|
-
props: {
|
|
879
|
-
modelValue: {
|
|
880
|
-
type: Object
|
|
881
|
-
},
|
|
882
|
-
extras: {
|
|
883
|
-
type: Object
|
|
884
|
-
},
|
|
885
|
-
fixedType: {
|
|
886
|
-
type: Boolean
|
|
887
|
-
},
|
|
888
|
-
errorText: {
|
|
889
|
-
type: String
|
|
890
|
-
}
|
|
891
|
-
},
|
|
892
|
-
emits: ["update:model-value"],
|
|
893
|
-
setup(e, { emit: d }) {
|
|
894
|
-
var g, p, v;
|
|
895
|
-
const a = useBusinessStore(), s = e, r = d, u = [
|
|
896
|
-
{
|
|
897
|
-
label: "Based on spending",
|
|
898
|
-
sublabel: "Customers earn rewards based on how much they spend.",
|
|
899
|
-
value: "PROPORTIONAL"
|
|
900
|
-
},
|
|
901
|
-
{
|
|
902
|
-
label: "Fixed amount",
|
|
903
|
-
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
904
|
-
value: "FIXED"
|
|
905
|
-
}
|
|
906
|
-
].filter((h) => {
|
|
907
|
-
var i, m;
|
|
908
|
-
return s.fixedType || ((m = (i = s.extras) == null ? void 0 : i.campaign) == null ? void 0 : m.event.type) != "BILL_COMPLETED" ? h.value == "FIXED" : !0;
|
|
909
|
-
}), o = computed(() => {
|
|
910
|
-
var i, m;
|
|
911
|
-
const h = s.extras && "configs" in s.extras ? s.extras.configs.type : (i = s.extras) == null ? void 0 : i.campaign.type;
|
|
912
|
-
return (((m = CollectibleOptions[h]) == null ? void 0 : m.name) || "reward").toLowerCase();
|
|
913
|
-
}), l = computed(() => {
|
|
914
|
-
const h = FdoEarningOption.safeParse(s.modelValue);
|
|
915
|
-
return h.success ? [] : h.error.errors;
|
|
916
|
-
});
|
|
917
|
-
function n(h) {
|
|
918
|
-
var i;
|
|
919
|
-
h != ((i = s.modelValue) == null ? void 0 : i.type) && r(
|
|
920
|
-
"update:model-value",
|
|
921
|
-
h === "FIXED" ? {
|
|
922
|
-
type: "FIXED",
|
|
923
|
-
amount: 1
|
|
924
|
-
} : {
|
|
925
|
-
type: "PROPORTIONAL",
|
|
926
|
-
amount: 1,
|
|
927
|
-
every: 1
|
|
928
|
-
}
|
|
929
|
-
);
|
|
930
|
-
}
|
|
931
|
-
const c = ref(
|
|
932
|
-
((g = s.modelValue) == null ? void 0 : g.type) === "PROPORTIONAL" && !!((v = (p = s.modelValue) == null ? void 0 : p.property) != null && v.length) || !1
|
|
933
|
-
);
|
|
934
|
-
return (h, i) => {
|
|
935
|
-
var x, k, N;
|
|
936
|
-
const m = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), C = resolveComponent("FmPill"), E = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), B = resolveComponent("FmHelperText");
|
|
937
|
-
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
938
|
-
createElementVNode("div", _hoisted_2$d, [
|
|
939
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (V) => {
|
|
940
|
-
var $, R;
|
|
941
|
-
return openBlock(), createBlock(m, {
|
|
942
|
-
variant: "outlined",
|
|
943
|
-
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
944
|
-
"col-span-2": unref(u).length == 1,
|
|
945
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": (($ = e.modelValue) == null ? void 0 : $.type) === V.value,
|
|
946
|
-
"hover:bg-fm-color-opacity-sm": ((R = e.modelValue) == null ? void 0 : R.type) != V.value
|
|
947
|
-
}]),
|
|
948
|
-
onClick: (S) => n(V.value),
|
|
949
|
-
key: V.value
|
|
950
|
-
}, {
|
|
951
|
-
default: withCtx(() => [
|
|
952
|
-
createElementVNode("div", _hoisted_3$b, toDisplayString(V.label), 1),
|
|
953
|
-
createElementVNode("div", _hoisted_4$a, toDisplayString(V.sublabel), 1)
|
|
954
|
-
]),
|
|
955
|
-
_: 2
|
|
956
|
-
}, 1032, ["class", "onClick"]);
|
|
957
|
-
}), 128))
|
|
958
|
-
]),
|
|
959
|
-
createElementVNode("div", _hoisted_5$6, [
|
|
960
|
-
((x = e.modelValue) == null ? void 0 : x.type) === "FIXED" ? (openBlock(), createBlock(f, {
|
|
961
|
-
key: 0,
|
|
962
|
-
label: `Receive ${unref(o)}(s)`,
|
|
963
|
-
class: "flex-1",
|
|
964
|
-
"model-value": ((k = e.modelValue) == null ? void 0 : k.amount) ?? null,
|
|
965
|
-
"onUpdate:modelValue": i[0] || (i[0] = (V) => r("update:model-value", {
|
|
966
|
-
...e.modelValue ?? { type: "FIXED" },
|
|
967
|
-
amount: V
|
|
968
|
-
}))
|
|
969
|
-
}, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
970
|
-
_hoisted_6$3,
|
|
971
|
-
createVNode(b, {
|
|
972
|
-
"model-value": unref(c),
|
|
973
|
-
"onUpdate:modelValue": i[6] || (i[6] = (V) => {
|
|
974
|
-
unref(c) != V && (r("update:model-value", {
|
|
975
|
-
...e.modelValue ?? {
|
|
976
|
-
type: "PROPORTIONAL",
|
|
977
|
-
amount: 1,
|
|
978
|
-
every: 1
|
|
979
|
-
},
|
|
980
|
-
property: V ? [] : void 0,
|
|
981
|
-
every: 1
|
|
982
|
-
}), c.value = V);
|
|
983
|
-
})
|
|
984
|
-
}, {
|
|
985
|
-
default: withCtx(() => [
|
|
986
|
-
createVNode(y, {
|
|
987
|
-
label: "Amount spent",
|
|
988
|
-
sublabel: `Receive ${unref(o)} by amount spent`,
|
|
989
|
-
value: !1
|
|
990
|
-
}, {
|
|
991
|
-
label: withCtx(() => {
|
|
992
|
-
var V, $;
|
|
993
|
-
return [
|
|
994
|
-
_hoisted_7$3,
|
|
995
|
-
createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(o)) + " by amount spent ", 1),
|
|
996
|
-
unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
997
|
-
createVNode(f, {
|
|
998
|
-
label: `Receive ${unref(o)}(s)`,
|
|
999
|
-
inputmode: "decimal",
|
|
1000
|
-
class: "flex-1",
|
|
1001
|
-
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
1002
|
-
"onUpdate:modelValue": i[1] || (i[1] = (R) => r("update:model-value", {
|
|
1003
|
-
...e.modelValue ?? { type: "FIXED" },
|
|
1004
|
-
amount: R
|
|
1005
|
-
}))
|
|
1006
|
-
}, null, 8, ["label", "model-value"]),
|
|
1007
|
-
_hoisted_10$3,
|
|
1008
|
-
createVNode(f, {
|
|
1009
|
-
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1010
|
-
class: "flex-1",
|
|
1011
|
-
inputmode: "decimal",
|
|
1012
|
-
"model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
|
|
1013
|
-
"onUpdate:modelValue": i[2] || (i[2] = (R) => r("update:model-value", {
|
|
1014
|
-
...e.modelValue,
|
|
1015
|
-
every: R
|
|
1016
|
-
}))
|
|
1017
|
-
}, {
|
|
1018
|
-
prepend: withCtx(() => [
|
|
1019
|
-
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1020
|
-
]),
|
|
1021
|
-
_: 1
|
|
1022
|
-
}, 8, ["label", "model-value"])
|
|
1023
|
-
]))
|
|
1024
|
-
];
|
|
1025
|
-
}),
|
|
1026
|
-
_: 1
|
|
1027
|
-
}, 8, ["sublabel"]),
|
|
1028
|
-
createVNode(y, {
|
|
1029
|
-
label: "Product bought",
|
|
1030
|
-
sublabel: `Receive ${unref(o)} by product bought`,
|
|
1031
|
-
value: !0,
|
|
1032
|
-
disabled: !unref(a).isPremium
|
|
1033
|
-
}, {
|
|
1034
|
-
label: withCtx(() => {
|
|
1035
|
-
var V, $;
|
|
1036
|
-
return [
|
|
1037
|
-
createElementVNode("div", _hoisted_11$1, [
|
|
1038
|
-
createTextVNode(" Product bought "),
|
|
1039
|
-
createVNode(C, { variant: "premium" })
|
|
1040
|
-
]),
|
|
1041
|
-
createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(o)) + " by product bought ", 1),
|
|
1042
|
-
unref(c) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
1043
|
-
createElementVNode("div", _hoisted_14, [
|
|
1044
|
-
createVNode(_sfc_main$f, {
|
|
1045
|
-
"model-value": s.modelValue.property || [],
|
|
1046
|
-
onConfirm: i[3] || (i[3] = (R) => r("update:model-value", {
|
|
1047
|
-
...e.modelValue,
|
|
1048
|
-
property: R
|
|
1049
|
-
}))
|
|
1050
|
-
}, {
|
|
1051
|
-
"side-sheet-button": withCtx(() => {
|
|
1052
|
-
var R, S;
|
|
1053
|
-
return [
|
|
1054
|
-
createVNode(E, {
|
|
1055
|
-
label: (R = s.modelValue.property) != null && R.length ? `${(S = s.modelValue.property) == null ? void 0 : S.length} product(s) selected` : "Select product",
|
|
1056
|
-
icon: "link",
|
|
1057
|
-
variant: "secondary"
|
|
1058
|
-
}, null, 8, ["label"])
|
|
1059
|
-
];
|
|
1060
|
-
}),
|
|
1061
|
-
_: 1
|
|
1062
|
-
}, 8, ["model-value"])
|
|
1063
|
-
]),
|
|
1064
|
-
createElementVNode("div", _hoisted_15, [
|
|
1065
|
-
createVNode(f, {
|
|
1066
|
-
inputmode: "decimal",
|
|
1067
|
-
label: `Receive ${unref(o)}(s)`,
|
|
1068
|
-
class: "flex-1",
|
|
1069
|
-
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
1070
|
-
"onUpdate:modelValue": i[4] || (i[4] = (R) => r("update:model-value", {
|
|
1071
|
-
...e.modelValue ?? { type: "FIXED" },
|
|
1072
|
-
amount: R
|
|
1073
|
-
}))
|
|
1074
|
-
}, null, 8, ["label", "model-value"]),
|
|
1075
|
-
_hoisted_16,
|
|
1076
|
-
createVNode(f, {
|
|
1077
|
-
label: "Item purchased",
|
|
1078
|
-
class: "flex-1",
|
|
1079
|
-
"model-value": (($ = e.modelValue) == null ? void 0 : $.every) ?? null,
|
|
1080
|
-
inputmode: "numeric",
|
|
1081
|
-
"max-fraction-digits": 0,
|
|
1082
|
-
"onUpdate:modelValue": i[5] || (i[5] = (R) => r("update:model-value", {
|
|
1083
|
-
...e.modelValue,
|
|
1084
|
-
every: R
|
|
1085
|
-
}))
|
|
1086
|
-
}, null, 8, ["model-value"])
|
|
1087
|
-
])
|
|
1088
|
-
])) : createCommentVNode("", !0)
|
|
1089
|
-
];
|
|
1090
|
-
}),
|
|
1091
|
-
_: 1
|
|
1092
|
-
}, 8, ["sublabel", "disabled"])
|
|
1093
|
-
]),
|
|
1094
|
-
_: 1
|
|
1095
|
-
}, 8, ["model-value"])
|
|
1096
|
-
], 64)) : createCommentVNode("", !0)
|
|
1097
|
-
]),
|
|
1098
|
-
e.errorText || unref(l).length > 0 ? (openBlock(), createBlock(B, {
|
|
1099
|
-
key: 0,
|
|
1100
|
-
class: "!mt-4",
|
|
1101
|
-
text: e.errorText || unref(ZodHelper).helperText(unref(l), ""),
|
|
1102
|
-
state: "error"
|
|
1103
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1104
|
-
]);
|
|
1105
|
-
};
|
|
1106
|
-
}
|
|
1107
|
-
}), _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({
|
|
558
|
+
}), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$b = /* @__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$9 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1108
559
|
__name: "GameTypeInput",
|
|
1109
560
|
props: {
|
|
1110
561
|
modelValue: {
|
|
@@ -1113,7 +564,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1113
564
|
},
|
|
1114
565
|
emits: ["update:model-value"],
|
|
1115
566
|
setup(e, { emit: d }) {
|
|
1116
|
-
const a = e,
|
|
567
|
+
const a = e, r = d, u = computed(
|
|
1117
568
|
() => [
|
|
1118
569
|
{
|
|
1119
570
|
label: "Fortune Wheel",
|
|
@@ -1127,28 +578,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1127
578
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
1128
579
|
hidden: !0
|
|
1129
580
|
}
|
|
1130
|
-
].filter((
|
|
581
|
+
].filter((i) => !i.hidden)
|
|
1131
582
|
);
|
|
1132
|
-
return (
|
|
1133
|
-
const
|
|
1134
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1135
|
-
_hoisted_2$
|
|
1136
|
-
createElementVNode("div", _hoisted_3$
|
|
1137
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
583
|
+
return (i, l) => {
|
|
584
|
+
const o = resolveComponent("FmCard");
|
|
585
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
586
|
+
_hoisted_2$b,
|
|
587
|
+
createElementVNode("div", _hoisted_3$9, [
|
|
588
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
1138
589
|
variant: "outlined",
|
|
1139
590
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1140
|
-
"col-span-2": unref(
|
|
591
|
+
"col-span-2": unref(u).length == 1,
|
|
1141
592
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
|
|
1142
593
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
1143
594
|
}]),
|
|
1144
595
|
onClick: () => {
|
|
1145
|
-
a.modelValue != n.value &&
|
|
596
|
+
a.modelValue != n.value && r("update:model-value", n.value);
|
|
1146
597
|
},
|
|
1147
598
|
key: n.value
|
|
1148
599
|
}, {
|
|
1149
600
|
default: withCtx(() => [
|
|
1150
|
-
createElementVNode("div", _hoisted_4$
|
|
1151
|
-
createElementVNode("div", _hoisted_5$
|
|
601
|
+
createElementVNode("div", _hoisted_4$8, toDisplayString(n.label), 1),
|
|
602
|
+
createElementVNode("div", _hoisted_5$4, toDisplayString(n.description), 1)
|
|
1152
603
|
]),
|
|
1153
604
|
_: 2
|
|
1154
605
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1156,104 +607,6 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1156
607
|
]);
|
|
1157
608
|
};
|
|
1158
609
|
}
|
|
1159
|
-
}), _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
|
-
__name: "VoucherEditor",
|
|
1161
|
-
props: {
|
|
1162
|
-
modelValue: {
|
|
1163
|
-
type: Object
|
|
1164
|
-
},
|
|
1165
|
-
rewardImage: {
|
|
1166
|
-
type: Object
|
|
1167
|
-
}
|
|
1168
|
-
},
|
|
1169
|
-
emits: ["update:model-value", "update:reward-image"],
|
|
1170
|
-
setup(e, { emit: d }) {
|
|
1171
|
-
const { t: a } = useI18n(), r = ref(
|
|
1172
|
-
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
1173
|
-
business: useCoreStore().currentBusiness.value._id,
|
|
1174
|
-
name: ""
|
|
1175
|
-
})
|
|
1176
|
-
), u = FdtoCollectibleConfig, o = d;
|
|
1177
|
-
return (l, n) => {
|
|
1178
|
-
var p, v, h;
|
|
1179
|
-
const c = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText");
|
|
1180
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
1181
|
-
createVNode(_sfc_main$u, {
|
|
1182
|
-
modelValue: unref(r).name,
|
|
1183
|
-
"onUpdate:modelValue": n[0] || (n[0] = (i) => unref(r).name = i),
|
|
1184
|
-
label: "Voucher name",
|
|
1185
|
-
schema: unref(ZodHelper).typeAtPath(unref(u), "name", [unref(r).type])
|
|
1186
|
-
}, null, 8, ["modelValue", "schema"]),
|
|
1187
|
-
createVNode(c, {
|
|
1188
|
-
class: "!mb-[-16px]",
|
|
1189
|
-
modelValue: unref(r).description,
|
|
1190
|
-
"onUpdate:modelValue": n[1] || (n[1] = (i) => unref(r).description = i),
|
|
1191
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(u), "description", [unref(r).type])]
|
|
1192
|
-
}, {
|
|
1193
|
-
label: withCtx(() => [
|
|
1194
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1195
|
-
unref(ZodHelper).toInputLabel(
|
|
1196
|
-
unref(ZodHelper).typeAtPath(unref(u), "description", [unref(r).type]),
|
|
1197
|
-
"Voucher description"
|
|
1198
|
-
)
|
|
1199
|
-
)))
|
|
1200
|
-
]),
|
|
1201
|
-
_: 1
|
|
1202
|
-
}, 8, ["modelValue", "rules"]),
|
|
1203
|
-
createElementVNode("div", _hoisted_1$c, [
|
|
1204
|
-
_hoisted_2$b,
|
|
1205
|
-
createElementVNode("div", null, toDisplayString(((p = unref(r).description) == null ? void 0 : p.length) ?? 0) + "/200", 1)
|
|
1206
|
-
]),
|
|
1207
|
-
createVNode(_sfc_main$v, {
|
|
1208
|
-
class: "w-1/2 xs:w-2/3",
|
|
1209
|
-
"aspect-ratio": "16/9",
|
|
1210
|
-
file: e.rewardImage ?? void 0,
|
|
1211
|
-
thumbnail: unref(r).image ?? void 0,
|
|
1212
|
-
"onUpdate:file": n[2] || (n[2] = async (i) => {
|
|
1213
|
-
o("update:reward-image", i), i || (unref(r).image = null);
|
|
1214
|
-
})
|
|
1215
|
-
}, {
|
|
1216
|
-
label: withCtx(() => [
|
|
1217
|
-
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1218
|
-
unref(ZodHelper).toInputLabel(
|
|
1219
|
-
unref(ZodHelper).typeAtPath(unref(u), "image", [unref(r).type]),
|
|
1220
|
-
"Voucher image"
|
|
1221
|
-
)
|
|
1222
|
-
)))
|
|
1223
|
-
]),
|
|
1224
|
-
_: 1
|
|
1225
|
-
}, 8, ["file", "thumbnail"]),
|
|
1226
|
-
_hoisted_3$9,
|
|
1227
|
-
createVNode(_sfc_main$w, {
|
|
1228
|
-
"model-value": unref(r).extras.effect,
|
|
1229
|
-
"onUpdate:modelValue": n[3] || (n[3] = (i) => unref(r).extras.effect = i)
|
|
1230
|
-
}, null, 8, ["model-value"]),
|
|
1231
|
-
unref(r).extras.effect == null ? (openBlock(), createBlock(g, {
|
|
1232
|
-
key: 0,
|
|
1233
|
-
class: "!mt-8",
|
|
1234
|
-
text: unref(a)("connect.campaign.common.effect_required"),
|
|
1235
|
-
state: "error"
|
|
1236
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1237
|
-
_hoisted_4$8,
|
|
1238
|
-
createVNode(_sfc_main$x, {
|
|
1239
|
-
"model-value": unref(r).options,
|
|
1240
|
-
"no-campaign": unref(r).noCampaign,
|
|
1241
|
-
"onUpdate:modelValue": n[4] || (n[4] = (i) => unref(r).options = i),
|
|
1242
|
-
schema: unref(ZodHelper).typeAtPath(unref(u), "options", ["VOUCHER"])
|
|
1243
|
-
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1244
|
-
_hoisted_5$4,
|
|
1245
|
-
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1246
|
-
key: 1,
|
|
1247
|
-
"model-value": ((h = (v = unref(r).extras) == null ? void 0 : v.targetLocation) == null ? void 0 : h.map(String)) ?? null,
|
|
1248
|
-
type: "select",
|
|
1249
|
-
"onUpdate:modelValue": n[5] || (n[5] = (i) => {
|
|
1250
|
-
unref(r).extras.targetLocation = i;
|
|
1251
|
-
}),
|
|
1252
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(u), "extras.targetLocation")]
|
|
1253
|
-
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
|
|
1254
|
-
], 64);
|
|
1255
|
-
};
|
|
1256
|
-
}
|
|
1257
610
|
}), _hoisted_1$b = {
|
|
1258
611
|
key: 0,
|
|
1259
612
|
class: "flex flex-col gap-y-24"
|
|
@@ -1261,72 +614,72 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1261
614
|
__name: "EditRewardPoolSheet",
|
|
1262
615
|
emits: ["update:model-value"],
|
|
1263
616
|
setup(e, { expose: d, emit: a }) {
|
|
1264
|
-
const
|
|
1265
|
-
var
|
|
1266
|
-
return ((
|
|
617
|
+
const r = useMembershipStore(), { minor: u } = useLoading, i = ref(!1), l = ref(), o = ref(), n = ref(0), c = computed(() => {
|
|
618
|
+
var s;
|
|
619
|
+
return ((s = r.loyaltyRewards.items.find(
|
|
1267
620
|
(f) => {
|
|
1268
|
-
var
|
|
1269
|
-
return f.value === ((
|
|
621
|
+
var m;
|
|
622
|
+
return f.value === ((m = l.value) == null ? void 0 : m.collectible);
|
|
1270
623
|
}
|
|
1271
|
-
)) == null ? void 0 :
|
|
624
|
+
)) == null ? void 0 : s.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1272
625
|
}), g = computed(() => {
|
|
1273
|
-
const
|
|
1274
|
-
return
|
|
626
|
+
const p = c.value.safeParse(l.value);
|
|
627
|
+
return p.success ? [] : p.error.errors;
|
|
1275
628
|
});
|
|
1276
|
-
function p
|
|
1277
|
-
|
|
629
|
+
function y(p, s, f) {
|
|
630
|
+
p && (l.value = s, n.value = f), i.value = p;
|
|
1278
631
|
}
|
|
1279
632
|
const v = a;
|
|
1280
633
|
async function h() {
|
|
1281
|
-
const
|
|
1282
|
-
|
|
634
|
+
const p = c.value.safeParse(l.value);
|
|
635
|
+
p.success && (await u(
|
|
1283
636
|
async () => {
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
637
|
+
p.data.type === "VOUCHER" && o.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
638
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
639
|
+
o.value
|
|
1287
640
|
));
|
|
1288
641
|
},
|
|
1289
642
|
{
|
|
1290
643
|
message: "Uploading reward image",
|
|
1291
644
|
successMessage: "Reward image updated"
|
|
1292
645
|
}
|
|
1293
|
-
), v("update:model-value",
|
|
646
|
+
), v("update:model-value", p.data, n.value));
|
|
1294
647
|
}
|
|
1295
648
|
return d({
|
|
1296
|
-
showSheet:
|
|
1297
|
-
}), (
|
|
1298
|
-
const f = resolveComponent("FmSelect"),
|
|
1299
|
-
return openBlock(), createBlock(
|
|
649
|
+
showSheet: y
|
|
650
|
+
}), (p, s) => {
|
|
651
|
+
const f = resolveComponent("FmSelect"), m = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
|
|
652
|
+
return openBlock(), createBlock(x, {
|
|
1300
653
|
"max-width": 560,
|
|
1301
|
-
modelValue: unref(
|
|
654
|
+
modelValue: unref(i),
|
|
1302
655
|
"onUpdate:modelValue": [
|
|
1303
|
-
|
|
1304
|
-
|
|
656
|
+
s[9] || (s[9] = (k) => isRef(i) ? i.value = k : null),
|
|
657
|
+
s[10] || (s[10] = (k) => i.value = k)
|
|
1305
658
|
],
|
|
1306
659
|
header: "Edit reward",
|
|
1307
660
|
"dismiss-away": ""
|
|
1308
661
|
}, {
|
|
1309
662
|
"side-sheet-footer": withCtx(() => [
|
|
1310
663
|
createElementVNode("div", _hoisted_4$7, [
|
|
1311
|
-
createVNode(
|
|
664
|
+
createVNode(b, {
|
|
1312
665
|
variant: "primary",
|
|
1313
666
|
type: "button",
|
|
1314
667
|
disabled: unref(g).length > 0,
|
|
1315
668
|
label: "Confirm",
|
|
1316
|
-
onClick:
|
|
669
|
+
onClick: s[7] || (s[7] = (k) => h())
|
|
1317
670
|
}, null, 8, ["disabled"]),
|
|
1318
|
-
createVNode(
|
|
671
|
+
createVNode(b, {
|
|
1319
672
|
variant: "secondary",
|
|
1320
673
|
type: "button",
|
|
1321
674
|
label: "Cancel",
|
|
1322
|
-
onClick:
|
|
675
|
+
onClick: s[8] || (s[8] = (k) => i.value = !1)
|
|
1323
676
|
})
|
|
1324
677
|
])
|
|
1325
678
|
]),
|
|
1326
679
|
default: withCtx(() => {
|
|
1327
|
-
var
|
|
680
|
+
var k, C, B;
|
|
1328
681
|
return [
|
|
1329
|
-
unref(
|
|
682
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1330
683
|
createVNode(f, {
|
|
1331
684
|
label: "Reward Type",
|
|
1332
685
|
items: [
|
|
@@ -1334,13 +687,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1334
687
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1335
688
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1336
689
|
],
|
|
1337
|
-
"model-value": unref(
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1339
|
-
|
|
690
|
+
"model-value": unref(l).type,
|
|
691
|
+
"onUpdate:modelValue": s[0] || (s[0] = (V) => {
|
|
692
|
+
V == "NO_REWARD" ? l.value = {
|
|
1340
693
|
type: "NO_REWARD",
|
|
1341
694
|
collectible: null,
|
|
1342
695
|
weight: 1
|
|
1343
|
-
} :
|
|
696
|
+
} : V === "VOUCHER" ? l.value = {
|
|
1344
697
|
collectible: null,
|
|
1345
698
|
type: "VOUCHER",
|
|
1346
699
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1354,8 +707,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1354
707
|
validForDay: 7
|
|
1355
708
|
},
|
|
1356
709
|
weight: 1
|
|
1357
|
-
} :
|
|
1358
|
-
collectible: unref(
|
|
710
|
+
} : l.value = {
|
|
711
|
+
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
1359
712
|
type: "LOYALTY",
|
|
1360
713
|
earningOption: {
|
|
1361
714
|
amount: 1,
|
|
@@ -1368,72 +721,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1368
721
|
};
|
|
1369
722
|
})
|
|
1370
723
|
}, null, 8, ["model-value"]),
|
|
1371
|
-
unref(
|
|
724
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
|
|
1372
725
|
key: 0,
|
|
1373
726
|
label: "Loyalty type",
|
|
1374
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(
|
|
1375
|
-
items: unref(
|
|
1376
|
-
"model-value": unref(
|
|
1377
|
-
"onUpdate:modelValue":
|
|
727
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
|
|
728
|
+
items: unref(r).loyaltyRewards.items,
|
|
729
|
+
"model-value": unref(l).collectible,
|
|
730
|
+
"onUpdate:modelValue": s[1] || (s[1] = (V) => unref(l).collectible = V)
|
|
1378
731
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1379
|
-
createVNode(
|
|
732
|
+
createVNode(m, {
|
|
1380
733
|
label: "Weight",
|
|
1381
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(
|
|
1382
|
-
"model-value": unref(
|
|
1383
|
-
"onUpdate:modelValue":
|
|
1384
|
-
...unref(
|
|
1385
|
-
weight:
|
|
734
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
|
|
735
|
+
"model-value": unref(l).weight,
|
|
736
|
+
"onUpdate:modelValue": s[2] || (s[2] = (V) => l.value = {
|
|
737
|
+
...unref(l),
|
|
738
|
+
weight: V
|
|
1386
739
|
})
|
|
1387
740
|
}, null, 8, ["rules", "model-value"]),
|
|
1388
|
-
unref(
|
|
1389
|
-
((
|
|
1390
|
-
(
|
|
1391
|
-
var
|
|
1392
|
-
return
|
|
741
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
742
|
+
((k = unref(r).loyaltyRewards.items.find(
|
|
743
|
+
(V) => {
|
|
744
|
+
var R;
|
|
745
|
+
return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1393
746
|
}
|
|
1394
|
-
)) == null ? void 0 :
|
|
747
|
+
)) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1395
748
|
_hoisted_2$a,
|
|
1396
|
-
createVNode(_sfc_main$
|
|
749
|
+
createVNode(_sfc_main$l, {
|
|
1397
750
|
class: "mt-[-8px]",
|
|
1398
751
|
rules: [
|
|
1399
|
-
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(
|
|
752
|
+
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
|
|
1400
753
|
],
|
|
1401
754
|
"helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
|
|
1402
755
|
"error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
|
|
1403
756
|
"fixed-type": !0,
|
|
1404
|
-
"model-value": unref(
|
|
1405
|
-
"onUpdate:modelValue":
|
|
1406
|
-
...unref(
|
|
1407
|
-
earningOption:
|
|
757
|
+
"model-value": unref(l).earningOption,
|
|
758
|
+
"onUpdate:modelValue": s[3] || (s[3] = (V) => l.value = {
|
|
759
|
+
...unref(l),
|
|
760
|
+
earningOption: V
|
|
1408
761
|
})
|
|
1409
762
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1410
763
|
], 64)) : createCommentVNode("", !0),
|
|
1411
764
|
_hoisted_3$8,
|
|
1412
|
-
createVNode(_sfc_main$
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
765
|
+
createVNode(_sfc_main$m, {
|
|
766
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
767
|
+
"for-credit": unref(l).type === "LOYALTY" && ((C = unref(r).loyaltyRewards.items.find(
|
|
768
|
+
(V) => {
|
|
769
|
+
var R;
|
|
770
|
+
return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1417
771
|
}
|
|
1418
|
-
)) == null ? void 0 :
|
|
772
|
+
)) == null ? void 0 : C.raw.type) === "CREDIT",
|
|
1419
773
|
class: "!gap-24",
|
|
1420
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(
|
|
1421
|
-
"model-value": unref(
|
|
1422
|
-
"onUpdate:modelValue":
|
|
1423
|
-
...unref(
|
|
1424
|
-
validityOption:
|
|
774
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
|
|
775
|
+
"model-value": unref(l).validityOption,
|
|
776
|
+
"onUpdate:modelValue": s[4] || (s[4] = (V) => l.value = {
|
|
777
|
+
...unref(l),
|
|
778
|
+
validityOption: V
|
|
1425
779
|
})
|
|
1426
|
-
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
780
|
+
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1427
781
|
], 64)) : createCommentVNode("", !0),
|
|
1428
|
-
unref(
|
|
782
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1429
783
|
key: 2,
|
|
1430
|
-
"reward-image": unref(
|
|
1431
|
-
"model-value": ((
|
|
1432
|
-
"onUpdate:modelValue":
|
|
1433
|
-
...unref(
|
|
1434
|
-
collectibleConfig:
|
|
784
|
+
"reward-image": unref(o),
|
|
785
|
+
"model-value": ((B = unref(l)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
786
|
+
"onUpdate:modelValue": s[5] || (s[5] = (V) => l.value = {
|
|
787
|
+
...unref(l),
|
|
788
|
+
collectibleConfig: V
|
|
1435
789
|
}),
|
|
1436
|
-
"onUpdate:rewardImage":
|
|
790
|
+
"onUpdate:rewardImage": s[6] || (s[6] = (V) => o.value = V)
|
|
1437
791
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1438
792
|
createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
|
|
1439
793
|
])) : createCommentVNode("", !0)
|
|
@@ -1463,80 +817,80 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1463
817
|
},
|
|
1464
818
|
emits: ["update:model-value"],
|
|
1465
819
|
setup(e, { emit: d }) {
|
|
1466
|
-
const a = e,
|
|
1467
|
-
const
|
|
1468
|
-
return
|
|
820
|
+
const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
|
|
821
|
+
const p = i.safeParse(l.value);
|
|
822
|
+
return p.success ? [] : p.error.errors;
|
|
1469
823
|
}), n = ref();
|
|
1470
|
-
function c(
|
|
1471
|
-
var
|
|
1472
|
-
const f = [...
|
|
1473
|
-
f[
|
|
824
|
+
function c(p, s) {
|
|
825
|
+
var m;
|
|
826
|
+
const f = [...l.value];
|
|
827
|
+
f[s] = p, (m = n.value) == null || m.showSheet(!1), r("update:model-value", f);
|
|
1474
828
|
}
|
|
1475
|
-
function g(
|
|
1476
|
-
const
|
|
1477
|
-
(
|
|
1478
|
-
), f = CollectionUtils.formattedType((
|
|
829
|
+
function g(p) {
|
|
830
|
+
const s = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
|
|
831
|
+
(b) => b._id.toString() == p.collectible
|
|
832
|
+
), f = CollectionUtils.formattedType((s == null ? void 0 : s.name) || ""), m = p.weight;
|
|
1479
833
|
return {
|
|
1480
834
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1481
|
-
sublabel: `${
|
|
835
|
+
sublabel: `${m} (${(m / l.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
|
|
1482
836
|
};
|
|
1483
837
|
}
|
|
1484
|
-
function p
|
|
838
|
+
function y(p) {
|
|
1485
839
|
var f;
|
|
1486
|
-
const
|
|
1487
|
-
(f = n.value) == null || f.showSheet(!0,
|
|
840
|
+
const s = [...l.value];
|
|
841
|
+
(f = n.value) == null || f.showSheet(!0, s[p], p);
|
|
1488
842
|
}
|
|
1489
|
-
function v(
|
|
1490
|
-
const
|
|
1491
|
-
|
|
843
|
+
function v(p) {
|
|
844
|
+
const s = [...l.value];
|
|
845
|
+
s.splice(p, 1), r("update:model-value", s);
|
|
1492
846
|
}
|
|
1493
847
|
function h() {
|
|
1494
|
-
var
|
|
1495
|
-
(
|
|
848
|
+
var p;
|
|
849
|
+
(p = n.value) == null || p.showSheet(
|
|
1496
850
|
!0,
|
|
1497
851
|
{
|
|
1498
852
|
type: "NO_REWARD",
|
|
1499
853
|
collectible: null,
|
|
1500
854
|
weight: 1
|
|
1501
855
|
},
|
|
1502
|
-
|
|
856
|
+
l.value.length
|
|
1503
857
|
);
|
|
1504
858
|
}
|
|
1505
|
-
return (
|
|
1506
|
-
const f = resolveComponent("FmButton"),
|
|
859
|
+
return (p, s) => {
|
|
860
|
+
const f = resolveComponent("FmButton"), m = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
1507
861
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1508
862
|
_hoisted_2$9,
|
|
1509
863
|
createVNode(f, {
|
|
1510
864
|
label: "Add Reward",
|
|
1511
|
-
onClick:
|
|
865
|
+
onClick: s[0] || (s[0] = (x) => h()),
|
|
1512
866
|
variant: "plain",
|
|
1513
867
|
icon: "add"
|
|
1514
868
|
}),
|
|
1515
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1516
|
-
key:
|
|
869
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, k) => (openBlock(), createBlock(m, {
|
|
870
|
+
key: k,
|
|
1517
871
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1518
872
|
variant: "outlined",
|
|
1519
|
-
onClick: (
|
|
873
|
+
onClick: (C) => y(k)
|
|
1520
874
|
}, {
|
|
1521
875
|
default: withCtx(() => {
|
|
1522
|
-
var
|
|
876
|
+
var C;
|
|
1523
877
|
return [
|
|
1524
878
|
createElementVNode("div", null, [
|
|
1525
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(
|
|
1526
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(g(
|
|
879
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(x.type == "LOYALTY" ? (C = x == null ? void 0 : x.earningOption) == null ? void 0 : C.amount : "") + " " + toDisplayString(g(x).label), 1),
|
|
880
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(g(x).sublabel), 1)
|
|
1527
881
|
]),
|
|
1528
882
|
createVNode(f, {
|
|
1529
883
|
icon: "delete",
|
|
1530
884
|
variant: "tertiary",
|
|
1531
|
-
onClick: (
|
|
885
|
+
onClick: (B) => (B.stopPropagation(), v(k))
|
|
1532
886
|
}, null, 8, ["onClick"])
|
|
1533
887
|
];
|
|
1534
888
|
}),
|
|
1535
889
|
_: 2
|
|
1536
890
|
}, 1032, ["onClick"]))), 128)),
|
|
1537
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1538
|
-
key:
|
|
1539
|
-
text:
|
|
891
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
|
|
892
|
+
key: x.message,
|
|
893
|
+
text: x.message,
|
|
1540
894
|
state: "error"
|
|
1541
895
|
}, null, 8, ["text"]))), 128)),
|
|
1542
896
|
createVNode(_sfc_main$b, {
|
|
@@ -1559,35 +913,35 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1559
913
|
},
|
|
1560
914
|
emits: ["update:model-value"],
|
|
1561
915
|
setup(e, { emit: d }) {
|
|
1562
|
-
const a = e,
|
|
916
|
+
const a = e, r = d, u = computed(() => [
|
|
1563
917
|
{
|
|
1564
918
|
label: "Rock paper scissor",
|
|
1565
919
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
1566
920
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1567
921
|
}
|
|
1568
922
|
]);
|
|
1569
|
-
return (
|
|
1570
|
-
var g,
|
|
1571
|
-
const
|
|
923
|
+
return (i, l) => {
|
|
924
|
+
var g, y, v;
|
|
925
|
+
const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
|
|
1572
926
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1573
|
-
createVNode(
|
|
927
|
+
createVNode(o, {
|
|
1574
928
|
label: "Enable game",
|
|
1575
929
|
"model-value": !!((g = e.modelValue) != null && g.gameType),
|
|
1576
|
-
"onUpdate:modelValue":
|
|
930
|
+
"onUpdate:modelValue": l[0] || (l[0] = (h) => h ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1577
931
|
}, null, 8, ["model-value"]),
|
|
1578
|
-
((
|
|
1579
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1580
|
-
var
|
|
932
|
+
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
933
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
|
|
934
|
+
var p, s;
|
|
1581
935
|
return openBlock(), createBlock(n, {
|
|
1582
936
|
variant: "outlined",
|
|
1583
937
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1584
|
-
"col-span-2": unref(
|
|
1585
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
1586
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
938
|
+
"col-span-2": unref(u).length == 1,
|
|
939
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == h.value,
|
|
940
|
+
"hover:bg-fm-color-opacity-sm": ((s = e.modelValue) == null ? void 0 : s.gameType) != h.value
|
|
1587
941
|
}]),
|
|
1588
942
|
onClick: () => {
|
|
1589
943
|
var f;
|
|
1590
|
-
((f = a.modelValue) == null ? void 0 : f.gameType) != h.value &&
|
|
944
|
+
((f = a.modelValue) == null ? void 0 : f.gameType) != h.value && r("update:model-value", { gameType: h.value });
|
|
1591
945
|
},
|
|
1592
946
|
key: h.value
|
|
1593
947
|
}, {
|
|
@@ -1616,7 +970,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1616
970
|
},
|
|
1617
971
|
emits: ["update:model-value"],
|
|
1618
972
|
setup(e, { emit: d }) {
|
|
1619
|
-
const a = e,
|
|
973
|
+
const a = e, r = d, u = computed(() => [
|
|
1620
974
|
{
|
|
1621
975
|
label: "Stamp",
|
|
1622
976
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -1628,20 +982,20 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1628
982
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1629
983
|
}
|
|
1630
984
|
]);
|
|
1631
|
-
return (
|
|
1632
|
-
const
|
|
985
|
+
return (i, l) => {
|
|
986
|
+
const o = resolveComponent("FmCard");
|
|
1633
987
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1634
988
|
_hoisted_2$7,
|
|
1635
989
|
createElementVNode("div", _hoisted_3$5, [
|
|
1636
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
990
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
1637
991
|
variant: "outlined",
|
|
1638
992
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1639
|
-
"col-span-2": unref(
|
|
993
|
+
"col-span-2": unref(u).length == 1,
|
|
1640
994
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
|
|
1641
995
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
1642
996
|
}]),
|
|
1643
997
|
onClick: () => {
|
|
1644
|
-
a.modelValue != n.value &&
|
|
998
|
+
a.modelValue != n.value && r("update:model-value", n.value);
|
|
1645
999
|
},
|
|
1646
1000
|
key: n.value
|
|
1647
1001
|
}, {
|
|
@@ -1671,14 +1025,14 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1671
1025
|
emits: ["update:model-value"],
|
|
1672
1026
|
setup(e, { emit: d }) {
|
|
1673
1027
|
const a = d;
|
|
1674
|
-
return (
|
|
1675
|
-
const
|
|
1028
|
+
return (r, u) => {
|
|
1029
|
+
const i = resolveComponent("FmStepperField");
|
|
1676
1030
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1677
1031
|
_hoisted_2$6,
|
|
1678
|
-
createVNode(
|
|
1032
|
+
createVNode(i, {
|
|
1679
1033
|
label: "Maximum to collect",
|
|
1680
1034
|
"model-value": e.modelValue || null,
|
|
1681
|
-
"onUpdate:modelValue":
|
|
1035
|
+
"onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
|
|
1682
1036
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1683
1037
|
"helper-state": e.helperState || "none"
|
|
1684
1038
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1695,18 +1049,25 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1695
1049
|
},
|
|
1696
1050
|
emits: ["update:model-value"],
|
|
1697
1051
|
setup(e, { expose: d, emit: a }) {
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1052
|
+
const r = e, u = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), o = ref(), n = ref(), c = ref(0), g = computed(() => {
|
|
1053
|
+
var m;
|
|
1054
|
+
return ((m = u.loyaltyRewards.items.find(
|
|
1055
|
+
(b) => {
|
|
1056
|
+
var x;
|
|
1057
|
+
return b.value === ((x = o.value) == null ? void 0 : x.collectible);
|
|
1058
|
+
}
|
|
1059
|
+
)) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1060
|
+
}), y = computed(() => {
|
|
1061
|
+
const f = g.value.safeParse(o.value);
|
|
1700
1062
|
return f.success ? [] : f.error.errors;
|
|
1701
1063
|
});
|
|
1702
|
-
function v(f,
|
|
1703
|
-
f && (
|
|
1064
|
+
function v(f, m, b) {
|
|
1065
|
+
f && (o.value = m, c.value = b), l.value = f;
|
|
1704
1066
|
}
|
|
1705
1067
|
const h = a;
|
|
1706
|
-
async function
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
f.success && (await u(
|
|
1068
|
+
async function p() {
|
|
1069
|
+
const f = g.value.safeParse(o.value);
|
|
1070
|
+
f.success && (await i(
|
|
1710
1071
|
async () => {
|
|
1711
1072
|
f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1712
1073
|
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
@@ -1719,78 +1080,80 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1719
1080
|
}
|
|
1720
1081
|
), h("update:model-value", f.data, c.value));
|
|
1721
1082
|
}
|
|
1722
|
-
const
|
|
1083
|
+
const s = ref();
|
|
1723
1084
|
return d({
|
|
1724
1085
|
showSheet: v
|
|
1725
|
-
}), (f,
|
|
1726
|
-
const
|
|
1727
|
-
return openBlock(), createBlock(
|
|
1086
|
+
}), (f, m) => {
|
|
1087
|
+
const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1088
|
+
return openBlock(), createBlock(B, {
|
|
1728
1089
|
"max-width": 560,
|
|
1729
|
-
modelValue: unref(
|
|
1090
|
+
modelValue: unref(l),
|
|
1730
1091
|
"onUpdate:modelValue": [
|
|
1731
|
-
|
|
1732
|
-
|
|
1092
|
+
m[10] || (m[10] = (V) => isRef(l) ? l.value = V : null),
|
|
1093
|
+
m[11] || (m[11] = (V) => l.value = V)
|
|
1733
1094
|
],
|
|
1734
1095
|
header: "Edit reward",
|
|
1735
1096
|
"dismiss-away": ""
|
|
1736
1097
|
}, {
|
|
1737
1098
|
"side-sheet-footer": withCtx(() => [
|
|
1738
1099
|
createElementVNode("div", _hoisted_2$5, [
|
|
1739
|
-
createVNode(
|
|
1100
|
+
createVNode(C, {
|
|
1740
1101
|
variant: "primary",
|
|
1741
1102
|
type: "button",
|
|
1742
1103
|
label: "Confirm",
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1104
|
+
disabled: unref(y).length > 0,
|
|
1105
|
+
onClick: m[8] || (m[8] = async () => {
|
|
1106
|
+
var V;
|
|
1107
|
+
return (V = unref(s)) == null ? void 0 : V.validateInputs();
|
|
1746
1108
|
})
|
|
1747
|
-
}),
|
|
1748
|
-
createVNode(
|
|
1109
|
+
}, null, 8, ["disabled"]),
|
|
1110
|
+
createVNode(C, {
|
|
1749
1111
|
variant: "secondary",
|
|
1750
1112
|
type: "button",
|
|
1751
1113
|
label: "Cancel",
|
|
1752
|
-
onClick:
|
|
1114
|
+
onClick: m[9] || (m[9] = (V) => l.value = !1)
|
|
1753
1115
|
})
|
|
1754
1116
|
])
|
|
1755
1117
|
]),
|
|
1756
1118
|
default: withCtx(() => [
|
|
1757
|
-
|
|
1119
|
+
createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
|
|
1120
|
+
unref(o) ? (openBlock(), createBlock(k, {
|
|
1758
1121
|
key: 0,
|
|
1759
1122
|
class: "flex flex-col gap-y-24",
|
|
1760
1123
|
ref_key: "formRef",
|
|
1761
|
-
ref:
|
|
1762
|
-
onValidationSuccess:
|
|
1124
|
+
ref: s,
|
|
1125
|
+
onValidationSuccess: m[7] || (m[7] = (V) => p())
|
|
1763
1126
|
}, {
|
|
1764
1127
|
default: withCtx(() => {
|
|
1765
|
-
var
|
|
1128
|
+
var V, R;
|
|
1766
1129
|
return [
|
|
1767
|
-
unref(
|
|
1130
|
+
unref(o).type ? (openBlock(), createBlock(b, {
|
|
1768
1131
|
key: 0,
|
|
1769
1132
|
label: "Threshold",
|
|
1770
1133
|
rules: [
|
|
1771
1134
|
unref(ZodHelper).toRule(
|
|
1772
1135
|
unref(z).number().min(1).max(
|
|
1773
|
-
|
|
1774
|
-
`Number cannot be more than ${
|
|
1136
|
+
r.maxThreshold,
|
|
1137
|
+
`Number cannot be more than ${r.maxThreshold}`
|
|
1775
1138
|
)
|
|
1776
1139
|
)
|
|
1777
1140
|
],
|
|
1778
|
-
"model-value": unref(
|
|
1779
|
-
"onUpdate:modelValue":
|
|
1780
|
-
...unref(
|
|
1781
|
-
threshold:
|
|
1141
|
+
"model-value": unref(o).threshold,
|
|
1142
|
+
"onUpdate:modelValue": m[0] || (m[0] = (E) => o.value = {
|
|
1143
|
+
...unref(o),
|
|
1144
|
+
threshold: E
|
|
1782
1145
|
})
|
|
1783
1146
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1784
|
-
createVNode(
|
|
1147
|
+
createVNode(x, {
|
|
1785
1148
|
label: "Reward Type",
|
|
1786
1149
|
items: [
|
|
1787
1150
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1788
1151
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1789
1152
|
],
|
|
1790
|
-
"model-value": unref(
|
|
1791
|
-
"onUpdate:modelValue":
|
|
1792
|
-
var
|
|
1793
|
-
|
|
1153
|
+
"model-value": unref(o).type,
|
|
1154
|
+
"onUpdate:modelValue": m[1] || (m[1] = (E) => {
|
|
1155
|
+
var S, $;
|
|
1156
|
+
E === "VOUCHER" ? o.value = {
|
|
1794
1157
|
collectible: null,
|
|
1795
1158
|
type: "VOUCHER",
|
|
1796
1159
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1803,9 +1166,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1803
1166
|
validityOption: {
|
|
1804
1167
|
validForDay: 7
|
|
1805
1168
|
},
|
|
1806
|
-
threshold: (
|
|
1807
|
-
} :
|
|
1808
|
-
collectible: unref(
|
|
1169
|
+
threshold: (S = unref(o)) == null ? void 0 : S.threshold
|
|
1170
|
+
} : o.value = {
|
|
1171
|
+
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
1809
1172
|
type: "LOYALTY",
|
|
1810
1173
|
earningOption: {
|
|
1811
1174
|
amount: 1,
|
|
@@ -1814,59 +1177,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1814
1177
|
validityOption: {
|
|
1815
1178
|
validForDay: 7
|
|
1816
1179
|
},
|
|
1817
|
-
threshold: (
|
|
1180
|
+
threshold: ($ = unref(o)) == null ? void 0 : $.threshold
|
|
1818
1181
|
};
|
|
1819
1182
|
})
|
|
1820
1183
|
}, null, 8, ["model-value"]),
|
|
1821
|
-
unref(
|
|
1184
|
+
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(x, {
|
|
1822
1185
|
key: 1,
|
|
1823
1186
|
label: "Loyalty type",
|
|
1824
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(
|
|
1825
|
-
items: unref(
|
|
1826
|
-
"model-value": unref(
|
|
1827
|
-
"onUpdate:modelValue":
|
|
1187
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(o).type])],
|
|
1188
|
+
items: unref(u).loyaltyRewards.items,
|
|
1189
|
+
"model-value": unref(o).collectible,
|
|
1190
|
+
"onUpdate:modelValue": m[2] || (m[2] = (E) => unref(o).collectible = E)
|
|
1828
1191
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1829
|
-
unref(
|
|
1192
|
+
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1830
1193
|
_hoisted_1$6,
|
|
1831
|
-
createVNode(_sfc_main$
|
|
1194
|
+
createVNode(_sfc_main$l, {
|
|
1832
1195
|
class: "mt-[-8px]",
|
|
1833
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(
|
|
1834
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1835
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1196
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(o).type])],
|
|
1197
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1198
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1836
1199
|
"fixed-type": !0,
|
|
1837
|
-
"model-value": unref(
|
|
1838
|
-
"onUpdate:modelValue":
|
|
1839
|
-
...unref(
|
|
1840
|
-
earningOption:
|
|
1200
|
+
"model-value": unref(o).earningOption,
|
|
1201
|
+
"onUpdate:modelValue": m[3] || (m[3] = (E) => o.value = {
|
|
1202
|
+
...unref(o),
|
|
1203
|
+
earningOption: E
|
|
1841
1204
|
})
|
|
1842
1205
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1843
|
-
createVNode(_sfc_main$
|
|
1206
|
+
createVNode(_sfc_main$m, {
|
|
1844
1207
|
class: "!gap-24",
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1208
|
+
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
1209
|
+
"for-credit": unref(o).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
|
|
1210
|
+
(E) => {
|
|
1211
|
+
var S;
|
|
1212
|
+
return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
|
|
1849
1213
|
}
|
|
1850
|
-
)) == null ? void 0 :
|
|
1851
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(
|
|
1852
|
-
"model-value": unref(
|
|
1853
|
-
"onUpdate:modelValue":
|
|
1854
|
-
...unref(
|
|
1855
|
-
validityOption:
|
|
1214
|
+
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1215
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(o).type])],
|
|
1216
|
+
"model-value": unref(o).validityOption,
|
|
1217
|
+
"onUpdate:modelValue": m[4] || (m[4] = (E) => o.value = {
|
|
1218
|
+
...unref(o),
|
|
1219
|
+
validityOption: E
|
|
1856
1220
|
})
|
|
1857
|
-
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1221
|
+
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1858
1222
|
], 64)) : createCommentVNode("", !0),
|
|
1859
|
-
unref(
|
|
1223
|
+
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1860
1224
|
key: 3,
|
|
1861
1225
|
"reward-image": unref(n),
|
|
1862
|
-
"model-value": ((
|
|
1863
|
-
"onUpdate:modelValue":
|
|
1864
|
-
...unref(
|
|
1865
|
-
collectibleConfig:
|
|
1226
|
+
"model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1227
|
+
"onUpdate:modelValue": m[5] || (m[5] = (E) => o.value = {
|
|
1228
|
+
...unref(o),
|
|
1229
|
+
collectibleConfig: E
|
|
1866
1230
|
}),
|
|
1867
|
-
"onUpdate:rewardImage":
|
|
1231
|
+
"onUpdate:rewardImage": m[6] || (m[6] = (E) => n.value = E)
|
|
1868
1232
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1869
|
-
createVNode(JsonViewer, { json: unref(
|
|
1233
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1870
1234
|
];
|
|
1871
1235
|
}),
|
|
1872
1236
|
_: 1
|
|
@@ -1900,19 +1264,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1900
1264
|
}
|
|
1901
1265
|
},
|
|
1902
1266
|
setup(e) {
|
|
1903
|
-
const d = e, { maxRange: a, currentRange:
|
|
1904
|
-
() => Math.min(
|
|
1905
|
-
),
|
|
1906
|
-
return (
|
|
1267
|
+
const d = e, { maxRange: a, currentRange: r, markers: u } = toRefs(d), i = computed(
|
|
1268
|
+
() => Math.min(r.value / a.value * 100, 100)
|
|
1269
|
+
), l = (o) => o / a.value * 100;
|
|
1270
|
+
return (o, n) => {
|
|
1907
1271
|
const c = resolveComponent("FmIcon");
|
|
1908
1272
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1909
1273
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(c, {
|
|
1910
1274
|
class: normalizeClass(
|
|
1911
|
-
unref(
|
|
1275
|
+
unref(r) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1912
1276
|
),
|
|
1913
|
-
outline: unref(
|
|
1277
|
+
outline: unref(r) < g,
|
|
1914
1278
|
key: g,
|
|
1915
|
-
name: unref(
|
|
1279
|
+
name: unref(u).some((y) => y === g) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1916
1280
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1917
1281
|
])) : (openBlock(), createElementBlock("div", {
|
|
1918
1282
|
key: 1,
|
|
@@ -1920,12 +1284,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1920
1284
|
}, [
|
|
1921
1285
|
createElementVNode("div", {
|
|
1922
1286
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1923
|
-
style: normalizeStyle({ width: unref(
|
|
1287
|
+
style: normalizeStyle({ width: unref(i) + "%" })
|
|
1924
1288
|
}, null, 4),
|
|
1925
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1926
|
-
key:
|
|
1289
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g, y) => (openBlock(), createElementBlock("div", {
|
|
1290
|
+
key: y,
|
|
1927
1291
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1928
|
-
style: normalizeStyle({ left:
|
|
1292
|
+
style: normalizeStyle({ left: l(g) + "%" })
|
|
1929
1293
|
}, [
|
|
1930
1294
|
createElementVNode("div", _hoisted_2$4, [
|
|
1931
1295
|
createElementVNode("div", {
|
|
@@ -1939,16 +1303,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1939
1303
|
}
|
|
1940
1304
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1941
1305
|
function changeKeysFactory(e) {
|
|
1942
|
-
return function d(a,
|
|
1943
|
-
if (
|
|
1306
|
+
return function d(a, r = 1, u) {
|
|
1307
|
+
if (r === 0 || !isObject(a))
|
|
1944
1308
|
return a;
|
|
1945
1309
|
if (Array.isArray(a))
|
|
1946
|
-
return a.map((
|
|
1947
|
-
const
|
|
1948
|
-
return Object.keys(a).forEach((
|
|
1949
|
-
const
|
|
1950
|
-
|
|
1951
|
-
}),
|
|
1310
|
+
return a.map((l) => d(l, r - 1, u));
|
|
1311
|
+
const i = Object.create(Object.getPrototypeOf(a));
|
|
1312
|
+
return Object.keys(a).forEach((l) => {
|
|
1313
|
+
const o = a[l], n = e(l, u), c = d(o, r - 1, u);
|
|
1314
|
+
i[n] = c;
|
|
1315
|
+
}), i;
|
|
1952
1316
|
};
|
|
1953
1317
|
}
|
|
1954
1318
|
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({
|
|
@@ -1965,42 +1329,42 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1965
1329
|
},
|
|
1966
1330
|
emits: ["update:model-value"],
|
|
1967
1331
|
setup(e, { emit: d }) {
|
|
1968
|
-
const a = e,
|
|
1969
|
-
() => a.modelValue.sort((
|
|
1970
|
-
),
|
|
1971
|
-
const
|
|
1972
|
-
return
|
|
1332
|
+
const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1333
|
+
() => a.modelValue.sort((s, f) => s.threshold - f.threshold) ?? []
|
|
1334
|
+
), o = computed(() => {
|
|
1335
|
+
const s = i.safeParse(l.value);
|
|
1336
|
+
return s.success ? [] : s.error.errors;
|
|
1973
1337
|
}), n = ref();
|
|
1974
|
-
function c(
|
|
1975
|
-
var
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1338
|
+
function c(s, f) {
|
|
1339
|
+
var b;
|
|
1340
|
+
const m = [...l.value];
|
|
1341
|
+
m[f] = s, (b = n.value) == null || b.showSheet(!1), r("update:model-value", m);
|
|
1978
1342
|
}
|
|
1979
|
-
function g(
|
|
1980
|
-
const f =
|
|
1981
|
-
(
|
|
1982
|
-
),
|
|
1343
|
+
function g(s) {
|
|
1344
|
+
const f = s.type == "VOUCHER" ? s.collectibleConfig : u.collectibles.find(
|
|
1345
|
+
(b) => b._id.toString() == s.collectible
|
|
1346
|
+
), m = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
|
|
1983
1347
|
return {
|
|
1984
|
-
label: isNullOrEmpty(
|
|
1985
|
-
sublabel: `Reward at ${
|
|
1348
|
+
label: isNullOrEmpty(m) ? "NO REWARD" : m,
|
|
1349
|
+
sublabel: `Reward at ${s.threshold} | Amount: ${s.earningOption.type == "FIXED" ? s.earningOption.amount : `${s.earningOption.amount} for every RM${s.earningOption.every} spent`} `
|
|
1986
1350
|
};
|
|
1987
1351
|
}
|
|
1988
|
-
function
|
|
1989
|
-
var
|
|
1990
|
-
const f = [...
|
|
1991
|
-
(
|
|
1352
|
+
function y(s) {
|
|
1353
|
+
var m;
|
|
1354
|
+
const f = [...l.value];
|
|
1355
|
+
(m = n.value) == null || m.showSheet(!0, f[s], s);
|
|
1992
1356
|
}
|
|
1993
|
-
function v(
|
|
1994
|
-
const f = [...
|
|
1995
|
-
f.splice(
|
|
1357
|
+
function v(s) {
|
|
1358
|
+
const f = [...l.value];
|
|
1359
|
+
f.splice(s, 1), r("update:model-value", f);
|
|
1996
1360
|
}
|
|
1997
1361
|
function h() {
|
|
1998
|
-
var
|
|
1999
|
-
(
|
|
1362
|
+
var s;
|
|
1363
|
+
(s = n.value) == null || s.showSheet(
|
|
2000
1364
|
!0,
|
|
2001
1365
|
{
|
|
2002
1366
|
type: "LOYALTY",
|
|
2003
|
-
collectible:
|
|
1367
|
+
collectible: u.loyaltyRewards.items[0].value,
|
|
2004
1368
|
threshold: null,
|
|
2005
1369
|
validityOption: {
|
|
2006
1370
|
validForDay: 7
|
|
@@ -2010,63 +1374,63 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2010
1374
|
amount: 1
|
|
2011
1375
|
}
|
|
2012
1376
|
},
|
|
2013
|
-
|
|
1377
|
+
l.value.length
|
|
2014
1378
|
);
|
|
2015
1379
|
}
|
|
2016
|
-
function
|
|
2017
|
-
var f,
|
|
2018
|
-
return
|
|
2019
|
-
((
|
|
2020
|
-
(
|
|
2021
|
-
)) == null ? void 0 :
|
|
1380
|
+
function p(s) {
|
|
1381
|
+
var f, m;
|
|
1382
|
+
return s.type == "VOUCHER" ? (f = s.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
|
|
1383
|
+
((m = u.loyaltyRewards.items.find(
|
|
1384
|
+
(b) => b.value == s.collectible
|
|
1385
|
+
)) == null ? void 0 : m.label) || ""
|
|
2022
1386
|
);
|
|
2023
1387
|
}
|
|
2024
|
-
return (
|
|
2025
|
-
const
|
|
1388
|
+
return (s, f) => {
|
|
1389
|
+
const m = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
|
|
2026
1390
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2027
1391
|
_hoisted_2$3,
|
|
2028
|
-
createVNode(
|
|
1392
|
+
createVNode(m, {
|
|
2029
1393
|
label: "Add Reward",
|
|
2030
|
-
onClick: f[0] || (f[0] = (
|
|
1394
|
+
onClick: f[0] || (f[0] = (k) => h()),
|
|
2031
1395
|
variant: "plain",
|
|
2032
1396
|
icon: "add"
|
|
2033
1397
|
}),
|
|
2034
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2035
|
-
key:
|
|
1398
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (k, C) => (openBlock(), createBlock(b, {
|
|
1399
|
+
key: C,
|
|
2036
1400
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2037
1401
|
variant: "outlined",
|
|
2038
|
-
onClick: (
|
|
1402
|
+
onClick: (B) => y(C)
|
|
2039
1403
|
}, {
|
|
2040
1404
|
default: withCtx(() => [
|
|
2041
1405
|
createElementVNode("div", null, [
|
|
2042
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(g(
|
|
2043
|
-
createElementVNode("div", _hoisted_4$3, toDisplayString(g(
|
|
1406
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(g(k).label), 1),
|
|
1407
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(g(k).sublabel), 1)
|
|
2044
1408
|
]),
|
|
2045
|
-
createVNode(
|
|
1409
|
+
createVNode(m, {
|
|
2046
1410
|
icon: "delete",
|
|
2047
1411
|
variant: "tertiary",
|
|
2048
|
-
onClick: (
|
|
1412
|
+
onClick: (B) => (B.stopPropagation(), v(C))
|
|
2049
1413
|
}, null, 8, ["onClick"])
|
|
2050
1414
|
]),
|
|
2051
1415
|
_: 2
|
|
2052
1416
|
}, 1032, ["onClick"]))), 128)),
|
|
2053
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2054
|
-
key:
|
|
2055
|
-
text:
|
|
1417
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
|
|
1418
|
+
key: k.message,
|
|
1419
|
+
text: k.message,
|
|
2056
1420
|
state: "error"
|
|
2057
1421
|
}, null, 8, ["text"]))), 128)),
|
|
2058
1422
|
_hoisted_5$2,
|
|
2059
|
-
(openBlock(), createBlock(
|
|
1423
|
+
(openBlock(), createBlock(b, {
|
|
2060
1424
|
key: 0,
|
|
2061
1425
|
variant: "outlined",
|
|
2062
1426
|
class: "p-24 space-y-16 w-fit"
|
|
2063
1427
|
}, {
|
|
2064
1428
|
default: withCtx(() => {
|
|
2065
|
-
var
|
|
1429
|
+
var k, C;
|
|
2066
1430
|
return [
|
|
2067
1431
|
createElementVNode("div", _hoisted_6$2, [
|
|
2068
1432
|
createElementVNode("div", null, [
|
|
2069
|
-
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((
|
|
1433
|
+
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((k = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : k.earningOption.amount) > 1 ? (C = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : C.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? p(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2070
1434
|
_hoisted_8$2
|
|
2071
1435
|
])
|
|
2072
1436
|
]),
|
|
@@ -2075,7 +1439,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2075
1439
|
type: e.mission.type,
|
|
2076
1440
|
"max-range": e.mission.end,
|
|
2077
1441
|
currentRange: e.mission.end / 4,
|
|
2078
|
-
markers: e.modelValue.map((
|
|
1442
|
+
markers: e.modelValue.map((B) => B.threshold)
|
|
2079
1443
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2080
1444
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2081
1445
|
])
|
|
@@ -2099,10 +1463,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2099
1463
|
},
|
|
2100
1464
|
emits: ["update:model-value"],
|
|
2101
1465
|
setup(e, { emit: d }) {
|
|
2102
|
-
const a = e,
|
|
2103
|
-
const
|
|
2104
|
-
return
|
|
2105
|
-
}),
|
|
1466
|
+
const a = e, r = computed(() => {
|
|
1467
|
+
const l = FdoMission.safeParse(a.modelValue);
|
|
1468
|
+
return l.success ? [] : l.error.errors;
|
|
1469
|
+
}), u = computed(() => [
|
|
2106
1470
|
{
|
|
2107
1471
|
label: "Stamp",
|
|
2108
1472
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -2113,8 +1477,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2113
1477
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
2114
1478
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2115
1479
|
}
|
|
2116
|
-
]),
|
|
2117
|
-
return (
|
|
1480
|
+
]), i = d;
|
|
1481
|
+
return (l, o) => {
|
|
2118
1482
|
var g;
|
|
2119
1483
|
const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
|
|
2120
1484
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
@@ -2122,28 +1486,28 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2122
1486
|
_hoisted_3$2,
|
|
2123
1487
|
_hoisted_4$2,
|
|
2124
1488
|
createElementVNode("div", _hoisted_5$1, [
|
|
2125
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1489
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y) => {
|
|
2126
1490
|
var v, h;
|
|
2127
1491
|
return openBlock(), createBlock(n, {
|
|
2128
1492
|
variant: "outlined",
|
|
2129
1493
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2130
|
-
"col-span-2": unref(
|
|
2131
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) ==
|
|
2132
|
-
"hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) !=
|
|
1494
|
+
"col-span-2": unref(u).length == 1,
|
|
1495
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) == y.value,
|
|
1496
|
+
"hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
|
|
2133
1497
|
}]),
|
|
2134
1498
|
onClick: () => {
|
|
2135
|
-
var
|
|
2136
|
-
((
|
|
1499
|
+
var p, s;
|
|
1500
|
+
((p = e.modelValue) == null ? void 0 : p.type) != y.value && i("update:model-value", {
|
|
2137
1501
|
...e.modelValue,
|
|
2138
|
-
type:
|
|
2139
|
-
end: ((
|
|
1502
|
+
type: y.value,
|
|
1503
|
+
end: ((s = e.modelValue) == null ? void 0 : s.end) || 1
|
|
2140
1504
|
});
|
|
2141
1505
|
},
|
|
2142
|
-
key:
|
|
1506
|
+
key: y.value
|
|
2143
1507
|
}, {
|
|
2144
1508
|
default: withCtx(() => [
|
|
2145
|
-
createElementVNode("div", _hoisted_6$1, toDisplayString(
|
|
2146
|
-
createElementVNode("div", _hoisted_7$1, toDisplayString(
|
|
1509
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(y.label), 1),
|
|
1510
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(y.description), 1)
|
|
2147
1511
|
]),
|
|
2148
1512
|
_: 2
|
|
2149
1513
|
}, 1032, ["class", "onClick"]);
|
|
@@ -2156,16 +1520,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2156
1520
|
createVNode(c, {
|
|
2157
1521
|
label: "Maximum to collect",
|
|
2158
1522
|
"model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
|
|
2159
|
-
"onUpdate:modelValue":
|
|
1523
|
+
"onUpdate:modelValue": o[0] || (o[0] = (y) => {
|
|
2160
1524
|
var v;
|
|
2161
|
-
return
|
|
1525
|
+
return i("update:model-value", {
|
|
2162
1526
|
...e.modelValue,
|
|
2163
1527
|
type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
|
|
2164
|
-
end:
|
|
1528
|
+
end: y
|
|
2165
1529
|
});
|
|
2166
1530
|
}),
|
|
2167
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
2168
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1531
|
+
"helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
|
|
1532
|
+
"helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
|
|
2169
1533
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
2170
1534
|
])
|
|
2171
1535
|
]);
|
|
@@ -2194,78 +1558,78 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2194
1558
|
},
|
|
2195
1559
|
emits: ["update:model-value", "update:file"],
|
|
2196
1560
|
setup(e, { emit: d }) {
|
|
2197
|
-
const { t: a } = useI18n(),
|
|
2198
|
-
function
|
|
2199
|
-
switch (
|
|
1561
|
+
const { t: a } = useI18n(), r = e, u = d;
|
|
1562
|
+
function i(c) {
|
|
1563
|
+
switch (r.field.type) {
|
|
2200
1564
|
case "timeframe":
|
|
2201
|
-
const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0,
|
|
2202
|
-
|
|
1565
|
+
const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, y = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
|
|
1566
|
+
u("update:model-value", {
|
|
2203
1567
|
type: "timeframe",
|
|
2204
1568
|
property: "__now",
|
|
2205
1569
|
start: g,
|
|
2206
|
-
end:
|
|
1570
|
+
end: y
|
|
2207
1571
|
});
|
|
2208
1572
|
break;
|
|
2209
1573
|
case "image": {
|
|
2210
|
-
|
|
1574
|
+
u(
|
|
2211
1575
|
"update:file",
|
|
2212
1576
|
c,
|
|
2213
|
-
|
|
1577
|
+
l.value || firebaseStorage.collectibleImagePath(void 0, c)
|
|
2214
1578
|
);
|
|
2215
1579
|
break;
|
|
2216
1580
|
}
|
|
2217
1581
|
default:
|
|
2218
|
-
|
|
1582
|
+
u("update:model-value", c);
|
|
2219
1583
|
break;
|
|
2220
1584
|
}
|
|
2221
1585
|
}
|
|
2222
|
-
const
|
|
2223
|
-
switch (
|
|
1586
|
+
const l = computed(() => {
|
|
1587
|
+
switch (r.field.type) {
|
|
2224
1588
|
case "timeframe": {
|
|
2225
|
-
const c =
|
|
1589
|
+
const c = r.modelValue;
|
|
2226
1590
|
return {
|
|
2227
1591
|
startDate: c != null && c.start ? hooks(c == null ? void 0 : c.start).format("YYYY-MM-DD") : null,
|
|
2228
1592
|
endDate: c != null && c.end ? hooks(c == null ? void 0 : c.end).format("YYYY-MM-DD") : null
|
|
2229
1593
|
};
|
|
2230
1594
|
}
|
|
2231
1595
|
default:
|
|
2232
|
-
return
|
|
1596
|
+
return r.modelValue;
|
|
2233
1597
|
}
|
|
2234
1598
|
});
|
|
2235
|
-
function
|
|
1599
|
+
function o() {
|
|
2236
1600
|
if (!n.value.schema) return [];
|
|
2237
|
-
const c = n.value.schema.safeParse(
|
|
1601
|
+
const c = n.value.schema.safeParse(r.modelValue);
|
|
2238
1602
|
return c.success ? [] : c.error.errors;
|
|
2239
1603
|
}
|
|
2240
1604
|
const n = computed(() => ({
|
|
2241
|
-
schema:
|
|
2242
|
-
unwrapped:
|
|
2243
|
-
rules:
|
|
2244
|
-
labelMark:
|
|
2245
|
-
zodLabel:
|
|
1605
|
+
schema: r.schema,
|
|
1606
|
+
unwrapped: r.schema ? ZodHelper.unwrap(r.schema) : void 0,
|
|
1607
|
+
rules: r.schema ? [ZodHelper.ruleAtPath(r.schema, "")] : void 0,
|
|
1608
|
+
labelMark: r.schema && ZodHelper.isRequired(r.schema) == !1 ? "optional" : void 0,
|
|
1609
|
+
zodLabel: r.schema ? ZodHelper.toInputLabel(r.schema, r.field.label) : void 0
|
|
2246
1610
|
}));
|
|
2247
1611
|
return (c, g) => {
|
|
2248
|
-
var f,
|
|
2249
|
-
const
|
|
2250
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
1612
|
+
var f, m, b, x, k;
|
|
1613
|
+
const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), s = resolveComponent("FmSwitch");
|
|
1614
|
+
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
2251
1615
|
key: 0,
|
|
2252
1616
|
label: unref(a)(e.field.label),
|
|
2253
1617
|
"label-mark": unref(n).labelMark,
|
|
2254
1618
|
rules: unref(n).rules,
|
|
2255
|
-
"model-value": unref(
|
|
2256
|
-
"onUpdate:modelValue":
|
|
1619
|
+
"model-value": unref(l),
|
|
1620
|
+
"onUpdate:modelValue": i,
|
|
2257
1621
|
"helper-state": e.helperText ? "error" : void 0,
|
|
2258
1622
|
"helper-text": e.helperText
|
|
2259
1623
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2260
1624
|
createVNode(JsonViewer, {
|
|
2261
|
-
json: { schema: unref(n).unwrapped, props:
|
|
1625
|
+
json: { schema: unref(n).unwrapped, props: r }
|
|
2262
1626
|
}, null, 8, ["json"]),
|
|
2263
1627
|
createVNode(v, {
|
|
2264
1628
|
label: unref(a)(e.field.label),
|
|
2265
1629
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
|
|
2266
|
-
"model-value": unref(
|
|
1630
|
+
"model-value": unref(l),
|
|
2267
1631
|
rules: e.field.isRuleChildren ? [] : unref(n).rules,
|
|
2268
|
-
"onUpdate:modelValue":
|
|
1632
|
+
"onUpdate:modelValue": i,
|
|
2269
1633
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2270
1634
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2271
1635
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
@@ -2274,183 +1638,183 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2274
1638
|
label: unref(a)(e.field.label),
|
|
2275
1639
|
"label-mark": unref(n).labelMark,
|
|
2276
1640
|
rules: unref(n).rules,
|
|
2277
|
-
"model-value": unref(
|
|
2278
|
-
"onUpdate:modelValue":
|
|
1641
|
+
"model-value": unref(l),
|
|
1642
|
+
"onUpdate:modelValue": i,
|
|
2279
1643
|
"show-word-count": "",
|
|
2280
|
-
"max-length": (
|
|
2281
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$
|
|
1644
|
+
"max-length": (k = (x = (b = (m = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : m._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
|
|
1645
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
2282
1646
|
key: 3,
|
|
2283
1647
|
"campaign-type": e.extras,
|
|
2284
|
-
"model-value": unref(
|
|
1648
|
+
"model-value": unref(l),
|
|
2285
1649
|
disabled: e.disabled,
|
|
2286
|
-
"onUpdate:modelValue":
|
|
1650
|
+
"onUpdate:modelValue": i
|
|
2287
1651
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2288
|
-
createVNode(_sfc_main$
|
|
2289
|
-
"model-value": unref(
|
|
2290
|
-
"onUpdate:modelValue":
|
|
1652
|
+
createVNode(_sfc_main$e, {
|
|
1653
|
+
"model-value": unref(l),
|
|
1654
|
+
"onUpdate:modelValue": i
|
|
2291
1655
|
}, null, 8, ["model-value"]),
|
|
2292
|
-
createVNode(
|
|
1656
|
+
createVNode(p, {
|
|
2293
1657
|
class: "!mt-[8px]",
|
|
2294
|
-
text: unref(ZodHelper).helperText(
|
|
2295
|
-
state: unref(ZodHelper).helperState(
|
|
1658
|
+
text: unref(ZodHelper).helperText(o(), ""),
|
|
1659
|
+
state: unref(ZodHelper).helperState(o(), "")
|
|
2296
1660
|
}, null, 8, ["text", "state"])
|
|
2297
|
-
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$
|
|
1661
|
+
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
2298
1662
|
key: 5,
|
|
2299
|
-
thumbnail: unref(
|
|
1663
|
+
thumbnail: unref(l),
|
|
2300
1664
|
"aspect-ratio": "16 / 9",
|
|
2301
1665
|
class: "w-1/2 xs:w-2/3",
|
|
2302
|
-
"onUpdate:file":
|
|
1666
|
+
"onUpdate:file": i
|
|
2303
1667
|
}, {
|
|
2304
1668
|
label: withCtx(() => [
|
|
2305
1669
|
(openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
|
|
2306
1670
|
]),
|
|
2307
1671
|
_: 1
|
|
2308
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
1672
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(s, {
|
|
2309
1673
|
key: 6,
|
|
2310
1674
|
label: unref(a)(e.field.label),
|
|
2311
1675
|
"label-placement": "right",
|
|
2312
1676
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2313
1677
|
"label-mark": unref(n).labelMark,
|
|
2314
1678
|
rules: unref(n).rules,
|
|
2315
|
-
"model-value": unref(
|
|
2316
|
-
"onUpdate:modelValue":
|
|
2317
|
-
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$
|
|
1679
|
+
"model-value": unref(l),
|
|
1680
|
+
"onUpdate:modelValue": i
|
|
1681
|
+
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
2318
1682
|
key: 7,
|
|
2319
|
-
"model-value": unref(
|
|
2320
|
-
"onUpdate:modelValue":
|
|
1683
|
+
"model-value": unref(l),
|
|
1684
|
+
"onUpdate:modelValue": i,
|
|
2321
1685
|
"no-campaign": !1,
|
|
2322
1686
|
schema: unref(n).schema,
|
|
2323
1687
|
"is-mission": e.extras === "MISSION"
|
|
2324
|
-
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$
|
|
1688
|
+
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
2325
1689
|
key: 8,
|
|
2326
|
-
"model-value": unref(
|
|
2327
|
-
"onUpdate:modelValue":
|
|
1690
|
+
"model-value": unref(l),
|
|
1691
|
+
"onUpdate:modelValue": i
|
|
2328
1692
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
2329
|
-
createVNode(_sfc_main$
|
|
2330
|
-
"model-value": unref(
|
|
2331
|
-
"onUpdate:modelValue":
|
|
1693
|
+
createVNode(_sfc_main$r, {
|
|
1694
|
+
"model-value": unref(l),
|
|
1695
|
+
"onUpdate:modelValue": i,
|
|
2332
1696
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2333
1697
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2334
|
-
unref(
|
|
1698
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
|
|
2335
1699
|
key: 0,
|
|
2336
1700
|
class: "!mt-[8px]",
|
|
2337
1701
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
2338
1702
|
state: "error"
|
|
2339
1703
|
}, null, 8, ["text"]))
|
|
2340
|
-
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$
|
|
1704
|
+
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
|
|
2341
1705
|
key: 10,
|
|
2342
|
-
"model-value": unref(
|
|
2343
|
-
"onUpdate:modelValue":
|
|
2344
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1706
|
+
"model-value": unref(l),
|
|
1707
|
+
"onUpdate:modelValue": i,
|
|
1708
|
+
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
2345
1709
|
"trigger-type": e.field.extras,
|
|
2346
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2347
|
-
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$
|
|
1710
|
+
"helper-state": unref(ZodHelper).helperState(o(), "")
|
|
1711
|
+
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
2348
1712
|
key: 11,
|
|
2349
|
-
"model-value": unref(
|
|
2350
|
-
"onUpdate:modelValue":
|
|
1713
|
+
"model-value": unref(l),
|
|
1714
|
+
"onUpdate:modelValue": i,
|
|
2351
1715
|
extras: e.extras,
|
|
2352
1716
|
"error-text": e.helperText
|
|
2353
|
-
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$
|
|
1717
|
+
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
|
|
2354
1718
|
key: 12,
|
|
2355
1719
|
type: "custom",
|
|
2356
|
-
"model-value": unref(
|
|
2357
|
-
"onUpdate:modelValue":
|
|
2358
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
2359
|
-
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$
|
|
1720
|
+
"model-value": unref(l),
|
|
1721
|
+
"onUpdate:modelValue": i,
|
|
1722
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
|
|
1723
|
+
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
2360
1724
|
key: 13,
|
|
2361
|
-
"model-value": unref(
|
|
2362
|
-
"onUpdate:modelValue":
|
|
1725
|
+
"model-value": unref(l),
|
|
1726
|
+
"onUpdate:modelValue": i
|
|
2363
1727
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
2364
1728
|
key: 14,
|
|
2365
|
-
"model-value": unref(
|
|
2366
|
-
"onUpdate:modelValue":
|
|
1729
|
+
"model-value": unref(l),
|
|
1730
|
+
"onUpdate:modelValue": i
|
|
2367
1731
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
2368
1732
|
key: 15,
|
|
2369
|
-
"model-value": unref(
|
|
2370
|
-
"onUpdate:modelValue":
|
|
1733
|
+
"model-value": unref(l),
|
|
1734
|
+
"onUpdate:modelValue": i
|
|
2371
1735
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2372
1736
|
key: 16,
|
|
2373
|
-
"model-value": unref(
|
|
2374
|
-
"onUpdate:modelValue":
|
|
1737
|
+
"model-value": unref(l),
|
|
1738
|
+
"onUpdate:modelValue": i
|
|
2375
1739
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2376
1740
|
key: 17,
|
|
2377
|
-
"model-value": unref(
|
|
2378
|
-
"onUpdate:modelValue":
|
|
2379
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2380
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1741
|
+
"model-value": unref(l),
|
|
1742
|
+
"onUpdate:modelValue": i,
|
|
1743
|
+
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
1744
|
+
"helper-state": unref(ZodHelper).helperState(o(), "")
|
|
2381
1745
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2382
1746
|
key: 18,
|
|
2383
|
-
"model-value": unref(
|
|
2384
|
-
"onUpdate:modelValue":
|
|
1747
|
+
"model-value": unref(l),
|
|
1748
|
+
"onUpdate:modelValue": i,
|
|
2385
1749
|
mission: e.extras.mission
|
|
2386
1750
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
2387
|
-
createVNode(_sfc_main$
|
|
2388
|
-
"model-value": unref(
|
|
2389
|
-
"onUpdate:modelValue":
|
|
1751
|
+
createVNode(_sfc_main$d, {
|
|
1752
|
+
"model-value": unref(l),
|
|
1753
|
+
"onUpdate:modelValue": i,
|
|
2390
1754
|
"start-date": e.extras.start,
|
|
2391
1755
|
"end-date": e.extras.end
|
|
2392
1756
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2393
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1757
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2394
1758
|
key: 0,
|
|
2395
1759
|
class: "!mt-[8px]",
|
|
2396
1760
|
text: e.helperText,
|
|
2397
1761
|
state: "error"
|
|
2398
1762
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2399
1763
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
2400
|
-
createVNode(_sfc_main$
|
|
2401
|
-
"model-value": unref(
|
|
2402
|
-
"onUpdate:modelValue":
|
|
1764
|
+
createVNode(_sfc_main$t, {
|
|
1765
|
+
"model-value": unref(l),
|
|
1766
|
+
"onUpdate:modelValue": i
|
|
2403
1767
|
}, null, 8, ["model-value"]),
|
|
2404
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1768
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2405
1769
|
key: 0,
|
|
2406
1770
|
class: "!mt-[8px]",
|
|
2407
1771
|
text: e.helperText,
|
|
2408
1772
|
state: "error"
|
|
2409
1773
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2410
1774
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2411
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(
|
|
1775
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
|
|
2412
1776
|
key: 0,
|
|
2413
1777
|
state: "warning",
|
|
2414
1778
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2415
1779
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2416
|
-
createVNode(_sfc_main$
|
|
2417
|
-
"model-value": unref(
|
|
2418
|
-
"onUpdate:modelValue":
|
|
1780
|
+
createVNode(_sfc_main$i, {
|
|
1781
|
+
"model-value": unref(l),
|
|
1782
|
+
"onUpdate:modelValue": i
|
|
2419
1783
|
}, null, 8, ["model-value"]),
|
|
2420
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1784
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2421
1785
|
key: 1,
|
|
2422
1786
|
class: "!mt-[8px]",
|
|
2423
1787
|
text: e.helperText,
|
|
2424
1788
|
state: "error"
|
|
2425
1789
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2426
1790
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
2427
|
-
createVNode(_sfc_main$
|
|
2428
|
-
"model-value": unref(
|
|
2429
|
-
"onUpdate:modelValue":
|
|
1791
|
+
createVNode(_sfc_main$u, {
|
|
1792
|
+
"model-value": unref(l),
|
|
1793
|
+
"onUpdate:modelValue": i
|
|
2430
1794
|
}, null, 8, ["model-value"]),
|
|
2431
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1795
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2432
1796
|
key: 0,
|
|
2433
1797
|
class: "!mt-[8px]",
|
|
2434
1798
|
text: e.helperText,
|
|
2435
1799
|
state: "error"
|
|
2436
1800
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2437
1801
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
2438
|
-
createVNode(_sfc_main$
|
|
2439
|
-
"model-value": unref(
|
|
2440
|
-
"onUpdate:modelValue":
|
|
1802
|
+
createVNode(_sfc_main$v, {
|
|
1803
|
+
"model-value": unref(l),
|
|
1804
|
+
"onUpdate:modelValue": i
|
|
2441
1805
|
}, null, 8, ["model-value"]),
|
|
2442
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1806
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2443
1807
|
key: 0,
|
|
2444
1808
|
class: "!mt-[8px]",
|
|
2445
1809
|
text: e.helperText,
|
|
2446
1810
|
state: "error"
|
|
2447
1811
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2448
1812
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
2449
|
-
createVNode(_sfc_main$
|
|
2450
|
-
"model-value": unref(
|
|
2451
|
-
"onUpdate:modelValue":
|
|
1813
|
+
createVNode(_sfc_main$h, {
|
|
1814
|
+
"model-value": unref(l),
|
|
1815
|
+
"onUpdate:modelValue": i
|
|
2452
1816
|
}, null, 8, ["model-value"]),
|
|
2453
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1817
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2454
1818
|
key: 0,
|
|
2455
1819
|
class: "!mt-[8px]",
|
|
2456
1820
|
text: e.helperText,
|
|
@@ -2458,16 +1822,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2458
1822
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2459
1823
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
2460
1824
|
createVNode(_sfc_main$9, {
|
|
2461
|
-
"model-value": unref(
|
|
2462
|
-
"onUpdate:modelValue":
|
|
1825
|
+
"model-value": unref(l),
|
|
1826
|
+
"onUpdate:modelValue": i
|
|
2463
1827
|
}, null, 8, ["model-value"]),
|
|
2464
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1828
|
+
e.helperText ? (openBlock(), createBlock(p, {
|
|
2465
1829
|
key: 0,
|
|
2466
1830
|
class: "!mt-[8px]",
|
|
2467
1831
|
text: e.helperText,
|
|
2468
1832
|
state: "error"
|
|
2469
1833
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2470
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
1834
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(r.field), 1));
|
|
2471
1835
|
};
|
|
2472
1836
|
}
|
|
2473
1837
|
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _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({
|
|
@@ -2480,22 +1844,22 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2480
1844
|
},
|
|
2481
1845
|
setup(e) {
|
|
2482
1846
|
const { t: d, te: a } = useI18n();
|
|
2483
|
-
return (
|
|
2484
|
-
const
|
|
2485
|
-
return openBlock(), createBlock(
|
|
1847
|
+
return (r, u) => {
|
|
1848
|
+
const i = resolveComponent("FmCard");
|
|
1849
|
+
return openBlock(), createBlock(i, {
|
|
2486
1850
|
variant: "outlined",
|
|
2487
1851
|
class: "p-16 space-y-8"
|
|
2488
1852
|
}, {
|
|
2489
1853
|
default: withCtx(() => [
|
|
2490
1854
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
|
|
2491
1855
|
_hoisted_2$1,
|
|
2492
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
1856
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
|
|
2493
1857
|
class: "space-y-4",
|
|
2494
|
-
key:
|
|
1858
|
+
key: o
|
|
2495
1859
|
}, [
|
|
2496
|
-
|
|
2497
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${
|
|
2498
|
-
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${
|
|
1860
|
+
l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1861
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${o}`)), 1),
|
|
1862
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${l}`) ? unref(d)(`${l}`) : l), 1)
|
|
2499
1863
|
], 64)) : createCommentVNode("", !0)
|
|
2500
1864
|
]))), 128))
|
|
2501
1865
|
]),
|
|
@@ -2543,10 +1907,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2543
1907
|
} finally {
|
|
2544
1908
|
await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
|
|
2545
1909
|
}
|
|
2546
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a,
|
|
1910
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, r) => {
|
|
2547
1911
|
a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
2548
|
-
(
|
|
2549
|
-
) &&
|
|
1912
|
+
(u) => u.code === a.campaign.code && u._id.toString() !== a.campaign._id.toString()
|
|
1913
|
+
) && r.addIssue({
|
|
2550
1914
|
code: "custom",
|
|
2551
1915
|
message: "Code already exists, please use another code",
|
|
2552
1916
|
path: ["campaign", "code"]
|
|
@@ -2580,7 +1944,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2580
1944
|
});
|
|
2581
1945
|
function stepErrors(e = currentStep.value - 1) {
|
|
2582
1946
|
const d = template.value.steps[e].groups.flatMap(
|
|
2583
|
-
(a) => a.fields.map((
|
|
1947
|
+
(a) => a.fields.map((r) => r.property)
|
|
2584
1948
|
);
|
|
2585
1949
|
return errors.value.filter((a) => d.includes(a.path.join(".")));
|
|
2586
1950
|
}
|
|
@@ -2604,7 +1968,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2604
1968
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
2605
1969
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
2606
1970
|
]
|
|
2607
|
-
),
|
|
1971
|
+
), r = RuleBuilder.setRuleToGroup(
|
|
2608
1972
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2609
1973
|
[
|
|
2610
1974
|
RuleBuilder.constructEntry(
|
|
@@ -2623,7 +1987,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2623
1987
|
_.set(
|
|
2624
1988
|
data.value,
|
|
2625
1989
|
"campaign.event.rule",
|
|
2626
|
-
RuleBuilder.setRuleToGroup(a,
|
|
1990
|
+
RuleBuilder.setRuleToGroup(a, r)
|
|
2627
1991
|
);
|
|
2628
1992
|
}
|
|
2629
1993
|
e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -2648,13 +2012,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2648
2012
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2649
2013
|
}
|
|
2650
2014
|
return (e, d) => {
|
|
2651
|
-
const a = resolveComponent("FmButton"),
|
|
2652
|
-
return openBlock(), createBlock(
|
|
2015
|
+
const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2016
|
+
return openBlock(), createBlock(l, {
|
|
2653
2017
|
"fullscreen-size": "lg",
|
|
2654
2018
|
modelValue: unref(sheetVisible),
|
|
2655
2019
|
"onUpdate:modelValue": [
|
|
2656
|
-
d[7] || (d[7] = (
|
|
2657
|
-
d[8] || (d[8] = (
|
|
2020
|
+
d[7] || (d[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
|
|
2021
|
+
d[8] || (d[8] = (o) => sheetVisible.value = o)
|
|
2658
2022
|
]
|
|
2659
2023
|
}, createSlots({
|
|
2660
2024
|
"top-sheet-header": withCtx(() => [
|
|
@@ -2662,7 +2026,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2662
2026
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2663
2027
|
createElementVNode("div", _hoisted_2, [
|
|
2664
2028
|
createVNode(a, {
|
|
2665
|
-
onClick: d[0] || (d[0] = (
|
|
2029
|
+
onClick: d[0] || (d[0] = (o) => hideSheet()),
|
|
2666
2030
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
2667
2031
|
variant: "tertiary"
|
|
2668
2032
|
}, null, 8, ["label"]),
|
|
@@ -2683,7 +2047,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2683
2047
|
createElementVNode("div", _hoisted_10, [
|
|
2684
2048
|
createElementVNode("div", _hoisted_11, [
|
|
2685
2049
|
_hoisted_12,
|
|
2686
|
-
createVNode(
|
|
2050
|
+
createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2687
2051
|
])
|
|
2688
2052
|
])
|
|
2689
2053
|
])
|
|
@@ -2693,16 +2057,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2693
2057
|
name: "default",
|
|
2694
2058
|
fn: withCtx(() => [
|
|
2695
2059
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2696
|
-
createVNode(
|
|
2060
|
+
createVNode(u, {
|
|
2697
2061
|
modelValue: unref(currentStep),
|
|
2698
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
2062
|
+
"onUpdate:modelValue": d[1] || (d[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
2699
2063
|
orientation: "horizontal",
|
|
2700
2064
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2701
2065
|
}, {
|
|
2702
2066
|
default: withCtx(() => [
|
|
2703
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2704
|
-
key:
|
|
2705
|
-
title: unref(t)(
|
|
2067
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
|
|
2068
|
+
key: o.name,
|
|
2069
|
+
title: unref(t)(o.name),
|
|
2706
2070
|
value: n + 1,
|
|
2707
2071
|
error: () => stepErrors(n).length > 0,
|
|
2708
2072
|
complete: () => n + 1 <= unref(currentStep)
|
|
@@ -2714,19 +2078,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2714
2078
|
createVNode(a, {
|
|
2715
2079
|
icon: "close",
|
|
2716
2080
|
variant: "tertiary",
|
|
2717
|
-
onClick: d[2] || (d[2] = (
|
|
2081
|
+
onClick: d[2] || (d[2] = (o) => sheetVisible.value = !1)
|
|
2718
2082
|
}),
|
|
2719
|
-
createVNode(
|
|
2083
|
+
createVNode(u, {
|
|
2720
2084
|
modelValue: unref(currentStep),
|
|
2721
|
-
"onUpdate:modelValue": d[3] || (d[3] = (
|
|
2085
|
+
"onUpdate:modelValue": d[3] || (d[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
2722
2086
|
orientation: "horizontal",
|
|
2723
2087
|
class: "flex-1"
|
|
2724
2088
|
}, {
|
|
2725
2089
|
default: withCtx(() => [
|
|
2726
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2727
|
-
key:
|
|
2090
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
|
|
2091
|
+
key: o.name,
|
|
2728
2092
|
title: unref(sheetTitle),
|
|
2729
|
-
description:
|
|
2093
|
+
description: o.name,
|
|
2730
2094
|
value: n + 1,
|
|
2731
2095
|
error: () => stepErrors(n).length > 0,
|
|
2732
2096
|
complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
@@ -2746,30 +2110,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2746
2110
|
json: {
|
|
2747
2111
|
data: unref(data),
|
|
2748
2112
|
errors: unref(errors).map(
|
|
2749
|
-
(
|
|
2113
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
2750
2114
|
),
|
|
2751
2115
|
stepErrors: stepErrors().map(
|
|
2752
|
-
(
|
|
2116
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
2753
2117
|
),
|
|
2754
2118
|
schema: unref(schema)
|
|
2755
2119
|
}
|
|
2756
2120
|
}, null, 8, ["json"]),
|
|
2757
2121
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2758
|
-
(
|
|
2759
|
-
), (
|
|
2122
|
+
(o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
|
|
2123
|
+
), (o, n) => (openBlock(), createElementBlock("div", {
|
|
2760
2124
|
key: n,
|
|
2761
2125
|
class: "space-y-24"
|
|
2762
2126
|
}, [
|
|
2763
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2764
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2127
|
+
createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
|
|
2128
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (c, g) => (openBlock(), createElementBlock("div", { key: g }, [
|
|
2765
2129
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2766
2130
|
key: g,
|
|
2767
2131
|
field: c,
|
|
2768
2132
|
modelValue: unref(_).get(unref(data), c.property),
|
|
2769
2133
|
disabled: isDisable(c),
|
|
2770
|
-
"onUpdate:modelValue": (
|
|
2771
|
-
"onUpdate:file": async (
|
|
2772
|
-
const h = await onUpdateFile(
|
|
2134
|
+
"onUpdate:modelValue": (y) => onUpdateProperty(c.property, y),
|
|
2135
|
+
"onUpdate:file": async (y, v) => {
|
|
2136
|
+
const h = await onUpdateFile(y, v);
|
|
2773
2137
|
onUpdateProperty(c.property, h || "");
|
|
2774
2138
|
},
|
|
2775
2139
|
schema: unref(ZodHelper).typeAtPath(
|
|
@@ -2788,12 +2152,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2788
2152
|
label: "Back",
|
|
2789
2153
|
variant: "tertiary",
|
|
2790
2154
|
disabled: unref(currentStep) == 1,
|
|
2791
|
-
onClick: d[5] || (d[5] = (
|
|
2155
|
+
onClick: d[5] || (d[5] = (o) => currentStep.value--)
|
|
2792
2156
|
}, null, 8, ["disabled"]),
|
|
2793
2157
|
createVNode(a, {
|
|
2794
2158
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2795
2159
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2796
|
-
onClick: d[6] || (d[6] = (
|
|
2160
|
+
onClick: d[6] || (d[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2797
2161
|
}, null, 8, ["disabled", "label"])
|
|
2798
2162
|
])
|
|
2799
2163
|
]),
|