@feedmepos/mf-connect 0.0.12-beta.5 → 0.0.13-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Analytic-DMbCeTaO.js +612 -0
- package/dist/{Broadcast-BFHQPSXL.js → Broadcast-bVaOzrys.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B1DYJDOy.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cd2midth.js} +8 -8
- package/dist/{Card-rOJ8yJg_.js → Card-CdCTfDuP.js} +127 -127
- package/dist/{Collections-BT8ihCOa.js → Collections-CQIHkJ4W.js} +129 -141
- package/dist/{Credit-D83Jsn7v.js → Credit-DuIm1c4_.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang--L-LP0DV.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DljWmOEP.js} +258 -242
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-HLzZirO_.js → EffectSheet.vue_vue_type_style_index_0_lang-BuJL01zR.js} +6 -6
- package/dist/{Experience-C6uBhQod.js → Experience-DEnMLbsA.js} +7 -7
- package/dist/{Game-5P5HWqAL.js → Game-BYS0nrH6.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DTDcpMpW.js → ImageInput.vue_vue_type_script_setup_true_lang-DW2tVaY0.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CQIJ54m1.js → MainLayout-BkFJubzZ.js} +53 -20
- package/dist/{Marketing-ONuItJ_B.js → Marketing-Da0HTlaz.js} +25 -25
- package/dist/{Member-SB2IySXY.js → Member-CVe_bRGx.js} +2 -2
- package/dist/MemberList-DpUy4gFd.js +1718 -0
- package/dist/{MemberTransactions-DPQ6M7eR.js → MemberTransactions-DWdTDUIJ.js} +2 -2
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-1KjmvWsp.js +203 -0
- package/dist/{Mission-rdnU6erJ.js → Mission-0eSMWCls.js} +7 -7
- package/dist/{Point-C2M66ORj.js → Point-ju1eHI9Z.js} +7 -7
- package/dist/{Promotion-DixbjmMJ.js → Promotion-DZjWvnQa.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CJsIBnGp.js → RuleGroup.vue_vue_type_script_setup_true_lang-CDPvpj10.js} +14 -14
- package/dist/{Segment-j_zQSV7O.js → Segment-Da_kMLWC.js} +18 -19
- package/dist/{Setting-ClhkF-bT.js → Setting-CxX35f3G.js} +541 -571
- package/dist/Store-DjUI3S8V.js +1442 -0
- package/dist/{StoreRewards-Bh90Ml4z.js → StoreRewards-92k0Bvp_.js} +74 -75
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DlbNMiw9.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Bsrz-oMi.js} +79 -82
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DNkJ-pFL.js +124 -0
- package/dist/{Tier-vxsDt3Kj.js → Tier-2J4GN90t.js} +68 -71
- package/dist/{Title-IFyz9vfW.js → Title-B3Dw3w_5.js} +75 -78
- package/dist/{Transaction-ETa-y_H9.js → Transaction-Dz6WT5Hb.js} +1 -1
- package/dist/{Voucher-BMYcuaPn.js → Voucher-Bf3oSOKc.js} +37 -37
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +140 -0
- package/dist/{app-Bl9KwQq5.js → app-BSmDH0M7.js} +46 -46
- package/dist/{app-BqWTxQI-.js → app-C7I-jK_l.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/{campaign-DI8CmTo2.js → campaign-CmvlWUoI.js} +11 -13
- package/dist/{collection.fn-CTEuol1r.js → collection.fn-DHlfGYAC.js} +2 -4
- package/dist/{dto-Bdlgo-8k.js → dto-rs6D-mtj.js} +239 -239
- package/dist/{effect-BdgYZfgW.js → effect-D8eQcTDU.js} +1 -1
- package/dist/{export-Dr_7YvBE.js → export-Bf2h8rMP.js} +3 -3
- package/dist/{helper-BygQ4tND.js → helper-BSlBLPdy.js} +1 -1
- package/dist/{index-CstgquVp.js → index-B64Y4rdW.js} +2 -2
- package/dist/{index-Djv3w5gV.js → index-BVSAl8E2.js} +37 -46
- package/dist/{index-DzQwND7p.js → index-CdMMIVsr.js} +217 -232
- package/dist/index-CuW8ePVX.js +244 -0
- package/dist/{index-DPYzF8No.js → index-D0nFU6ln.js} +1 -1
- package/dist/{index-Cv0dYoWA.js → index-fFL3EyTx.js} +68 -105
- package/dist/{index-Dhl0c4JQ.js → index-jqxAE4Rp.js} +1 -1
- package/dist/{index-BPdhkx4l.js → index-sIR31szI.js} +1 -1
- package/dist/{index-BtG8YOzi.js → index-wIa5WSXJ.js} +27 -28
- package/dist/{index-CpxxO2-G.js → index-x9e-DyDf.js} +1 -1
- package/dist/{loading-DlPkAkzK.js → loading-BxJj39Hj.js} +3156 -3156
- package/dist/{lodash-Cjf6EG_s.js → lodash-CrYvSLZb.js} +1 -1
- package/dist/{membership-B4-9J74r.js → membership-DKQL_Qp9.js} +73 -84
- package/dist/{money-il542E4J.js → money-B1P0wtzb.js} +1 -1
- package/dist/{number-WhKft9Yv.js → number-Bc1eguaq.js} +3 -3
- package/dist/{rule-XS2i1LKt.js → rule-BblG87FW.js} +2 -2
- package/dist/{rule-builder-CdK4IIT9.js → rule-builder-BQdKD4Gy.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-owB8rrou.js → template-o2RQUsfw.js} +6 -6
- package/dist/{usePagination-CxpwPyMW.js → usePagination-BaqNzQhm.js} +1 -1
- package/dist/{xlsx-CbJTFamj.js → xlsx-DqRMXFBK.js} +309 -309
- package/package.json +1 -1
- package/dist/Analytic-CCtweUZA.js +0 -757
- package/dist/MainLayout-CWfQ53Qr.js +0 -41
- package/dist/MemberList-C2X8fM7F.js +0 -1729
- package/dist/MessageInput.vue_vue_type_script_setup_true_lang-CE03Mh2P.js +0 -432
- package/dist/Store-CaWIsSZ3.js +0 -1506
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-DkpguWBa.js +0 -136
- package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-CWt4tVdk.js +0 -55
- package/dist/index-_8VUWoAN.js +0 -245
- package/dist/zod-W_PvIofQ.js +0 -90
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { a as useBusinessStore,
|
|
4
|
-
import { Z as ZodHelper } from "./
|
|
5
|
-
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-
|
|
7
|
-
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-
|
|
8
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, createSlots, resolveDynamicComponent, toRefs, normalizeStyle } from "vue";
|
|
2
|
+
import { _ } from "./lodash-CrYvSLZb.js";
|
|
3
|
+
import { a as useBusinessStore, d as core, J as JsonViewer, z, S as SvcConfig } from "./app-BSmDH0M7.js";
|
|
4
|
+
import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-rs6D-mtj.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-DKQL_Qp9.js";
|
|
7
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-CdMMIVsr.js";
|
|
8
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BQdKD4Gy.js";
|
|
9
9
|
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
10
|
-
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-
|
|
11
|
-
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
12
|
-
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
13
|
-
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
15
|
-
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-
|
|
16
|
-
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-
|
|
17
|
-
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
18
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
19
|
-
import "./index-
|
|
20
|
-
import "./index-
|
|
21
|
-
import "./index-
|
|
22
|
-
import "./index-
|
|
10
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-BVSAl8E2.js";
|
|
11
|
+
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-DW2tVaY0.js";
|
|
12
|
+
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-BuJL01zR.js";
|
|
13
|
+
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DNkJ-pFL.js";
|
|
14
|
+
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CDPvpj10.js";
|
|
15
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-BxJj39Hj.js";
|
|
16
|
+
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-fFL3EyTx.js";
|
|
17
|
+
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-1KjmvWsp.js";
|
|
18
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BblG87FW.js";
|
|
19
|
+
import "./index-B64Y4rdW.js";
|
|
20
|
+
import "./index-wIa5WSXJ.js";
|
|
21
|
+
import "./index-CuW8ePVX.js";
|
|
22
|
+
import "./index-sIR31szI.js";
|
|
23
23
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { C as CollectionUtils } from "./collection.fn-CTEuol1r.js";
|
|
24
|
+
import { i as initCollectibleConfig } from "./helper-BSlBLPdy.js";
|
|
25
|
+
import { C as CollectionUtils } from "./collection.fn-DHlfGYAC.js";
|
|
27
26
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
28
27
|
import { useDialog } from "@feedmepos/ui-library";
|
|
29
28
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
@@ -88,19 +87,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
88
87
|
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
89
88
|
(a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
90
89
|
).length > 0) {
|
|
91
|
-
const
|
|
90
|
+
const c = await prompt.confirm(
|
|
92
91
|
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
93
92
|
);
|
|
94
|
-
|
|
93
|
+
c && r(
|
|
95
94
|
"update:model-value",
|
|
96
95
|
RuleBuilder.setRuleToGroup(
|
|
97
96
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
98
97
|
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
99
98
|
)
|
|
100
|
-
), o.value =
|
|
99
|
+
), o.value = c ? l : t;
|
|
101
100
|
}
|
|
102
101
|
}), (l, t) => {
|
|
103
|
-
var
|
|
102
|
+
var c, v;
|
|
104
103
|
const a = resolveComponent("FmRadio");
|
|
105
104
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
106
105
|
createElementVNode("div", null, [
|
|
@@ -114,7 +113,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
114
113
|
]),
|
|
115
114
|
unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
116
115
|
createVNode(_sfc_main$p, {
|
|
117
|
-
modelValue: ((
|
|
116
|
+
modelValue: ((c = e.modelValue) == null ? void 0 : c.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
118
117
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
119
118
|
"update:model-value",
|
|
120
119
|
unref(RuleBuilder).setRuleToGroup(
|
|
@@ -159,16 +158,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
159
158
|
watch(o, async (l, t) => {
|
|
160
159
|
var a;
|
|
161
160
|
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
162
|
-
const
|
|
161
|
+
const c = await prompt.confirm(
|
|
163
162
|
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
164
163
|
);
|
|
165
|
-
|
|
164
|
+
c && r(
|
|
166
165
|
"update:model-value",
|
|
167
166
|
RuleBuilder.setRuleToGroup(
|
|
168
167
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
169
168
|
RuleBuilder.scaffoldGroup("g_time")
|
|
170
169
|
)
|
|
171
|
-
), o.value =
|
|
170
|
+
), o.value = c ? l : t;
|
|
172
171
|
}
|
|
173
172
|
});
|
|
174
173
|
async function s(l) {
|
|
@@ -191,9 +190,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
191
190
|
}
|
|
192
191
|
return (l, t) => {
|
|
193
192
|
var v;
|
|
194
|
-
const a = resolveComponent("FmRadio"),
|
|
193
|
+
const a = resolveComponent("FmRadio"), c = resolveComponent("FmRadioGroup");
|
|
195
194
|
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
196
|
-
createVNode(
|
|
195
|
+
createVNode(c, {
|
|
197
196
|
modelValue: unref(o),
|
|
198
197
|
"onUpdate:modelValue": [
|
|
199
198
|
t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
|
|
@@ -319,11 +318,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
319
318
|
label: "Days before birthday",
|
|
320
319
|
"show-steppers": !1,
|
|
321
320
|
"model-value": unref(o).equator.x,
|
|
322
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
321
|
+
"onUpdate:modelValue": l[2] || (l[2] = (c) => r(
|
|
323
322
|
"update:model-value",
|
|
324
323
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
325
324
|
op: "after",
|
|
326
|
-
x:
|
|
325
|
+
x: c,
|
|
327
326
|
ignoreYear: !0
|
|
328
327
|
})
|
|
329
328
|
))
|
|
@@ -545,7 +544,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
545
544
|
key: 0,
|
|
546
545
|
variant: "tertiary",
|
|
547
546
|
icon: "clear",
|
|
548
|
-
onClick: o[0] || (o[0] = (
|
|
547
|
+
onClick: o[0] || (o[0] = (c) => (c.stopPropagation(), n("update:model-value", null)))
|
|
549
548
|
})) : createCommentVNode("", !0)
|
|
550
549
|
]),
|
|
551
550
|
default: withCtx(() => [
|
|
@@ -648,7 +647,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
648
647
|
n.endDate ? new Date(n.endDate) : void 0
|
|
649
648
|
)
|
|
650
649
|
);
|
|
651
|
-
function
|
|
650
|
+
function c(m) {
|
|
652
651
|
const g = m.label.toLowerCase(), y = g == "fixed" ? [
|
|
653
652
|
RuleBuilder.constructEntry(
|
|
654
653
|
"trigger.date",
|
|
@@ -704,12 +703,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
704
703
|
);
|
|
705
704
|
}
|
|
706
705
|
return (m, g) => {
|
|
707
|
-
const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"),
|
|
706
|
+
const y = resolveComponent("FmButtonGroup"), i = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), p = resolveComponent("FmTooltip"), f = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
|
|
708
707
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
709
708
|
createVNode(y, {
|
|
710
709
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
711
710
|
"model-value": { label: unref(cases).title(unref(s)) },
|
|
712
|
-
"onUpdate:modelValue":
|
|
711
|
+
"onUpdate:modelValue": c,
|
|
713
712
|
class: "mb-8"
|
|
714
713
|
}, null, 8, ["model-value"]),
|
|
715
714
|
createElementVNode("div", _hoisted_1$g, [
|
|
@@ -724,7 +723,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
724
723
|
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
725
724
|
createElementVNode("div", _hoisted_4$b, [
|
|
726
725
|
_hoisted_5$7,
|
|
727
|
-
unref(t).date ? (openBlock(), createBlock(
|
|
726
|
+
unref(t).date ? (openBlock(), createBlock(p, {
|
|
728
727
|
key: 0,
|
|
729
728
|
"z-index": 9999,
|
|
730
729
|
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
@@ -803,7 +802,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
803
802
|
}
|
|
804
803
|
const s = d;
|
|
805
804
|
return (l, t) => {
|
|
806
|
-
const a = resolveComponent("FmField"),
|
|
805
|
+
const a = resolveComponent("FmField"), c = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
|
|
807
806
|
return openBlock(), createBlock(v, {
|
|
808
807
|
modelValue: r.value,
|
|
809
808
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
|
|
@@ -824,12 +823,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
824
823
|
]),
|
|
825
824
|
"side-sheet-footer": withCtx(() => [
|
|
826
825
|
createElementVNode("div", _hoisted_1$f, [
|
|
827
|
-
createVNode(
|
|
826
|
+
createVNode(c, {
|
|
828
827
|
variant: "tertiary",
|
|
829
828
|
onClick: t[0] || (t[0] = (m) => r.value = !1),
|
|
830
829
|
label: "Cancel"
|
|
831
830
|
}),
|
|
832
|
-
createVNode(
|
|
831
|
+
createVNode(c, {
|
|
833
832
|
variant: "primary",
|
|
834
833
|
onClick: o,
|
|
835
834
|
label: "Confirm"
|
|
@@ -853,13 +852,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
853
852
|
}, 8, ["modelValue"]);
|
|
854
853
|
};
|
|
855
854
|
}
|
|
856
|
-
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 =
|
|
855
|
+
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = {
|
|
856
|
+
key: 0,
|
|
857
|
+
class: "mr-32"
|
|
858
|
+
}, _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_8$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_9$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_10$3 = {
|
|
859
|
+
key: 0,
|
|
860
|
+
class: "xs:block flex gap-16 items-center pt-8"
|
|
861
|
+
}, _hoisted_11$1 = {
|
|
857
862
|
key: 0,
|
|
858
|
-
class: "
|
|
859
|
-
},
|
|
863
|
+
class: "mr-32"
|
|
864
|
+
}, _hoisted_12$1 = /* @__PURE__ */ createElementVNode("div", { class: "xs:hidden text-center" }, "for every", -1), _hoisted_13 = { class: "fm-typo-en-body-lg-400" }, _hoisted_14 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_15 = {
|
|
860
865
|
key: 0,
|
|
861
866
|
class: "pt-8 space-y-8"
|
|
862
|
-
},
|
|
867
|
+
}, _hoisted_16 = { class: "flex items-center gap-16 xs:block xs:space-y-8" }, _hoisted_17 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_18 = { class: "xs:block flex gap-16 items-center" }, _hoisted_19 = {
|
|
868
|
+
key: 0,
|
|
869
|
+
class: "mr-32"
|
|
870
|
+
}, _hoisted_20 = /* @__PURE__ */ createElementVNode("div", { class: "xs:hidden text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
863
871
|
__name: "EarningOptionInput",
|
|
864
872
|
props: {
|
|
865
873
|
modelValue: {
|
|
@@ -914,59 +922,54 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
914
922
|
}
|
|
915
923
|
);
|
|
916
924
|
}
|
|
917
|
-
const
|
|
925
|
+
const c = ref(
|
|
918
926
|
((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
|
|
919
927
|
);
|
|
920
928
|
return (y, i) => {
|
|
921
|
-
var E,
|
|
922
|
-
const u = resolveComponent("FmCard"),
|
|
929
|
+
var E, h, N;
|
|
930
|
+
const u = resolveComponent("FmCard"), p = resolveComponent("FmStepperField"), f = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
|
|
923
931
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
924
932
|
createElementVNode("div", _hoisted_2$d, [
|
|
925
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (
|
|
933
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (V) => {
|
|
926
934
|
var R, B;
|
|
927
935
|
return openBlock(), createBlock(u, {
|
|
928
936
|
variant: "outlined",
|
|
929
937
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
930
938
|
"col-span-2": unref(s).length == 1,
|
|
931
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) ===
|
|
932
|
-
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) !=
|
|
939
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === V.value,
|
|
940
|
+
"hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != V.value
|
|
933
941
|
}]),
|
|
934
|
-
onClick: ($) => a(
|
|
935
|
-
key:
|
|
942
|
+
onClick: ($) => a(V.value),
|
|
943
|
+
key: V.value
|
|
936
944
|
}, {
|
|
937
945
|
default: withCtx(() => [
|
|
938
|
-
createElementVNode("div", _hoisted_3$b, toDisplayString(
|
|
939
|
-
createElementVNode("div", _hoisted_4$a, toDisplayString(
|
|
946
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(V.label), 1),
|
|
947
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(V.sublabel), 1)
|
|
940
948
|
]),
|
|
941
949
|
_: 2
|
|
942
950
|
}, 1032, ["class", "onClick"]);
|
|
943
951
|
}), 128))
|
|
944
952
|
]),
|
|
945
953
|
createElementVNode("div", _hoisted_5$6, [
|
|
946
|
-
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(
|
|
954
|
+
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(p, {
|
|
947
955
|
key: 0,
|
|
948
|
-
label:
|
|
956
|
+
label: "Receive amount",
|
|
949
957
|
class: "flex-1",
|
|
950
|
-
"model-value": ((
|
|
951
|
-
"onUpdate:modelValue": i[0] || (i[0] = (
|
|
958
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
959
|
+
"onUpdate:modelValue": i[0] || (i[0] = (V) => o("update:model-value", {
|
|
952
960
|
...e.modelValue ?? { type: "FIXED" },
|
|
953
|
-
amount:
|
|
961
|
+
amount: V
|
|
954
962
|
}))
|
|
955
|
-
},
|
|
956
|
-
|
|
963
|
+
}, {
|
|
964
|
+
append: withCtx(() => [
|
|
965
|
+
e.extras ? (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString(unref(l)) + "(s)", 1)) : createCommentVNode("", !0)
|
|
966
|
+
]),
|
|
967
|
+
_: 1
|
|
968
|
+
}, 8, ["model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
969
|
+
_hoisted_7$3,
|
|
957
970
|
createVNode(b, {
|
|
958
|
-
|
|
959
|
-
"onUpdate:modelValue": i[6] || (i[6] = (
|
|
960
|
-
unref(p) != h && (o("update:model-value", {
|
|
961
|
-
...e.modelValue ?? {
|
|
962
|
-
type: "PROPORTIONAL",
|
|
963
|
-
amount: 1,
|
|
964
|
-
every: 1
|
|
965
|
-
},
|
|
966
|
-
property: h ? [] : void 0,
|
|
967
|
-
every: 1
|
|
968
|
-
}), p.value = h);
|
|
969
|
-
})
|
|
971
|
+
modelValue: unref(c),
|
|
972
|
+
"onUpdate:modelValue": i[6] || (i[6] = (V) => isRef(c) ? c.value = V : null)
|
|
970
973
|
}, {
|
|
971
974
|
default: withCtx(() => [
|
|
972
975
|
createVNode(f, {
|
|
@@ -975,37 +978,43 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
975
978
|
value: !1
|
|
976
979
|
}, {
|
|
977
980
|
label: withCtx(() => {
|
|
978
|
-
var
|
|
981
|
+
var V, R;
|
|
979
982
|
return [
|
|
980
|
-
|
|
981
|
-
createElementVNode("div",
|
|
982
|
-
unref(
|
|
983
|
-
createVNode(
|
|
984
|
-
label:
|
|
985
|
-
inputmode: "decimal",
|
|
983
|
+
_hoisted_8$3,
|
|
984
|
+
createElementVNode("div", _hoisted_9$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
|
|
985
|
+
unref(c) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_10$3, [
|
|
986
|
+
createVNode(p, {
|
|
987
|
+
label: "Receive amount",
|
|
986
988
|
class: "flex-1",
|
|
987
|
-
"model-value": ((
|
|
989
|
+
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
988
990
|
"onUpdate:modelValue": i[1] || (i[1] = (B) => o("update:model-value", {
|
|
989
991
|
...e.modelValue ?? { type: "FIXED" },
|
|
990
992
|
amount: B
|
|
991
993
|
}))
|
|
992
|
-
},
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
994
|
+
}, {
|
|
995
|
+
append: withCtx(() => [
|
|
996
|
+
e.extras ? (openBlock(), createElementBlock("div", _hoisted_11$1, toDisplayString(unref(l)) + "(s)", 1)) : createCommentVNode("", !0)
|
|
997
|
+
]),
|
|
998
|
+
_: 1
|
|
999
|
+
}, 8, ["model-value"]),
|
|
1000
|
+
_hoisted_12$1,
|
|
1001
|
+
createVNode(p, {
|
|
1002
|
+
label: unref(c) ? "Item purchased" : `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
996
1003
|
class: "flex-1",
|
|
997
|
-
inputmode: "decimal",
|
|
998
1004
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
999
1005
|
"onUpdate:modelValue": i[2] || (i[2] = (B) => o("update:model-value", {
|
|
1000
1006
|
...e.modelValue,
|
|
1001
1007
|
every: B
|
|
1002
1008
|
}))
|
|
1003
|
-
}, {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
+
}, createSlots({ _: 2 }, [
|
|
1010
|
+
unref(c) ? void 0 : {
|
|
1011
|
+
name: "prepend",
|
|
1012
|
+
fn: withCtx(() => [
|
|
1013
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1014
|
+
]),
|
|
1015
|
+
key: "0"
|
|
1016
|
+
}
|
|
1017
|
+
]), 1032, ["label", "model-value"])
|
|
1009
1018
|
]))
|
|
1010
1019
|
];
|
|
1011
1020
|
}),
|
|
@@ -1018,15 +1027,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1018
1027
|
disabled: !unref(n).isPremium
|
|
1019
1028
|
}, {
|
|
1020
1029
|
label: withCtx(() => {
|
|
1021
|
-
var
|
|
1030
|
+
var V, R;
|
|
1022
1031
|
return [
|
|
1023
|
-
createElementVNode("div",
|
|
1032
|
+
createElementVNode("div", _hoisted_13, [
|
|
1024
1033
|
createTextVNode(" Product bought "),
|
|
1025
1034
|
createVNode(k, { variant: "premium" })
|
|
1026
1035
|
]),
|
|
1027
|
-
createElementVNode("div",
|
|
1028
|
-
unref(
|
|
1029
|
-
createElementVNode("div",
|
|
1036
|
+
createElementVNode("div", _hoisted_14, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
|
|
1037
|
+
unref(c) ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
1038
|
+
createElementVNode("div", _hoisted_16, [
|
|
1030
1039
|
createVNode(_sfc_main$f, {
|
|
1031
1040
|
"model-value": r.modelValue.property || [],
|
|
1032
1041
|
onConfirm: i[3] || (i[3] = (B) => o("update:model-value", {
|
|
@@ -1034,42 +1043,50 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1034
1043
|
property: B
|
|
1035
1044
|
}))
|
|
1036
1045
|
}, {
|
|
1037
|
-
"side-sheet-button": withCtx(() =>
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}, null, 8, ["label"])
|
|
1045
|
-
];
|
|
1046
|
-
}),
|
|
1046
|
+
"side-sheet-button": withCtx(() => [
|
|
1047
|
+
createVNode(C, {
|
|
1048
|
+
label: "Select product",
|
|
1049
|
+
icon: "link",
|
|
1050
|
+
variant: "secondary"
|
|
1051
|
+
})
|
|
1052
|
+
]),
|
|
1047
1053
|
_: 1
|
|
1048
|
-
}, 8, ["model-value"])
|
|
1054
|
+
}, 8, ["model-value"]),
|
|
1055
|
+
createElementVNode("div", _hoisted_17, toDisplayString((r.modelValue.property ?? []).length) + " product(s) selected ", 1)
|
|
1049
1056
|
]),
|
|
1050
|
-
createElementVNode("div",
|
|
1051
|
-
createVNode(
|
|
1052
|
-
|
|
1053
|
-
label: `Receive ${unref(l)}(s)`,
|
|
1057
|
+
createElementVNode("div", _hoisted_18, [
|
|
1058
|
+
createVNode(p, {
|
|
1059
|
+
label: "Receive amount",
|
|
1054
1060
|
class: "flex-1",
|
|
1055
|
-
"model-value": ((
|
|
1061
|
+
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
1056
1062
|
"onUpdate:modelValue": i[4] || (i[4] = (B) => o("update:model-value", {
|
|
1057
1063
|
...e.modelValue ?? { type: "FIXED" },
|
|
1058
1064
|
amount: B
|
|
1059
1065
|
}))
|
|
1060
|
-
},
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1066
|
+
}, {
|
|
1067
|
+
append: withCtx(() => [
|
|
1068
|
+
e.extras ? (openBlock(), createElementBlock("div", _hoisted_19, toDisplayString(unref(l)) + "(s)", 1)) : createCommentVNode("", !0)
|
|
1069
|
+
]),
|
|
1070
|
+
_: 1
|
|
1071
|
+
}, 8, ["model-value"]),
|
|
1072
|
+
_hoisted_20,
|
|
1073
|
+
createVNode(p, {
|
|
1074
|
+
label: unref(c) ? "Item purchased" : `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
1064
1075
|
class: "flex-1",
|
|
1065
1076
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1066
|
-
inputmode: "numeric",
|
|
1067
|
-
"max-fraction-digits": 0,
|
|
1068
1077
|
"onUpdate:modelValue": i[5] || (i[5] = (B) => o("update:model-value", {
|
|
1069
1078
|
...e.modelValue,
|
|
1070
1079
|
every: B
|
|
1071
1080
|
}))
|
|
1072
|
-
},
|
|
1081
|
+
}, createSlots({ _: 2 }, [
|
|
1082
|
+
unref(c) ? void 0 : {
|
|
1083
|
+
name: "prepend",
|
|
1084
|
+
fn: withCtx(() => [
|
|
1085
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
1086
|
+
]),
|
|
1087
|
+
key: "0"
|
|
1088
|
+
}
|
|
1089
|
+
]), 1032, ["label", "model-value"])
|
|
1073
1090
|
])
|
|
1074
1091
|
])) : createCommentVNode("", !0)
|
|
1075
1092
|
];
|
|
@@ -1078,7 +1095,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1078
1095
|
}, 8, ["sublabel", "disabled"])
|
|
1079
1096
|
]),
|
|
1080
1097
|
_: 1
|
|
1081
|
-
}, 8, ["
|
|
1098
|
+
}, 8, ["modelValue"])
|
|
1082
1099
|
], 64)) : createCommentVNode("", !0)
|
|
1083
1100
|
]),
|
|
1084
1101
|
e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
|
|
@@ -1162,7 +1179,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1162
1179
|
), o = FdtoCollectibleConfig, s = d;
|
|
1163
1180
|
return (l, t) => {
|
|
1164
1181
|
var m, g, y;
|
|
1165
|
-
const a = resolveComponent("FmTextarea"),
|
|
1182
|
+
const a = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), v = resolveComponent("FmSwitch");
|
|
1166
1183
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1167
1184
|
createVNode(_sfc_main$u, {
|
|
1168
1185
|
modelValue: unref(r).name,
|
|
@@ -1214,7 +1231,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1214
1231
|
"model-value": unref(r).extras.effect,
|
|
1215
1232
|
"onUpdate:modelValue": t[3] || (t[3] = (i) => unref(r).extras.effect = i)
|
|
1216
1233
|
}, null, 8, ["model-value"]),
|
|
1217
|
-
unref(r).extras.effect == null ? (openBlock(), createBlock(
|
|
1234
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(c, {
|
|
1218
1235
|
key: 0,
|
|
1219
1236
|
class: "!mt-8",
|
|
1220
1237
|
text: "Effect is required",
|
|
@@ -1254,24 +1271,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1254
1271
|
__name: "EditRewardPoolSheet",
|
|
1255
1272
|
emits: ["update:model-value"],
|
|
1256
1273
|
setup(e, { expose: d, emit: n }) {
|
|
1257
|
-
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0),
|
|
1274
|
+
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), c = computed(() => {
|
|
1258
1275
|
var u;
|
|
1259
1276
|
return ((u = r.loyaltyRewards.items.find(
|
|
1260
|
-
(
|
|
1277
|
+
(p) => {
|
|
1261
1278
|
var f;
|
|
1262
|
-
return
|
|
1279
|
+
return p.value === ((f = l.value) == null ? void 0 : f.collectible);
|
|
1263
1280
|
}
|
|
1264
1281
|
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1265
1282
|
}), v = computed(() => {
|
|
1266
|
-
const i =
|
|
1283
|
+
const i = c.value.safeParse(l.value);
|
|
1267
1284
|
return i.success ? [] : i.error.errors;
|
|
1268
1285
|
});
|
|
1269
|
-
function m(i, u,
|
|
1270
|
-
i && (l.value = u, a.value =
|
|
1286
|
+
function m(i, u, p) {
|
|
1287
|
+
i && (l.value = u, a.value = p), s.value = i;
|
|
1271
1288
|
}
|
|
1272
1289
|
const g = n;
|
|
1273
1290
|
async function y() {
|
|
1274
|
-
const i =
|
|
1291
|
+
const i = c.value.safeParse(l.value);
|
|
1275
1292
|
i.success && (await o(
|
|
1276
1293
|
async () => {
|
|
1277
1294
|
i.data.type === "VOUCHER" && t.value && (i.data.collectibleConfig.image = await firebaseStorage.update(
|
|
@@ -1288,7 +1305,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1288
1305
|
return d({
|
|
1289
1306
|
showSheet: m
|
|
1290
1307
|
}), (i, u) => {
|
|
1291
|
-
const
|
|
1308
|
+
const p = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1292
1309
|
return openBlock(), createBlock(C, {
|
|
1293
1310
|
"max-width": 560,
|
|
1294
1311
|
modelValue: unref(s),
|
|
@@ -1320,7 +1337,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1320
1337
|
var b, x, E;
|
|
1321
1338
|
return [
|
|
1322
1339
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1323
|
-
createVNode(
|
|
1340
|
+
createVNode(p, {
|
|
1324
1341
|
label: "Reward Type",
|
|
1325
1342
|
items: [
|
|
1326
1343
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1328,12 +1345,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1328
1345
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1329
1346
|
],
|
|
1330
1347
|
"model-value": unref(l).type,
|
|
1331
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
|
1332
|
-
|
|
1348
|
+
"onUpdate:modelValue": u[0] || (u[0] = (h) => {
|
|
1349
|
+
h == "NO_REWARD" ? l.value = {
|
|
1333
1350
|
type: "NO_REWARD",
|
|
1334
1351
|
collectible: null,
|
|
1335
1352
|
weight: 1
|
|
1336
|
-
} :
|
|
1353
|
+
} : h === "VOUCHER" ? l.value = {
|
|
1337
1354
|
collectible: null,
|
|
1338
1355
|
type: "VOUCHER",
|
|
1339
1356
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1361,60 +1378,60 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1361
1378
|
};
|
|
1362
1379
|
})
|
|
1363
1380
|
}, null, 8, ["model-value"]),
|
|
1364
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1381
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
|
|
1365
1382
|
key: 0,
|
|
1366
1383
|
label: "Loyalty type",
|
|
1367
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1384
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
|
|
1368
1385
|
items: unref(r).loyaltyRewards.items,
|
|
1369
1386
|
"model-value": unref(l).collectible,
|
|
1370
|
-
"onUpdate:modelValue": u[1] || (u[1] = (
|
|
1387
|
+
"onUpdate:modelValue": u[1] || (u[1] = (h) => unref(l).collectible = h)
|
|
1371
1388
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1372
1389
|
createVNode(f, {
|
|
1373
1390
|
label: "Weight",
|
|
1374
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1391
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
|
|
1375
1392
|
"model-value": unref(l).weight,
|
|
1376
|
-
"onUpdate:modelValue": u[2] || (u[2] = (
|
|
1393
|
+
"onUpdate:modelValue": u[2] || (u[2] = (h) => l.value = {
|
|
1377
1394
|
...unref(l),
|
|
1378
|
-
weight:
|
|
1395
|
+
weight: h
|
|
1379
1396
|
})
|
|
1380
1397
|
}, null, 8, ["rules", "model-value"]),
|
|
1381
1398
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1382
1399
|
((b = unref(r).loyaltyRewards.items.find(
|
|
1383
|
-
(
|
|
1400
|
+
(h) => {
|
|
1384
1401
|
var N;
|
|
1385
|
-
return
|
|
1402
|
+
return h.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1386
1403
|
}
|
|
1387
1404
|
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1388
1405
|
_hoisted_2$a,
|
|
1389
1406
|
createVNode(_sfc_main$e, {
|
|
1390
1407
|
class: "mt-[-8px]",
|
|
1391
1408
|
rules: [
|
|
1392
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1409
|
+
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
|
|
1393
1410
|
],
|
|
1394
1411
|
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1395
1412
|
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
1396
1413
|
"fixed-type": !0,
|
|
1397
1414
|
"model-value": unref(l).earningOption,
|
|
1398
|
-
"onUpdate:modelValue": u[3] || (u[3] = (
|
|
1415
|
+
"onUpdate:modelValue": u[3] || (u[3] = (h) => l.value = {
|
|
1399
1416
|
...unref(l),
|
|
1400
|
-
earningOption:
|
|
1417
|
+
earningOption: h
|
|
1401
1418
|
})
|
|
1402
1419
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1403
1420
|
], 64)) : createCommentVNode("", !0),
|
|
1404
1421
|
_hoisted_3$8,
|
|
1405
1422
|
createVNode(_sfc_main$z, {
|
|
1406
1423
|
"for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
|
|
1407
|
-
(
|
|
1424
|
+
(h) => {
|
|
1408
1425
|
var N;
|
|
1409
|
-
return
|
|
1426
|
+
return h.value === ((N = unref(l)) == null ? void 0 : N.collectible);
|
|
1410
1427
|
}
|
|
1411
1428
|
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
1412
1429
|
class: "!gap-24",
|
|
1413
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1430
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
|
|
1414
1431
|
"model-value": unref(l).validityOption,
|
|
1415
|
-
"onUpdate:modelValue": u[4] || (u[4] = (
|
|
1432
|
+
"onUpdate:modelValue": u[4] || (u[4] = (h) => l.value = {
|
|
1416
1433
|
...unref(l),
|
|
1417
|
-
validityOption:
|
|
1434
|
+
validityOption: h
|
|
1418
1435
|
})
|
|
1419
1436
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1420
1437
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -1422,11 +1439,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1422
1439
|
key: 2,
|
|
1423
1440
|
"reward-image": unref(t),
|
|
1424
1441
|
"model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
|
|
1425
|
-
"onUpdate:modelValue": u[5] || (u[5] = (
|
|
1442
|
+
"onUpdate:modelValue": u[5] || (u[5] = (h) => l.value = {
|
|
1426
1443
|
...unref(l),
|
|
1427
|
-
collectibleConfig:
|
|
1444
|
+
collectibleConfig: h
|
|
1428
1445
|
}),
|
|
1429
|
-
"onUpdate:rewardImage": u[6] || (u[6] = (
|
|
1446
|
+
"onUpdate:rewardImage": u[6] || (u[6] = (h) => t.value = h)
|
|
1430
1447
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1431
1448
|
createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
|
|
1432
1449
|
])) : createCommentVNode("", !0)
|
|
@@ -1460,24 +1477,24 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1460
1477
|
const i = s.safeParse(l.value);
|
|
1461
1478
|
return i.success ? [] : i.error.errors;
|
|
1462
1479
|
}), a = ref();
|
|
1463
|
-
function
|
|
1480
|
+
function c(i, u) {
|
|
1464
1481
|
var f;
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1482
|
+
const p = [...l.value];
|
|
1483
|
+
p[u] = i, (f = a.value) == null || f.showSheet(!1), r("update:model-value", p);
|
|
1467
1484
|
}
|
|
1468
1485
|
function v(i) {
|
|
1469
1486
|
const u = i.type == "VOUCHER" ? i.collectibleConfig : o.collectibles.find(
|
|
1470
1487
|
(k) => k._id.toString() == i.collectible
|
|
1471
|
-
),
|
|
1488
|
+
), p = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), f = i.weight;
|
|
1472
1489
|
return {
|
|
1473
|
-
label: isNullOrEmpty(
|
|
1490
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
1474
1491
|
sublabel: `${f} (${(f / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
|
|
1475
1492
|
};
|
|
1476
1493
|
}
|
|
1477
1494
|
function m(i) {
|
|
1478
|
-
var
|
|
1495
|
+
var p;
|
|
1479
1496
|
const u = [...l.value];
|
|
1480
|
-
(
|
|
1497
|
+
(p = a.value) == null || p.showSheet(!0, u[i], i);
|
|
1481
1498
|
}
|
|
1482
1499
|
function g(i) {
|
|
1483
1500
|
const u = [...l.value];
|
|
@@ -1496,10 +1513,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1496
1513
|
);
|
|
1497
1514
|
}
|
|
1498
1515
|
return (i, u) => {
|
|
1499
|
-
const
|
|
1516
|
+
const p = resolveComponent("FmButton"), f = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1500
1517
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1501
1518
|
_hoisted_2$9,
|
|
1502
|
-
createVNode(
|
|
1519
|
+
createVNode(p, {
|
|
1503
1520
|
label: "Add Reward",
|
|
1504
1521
|
onClick: u[0] || (u[0] = (C) => y()),
|
|
1505
1522
|
variant: "plain",
|
|
@@ -1516,7 +1533,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1516
1533
|
createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
|
|
1517
1534
|
createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
|
|
1518
1535
|
]),
|
|
1519
|
-
createVNode(
|
|
1536
|
+
createVNode(p, {
|
|
1520
1537
|
icon: "delete",
|
|
1521
1538
|
variant: "tertiary",
|
|
1522
1539
|
onClick: (x) => (x.stopPropagation(), g(b))
|
|
@@ -1532,7 +1549,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1532
1549
|
createVNode(_sfc_main$b, {
|
|
1533
1550
|
ref_key: "sheetRef",
|
|
1534
1551
|
ref: a,
|
|
1535
|
-
"onUpdate:modelValue":
|
|
1552
|
+
"onUpdate:modelValue": c
|
|
1536
1553
|
}, null, 512)
|
|
1537
1554
|
]);
|
|
1538
1555
|
};
|
|
@@ -1558,7 +1575,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1558
1575
|
]);
|
|
1559
1576
|
return (s, l) => {
|
|
1560
1577
|
var v, m, g;
|
|
1561
|
-
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"),
|
|
1578
|
+
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
|
|
1562
1579
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1563
1580
|
createVNode(t, {
|
|
1564
1581
|
label: "Enable game",
|
|
@@ -1576,8 +1593,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1576
1593
|
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != y.value
|
|
1577
1594
|
}]),
|
|
1578
1595
|
onClick: () => {
|
|
1579
|
-
var
|
|
1580
|
-
((
|
|
1596
|
+
var p;
|
|
1597
|
+
((p = n.modelValue) == null ? void 0 : p.gameType) != y.value && r("update:model-value", { gameType: y.value });
|
|
1581
1598
|
},
|
|
1582
1599
|
key: y.value
|
|
1583
1600
|
}, {
|
|
@@ -1589,7 +1606,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1589
1606
|
}, 1032, ["class", "onClick"]);
|
|
1590
1607
|
}), 128))
|
|
1591
1608
|
])) : createCommentVNode("", !0),
|
|
1592
|
-
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
1609
|
+
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
|
|
1593
1610
|
key: 1,
|
|
1594
1611
|
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)",
|
|
1595
1612
|
state: "warning"
|
|
@@ -1685,21 +1702,21 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1685
1702
|
},
|
|
1686
1703
|
emits: ["update:model-value"],
|
|
1687
1704
|
setup(e, { expose: d, emit: n }) {
|
|
1688
|
-
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(),
|
|
1689
|
-
const
|
|
1690
|
-
return
|
|
1705
|
+
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), c = ref(0), v = FdtoThresholdReward, m = computed(() => {
|
|
1706
|
+
const p = v.safeParse(t.value);
|
|
1707
|
+
return p.success ? [] : p.error.errors;
|
|
1691
1708
|
});
|
|
1692
|
-
function g(
|
|
1693
|
-
|
|
1709
|
+
function g(p, f, k) {
|
|
1710
|
+
p && (t.value = f, c.value = k), l.value = p;
|
|
1694
1711
|
}
|
|
1695
1712
|
const y = n;
|
|
1696
1713
|
async function i() {
|
|
1697
1714
|
console.log(t.value);
|
|
1698
|
-
const
|
|
1699
|
-
|
|
1715
|
+
const p = v.safeParse(t.value);
|
|
1716
|
+
p.success && (await s(
|
|
1700
1717
|
async () => {
|
|
1701
|
-
|
|
1702
|
-
|
|
1718
|
+
p.data.type === "VOUCHER" && a.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1719
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
1703
1720
|
a.value
|
|
1704
1721
|
));
|
|
1705
1722
|
},
|
|
@@ -1707,19 +1724,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1707
1724
|
message: "Uploading reward image",
|
|
1708
1725
|
successMessage: "Reward image updated"
|
|
1709
1726
|
}
|
|
1710
|
-
), y("update:model-value",
|
|
1727
|
+
), y("update:model-value", p.data, c.value));
|
|
1711
1728
|
}
|
|
1712
1729
|
const u = ref();
|
|
1713
1730
|
return d({
|
|
1714
1731
|
showSheet: g
|
|
1715
|
-
}), (
|
|
1732
|
+
}), (p, f) => {
|
|
1716
1733
|
const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
|
|
1717
1734
|
return openBlock(), createBlock(E, {
|
|
1718
1735
|
"max-width": 560,
|
|
1719
1736
|
modelValue: unref(l),
|
|
1720
1737
|
"onUpdate:modelValue": [
|
|
1721
|
-
f[10] || (f[10] = (
|
|
1722
|
-
f[11] || (f[11] = (
|
|
1738
|
+
f[10] || (f[10] = (h) => isRef(l) ? l.value = h : null),
|
|
1739
|
+
f[11] || (f[11] = (h) => l.value = h)
|
|
1723
1740
|
],
|
|
1724
1741
|
header: "Edit reward",
|
|
1725
1742
|
"dismiss-away": ""
|
|
@@ -1731,15 +1748,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1731
1748
|
type: "button",
|
|
1732
1749
|
label: "Confirm",
|
|
1733
1750
|
onClick: f[8] || (f[8] = async () => {
|
|
1734
|
-
var
|
|
1735
|
-
return (
|
|
1751
|
+
var h;
|
|
1752
|
+
return (h = unref(u)) == null ? void 0 : h.validateInputs();
|
|
1736
1753
|
})
|
|
1737
1754
|
}),
|
|
1738
1755
|
createVNode(x, {
|
|
1739
1756
|
variant: "secondary",
|
|
1740
1757
|
type: "button",
|
|
1741
1758
|
label: "Cancel",
|
|
1742
|
-
onClick: f[9] || (f[9] = (
|
|
1759
|
+
onClick: f[9] || (f[9] = (h) => l.value = !1)
|
|
1743
1760
|
})
|
|
1744
1761
|
])
|
|
1745
1762
|
]),
|
|
@@ -1749,10 +1766,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1749
1766
|
class: "flex flex-col gap-y-24",
|
|
1750
1767
|
ref_key: "formRef",
|
|
1751
1768
|
ref: u,
|
|
1752
|
-
onValidationSuccess: f[7] || (f[7] = (
|
|
1769
|
+
onValidationSuccess: f[7] || (f[7] = (h) => i())
|
|
1753
1770
|
}, {
|
|
1754
1771
|
default: withCtx(() => {
|
|
1755
|
-
var
|
|
1772
|
+
var h, N;
|
|
1756
1773
|
return [
|
|
1757
1774
|
unref(t).type ? (openBlock(), createBlock(k, {
|
|
1758
1775
|
key: 0,
|
|
@@ -1766,9 +1783,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1766
1783
|
)
|
|
1767
1784
|
],
|
|
1768
1785
|
"model-value": unref(t).threshold,
|
|
1769
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
1786
|
+
"onUpdate:modelValue": f[0] || (f[0] = (V) => t.value = {
|
|
1770
1787
|
...unref(t),
|
|
1771
|
-
threshold:
|
|
1788
|
+
threshold: V
|
|
1772
1789
|
})
|
|
1773
1790
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1774
1791
|
createVNode(C, {
|
|
@@ -1778,9 +1795,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1778
1795
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1779
1796
|
],
|
|
1780
1797
|
"model-value": unref(t).type,
|
|
1781
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
1798
|
+
"onUpdate:modelValue": f[1] || (f[1] = (V) => {
|
|
1782
1799
|
var R, B;
|
|
1783
|
-
|
|
1800
|
+
V === "VOUCHER" ? t.value = {
|
|
1784
1801
|
collectible: null,
|
|
1785
1802
|
type: "VOUCHER",
|
|
1786
1803
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1814,7 +1831,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1814
1831
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
|
|
1815
1832
|
items: unref(o).loyaltyRewards.items,
|
|
1816
1833
|
"model-value": unref(t).collectible,
|
|
1817
|
-
"onUpdate:modelValue": f[2] || (f[2] = (
|
|
1834
|
+
"onUpdate:modelValue": f[2] || (f[2] = (V) => unref(t).collectible = V)
|
|
1818
1835
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1819
1836
|
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1820
1837
|
_hoisted_1$6,
|
|
@@ -1825,24 +1842,24 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1825
1842
|
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1826
1843
|
"fixed-type": !0,
|
|
1827
1844
|
"model-value": unref(t).earningOption,
|
|
1828
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
1845
|
+
"onUpdate:modelValue": f[3] || (f[3] = (V) => t.value = {
|
|
1829
1846
|
...unref(t),
|
|
1830
|
-
earningOption:
|
|
1847
|
+
earningOption: V
|
|
1831
1848
|
})
|
|
1832
1849
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1833
1850
|
createVNode(_sfc_main$z, {
|
|
1834
1851
|
class: "!gap-24",
|
|
1835
|
-
"for-credit": unref(t).type === "LOYALTY" && ((
|
|
1836
|
-
(
|
|
1852
|
+
"for-credit": unref(t).type === "LOYALTY" && ((h = unref(o).loyaltyRewards.items.find(
|
|
1853
|
+
(V) => {
|
|
1837
1854
|
var R;
|
|
1838
|
-
return
|
|
1855
|
+
return V.value === ((R = unref(t)) == null ? void 0 : R.collectible);
|
|
1839
1856
|
}
|
|
1840
|
-
)) == null ? void 0 :
|
|
1857
|
+
)) == null ? void 0 : h.raw.type) === "CREDIT",
|
|
1841
1858
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
|
|
1842
1859
|
"model-value": unref(t).validityOption,
|
|
1843
|
-
"onUpdate:modelValue": f[4] || (f[4] = (
|
|
1860
|
+
"onUpdate:modelValue": f[4] || (f[4] = (V) => t.value = {
|
|
1844
1861
|
...unref(t),
|
|
1845
|
-
validityOption:
|
|
1862
|
+
validityOption: V
|
|
1846
1863
|
})
|
|
1847
1864
|
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1848
1865
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -1850,11 +1867,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1850
1867
|
key: 3,
|
|
1851
1868
|
"reward-image": unref(a),
|
|
1852
1869
|
"model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1853
|
-
"onUpdate:modelValue": f[5] || (f[5] = (
|
|
1870
|
+
"onUpdate:modelValue": f[5] || (f[5] = (V) => t.value = {
|
|
1854
1871
|
...unref(t),
|
|
1855
|
-
collectibleConfig:
|
|
1872
|
+
collectibleConfig: V
|
|
1856
1873
|
}),
|
|
1857
|
-
"onUpdate:rewardImage": f[6] || (f[6] = (
|
|
1874
|
+
"onUpdate:rewardImage": f[6] || (f[6] = (V) => a.value = V)
|
|
1858
1875
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1859
1876
|
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1860
1877
|
];
|
|
@@ -1894,9 +1911,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1894
1911
|
() => Math.min(r.value / n.value * 100, 100)
|
|
1895
1912
|
), l = (t) => t / n.value * 100;
|
|
1896
1913
|
return (t, a) => {
|
|
1897
|
-
const
|
|
1914
|
+
const c = resolveComponent("FmIcon");
|
|
1898
1915
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1899
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(
|
|
1916
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(c, {
|
|
1900
1917
|
class: normalizeClass(
|
|
1901
1918
|
unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1902
1919
|
),
|
|
@@ -1936,8 +1953,8 @@ function changeKeysFactory(e) {
|
|
|
1936
1953
|
return n.map((l) => d(l, r - 1, o));
|
|
1937
1954
|
const s = Object.create(Object.getPrototypeOf(n));
|
|
1938
1955
|
return Object.keys(n).forEach((l) => {
|
|
1939
|
-
const t = n[l], a = e(l, o),
|
|
1940
|
-
s[a] =
|
|
1956
|
+
const t = n[l], a = e(l, o), c = d(t, r - 1, o);
|
|
1957
|
+
s[a] = c;
|
|
1941
1958
|
}), s;
|
|
1942
1959
|
};
|
|
1943
1960
|
}
|
|
@@ -1956,20 +1973,20 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1956
1973
|
emits: ["update:model-value"],
|
|
1957
1974
|
setup(e, { emit: d }) {
|
|
1958
1975
|
const n = e, r = d, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1959
|
-
() => n.modelValue.sort((u,
|
|
1976
|
+
() => n.modelValue.sort((u, p) => u.threshold - p.threshold) ?? []
|
|
1960
1977
|
), t = computed(() => {
|
|
1961
1978
|
const u = s.safeParse(l.value);
|
|
1962
1979
|
return u.success ? [] : u.error.errors;
|
|
1963
1980
|
}), a = ref();
|
|
1964
|
-
function
|
|
1981
|
+
function c(u, p) {
|
|
1965
1982
|
var k;
|
|
1966
1983
|
const f = [...l.value];
|
|
1967
|
-
f[
|
|
1984
|
+
f[p] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", f);
|
|
1968
1985
|
}
|
|
1969
1986
|
function v(u) {
|
|
1970
|
-
const
|
|
1987
|
+
const p = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
|
|
1971
1988
|
(k) => k._id.toString() == u.collectible
|
|
1972
|
-
), f = CollectionUtils.formattedType((
|
|
1989
|
+
), f = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
|
|
1973
1990
|
return {
|
|
1974
1991
|
label: isNullOrEmpty(f) ? "NO REWARD" : f,
|
|
1975
1992
|
sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
|
|
@@ -1977,12 +1994,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1977
1994
|
}
|
|
1978
1995
|
function m(u) {
|
|
1979
1996
|
var f;
|
|
1980
|
-
const
|
|
1981
|
-
(f = a.value) == null || f.showSheet(!0,
|
|
1997
|
+
const p = [...l.value];
|
|
1998
|
+
(f = a.value) == null || f.showSheet(!0, p[u], u);
|
|
1982
1999
|
}
|
|
1983
2000
|
function g(u) {
|
|
1984
|
-
const
|
|
1985
|
-
|
|
2001
|
+
const p = [...l.value];
|
|
2002
|
+
p.splice(u, 1), r("update:model-value", p);
|
|
1986
2003
|
}
|
|
1987
2004
|
function y() {
|
|
1988
2005
|
var u;
|
|
@@ -2004,20 +2021,20 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2004
2021
|
);
|
|
2005
2022
|
}
|
|
2006
2023
|
function i(u) {
|
|
2007
|
-
var
|
|
2008
|
-
return u.type == "VOUCHER" ? (
|
|
2024
|
+
var p, f;
|
|
2025
|
+
return u.type == "VOUCHER" ? (p = u.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
|
|
2009
2026
|
((f = o.loyaltyRewards.items.find(
|
|
2010
2027
|
(k) => k.value == u.collectible
|
|
2011
2028
|
)) == null ? void 0 : f.label) || ""
|
|
2012
2029
|
);
|
|
2013
2030
|
}
|
|
2014
|
-
return (u,
|
|
2031
|
+
return (u, p) => {
|
|
2015
2032
|
const f = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2016
2033
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2017
2034
|
_hoisted_2$3,
|
|
2018
2035
|
createVNode(f, {
|
|
2019
2036
|
label: "Add Reward",
|
|
2020
|
-
onClick:
|
|
2037
|
+
onClick: p[0] || (p[0] = (b) => y()),
|
|
2021
2038
|
variant: "plain",
|
|
2022
2039
|
icon: "add"
|
|
2023
2040
|
}),
|
|
@@ -2072,7 +2089,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2072
2089
|
createVNode(_sfc_main$6, {
|
|
2073
2090
|
ref_key: "sheetRef",
|
|
2074
2091
|
ref: a,
|
|
2075
|
-
"onUpdate:modelValue":
|
|
2092
|
+
"onUpdate:modelValue": c,
|
|
2076
2093
|
"max-threshold": e.mission.end
|
|
2077
2094
|
}, null, 8, ["max-threshold"])
|
|
2078
2095
|
]);
|
|
@@ -2102,7 +2119,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2102
2119
|
]), s = d;
|
|
2103
2120
|
return (l, t) => {
|
|
2104
2121
|
var v;
|
|
2105
|
-
const a = resolveComponent("FmCard"),
|
|
2122
|
+
const a = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
|
|
2106
2123
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2107
2124
|
createElementVNode("div", _hoisted_2$2, [
|
|
2108
2125
|
_hoisted_3$2,
|
|
@@ -2139,7 +2156,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2139
2156
|
createElementVNode("div", _hoisted_8$1, [
|
|
2140
2157
|
_hoisted_9$1,
|
|
2141
2158
|
_hoisted_10$1,
|
|
2142
|
-
createVNode(
|
|
2159
|
+
createVNode(c, {
|
|
2143
2160
|
label: "Maximum to collect",
|
|
2144
2161
|
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2145
2162
|
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
@@ -2184,11 +2201,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2184
2201
|
function o(a) {
|
|
2185
2202
|
switch (n.field.type) {
|
|
2186
2203
|
case "timeframe":
|
|
2187
|
-
const
|
|
2204
|
+
const c = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
|
|
2188
2205
|
r("update:model-value", {
|
|
2189
2206
|
type: "timeframe",
|
|
2190
2207
|
property: "__now",
|
|
2191
|
-
start:
|
|
2208
|
+
start: c,
|
|
2192
2209
|
end: v
|
|
2193
2210
|
});
|
|
2194
2211
|
break;
|
|
@@ -2230,8 +2247,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2230
2247
|
labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
|
|
2231
2248
|
zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
|
|
2232
2249
|
}));
|
|
2233
|
-
return (a,
|
|
2234
|
-
var u,
|
|
2250
|
+
return (a, c) => {
|
|
2251
|
+
var u, p, f, k, C;
|
|
2235
2252
|
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), y = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
|
|
2236
2253
|
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
2237
2254
|
key: 0,
|
|
@@ -2261,7 +2278,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2261
2278
|
"model-value": unref(s),
|
|
2262
2279
|
"onUpdate:modelValue": o,
|
|
2263
2280
|
"show-word-count": "",
|
|
2264
|
-
"max-length": (C = (k = (f = (
|
|
2281
|
+
"max-length": (C = (k = (f = (p = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : p._def) == null ? void 0 : f.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
|
|
2265
2282
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2266
2283
|
key: 3,
|
|
2267
2284
|
"campaign-type": e.extras,
|
|
@@ -2323,7 +2340,6 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2323
2340
|
}))
|
|
2324
2341
|
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
2325
2342
|
key: 10,
|
|
2326
|
-
"allow-email": !0,
|
|
2327
2343
|
"model-value": unref(s),
|
|
2328
2344
|
"onUpdate:modelValue": o,
|
|
2329
2345
|
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
@@ -2731,24 +2747,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2731
2747
|
class: "space-y-24"
|
|
2732
2748
|
}, [
|
|
2733
2749
|
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2734
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (
|
|
2750
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (c, v) => (openBlock(), createElementBlock("div", { key: v }, [
|
|
2735
2751
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2736
2752
|
key: v,
|
|
2737
|
-
field:
|
|
2738
|
-
modelValue: unref(_).get(unref(data),
|
|
2739
|
-
disabled: isDisable(
|
|
2740
|
-
"onUpdate:modelValue": (m) => onUpdateProperty(
|
|
2753
|
+
field: c,
|
|
2754
|
+
modelValue: unref(_).get(unref(data), c.property),
|
|
2755
|
+
disabled: isDisable(c),
|
|
2756
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(c.property, m),
|
|
2741
2757
|
"onUpdate:file": async (m, g) => {
|
|
2742
2758
|
const y = await onUpdateFile(m, g);
|
|
2743
|
-
onUpdateProperty(
|
|
2759
|
+
onUpdateProperty(c.property, y || "");
|
|
2744
2760
|
},
|
|
2745
2761
|
schema: unref(ZodHelper).typeAtPath(
|
|
2746
2762
|
unref(schema),
|
|
2747
|
-
|
|
2763
|
+
c.property,
|
|
2748
2764
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2749
2765
|
),
|
|
2750
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2751
|
-
extras:
|
|
2766
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
|
|
2767
|
+
extras: c.extras != null ? c.extras == "" ? unref(data) : unref(_).get(unref(data), c.extras) : void 0
|
|
2752
2768
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
|
|
2753
2769
|
]))), 128))
|
|
2754
2770
|
]))), 128)),
|