@feedmepos/mf-connect 0.1.38-beta.2 → 0.1.38-beta.21
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-BjSfI2Ff.js → Analytic-CEd_WApy.js} +14 -14
- package/dist/{App-D11A2JY1.js → App-ulCtuU5o.js} +671 -661
- package/dist/{AuditLogs-DWCFYoRg.js → AuditLogs-BM1Np61K.js} +11 -11
- package/dist/{Bin-9wV4Ah3M.js → Bin-icbjnKXw.js} +9 -9
- package/dist/{Broadcast-I3BtSk8V.js → Broadcast-COQ3E8vI.js} +9 -9
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-XJqTXbKr.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BbXEYOFK.js} +6 -6
- package/dist/{Card-CqALG5RM.js → Card-Cwh3GXi0.js} +142 -136
- package/dist/{Collections-rg3SzoUb.js → Collections-EuOjzpkL.js} +81 -75
- package/dist/{Credit-BNn1sYZv.js → Credit-BY2Fpdhh.js} +9 -9
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BUzUIIUW.js → DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-PJ8q72XH.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BbsLgUMQ.js} +678 -675
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Sww7KNle.js → EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js} +6 -6
- package/dist/{Experience-D_Qm8SUj.js → Experience-rAH7zk71.js} +9 -9
- package/dist/{Game-CKXgXm6Q.js → Game-DlI0yNF0.js} +10 -10
- package/dist/{Index-D4DGfUHd.js → Index-DemXFS3d.js} +10 -10
- package/dist/{Marketing-Dn9A1vgH.js → Marketing-shNBO9Rc.js} +7 -7
- package/dist/{Member-B55vWHDd.js → Member-C19ZgpaL.js} +10 -10
- package/dist/{MemberList-BWTG9Ohy.js → MemberList-B2tNB4yg.js} +27 -27
- package/dist/{MemberTransactions-CP5EI-W0.js → MemberTransactions-BN3qaTVY.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D--_An-f.js → MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js} +5621 -5418
- package/dist/{Mission-CFvhROuB.js → Mission-j1KI0-hJ.js} +10 -10
- package/dist/{Overview-4273yNwL.js → Overview-BN2Vdu8Q.js} +18 -18
- package/dist/{Point-B_-_C919.js → Point-8zy7QcTk.js} +9 -9
- package/dist/{Promotion-D2S3COxk.js → Promotion-mcUcylXB.js} +10 -10
- package/dist/{Queue-BmS1Oi-C.js → Queue-BsNv4P8u.js} +11 -11
- package/dist/{Record-DRBl0M8g.js → Record-VA6Bdlnz.js} +9 -9
- package/dist/{Reward-8056NmfK.js → Reward-CVyO3Ga1.js} +15 -15
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-CJ_WC2gV.js → RewardGroup.vue_vue_type_script_setup_true_lang-BR9_a9bJ.js} +11 -11
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js +1763 -0
- package/dist/{Segment-Bzq-pyhc.js → Segment-BMgcdIIS.js} +209 -209
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-4nNkkklE.js → SelectItems.vue_vue_type_script_setup_true_lang-CKRpWcn_.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Dnf2oxOG.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DZCNcdVW.js} +11 -11
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BLYP-5U9.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BESF672g.js} +3 -3
- package/dist/{Setting-BrJfYoru.js → Setting-BMKKkZTD.js} +457 -442
- package/dist/{Store-Bpl_4yZW.js → Store-DdxMDtfL.js} +466 -459
- package/dist/{StoreRewards-Cu7n7Pjz.js → StoreRewards-CRyeHEMF.js} +13 -13
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-T3Wo2maC.js → StoreTransactions.vue_vue_type_script_setup_true_lang-DS6-9WP9.js} +207 -221
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-QucRaI08.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js} +1 -1
- package/dist/{Tier-_LnXg3n6.js → Tier-D5Xmp5vV.js} +229 -226
- package/dist/{Title-B7AGStvx.js → Title-CsK2crqD.js} +141 -138
- package/dist/{Transaction-Chxv6V7u.js → Transaction-Dvfc9x4f.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CzXNmobp.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js} +6 -6
- package/dist/{Voucher-C5z2kOq9.js → Voucher-CPN7TMho.js} +13 -13
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DdGMrk2C.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js} +10 -10
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BlXzEWA6.js → ZodTextField.vue_vue_type_script_setup_true_lang-CnaQAEKo.js} +1 -1
- package/dist/{app-BVojNX0w.js → app-DRBevJsF.js} +1 -1
- package/dist/{app-7cvPyHJ7.js → app-DteFjR9L.js} +459 -449
- package/dist/app.js +1 -1
- package/dist/{business-CmxV69wT.js → business-BqV9jK-p.js} +1 -1
- package/dist/{campaign-CT_cNJEL.js → campaign-BHDq-yx-.js} +10 -10
- package/dist/{campaign-Dq5C_no-.js → campaign-CsWoG6e_.js} +2 -2
- package/dist/{campaign.enum-dp7yHKzF.js → campaign.enum-Dfa96W5V.js} +1 -1
- package/dist/{campaign.fn-BYZgKDN7.js → campaign.fn-pLrwyHA_.js} +37 -37
- package/dist/{collectible.enum-DxbB4DxT.js → collectible.enum-BYTYWPsR.js} +1 -1
- package/dist/{collection.fn-CNZRdUgy.js → collection.fn-CYLIQJig.js} +2 -2
- package/dist/{dto-CT9zZbv9.js → dto-DBfDbpyb.js} +4 -4
- package/dist/{effect-FIlOEC4H.js → effect-D9pD5RCk.js} +1 -1
- package/dist/{email-addresses-Ba7xImfX.js → email-addresses-BApvdLkQ.js} +1 -1
- package/dist/{export-uzjZFNF9.js → export--EfmCiw0.js} +4 -4
- package/dist/{helper-D4sAZde0.js → helper-BHiK3pLT.js} +1 -1
- package/dist/{index-B9pl4zRZ.js → index-2dknXEFJ.js} +19 -9
- package/dist/{index-CNJLP3D5.js → index-B9_Tn8si.js} +1 -1
- package/dist/{index-BjU8LVUC.js → index-BSQXDDQY.js} +6347 -6305
- package/dist/{index-CwsMG2cV.js → index-Bqc7PV3K.js} +1 -1
- package/dist/{index-CONvJfKv.js → index-C1Vrltkc.js} +1 -1
- package/dist/{index-D5rvMvzx.js → index-CD2bkLo_.js} +1 -1
- package/dist/{index-DNxa8Rqx.js → index-CDLBLuYq.js} +69 -68
- package/dist/{index-BXz54M1s.js → index-COiVJ9pA.js} +1 -1
- package/dist/{index-CH3z92VV.js → index-CVxruvVB.js} +1 -1
- package/dist/{index-CS3Jmojj.js → index-Cc80pBYX.js} +573 -573
- package/dist/{index-l2F5MnLF.js → index-DXM3o6kl.js} +11 -4
- package/dist/{index-BI3m1Ehv.js → index-DYgdunxw.js} +3 -3
- package/dist/{index-CvBcve-r.js → index-Pd9RCQxn.js} +1 -1
- package/dist/{index-CUfS9Kp1.js → index-qd_dvZcw.js} +2 -2
- package/dist/{index.esm2017-ATcsD5N4.js → index.esm2017-DAWS_ALH.js} +34 -34
- package/dist/{loading-BWGQSrCB.js → loading-BVUeda4s.js} +1 -1
- package/dist/{membership-Cc4OZ8-U.js → membership-BL_43RJR.js} +3 -3
- package/dist/{moment-BWErdI6_.js → moment-D7p2TMB-.js} +6 -1
- package/dist/{money-D7p8nfun.js → money-Cd8hLiNc.js} +1 -1
- package/dist/{number-CMJjC4qz.js → number-DVb8PSrj.js} +1 -1
- package/dist/objectid-D33s3gxp.js +145 -0
- package/dist/{plugins-eQis66QR.js → plugins-BKtBkC9Q.js} +2 -2
- package/dist/{reward-DrnzbG20.js → reward-f41dJcaL.js} +1 -1
- package/dist/{rule-CtRxkYXB.js → rule-Cbux1-fC.js} +4 -4
- package/dist/rule-builder-BrZeF45Z.js +91 -0
- package/dist/style.css +4 -1
- package/dist/{template-C3UfY0v5.js → template-tqhgmIdT.js} +4 -4
- package/dist/timezone-DaTVH4y0.js +1150 -0
- package/dist/{trigger-C9U7Zgad.js → trigger-C34RfwrT.js} +4 -4
- package/dist/{user-D7n9yYmO.js → user-DgKhDLYr.js} +1 -1
- package/dist/{vue-i18n-Bz45zC04.js → vue-i18n-xo56wiwi.js} +410 -410
- package/dist/{xlsx-D4S4qbcZ.js → xlsx-D8ZZRjtf.js} +1 -1
- package/package.json +3 -2
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-DqNQl_nz.js +0 -1728
- package/dist/objectid-D5T27iny.js +0 -145
- package/dist/rule-builder-Di9RIYHF.js +0 -89
|
@@ -1,41 +1,42 @@
|
|
|
1
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-DteFjR9L.js";
|
|
4
4
|
import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
|
|
5
|
-
import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-
|
|
6
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
7
|
-
import { u as useMembershipStore } from "./membership-
|
|
8
|
-
import { u as useBusinessStore } from "./business-
|
|
9
|
-
import "./index-
|
|
10
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
5
|
+
import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-BHDq-yx-.js";
|
|
6
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-DBfDbpyb.js";
|
|
7
|
+
import { u as useMembershipStore } from "./membership-BL_43RJR.js";
|
|
8
|
+
import { u as useBusinessStore } from "./business-BqV9jK-p.js";
|
|
9
|
+
import "./index-qd_dvZcw.js";
|
|
10
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BrZeF45Z.js";
|
|
11
11
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
12
|
-
import { h as hooks } from "./moment-
|
|
13
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
12
|
+
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
13
|
+
import { f as featureVersionMapping } from "./campaign.enum-Dfa96W5V.js";
|
|
14
14
|
import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
|
|
15
|
-
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
16
|
-
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
17
|
-
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-
|
|
20
|
-
import { u as useI18n } from "./vue-i18n-
|
|
21
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-
|
|
22
|
-
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { T as TEMPLATES } from "./index-B9pl4zRZ.js";
|
|
26
|
-
import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-DNxa8Rqx.js";
|
|
27
|
-
import "./index-CONvJfKv.js";
|
|
28
|
-
import "./index-BI3m1Ehv.js";
|
|
29
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-DxbB4DxT.js";
|
|
15
|
+
import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-BLw3-hI1.js";
|
|
16
|
+
import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BTKpclKX.js";
|
|
17
|
+
import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-CqCxWltm.js";
|
|
18
|
+
import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Dhs2whAH.js";
|
|
19
|
+
import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-BKtBkC9Q.js";
|
|
20
|
+
import { u as useI18n } from "./vue-i18n-xo56wiwi.js";
|
|
21
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-C34RfwrT.js";
|
|
22
|
+
import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-BY3j1h72.js";
|
|
23
|
+
import { C as CountryTimezone, m as moment } from "./timezone-DaTVH4y0.js";
|
|
24
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Cbux1-fC.js";
|
|
30
25
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
26
|
+
import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DMye9MS3.js";
|
|
27
|
+
import { T as TEMPLATES } from "./index-2dknXEFJ.js";
|
|
28
|
+
import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-CDLBLuYq.js";
|
|
29
|
+
import "./index-C1Vrltkc.js";
|
|
30
|
+
import "./index-DYgdunxw.js";
|
|
31
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-BYTYWPsR.js";
|
|
32
|
+
import { u as useLoading } from "./loading-BVUeda4s.js";
|
|
33
|
+
import { i as initCollectibleConfig } from "./helper-BHiK3pLT.js";
|
|
34
|
+
import { C as CollectionUtils } from "./collection.fn-CYLIQJig.js";
|
|
34
35
|
import { s as sentenceCase$1 } from "./index-CsaQJMAR.js";
|
|
35
|
-
import "./index-
|
|
36
|
+
import "./index-Cc80pBYX.js";
|
|
36
37
|
import { useDialog } from "@feedmepos/ui-library";
|
|
37
|
-
import { u as useCampaignStore } from "./campaign-
|
|
38
|
-
import { S as SvcConfig } from "./index-
|
|
38
|
+
import { u as useCampaignStore } from "./campaign-CsWoG6e_.js";
|
|
39
|
+
import { S as SvcConfig } from "./index-BSQXDDQY.js";
|
|
39
40
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
40
41
|
const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
41
42
|
__name: "TimeRuleGroup",
|
|
@@ -47,83 +48,83 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
47
48
|
}
|
|
48
49
|
},
|
|
49
50
|
emits: ["update:model-value"],
|
|
50
|
-
setup(e, { emit:
|
|
51
|
-
const { t: a } = useI18n(),
|
|
52
|
-
!
|
|
51
|
+
setup(e, { emit: m }) {
|
|
52
|
+
const { t: a } = useI18n(), i = e, u = m, d = ref(
|
|
53
|
+
!i.modelValue || !i.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(i.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
53
54
|
);
|
|
54
|
-
watch(
|
|
55
|
-
var
|
|
56
|
-
if (n == "custom" &&
|
|
57
|
-
const
|
|
55
|
+
watch(d, async (o, n) => {
|
|
56
|
+
var s;
|
|
57
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((s = i.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
|
|
58
|
+
const y = await prompt.confirm(
|
|
58
59
|
a("connect.template.rule.time.confirm_remove"),
|
|
59
60
|
a("connect.common.confirm"),
|
|
60
61
|
a("connect.common.confirm"),
|
|
61
62
|
a("connect.common.cancel")
|
|
62
63
|
);
|
|
63
|
-
|
|
64
|
+
y && u(
|
|
64
65
|
"update:model-value",
|
|
65
66
|
RuleBuilder.setRuleToGroup(
|
|
66
|
-
|
|
67
|
+
i.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
67
68
|
RuleBuilder.scaffoldGroup("g_time")
|
|
68
69
|
)
|
|
69
|
-
),
|
|
70
|
+
), d.value = y ? o : n;
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
|
-
async function o
|
|
73
|
+
async function l(o) {
|
|
73
74
|
var n;
|
|
74
|
-
if (
|
|
75
|
+
if (o == "custom" && RuleBuilder.getRules((n = i.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
75
76
|
if (!await prompt.confirm(
|
|
76
77
|
a("connect.template.rule.time.confirm_remove"),
|
|
77
78
|
a("connect.common.confirm"),
|
|
78
79
|
a("connect.common.confirm"),
|
|
79
80
|
a("connect.common.cancel")
|
|
80
81
|
)) {
|
|
81
|
-
|
|
82
|
+
d.value = "all_time";
|
|
82
83
|
return;
|
|
83
84
|
}
|
|
84
85
|
u(
|
|
85
86
|
"update:model-value",
|
|
86
87
|
RuleBuilder.setRuleToGroup(
|
|
87
|
-
|
|
88
|
+
i.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
88
89
|
RuleBuilder.scaffoldGroup("g_time")
|
|
89
90
|
)
|
|
90
91
|
);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
return (
|
|
94
|
-
var
|
|
95
|
-
const
|
|
94
|
+
return (o, n) => {
|
|
95
|
+
var v;
|
|
96
|
+
const s = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
|
|
96
97
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
97
|
-
createVNode(
|
|
98
|
-
modelValue: unref(
|
|
98
|
+
createVNode(y, {
|
|
99
|
+
modelValue: unref(d),
|
|
99
100
|
"onUpdate:modelValue": [
|
|
100
|
-
n[0] || (n[0] = (
|
|
101
|
-
n[1] || (n[1] = (
|
|
101
|
+
n[0] || (n[0] = (h) => isRef(d) ? d.value = h : null),
|
|
102
|
+
n[1] || (n[1] = (h) => l(h))
|
|
102
103
|
]
|
|
103
104
|
}, {
|
|
104
105
|
default: withCtx(() => [
|
|
105
|
-
createVNode(
|
|
106
|
+
createVNode(s, {
|
|
106
107
|
label: unref(a)("connect.template.rule.time.all_time"),
|
|
107
108
|
value: "all_time"
|
|
108
109
|
}, null, 8, ["label"]),
|
|
109
|
-
createVNode(
|
|
110
|
+
createVNode(s, {
|
|
110
111
|
label: unref(a)("connect.template.rule.time.custom"),
|
|
111
112
|
value: "custom"
|
|
112
113
|
}, null, 8, ["label"])
|
|
113
114
|
]),
|
|
114
115
|
_: 1
|
|
115
116
|
}, 8, ["modelValue"]),
|
|
116
|
-
unref(
|
|
117
|
+
unref(d) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
117
118
|
key: 0,
|
|
118
119
|
class: "!mt-[0px]",
|
|
119
120
|
"include-only": "trigger",
|
|
120
121
|
"trigger-type": "SCHEDULE",
|
|
121
|
-
"model-value": ((
|
|
122
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
122
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
123
|
+
"onUpdate:modelValue": n[2] || (n[2] = (h) => u(
|
|
123
124
|
"update:model-value",
|
|
124
125
|
unref(RuleBuilder).setRuleToGroup(
|
|
125
126
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
126
|
-
|
|
127
|
+
h,
|
|
127
128
|
"&&"
|
|
128
129
|
)
|
|
129
130
|
))
|
|
@@ -139,29 +140,29 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
139
140
|
}
|
|
140
141
|
},
|
|
141
142
|
emits: ["update:model-value"],
|
|
142
|
-
setup(e, { emit:
|
|
143
|
-
const a = e,
|
|
144
|
-
const { property:
|
|
143
|
+
setup(e, { emit: m }) {
|
|
144
|
+
const a = e, i = m, u = computed(() => {
|
|
145
|
+
const { property: d, operator: l, equator: o } = RuleBuilder.simplify(
|
|
145
146
|
a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
146
147
|
op: "before",
|
|
147
148
|
x: 1
|
|
148
149
|
})
|
|
149
150
|
);
|
|
150
151
|
return {
|
|
151
|
-
property:
|
|
152
|
-
operator:
|
|
153
|
-
equator:
|
|
152
|
+
property: d,
|
|
153
|
+
operator: l,
|
|
154
|
+
equator: o
|
|
154
155
|
};
|
|
155
156
|
});
|
|
156
|
-
return (
|
|
157
|
-
const
|
|
157
|
+
return (d, l) => {
|
|
158
|
+
const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
|
|
158
159
|
return openBlock(), createElementBlock("div", null, [
|
|
159
|
-
createVNode(
|
|
160
|
+
createVNode(o, {
|
|
160
161
|
label: "On birthday",
|
|
161
162
|
value: "_isRange-day",
|
|
162
163
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
163
|
-
"onUpdate:modelValue":
|
|
164
|
-
|
|
164
|
+
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
165
|
+
i(
|
|
165
166
|
"update:model-value",
|
|
166
167
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
167
168
|
op: "this",
|
|
@@ -171,12 +172,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
171
172
|
);
|
|
172
173
|
})
|
|
173
174
|
}, null, 8, ["model-value"]),
|
|
174
|
-
createVNode(
|
|
175
|
+
createVNode(o, {
|
|
175
176
|
label: "N days before birthday",
|
|
176
177
|
value: "_isDay",
|
|
177
178
|
"model-value": unref(u).operator,
|
|
178
|
-
"onUpdate:modelValue":
|
|
179
|
-
|
|
179
|
+
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
180
|
+
i(
|
|
180
181
|
"update:model-value",
|
|
181
182
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
182
183
|
op: "after",
|
|
@@ -191,21 +192,21 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
191
192
|
label: "Days before birthday",
|
|
192
193
|
"show-steppers": !1,
|
|
193
194
|
"model-value": unref(u).equator.x,
|
|
194
|
-
"onUpdate:modelValue":
|
|
195
|
+
"onUpdate:modelValue": l[2] || (l[2] = (s) => i(
|
|
195
196
|
"update:model-value",
|
|
196
197
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
197
198
|
op: "after",
|
|
198
|
-
x:
|
|
199
|
+
x: s,
|
|
199
200
|
ignoreYear: !0
|
|
200
201
|
})
|
|
201
202
|
))
|
|
202
203
|
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
203
|
-
createVNode(
|
|
204
|
+
createVNode(o, {
|
|
204
205
|
label: "In birthday week",
|
|
205
206
|
value: "_isRange-week",
|
|
206
207
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
207
|
-
"onUpdate:modelValue":
|
|
208
|
-
|
|
208
|
+
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
209
|
+
i(
|
|
209
210
|
"update:model-value",
|
|
210
211
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
211
212
|
op: "this",
|
|
@@ -215,12 +216,12 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
215
216
|
);
|
|
216
217
|
})
|
|
217
218
|
}, null, 8, ["model-value"]),
|
|
218
|
-
createVNode(
|
|
219
|
+
createVNode(o, {
|
|
219
220
|
label: "In birthday month",
|
|
220
221
|
value: "_isRange-month",
|
|
221
222
|
"model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
|
|
222
|
-
"onUpdate:modelValue":
|
|
223
|
-
|
|
223
|
+
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
224
|
+
i(
|
|
224
225
|
"update:model-value",
|
|
225
226
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
226
227
|
op: "this",
|
|
@@ -249,16 +250,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
249
250
|
}
|
|
250
251
|
},
|
|
251
252
|
emits: ["update:model-value"],
|
|
252
|
-
setup(e, { emit:
|
|
253
|
-
const a = e,
|
|
254
|
-
(
|
|
253
|
+
setup(e, { emit: m }) {
|
|
254
|
+
const a = e, i = m, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
|
|
255
|
+
(d) => d.value == a.modelValue
|
|
255
256
|
) : TypeToTriggerOptions[a.campaignType]);
|
|
256
|
-
return (
|
|
257
|
-
const
|
|
257
|
+
return (d, l) => {
|
|
258
|
+
const o = resolveComponent("FmCard");
|
|
258
259
|
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
259
|
-
|
|
260
|
+
l[0] || (l[0] = 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)),
|
|
260
261
|
createElementVNode("div", _hoisted_2$c, [
|
|
261
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
262
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
262
263
|
variant: "outlined",
|
|
263
264
|
disabled: a.disabled,
|
|
264
265
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
@@ -267,7 +268,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
267
268
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
268
269
|
}]),
|
|
269
270
|
onClick: () => {
|
|
270
|
-
a.modelValue != n.value && !a.disabled &&
|
|
271
|
+
a.modelValue != n.value && !a.disabled && i("update:model-value", n.value);
|
|
271
272
|
},
|
|
272
273
|
key: n.name
|
|
273
274
|
}, {
|
|
@@ -294,27 +295,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
294
295
|
}
|
|
295
296
|
},
|
|
296
297
|
emits: ["update:model-value"],
|
|
297
|
-
setup(e, { emit:
|
|
298
|
-
const a =
|
|
299
|
-
return (
|
|
300
|
-
const
|
|
301
|
-
return openBlock(), createBlock(
|
|
298
|
+
setup(e, { emit: m }) {
|
|
299
|
+
const a = m;
|
|
300
|
+
return (i, u) => {
|
|
301
|
+
const d = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
302
|
+
return openBlock(), createBlock(o, {
|
|
302
303
|
label: e.label,
|
|
303
304
|
"model-value": e.modelValue || "",
|
|
304
305
|
"onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
|
|
305
306
|
}, {
|
|
306
307
|
"trigger-button": withCtx(({ opened: n }) => [
|
|
307
|
-
createVNode(
|
|
308
|
+
createVNode(l, {
|
|
308
309
|
class: "flex items-center",
|
|
309
310
|
"prepend-icon": "calendar_month",
|
|
310
311
|
"icon-outlined": !n
|
|
311
312
|
}, {
|
|
312
313
|
append: withCtx(() => [
|
|
313
|
-
e.modelValue ? (openBlock(), createBlock(
|
|
314
|
+
e.modelValue ? (openBlock(), createBlock(d, {
|
|
314
315
|
key: 0,
|
|
315
316
|
variant: "tertiary",
|
|
316
317
|
icon: "clear",
|
|
317
|
-
onClick: u[0] || (u[0] = (
|
|
318
|
+
onClick: u[0] || (u[0] = (s) => (s.stopPropagation(), a("update:model-value", null)))
|
|
318
319
|
})) : createCommentVNode("", !0)
|
|
319
320
|
]),
|
|
320
321
|
default: withCtx(() => [
|
|
@@ -338,19 +339,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
338
339
|
}
|
|
339
340
|
},
|
|
340
341
|
emits: ["update:model-value"],
|
|
341
|
-
setup(e, { emit:
|
|
342
|
-
const a =
|
|
343
|
-
return (
|
|
344
|
-
var
|
|
342
|
+
setup(e, { emit: m }) {
|
|
343
|
+
const a = m;
|
|
344
|
+
return (i, u) => {
|
|
345
|
+
var d, l;
|
|
345
346
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
346
347
|
createElementVNode("div", _hoisted_2$b, [
|
|
347
348
|
createVNode(_sfc_main$f, {
|
|
348
|
-
"model-value": ((
|
|
349
|
+
"model-value": ((d = e.modelValue) == null ? void 0 : d.startDate) ?? null,
|
|
349
350
|
label: "Start date",
|
|
350
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
351
|
+
"onUpdate:modelValue": u[0] || (u[0] = (o) => {
|
|
351
352
|
var n;
|
|
352
353
|
return a("update:model-value", {
|
|
353
|
-
startDate:
|
|
354
|
+
startDate: o,
|
|
354
355
|
endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
|
|
355
356
|
});
|
|
356
357
|
})
|
|
@@ -359,13 +360,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
359
360
|
u[2] || (u[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
|
|
360
361
|
createElementVNode("div", _hoisted_3$9, [
|
|
361
362
|
createVNode(_sfc_main$f, {
|
|
362
|
-
"model-value": ((
|
|
363
|
+
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
363
364
|
label: "End date",
|
|
364
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
365
|
+
"onUpdate:modelValue": u[1] || (u[1] = (o) => {
|
|
365
366
|
var n;
|
|
366
367
|
return a("update:model-value", {
|
|
367
368
|
startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
|
|
368
|
-
endDate:
|
|
369
|
+
endDate: o
|
|
369
370
|
});
|
|
370
371
|
})
|
|
371
372
|
}, null, 8, ["model-value"])
|
|
@@ -391,25 +392,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
391
392
|
}
|
|
392
393
|
},
|
|
393
394
|
emits: ["update:model-value"],
|
|
394
|
-
setup(e, { emit:
|
|
395
|
-
const a = e,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
395
|
+
setup(e, { emit: m }) {
|
|
396
|
+
const a = e, i = m, u = useCoreStore(), d = computed(
|
|
397
|
+
() => CountryTimezone[u.currentCountry.value || "MY"]
|
|
398
|
+
);
|
|
399
|
+
function l() {
|
|
400
|
+
const g = RuleBuilder.getRules(a.modelValue);
|
|
401
|
+
return g.length == 0 ? "fixed" : g.some(
|
|
402
|
+
(c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
|
|
400
403
|
) ? "repeating" : "fixed";
|
|
401
404
|
}
|
|
402
|
-
const
|
|
403
|
-
const
|
|
404
|
-
(
|
|
405
|
-
),
|
|
406
|
-
(
|
|
405
|
+
const o = ref(l()), n = ref(!1), s = computed(() => {
|
|
406
|
+
const g = RuleBuilder.getRules(a.modelValue), c = g.find(
|
|
407
|
+
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
|
|
408
|
+
), r = g.find(
|
|
409
|
+
(p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.time"
|
|
407
410
|
);
|
|
408
411
|
return {
|
|
409
|
-
date:
|
|
410
|
-
time:
|
|
412
|
+
date: c ? RuleBuilder.simplify(c).equator : null,
|
|
413
|
+
time: r ? RuleBuilder.simplify(r).equator : null
|
|
411
414
|
};
|
|
412
|
-
}),
|
|
415
|
+
}), y = computed(
|
|
413
416
|
() => calculateNextScheduleAt(
|
|
414
417
|
a.modelValue,
|
|
415
418
|
/* @__PURE__ */ new Date(),
|
|
@@ -417,8 +420,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
417
420
|
a.endDate ? new Date(a.endDate) : void 0
|
|
418
421
|
)
|
|
419
422
|
);
|
|
420
|
-
function
|
|
421
|
-
const
|
|
423
|
+
function v(g) {
|
|
424
|
+
const c = g.label.toLowerCase(), r = c == "fixed" ? [
|
|
422
425
|
RuleBuilder.constructEntry(
|
|
423
426
|
"trigger.date",
|
|
424
427
|
"_isOnDate",
|
|
@@ -433,73 +436,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
433
436
|
),
|
|
434
437
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
435
438
|
];
|
|
436
|
-
|
|
439
|
+
i(
|
|
437
440
|
"update:model-value",
|
|
438
441
|
RuleBuilder.setRuleToGroup(
|
|
439
442
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
440
|
-
|
|
443
|
+
r
|
|
441
444
|
)
|
|
442
|
-
),
|
|
445
|
+
), o.value = c;
|
|
443
446
|
}
|
|
444
|
-
function g
|
|
445
|
-
|
|
447
|
+
function h(g) {
|
|
448
|
+
o.value == "fixed" ? i(
|
|
446
449
|
"update:model-value",
|
|
447
450
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
448
451
|
RuleBuilder.constructEntry(
|
|
449
452
|
"trigger.date",
|
|
450
453
|
"_isOnDate",
|
|
451
|
-
|
|
454
|
+
g.date
|
|
452
455
|
),
|
|
453
456
|
RuleBuilder.constructEntry(
|
|
454
457
|
"trigger.time",
|
|
455
458
|
"_isOnTime",
|
|
456
|
-
|
|
459
|
+
g.time
|
|
457
460
|
)
|
|
458
461
|
])
|
|
459
|
-
) :
|
|
462
|
+
) : i(
|
|
460
463
|
"update:model-value",
|
|
461
464
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
462
465
|
RuleBuilder.constructEntry(
|
|
463
466
|
"trigger.date",
|
|
464
467
|
"_rrule",
|
|
465
|
-
|
|
468
|
+
g.date
|
|
466
469
|
),
|
|
467
470
|
RuleBuilder.constructEntry(
|
|
468
471
|
"trigger.time",
|
|
469
472
|
"_isOnTime",
|
|
470
|
-
|
|
473
|
+
g.time
|
|
471
474
|
)
|
|
472
475
|
])
|
|
473
476
|
);
|
|
474
477
|
}
|
|
475
|
-
return (
|
|
476
|
-
const
|
|
478
|
+
return (g, c) => {
|
|
479
|
+
const r = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), f = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), C = resolveComponent("FmField"), V = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), k = resolveComponent("FmHelperText");
|
|
477
480
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
478
|
-
createVNode(
|
|
481
|
+
createVNode(r, {
|
|
479
482
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
480
|
-
"model-value": { label: unref(cases).title(unref(
|
|
481
|
-
"onUpdate:modelValue":
|
|
483
|
+
"model-value": { label: unref(cases).title(unref(o)) },
|
|
484
|
+
"onUpdate:modelValue": v,
|
|
482
485
|
class: "mb-8"
|
|
483
486
|
}, null, 8, ["model-value"]),
|
|
484
487
|
createElementVNode("div", _hoisted_1$d, [
|
|
485
488
|
createElementVNode("div", _hoisted_2$a, [
|
|
486
|
-
createVNode(
|
|
489
|
+
createVNode(p, {
|
|
487
490
|
label: "Notify time",
|
|
488
|
-
"model-value": unref(
|
|
489
|
-
"onUpdate:modelValue":
|
|
490
|
-
"helper-text": unref(
|
|
491
|
-
"helper-state": unref(
|
|
491
|
+
"model-value": unref(s).time,
|
|
492
|
+
"onUpdate:modelValue": c[0] || (c[0] = (B) => h({ date: unref(s).date, time: B })),
|
|
493
|
+
"helper-text": unref(s).time ? void 0 : "Time is required",
|
|
494
|
+
"helper-state": unref(s).time ? void 0 : "error"
|
|
492
495
|
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
493
|
-
unref(
|
|
496
|
+
unref(o) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
|
|
494
497
|
createElementVNode("div", _hoisted_4$6, [
|
|
495
|
-
|
|
496
|
-
unref(
|
|
498
|
+
c[5] || (c[5] = createElementVNode("div", null, "Notify date", -1)),
|
|
499
|
+
unref(s).date ? (openBlock(), createBlock(b, {
|
|
497
500
|
key: 0,
|
|
498
501
|
"z-index": 9999,
|
|
499
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
502
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options)
|
|
500
503
|
}, {
|
|
501
504
|
default: withCtx(() => [
|
|
502
|
-
createVNode(
|
|
505
|
+
createVNode(f, {
|
|
503
506
|
name: "info",
|
|
504
507
|
size: "sm",
|
|
505
508
|
outline: !0
|
|
@@ -509,29 +512,29 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
509
512
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
510
513
|
]),
|
|
511
514
|
createVNode(x, {
|
|
512
|
-
"show-popover": unref(
|
|
513
|
-
onPopoverChanged:
|
|
515
|
+
"show-popover": unref(n),
|
|
516
|
+
onPopoverChanged: c[3] || (c[3] = (B) => n.value = B)
|
|
514
517
|
}, {
|
|
515
518
|
"popover-button": withCtx(() => [
|
|
516
|
-
createVNode(
|
|
519
|
+
createVNode(C, {
|
|
517
520
|
class: "cursor-pointer",
|
|
518
|
-
"helper-text": unref(
|
|
519
|
-
"helper-state": unref(
|
|
521
|
+
"helper-text": unref(s).date ? void 0 : "Date is required",
|
|
522
|
+
"helper-state": unref(s).date ? void 0 : "error"
|
|
520
523
|
}, {
|
|
521
524
|
default: withCtx(() => [
|
|
522
|
-
createElementVNode("div", _hoisted_5$3, toDisplayString(unref(
|
|
525
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(unref(s).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options) : "Set a repeating date"), 1)
|
|
523
526
|
]),
|
|
524
527
|
_: 1
|
|
525
528
|
}, 8, ["helper-text", "helper-state"])
|
|
526
529
|
]),
|
|
527
530
|
default: withCtx(() => [
|
|
528
|
-
createVNode(
|
|
531
|
+
createVNode(V, { class: "elevated p-8 w-[450px]" }, {
|
|
529
532
|
default: withCtx(() => [
|
|
530
533
|
createVNode(_sfc_main$k, {
|
|
531
534
|
"apply-button": !0,
|
|
532
|
-
"model-value": unref(
|
|
533
|
-
onCancel:
|
|
534
|
-
"onUpdate:modelValue":
|
|
535
|
+
"model-value": unref(s).date || "",
|
|
536
|
+
onCancel: c[1] || (c[1] = (B) => n.value = !1),
|
|
537
|
+
"onUpdate:modelValue": c[2] || (c[2] = (B) => (h({ date: B, time: unref(s).time }), n.value = !1))
|
|
535
538
|
}, null, 8, ["model-value"])
|
|
536
539
|
]),
|
|
537
540
|
_: 1
|
|
@@ -539,19 +542,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
539
542
|
]),
|
|
540
543
|
_: 1
|
|
541
544
|
}, 8, ["show-popover"])
|
|
542
|
-
])) : (openBlock(), createBlock(
|
|
545
|
+
])) : (openBlock(), createBlock(R, {
|
|
543
546
|
key: 1,
|
|
544
547
|
label: "Notify date",
|
|
545
|
-
"model-value": unref(
|
|
546
|
-
"onUpdate:modelValue":
|
|
547
|
-
"helper-text": unref(
|
|
548
|
-
"helper-state": unref(
|
|
548
|
+
"model-value": unref(s).date || "",
|
|
549
|
+
"onUpdate:modelValue": c[4] || (c[4] = (B) => h({ date: B, time: unref(s).time })),
|
|
550
|
+
"helper-text": unref(s).date ? void 0 : "Date is required",
|
|
551
|
+
"helper-state": unref(s).date ? void 0 : "error"
|
|
549
552
|
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
550
553
|
]),
|
|
551
|
-
unref(
|
|
554
|
+
unref(s).date && unref(s).time && unref(y) ? (openBlock(), createBlock(k, {
|
|
552
555
|
key: 0,
|
|
553
|
-
text: `${unref(
|
|
554
|
-
${unref(
|
|
556
|
+
text: `${unref(moment)(unref(y)).isAfter(unref(moment)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(moment)(unref(y)).format("dddd, DD MMM YYYY")} at
|
|
557
|
+
${unref(moment)(unref(y)).format("hh:mmA")}(UTC${unref(moment).tz(unref(d)).format("Z")}) (${unref(moment)(unref(y)).fromNow()})`
|
|
555
558
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
556
559
|
])
|
|
557
560
|
], 64);
|
|
@@ -565,8 +568,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
565
568
|
}
|
|
566
569
|
},
|
|
567
570
|
emits: ["update:model-value"],
|
|
568
|
-
setup(e, { emit:
|
|
569
|
-
const a = e,
|
|
571
|
+
setup(e, { emit: m }) {
|
|
572
|
+
const a = e, i = m, u = computed(
|
|
570
573
|
() => [
|
|
571
574
|
{
|
|
572
575
|
label: "Fortune Wheel",
|
|
@@ -580,14 +583,14 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
580
583
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
581
584
|
hidden: !0
|
|
582
585
|
}
|
|
583
|
-
].filter((
|
|
586
|
+
].filter((d) => !d.hidden)
|
|
584
587
|
);
|
|
585
|
-
return (
|
|
586
|
-
const
|
|
588
|
+
return (d, l) => {
|
|
589
|
+
const o = resolveComponent("FmCard");
|
|
587
590
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
588
|
-
|
|
591
|
+
l[0] || (l[0] = 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)),
|
|
589
592
|
createElementVNode("div", _hoisted_2$9, [
|
|
590
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
593
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
591
594
|
variant: "outlined",
|
|
592
595
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
593
596
|
"col-span-2": unref(u).length == 1,
|
|
@@ -595,7 +598,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
595
598
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
596
599
|
}]),
|
|
597
600
|
onClick: () => {
|
|
598
|
-
a.modelValue != n.value &&
|
|
601
|
+
a.modelValue != n.value && i("update:model-value", n.value);
|
|
599
602
|
},
|
|
600
603
|
key: n.value
|
|
601
604
|
}, {
|
|
@@ -615,48 +618,48 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
615
618
|
}, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
616
619
|
__name: "EditRewardPoolSheet",
|
|
617
620
|
emits: ["update:model-value"],
|
|
618
|
-
setup(e, { expose:
|
|
619
|
-
const
|
|
621
|
+
setup(e, { expose: m, emit: a }) {
|
|
622
|
+
const i = useMembershipStore(), { minor: u } = useLoading, d = ref(!1), l = ref(), o = ref(), n = ref(0), s = computed(() => {
|
|
620
623
|
var r;
|
|
621
|
-
return ((r =
|
|
622
|
-
(
|
|
623
|
-
var
|
|
624
|
-
return
|
|
624
|
+
return ((r = i.loyaltyRewards.items.find(
|
|
625
|
+
(p) => {
|
|
626
|
+
var f;
|
|
627
|
+
return p.value === ((f = l.value) == null ? void 0 : f.collectible);
|
|
625
628
|
}
|
|
626
629
|
)) == null ? void 0 : r.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
627
|
-
}),
|
|
628
|
-
const
|
|
629
|
-
return
|
|
630
|
+
}), y = computed(() => {
|
|
631
|
+
const c = s.value.safeParse(l.value);
|
|
632
|
+
return c.success ? [] : c.error.errors;
|
|
630
633
|
});
|
|
631
|
-
function
|
|
632
|
-
|
|
634
|
+
function v(c, r, p) {
|
|
635
|
+
c && (l.value = r, n.value = p), d.value = c;
|
|
633
636
|
}
|
|
634
|
-
const
|
|
635
|
-
async function
|
|
636
|
-
const
|
|
637
|
-
|
|
637
|
+
const h = a;
|
|
638
|
+
async function g() {
|
|
639
|
+
const c = s.value.safeParse(l.value);
|
|
640
|
+
c.success && (await u(
|
|
638
641
|
async () => {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
+
c.data.type === "VOUCHER" && o.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
|
|
643
|
+
c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
644
|
+
o.value
|
|
642
645
|
));
|
|
643
646
|
},
|
|
644
647
|
{
|
|
645
648
|
message: "Uploading reward image",
|
|
646
649
|
successMessage: "Reward image updated"
|
|
647
650
|
}
|
|
648
|
-
),
|
|
651
|
+
), h("update:model-value", c.data, n.value));
|
|
649
652
|
}
|
|
650
|
-
return
|
|
651
|
-
showSheet:
|
|
652
|
-
}), (
|
|
653
|
-
const
|
|
654
|
-
return openBlock(), createBlock(
|
|
653
|
+
return m({
|
|
654
|
+
showSheet: v
|
|
655
|
+
}), (c, r) => {
|
|
656
|
+
const p = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
657
|
+
return openBlock(), createBlock(C, {
|
|
655
658
|
"max-width": 560,
|
|
656
|
-
modelValue: unref(
|
|
659
|
+
modelValue: unref(d),
|
|
657
660
|
"onUpdate:modelValue": [
|
|
658
|
-
r[9] || (r[9] = (
|
|
659
|
-
r[10] || (r[10] = (
|
|
661
|
+
r[9] || (r[9] = (V) => isRef(d) ? d.value = V : null),
|
|
662
|
+
r[10] || (r[10] = (V) => d.value = V)
|
|
660
663
|
],
|
|
661
664
|
header: "Edit reward",
|
|
662
665
|
"dismiss-away": ""
|
|
@@ -666,36 +669,36 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
666
669
|
createVNode(b, {
|
|
667
670
|
variant: "primary",
|
|
668
671
|
type: "button",
|
|
669
|
-
disabled: unref(
|
|
672
|
+
disabled: unref(y).length > 0,
|
|
670
673
|
label: "Confirm",
|
|
671
|
-
onClick: r[7] || (r[7] = (
|
|
674
|
+
onClick: r[7] || (r[7] = (V) => g())
|
|
672
675
|
}, null, 8, ["disabled"]),
|
|
673
676
|
createVNode(b, {
|
|
674
677
|
variant: "secondary",
|
|
675
678
|
type: "button",
|
|
676
679
|
label: "Cancel",
|
|
677
|
-
onClick: r[8] || (r[8] = (
|
|
680
|
+
onClick: r[8] || (r[8] = (V) => d.value = !1)
|
|
678
681
|
})
|
|
679
682
|
])
|
|
680
683
|
]),
|
|
681
684
|
default: withCtx(() => {
|
|
682
|
-
var
|
|
685
|
+
var V, x, R;
|
|
683
686
|
return [
|
|
684
|
-
unref(
|
|
685
|
-
createVNode(
|
|
687
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
688
|
+
createVNode(p, {
|
|
686
689
|
label: "Reward Type",
|
|
687
690
|
items: [
|
|
688
691
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
689
692
|
{ label: "Voucher", value: "VOUCHER" },
|
|
690
693
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
691
694
|
],
|
|
692
|
-
"model-value": unref(
|
|
693
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
694
|
-
|
|
695
|
+
"model-value": unref(l).type,
|
|
696
|
+
"onUpdate:modelValue": r[0] || (r[0] = (k) => {
|
|
697
|
+
k == "NO_REWARD" ? l.value = {
|
|
695
698
|
type: "NO_REWARD",
|
|
696
699
|
collectible: null,
|
|
697
700
|
weight: 1
|
|
698
|
-
} :
|
|
701
|
+
} : k === "VOUCHER" ? l.value = {
|
|
699
702
|
collectible: null,
|
|
700
703
|
type: "VOUCHER",
|
|
701
704
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -709,8 +712,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
709
712
|
validForDay: 7
|
|
710
713
|
},
|
|
711
714
|
weight: 1
|
|
712
|
-
} :
|
|
713
|
-
collectible: unref(
|
|
715
|
+
} : l.value = {
|
|
716
|
+
collectible: unref(i).loyaltyRewards.raw[0]._id,
|
|
714
717
|
type: "LOYALTY",
|
|
715
718
|
earningOption: {
|
|
716
719
|
amount: 1,
|
|
@@ -723,75 +726,75 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
|
|
|
723
726
|
};
|
|
724
727
|
})
|
|
725
728
|
}, null, 8, ["model-value"]),
|
|
726
|
-
unref(
|
|
729
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
|
|
727
730
|
key: 0,
|
|
728
731
|
label: "Loyalty type",
|
|
729
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
730
|
-
items: unref(
|
|
731
|
-
"model-value": unref(
|
|
732
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
732
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(l).type])],
|
|
733
|
+
items: unref(i).loyaltyRewards.items,
|
|
734
|
+
"model-value": unref(l).collectible,
|
|
735
|
+
"onUpdate:modelValue": r[1] || (r[1] = (k) => unref(l).collectible = k)
|
|
733
736
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
734
|
-
createVNode(
|
|
737
|
+
createVNode(f, {
|
|
735
738
|
label: "Weight",
|
|
736
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
737
|
-
"model-value": unref(
|
|
738
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
739
|
-
...unref(
|
|
740
|
-
weight:
|
|
739
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(l).type])],
|
|
740
|
+
"model-value": unref(l).weight,
|
|
741
|
+
"onUpdate:modelValue": r[2] || (r[2] = (k) => l.value = {
|
|
742
|
+
...unref(l),
|
|
743
|
+
weight: k
|
|
741
744
|
})
|
|
742
745
|
}, null, 8, ["rules", "model-value"]),
|
|
743
|
-
unref(
|
|
744
|
-
((
|
|
745
|
-
(
|
|
746
|
-
var
|
|
747
|
-
return
|
|
746
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
747
|
+
((V = unref(i).loyaltyRewards.items.find(
|
|
748
|
+
(k) => {
|
|
749
|
+
var B;
|
|
750
|
+
return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
|
|
748
751
|
}
|
|
749
|
-
)) == null ? void 0 :
|
|
752
|
+
)) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
750
753
|
r[11] || (r[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
751
754
|
createVNode(_sfc_main$l, {
|
|
752
755
|
class: "mt-[-8px]",
|
|
753
756
|
rules: [
|
|
754
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
757
|
+
unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(l).type])
|
|
755
758
|
],
|
|
756
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
757
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
759
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
760
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
758
761
|
"fixed-type": !0,
|
|
759
|
-
"model-value": unref(
|
|
760
|
-
"onUpdate:modelValue": r[3] || (r[3] = (
|
|
761
|
-
...unref(
|
|
762
|
-
earningOption:
|
|
762
|
+
"model-value": unref(l).earningOption,
|
|
763
|
+
"onUpdate:modelValue": r[3] || (r[3] = (k) => l.value = {
|
|
764
|
+
...unref(l),
|
|
765
|
+
earningOption: k
|
|
763
766
|
})
|
|
764
767
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
765
768
|
], 64)) : createCommentVNode("", !0),
|
|
766
769
|
r[12] || (r[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
767
770
|
createVNode(_sfc_main$m, {
|
|
768
|
-
type: unref(
|
|
769
|
-
"for-credit": unref(
|
|
770
|
-
(
|
|
771
|
-
var
|
|
772
|
-
return
|
|
771
|
+
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
772
|
+
"for-credit": unref(l).type === "LOYALTY" && ((x = unref(i).loyaltyRewards.items.find(
|
|
773
|
+
(k) => {
|
|
774
|
+
var B;
|
|
775
|
+
return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
|
|
773
776
|
}
|
|
774
|
-
)) == null ? void 0 :
|
|
777
|
+
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
775
778
|
class: "!gap-24",
|
|
776
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
777
|
-
"model-value": unref(
|
|
778
|
-
"onUpdate:modelValue": r[4] || (r[4] = (
|
|
779
|
-
...unref(
|
|
780
|
-
validityOption:
|
|
779
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(l).type])],
|
|
780
|
+
"model-value": unref(l).validityOption,
|
|
781
|
+
"onUpdate:modelValue": r[4] || (r[4] = (k) => l.value = {
|
|
782
|
+
...unref(l),
|
|
783
|
+
validityOption: k
|
|
781
784
|
})
|
|
782
785
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
783
786
|
], 64)) : createCommentVNode("", !0),
|
|
784
|
-
unref(
|
|
787
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
785
788
|
key: 2,
|
|
786
|
-
"reward-image": unref(
|
|
787
|
-
"model-value": ((
|
|
788
|
-
"onUpdate:modelValue": r[5] || (r[5] = (
|
|
789
|
-
...unref(
|
|
790
|
-
collectibleConfig:
|
|
789
|
+
"reward-image": unref(o),
|
|
790
|
+
"model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
791
|
+
"onUpdate:modelValue": r[5] || (r[5] = (k) => l.value = {
|
|
792
|
+
...unref(l),
|
|
793
|
+
collectibleConfig: k
|
|
791
794
|
}),
|
|
792
|
-
"onUpdate:rewardImage": r[6] || (r[6] = (
|
|
795
|
+
"onUpdate:rewardImage": r[6] || (r[6] = (k) => o.value = k)
|
|
793
796
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
794
|
-
createVNode(JsonViewer, { json: unref(
|
|
797
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
795
798
|
])) : createCommentVNode("", !0)
|
|
796
799
|
];
|
|
797
800
|
}),
|
|
@@ -818,87 +821,87 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
818
821
|
}
|
|
819
822
|
},
|
|
820
823
|
emits: ["update:model-value"],
|
|
821
|
-
setup(e, { emit:
|
|
822
|
-
const a = e,
|
|
823
|
-
const
|
|
824
|
-
return
|
|
824
|
+
setup(e, { emit: m }) {
|
|
825
|
+
const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
|
|
826
|
+
const c = d.safeParse(l.value);
|
|
827
|
+
return c.success ? [] : c.error.errors;
|
|
825
828
|
}), n = ref();
|
|
826
|
-
function
|
|
827
|
-
var
|
|
828
|
-
const
|
|
829
|
-
|
|
829
|
+
function s(c, r) {
|
|
830
|
+
var f;
|
|
831
|
+
const p = [...l.value];
|
|
832
|
+
p[r] = c, (f = n.value) == null || f.showSheet(!1), i("update:model-value", p);
|
|
830
833
|
}
|
|
831
|
-
function
|
|
832
|
-
const r =
|
|
833
|
-
(b) => b._id.toString() ==
|
|
834
|
-
),
|
|
834
|
+
function y(c) {
|
|
835
|
+
const r = c.type == "VOUCHER" ? c.collectibleConfig : u.collectibles.find(
|
|
836
|
+
(b) => b._id.toString() == c.collectible
|
|
837
|
+
), p = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), f = c.weight;
|
|
835
838
|
return {
|
|
836
|
-
label: isNullOrEmpty(
|
|
837
|
-
sublabel: `${
|
|
839
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
840
|
+
sublabel: `${f} (${(f / l.value.reduce((b, C) => b + C.weight, 0) * 100).toFixed(2)}%)`
|
|
838
841
|
};
|
|
839
842
|
}
|
|
840
|
-
function
|
|
841
|
-
var
|
|
842
|
-
const r = [...
|
|
843
|
-
(
|
|
843
|
+
function v(c) {
|
|
844
|
+
var p;
|
|
845
|
+
const r = [...l.value];
|
|
846
|
+
(p = n.value) == null || p.showSheet(!0, r[c], c);
|
|
844
847
|
}
|
|
845
|
-
function
|
|
846
|
-
const r = [...
|
|
847
|
-
r.splice(
|
|
848
|
+
function h(c) {
|
|
849
|
+
const r = [...l.value];
|
|
850
|
+
r.splice(c, 1), i("update:model-value", r);
|
|
848
851
|
}
|
|
849
|
-
function
|
|
850
|
-
var
|
|
851
|
-
(
|
|
852
|
+
function g() {
|
|
853
|
+
var c;
|
|
854
|
+
(c = n.value) == null || c.showSheet(
|
|
852
855
|
!0,
|
|
853
856
|
{
|
|
854
857
|
type: "NO_REWARD",
|
|
855
858
|
collectible: null,
|
|
856
859
|
weight: 1
|
|
857
860
|
},
|
|
858
|
-
|
|
861
|
+
l.value.length
|
|
859
862
|
);
|
|
860
863
|
}
|
|
861
|
-
return (
|
|
862
|
-
const
|
|
864
|
+
return (c, r) => {
|
|
865
|
+
const p = resolveComponent("FmButton"), f = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
863
866
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
864
867
|
r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1)),
|
|
865
|
-
createVNode(
|
|
868
|
+
createVNode(p, {
|
|
866
869
|
label: "Add Reward",
|
|
867
|
-
onClick: r[0] || (r[0] = (
|
|
870
|
+
onClick: r[0] || (r[0] = (C) => g()),
|
|
868
871
|
variant: "plain",
|
|
869
872
|
icon: "add"
|
|
870
873
|
}),
|
|
871
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
872
|
-
key:
|
|
874
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, V) => (openBlock(), createBlock(f, {
|
|
875
|
+
key: V,
|
|
873
876
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
874
877
|
variant: "outlined",
|
|
875
|
-
onClick: (
|
|
878
|
+
onClick: (x) => v(V)
|
|
876
879
|
}, {
|
|
877
880
|
default: withCtx(() => {
|
|
878
|
-
var
|
|
881
|
+
var x;
|
|
879
882
|
return [
|
|
880
883
|
createElementVNode("div", null, [
|
|
881
|
-
createElementVNode("div", _hoisted_2$7, toDisplayString(
|
|
882
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
884
|
+
createElementVNode("div", _hoisted_2$7, toDisplayString(C.type == "LOYALTY" ? (x = C == null ? void 0 : C.earningOption) == null ? void 0 : x.amount : "") + " " + toDisplayString(y(C).label), 1),
|
|
885
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(y(C).sublabel), 1)
|
|
883
886
|
]),
|
|
884
|
-
createVNode(
|
|
887
|
+
createVNode(p, {
|
|
885
888
|
icon: "delete",
|
|
886
889
|
variant: "tertiary",
|
|
887
|
-
onClick: (
|
|
890
|
+
onClick: (R) => (R.stopPropagation(), h(V))
|
|
888
891
|
}, null, 8, ["onClick"])
|
|
889
892
|
];
|
|
890
893
|
}),
|
|
891
894
|
_: 2
|
|
892
895
|
}, 1032, ["onClick"]))), 128)),
|
|
893
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
894
|
-
key:
|
|
895
|
-
text:
|
|
896
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(b, {
|
|
897
|
+
key: C.message,
|
|
898
|
+
text: C.message,
|
|
896
899
|
state: "error"
|
|
897
900
|
}, null, 8, ["text"]))), 128)),
|
|
898
901
|
createVNode(_sfc_main$b, {
|
|
899
902
|
ref_key: "sheetRef",
|
|
900
903
|
ref: n,
|
|
901
|
-
"onUpdate:modelValue":
|
|
904
|
+
"onUpdate:modelValue": s
|
|
902
905
|
}, null, 512)
|
|
903
906
|
]);
|
|
904
907
|
};
|
|
@@ -914,48 +917,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
914
917
|
}
|
|
915
918
|
},
|
|
916
919
|
emits: ["update:model-value"],
|
|
917
|
-
setup(e, { emit:
|
|
918
|
-
const a = e,
|
|
920
|
+
setup(e, { emit: m }) {
|
|
921
|
+
const a = e, i = m, u = computed(() => [
|
|
919
922
|
{
|
|
920
923
|
label: "Rock paper scissor",
|
|
921
924
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
922
925
|
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
923
926
|
}
|
|
924
927
|
]);
|
|
925
|
-
return (
|
|
926
|
-
var
|
|
927
|
-
const
|
|
928
|
+
return (d, l) => {
|
|
929
|
+
var y, v, h;
|
|
930
|
+
const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), s = resolveComponent("FmHelperText");
|
|
928
931
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
929
|
-
createVNode(
|
|
932
|
+
createVNode(o, {
|
|
930
933
|
label: "Enable game",
|
|
931
|
-
"model-value": !!((
|
|
932
|
-
"onUpdate:modelValue":
|
|
934
|
+
"model-value": !!((y = e.modelValue) != null && y.gameType),
|
|
935
|
+
"onUpdate:modelValue": l[0] || (l[0] = (g) => g ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
|
|
933
936
|
}, null, 8, ["model-value"]),
|
|
934
|
-
((
|
|
935
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (
|
|
936
|
-
var
|
|
937
|
+
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
|
|
938
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g) => {
|
|
939
|
+
var c, r;
|
|
937
940
|
return openBlock(), createBlock(n, {
|
|
938
941
|
variant: "outlined",
|
|
939
942
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
940
943
|
"col-span-2": unref(u).length == 1,
|
|
941
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
942
|
-
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) !=
|
|
944
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((c = e.modelValue) == null ? void 0 : c.gameType) == g.value,
|
|
945
|
+
"hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != g.value
|
|
943
946
|
}]),
|
|
944
947
|
onClick: () => {
|
|
945
|
-
var
|
|
946
|
-
((
|
|
948
|
+
var p;
|
|
949
|
+
((p = a.modelValue) == null ? void 0 : p.gameType) != g.value && i("update:model-value", { gameType: g.value });
|
|
947
950
|
},
|
|
948
|
-
key:
|
|
951
|
+
key: g.value
|
|
949
952
|
}, {
|
|
950
953
|
default: withCtx(() => [
|
|
951
|
-
createElementVNode("div", _hoisted_3$5, toDisplayString(
|
|
952
|
-
createElementVNode("div", _hoisted_4$4, toDisplayString(
|
|
954
|
+
createElementVNode("div", _hoisted_3$5, toDisplayString(g.label), 1),
|
|
955
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(g.description), 1)
|
|
953
956
|
]),
|
|
954
957
|
_: 2
|
|
955
958
|
}, 1032, ["class", "onClick"]);
|
|
956
959
|
}), 128))
|
|
957
960
|
])) : createCommentVNode("", !0),
|
|
958
|
-
((
|
|
961
|
+
((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(s, {
|
|
959
962
|
key: 1,
|
|
960
963
|
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
961
964
|
state: "warning"
|
|
@@ -971,8 +974,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
971
974
|
}
|
|
972
975
|
},
|
|
973
976
|
emits: ["update:model-value"],
|
|
974
|
-
setup(e, { emit:
|
|
975
|
-
const a = e,
|
|
977
|
+
setup(e, { emit: m }) {
|
|
978
|
+
const a = e, i = m, u = computed(() => [
|
|
976
979
|
{
|
|
977
980
|
label: "Stamp",
|
|
978
981
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -984,12 +987,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
984
987
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
985
988
|
}
|
|
986
989
|
]);
|
|
987
|
-
return (
|
|
988
|
-
const
|
|
990
|
+
return (d, l) => {
|
|
991
|
+
const o = resolveComponent("FmCard");
|
|
989
992
|
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
990
|
-
|
|
993
|
+
l[0] || (l[0] = 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)),
|
|
991
994
|
createElementVNode("div", _hoisted_2$5, [
|
|
992
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(
|
|
995
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
|
|
993
996
|
variant: "outlined",
|
|
994
997
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
995
998
|
"col-span-2": unref(u).length == 1,
|
|
@@ -997,7 +1000,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
997
1000
|
"hover:bg-fm-color-opacity-sm": e.modelValue != n.value
|
|
998
1001
|
}]),
|
|
999
1002
|
onClick: () => {
|
|
1000
|
-
a.modelValue != n.value &&
|
|
1003
|
+
a.modelValue != n.value && i("update:model-value", n.value);
|
|
1001
1004
|
},
|
|
1002
1005
|
key: n.value
|
|
1003
1006
|
}, {
|
|
@@ -1025,16 +1028,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1025
1028
|
}
|
|
1026
1029
|
},
|
|
1027
1030
|
emits: ["update:model-value"],
|
|
1028
|
-
setup(e, { emit:
|
|
1029
|
-
const a =
|
|
1030
|
-
return (
|
|
1031
|
-
const
|
|
1031
|
+
setup(e, { emit: m }) {
|
|
1032
|
+
const a = m;
|
|
1033
|
+
return (i, u) => {
|
|
1034
|
+
const d = resolveComponent("FmStepperField");
|
|
1032
1035
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1033
1036
|
u[1] || (u[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
1034
|
-
createVNode(
|
|
1037
|
+
createVNode(d, {
|
|
1035
1038
|
label: "Maximum to collect",
|
|
1036
1039
|
"model-value": e.modelValue || null,
|
|
1037
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1040
|
+
"onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
|
|
1038
1041
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1039
1042
|
"helper-state": e.helperState || "none"
|
|
1040
1043
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1050,29 +1053,29 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1050
1053
|
}
|
|
1051
1054
|
},
|
|
1052
1055
|
emits: ["update:model-value"],
|
|
1053
|
-
setup(e, { expose:
|
|
1054
|
-
const
|
|
1055
|
-
var
|
|
1056
|
-
return ((
|
|
1056
|
+
setup(e, { expose: m, emit: a }) {
|
|
1057
|
+
const i = e, u = useMembershipStore(), { minor: d } = useLoading, l = ref(!1), o = ref(), n = ref(), s = ref(0), y = computed(() => {
|
|
1058
|
+
var f;
|
|
1059
|
+
return ((f = u.loyaltyRewards.items.find(
|
|
1057
1060
|
(b) => {
|
|
1058
|
-
var
|
|
1059
|
-
return b.value === ((
|
|
1061
|
+
var C;
|
|
1062
|
+
return b.value === ((C = o.value) == null ? void 0 : C.collectible);
|
|
1060
1063
|
}
|
|
1061
|
-
)) == null ? void 0 :
|
|
1062
|
-
}),
|
|
1063
|
-
const
|
|
1064
|
-
return
|
|
1064
|
+
)) == null ? void 0 : f.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1065
|
+
}), v = computed(() => {
|
|
1066
|
+
const p = y.value.safeParse(o.value);
|
|
1067
|
+
return p.success ? [] : p.error.errors;
|
|
1065
1068
|
});
|
|
1066
|
-
function
|
|
1067
|
-
|
|
1069
|
+
function h(p, f, b) {
|
|
1070
|
+
p && (o.value = f, s.value = b), l.value = p;
|
|
1068
1071
|
}
|
|
1069
|
-
const
|
|
1070
|
-
async function
|
|
1071
|
-
const
|
|
1072
|
-
|
|
1072
|
+
const g = a;
|
|
1073
|
+
async function c() {
|
|
1074
|
+
const p = y.value.safeParse(o.value);
|
|
1075
|
+
p.success && (await d(
|
|
1073
1076
|
async () => {
|
|
1074
|
-
|
|
1075
|
-
|
|
1077
|
+
p.data.type === "VOUCHER" && n.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1078
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
1076
1079
|
n.value
|
|
1077
1080
|
));
|
|
1078
1081
|
},
|
|
@@ -1080,82 +1083,82 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1080
1083
|
message: "Uploading reward image",
|
|
1081
1084
|
successMessage: "Reward image updated"
|
|
1082
1085
|
}
|
|
1083
|
-
),
|
|
1086
|
+
), g("update:model-value", p.data, s.value));
|
|
1084
1087
|
}
|
|
1085
1088
|
const r = ref();
|
|
1086
|
-
return
|
|
1087
|
-
showSheet:
|
|
1088
|
-
}), (
|
|
1089
|
-
const b = resolveComponent("FmStepperField"),
|
|
1090
|
-
return openBlock(), createBlock(
|
|
1089
|
+
return m({
|
|
1090
|
+
showSheet: h
|
|
1091
|
+
}), (p, f) => {
|
|
1092
|
+
const b = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), x = resolveComponent("FmButton"), R = resolveComponent("FmSideSheet");
|
|
1093
|
+
return openBlock(), createBlock(R, {
|
|
1091
1094
|
"max-width": 560,
|
|
1092
|
-
modelValue: unref(
|
|
1095
|
+
modelValue: unref(l),
|
|
1093
1096
|
"onUpdate:modelValue": [
|
|
1094
|
-
|
|
1095
|
-
|
|
1097
|
+
f[10] || (f[10] = (k) => isRef(l) ? l.value = k : null),
|
|
1098
|
+
f[11] || (f[11] = (k) => l.value = k)
|
|
1096
1099
|
],
|
|
1097
1100
|
header: "Edit reward",
|
|
1098
1101
|
"dismiss-away": ""
|
|
1099
1102
|
}, {
|
|
1100
1103
|
"side-sheet-footer": withCtx(() => [
|
|
1101
1104
|
createElementVNode("div", _hoisted_1$6, [
|
|
1102
|
-
createVNode(
|
|
1105
|
+
createVNode(x, {
|
|
1103
1106
|
variant: "primary",
|
|
1104
1107
|
type: "button",
|
|
1105
1108
|
label: "Confirm",
|
|
1106
|
-
disabled: unref(
|
|
1107
|
-
onClick:
|
|
1108
|
-
var
|
|
1109
|
-
return (
|
|
1109
|
+
disabled: unref(v).length > 0,
|
|
1110
|
+
onClick: f[8] || (f[8] = async () => {
|
|
1111
|
+
var k;
|
|
1112
|
+
return (k = unref(r)) == null ? void 0 : k.validateInputs();
|
|
1110
1113
|
})
|
|
1111
1114
|
}, null, 8, ["disabled"]),
|
|
1112
|
-
createVNode(
|
|
1115
|
+
createVNode(x, {
|
|
1113
1116
|
variant: "secondary",
|
|
1114
1117
|
type: "button",
|
|
1115
1118
|
label: "Cancel",
|
|
1116
|
-
onClick:
|
|
1119
|
+
onClick: f[9] || (f[9] = (k) => l.value = !1)
|
|
1117
1120
|
})
|
|
1118
1121
|
])
|
|
1119
1122
|
]),
|
|
1120
1123
|
default: withCtx(() => [
|
|
1121
|
-
createVNode(JsonViewer, { json: unref(
|
|
1122
|
-
unref(
|
|
1124
|
+
createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
|
|
1125
|
+
unref(o) ? (openBlock(), createBlock(V, {
|
|
1123
1126
|
key: 0,
|
|
1124
1127
|
class: "flex flex-col gap-y-24",
|
|
1125
1128
|
ref_key: "formRef",
|
|
1126
1129
|
ref: r,
|
|
1127
|
-
onValidationSuccess:
|
|
1130
|
+
onValidationSuccess: f[7] || (f[7] = (k) => c())
|
|
1128
1131
|
}, {
|
|
1129
1132
|
default: withCtx(() => {
|
|
1130
|
-
var
|
|
1133
|
+
var k, B;
|
|
1131
1134
|
return [
|
|
1132
|
-
unref(
|
|
1135
|
+
unref(o).type ? (openBlock(), createBlock(b, {
|
|
1133
1136
|
key: 0,
|
|
1134
1137
|
label: "Threshold",
|
|
1135
1138
|
rules: [
|
|
1136
1139
|
unref(ZodHelper).toRule(
|
|
1137
1140
|
unref(z).number().min(1).max(
|
|
1138
|
-
|
|
1139
|
-
`Number cannot be more than ${
|
|
1141
|
+
i.maxThreshold,
|
|
1142
|
+
`Number cannot be more than ${i.maxThreshold}`
|
|
1140
1143
|
)
|
|
1141
1144
|
)
|
|
1142
1145
|
],
|
|
1143
|
-
"model-value": unref(
|
|
1144
|
-
"onUpdate:modelValue":
|
|
1145
|
-
...unref(
|
|
1146
|
+
"model-value": unref(o).threshold,
|
|
1147
|
+
"onUpdate:modelValue": f[0] || (f[0] = (E) => o.value = {
|
|
1148
|
+
...unref(o),
|
|
1146
1149
|
threshold: E
|
|
1147
1150
|
})
|
|
1148
1151
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1149
|
-
createVNode(
|
|
1152
|
+
createVNode(C, {
|
|
1150
1153
|
label: "Reward Type",
|
|
1151
1154
|
items: [
|
|
1152
1155
|
{ label: "Voucher", value: "VOUCHER" },
|
|
1153
1156
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1154
1157
|
],
|
|
1155
|
-
"model-value": unref(
|
|
1156
|
-
"onUpdate:modelValue":
|
|
1158
|
+
"model-value": unref(o).type,
|
|
1159
|
+
"onUpdate:modelValue": f[1] || (f[1] = (E) => {
|
|
1157
1160
|
var S, w;
|
|
1158
|
-
E === "VOUCHER" ?
|
|
1161
|
+
E === "VOUCHER" ? o.value = {
|
|
1159
1162
|
collectible: null,
|
|
1160
1163
|
type: "VOUCHER",
|
|
1161
1164
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1168,8 +1171,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1168
1171
|
validityOption: {
|
|
1169
1172
|
validForDay: 7
|
|
1170
1173
|
},
|
|
1171
|
-
threshold: (S = unref(
|
|
1172
|
-
} :
|
|
1174
|
+
threshold: (S = unref(o)) == null ? void 0 : S.threshold
|
|
1175
|
+
} : o.value = {
|
|
1173
1176
|
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
1174
1177
|
type: "LOYALTY",
|
|
1175
1178
|
earningOption: {
|
|
@@ -1179,60 +1182,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1179
1182
|
validityOption: {
|
|
1180
1183
|
validForDay: 7
|
|
1181
1184
|
},
|
|
1182
|
-
threshold: (w = unref(
|
|
1185
|
+
threshold: (w = unref(o)) == null ? void 0 : w.threshold
|
|
1183
1186
|
};
|
|
1184
1187
|
})
|
|
1185
1188
|
}, null, 8, ["model-value"]),
|
|
1186
|
-
unref(
|
|
1189
|
+
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(C, {
|
|
1187
1190
|
key: 1,
|
|
1188
1191
|
label: "Loyalty type",
|
|
1189
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1192
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
|
|
1190
1193
|
items: unref(u).loyaltyRewards.items,
|
|
1191
|
-
"model-value": unref(
|
|
1192
|
-
"onUpdate:modelValue":
|
|
1194
|
+
"model-value": unref(o).collectible,
|
|
1195
|
+
"onUpdate:modelValue": f[2] || (f[2] = (E) => unref(o).collectible = E)
|
|
1193
1196
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1194
|
-
unref(
|
|
1195
|
-
|
|
1197
|
+
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1198
|
+
f[12] || (f[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1196
1199
|
createVNode(_sfc_main$l, {
|
|
1197
1200
|
class: "mt-[-8px]",
|
|
1198
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1199
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1200
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1201
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
|
|
1202
|
+
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1203
|
+
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
1201
1204
|
"fixed-type": !0,
|
|
1202
|
-
"model-value": unref(
|
|
1203
|
-
"onUpdate:modelValue":
|
|
1204
|
-
...unref(
|
|
1205
|
+
"model-value": unref(o).earningOption,
|
|
1206
|
+
"onUpdate:modelValue": f[3] || (f[3] = (E) => o.value = {
|
|
1207
|
+
...unref(o),
|
|
1205
1208
|
earningOption: E
|
|
1206
1209
|
})
|
|
1207
1210
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1208
1211
|
createVNode(_sfc_main$m, {
|
|
1209
1212
|
class: "!gap-24",
|
|
1210
|
-
type: unref(
|
|
1211
|
-
"for-credit": unref(
|
|
1213
|
+
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
1214
|
+
"for-credit": unref(o).type === "LOYALTY" && ((k = unref(u).loyaltyRewards.items.find(
|
|
1212
1215
|
(E) => {
|
|
1213
1216
|
var S;
|
|
1214
|
-
return E.value === ((S = unref(
|
|
1217
|
+
return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
|
|
1215
1218
|
}
|
|
1216
|
-
)) == null ? void 0 :
|
|
1217
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1218
|
-
"model-value": unref(
|
|
1219
|
-
"onUpdate:modelValue":
|
|
1220
|
-
...unref(
|
|
1219
|
+
)) == null ? void 0 : k.raw.type) === "CREDIT",
|
|
1220
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
|
|
1221
|
+
"model-value": unref(o).validityOption,
|
|
1222
|
+
"onUpdate:modelValue": f[4] || (f[4] = (E) => o.value = {
|
|
1223
|
+
...unref(o),
|
|
1221
1224
|
validityOption: E
|
|
1222
1225
|
})
|
|
1223
1226
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1224
1227
|
], 64)) : createCommentVNode("", !0),
|
|
1225
|
-
unref(
|
|
1228
|
+
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
1226
1229
|
key: 3,
|
|
1227
1230
|
"reward-image": unref(n),
|
|
1228
|
-
"model-value": ((
|
|
1229
|
-
"onUpdate:modelValue":
|
|
1230
|
-
...unref(
|
|
1231
|
+
"model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
|
|
1232
|
+
"onUpdate:modelValue": f[5] || (f[5] = (E) => o.value = {
|
|
1233
|
+
...unref(o),
|
|
1231
1234
|
collectibleConfig: E
|
|
1232
1235
|
}),
|
|
1233
|
-
"onUpdate:rewardImage":
|
|
1236
|
+
"onUpdate:rewardImage": f[6] || (f[6] = (E) => n.value = E)
|
|
1234
1237
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1235
|
-
createVNode(JsonViewer, { json: unref(
|
|
1238
|
+
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
1236
1239
|
];
|
|
1237
1240
|
}),
|
|
1238
1241
|
_: 1
|
|
@@ -1266,19 +1269,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1266
1269
|
}
|
|
1267
1270
|
},
|
|
1268
1271
|
setup(e) {
|
|
1269
|
-
const
|
|
1270
|
-
() => Math.min(
|
|
1271
|
-
),
|
|
1272
|
-
return (
|
|
1273
|
-
const
|
|
1272
|
+
const m = e, { maxRange: a, currentRange: i, markers: u } = toRefs(m), d = computed(
|
|
1273
|
+
() => Math.min(i.value / a.value * 100, 100)
|
|
1274
|
+
), l = (o) => o / a.value * 100;
|
|
1275
|
+
return (o, n) => {
|
|
1276
|
+
const s = resolveComponent("FmIcon");
|
|
1274
1277
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1275
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (
|
|
1278
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(s, {
|
|
1276
1279
|
class: normalizeClass(
|
|
1277
|
-
unref(
|
|
1280
|
+
unref(i) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1278
1281
|
),
|
|
1279
|
-
outline: unref(
|
|
1280
|
-
key:
|
|
1281
|
-
name: unref(u).some((
|
|
1282
|
+
outline: unref(i) < y,
|
|
1283
|
+
key: y,
|
|
1284
|
+
name: unref(u).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1282
1285
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1283
1286
|
])) : (openBlock(), createElementBlock("div", {
|
|
1284
1287
|
key: 1,
|
|
@@ -1286,12 +1289,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1286
1289
|
}, [
|
|
1287
1290
|
createElementVNode("div", {
|
|
1288
1291
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1289
|
-
style: normalizeStyle({ width: unref(
|
|
1292
|
+
style: normalizeStyle({ width: unref(d) + "%" })
|
|
1290
1293
|
}, null, 4),
|
|
1291
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (
|
|
1292
|
-
key:
|
|
1294
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y, v) => (openBlock(), createElementBlock("div", {
|
|
1295
|
+
key: v,
|
|
1293
1296
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1294
|
-
style: normalizeStyle({ left:
|
|
1297
|
+
style: normalizeStyle({ left: l(y) + "%" })
|
|
1295
1298
|
}, [
|
|
1296
1299
|
createElementVNode("div", _hoisted_2$4, [
|
|
1297
1300
|
createElementVNode("div", {
|
|
@@ -1305,16 +1308,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1305
1308
|
}
|
|
1306
1309
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1307
1310
|
function changeKeysFactory(e) {
|
|
1308
|
-
return function
|
|
1309
|
-
if (
|
|
1311
|
+
return function m(a, i = 1, u) {
|
|
1312
|
+
if (i === 0 || !isObject(a))
|
|
1310
1313
|
return a;
|
|
1311
1314
|
if (Array.isArray(a))
|
|
1312
|
-
return a.map((
|
|
1313
|
-
const
|
|
1314
|
-
return Object.keys(a).forEach((
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
}),
|
|
1315
|
+
return a.map((l) => m(l, i - 1, u));
|
|
1316
|
+
const d = Object.create(Object.getPrototypeOf(a));
|
|
1317
|
+
return Object.keys(a).forEach((l) => {
|
|
1318
|
+
const o = a[l], n = e(l, u), s = m(o, i - 1, u);
|
|
1319
|
+
d[n] = s;
|
|
1320
|
+
}), d;
|
|
1318
1321
|
};
|
|
1319
1322
|
}
|
|
1320
1323
|
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = { class: "flex items-center gap-4" }, _hoisted_5$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$2 = { class: "flex items-center gap-16" }, _hoisted_7$1 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
@@ -1330,37 +1333,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1330
1333
|
}
|
|
1331
1334
|
},
|
|
1332
1335
|
emits: ["update:model-value"],
|
|
1333
|
-
setup(e, { emit:
|
|
1334
|
-
const a = e,
|
|
1335
|
-
() => a.modelValue.sort((r,
|
|
1336
|
-
),
|
|
1337
|
-
const r =
|
|
1336
|
+
setup(e, { emit: m }) {
|
|
1337
|
+
const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1338
|
+
() => a.modelValue.sort((r, p) => r.threshold - p.threshold) ?? []
|
|
1339
|
+
), o = computed(() => {
|
|
1340
|
+
const r = d.safeParse(l.value);
|
|
1338
1341
|
return r.success ? [] : r.error.errors;
|
|
1339
1342
|
}), n = ref();
|
|
1340
|
-
function
|
|
1343
|
+
function s(r, p) {
|
|
1341
1344
|
var b;
|
|
1342
|
-
const
|
|
1343
|
-
p
|
|
1345
|
+
const f = [...l.value];
|
|
1346
|
+
f[p] = r, (b = n.value) == null || b.showSheet(!1), i("update:model-value", f);
|
|
1344
1347
|
}
|
|
1345
|
-
function
|
|
1346
|
-
const
|
|
1348
|
+
function y(r) {
|
|
1349
|
+
const p = r.type == "VOUCHER" ? r.collectibleConfig : u.collectibles.find(
|
|
1347
1350
|
(b) => b._id.toString() == r.collectible
|
|
1348
|
-
),
|
|
1351
|
+
), f = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
|
|
1349
1352
|
return {
|
|
1350
|
-
label: isNullOrEmpty(
|
|
1353
|
+
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1351
1354
|
sublabel: `Reward at ${r.threshold} | Amount: ${r.earningOption.type == "FIXED" ? r.earningOption.amount : `${r.earningOption.amount} for every RM${r.earningOption.every} spent`} `
|
|
1352
1355
|
};
|
|
1353
1356
|
}
|
|
1354
|
-
function y(r) {
|
|
1355
|
-
var p;
|
|
1356
|
-
const c = [...o.value];
|
|
1357
|
-
(p = n.value) == null || p.showSheet(!0, c[r], r);
|
|
1358
|
-
}
|
|
1359
1357
|
function v(r) {
|
|
1360
|
-
|
|
1361
|
-
|
|
1358
|
+
var f;
|
|
1359
|
+
const p = [...l.value];
|
|
1360
|
+
(f = n.value) == null || f.showSheet(!0, p[r], r);
|
|
1361
|
+
}
|
|
1362
|
+
function h(r) {
|
|
1363
|
+
const p = [...l.value];
|
|
1364
|
+
p.splice(r, 1), i("update:model-value", p);
|
|
1362
1365
|
}
|
|
1363
|
-
function
|
|
1366
|
+
function g() {
|
|
1364
1367
|
var r;
|
|
1365
1368
|
(r = n.value) == null || r.showSheet(
|
|
1366
1369
|
!0,
|
|
@@ -1376,64 +1379,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1376
1379
|
amount: 1
|
|
1377
1380
|
}
|
|
1378
1381
|
},
|
|
1379
|
-
|
|
1382
|
+
l.value.length
|
|
1380
1383
|
);
|
|
1381
1384
|
}
|
|
1382
|
-
function
|
|
1383
|
-
var
|
|
1384
|
-
return r.type == "VOUCHER" ? (
|
|
1385
|
-
((
|
|
1385
|
+
function c(r) {
|
|
1386
|
+
var p, f;
|
|
1387
|
+
return r.type == "VOUCHER" ? (p = r.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
|
|
1388
|
+
((f = u.loyaltyRewards.items.find(
|
|
1386
1389
|
(b) => b.value == r.collectible
|
|
1387
|
-
)) == null ? void 0 :
|
|
1390
|
+
)) == null ? void 0 : f.label) || ""
|
|
1388
1391
|
);
|
|
1389
1392
|
}
|
|
1390
|
-
return (r,
|
|
1391
|
-
const
|
|
1393
|
+
return (r, p) => {
|
|
1394
|
+
const f = resolveComponent("FmButton"), b = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
1392
1395
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1393
|
-
|
|
1394
|
-
createVNode(
|
|
1396
|
+
p[2] || (p[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
|
|
1397
|
+
createVNode(f, {
|
|
1395
1398
|
label: "Add Reward",
|
|
1396
|
-
onClick:
|
|
1399
|
+
onClick: p[0] || (p[0] = (V) => g()),
|
|
1397
1400
|
variant: "plain",
|
|
1398
1401
|
icon: "add"
|
|
1399
1402
|
}),
|
|
1400
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1401
|
-
key:
|
|
1403
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, x) => (openBlock(), createBlock(b, {
|
|
1404
|
+
key: x,
|
|
1402
1405
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1403
1406
|
variant: "outlined",
|
|
1404
|
-
onClick: (
|
|
1407
|
+
onClick: (R) => v(x)
|
|
1405
1408
|
}, {
|
|
1406
1409
|
default: withCtx(() => [
|
|
1407
1410
|
createElementVNode("div", null, [
|
|
1408
|
-
createElementVNode("div", _hoisted_2$3, toDisplayString(
|
|
1409
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(
|
|
1411
|
+
createElementVNode("div", _hoisted_2$3, toDisplayString(y(V).label), 1),
|
|
1412
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(y(V).sublabel), 1)
|
|
1410
1413
|
]),
|
|
1411
|
-
createVNode(
|
|
1414
|
+
createVNode(f, {
|
|
1412
1415
|
icon: "delete",
|
|
1413
1416
|
variant: "tertiary",
|
|
1414
|
-
onClick: (
|
|
1417
|
+
onClick: (R) => (R.stopPropagation(), h(x))
|
|
1415
1418
|
}, null, 8, ["onClick"])
|
|
1416
1419
|
]),
|
|
1417
1420
|
_: 2
|
|
1418
1421
|
}, 1032, ["onClick"]))), 128)),
|
|
1419
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1420
|
-
key:
|
|
1421
|
-
text:
|
|
1422
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(C, {
|
|
1423
|
+
key: V.message,
|
|
1424
|
+
text: V.message,
|
|
1422
1425
|
state: "error"
|
|
1423
1426
|
}, null, 8, ["text"]))), 128)),
|
|
1424
|
-
|
|
1427
|
+
p[3] || (p[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
|
|
1425
1428
|
(openBlock(), createBlock(b, {
|
|
1426
1429
|
key: 0,
|
|
1427
1430
|
variant: "outlined",
|
|
1428
1431
|
class: "p-24 space-y-16 w-fit"
|
|
1429
1432
|
}, {
|
|
1430
1433
|
default: withCtx(() => {
|
|
1431
|
-
var
|
|
1434
|
+
var V, x;
|
|
1432
1435
|
return [
|
|
1433
1436
|
createElementVNode("div", _hoisted_4$2, [
|
|
1434
1437
|
createElementVNode("div", null, [
|
|
1435
|
-
createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((
|
|
1436
|
-
|
|
1438
|
+
createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((V = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : V.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? c(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
1439
|
+
p[1] || (p[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
|
|
1437
1440
|
])
|
|
1438
1441
|
]),
|
|
1439
1442
|
createElementVNode("div", _hoisted_6$2, [
|
|
@@ -1441,7 +1444,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1441
1444
|
type: e.mission.type,
|
|
1442
1445
|
"max-range": e.mission.end,
|
|
1443
1446
|
currentRange: e.mission.end / 4,
|
|
1444
|
-
markers: e.modelValue.map((
|
|
1447
|
+
markers: e.modelValue.map((R) => R.threshold)
|
|
1445
1448
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
1446
1449
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
1447
1450
|
])
|
|
@@ -1452,7 +1455,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1452
1455
|
createVNode(_sfc_main$6, {
|
|
1453
1456
|
ref_key: "sheetRef",
|
|
1454
1457
|
ref: n,
|
|
1455
|
-
"onUpdate:modelValue":
|
|
1458
|
+
"onUpdate:modelValue": s,
|
|
1456
1459
|
"max-threshold": e.mission.end
|
|
1457
1460
|
}, null, 8, ["max-threshold"])
|
|
1458
1461
|
]);
|
|
@@ -1464,10 +1467,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1464
1467
|
modelValue: Object
|
|
1465
1468
|
},
|
|
1466
1469
|
emits: ["update:model-value"],
|
|
1467
|
-
setup(e, { emit:
|
|
1468
|
-
const a = e,
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1470
|
+
setup(e, { emit: m }) {
|
|
1471
|
+
const a = e, i = computed(() => {
|
|
1472
|
+
const l = FdoMission.safeParse(a.modelValue);
|
|
1473
|
+
return l.success ? [] : l.error.errors;
|
|
1471
1474
|
}), u = computed(() => [
|
|
1472
1475
|
{
|
|
1473
1476
|
label: "Stamp",
|
|
@@ -1479,37 +1482,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1479
1482
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
1480
1483
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1481
1484
|
}
|
|
1482
|
-
]),
|
|
1483
|
-
return (
|
|
1484
|
-
var
|
|
1485
|
-
const n = resolveComponent("FmCard"),
|
|
1485
|
+
]), d = m;
|
|
1486
|
+
return (l, o) => {
|
|
1487
|
+
var y;
|
|
1488
|
+
const n = resolveComponent("FmCard"), s = resolveComponent("FmStepperField");
|
|
1486
1489
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1487
1490
|
createElementVNode("div", _hoisted_2$2, [
|
|
1488
|
-
|
|
1489
|
-
|
|
1491
|
+
o[1] || (o[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
|
|
1492
|
+
o[2] || (o[2] = 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)),
|
|
1490
1493
|
createElementVNode("div", _hoisted_3$2, [
|
|
1491
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (
|
|
1492
|
-
var
|
|
1494
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (v) => {
|
|
1495
|
+
var h, g;
|
|
1493
1496
|
return openBlock(), createBlock(n, {
|
|
1494
1497
|
variant: "outlined",
|
|
1495
1498
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1496
1499
|
"col-span-2": unref(u).length == 1,
|
|
1497
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
1498
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1500
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.type) == v.value,
|
|
1501
|
+
"hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.type) != v.value
|
|
1499
1502
|
}]),
|
|
1500
1503
|
onClick: () => {
|
|
1501
|
-
var
|
|
1502
|
-
((
|
|
1504
|
+
var c, r;
|
|
1505
|
+
((c = e.modelValue) == null ? void 0 : c.type) != v.value && d("update:model-value", {
|
|
1503
1506
|
...e.modelValue,
|
|
1504
|
-
type:
|
|
1507
|
+
type: v.value,
|
|
1505
1508
|
end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
|
|
1506
1509
|
});
|
|
1507
1510
|
},
|
|
1508
|
-
key:
|
|
1511
|
+
key: v.value
|
|
1509
1512
|
}, {
|
|
1510
1513
|
default: withCtx(() => [
|
|
1511
|
-
createElementVNode("div", _hoisted_4$1, toDisplayString(
|
|
1512
|
-
createElementVNode("div", _hoisted_5$1, toDisplayString(
|
|
1514
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(v.label), 1),
|
|
1515
|
+
createElementVNode("div", _hoisted_5$1, toDisplayString(v.description), 1)
|
|
1513
1516
|
]),
|
|
1514
1517
|
_: 2
|
|
1515
1518
|
}, 1032, ["class", "onClick"]);
|
|
@@ -1517,21 +1520,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1517
1520
|
])
|
|
1518
1521
|
]),
|
|
1519
1522
|
createElementVNode("div", _hoisted_6$1, [
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
createVNode(
|
|
1523
|
+
o[3] || (o[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
|
|
1524
|
+
o[4] || (o[4] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
1525
|
+
createVNode(s, {
|
|
1523
1526
|
label: "Maximum to collect",
|
|
1524
|
-
"model-value": ((
|
|
1525
|
-
"onUpdate:modelValue":
|
|
1526
|
-
var
|
|
1527
|
-
return
|
|
1527
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
|
|
1528
|
+
"onUpdate:modelValue": o[0] || (o[0] = (v) => {
|
|
1529
|
+
var h;
|
|
1530
|
+
return d("update:model-value", {
|
|
1528
1531
|
...e.modelValue,
|
|
1529
|
-
type: ((
|
|
1530
|
-
end:
|
|
1532
|
+
type: ((h = e.modelValue) == null ? void 0 : h.type) || "STAMP",
|
|
1533
|
+
end: v
|
|
1531
1534
|
});
|
|
1532
1535
|
}),
|
|
1533
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
1534
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1536
|
+
"helper-text": unref(ZodHelper).helperText(unref(i), "end") || "Set the threshold required for reward eligibility",
|
|
1537
|
+
"helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
|
|
1535
1538
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1536
1539
|
])
|
|
1537
1540
|
]);
|
|
@@ -1559,113 +1562,113 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1559
1562
|
}
|
|
1560
1563
|
},
|
|
1561
1564
|
emits: ["update:model-value", "update:file"],
|
|
1562
|
-
setup(e, { emit:
|
|
1563
|
-
const { t: a } = useI18n(),
|
|
1564
|
-
function
|
|
1565
|
-
switch (
|
|
1565
|
+
setup(e, { emit: m }) {
|
|
1566
|
+
const { t: a } = useI18n(), i = e, u = m;
|
|
1567
|
+
function d(s) {
|
|
1568
|
+
switch (i.field.type) {
|
|
1566
1569
|
case "timeframe":
|
|
1567
|
-
const
|
|
1570
|
+
const y = s.startDate ? hooks(s.startDate).startOf("day").toISOString() : void 0, v = s.endDate ? hooks(s.endDate).endOf("day").toISOString() : void 0;
|
|
1568
1571
|
u("update:model-value", {
|
|
1569
1572
|
type: "timeframe",
|
|
1570
1573
|
property: "__now",
|
|
1571
|
-
start:
|
|
1572
|
-
end:
|
|
1574
|
+
start: y,
|
|
1575
|
+
end: v
|
|
1573
1576
|
});
|
|
1574
1577
|
break;
|
|
1575
1578
|
case "image": {
|
|
1576
1579
|
u(
|
|
1577
1580
|
"update:file",
|
|
1578
|
-
|
|
1579
|
-
|
|
1581
|
+
s,
|
|
1582
|
+
l.value || firebaseStorage.collectibleImagePath(void 0, s)
|
|
1580
1583
|
);
|
|
1581
1584
|
break;
|
|
1582
1585
|
}
|
|
1583
1586
|
default:
|
|
1584
|
-
u("update:model-value",
|
|
1587
|
+
u("update:model-value", s);
|
|
1585
1588
|
break;
|
|
1586
1589
|
}
|
|
1587
1590
|
}
|
|
1588
|
-
const
|
|
1589
|
-
switch (
|
|
1591
|
+
const l = computed(() => {
|
|
1592
|
+
switch (i.field.type) {
|
|
1590
1593
|
case "timeframe": {
|
|
1591
|
-
const
|
|
1594
|
+
const s = i.modelValue;
|
|
1592
1595
|
return {
|
|
1593
|
-
startDate:
|
|
1594
|
-
endDate:
|
|
1596
|
+
startDate: s != null && s.start ? hooks(s == null ? void 0 : s.start).format("YYYY-MM-DD") : null,
|
|
1597
|
+
endDate: s != null && s.end ? hooks(s == null ? void 0 : s.end).format("YYYY-MM-DD") : null
|
|
1595
1598
|
};
|
|
1596
1599
|
}
|
|
1597
1600
|
default:
|
|
1598
|
-
return
|
|
1601
|
+
return i.modelValue;
|
|
1599
1602
|
}
|
|
1600
1603
|
});
|
|
1601
|
-
function
|
|
1604
|
+
function o() {
|
|
1602
1605
|
if (!n.value.schema) return [];
|
|
1603
|
-
const
|
|
1604
|
-
return
|
|
1606
|
+
const s = n.value.schema.safeParse(i.modelValue);
|
|
1607
|
+
return s.success ? [] : s.error.errors;
|
|
1605
1608
|
}
|
|
1606
1609
|
const n = computed(() => ({
|
|
1607
|
-
schema:
|
|
1608
|
-
unwrapped:
|
|
1609
|
-
rules:
|
|
1610
|
-
labelMark:
|
|
1611
|
-
zodLabel:
|
|
1610
|
+
schema: i.schema,
|
|
1611
|
+
unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
|
|
1612
|
+
rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
|
|
1613
|
+
labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
|
|
1614
|
+
zodLabel: i.schema ? ZodHelper.toInputLabel(i.schema, i.field.label) : void 0
|
|
1612
1615
|
}));
|
|
1613
|
-
return (
|
|
1614
|
-
var
|
|
1615
|
-
const
|
|
1616
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
1616
|
+
return (s, y) => {
|
|
1617
|
+
var p, f, b, C, V;
|
|
1618
|
+
const v = resolveComponent("FmTextField"), h = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
|
|
1619
|
+
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
1617
1620
|
key: 0,
|
|
1618
1621
|
label: unref(a)(e.field.label),
|
|
1619
1622
|
"label-mark": unref(n).labelMark,
|
|
1620
1623
|
rules: unref(n).rules,
|
|
1621
|
-
"model-value": unref(
|
|
1622
|
-
"onUpdate:modelValue":
|
|
1624
|
+
"model-value": unref(l),
|
|
1625
|
+
"onUpdate:modelValue": d,
|
|
1623
1626
|
"helper-state": e.helperText ? "error" : void 0,
|
|
1624
1627
|
"helper-text": e.helperText
|
|
1625
1628
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1626
1629
|
createVNode(JsonViewer, {
|
|
1627
|
-
json: { schema: unref(n).unwrapped, props:
|
|
1630
|
+
json: { schema: unref(n).unwrapped, props: i }
|
|
1628
1631
|
}, null, 8, ["json"]),
|
|
1629
|
-
createVNode(
|
|
1632
|
+
createVNode(h, {
|
|
1630
1633
|
label: unref(a)(e.field.label),
|
|
1631
1634
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
|
|
1632
|
-
"model-value": unref(
|
|
1635
|
+
"model-value": unref(l),
|
|
1633
1636
|
rules: e.field.isRuleChildren ? [] : unref(n).rules,
|
|
1634
|
-
"onUpdate:modelValue":
|
|
1637
|
+
"onUpdate:modelValue": d,
|
|
1635
1638
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
1636
1639
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
1637
1640
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
1638
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
1641
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
|
|
1639
1642
|
key: 2,
|
|
1640
1643
|
label: unref(a)(e.field.label),
|
|
1641
1644
|
"label-mark": unref(n).labelMark,
|
|
1642
1645
|
rules: unref(n).rules,
|
|
1643
|
-
"model-value": unref(
|
|
1644
|
-
"onUpdate:modelValue":
|
|
1646
|
+
"model-value": unref(l),
|
|
1647
|
+
"onUpdate:modelValue": d,
|
|
1645
1648
|
"show-word-count": "",
|
|
1646
|
-
"max-length": (
|
|
1649
|
+
"max-length": (V = (C = (b = (f = (p = unref(n)) == null ? void 0 : p.unwrapped) == null ? void 0 : f._def) == null ? void 0 : b.checks) == null ? void 0 : C.find((x) => x.kind == "max")) == null ? void 0 : V.value
|
|
1647
1650
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
|
|
1648
1651
|
key: 3,
|
|
1649
1652
|
"campaign-type": e.extras,
|
|
1650
|
-
"model-value": unref(
|
|
1653
|
+
"model-value": unref(l),
|
|
1651
1654
|
disabled: e.disabled,
|
|
1652
|
-
"onUpdate:modelValue":
|
|
1655
|
+
"onUpdate:modelValue": d
|
|
1653
1656
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
1654
1657
|
createVNode(_sfc_main$e, {
|
|
1655
|
-
"model-value": unref(
|
|
1656
|
-
"onUpdate:modelValue":
|
|
1658
|
+
"model-value": unref(l),
|
|
1659
|
+
"onUpdate:modelValue": d
|
|
1657
1660
|
}, null, 8, ["model-value"]),
|
|
1658
|
-
createVNode(
|
|
1661
|
+
createVNode(c, {
|
|
1659
1662
|
class: "!mt-[8px]",
|
|
1660
|
-
text: unref(ZodHelper).helperText(
|
|
1661
|
-
state: unref(ZodHelper).helperState(
|
|
1663
|
+
text: unref(ZodHelper).helperText(o(), ""),
|
|
1664
|
+
state: unref(ZodHelper).helperState(o(), "")
|
|
1662
1665
|
}, null, 8, ["text", "state"])
|
|
1663
1666
|
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
|
|
1664
1667
|
key: 5,
|
|
1665
|
-
thumbnail: unref(
|
|
1668
|
+
thumbnail: unref(l),
|
|
1666
1669
|
"aspect-ratio": "16 / 9",
|
|
1667
1670
|
class: "w-1/2 xs:w-2/3",
|
|
1668
|
-
"onUpdate:file":
|
|
1671
|
+
"onUpdate:file": d
|
|
1669
1672
|
}, {
|
|
1670
1673
|
label: withCtx(() => [
|
|
1671
1674
|
(openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
|
|
@@ -1678,26 +1681,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1678
1681
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
1679
1682
|
"label-mark": unref(n).labelMark,
|
|
1680
1683
|
rules: unref(n).rules,
|
|
1681
|
-
"model-value": unref(
|
|
1682
|
-
"onUpdate:modelValue":
|
|
1684
|
+
"model-value": unref(l),
|
|
1685
|
+
"onUpdate:modelValue": d
|
|
1683
1686
|
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
|
|
1684
1687
|
key: 7,
|
|
1685
|
-
"model-value": unref(
|
|
1686
|
-
"onUpdate:modelValue":
|
|
1688
|
+
"model-value": unref(l),
|
|
1689
|
+
"onUpdate:modelValue": d,
|
|
1687
1690
|
"no-campaign": !1,
|
|
1688
1691
|
schema: unref(n).schema,
|
|
1689
1692
|
"is-mission": e.extras === "MISSION"
|
|
1690
1693
|
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
1691
1694
|
key: 8,
|
|
1692
|
-
"model-value": unref(
|
|
1693
|
-
"onUpdate:modelValue":
|
|
1695
|
+
"model-value": unref(l),
|
|
1696
|
+
"onUpdate:modelValue": d
|
|
1694
1697
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
1695
1698
|
createVNode(_sfc_main$r, {
|
|
1696
|
-
"model-value": unref(
|
|
1697
|
-
"onUpdate:modelValue":
|
|
1699
|
+
"model-value": unref(l),
|
|
1700
|
+
"onUpdate:modelValue": d,
|
|
1698
1701
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
1699
1702
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
1700
|
-
unref(
|
|
1703
|
+
unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
|
|
1701
1704
|
key: 0,
|
|
1702
1705
|
class: "!mt-[8px]",
|
|
1703
1706
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
@@ -1707,58 +1710,58 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1707
1710
|
key: 10,
|
|
1708
1711
|
"allow-email": !0,
|
|
1709
1712
|
"allow-whatsapp": !0,
|
|
1710
|
-
"model-value": unref(
|
|
1711
|
-
"onUpdate:modelValue":
|
|
1712
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1713
|
+
"model-value": unref(l),
|
|
1714
|
+
"onUpdate:modelValue": d,
|
|
1715
|
+
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
1713
1716
|
"trigger-type": e.field.extras,
|
|
1714
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1717
|
+
"helper-state": unref(ZodHelper).helperState(o(), "")
|
|
1715
1718
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
1716
1719
|
key: 11,
|
|
1717
|
-
"model-value": unref(
|
|
1718
|
-
"onUpdate:modelValue":
|
|
1720
|
+
"model-value": unref(l),
|
|
1721
|
+
"onUpdate:modelValue": d,
|
|
1719
1722
|
extras: e.extras,
|
|
1720
1723
|
"error-text": e.helperText
|
|
1721
1724
|
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
|
|
1722
1725
|
key: 12,
|
|
1723
1726
|
type: "custom",
|
|
1724
|
-
"model-value": unref(
|
|
1725
|
-
"onUpdate:modelValue":
|
|
1726
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
1727
|
+
"model-value": unref(l),
|
|
1728
|
+
"onUpdate:modelValue": d,
|
|
1729
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
|
|
1727
1730
|
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1728
1731
|
key: 13,
|
|
1729
|
-
"model-value": unref(
|
|
1730
|
-
"onUpdate:modelValue":
|
|
1732
|
+
"model-value": unref(l),
|
|
1733
|
+
"onUpdate:modelValue": d
|
|
1731
1734
|
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
1732
1735
|
key: 14,
|
|
1733
|
-
"model-value": unref(
|
|
1734
|
-
"onUpdate:modelValue":
|
|
1736
|
+
"model-value": unref(l),
|
|
1737
|
+
"onUpdate:modelValue": d
|
|
1735
1738
|
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
1736
1739
|
key: 15,
|
|
1737
|
-
"model-value": unref(
|
|
1738
|
-
"onUpdate:modelValue":
|
|
1740
|
+
"model-value": unref(l),
|
|
1741
|
+
"onUpdate:modelValue": d
|
|
1739
1742
|
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
1740
1743
|
key: 16,
|
|
1741
|
-
"model-value": unref(
|
|
1742
|
-
"onUpdate:modelValue":
|
|
1744
|
+
"model-value": unref(l),
|
|
1745
|
+
"onUpdate:modelValue": d
|
|
1743
1746
|
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
1744
1747
|
key: 17,
|
|
1745
|
-
"model-value": unref(
|
|
1746
|
-
"onUpdate:modelValue":
|
|
1747
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
1748
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
1748
|
+
"model-value": unref(l),
|
|
1749
|
+
"onUpdate:modelValue": d,
|
|
1750
|
+
"helper-text": unref(ZodHelper).helperText(o(), ""),
|
|
1751
|
+
"helper-state": unref(ZodHelper).helperState(o(), "")
|
|
1749
1752
|
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
1750
1753
|
key: 18,
|
|
1751
|
-
"model-value": unref(
|
|
1752
|
-
"onUpdate:modelValue":
|
|
1754
|
+
"model-value": unref(l),
|
|
1755
|
+
"onUpdate:modelValue": d,
|
|
1753
1756
|
mission: e.extras.mission
|
|
1754
1757
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
1755
1758
|
createVNode(_sfc_main$d, {
|
|
1756
|
-
"model-value": unref(
|
|
1757
|
-
"onUpdate:modelValue":
|
|
1759
|
+
"model-value": unref(l),
|
|
1760
|
+
"onUpdate:modelValue": d,
|
|
1758
1761
|
"start-date": e.extras.start,
|
|
1759
1762
|
"end-date": e.extras.end
|
|
1760
1763
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
1761
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1764
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1762
1765
|
key: 0,
|
|
1763
1766
|
class: "!mt-[8px]",
|
|
1764
1767
|
text: e.helperText,
|
|
@@ -1766,26 +1769,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1766
1769
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1767
1770
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
1768
1771
|
createVNode(_sfc_main$t, {
|
|
1769
|
-
"model-value": unref(
|
|
1770
|
-
"onUpdate:modelValue":
|
|
1772
|
+
"model-value": unref(l),
|
|
1773
|
+
"onUpdate:modelValue": d
|
|
1771
1774
|
}, null, 8, ["model-value"]),
|
|
1772
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1775
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1773
1776
|
key: 0,
|
|
1774
1777
|
class: "!mt-[8px]",
|
|
1775
1778
|
text: e.helperText,
|
|
1776
1779
|
state: "error"
|
|
1777
1780
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1778
1781
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
1779
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(
|
|
1782
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
|
|
1780
1783
|
key: 0,
|
|
1781
1784
|
state: "warning",
|
|
1782
1785
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
1783
1786
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1784
1787
|
createVNode(_sfc_main$i, {
|
|
1785
|
-
"model-value": unref(
|
|
1786
|
-
"onUpdate:modelValue":
|
|
1788
|
+
"model-value": unref(l),
|
|
1789
|
+
"onUpdate:modelValue": d
|
|
1787
1790
|
}, null, 8, ["model-value"]),
|
|
1788
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1791
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1789
1792
|
key: 1,
|
|
1790
1793
|
class: "!mt-[8px]",
|
|
1791
1794
|
text: e.helperText,
|
|
@@ -1793,10 +1796,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1793
1796
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1794
1797
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
1795
1798
|
createVNode(_sfc_main$u, {
|
|
1796
|
-
"model-value": unref(
|
|
1797
|
-
"onUpdate:modelValue":
|
|
1799
|
+
"model-value": unref(l),
|
|
1800
|
+
"onUpdate:modelValue": d
|
|
1798
1801
|
}, null, 8, ["model-value"]),
|
|
1799
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1802
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1800
1803
|
key: 0,
|
|
1801
1804
|
class: "!mt-[8px]",
|
|
1802
1805
|
text: e.helperText,
|
|
@@ -1804,10 +1807,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1804
1807
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1805
1808
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
1806
1809
|
createVNode(_sfc_main$v, {
|
|
1807
|
-
"model-value": unref(
|
|
1808
|
-
"onUpdate:modelValue":
|
|
1810
|
+
"model-value": unref(l),
|
|
1811
|
+
"onUpdate:modelValue": d
|
|
1809
1812
|
}, null, 8, ["model-value"]),
|
|
1810
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1813
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1811
1814
|
key: 0,
|
|
1812
1815
|
class: "!mt-[8px]",
|
|
1813
1816
|
text: e.helperText,
|
|
@@ -1815,10 +1818,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1815
1818
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1816
1819
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
1817
1820
|
createVNode(_sfc_main$h, {
|
|
1818
|
-
"model-value": unref(
|
|
1819
|
-
"onUpdate:modelValue":
|
|
1821
|
+
"model-value": unref(l),
|
|
1822
|
+
"onUpdate:modelValue": d
|
|
1820
1823
|
}, null, 8, ["model-value"]),
|
|
1821
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1824
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1822
1825
|
key: 0,
|
|
1823
1826
|
class: "!mt-[8px]",
|
|
1824
1827
|
text: e.helperText,
|
|
@@ -1826,16 +1829,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1826
1829
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1827
1830
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
1828
1831
|
createVNode(_sfc_main$9, {
|
|
1829
|
-
"model-value": unref(
|
|
1830
|
-
"onUpdate:modelValue":
|
|
1832
|
+
"model-value": unref(l),
|
|
1833
|
+
"onUpdate:modelValue": d
|
|
1831
1834
|
}, null, 8, ["model-value"]),
|
|
1832
|
-
e.helperText ? (openBlock(), createBlock(
|
|
1835
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
1833
1836
|
key: 0,
|
|
1834
1837
|
class: "!mt-[8px]",
|
|
1835
1838
|
text: e.helperText,
|
|
1836
1839
|
state: "error"
|
|
1837
1840
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1838
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
1841
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
|
|
1839
1842
|
};
|
|
1840
1843
|
}
|
|
1841
1844
|
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -1847,23 +1850,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1847
1850
|
}
|
|
1848
1851
|
},
|
|
1849
1852
|
setup(e) {
|
|
1850
|
-
const { t:
|
|
1851
|
-
return (
|
|
1852
|
-
const
|
|
1853
|
-
return openBlock(), createBlock(
|
|
1853
|
+
const { t: m, te: a } = useI18n();
|
|
1854
|
+
return (i, u) => {
|
|
1855
|
+
const d = resolveComponent("FmCard");
|
|
1856
|
+
return openBlock(), createBlock(d, {
|
|
1854
1857
|
variant: "outlined",
|
|
1855
1858
|
class: "p-16 space-y-8"
|
|
1856
1859
|
}, {
|
|
1857
1860
|
default: withCtx(() => [
|
|
1858
|
-
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(
|
|
1861
|
+
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
|
|
1859
1862
|
u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
1860
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
1863
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
|
|
1861
1864
|
class: "space-y-4",
|
|
1862
|
-
key:
|
|
1865
|
+
key: o
|
|
1863
1866
|
}, [
|
|
1864
|
-
|
|
1865
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(
|
|
1866
|
-
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${
|
|
1867
|
+
l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1868
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${o}`)), 1),
|
|
1869
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${l}`) ? unref(m)(`${l}`) : l), 1)
|
|
1867
1870
|
], 64)) : createCommentVNode("", !0)
|
|
1868
1871
|
]))), 128))
|
|
1869
1872
|
]),
|
|
@@ -1882,7 +1885,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1882
1885
|
TEMPLATES.VOUCHER
|
|
1883
1886
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
1884
1887
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
1885
|
-
var e,
|
|
1888
|
+
var e, m;
|
|
1886
1889
|
if (sheetVisible.value = visible, visible == !0) {
|
|
1887
1890
|
try {
|
|
1888
1891
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
@@ -1890,16 +1893,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1890
1893
|
} finally {
|
|
1891
1894
|
await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
|
|
1892
1895
|
}
|
|
1893
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a,
|
|
1896
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, i) => {
|
|
1894
1897
|
a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
|
|
1895
1898
|
(u) => u.code === a.campaign.code && u._id.toString() !== a.campaign._id.toString()
|
|
1896
|
-
) &&
|
|
1899
|
+
) && i.addIssue({
|
|
1897
1900
|
code: "custom",
|
|
1898
1901
|
message: "Code already exists, please use another code",
|
|
1899
1902
|
path: ["campaign", "code"]
|
|
1900
1903
|
});
|
|
1901
1904
|
})), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
1902
|
-
...(
|
|
1905
|
+
...(m = template.value) == null ? void 0 : m.defaultValue
|
|
1903
1906
|
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
|
|
1904
1907
|
}
|
|
1905
1908
|
}
|
|
@@ -1926,11 +1929,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1926
1929
|
return e.success ? [] : e.error.errors;
|
|
1927
1930
|
});
|
|
1928
1931
|
function stepErrors(e = currentStep.value - 1) {
|
|
1929
|
-
const
|
|
1930
|
-
(a) => a.fields.map((
|
|
1932
|
+
const m = template.value.steps[e].groups.flatMap(
|
|
1933
|
+
(a) => a.fields.map((i) => i.property)
|
|
1931
1934
|
);
|
|
1932
1935
|
return errors.value.filter(
|
|
1933
|
-
(a) =>
|
|
1936
|
+
(a) => m.some((i) => a.path.join(".").includes(i))
|
|
1934
1937
|
);
|
|
1935
1938
|
}
|
|
1936
1939
|
__expose({ showSheet });
|
|
@@ -1943,17 +1946,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1943
1946
|
}
|
|
1944
1947
|
});
|
|
1945
1948
|
}
|
|
1946
|
-
function onUpdateProperty(e,
|
|
1947
|
-
var a,
|
|
1948
|
-
if (_.set(data.value, e,
|
|
1949
|
-
const
|
|
1950
|
-
...(
|
|
1949
|
+
function onUpdateProperty(e, m) {
|
|
1950
|
+
var a, i, u, d, l, o, n, s;
|
|
1951
|
+
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
1952
|
+
const v = ((d = (u = (i = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : i.campaign) == null ? void 0 : u.event) == null ? void 0 : d.rule) ? _.cloneDeep({
|
|
1953
|
+
...(s = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : s.rule
|
|
1951
1954
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
1952
1955
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1953
1956
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
1954
1957
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
1955
1958
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
1956
|
-
]),
|
|
1959
|
+
]), h = RuleBuilder.setRuleToGroup(
|
|
1957
1960
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1958
1961
|
[
|
|
1959
1962
|
RuleBuilder.constructEntry(
|
|
@@ -1965,29 +1968,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1965
1968
|
],
|
|
1966
1969
|
"&&"
|
|
1967
1970
|
);
|
|
1968
|
-
if (
|
|
1969
|
-
_.set(data.value, "campaign.event.rule",
|
|
1971
|
+
if (m != "SCHEDULE") {
|
|
1972
|
+
_.set(data.value, "campaign.event.rule", v);
|
|
1970
1973
|
return;
|
|
1971
1974
|
}
|
|
1972
1975
|
_.set(
|
|
1973
1976
|
data.value,
|
|
1974
1977
|
"campaign.event.rule",
|
|
1975
|
-
RuleBuilder.setRuleToGroup(
|
|
1978
|
+
RuleBuilder.setRuleToGroup(v, h)
|
|
1976
1979
|
);
|
|
1977
1980
|
}
|
|
1978
|
-
e == "campaign.notify" &&
|
|
1981
|
+
e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
1979
1982
|
}
|
|
1980
|
-
async function onUpdateFile(e,
|
|
1981
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
1983
|
+
async function onUpdateFile(e, m) {
|
|
1984
|
+
return e ? await minor(async () => firebaseStorage.update(m, e), {
|
|
1982
1985
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
1983
1986
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
1984
1987
|
}) : "";
|
|
1985
1988
|
}
|
|
1986
1989
|
function isDisable(e) {
|
|
1987
|
-
var
|
|
1990
|
+
var m, a;
|
|
1988
1991
|
switch (e == null ? void 0 : e.property) {
|
|
1989
1992
|
case "campaign.event.type":
|
|
1990
|
-
return ((a = (
|
|
1993
|
+
return ((a = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : a._id) || !1;
|
|
1991
1994
|
default:
|
|
1992
1995
|
return !1;
|
|
1993
1996
|
}
|
|
@@ -1996,14 +1999,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1996
1999
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
1997
2000
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
1998
2001
|
}
|
|
1999
|
-
return (e,
|
|
2000
|
-
const a = resolveComponent("FmButton"),
|
|
2001
|
-
return openBlock(), createBlock(
|
|
2002
|
+
return (e, m) => {
|
|
2003
|
+
const a = resolveComponent("FmButton"), i = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), d = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2004
|
+
return openBlock(), createBlock(l, {
|
|
2002
2005
|
"fullscreen-size": "lg",
|
|
2003
2006
|
modelValue: unref(sheetVisible),
|
|
2004
2007
|
"onUpdate:modelValue": [
|
|
2005
|
-
|
|
2006
|
-
|
|
2008
|
+
m[7] || (m[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
|
|
2009
|
+
m[8] || (m[8] = (o) => sheetVisible.value = o)
|
|
2007
2010
|
]
|
|
2008
2011
|
}, createSlots({
|
|
2009
2012
|
"top-sheet-header": withCtx(() => [
|
|
@@ -2011,7 +2014,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2011
2014
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2012
2015
|
createElementVNode("div", _hoisted_2, [
|
|
2013
2016
|
createVNode(a, {
|
|
2014
|
-
onClick:
|
|
2017
|
+
onClick: m[0] || (m[0] = (o) => hideSheet()),
|
|
2015
2018
|
label: unref(t)("connect.campaign.common.cancel"),
|
|
2016
2019
|
variant: "tertiary"
|
|
2017
2020
|
}, null, 8, ["label"]),
|
|
@@ -2031,7 +2034,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2031
2034
|
createElementVNode("div", _hoisted_9, [
|
|
2032
2035
|
createElementVNode("div", _hoisted_10, [
|
|
2033
2036
|
createElementVNode("div", _hoisted_11, [
|
|
2034
|
-
|
|
2037
|
+
m[9] || (m[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
2035
2038
|
createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
2036
2039
|
createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2037
2040
|
createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
@@ -2053,7 +2056,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2053
2056
|
])
|
|
2054
2057
|
])
|
|
2055
2058
|
], -1)),
|
|
2056
|
-
createVNode(
|
|
2059
|
+
createVNode(d, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2057
2060
|
])
|
|
2058
2061
|
])
|
|
2059
2062
|
])
|
|
@@ -2065,14 +2068,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2065
2068
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2066
2069
|
createVNode(u, {
|
|
2067
2070
|
modelValue: unref(currentStep),
|
|
2068
|
-
"onUpdate:modelValue":
|
|
2071
|
+
"onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
2069
2072
|
orientation: "horizontal",
|
|
2070
2073
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2071
2074
|
}, {
|
|
2072
2075
|
default: withCtx(() => [
|
|
2073
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2074
|
-
key:
|
|
2075
|
-
title: unref(t)(
|
|
2076
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
|
|
2077
|
+
key: o.name,
|
|
2078
|
+
title: unref(t)(o.name),
|
|
2076
2079
|
value: n + 1,
|
|
2077
2080
|
error: () => stepErrors(n).length > 0,
|
|
2078
2081
|
complete: () => n + 1 <= unref(currentStep)
|
|
@@ -2084,19 +2087,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2084
2087
|
createVNode(a, {
|
|
2085
2088
|
icon: "close",
|
|
2086
2089
|
variant: "tertiary",
|
|
2087
|
-
onClick:
|
|
2090
|
+
onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
|
|
2088
2091
|
}),
|
|
2089
2092
|
createVNode(u, {
|
|
2090
2093
|
modelValue: unref(currentStep),
|
|
2091
|
-
"onUpdate:modelValue":
|
|
2094
|
+
"onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
2092
2095
|
orientation: "horizontal",
|
|
2093
2096
|
class: "flex-1"
|
|
2094
2097
|
}, {
|
|
2095
2098
|
default: withCtx(() => [
|
|
2096
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (
|
|
2097
|
-
key:
|
|
2099
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
|
|
2100
|
+
key: o.name,
|
|
2098
2101
|
title: unref(sheetTitle),
|
|
2099
|
-
description: unref(t)(
|
|
2102
|
+
description: unref(t)(o.name),
|
|
2100
2103
|
value: n + 1,
|
|
2101
2104
|
error: () => stepErrors(n).length > 0,
|
|
2102
2105
|
complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
@@ -2107,7 +2110,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2107
2110
|
createVNode(a, {
|
|
2108
2111
|
icon: "info",
|
|
2109
2112
|
variant: "tertiary",
|
|
2110
|
-
onClick:
|
|
2113
|
+
onClick: m[4] || (m[4] = () => showSummaryDialog())
|
|
2111
2114
|
})
|
|
2112
2115
|
]),
|
|
2113
2116
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -2116,40 +2119,40 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2116
2119
|
json: {
|
|
2117
2120
|
data: unref(data),
|
|
2118
2121
|
errors: unref(errors).map(
|
|
2119
|
-
(
|
|
2122
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
2120
2123
|
),
|
|
2121
2124
|
stepErrors: stepErrors().map(
|
|
2122
|
-
(
|
|
2125
|
+
(o) => `${o.path.join(".")} - ${o.message}`
|
|
2123
2126
|
),
|
|
2124
2127
|
schema: unref(schema)
|
|
2125
2128
|
}
|
|
2126
2129
|
}, null, 8, ["json"]),
|
|
2127
2130
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2128
|
-
(
|
|
2129
|
-
), (
|
|
2131
|
+
(o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
|
|
2132
|
+
), (o, n) => (openBlock(), createElementBlock("div", {
|
|
2130
2133
|
key: n,
|
|
2131
2134
|
class: "space-y-24"
|
|
2132
2135
|
}, [
|
|
2133
|
-
createElementVNode("div", _hoisted_7, toDisplayString(
|
|
2134
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(
|
|
2136
|
+
createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
|
|
2137
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (s, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
2135
2138
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2136
|
-
key:
|
|
2137
|
-
field:
|
|
2138
|
-
modelValue: unref(_).get(unref(data),
|
|
2139
|
-
disabled: isDisable(
|
|
2140
|
-
"onUpdate:modelValue": (
|
|
2141
|
-
"onUpdate:file": async (
|
|
2142
|
-
const
|
|
2143
|
-
onUpdateProperty(
|
|
2139
|
+
key: y,
|
|
2140
|
+
field: s,
|
|
2141
|
+
modelValue: unref(_).get(unref(data), s.property),
|
|
2142
|
+
disabled: isDisable(s),
|
|
2143
|
+
"onUpdate:modelValue": (v) => onUpdateProperty(s.property, v),
|
|
2144
|
+
"onUpdate:file": async (v, h) => {
|
|
2145
|
+
const g = await onUpdateFile(v, h);
|
|
2146
|
+
onUpdateProperty(s.property, g || "");
|
|
2144
2147
|
},
|
|
2145
2148
|
schema: unref(ZodHelper).typeAtPath(
|
|
2146
2149
|
unref(schema),
|
|
2147
|
-
|
|
2150
|
+
s.property,
|
|
2148
2151
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2149
2152
|
),
|
|
2150
|
-
"helper-state": unref(ZodHelper).helperState(unref(errors),
|
|
2151
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2152
|
-
extras:
|
|
2153
|
+
"helper-state": unref(ZodHelper).helperState(unref(errors), s.property),
|
|
2154
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), s.property),
|
|
2155
|
+
extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
|
|
2153
2156
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
2154
2157
|
]))), 128))
|
|
2155
2158
|
]))), 128)),
|
|
@@ -2158,12 +2161,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2158
2161
|
label: "Back",
|
|
2159
2162
|
variant: "tertiary",
|
|
2160
2163
|
disabled: unref(currentStep) == 1,
|
|
2161
|
-
onClick:
|
|
2164
|
+
onClick: m[5] || (m[5] = (o) => currentStep.value--)
|
|
2162
2165
|
}, null, 8, ["disabled"]),
|
|
2163
2166
|
createVNode(a, {
|
|
2164
2167
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2165
2168
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2166
|
-
onClick:
|
|
2169
|
+
onClick: m[6] || (m[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2167
2170
|
}, null, 8, ["disabled", "label"])
|
|
2168
2171
|
])
|
|
2169
2172
|
]),
|