@feedmepos/mf-connect 0.0.20-prod → 0.0.22-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-DuwMJh8c.js → Analytic-DiZyXVa2.js} +21 -19
- package/dist/App-B56fA1JN.js +176 -0
- package/dist/{Broadcast-BUgjgqv9.js → Broadcast-ixoPXMt8.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BDU9wbxY.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DlgKZtNO.js} +8 -8
- package/dist/{Card-CwohdmAQ.js → Card-aw5tdKY-.js} +74 -72
- package/dist/{Collections-D-JKj4iC.js → Collections-CMD-SLC3.js} +16 -14
- package/dist/{Credit-BdKekl3X.js → Credit-CEVk1_sX.js} +7 -7
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DA-7-Qi9.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-Co6j2tz0.js} +324 -328
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-lDNh6GmQ.js → EffectSheet.vue_vue_type_style_index_0_lang-xXv4IrKd.js} +5 -5
- package/dist/{Experience-KoC4x_ae.js → Experience-CSui9603.js} +7 -7
- package/dist/{Game-CTkr8R18.js → Game-PodGVfdS.js} +7 -7
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CDeQRYDy.js → ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js} +1 -1
- package/dist/JsonViewer-v8_C7l5N.js +87 -0
- package/dist/{MainLayout-Du7UHyf3.js → MainLayout-DpZC6o3R.js} +2 -1
- package/dist/{Marketing-CTl2LqXi.js → Marketing-CbrFzK0w.js} +13 -12
- package/dist/{Member-hHIz1gGT.js → Member-DnrQEiiV.js} +31 -30
- package/dist/{MemberList-Fs95BxUo.js → MemberList-7Te6kVOJ.js} +33 -30
- package/dist/{MemberTransactions-nmURocbA.js → MemberTransactions-BUp_0bkL.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-Zk21rkMZ.js → MessageInput.vue_vue_type_script_setup_true_lang-BrxCjH9R.js} +2 -2
- package/dist/{Mission-B5YwPU71.js → Mission-Bp16rwVh.js} +14 -14
- package/dist/{Point-BiOgpyye.js → Point-DnzgCjC2.js} +7 -7
- package/dist/{Promotion-Bpvuwixe.js → Promotion-BmhVCYgN.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-DZlxkB8D.js → RuleGroup.vue_vue_type_script_setup_true_lang-BuELQmoo.js} +16 -15
- package/dist/{Segment-DrEpmY4N.js → Segment-CCrLEh0A.js} +19 -18
- package/dist/{Setting-D48p2snU.js → Setting-v0gKscv9.js} +11 -10
- package/dist/{Store-CT1XE_Sn.js → Store-CHDu8Rop.js} +51 -47
- package/dist/StoreRewards-D_vBCPZl.js +429 -0
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DboIoW51.js → StoreTransactions.vue_vue_type_script_setup_true_lang-zDJEaBmd.js} +106 -108
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CtSi80Oy.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-CVf5Jjj1.js} +6 -6
- package/dist/{Tier-BzZX_Dki.js → Tier-C5gbgtcG.js} +25 -24
- package/dist/{Title-C2Ji-YGQ.js → Title-CojucJrP.js} +15 -15
- package/dist/{Transaction-BJGKndk-.js → Transaction-D1i5IH7D.js} +1 -1
- package/dist/{Voucher-D2dpFJSA.js → Voucher-VuXKhD49.js} +55 -51
- package/dist/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-Cok2f-SL.js +2974 -0
- package/dist/{app-D5_9RvMw.js → app-Df5HEUc7.js} +1 -1
- package/dist/app-wDQR6dpb.js +39 -0
- package/dist/app.js +2 -2
- package/dist/business-zehruO7m.js +78 -0
- package/dist/{campaign-BK6-HrgE.js → campaign-BDdGYC5z.js} +7 -7
- package/dist/{dto-E-AuMyEO.js → dto-X3oNeL7n.js} +8 -8
- package/dist/{effect-DOWJayPu.js → effect-Cl3gXAd9.js} +1 -1
- package/dist/{export-DMZdMVnb.js → export-COy97xf1.js} +3 -3
- package/dist/{helper-CmlX0eR1.js → helper-BMCigtw-.js} +1 -1
- package/dist/{index-Cj1rTpPK.js → index-9ijJtga8.js} +1 -1
- package/dist/{app-BAgeAm1l.js → index-BENEb_BE.js} +9660 -13019
- package/dist/index-BEWobmlN.js +11 -0
- package/dist/{index-QeG7EuE3.js → index-Bi8rxPHs.js} +1 -1
- package/dist/{index-gOVUv83Y.js → index-Btbk-4q4.js} +3 -3
- package/dist/{index-BkHtyaBf.js → index-CXwywdbf.js} +5 -5
- package/dist/{index-BhHZOSyO.js → index-Cl6-R6oj.js} +1 -1
- package/dist/{index-DKCHICCa.js → index-DEunD6Nb.js} +46 -39
- package/dist/{index-BNy1wU-V.js → index-DcRKYwqb.js} +3 -3
- package/dist/{index-BZbJpBo2.js → index-SusoyGmN.js} +6 -7
- package/dist/{index-zAvZNHx0.js → index-ucUyNm2f.js} +177 -168
- package/dist/{index-RcFvF7Y_.js → index-ueVq8lE0.js} +6 -5
- package/dist/{loading-BIURYgSR.js → loading-B7ZGAeOi.js} +28 -26
- package/dist/{lodash-CxofWkz4.js → lodash-B5I3zXaY.js} +1 -1
- package/dist/{membership-DVEV926P.js → membership-JcEfpV3H.js} +3 -3
- package/dist/{money-99JilzxX.js → money-DFguRQja.js} +1 -1
- package/dist/number-CojWykn9.js +12 -0
- package/dist/{rule-Chwh9Y4B.js → rule-C_lc6_Vf.js} +2 -2
- package/dist/{rule-builder-JEF7ltcg.js → rule-builder-C3AmhP2r.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{template-B6lZdtyo.js → template-TVj4e3Q0.js} +5 -5
- package/dist/{usePagination-4epNDLvW.js → usePagination-JoYaROkV.js} +1 -1
- package/dist/{xlsx-DKkkHUS_.js → xlsx-zY8O-RaE.js} +1 -1
- package/package.json +1 -1
- package/dist/StoreRewards-DsjyanOO.js +0 -433
- package/dist/number-BKGHLuLf.js +0 -12
|
@@ -1,27 +1,30 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import {
|
|
2
|
+
import { _ } from "./lodash-B5I3zXaY.js";
|
|
3
|
+
import { z } from "./app-Cok2f-SL.js";
|
|
4
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-
|
|
6
|
-
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-X3oNeL7n.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-JcEfpV3H.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-zehruO7m.js";
|
|
8
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-ucUyNm2f.js";
|
|
9
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-C3AmhP2r.js";
|
|
10
|
+
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
9
11
|
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-
|
|
12
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-ueVq8lE0.js";
|
|
13
|
+
import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
|
|
14
|
+
import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-xXv4IrKd.js";
|
|
15
|
+
import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CVf5Jjj1.js";
|
|
16
|
+
import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BuELQmoo.js";
|
|
17
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-B7ZGAeOi.js";
|
|
18
|
+
import { _ as _sfc_main$q, T as TEMPLATES } from "./index-CXwywdbf.js";
|
|
19
|
+
import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-BrxCjH9R.js";
|
|
20
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-C_lc6_Vf.js";
|
|
21
|
+
import { c as core, S as SvcConfig } from "./index-BENEb_BE.js";
|
|
22
|
+
import "./index-SusoyGmN.js";
|
|
23
|
+
import "./index-Btbk-4q4.js";
|
|
24
|
+
import "./index-DEunD6Nb.js";
|
|
25
|
+
import "./index-Cl6-R6oj.js";
|
|
23
26
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
24
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
27
|
+
import { i as initCollectibleConfig } from "./helper-BMCigtw-.js";
|
|
25
28
|
import { C as CollectionUtils } from "./collection.fn-DHlfGYAC.js";
|
|
26
29
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
27
30
|
import { useDialog } from "@feedmepos/ui-library";
|
|
@@ -35,12 +38,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
35
38
|
}
|
|
36
39
|
},
|
|
37
40
|
emits: ["update:model-value"],
|
|
38
|
-
setup(e, { emit:
|
|
41
|
+
setup(e, { emit: i }) {
|
|
39
42
|
const n = e, r = computed(() => {
|
|
40
43
|
var t;
|
|
41
44
|
const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
|
|
42
45
|
return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
43
|
-
}), o =
|
|
46
|
+
}), o = i;
|
|
44
47
|
return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
|
|
45
48
|
multiselect: !0,
|
|
46
49
|
items: unref(useMembershipStore)().segmentOptions,
|
|
@@ -65,8 +68,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
65
68
|
}
|
|
66
69
|
},
|
|
67
70
|
emits: ["update:model-value"],
|
|
68
|
-
setup(e, { emit:
|
|
69
|
-
const n = e, r =
|
|
71
|
+
setup(e, { emit: i }) {
|
|
72
|
+
const n = e, r = i, o = ref(
|
|
70
73
|
n.modelValue ? RuleBuilder.getRules(n.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(n.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
71
74
|
), s = [
|
|
72
75
|
{
|
|
@@ -87,19 +90,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
87
90
|
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
88
91
|
(a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
89
92
|
).length > 0) {
|
|
90
|
-
const
|
|
93
|
+
const f = await prompt.confirm(
|
|
91
94
|
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
92
95
|
);
|
|
93
|
-
|
|
96
|
+
f && r(
|
|
94
97
|
"update:model-value",
|
|
95
98
|
RuleBuilder.setRuleToGroup(
|
|
96
99
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
97
100
|
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
98
101
|
)
|
|
99
|
-
), o.value =
|
|
102
|
+
), o.value = f ? l : t;
|
|
100
103
|
}
|
|
101
104
|
}), (l, t) => {
|
|
102
|
-
var
|
|
105
|
+
var f, v;
|
|
103
106
|
const a = resolveComponent("FmRadio");
|
|
104
107
|
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
105
108
|
createElementVNode("div", null, [
|
|
@@ -113,7 +116,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
113
116
|
]),
|
|
114
117
|
unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
115
118
|
createVNode(_sfc_main$p, {
|
|
116
|
-
modelValue: ((
|
|
119
|
+
modelValue: ((f = e.modelValue) == null ? void 0 : f.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
117
120
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
118
121
|
"update:model-value",
|
|
119
122
|
unref(RuleBuilder).setRuleToGroup(
|
|
@@ -151,23 +154,23 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
151
154
|
}
|
|
152
155
|
},
|
|
153
156
|
emits: ["update:model-value"],
|
|
154
|
-
setup(e, { emit:
|
|
155
|
-
const n = e, r =
|
|
157
|
+
setup(e, { emit: i }) {
|
|
158
|
+
const n = e, r = i, o = ref(
|
|
156
159
|
!n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
157
160
|
);
|
|
158
161
|
watch(o, async (l, t) => {
|
|
159
162
|
var a;
|
|
160
163
|
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
|
|
161
|
-
const
|
|
164
|
+
const f = await prompt.confirm(
|
|
162
165
|
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
163
166
|
);
|
|
164
|
-
|
|
167
|
+
f && r(
|
|
165
168
|
"update:model-value",
|
|
166
169
|
RuleBuilder.setRuleToGroup(
|
|
167
170
|
n.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
168
171
|
RuleBuilder.scaffoldGroup("g_time")
|
|
169
172
|
)
|
|
170
|
-
), o.value =
|
|
173
|
+
), o.value = f ? l : t;
|
|
171
174
|
}
|
|
172
175
|
});
|
|
173
176
|
async function s(l) {
|
|
@@ -190,9 +193,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
190
193
|
}
|
|
191
194
|
return (l, t) => {
|
|
192
195
|
var v;
|
|
193
|
-
const a = resolveComponent("FmRadio"),
|
|
196
|
+
const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
|
|
194
197
|
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
195
|
-
createVNode(
|
|
198
|
+
createVNode(f, {
|
|
196
199
|
modelValue: unref(o),
|
|
197
200
|
"onUpdate:modelValue": [
|
|
198
201
|
t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
|
|
@@ -239,8 +242,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
239
242
|
}
|
|
240
243
|
},
|
|
241
244
|
emits: ["update:model-value"],
|
|
242
|
-
setup(e, { emit:
|
|
243
|
-
const n =
|
|
245
|
+
setup(e, { emit: i }) {
|
|
246
|
+
const n = i;
|
|
244
247
|
return (r, o) => {
|
|
245
248
|
var s;
|
|
246
249
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
@@ -266,8 +269,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
266
269
|
}
|
|
267
270
|
},
|
|
268
271
|
emits: ["update:model-value"],
|
|
269
|
-
setup(e, { emit:
|
|
270
|
-
const n = e, r =
|
|
272
|
+
setup(e, { emit: i }) {
|
|
273
|
+
const n = e, r = i, o = computed(() => {
|
|
271
274
|
const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
|
|
272
275
|
n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
273
276
|
op: "before",
|
|
@@ -318,11 +321,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
318
321
|
label: "Days before birthday",
|
|
319
322
|
"show-steppers": !1,
|
|
320
323
|
"model-value": unref(o).equator.x,
|
|
321
|
-
"onUpdate:modelValue": l[2] || (l[2] = (
|
|
324
|
+
"onUpdate:modelValue": l[2] || (l[2] = (f) => r(
|
|
322
325
|
"update:model-value",
|
|
323
326
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
327
|
op: "after",
|
|
325
|
-
x:
|
|
328
|
+
x: f,
|
|
326
329
|
ignoreYear: !0
|
|
327
330
|
})
|
|
328
331
|
))
|
|
@@ -370,8 +373,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
370
373
|
}
|
|
371
374
|
},
|
|
372
375
|
emits: ["update:model-value"],
|
|
373
|
-
setup(e, { emit:
|
|
374
|
-
const n =
|
|
376
|
+
setup(e, { emit: i }) {
|
|
377
|
+
const n = i;
|
|
375
378
|
return (r, o) => {
|
|
376
379
|
var s;
|
|
377
380
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
@@ -457,10 +460,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
457
460
|
"GAME",
|
|
458
461
|
"MISSION"
|
|
459
462
|
].map((e) => {
|
|
460
|
-
const
|
|
463
|
+
const i = CAMPAIGN_TRIGGER[e];
|
|
461
464
|
return [
|
|
462
465
|
e,
|
|
463
|
-
(
|
|
466
|
+
(i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
|
|
464
467
|
];
|
|
465
468
|
})
|
|
466
469
|
), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
@@ -479,8 +482,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
479
482
|
}
|
|
480
483
|
},
|
|
481
484
|
emits: ["update:model-value"],
|
|
482
|
-
setup(e, { emit:
|
|
483
|
-
const n = e, r =
|
|
485
|
+
setup(e, { emit: i }) {
|
|
486
|
+
const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
|
|
484
487
|
(s) => s.value == n.modelValue
|
|
485
488
|
) : TypeToTriggerOptions[n.campaignType]);
|
|
486
489
|
return (s, l) => {
|
|
@@ -524,8 +527,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
524
527
|
}
|
|
525
528
|
},
|
|
526
529
|
emits: ["update:model-value"],
|
|
527
|
-
setup(e, { emit:
|
|
528
|
-
const n =
|
|
530
|
+
setup(e, { emit: i }) {
|
|
531
|
+
const n = i;
|
|
529
532
|
return (r, o) => {
|
|
530
533
|
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
|
|
531
534
|
return openBlock(), createBlock(t, {
|
|
@@ -544,7 +547,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
544
547
|
key: 0,
|
|
545
548
|
variant: "tertiary",
|
|
546
549
|
icon: "clear",
|
|
547
|
-
onClick: o[0] || (o[0] = (
|
|
550
|
+
onClick: o[0] || (o[0] = (f) => (f.stopPropagation(), n("update:model-value", null)))
|
|
548
551
|
})) : createCommentVNode("", !0)
|
|
549
552
|
]),
|
|
550
553
|
default: withCtx(() => [
|
|
@@ -568,8 +571,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
568
571
|
}
|
|
569
572
|
},
|
|
570
573
|
emits: ["update:model-value"],
|
|
571
|
-
setup(e, { emit:
|
|
572
|
-
const n =
|
|
574
|
+
setup(e, { emit: i }) {
|
|
575
|
+
const n = i;
|
|
573
576
|
return (r, o) => {
|
|
574
577
|
var s, l;
|
|
575
578
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
@@ -621,8 +624,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
621
624
|
}
|
|
622
625
|
},
|
|
623
626
|
emits: ["update:model-value"],
|
|
624
|
-
setup(e, { emit:
|
|
625
|
-
const n = e, r =
|
|
627
|
+
setup(e, { emit: i }) {
|
|
628
|
+
const n = e, r = i;
|
|
626
629
|
function o() {
|
|
627
630
|
const m = RuleBuilder.getRules(n.modelValue);
|
|
628
631
|
return m.length == 0 ? "fixed" : m.some(
|
|
@@ -631,13 +634,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
631
634
|
}
|
|
632
635
|
const s = ref(o()), l = ref(!1), t = computed(() => {
|
|
633
636
|
const m = RuleBuilder.getRules(n.modelValue), g = m.find(
|
|
634
|
-
(
|
|
635
|
-
),
|
|
636
|
-
(
|
|
637
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
|
|
638
|
+
), c = m.find(
|
|
639
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
|
|
637
640
|
);
|
|
638
641
|
return {
|
|
639
642
|
date: g ? RuleBuilder.simplify(g).equator : null,
|
|
640
|
-
time:
|
|
643
|
+
time: c ? RuleBuilder.simplify(c).equator : null
|
|
641
644
|
};
|
|
642
645
|
}), a = computed(
|
|
643
646
|
() => calculateNextScheduleAt(
|
|
@@ -647,8 +650,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
647
650
|
n.endDate ? new Date(n.endDate) : void 0
|
|
648
651
|
)
|
|
649
652
|
);
|
|
650
|
-
function
|
|
651
|
-
const g = m.label.toLowerCase(),
|
|
653
|
+
function f(m) {
|
|
654
|
+
const g = m.label.toLowerCase(), c = g == "fixed" ? [
|
|
652
655
|
RuleBuilder.constructEntry(
|
|
653
656
|
"trigger.date",
|
|
654
657
|
"_isOnDate",
|
|
@@ -667,7 +670,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
667
670
|
"update:model-value",
|
|
668
671
|
RuleBuilder.setRuleToGroup(
|
|
669
672
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
670
|
-
|
|
673
|
+
c
|
|
671
674
|
)
|
|
672
675
|
), s.value = g;
|
|
673
676
|
}
|
|
@@ -703,17 +706,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
703
706
|
);
|
|
704
707
|
}
|
|
705
708
|
return (m, g) => {
|
|
706
|
-
const
|
|
709
|
+
const c = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), p = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
|
|
707
710
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
708
|
-
createVNode(
|
|
711
|
+
createVNode(c, {
|
|
709
712
|
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
710
713
|
"model-value": { label: unref(cases).title(unref(s)) },
|
|
711
|
-
"onUpdate:modelValue":
|
|
714
|
+
"onUpdate:modelValue": f,
|
|
712
715
|
class: "mb-8"
|
|
713
716
|
}, null, 8, ["model-value"]),
|
|
714
717
|
createElementVNode("div", _hoisted_1$g, [
|
|
715
718
|
createElementVNode("div", _hoisted_2$e, [
|
|
716
|
-
createVNode(
|
|
719
|
+
createVNode(d, {
|
|
717
720
|
label: "Notify time",
|
|
718
721
|
"model-value": unref(t).time,
|
|
719
722
|
"onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
|
|
@@ -723,7 +726,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
723
726
|
unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
724
727
|
createElementVNode("div", _hoisted_4$b, [
|
|
725
728
|
_hoisted_5$7,
|
|
726
|
-
unref(t).date ? (openBlock(), createBlock(
|
|
729
|
+
unref(t).date ? (openBlock(), createBlock(p, {
|
|
727
730
|
key: 0,
|
|
728
731
|
"z-index": 9999,
|
|
729
732
|
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
@@ -743,7 +746,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
743
746
|
onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
|
|
744
747
|
}, {
|
|
745
748
|
"popover-button": withCtx(() => [
|
|
746
|
-
createVNode(
|
|
749
|
+
createVNode(y, {
|
|
747
750
|
class: "cursor-pointer",
|
|
748
751
|
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
749
752
|
"helper-state": unref(t).date ? void 0 : "error"
|
|
@@ -794,15 +797,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
794
797
|
filterItems: { type: Function }
|
|
795
798
|
},
|
|
796
799
|
emits: ["confirm"],
|
|
797
|
-
setup(e, { emit:
|
|
800
|
+
setup(e, { emit: i }) {
|
|
798
801
|
const n = ref(), r = ref(!1);
|
|
799
802
|
function o() {
|
|
800
803
|
var l;
|
|
801
804
|
(l = n.value) == null || l.onConfirm();
|
|
802
805
|
}
|
|
803
|
-
const s =
|
|
806
|
+
const s = i;
|
|
804
807
|
return (l, t) => {
|
|
805
|
-
const a = resolveComponent("FmField"),
|
|
808
|
+
const a = resolveComponent("FmField"), f = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
|
|
806
809
|
return openBlock(), createBlock(v, {
|
|
807
810
|
modelValue: r.value,
|
|
808
811
|
"onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
|
|
@@ -823,12 +826,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
823
826
|
]),
|
|
824
827
|
"side-sheet-footer": withCtx(() => [
|
|
825
828
|
createElementVNode("div", _hoisted_1$f, [
|
|
826
|
-
createVNode(
|
|
829
|
+
createVNode(f, {
|
|
827
830
|
variant: "tertiary",
|
|
828
831
|
onClick: t[0] || (t[0] = (m) => r.value = !1),
|
|
829
832
|
label: "Cancel"
|
|
830
833
|
}),
|
|
831
|
-
createVNode(
|
|
834
|
+
createVNode(f, {
|
|
832
835
|
variant: "primary",
|
|
833
836
|
onClick: o,
|
|
834
837
|
label: "Confirm"
|
|
@@ -875,9 +878,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
875
878
|
}
|
|
876
879
|
},
|
|
877
880
|
emits: ["update:model-value"],
|
|
878
|
-
setup(e, { emit:
|
|
881
|
+
setup(e, { emit: i }) {
|
|
879
882
|
var v, m, g;
|
|
880
|
-
const n = useBusinessStore(), r = e, o =
|
|
883
|
+
const n = useBusinessStore(), r = e, o = i, s = [
|
|
881
884
|
{
|
|
882
885
|
label: "Based on spending",
|
|
883
886
|
sublabel: "Customers earn rewards based on how much they spend.",
|
|
@@ -888,22 +891,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
888
891
|
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
889
892
|
value: "FIXED"
|
|
890
893
|
}
|
|
891
|
-
].filter((
|
|
892
|
-
var
|
|
893
|
-
return r.fixedType || ((u = (
|
|
894
|
+
].filter((c) => {
|
|
895
|
+
var d, u;
|
|
896
|
+
return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? c.value == "FIXED" : !0;
|
|
894
897
|
}), l = computed(() => {
|
|
895
|
-
var
|
|
896
|
-
const
|
|
897
|
-
return (((u = CollectibleOptions[
|
|
898
|
+
var d, u;
|
|
899
|
+
const c = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
|
|
900
|
+
return (((u = CollectibleOptions[c]) == null ? void 0 : u.name) || "reward").toLowerCase();
|
|
898
901
|
}), t = computed(() => {
|
|
899
|
-
const
|
|
900
|
-
return
|
|
902
|
+
const c = FdoEarningOption.safeParse(r.modelValue);
|
|
903
|
+
return c.success ? [] : c.error.errors;
|
|
901
904
|
});
|
|
902
|
-
function a(
|
|
903
|
-
var
|
|
904
|
-
|
|
905
|
+
function a(c) {
|
|
906
|
+
var d;
|
|
907
|
+
c != ((d = r.modelValue) == null ? void 0 : d.type) && o(
|
|
905
908
|
"update:model-value",
|
|
906
|
-
|
|
909
|
+
c === "FIXED" ? {
|
|
907
910
|
type: "FIXED",
|
|
908
911
|
amount: 1
|
|
909
912
|
} : {
|
|
@@ -913,12 +916,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
913
916
|
}
|
|
914
917
|
);
|
|
915
918
|
}
|
|
916
|
-
const
|
|
919
|
+
const f = ref(
|
|
917
920
|
((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
|
|
918
921
|
);
|
|
919
|
-
return (
|
|
922
|
+
return (c, d) => {
|
|
920
923
|
var E, V, N;
|
|
921
|
-
const u = resolveComponent("FmCard"),
|
|
924
|
+
const u = resolveComponent("FmCard"), p = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
|
|
922
925
|
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
923
926
|
createElementVNode("div", _hoisted_2$d, [
|
|
924
927
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
|
|
@@ -942,21 +945,21 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
942
945
|
}), 128))
|
|
943
946
|
]),
|
|
944
947
|
createElementVNode("div", _hoisted_5$6, [
|
|
945
|
-
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(
|
|
948
|
+
((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(p, {
|
|
946
949
|
key: 0,
|
|
947
950
|
label: `Receive ${unref(l)}(s)`,
|
|
948
951
|
class: "flex-1",
|
|
949
952
|
"model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
|
|
950
|
-
"onUpdate:modelValue":
|
|
953
|
+
"onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
|
|
951
954
|
...e.modelValue ?? { type: "FIXED" },
|
|
952
955
|
amount: h
|
|
953
956
|
}))
|
|
954
957
|
}, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
955
958
|
_hoisted_6$3,
|
|
956
959
|
createVNode(b, {
|
|
957
|
-
"model-value": unref(
|
|
958
|
-
"onUpdate:modelValue":
|
|
959
|
-
unref(
|
|
960
|
+
"model-value": unref(f),
|
|
961
|
+
"onUpdate:modelValue": d[6] || (d[6] = (h) => {
|
|
962
|
+
unref(f) != h && (o("update:model-value", {
|
|
960
963
|
...e.modelValue ?? {
|
|
961
964
|
type: "PROPORTIONAL",
|
|
962
965
|
amount: 1,
|
|
@@ -964,11 +967,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
964
967
|
},
|
|
965
968
|
property: h ? [] : void 0,
|
|
966
969
|
every: 1
|
|
967
|
-
}),
|
|
970
|
+
}), f.value = h);
|
|
968
971
|
})
|
|
969
972
|
}, {
|
|
970
973
|
default: withCtx(() => [
|
|
971
|
-
createVNode(
|
|
974
|
+
createVNode(y, {
|
|
972
975
|
label: "Amount spent",
|
|
973
976
|
sublabel: `Receive ${unref(l)} by amount spent`,
|
|
974
977
|
value: !1
|
|
@@ -978,24 +981,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
978
981
|
return [
|
|
979
982
|
_hoisted_7$3,
|
|
980
983
|
createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
|
|
981
|
-
unref(
|
|
982
|
-
createVNode(
|
|
984
|
+
unref(f) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
985
|
+
createVNode(p, {
|
|
983
986
|
label: `Receive ${unref(l)}(s)`,
|
|
984
987
|
inputmode: "decimal",
|
|
985
988
|
class: "flex-1",
|
|
986
989
|
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
987
|
-
"onUpdate:modelValue":
|
|
990
|
+
"onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
|
|
988
991
|
...e.modelValue ?? { type: "FIXED" },
|
|
989
992
|
amount: B
|
|
990
993
|
}))
|
|
991
994
|
}, null, 8, ["label", "model-value"]),
|
|
992
995
|
_hoisted_10$3,
|
|
993
|
-
createVNode(
|
|
996
|
+
createVNode(p, {
|
|
994
997
|
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
995
998
|
class: "flex-1",
|
|
996
999
|
inputmode: "decimal",
|
|
997
1000
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
998
|
-
"onUpdate:modelValue":
|
|
1001
|
+
"onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
|
|
999
1002
|
...e.modelValue,
|
|
1000
1003
|
every: B
|
|
1001
1004
|
}))
|
|
@@ -1010,7 +1013,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1010
1013
|
}),
|
|
1011
1014
|
_: 1
|
|
1012
1015
|
}, 8, ["sublabel"]),
|
|
1013
|
-
createVNode(
|
|
1016
|
+
createVNode(y, {
|
|
1014
1017
|
label: "Product bought",
|
|
1015
1018
|
sublabel: `Receive ${unref(l)} by product bought`,
|
|
1016
1019
|
value: !0,
|
|
@@ -1024,11 +1027,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1024
1027
|
createVNode(k, { variant: "premium" })
|
|
1025
1028
|
]),
|
|
1026
1029
|
createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
|
|
1027
|
-
unref(
|
|
1030
|
+
unref(f) ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
1028
1031
|
createElementVNode("div", _hoisted_14, [
|
|
1029
1032
|
createVNode(_sfc_main$f, {
|
|
1030
1033
|
"model-value": r.modelValue.property || [],
|
|
1031
|
-
onConfirm:
|
|
1034
|
+
onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
|
|
1032
1035
|
...e.modelValue,
|
|
1033
1036
|
property: B
|
|
1034
1037
|
}))
|
|
@@ -1047,24 +1050,24 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1047
1050
|
}, 8, ["model-value"])
|
|
1048
1051
|
]),
|
|
1049
1052
|
createElementVNode("div", _hoisted_15, [
|
|
1050
|
-
createVNode(
|
|
1053
|
+
createVNode(p, {
|
|
1051
1054
|
inputmode: "decimal",
|
|
1052
1055
|
label: `Receive ${unref(l)}(s)`,
|
|
1053
1056
|
class: "flex-1",
|
|
1054
1057
|
"model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
|
|
1055
|
-
"onUpdate:modelValue":
|
|
1058
|
+
"onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
|
|
1056
1059
|
...e.modelValue ?? { type: "FIXED" },
|
|
1057
1060
|
amount: B
|
|
1058
1061
|
}))
|
|
1059
1062
|
}, null, 8, ["label", "model-value"]),
|
|
1060
1063
|
_hoisted_16,
|
|
1061
|
-
createVNode(
|
|
1064
|
+
createVNode(p, {
|
|
1062
1065
|
label: "Item purchased",
|
|
1063
1066
|
class: "flex-1",
|
|
1064
1067
|
"model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
|
|
1065
1068
|
inputmode: "numeric",
|
|
1066
1069
|
"max-fraction-digits": 0,
|
|
1067
|
-
"onUpdate:modelValue":
|
|
1070
|
+
"onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
|
|
1068
1071
|
...e.modelValue,
|
|
1069
1072
|
every: B
|
|
1070
1073
|
}))
|
|
@@ -1097,8 +1100,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1097
1100
|
}
|
|
1098
1101
|
},
|
|
1099
1102
|
emits: ["update:model-value"],
|
|
1100
|
-
setup(e, { emit:
|
|
1101
|
-
const n = e, r =
|
|
1103
|
+
setup(e, { emit: i }) {
|
|
1104
|
+
const n = e, r = i, o = computed(
|
|
1102
1105
|
() => [
|
|
1103
1106
|
{
|
|
1104
1107
|
label: "Fortune Wheel",
|
|
@@ -1152,27 +1155,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1152
1155
|
}
|
|
1153
1156
|
},
|
|
1154
1157
|
emits: ["update:model-value", "update:reward-image"],
|
|
1155
|
-
setup(e, { emit:
|
|
1158
|
+
setup(e, { emit: i }) {
|
|
1156
1159
|
const r = ref(
|
|
1157
1160
|
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
1158
1161
|
business: useCoreStore().currentBusiness.value._id,
|
|
1159
1162
|
name: ""
|
|
1160
1163
|
})
|
|
1161
|
-
), o = FdtoCollectibleConfig, s =
|
|
1164
|
+
), o = FdtoCollectibleConfig, s = i;
|
|
1162
1165
|
return (l, t) => {
|
|
1163
|
-
var m, g
|
|
1164
|
-
const a = resolveComponent("FmTextarea"),
|
|
1166
|
+
var v, m, g;
|
|
1167
|
+
const a = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText");
|
|
1165
1168
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1166
1169
|
createVNode(_sfc_main$u, {
|
|
1167
1170
|
modelValue: unref(r).name,
|
|
1168
|
-
"onUpdate:modelValue": t[0] || (t[0] = (
|
|
1171
|
+
"onUpdate:modelValue": t[0] || (t[0] = (c) => unref(r).name = c),
|
|
1169
1172
|
label: "Voucher name",
|
|
1170
1173
|
schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
|
|
1171
1174
|
}, null, 8, ["modelValue", "schema"]),
|
|
1172
1175
|
createVNode(a, {
|
|
1173
1176
|
class: "!mb-[-16px]",
|
|
1174
1177
|
modelValue: unref(r).description,
|
|
1175
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
1178
|
+
"onUpdate:modelValue": t[1] || (t[1] = (c) => unref(r).description = c),
|
|
1176
1179
|
rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
|
|
1177
1180
|
}, {
|
|
1178
1181
|
label: withCtx(() => [
|
|
@@ -1187,15 +1190,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1187
1190
|
}, 8, ["modelValue", "rules"]),
|
|
1188
1191
|
createElementVNode("div", _hoisted_1$c, [
|
|
1189
1192
|
_hoisted_2$b,
|
|
1190
|
-
createElementVNode("div", null, toDisplayString(((
|
|
1193
|
+
createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
|
|
1191
1194
|
]),
|
|
1192
1195
|
createVNode(_sfc_main$v, {
|
|
1193
1196
|
class: "w-1/2 xs:w-2/3",
|
|
1194
1197
|
"aspect-ratio": "16/9",
|
|
1195
1198
|
file: e.rewardImage ?? void 0,
|
|
1196
1199
|
thumbnail: unref(r).image ?? void 0,
|
|
1197
|
-
"onUpdate:file": t[2] || (t[2] = async (
|
|
1198
|
-
s("update:reward-image",
|
|
1200
|
+
"onUpdate:file": t[2] || (t[2] = async (c) => {
|
|
1201
|
+
s("update:reward-image", c), c || (unref(r).image = null);
|
|
1199
1202
|
})
|
|
1200
1203
|
}, {
|
|
1201
1204
|
label: withCtx(() => [
|
|
@@ -1211,9 +1214,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1211
1214
|
_hoisted_3$9,
|
|
1212
1215
|
createVNode(_sfc_main$w, {
|
|
1213
1216
|
"model-value": unref(r).extras.effect,
|
|
1214
|
-
"onUpdate:modelValue": t[3] || (t[3] = (
|
|
1217
|
+
"onUpdate:modelValue": t[3] || (t[3] = (c) => unref(r).extras.effect = c)
|
|
1215
1218
|
}, null, 8, ["model-value"]),
|
|
1216
|
-
unref(r).extras.effect == null ? (openBlock(), createBlock(
|
|
1219
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(f, {
|
|
1217
1220
|
key: 0,
|
|
1218
1221
|
class: "!mt-8",
|
|
1219
1222
|
text: "Effect is required",
|
|
@@ -1223,26 +1226,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1223
1226
|
createVNode(_sfc_main$x, {
|
|
1224
1227
|
"model-value": unref(r).options,
|
|
1225
1228
|
"no-campaign": unref(r).noCampaign,
|
|
1226
|
-
"onUpdate:modelValue": t[4] || (t[4] = (
|
|
1229
|
+
"onUpdate:modelValue": t[4] || (t[4] = (c) => unref(r).options = c),
|
|
1227
1230
|
schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
|
|
1228
1231
|
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1229
1232
|
_hoisted_5$4,
|
|
1230
1233
|
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1231
1234
|
key: 1,
|
|
1232
|
-
"model-value": ((
|
|
1235
|
+
"model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
|
|
1233
1236
|
type: "select",
|
|
1234
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
1235
|
-
unref(r).extras.targetLocation =
|
|
1237
|
+
"onUpdate:modelValue": t[5] || (t[5] = (c) => {
|
|
1238
|
+
unref(r).extras.targetLocation = c;
|
|
1236
1239
|
}),
|
|
1237
1240
|
rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
|
|
1238
|
-
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
|
|
1239
|
-
createVNode(v, {
|
|
1240
|
-
modelValue: unref(r).internal,
|
|
1241
|
-
"onUpdate:modelValue": t[6] || (t[6] = (i) => unref(r).internal = i),
|
|
1242
|
-
"label-placement": "right",
|
|
1243
|
-
label: "Internal only",
|
|
1244
|
-
sublabel: "Voucher will not be shown to customer"
|
|
1245
|
-
}, null, 8, ["modelValue"])
|
|
1241
|
+
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
|
|
1246
1242
|
], 64);
|
|
1247
1243
|
};
|
|
1248
1244
|
}
|
|
@@ -1252,29 +1248,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1252
1248
|
}, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1253
1249
|
__name: "EditRewardPoolSheet",
|
|
1254
1250
|
emits: ["update:model-value"],
|
|
1255
|
-
setup(e, { expose:
|
|
1256
|
-
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0),
|
|
1251
|
+
setup(e, { expose: i, emit: n }) {
|
|
1252
|
+
const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), f = computed(() => {
|
|
1257
1253
|
var u;
|
|
1258
1254
|
return ((u = r.loyaltyRewards.items.find(
|
|
1259
|
-
(
|
|
1260
|
-
var
|
|
1261
|
-
return
|
|
1255
|
+
(p) => {
|
|
1256
|
+
var y;
|
|
1257
|
+
return p.value === ((y = l.value) == null ? void 0 : y.collectible);
|
|
1262
1258
|
}
|
|
1263
1259
|
)) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1264
1260
|
}), v = computed(() => {
|
|
1265
|
-
const
|
|
1266
|
-
return
|
|
1261
|
+
const d = f.value.safeParse(l.value);
|
|
1262
|
+
return d.success ? [] : d.error.errors;
|
|
1267
1263
|
});
|
|
1268
|
-
function m(
|
|
1269
|
-
|
|
1264
|
+
function m(d, u, p) {
|
|
1265
|
+
d && (l.value = u, a.value = p), s.value = d;
|
|
1270
1266
|
}
|
|
1271
1267
|
const g = n;
|
|
1272
|
-
async function
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1268
|
+
async function c() {
|
|
1269
|
+
const d = f.value.safeParse(l.value);
|
|
1270
|
+
d.success && (await o(
|
|
1275
1271
|
async () => {
|
|
1276
|
-
|
|
1277
|
-
|
|
1272
|
+
d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1273
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
|
|
1278
1274
|
t.value
|
|
1279
1275
|
));
|
|
1280
1276
|
},
|
|
@@ -1282,12 +1278,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1282
1278
|
message: "Uploading reward image",
|
|
1283
1279
|
successMessage: "Reward image updated"
|
|
1284
1280
|
}
|
|
1285
|
-
), g("update:model-value",
|
|
1281
|
+
), g("update:model-value", d.data, a.value));
|
|
1286
1282
|
}
|
|
1287
|
-
return
|
|
1283
|
+
return i({
|
|
1288
1284
|
showSheet: m
|
|
1289
|
-
}), (
|
|
1290
|
-
const
|
|
1285
|
+
}), (d, u) => {
|
|
1286
|
+
const p = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1291
1287
|
return openBlock(), createBlock(C, {
|
|
1292
1288
|
"max-width": 560,
|
|
1293
1289
|
modelValue: unref(s),
|
|
@@ -1305,7 +1301,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1305
1301
|
type: "button",
|
|
1306
1302
|
disabled: unref(v).length > 0,
|
|
1307
1303
|
label: "Confirm",
|
|
1308
|
-
onClick: u[7] || (u[7] = (b) =>
|
|
1304
|
+
onClick: u[7] || (u[7] = (b) => c())
|
|
1309
1305
|
}, null, 8, ["disabled"]),
|
|
1310
1306
|
createVNode(k, {
|
|
1311
1307
|
variant: "secondary",
|
|
@@ -1319,7 +1315,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1319
1315
|
var b, x, E;
|
|
1320
1316
|
return [
|
|
1321
1317
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1322
|
-
createVNode(
|
|
1318
|
+
createVNode(p, {
|
|
1323
1319
|
label: "Reward Type",
|
|
1324
1320
|
items: [
|
|
1325
1321
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1360,17 +1356,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1360
1356
|
};
|
|
1361
1357
|
})
|
|
1362
1358
|
}, null, 8, ["model-value"]),
|
|
1363
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1359
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
|
|
1364
1360
|
key: 0,
|
|
1365
1361
|
label: "Loyalty type",
|
|
1366
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1362
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
|
|
1367
1363
|
items: unref(r).loyaltyRewards.items,
|
|
1368
1364
|
"model-value": unref(l).collectible,
|
|
1369
1365
|
"onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
|
|
1370
1366
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1371
|
-
createVNode(
|
|
1367
|
+
createVNode(y, {
|
|
1372
1368
|
label: "Weight",
|
|
1373
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1369
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "weight", [unref(l).type])],
|
|
1374
1370
|
"model-value": unref(l).weight,
|
|
1375
1371
|
"onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
|
|
1376
1372
|
...unref(l),
|
|
@@ -1388,7 +1384,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1388
1384
|
createVNode(_sfc_main$e, {
|
|
1389
1385
|
class: "mt-[-8px]",
|
|
1390
1386
|
rules: [
|
|
1391
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1387
|
+
unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])
|
|
1392
1388
|
],
|
|
1393
1389
|
"helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
|
|
1394
1390
|
"error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
|
|
@@ -1409,7 +1405,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
1409
1405
|
}
|
|
1410
1406
|
)) == null ? void 0 : x.raw.type) === "CREDIT",
|
|
1411
1407
|
class: "!gap-24",
|
|
1412
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1408
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
|
|
1413
1409
|
"model-value": unref(l).validityOption,
|
|
1414
1410
|
"onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
|
|
1415
1411
|
...unref(l),
|
|
@@ -1454,37 +1450,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1454
1450
|
}
|
|
1455
1451
|
},
|
|
1456
1452
|
emits: ["update:model-value"],
|
|
1457
|
-
setup(e, { emit:
|
|
1458
|
-
const n = e, r =
|
|
1459
|
-
const
|
|
1460
|
-
return
|
|
1453
|
+
setup(e, { emit: i }) {
|
|
1454
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
|
|
1455
|
+
const d = s.safeParse(l.value);
|
|
1456
|
+
return d.success ? [] : d.error.errors;
|
|
1461
1457
|
}), a = ref();
|
|
1462
|
-
function
|
|
1463
|
-
var
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1458
|
+
function f(d, u) {
|
|
1459
|
+
var y;
|
|
1460
|
+
const p = [...l.value];
|
|
1461
|
+
p[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", p);
|
|
1466
1462
|
}
|
|
1467
|
-
function v(
|
|
1468
|
-
const u =
|
|
1469
|
-
(k) => k._id.toString() ==
|
|
1470
|
-
),
|
|
1463
|
+
function v(d) {
|
|
1464
|
+
const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
|
|
1465
|
+
(k) => k._id.toString() == d.collectible
|
|
1466
|
+
), p = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
|
|
1471
1467
|
return {
|
|
1472
|
-
label: isNullOrEmpty(
|
|
1473
|
-
sublabel: `${
|
|
1468
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
1469
|
+
sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
|
|
1474
1470
|
};
|
|
1475
1471
|
}
|
|
1476
|
-
function m(
|
|
1477
|
-
var
|
|
1472
|
+
function m(d) {
|
|
1473
|
+
var p;
|
|
1478
1474
|
const u = [...l.value];
|
|
1479
|
-
(
|
|
1475
|
+
(p = a.value) == null || p.showSheet(!0, u[d], d);
|
|
1480
1476
|
}
|
|
1481
|
-
function g(
|
|
1477
|
+
function g(d) {
|
|
1482
1478
|
const u = [...l.value];
|
|
1483
|
-
u.splice(
|
|
1479
|
+
u.splice(d, 1), r("update:model-value", u);
|
|
1484
1480
|
}
|
|
1485
|
-
function
|
|
1486
|
-
var
|
|
1487
|
-
(
|
|
1481
|
+
function c() {
|
|
1482
|
+
var d;
|
|
1483
|
+
(d = a.value) == null || d.showSheet(
|
|
1488
1484
|
!0,
|
|
1489
1485
|
{
|
|
1490
1486
|
type: "NO_REWARD",
|
|
@@ -1494,17 +1490,17 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1494
1490
|
l.value.length
|
|
1495
1491
|
);
|
|
1496
1492
|
}
|
|
1497
|
-
return (
|
|
1498
|
-
const
|
|
1493
|
+
return (d, u) => {
|
|
1494
|
+
const p = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1499
1495
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1500
1496
|
_hoisted_2$9,
|
|
1501
|
-
createVNode(
|
|
1497
|
+
createVNode(p, {
|
|
1502
1498
|
label: "Add Reward",
|
|
1503
|
-
onClick: u[0] || (u[0] = (C) =>
|
|
1499
|
+
onClick: u[0] || (u[0] = (C) => c()),
|
|
1504
1500
|
variant: "plain",
|
|
1505
1501
|
icon: "add"
|
|
1506
1502
|
}),
|
|
1507
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(
|
|
1503
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
|
|
1508
1504
|
key: b,
|
|
1509
1505
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1510
1506
|
variant: "outlined",
|
|
@@ -1515,7 +1511,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1515
1511
|
createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
|
|
1516
1512
|
createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
|
|
1517
1513
|
]),
|
|
1518
|
-
createVNode(
|
|
1514
|
+
createVNode(p, {
|
|
1519
1515
|
icon: "delete",
|
|
1520
1516
|
variant: "tertiary",
|
|
1521
1517
|
onClick: (x) => (x.stopPropagation(), g(b))
|
|
@@ -1531,7 +1527,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1531
1527
|
createVNode(_sfc_main$b, {
|
|
1532
1528
|
ref_key: "sheetRef",
|
|
1533
1529
|
ref: a,
|
|
1534
|
-
"onUpdate:modelValue":
|
|
1530
|
+
"onUpdate:modelValue": f
|
|
1535
1531
|
}, null, 512)
|
|
1536
1532
|
]);
|
|
1537
1533
|
};
|
|
@@ -1547,8 +1543,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1547
1543
|
}
|
|
1548
1544
|
},
|
|
1549
1545
|
emits: ["update:model-value"],
|
|
1550
|
-
setup(e, { emit:
|
|
1551
|
-
const n = e, r =
|
|
1546
|
+
setup(e, { emit: i }) {
|
|
1547
|
+
const n = e, r = i, o = computed(() => [
|
|
1552
1548
|
{
|
|
1553
1549
|
label: "Rock paper scissor",
|
|
1554
1550
|
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
@@ -1557,38 +1553,38 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1557
1553
|
]);
|
|
1558
1554
|
return (s, l) => {
|
|
1559
1555
|
var v, m, g;
|
|
1560
|
-
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"),
|
|
1556
|
+
const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
|
|
1561
1557
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1562
1558
|
createVNode(t, {
|
|
1563
1559
|
label: "Enable game",
|
|
1564
1560
|
"model-value": !!((v = e.modelValue) != null && v.gameType),
|
|
1565
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
1561
|
+
"onUpdate:modelValue": l[0] || (l[0] = (c) => c ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1566
1562
|
}, null, 8, ["model-value"]),
|
|
1567
1563
|
((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1568
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (
|
|
1569
|
-
var
|
|
1564
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (c) => {
|
|
1565
|
+
var d, u;
|
|
1570
1566
|
return openBlock(), createBlock(a, {
|
|
1571
1567
|
variant: "outlined",
|
|
1572
1568
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1573
1569
|
"col-span-2": unref(o).length == 1,
|
|
1574
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
1575
|
-
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) !=
|
|
1570
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == c.value,
|
|
1571
|
+
"hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != c.value
|
|
1576
1572
|
}]),
|
|
1577
1573
|
onClick: () => {
|
|
1578
|
-
var
|
|
1579
|
-
((
|
|
1574
|
+
var p;
|
|
1575
|
+
((p = n.modelValue) == null ? void 0 : p.gameType) != c.value && r("update:model-value", { gameType: c.value });
|
|
1580
1576
|
},
|
|
1581
|
-
key:
|
|
1577
|
+
key: c.value
|
|
1582
1578
|
}, {
|
|
1583
1579
|
default: withCtx(() => [
|
|
1584
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
1585
|
-
createElementVNode("div", _hoisted_4$5, toDisplayString(
|
|
1580
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(c.label), 1),
|
|
1581
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(c.description), 1)
|
|
1586
1582
|
]),
|
|
1587
1583
|
_: 2
|
|
1588
1584
|
}, 1032, ["class", "onClick"]);
|
|
1589
1585
|
}), 128))
|
|
1590
1586
|
])) : createCommentVNode("", !0),
|
|
1591
|
-
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
1587
|
+
((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
|
|
1592
1588
|
key: 1,
|
|
1593
1589
|
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)",
|
|
1594
1590
|
state: "warning"
|
|
@@ -1604,8 +1600,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1604
1600
|
}
|
|
1605
1601
|
},
|
|
1606
1602
|
emits: ["update:model-value"],
|
|
1607
|
-
setup(e, { emit:
|
|
1608
|
-
const n = e, r =
|
|
1603
|
+
setup(e, { emit: i }) {
|
|
1604
|
+
const n = e, r = i, o = computed(() => [
|
|
1609
1605
|
{
|
|
1610
1606
|
label: "Stamp",
|
|
1611
1607
|
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
@@ -1658,8 +1654,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1658
1654
|
}
|
|
1659
1655
|
},
|
|
1660
1656
|
emits: ["update:model-value"],
|
|
1661
|
-
setup(e, { emit:
|
|
1662
|
-
const n =
|
|
1657
|
+
setup(e, { emit: i }) {
|
|
1658
|
+
const n = i;
|
|
1663
1659
|
return (r, o) => {
|
|
1664
1660
|
const s = resolveComponent("FmStepperField");
|
|
1665
1661
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
@@ -1683,22 +1679,22 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1683
1679
|
}
|
|
1684
1680
|
},
|
|
1685
1681
|
emits: ["update:model-value"],
|
|
1686
|
-
setup(e, { expose:
|
|
1687
|
-
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(),
|
|
1688
|
-
const
|
|
1689
|
-
return
|
|
1682
|
+
setup(e, { expose: i, emit: n }) {
|
|
1683
|
+
const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), f = ref(0), v = FdtoThresholdReward, m = computed(() => {
|
|
1684
|
+
const p = v.safeParse(t.value);
|
|
1685
|
+
return p.success ? [] : p.error.errors;
|
|
1690
1686
|
});
|
|
1691
|
-
function g(
|
|
1692
|
-
|
|
1687
|
+
function g(p, y, k) {
|
|
1688
|
+
p && (t.value = y, f.value = k), l.value = p;
|
|
1693
1689
|
}
|
|
1694
|
-
const
|
|
1695
|
-
async function
|
|
1690
|
+
const c = n;
|
|
1691
|
+
async function d() {
|
|
1696
1692
|
console.log(t.value);
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1693
|
+
const p = v.safeParse(t.value);
|
|
1694
|
+
p.success && (await s(
|
|
1699
1695
|
async () => {
|
|
1700
|
-
|
|
1701
|
-
|
|
1696
|
+
p.data.type === "VOUCHER" && a.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1697
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
|
|
1702
1698
|
a.value
|
|
1703
1699
|
));
|
|
1704
1700
|
},
|
|
@@ -1706,19 +1702,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1706
1702
|
message: "Uploading reward image",
|
|
1707
1703
|
successMessage: "Reward image updated"
|
|
1708
1704
|
}
|
|
1709
|
-
),
|
|
1705
|
+
), c("update:model-value", p.data, f.value));
|
|
1710
1706
|
}
|
|
1711
1707
|
const u = ref();
|
|
1712
|
-
return
|
|
1708
|
+
return i({
|
|
1713
1709
|
showSheet: g
|
|
1714
|
-
}), (
|
|
1710
|
+
}), (p, y) => {
|
|
1715
1711
|
const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
|
|
1716
1712
|
return openBlock(), createBlock(E, {
|
|
1717
1713
|
"max-width": 560,
|
|
1718
1714
|
modelValue: unref(l),
|
|
1719
1715
|
"onUpdate:modelValue": [
|
|
1720
|
-
|
|
1721
|
-
|
|
1716
|
+
y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
|
|
1717
|
+
y[11] || (y[11] = (V) => l.value = V)
|
|
1722
1718
|
],
|
|
1723
1719
|
header: "Edit reward",
|
|
1724
1720
|
"dismiss-away": ""
|
|
@@ -1729,7 +1725,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1729
1725
|
variant: "primary",
|
|
1730
1726
|
type: "button",
|
|
1731
1727
|
label: "Confirm",
|
|
1732
|
-
onClick:
|
|
1728
|
+
onClick: y[8] || (y[8] = async () => {
|
|
1733
1729
|
var V;
|
|
1734
1730
|
return (V = unref(u)) == null ? void 0 : V.validateInputs();
|
|
1735
1731
|
})
|
|
@@ -1738,7 +1734,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1738
1734
|
variant: "secondary",
|
|
1739
1735
|
type: "button",
|
|
1740
1736
|
label: "Cancel",
|
|
1741
|
-
onClick:
|
|
1737
|
+
onClick: y[9] || (y[9] = (V) => l.value = !1)
|
|
1742
1738
|
})
|
|
1743
1739
|
])
|
|
1744
1740
|
]),
|
|
@@ -1748,7 +1744,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1748
1744
|
class: "flex flex-col gap-y-24",
|
|
1749
1745
|
ref_key: "formRef",
|
|
1750
1746
|
ref: u,
|
|
1751
|
-
onValidationSuccess:
|
|
1747
|
+
onValidationSuccess: y[7] || (y[7] = (V) => d())
|
|
1752
1748
|
}, {
|
|
1753
1749
|
default: withCtx(() => {
|
|
1754
1750
|
var V, N;
|
|
@@ -1765,7 +1761,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1765
1761
|
)
|
|
1766
1762
|
],
|
|
1767
1763
|
"model-value": unref(t).threshold,
|
|
1768
|
-
"onUpdate:modelValue":
|
|
1764
|
+
"onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
|
|
1769
1765
|
...unref(t),
|
|
1770
1766
|
threshold: h
|
|
1771
1767
|
})
|
|
@@ -1777,7 +1773,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1777
1773
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1778
1774
|
],
|
|
1779
1775
|
"model-value": unref(t).type,
|
|
1780
|
-
"onUpdate:modelValue":
|
|
1776
|
+
"onUpdate:modelValue": y[1] || (y[1] = (h) => {
|
|
1781
1777
|
var R, B;
|
|
1782
1778
|
h === "VOUCHER" ? t.value = {
|
|
1783
1779
|
collectible: null,
|
|
@@ -1813,7 +1809,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1813
1809
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
|
|
1814
1810
|
items: unref(o).loyaltyRewards.items,
|
|
1815
1811
|
"model-value": unref(t).collectible,
|
|
1816
|
-
"onUpdate:modelValue":
|
|
1812
|
+
"onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
|
|
1817
1813
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1818
1814
|
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1819
1815
|
_hoisted_1$6,
|
|
@@ -1824,7 +1820,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1824
1820
|
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1825
1821
|
"fixed-type": !0,
|
|
1826
1822
|
"model-value": unref(t).earningOption,
|
|
1827
|
-
"onUpdate:modelValue":
|
|
1823
|
+
"onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
|
|
1828
1824
|
...unref(t),
|
|
1829
1825
|
earningOption: h
|
|
1830
1826
|
})
|
|
@@ -1839,7 +1835,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1839
1835
|
)) == null ? void 0 : V.raw.type) === "CREDIT",
|
|
1840
1836
|
rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
|
|
1841
1837
|
"model-value": unref(t).validityOption,
|
|
1842
|
-
"onUpdate:modelValue":
|
|
1838
|
+
"onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
|
|
1843
1839
|
...unref(t),
|
|
1844
1840
|
validityOption: h
|
|
1845
1841
|
})
|
|
@@ -1849,11 +1845,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1849
1845
|
key: 3,
|
|
1850
1846
|
"reward-image": unref(a),
|
|
1851
1847
|
"model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1852
|
-
"onUpdate:modelValue":
|
|
1848
|
+
"onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
|
|
1853
1849
|
...unref(t),
|
|
1854
1850
|
collectibleConfig: h
|
|
1855
1851
|
}),
|
|
1856
|
-
"onUpdate:rewardImage":
|
|
1852
|
+
"onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
|
|
1857
1853
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1858
1854
|
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1859
1855
|
];
|
|
@@ -1889,13 +1885,13 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1889
1885
|
}
|
|
1890
1886
|
},
|
|
1891
1887
|
setup(e) {
|
|
1892
|
-
const
|
|
1888
|
+
const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
|
|
1893
1889
|
() => Math.min(r.value / n.value * 100, 100)
|
|
1894
1890
|
), l = (t) => t / n.value * 100;
|
|
1895
1891
|
return (t, a) => {
|
|
1896
|
-
const
|
|
1892
|
+
const f = resolveComponent("FmIcon");
|
|
1897
1893
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1898
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(
|
|
1894
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(f, {
|
|
1899
1895
|
class: normalizeClass(
|
|
1900
1896
|
unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1901
1897
|
),
|
|
@@ -1928,15 +1924,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
|
|
|
1928
1924
|
}
|
|
1929
1925
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1930
1926
|
function changeKeysFactory(e) {
|
|
1931
|
-
return function
|
|
1927
|
+
return function i(n, r = 1, o) {
|
|
1932
1928
|
if (r === 0 || !isObject(n))
|
|
1933
1929
|
return n;
|
|
1934
1930
|
if (Array.isArray(n))
|
|
1935
|
-
return n.map((l) =>
|
|
1931
|
+
return n.map((l) => i(l, r - 1, o));
|
|
1936
1932
|
const s = Object.create(Object.getPrototypeOf(n));
|
|
1937
1933
|
return Object.keys(n).forEach((l) => {
|
|
1938
|
-
const t = n[l], a = e(l, o),
|
|
1939
|
-
s[a] =
|
|
1934
|
+
const t = n[l], a = e(l, o), f = i(t, r - 1, o);
|
|
1935
|
+
s[a] = f;
|
|
1940
1936
|
}), s;
|
|
1941
1937
|
};
|
|
1942
1938
|
}
|
|
@@ -1953,37 +1949,37 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
1953
1949
|
}
|
|
1954
1950
|
},
|
|
1955
1951
|
emits: ["update:model-value"],
|
|
1956
|
-
setup(e, { emit:
|
|
1957
|
-
const n = e, r =
|
|
1958
|
-
() => n.modelValue.sort((u,
|
|
1952
|
+
setup(e, { emit: i }) {
|
|
1953
|
+
const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1954
|
+
() => n.modelValue.sort((u, p) => u.threshold - p.threshold) ?? []
|
|
1959
1955
|
), t = computed(() => {
|
|
1960
1956
|
const u = s.safeParse(l.value);
|
|
1961
1957
|
return u.success ? [] : u.error.errors;
|
|
1962
1958
|
}), a = ref();
|
|
1963
|
-
function
|
|
1959
|
+
function f(u, p) {
|
|
1964
1960
|
var k;
|
|
1965
|
-
const
|
|
1966
|
-
|
|
1961
|
+
const y = [...l.value];
|
|
1962
|
+
y[p] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
|
|
1967
1963
|
}
|
|
1968
1964
|
function v(u) {
|
|
1969
|
-
const
|
|
1965
|
+
const p = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
|
|
1970
1966
|
(k) => k._id.toString() == u.collectible
|
|
1971
|
-
),
|
|
1967
|
+
), y = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
|
|
1972
1968
|
return {
|
|
1973
|
-
label: isNullOrEmpty(
|
|
1969
|
+
label: isNullOrEmpty(y) ? "NO REWARD" : y,
|
|
1974
1970
|
sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
|
|
1975
1971
|
};
|
|
1976
1972
|
}
|
|
1977
1973
|
function m(u) {
|
|
1978
|
-
var
|
|
1979
|
-
const
|
|
1980
|
-
(
|
|
1974
|
+
var y;
|
|
1975
|
+
const p = [...l.value];
|
|
1976
|
+
(y = a.value) == null || y.showSheet(!0, p[u], u);
|
|
1981
1977
|
}
|
|
1982
1978
|
function g(u) {
|
|
1983
|
-
const
|
|
1984
|
-
|
|
1979
|
+
const p = [...l.value];
|
|
1980
|
+
p.splice(u, 1), r("update:model-value", p);
|
|
1985
1981
|
}
|
|
1986
|
-
function
|
|
1982
|
+
function c() {
|
|
1987
1983
|
var u;
|
|
1988
1984
|
(u = a.value) == null || u.showSheet(
|
|
1989
1985
|
!0,
|
|
@@ -2002,21 +1998,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2002
1998
|
l.value.length
|
|
2003
1999
|
);
|
|
2004
2000
|
}
|
|
2005
|
-
function
|
|
2006
|
-
var
|
|
2007
|
-
return u.type == "VOUCHER" ? (
|
|
2008
|
-
((
|
|
2001
|
+
function d(u) {
|
|
2002
|
+
var p, y;
|
|
2003
|
+
return u.type == "VOUCHER" ? (p = u.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
|
|
2004
|
+
((y = o.loyaltyRewards.items.find(
|
|
2009
2005
|
(k) => k.value == u.collectible
|
|
2010
|
-
)) == null ? void 0 :
|
|
2006
|
+
)) == null ? void 0 : y.label) || ""
|
|
2011
2007
|
);
|
|
2012
2008
|
}
|
|
2013
|
-
return (u,
|
|
2014
|
-
const
|
|
2009
|
+
return (u, p) => {
|
|
2010
|
+
const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2015
2011
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2016
2012
|
_hoisted_2$3,
|
|
2017
|
-
createVNode(
|
|
2013
|
+
createVNode(y, {
|
|
2018
2014
|
label: "Add Reward",
|
|
2019
|
-
onClick:
|
|
2015
|
+
onClick: p[0] || (p[0] = (b) => c()),
|
|
2020
2016
|
variant: "plain",
|
|
2021
2017
|
icon: "add"
|
|
2022
2018
|
}),
|
|
@@ -2031,7 +2027,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2031
2027
|
createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
|
|
2032
2028
|
createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
|
|
2033
2029
|
]),
|
|
2034
|
-
createVNode(
|
|
2030
|
+
createVNode(y, {
|
|
2035
2031
|
icon: "delete",
|
|
2036
2032
|
variant: "tertiary",
|
|
2037
2033
|
onClick: (E) => (E.stopPropagation(), g(x))
|
|
@@ -2052,7 +2048,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2052
2048
|
default: withCtx(() => [
|
|
2053
2049
|
createElementVNode("div", _hoisted_6$2, [
|
|
2054
2050
|
createElementVNode("div", null, [
|
|
2055
|
-
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(
|
|
2051
|
+
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(d(e.modelValue[e.modelValue.length - 1])), 1),
|
|
2056
2052
|
_hoisted_8$2
|
|
2057
2053
|
])
|
|
2058
2054
|
]),
|
|
@@ -2071,7 +2067,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2071
2067
|
createVNode(_sfc_main$6, {
|
|
2072
2068
|
ref_key: "sheetRef",
|
|
2073
2069
|
ref: a,
|
|
2074
|
-
"onUpdate:modelValue":
|
|
2070
|
+
"onUpdate:modelValue": f,
|
|
2075
2071
|
"max-threshold": e.mission.end
|
|
2076
2072
|
}, null, 8, ["max-threshold"])
|
|
2077
2073
|
]);
|
|
@@ -2083,7 +2079,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2083
2079
|
modelValue: Object
|
|
2084
2080
|
},
|
|
2085
2081
|
emits: ["update:model-value"],
|
|
2086
|
-
setup(e, { emit:
|
|
2082
|
+
setup(e, { emit: i }) {
|
|
2087
2083
|
const n = e, r = computed(() => {
|
|
2088
2084
|
const l = FdoMission.safeParse(n.modelValue);
|
|
2089
2085
|
return l.success ? [] : l.error.errors;
|
|
@@ -2098,27 +2094,27 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2098
2094
|
description: "Reward customers when they reach a cumulative spending goal.",
|
|
2099
2095
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2100
2096
|
}
|
|
2101
|
-
]), s =
|
|
2097
|
+
]), s = i;
|
|
2102
2098
|
return (l, t) => {
|
|
2103
2099
|
var v;
|
|
2104
|
-
const a = resolveComponent("FmCard"),
|
|
2100
|
+
const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
|
|
2105
2101
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2106
2102
|
createElementVNode("div", _hoisted_2$2, [
|
|
2107
2103
|
_hoisted_3$2,
|
|
2108
2104
|
_hoisted_4$2,
|
|
2109
2105
|
createElementVNode("div", _hoisted_5$1, [
|
|
2110
2106
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
|
|
2111
|
-
var g,
|
|
2107
|
+
var g, c;
|
|
2112
2108
|
return openBlock(), createBlock(a, {
|
|
2113
2109
|
variant: "outlined",
|
|
2114
2110
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2115
2111
|
"col-span-2": unref(o).length == 1,
|
|
2116
2112
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == m.value,
|
|
2117
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2113
|
+
"hover:bg-fm-color-opacity-sm": ((c = e.modelValue) == null ? void 0 : c.type) != m.value
|
|
2118
2114
|
}]),
|
|
2119
2115
|
onClick: () => {
|
|
2120
|
-
var
|
|
2121
|
-
((
|
|
2116
|
+
var d, u;
|
|
2117
|
+
((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
|
|
2122
2118
|
...e.modelValue,
|
|
2123
2119
|
type: m.value,
|
|
2124
2120
|
end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
|
|
@@ -2138,7 +2134,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2138
2134
|
createElementVNode("div", _hoisted_8$1, [
|
|
2139
2135
|
_hoisted_9$1,
|
|
2140
2136
|
_hoisted_10$1,
|
|
2141
|
-
createVNode(
|
|
2137
|
+
createVNode(f, {
|
|
2142
2138
|
label: "Maximum to collect",
|
|
2143
2139
|
"model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
|
|
2144
2140
|
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
@@ -2178,16 +2174,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2178
2174
|
}
|
|
2179
2175
|
},
|
|
2180
2176
|
emits: ["update:model-value", "update:file"],
|
|
2181
|
-
setup(e, { emit:
|
|
2182
|
-
const n = e, r =
|
|
2177
|
+
setup(e, { emit: i }) {
|
|
2178
|
+
const n = e, r = i;
|
|
2183
2179
|
function o(a) {
|
|
2184
2180
|
switch (n.field.type) {
|
|
2185
2181
|
case "timeframe":
|
|
2186
|
-
const
|
|
2182
|
+
const f = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
|
|
2187
2183
|
r("update:model-value", {
|
|
2188
2184
|
type: "timeframe",
|
|
2189
2185
|
property: "__now",
|
|
2190
|
-
start:
|
|
2186
|
+
start: f,
|
|
2191
2187
|
end: v
|
|
2192
2188
|
});
|
|
2193
2189
|
break;
|
|
@@ -2229,9 +2225,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2229
2225
|
labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
|
|
2230
2226
|
zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
|
|
2231
2227
|
}));
|
|
2232
|
-
return (a,
|
|
2233
|
-
var u,
|
|
2234
|
-
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"),
|
|
2228
|
+
return (a, f) => {
|
|
2229
|
+
var u, p, y, k, C;
|
|
2230
|
+
const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2235
2231
|
return e.field.type === "text" ? (openBlock(), createBlock(v, {
|
|
2236
2232
|
key: 0,
|
|
2237
2233
|
label: e.field.label,
|
|
@@ -2260,7 +2256,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2260
2256
|
"model-value": unref(s),
|
|
2261
2257
|
"onUpdate:modelValue": o,
|
|
2262
2258
|
"show-word-count": "",
|
|
2263
|
-
"max-length": (C = (k = (
|
|
2259
|
+
"max-length": (C = (k = (y = (p = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : p._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
|
|
2264
2260
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2265
2261
|
key: 3,
|
|
2266
2262
|
"campaign-type": e.extras,
|
|
@@ -2272,7 +2268,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2272
2268
|
"model-value": unref(s),
|
|
2273
2269
|
"onUpdate:modelValue": o
|
|
2274
2270
|
}, null, 8, ["model-value"]),
|
|
2275
|
-
createVNode(
|
|
2271
|
+
createVNode(c, {
|
|
2276
2272
|
class: "!mt-[8px]",
|
|
2277
2273
|
text: unref(ZodHelper).helperText(l(), ""),
|
|
2278
2274
|
state: unref(ZodHelper).helperState(l(), "")
|
|
@@ -2288,7 +2284,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2288
2284
|
(openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
|
|
2289
2285
|
]),
|
|
2290
2286
|
_: 1
|
|
2291
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2287
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2292
2288
|
key: 6,
|
|
2293
2289
|
label: e.field.label,
|
|
2294
2290
|
"label-placement": "right",
|
|
@@ -2314,7 +2310,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2314
2310
|
"onUpdate:modelValue": o,
|
|
2315
2311
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2316
2312
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2317
|
-
unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
2313
|
+
unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
|
|
2318
2314
|
key: 0,
|
|
2319
2315
|
class: "!mt-[8px]",
|
|
2320
2316
|
text: "Effect is required",
|
|
@@ -2373,7 +2369,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2373
2369
|
"start-date": e.extras.start,
|
|
2374
2370
|
"end-date": e.extras.end
|
|
2375
2371
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2376
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2372
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2377
2373
|
key: 0,
|
|
2378
2374
|
class: "!mt-[8px]",
|
|
2379
2375
|
text: e.helperText,
|
|
@@ -2384,14 +2380,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2384
2380
|
"model-value": unref(s),
|
|
2385
2381
|
"onUpdate:modelValue": o
|
|
2386
2382
|
}, null, 8, ["model-value"]),
|
|
2387
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2383
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2388
2384
|
key: 0,
|
|
2389
2385
|
class: "!mt-[8px]",
|
|
2390
2386
|
text: e.helperText,
|
|
2391
2387
|
state: "error"
|
|
2392
2388
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2393
2389
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2394
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
2390
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
|
|
2395
2391
|
key: 0,
|
|
2396
2392
|
state: "warning",
|
|
2397
2393
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -2400,7 +2396,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2400
2396
|
"model-value": unref(s),
|
|
2401
2397
|
"onUpdate:modelValue": o
|
|
2402
2398
|
}, null, 8, ["model-value"]),
|
|
2403
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2399
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2404
2400
|
key: 1,
|
|
2405
2401
|
class: "!mt-[8px]",
|
|
2406
2402
|
text: e.helperText,
|
|
@@ -2411,7 +2407,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2411
2407
|
"model-value": unref(s),
|
|
2412
2408
|
"onUpdate:modelValue": o
|
|
2413
2409
|
}, null, 8, ["model-value"]),
|
|
2414
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2410
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2415
2411
|
key: 0,
|
|
2416
2412
|
class: "!mt-[8px]",
|
|
2417
2413
|
text: e.helperText,
|
|
@@ -2422,7 +2418,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2422
2418
|
"model-value": unref(s),
|
|
2423
2419
|
"onUpdate:modelValue": o
|
|
2424
2420
|
}, null, 8, ["model-value"]),
|
|
2425
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2421
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2426
2422
|
key: 0,
|
|
2427
2423
|
class: "!mt-[8px]",
|
|
2428
2424
|
text: e.helperText,
|
|
@@ -2433,7 +2429,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2433
2429
|
"model-value": unref(s),
|
|
2434
2430
|
"onUpdate:modelValue": o
|
|
2435
2431
|
}, null, 8, ["model-value"]),
|
|
2436
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2432
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2437
2433
|
key: 0,
|
|
2438
2434
|
class: "!mt-[8px]",
|
|
2439
2435
|
text: e.helperText,
|
|
@@ -2444,7 +2440,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2444
2440
|
"model-value": unref(s),
|
|
2445
2441
|
"onUpdate:modelValue": o
|
|
2446
2442
|
}, null, 8, ["model-value"]),
|
|
2447
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2443
|
+
e.helperText ? (openBlock(), createBlock(c, {
|
|
2448
2444
|
key: 0,
|
|
2449
2445
|
class: "!mt-[8px]",
|
|
2450
2446
|
text: e.helperText,
|
|
@@ -2462,7 +2458,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2462
2458
|
}
|
|
2463
2459
|
},
|
|
2464
2460
|
setup(e) {
|
|
2465
|
-
return (
|
|
2461
|
+
return (i, n) => {
|
|
2466
2462
|
const r = resolveComponent("FmCard");
|
|
2467
2463
|
return openBlock(), createBlock(r, {
|
|
2468
2464
|
variant: "outlined",
|
|
@@ -2517,7 +2513,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2517
2513
|
TEMPLATES.VOUCHER
|
|
2518
2514
|
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
2519
2515
|
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2520
|
-
var e,
|
|
2516
|
+
var e, i;
|
|
2521
2517
|
if (sheetVisible.value = visible, visible == !0) {
|
|
2522
2518
|
try {
|
|
2523
2519
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
@@ -2526,7 +2522,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2526
2522
|
await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
|
|
2527
2523
|
}
|
|
2528
2524
|
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2529
|
-
...(
|
|
2525
|
+
...(i = template.value) == null ? void 0 : i.defaultValue
|
|
2530
2526
|
}), "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`;
|
|
2531
2527
|
}
|
|
2532
2528
|
}
|
|
@@ -2547,10 +2543,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2547
2543
|
return e.success ? [] : e.error.errors;
|
|
2548
2544
|
});
|
|
2549
2545
|
function stepErrors(e = currentStep.value - 1) {
|
|
2550
|
-
const
|
|
2546
|
+
const i = template.value.steps[e].groups.flatMap(
|
|
2551
2547
|
(n) => n.fields.map((r) => r.property)
|
|
2552
2548
|
);
|
|
2553
|
-
return errors.value.filter((n) =>
|
|
2549
|
+
return errors.value.filter((n) => i.includes(n.path.join(".")));
|
|
2554
2550
|
}
|
|
2555
2551
|
__expose({ showSheet });
|
|
2556
2552
|
function showSummaryDialog() {
|
|
@@ -2562,8 +2558,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2562
2558
|
}
|
|
2563
2559
|
});
|
|
2564
2560
|
}
|
|
2565
|
-
function onUpdateProperty(e,
|
|
2566
|
-
if (_.set(data.value, e,
|
|
2561
|
+
function onUpdateProperty(e, i) {
|
|
2562
|
+
if (_.set(data.value, e, i), e == "campaign.event.type") {
|
|
2567
2563
|
const n = RuleBuilder.setRuleToGroup(
|
|
2568
2564
|
RuleBuilder.scaffoldGroup(),
|
|
2569
2565
|
[
|
|
@@ -2584,7 +2580,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2584
2580
|
],
|
|
2585
2581
|
"&&"
|
|
2586
2582
|
);
|
|
2587
|
-
if (
|
|
2583
|
+
if (i != "SCHEDULE") {
|
|
2588
2584
|
_.set(data.value, "campaign.event.rule", n);
|
|
2589
2585
|
return;
|
|
2590
2586
|
}
|
|
@@ -2594,19 +2590,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2594
2590
|
RuleBuilder.setRuleToGroup(n, r)
|
|
2595
2591
|
);
|
|
2596
2592
|
}
|
|
2597
|
-
e == "campaign.notify" &&
|
|
2593
|
+
e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
2598
2594
|
}
|
|
2599
|
-
async function onUpdateFile(e,
|
|
2600
|
-
return e ? await minor(async () => firebaseStorage.update(
|
|
2595
|
+
async function onUpdateFile(e, i) {
|
|
2596
|
+
return e ? await minor(async () => firebaseStorage.update(i, e), {
|
|
2601
2597
|
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2602
2598
|
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2603
2599
|
}) : "";
|
|
2604
2600
|
}
|
|
2605
2601
|
function isDisable(e) {
|
|
2606
|
-
var
|
|
2602
|
+
var i, n;
|
|
2607
2603
|
switch (e == null ? void 0 : e.property) {
|
|
2608
2604
|
case "campaign.event.type":
|
|
2609
|
-
return ((n = (
|
|
2605
|
+
return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
|
|
2610
2606
|
default:
|
|
2611
2607
|
return !1;
|
|
2612
2608
|
}
|
|
@@ -2615,14 +2611,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2615
2611
|
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2616
2612
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2617
2613
|
}
|
|
2618
|
-
return (e,
|
|
2614
|
+
return (e, i) => {
|
|
2619
2615
|
const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2620
2616
|
return openBlock(), createBlock(l, {
|
|
2621
2617
|
"fullscreen-size": "lg",
|
|
2622
2618
|
modelValue: unref(sheetVisible),
|
|
2623
2619
|
"onUpdate:modelValue": [
|
|
2624
|
-
|
|
2625
|
-
|
|
2620
|
+
i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
|
|
2621
|
+
i[8] || (i[8] = (t) => sheetVisible.value = t)
|
|
2626
2622
|
]
|
|
2627
2623
|
}, createSlots({
|
|
2628
2624
|
"top-sheet-header": withCtx(() => [
|
|
@@ -2630,7 +2626,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2630
2626
|
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2631
2627
|
createElementVNode("div", _hoisted_2, [
|
|
2632
2628
|
createVNode(n, {
|
|
2633
|
-
onClick:
|
|
2629
|
+
onClick: i[0] || (i[0] = (t) => hideSheet()),
|
|
2634
2630
|
label: "Cancel",
|
|
2635
2631
|
variant: "tertiary"
|
|
2636
2632
|
}),
|
|
@@ -2663,7 +2659,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2663
2659
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2664
2660
|
createVNode(o, {
|
|
2665
2661
|
modelValue: unref(currentStep),
|
|
2666
|
-
"onUpdate:modelValue":
|
|
2662
|
+
"onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2667
2663
|
orientation: "horizontal",
|
|
2668
2664
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2669
2665
|
}, {
|
|
@@ -2682,11 +2678,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2682
2678
|
createVNode(n, {
|
|
2683
2679
|
icon: "close",
|
|
2684
2680
|
variant: "tertiary",
|
|
2685
|
-
onClick:
|
|
2681
|
+
onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
|
|
2686
2682
|
}),
|
|
2687
2683
|
createVNode(o, {
|
|
2688
2684
|
modelValue: unref(currentStep),
|
|
2689
|
-
"onUpdate:modelValue":
|
|
2685
|
+
"onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2690
2686
|
orientation: "horizontal",
|
|
2691
2687
|
class: "flex-1"
|
|
2692
2688
|
}, {
|
|
@@ -2705,7 +2701,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2705
2701
|
createVNode(n, {
|
|
2706
2702
|
icon: "info",
|
|
2707
2703
|
variant: "tertiary",
|
|
2708
|
-
onClick:
|
|
2704
|
+
onClick: i[4] || (i[4] = () => showSummaryDialog())
|
|
2709
2705
|
})
|
|
2710
2706
|
]),
|
|
2711
2707
|
createElementVNode("div", _hoisted_5, [
|
|
@@ -2729,24 +2725,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2729
2725
|
class: "space-y-24"
|
|
2730
2726
|
}, [
|
|
2731
2727
|
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2732
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (
|
|
2728
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (f, v) => (openBlock(), createElementBlock("div", { key: v }, [
|
|
2733
2729
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
2734
2730
|
key: v,
|
|
2735
|
-
field:
|
|
2736
|
-
modelValue: unref(_).get(unref(data),
|
|
2737
|
-
disabled: isDisable(
|
|
2738
|
-
"onUpdate:modelValue": (m) => onUpdateProperty(
|
|
2731
|
+
field: f,
|
|
2732
|
+
modelValue: unref(_).get(unref(data), f.property),
|
|
2733
|
+
disabled: isDisable(f),
|
|
2734
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(f.property, m),
|
|
2739
2735
|
"onUpdate:file": async (m, g) => {
|
|
2740
|
-
const
|
|
2741
|
-
onUpdateProperty(
|
|
2736
|
+
const c = await onUpdateFile(m, g);
|
|
2737
|
+
onUpdateProperty(f.property, c || "");
|
|
2742
2738
|
},
|
|
2743
2739
|
schema: unref(ZodHelper).typeAtPath(
|
|
2744
2740
|
unref(schema),
|
|
2745
|
-
|
|
2741
|
+
f.property,
|
|
2746
2742
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2747
2743
|
),
|
|
2748
|
-
"helper-text": unref(ZodHelper).helperText(unref(errors),
|
|
2749
|
-
extras:
|
|
2744
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), f.property),
|
|
2745
|
+
extras: f.extras != null ? f.extras == "" ? unref(data) : unref(_).get(unref(data), f.extras) : void 0
|
|
2750
2746
|
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
|
|
2751
2747
|
]))), 128))
|
|
2752
2748
|
]))), 128)),
|
|
@@ -2755,12 +2751,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2755
2751
|
label: "Back",
|
|
2756
2752
|
variant: "tertiary",
|
|
2757
2753
|
disabled: unref(currentStep) == 1,
|
|
2758
|
-
onClick:
|
|
2754
|
+
onClick: i[5] || (i[5] = (t) => currentStep.value--)
|
|
2759
2755
|
}, null, 8, ["disabled"]),
|
|
2760
2756
|
createVNode(n, {
|
|
2761
2757
|
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2762
2758
|
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2763
|
-
onClick:
|
|
2759
|
+
onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2764
2760
|
}, null, 8, ["disabled", "label"])
|
|
2765
2761
|
])
|
|
2766
2762
|
]),
|