@feedmepos/mf-connect 0.1.38-beta.64 → 0.1.38-beta.66
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-DImqxsOL.js → Analytic-BMD3DbZw.js} +14 -14
- package/dist/{App-DJO0YAvc.js → App-Dmu_97KT.js} +7 -7
- package/dist/{AuditLogs-Cyu6WkQi.js → AuditLogs-VHXsFbG0.js} +9 -9
- package/dist/{Bin-BKbRhXUs.js → Bin-H5eYDXCv.js} +8 -8
- package/dist/{Broadcast-Ek81jvaq.js → Broadcast-BEf5FBVy.js} +10 -10
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D3Aiw8__.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Bhw26PyY.js} +6 -6
- package/dist/{Card-DOzOYj6D.js → Card-kO6RMLoh.js} +17 -17
- package/dist/{Collections-DcRpulGT.js → Collections-o9KSs_nW.js} +7 -7
- package/dist/{Credit-LtPhJ4b5.js → Credit-D143NbuT.js} +10 -10
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-D7Nj-Tno.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-g5r_TxTy.js} +732 -719
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-C-DHzPNt.js → EffectSheet.vue_vue_type_style_index_0_lang-DMFkinru.js} +6 -6
- package/dist/{Experience-L5kmVW4A.js → Experience-D5b0q3qI.js} +10 -10
- package/dist/{FileSaver.min-B3xhuPlX.js → FileSaver.min-meIJUdAL.js} +1 -1
- package/dist/{Game-yAHX6ESV.js → Game-D2bgLmbD.js} +11 -11
- package/dist/{GenerateMaterial-C6yB1l5n.js → GenerateMaterial-BKQaryp_.js} +6 -6
- package/dist/{Grab-C8qZcx5X.js → Grab-LuS9nYfk.js} +9 -9
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DvsZJeqY.js → ImageInput.vue_vue_type_script_setup_true_lang-C8rHZeXA.js} +1 -1
- package/dist/{Index-Bx28-3fK.js → Index-BxtqkJBu.js} +10 -10
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DYkYP1j5.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BBzY-uiP.js} +1 -1
- package/dist/{MainLayout-6aH93R6_.js → MainLayout-ilqBWlQf.js} +1 -1
- package/dist/{Marketing-ZTVOB4cf.js → Marketing-DTKQBBKX.js} +4 -4
- package/dist/{MarketingMaterialEdit-Mz4PPSH7.js → MarketingMaterialEdit-BEhYwtRN.js} +4 -4
- package/dist/{Member-CX4ZSHLU.js → Member-B9ugq-MK.js} +11 -11
- package/dist/{MemberList-D4u1RgAm.js → MemberList-DkEtzUBQ.js} +25 -25
- package/dist/{MemberTransactions-DnQmwPuX.js → MemberTransactions-f-ZPDMN1.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C2DzMxhJ.js → MessageInput.vue_vue_type_script_setup_true_lang-CU5wc5yh.js} +8 -8
- package/dist/{Mission-BNVlPohF.js → Mission-KHRXljKR.js} +11 -11
- package/dist/{Overview-CByRWtKM.js → Overview-DuCH_EwU.js} +18 -18
- package/dist/{Point-B6rFqRp5.js → Point-Djmk5mzF.js} +10 -10
- package/dist/{Promotion-iXS4dUUj.js → Promotion-NvAXNPAC.js} +11 -11
- package/dist/{Queue-BGCom40i.js → Queue-CEggG4n0.js} +10 -10
- package/dist/{Record-DGG0bYbP.js → Record-Cdjh_lvA.js} +9 -9
- package/dist/{Reward-HKanIyJm.js → Reward-CzI6xVOs.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-hZ5y5Csf.js → RewardGroup.vue_vue_type_script_setup_true_lang-SMEw9Knc.js} +11 -11
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-SgZhL9m1.js +1790 -0
- package/dist/{Segment-DtOYS1HV.js → Segment-CFy6BQeZ.js} +24 -24
- package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-CaRD9uhw.js → SelectItems.vue_vue_type_script_setup_true_lang-BDuapaHE.js} +2 -2
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BmIzjrxP.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B5hlqodj.js} +12 -12
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-IfDlNAmn.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVOIOeF0.js} +4 -4
- package/dist/{Setting-CBQrI1ws.js → Setting-XIfKS6s3.js} +13 -13
- package/dist/{SettingAdvertisements-Cx9k9cXL.js → SettingAdvertisements-HDOFbmuC.js} +11 -11
- package/dist/{Store-AAHTMyqb.js → Store-CcEw5SUh.js} +20 -20
- package/dist/{StoreRewards-cDAqSN9v.js → StoreRewards-CSXACIqq.js} +14 -14
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-nVDuPFpg.js → StoreTransactions.vue_vue_type_script_setup_true_lang-ewdZFwnK.js} +19 -19
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-Ix_aNN7T.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dbp6toAh.js} +1 -1
- package/dist/{Tier-Wn_aSNV_.js → Tier-k8tDrGI_.js} +23 -23
- package/dist/{Title-DjGXuzb0.js → Title-BbWWFyoe.js} +20 -20
- package/dist/{Transaction-Dh3Bx3q3.js → Transaction-Cev7bwxP.js} +2 -2
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C1-ZQQnt.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-_Tp-c5Sq.js} +6 -6
- package/dist/{Voucher-De2-mEnV.js → Voucher-B6f8Gu2c.js} +14 -14
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DRRf7JqE.js → VoucherEditor.vue_vue_type_script_setup_true_lang-_EvJfrpe.js} +12 -12
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Bi86zVGt.js → ZodTextField.vue_vue_type_script_setup_true_lang-CXq3i0bH.js} +2 -2
- package/dist/{app-BJ_l3R6Q.js → app-DTwM6_Sq.js} +48 -48
- package/dist/app.js +1 -1
- package/dist/{business-D1SkgUbP.js → business-Dbw5HJ04.js} +1 -1
- package/dist/{campaign-C5DyrIfd.js → campaign-DCMBWpkn.js} +8 -8
- package/dist/{campaign-BiojeSP5.js → campaign-rMtxPwGn.js} +2 -2
- package/dist/{campaign.enum-HutGTRRn.js → campaign.enum-BZBB9gZ-.js} +1 -1
- package/dist/{campaign.fn-DiZYTHCZ.js → campaign.fn-BncYunu-.js} +104 -104
- package/dist/{collectible.enum-B5T-OfR8.js → collectible.enum-DfsBVU6o.js} +1 -1
- package/dist/{collection.fn-FIlTL2JE.js → collection.fn-BT3JFF7K.js} +2 -2
- package/dist/{dto-BGOK57PZ.js → dto-bz1fmkOx.js} +4 -4
- package/dist/{duplicateCampaign-1w88dLG-.js → duplicateCampaign-DhwEIZeJ.js} +2 -2
- package/dist/{effect-DobHugAy.js → effect-CuDyjImq.js} +1 -1
- package/dist/{email-addresses-UxnCqaaf.js → email-addresses-DJ9xXGfL.js} +2 -2
- package/dist/{export-pvm_NgQU.js → export-DqVsr8M_.js} +2 -2
- package/dist/{helper-D3eS0r70.js → helper-ByykQMOx.js} +1 -1
- package/dist/{index-BnSNIOQs.js → index-129oSkjn.js} +1 -1
- package/dist/{index-CY6h4SFf.js → index-BvNfmMAY.js} +1 -1
- package/dist/{index-BRFOX7S-.js → index-C3dTVGE1.js} +4 -4
- package/dist/{index-4lThn8WV.js → index-C9qqzKtO.js} +3 -3
- package/dist/{index-Lg_nQhXK.js → index-Cbs-ZGHs.js} +4 -4
- package/dist/{index-BnNwjigo.js → index-D0Wf5Gmf.js} +1 -1
- package/dist/{index-X-yFxquK.js → index-D224oAyo.js} +1 -1
- package/dist/{index-Buefoo9P.js → index-DYgg3ggV.js} +6 -6
- package/dist/{index-lE4L7YvM.js → index-DxwdIN0K.js} +1 -1
- package/dist/{index-CmUlioJz.js → index-FSu_hzwp.js} +1 -1
- package/dist/{index-BrXdnGx4.js → index-Grr7sf1v.js} +1 -1
- package/dist/{index-QzVwYkxx.js → index-JQ5i2eIx.js} +3 -3
- package/dist/{index-D__Ic2kG.js → index-lOtz7QlA.js} +3 -3
- package/dist/{index.esm2017-DjEyr_zT.js → index.esm2017-7Xban41w.js} +1 -1
- package/dist/{loading-DBYbDdOd.js → loading-CeI7XavO.js} +2 -2
- package/dist/{lodash-KJZoYwXO.js → lodash-DaLV_Qoq.js} +1 -1
- package/dist/{membership-DTr8xnzY.js → membership-ClhrKP9i.js} +3 -3
- package/dist/{money-BDjHNZCd.js → money-CU4mt57O.js} +1 -1
- package/dist/{number-VLq9D28R.js → number-DVBI4eWs.js} +1 -1
- package/dist/{objectid-DuwHzFaN.js → objectid-Rw-WM4vJ.js} +10 -10
- package/dist/{plugins-brNudj1r.js → plugins-CJWJtN5z.js} +3 -3
- package/dist/{reward-D3mHJxPc.js → reward-BSXcv7H4.js} +1 -1
- package/dist/{rule-9xMfesmq.js → rule-CUgtAWfh.js} +505 -487
- package/dist/{rule-builder-yek0k-Ze.js → rule-builder-DWo0P5Nw.js} +1 -1
- package/dist/{template-B_HIMJTg.js → template-HvM0I6l8.js} +6 -6
- package/dist/{timezone-BK3IHWvn.js → timezone-9ba8k_Ll.js} +2 -2
- package/dist/{trigger-Dme-DD2I.js → trigger-RhbSBW6h.js} +5 -5
- package/dist/{usePagination-DYoAtdDl.js → usePagination-h3zus0Bk.js} +1 -1
- package/dist/{user-DenjAAcI.js → user-B2Ae5sw8.js} +1 -1
- package/dist/{vue-i18n-DAhoRYgb.js → vue-i18n-BdXl9UUY.js} +164 -164
- package/dist/{xlsx-DsKdPOAN.js → xlsx-B-znTtsE.js} +1 -1
- package/dist/{zod-ZpIHBP_1.js → zod-ZnxWr0uZ.js} +1 -1
- package/package.json +1 -1
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-D9GcoJiZ.js +0 -1766
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createElementVNode, createVNode, createCommentVNode, computed, onMounted, toDisplayString, createBlock, withCtx, Fragment, renderList, withModifiers, unref, isRef, createTextVNode, normalizeClass, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { U as Ud, z } from "./app-
|
|
4
|
-
import { Z as ZodHelper } from "./zod-
|
|
5
|
-
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-
|
|
6
|
-
import { u as useMembershipStore } from "./membership-
|
|
7
|
-
import { u as useBusinessStore } from "./business-
|
|
8
|
-
import "./index-
|
|
9
|
-
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
2
|
+
import { _ } from "./lodash-DaLV_Qoq.js";
|
|
3
|
+
import { U as Ud, z } from "./app-DTwM6_Sq.js";
|
|
4
|
+
import { Z as ZodHelper } from "./zod-ZnxWr0uZ.js";
|
|
5
|
+
import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-bz1fmkOx.js";
|
|
6
|
+
import { u as useMembershipStore } from "./membership-ClhrKP9i.js";
|
|
7
|
+
import { u as useBusinessStore } from "./business-Dbw5HJ04.js";
|
|
8
|
+
import "./index-C9qqzKtO.js";
|
|
9
|
+
import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DWo0P5Nw.js";
|
|
10
10
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
11
11
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
12
|
-
import { f as featureVersionMapping } from "./campaign.enum-
|
|
13
|
-
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-
|
|
15
|
-
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-
|
|
16
|
-
import { c as core, S as SvcConfig } from "./index-
|
|
17
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
18
|
-
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { f as featureVersionMapping } from "./campaign.enum-BZBB9gZ-.js";
|
|
13
|
+
import { _ as _sfc_main$u } from "./ImageInput.vue_vue_type_script_setup_true_lang-C8rHZeXA.js";
|
|
14
|
+
import { b as _sfc_main$s, a as _sfc_main$v, _ as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-DMFkinru.js";
|
|
15
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Dbp6toAh.js";
|
|
16
|
+
import { c as core, S as SvcConfig } from "./index-lOtz7QlA.js";
|
|
17
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-CJWJtN5z.js";
|
|
18
|
+
import { _ as _sfc_main$o } from "./SelectItems.vue_vue_type_script_setup_true_lang-BDuapaHE.js";
|
|
19
19
|
import { _ as _export_sfc } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
20
|
-
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-
|
|
21
|
-
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-
|
|
22
|
-
import { u as useI18n } from "./vue-i18n-
|
|
23
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-
|
|
24
|
-
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-
|
|
25
|
-
import { C as CountryTimezone, m as moment } from "./timezone-
|
|
26
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule,
|
|
20
|
+
import { _ as _sfc_main$z } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-_Tp-c5Sq.js";
|
|
21
|
+
import { _ as _sfc_main$p, a as _sfc_main$q } from "./RuleGroup.vue_vue_type_script_setup_true_lang-SgZhL9m1.js";
|
|
22
|
+
import { u as useI18n } from "./vue-i18n-BdXl9UUY.js";
|
|
23
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$A, b as _sfc_main$B } from "./trigger-RhbSBW6h.js";
|
|
24
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-CU5wc5yh.js";
|
|
25
|
+
import { C as CountryTimezone, m as moment } from "./timezone-9ba8k_Ll.js";
|
|
26
|
+
import { c as calculateNextScheduleAt, R as RRule, S as SummarizeRrule, g as getRruleAnchorDate } from "./rule-CUgtAWfh.js";
|
|
27
27
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
28
|
-
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-
|
|
29
|
-
import { T as TEMPLATES } from "./index-
|
|
30
|
-
import { u as FdoCreditLoyaltyReward, v as FdtoRandomReward, w as F_MISSION_TYPE, x as FdoThresholdCreditReward, y as FdtoThresholdReward, z as FdoMission } from "./index-
|
|
31
|
-
import "./index-
|
|
32
|
-
import "./index-
|
|
33
|
-
import { a as F_GAME_TYPE } from "./collectible.enum-
|
|
34
|
-
import { u as useLoading } from "./loading-
|
|
35
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
36
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
28
|
+
import { _ as _sfc_main$r, a as _sfc_main$t } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-_EvJfrpe.js";
|
|
29
|
+
import { T as TEMPLATES } from "./index-DYgg3ggV.js";
|
|
30
|
+
import { u as FdoCreditLoyaltyReward, v as FdtoRandomReward, w as F_MISSION_TYPE, x as FdoThresholdCreditReward, y as FdtoThresholdReward, z as FdoMission } from "./index-C3dTVGE1.js";
|
|
31
|
+
import "./index-Cbs-ZGHs.js";
|
|
32
|
+
import "./index-JQ5i2eIx.js";
|
|
33
|
+
import { a as F_GAME_TYPE } from "./collectible.enum-DfsBVU6o.js";
|
|
34
|
+
import { u as useLoading } from "./loading-CeI7XavO.js";
|
|
35
|
+
import { i as initCollectibleConfig } from "./helper-ByykQMOx.js";
|
|
36
|
+
import { C as CollectionUtils } from "./collection.fn-BT3JFF7K.js";
|
|
37
37
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
38
|
-
import { d as getCampaignSummaryObject } from "./campaign-
|
|
38
|
+
import { d as getCampaignSummaryObject } from "./campaign-DCMBWpkn.js";
|
|
39
39
|
import { useDialog } from "@feedmepos/ui-library";
|
|
40
|
-
import { u as useCampaignStore } from "./campaign-
|
|
40
|
+
import { u as useCampaignStore } from "./campaign-rMtxPwGn.js";
|
|
41
41
|
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
42
42
|
function summarizeGrabDiscount(e) {
|
|
43
43
|
if (!e)
|
|
@@ -48,14 +48,14 @@ function summarizeGrabDiscount(e) {
|
|
|
48
48
|
case "order":
|
|
49
49
|
return "Bill discount";
|
|
50
50
|
case "items":
|
|
51
|
-
return l.type.startsWith("bundle") ?
|
|
51
|
+
return l.type.startsWith("bundle") ? d(l.type) : "Item discount";
|
|
52
52
|
case "categories":
|
|
53
53
|
return "Category discount";
|
|
54
54
|
default:
|
|
55
55
|
return "Discount";
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function d(l) {
|
|
59
59
|
switch (l) {
|
|
60
60
|
case "bundleSameFixPrice":
|
|
61
61
|
return "Bundle (same item) - Fixed price";
|
|
@@ -73,7 +73,7 @@ function summarizeGrabDiscount(e) {
|
|
|
73
73
|
return "Bundle discount";
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function u(l) {
|
|
77
77
|
switch (l.type) {
|
|
78
78
|
case "percentage":
|
|
79
79
|
case "bundleSamePercentage":
|
|
@@ -99,7 +99,7 @@ function summarizeGrabDiscount(e) {
|
|
|
99
99
|
}
|
|
100
100
|
return {
|
|
101
101
|
type: a(e),
|
|
102
|
-
adjustment:
|
|
102
|
+
adjustment: u(e),
|
|
103
103
|
cap: s(e)
|
|
104
104
|
};
|
|
105
105
|
}
|
|
@@ -115,36 +115,36 @@ const _hoisted_1$l = {
|
|
|
115
115
|
},
|
|
116
116
|
emits: ["confirm", "cancel"],
|
|
117
117
|
setup(e, { emit: m }) {
|
|
118
|
-
const a = e,
|
|
118
|
+
const a = e, d = m, u = ref();
|
|
119
119
|
watch(
|
|
120
120
|
() => a.visible,
|
|
121
121
|
(n) => {
|
|
122
|
-
var r,
|
|
123
|
-
!n &&
|
|
122
|
+
var r, p;
|
|
123
|
+
!n && u.value && ((p = (r = u.value).setSelectedItems) == null || p.call(r, a.initialValue || []));
|
|
124
124
|
}
|
|
125
125
|
);
|
|
126
126
|
function s() {
|
|
127
127
|
var n;
|
|
128
|
-
(n =
|
|
128
|
+
(n = u.value) == null || n.onConfirm();
|
|
129
129
|
}
|
|
130
130
|
function l() {
|
|
131
|
-
|
|
131
|
+
d("cancel");
|
|
132
132
|
}
|
|
133
133
|
function o(n) {
|
|
134
|
-
|
|
134
|
+
d("confirm", n);
|
|
135
135
|
}
|
|
136
136
|
return (n, r) => {
|
|
137
|
-
const
|
|
137
|
+
const p = resolveComponent("FmIcon"), h = resolveComponent("FmButton");
|
|
138
138
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
139
139
|
createElementVNode("div", _hoisted_2$h, [
|
|
140
140
|
createElementVNode("div", _hoisted_3$e, [
|
|
141
|
-
createVNode(
|
|
141
|
+
createVNode(p, {
|
|
142
142
|
name: "restaurant",
|
|
143
143
|
size: "md"
|
|
144
144
|
}),
|
|
145
145
|
r[0] || (r[0] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Items", -1))
|
|
146
146
|
]),
|
|
147
|
-
createVNode(
|
|
147
|
+
createVNode(h, {
|
|
148
148
|
icon: "close",
|
|
149
149
|
variant: "tertiary",
|
|
150
150
|
onClick: l
|
|
@@ -154,7 +154,7 @@ const _hoisted_1$l = {
|
|
|
154
154
|
createElementVNode("div", _hoisted_4$d, [
|
|
155
155
|
createVNode(_sfc_main$o, {
|
|
156
156
|
ref_key: "selectItemRef",
|
|
157
|
-
ref:
|
|
157
|
+
ref: u,
|
|
158
158
|
"initial-value": e.initialValue,
|
|
159
159
|
"filter-items": e.filterItems,
|
|
160
160
|
"on-complete": o,
|
|
@@ -162,12 +162,12 @@ const _hoisted_1$l = {
|
|
|
162
162
|
}, null, 8, ["initial-value", "filter-items"])
|
|
163
163
|
]),
|
|
164
164
|
createElementVNode("div", _hoisted_5$a, [
|
|
165
|
-
createVNode(
|
|
165
|
+
createVNode(h, {
|
|
166
166
|
variant: "secondary",
|
|
167
167
|
label: "Cancel",
|
|
168
168
|
onClick: l
|
|
169
169
|
}),
|
|
170
|
-
createVNode(
|
|
170
|
+
createVNode(h, {
|
|
171
171
|
variant: "primary",
|
|
172
172
|
label: "Confirm Selection",
|
|
173
173
|
onClick: s
|
|
@@ -190,125 +190,125 @@ const _hoisted_1$l = {
|
|
|
190
190
|
},
|
|
191
191
|
emits: ["confirm", "cancel"],
|
|
192
192
|
setup(e, { emit: m }) {
|
|
193
|
-
const a = e,
|
|
194
|
-
const
|
|
195
|
-
return
|
|
196
|
-
id:
|
|
197
|
-
name:
|
|
193
|
+
const a = e, d = m, u = Ud(), s = ref({}), l = ref(""), o = computed(() => {
|
|
194
|
+
const i = u.menu.value;
|
|
195
|
+
return i ? i.modules.category.map((c) => ({
|
|
196
|
+
id: c._id,
|
|
197
|
+
name: c.name
|
|
198
198
|
})) : [];
|
|
199
199
|
}), n = computed(() => {
|
|
200
200
|
if (!l.value) return o.value;
|
|
201
|
-
const
|
|
201
|
+
const i = l.value.toLowerCase();
|
|
202
202
|
return o.value.filter(
|
|
203
|
-
(
|
|
203
|
+
(c) => c.name.toLowerCase().includes(i)
|
|
204
204
|
);
|
|
205
205
|
}), r = computed(() => Object.values(s.value).filter(Boolean).length);
|
|
206
|
-
function
|
|
206
|
+
function p() {
|
|
207
207
|
s.value = o.value.reduce(
|
|
208
|
-
(
|
|
208
|
+
(i, c) => (i[c.id] = a.initialValue.includes(c.id), i),
|
|
209
209
|
{}
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
212
|
watch([() => a.visible, () => a.initialValue], () => {
|
|
213
|
-
a.visible &&
|
|
213
|
+
a.visible && p();
|
|
214
214
|
}), onMounted(async () => {
|
|
215
|
-
await
|
|
215
|
+
await u.store.getMenu(), p();
|
|
216
216
|
});
|
|
217
|
-
function
|
|
218
|
-
s.value[
|
|
217
|
+
function h(i) {
|
|
218
|
+
s.value[i] = !s.value[i];
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
const
|
|
222
|
-
n.value.forEach((
|
|
223
|
-
s.value[
|
|
220
|
+
function y() {
|
|
221
|
+
const i = r.value === n.value.length;
|
|
222
|
+
n.value.forEach((c) => {
|
|
223
|
+
s.value[c.id] = !i;
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
Object.keys(s.value).forEach((
|
|
228
|
-
s.value[
|
|
226
|
+
function C() {
|
|
227
|
+
Object.keys(s.value).forEach((i) => {
|
|
228
|
+
s.value[i] = !1;
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
const
|
|
233
|
-
|
|
231
|
+
function x() {
|
|
232
|
+
const i = Object.entries(s.value).filter(([, c]) => c).map(([c]) => c);
|
|
233
|
+
d("confirm", i);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
235
|
+
function v() {
|
|
236
|
+
d("cancel");
|
|
237
237
|
}
|
|
238
|
-
const
|
|
239
|
-
(
|
|
238
|
+
const f = computed(() => n.value.length > 0 && n.value.every(
|
|
239
|
+
(i) => s.value[i.id]
|
|
240
240
|
));
|
|
241
|
-
return (
|
|
242
|
-
const
|
|
241
|
+
return (i, c) => {
|
|
242
|
+
const k = resolveComponent("FmIcon"), b = resolveComponent("FmButton"), S = resolveComponent("FmTextField"), N = resolveComponent("FmCheckbox"), B = resolveComponent("FmListItem"), w = resolveComponent("FmList");
|
|
243
243
|
return e.visible ? (openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
244
244
|
createElementVNode("div", _hoisted_2$g, [
|
|
245
245
|
createElementVNode("div", _hoisted_3$d, [
|
|
246
|
-
createVNode(
|
|
246
|
+
createVNode(k, {
|
|
247
247
|
name: "category",
|
|
248
248
|
size: "md"
|
|
249
249
|
}),
|
|
250
|
-
|
|
250
|
+
c[2] || (c[2] = createElementVNode("h3", { class: "fm-typo-en-body-lg-600" }, "Select Categories", -1))
|
|
251
251
|
]),
|
|
252
252
|
createVNode(b, {
|
|
253
253
|
icon: "close",
|
|
254
254
|
variant: "tertiary",
|
|
255
|
-
onClick:
|
|
255
|
+
onClick: v
|
|
256
256
|
})
|
|
257
257
|
]),
|
|
258
|
-
|
|
258
|
+
c[3] || (c[3] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. The discount will be available for all items within the selected categories. ", -1)),
|
|
259
259
|
createElementVNode("div", _hoisted_4$c, [
|
|
260
260
|
createElementVNode("div", _hoisted_5$9, [
|
|
261
261
|
createVNode(b, {
|
|
262
262
|
icon: "select_all",
|
|
263
263
|
variant: "tertiary",
|
|
264
264
|
size: "small",
|
|
265
|
-
label: `${
|
|
266
|
-
onClick:
|
|
265
|
+
label: `${f.value ? "Deselect" : "Select"} All`,
|
|
266
|
+
onClick: y
|
|
267
267
|
}, null, 8, ["label"]),
|
|
268
268
|
createVNode(b, {
|
|
269
269
|
icon: "sync",
|
|
270
270
|
variant: "tertiary",
|
|
271
271
|
size: "small",
|
|
272
272
|
label: "Clear",
|
|
273
|
-
onClick:
|
|
273
|
+
onClick: C
|
|
274
274
|
}),
|
|
275
275
|
createElementVNode("span", _hoisted_6$5, toDisplayString(r.value) + " selected ", 1)
|
|
276
276
|
]),
|
|
277
|
-
createVNode(
|
|
277
|
+
createVNode(S, {
|
|
278
278
|
modelValue: l.value,
|
|
279
|
-
"onUpdate:modelValue":
|
|
279
|
+
"onUpdate:modelValue": c[0] || (c[0] = (E) => l.value = E),
|
|
280
280
|
placeholder: "Search categories",
|
|
281
281
|
"leading-icon": { name: "search", color: "" },
|
|
282
282
|
class: "flex-1 min-w-[200px]"
|
|
283
283
|
}, null, 8, ["modelValue"])
|
|
284
284
|
]),
|
|
285
285
|
createElementVNode("div", _hoisted_7$5, [
|
|
286
|
-
n.value.length > 0 ? (openBlock(), createBlock(
|
|
286
|
+
n.value.length > 0 ? (openBlock(), createBlock(w, { key: 0 }, {
|
|
287
287
|
default: withCtx(() => [
|
|
288
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (
|
|
289
|
-
key:
|
|
288
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.value, (E) => (openBlock(), createBlock(B, {
|
|
289
|
+
key: E.id,
|
|
290
290
|
clickable: !0,
|
|
291
|
-
onClick: (
|
|
291
|
+
onClick: (F) => h(E.id)
|
|
292
292
|
}, {
|
|
293
293
|
leading: withCtx(() => [
|
|
294
294
|
createVNode(N, {
|
|
295
|
-
"model-value": s.value[
|
|
296
|
-
value:
|
|
297
|
-
"onUpdate:modelValue": (
|
|
298
|
-
onClick:
|
|
295
|
+
"model-value": s.value[E.id] || !1,
|
|
296
|
+
value: E.id,
|
|
297
|
+
"onUpdate:modelValue": (F) => h(E.id),
|
|
298
|
+
onClick: c[1] || (c[1] = withModifiers(() => {
|
|
299
299
|
}, ["stop"]))
|
|
300
300
|
}, null, 8, ["model-value", "value", "onUpdate:modelValue"])
|
|
301
301
|
]),
|
|
302
302
|
default: withCtx(() => [
|
|
303
303
|
createElementVNode("div", _hoisted_8$4, [
|
|
304
|
-
createVNode(
|
|
304
|
+
createVNode(k, {
|
|
305
305
|
name: "category",
|
|
306
306
|
size: "sm",
|
|
307
307
|
class: "text-fm-color-typo-secondary"
|
|
308
308
|
}),
|
|
309
309
|
createElementVNode("div", null, [
|
|
310
|
-
createElementVNode("div", _hoisted_9$4, toDisplayString(
|
|
311
|
-
createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(
|
|
310
|
+
createElementVNode("div", _hoisted_9$4, toDisplayString(E.name), 1),
|
|
311
|
+
createElementVNode("div", _hoisted_10$4, " ID: " + toDisplayString(E.id), 1)
|
|
312
312
|
])
|
|
313
313
|
])
|
|
314
314
|
]),
|
|
@@ -324,13 +324,13 @@ const _hoisted_1$l = {
|
|
|
324
324
|
createVNode(b, {
|
|
325
325
|
variant: "secondary",
|
|
326
326
|
label: "Cancel",
|
|
327
|
-
onClick:
|
|
327
|
+
onClick: v
|
|
328
328
|
}),
|
|
329
329
|
createVNode(b, {
|
|
330
330
|
variant: "primary",
|
|
331
331
|
label: `Confirm Selection (${r.value})`,
|
|
332
332
|
disabled: r.value === 0,
|
|
333
|
-
onClick:
|
|
333
|
+
onClick: x
|
|
334
334
|
}, null, 8, ["label", "disabled"])
|
|
335
335
|
])
|
|
336
336
|
])) : createCommentVNode("", !0);
|
|
@@ -349,7 +349,7 @@ const _hoisted_1$l = {
|
|
|
349
349
|
},
|
|
350
350
|
emits: ["update:model-value"],
|
|
351
351
|
setup(e, { emit: m }) {
|
|
352
|
-
const a = e,
|
|
352
|
+
const a = e, d = m, u = Ud(), s = ref(!1), l = ref(!1), o = ref(!1), n = ref({
|
|
353
353
|
type: "net",
|
|
354
354
|
value: 0,
|
|
355
355
|
scope: {
|
|
@@ -363,65 +363,65 @@ const _hoisted_1$l = {
|
|
|
363
363
|
},
|
|
364
364
|
{ immediate: !0 }
|
|
365
365
|
), onMounted(async () => {
|
|
366
|
-
await
|
|
366
|
+
await u.store.getMenu();
|
|
367
367
|
});
|
|
368
368
|
const r = computed(() => {
|
|
369
369
|
var g;
|
|
370
|
-
return !(!n.value.type || !((g = n.value.scope) != null && g.type) ||
|
|
370
|
+
return !(!n.value.type || !((g = n.value.scope) != null && g.type) || y(n.value.type) && (!n.value.value || n.value.value <= 0) || (n.value.scope.type === "items" || n.value.scope.type === "category") && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0));
|
|
371
371
|
});
|
|
372
|
-
async function
|
|
373
|
-
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") &&
|
|
372
|
+
async function p(g) {
|
|
373
|
+
g.stopPropagation(), await prompt.remove("Are you sure you want to remove this discount?") && d("update:model-value", null);
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function h() {
|
|
376
376
|
var g;
|
|
377
|
-
return
|
|
377
|
+
return k(((g = n.value.scope) == null ? void 0 : g.type) || "order");
|
|
378
378
|
}
|
|
379
|
-
function
|
|
379
|
+
function y(g) {
|
|
380
380
|
return g && !["freeItem", "delivery"].includes(g);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
382
|
+
function C(g) {
|
|
383
383
|
return g && ["percentage", "bundleSamePercentage", "bundleDiffPercentage"].includes(
|
|
384
384
|
g
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function x(g) {
|
|
388
388
|
return g != null && g.includes("Percentage") ? "Discount percentage" : g != null && g.includes("FixPrice") ? "Bundle fixed price" : g === "percentage" ? "Discount percentage" : "Discount amount";
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function v(g) {
|
|
391
391
|
return g != null && g.includes("Percentage") || g === "percentage" ? "10" : "5.00";
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function f(g) {
|
|
394
394
|
return g != null && g.includes("Percentage") || g === "percentage" ? "%" : "$";
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function i(g, V) {
|
|
397
397
|
n.value = {
|
|
398
398
|
...n.value,
|
|
399
399
|
[g]: V
|
|
400
400
|
};
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
var
|
|
404
|
-
const
|
|
402
|
+
function c(g, V) {
|
|
403
|
+
var O;
|
|
404
|
+
const $ = {
|
|
405
405
|
...n.value.scope,
|
|
406
406
|
[g]: V
|
|
407
407
|
};
|
|
408
408
|
if (n.value = {
|
|
409
409
|
...n.value,
|
|
410
|
-
scope:
|
|
410
|
+
scope: $
|
|
411
411
|
}, g === "type") {
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
(
|
|
412
|
+
const T = k(V);
|
|
413
|
+
T.some(
|
|
414
|
+
(A) => A.value === n.value.type
|
|
415
415
|
) || (n.value = {
|
|
416
416
|
...n.value,
|
|
417
|
-
type: ((
|
|
417
|
+
type: ((O = T[0]) == null ? void 0 : O.value) || "net",
|
|
418
418
|
// Reset value and cap when changing to incompatible type
|
|
419
419
|
value: 0,
|
|
420
420
|
cap: void 0
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function k(g) {
|
|
425
425
|
switch (g) {
|
|
426
426
|
case "order":
|
|
427
427
|
return [
|
|
@@ -480,7 +480,7 @@ const _hoisted_1$l = {
|
|
|
480
480
|
return "Select how you want to apply the discount.";
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function S() {
|
|
484
484
|
var g;
|
|
485
485
|
return ((g = n.value.scope) == null ? void 0 : g.type) === "items";
|
|
486
486
|
}
|
|
@@ -488,39 +488,39 @@ const _hoisted_1$l = {
|
|
|
488
488
|
var g;
|
|
489
489
|
return ((g = n.value.scope) == null ? void 0 : g.type) === "category";
|
|
490
490
|
}
|
|
491
|
-
function
|
|
492
|
-
var
|
|
493
|
-
const g = (
|
|
491
|
+
function B() {
|
|
492
|
+
var $;
|
|
493
|
+
const g = ($ = n.value.scope) == null ? void 0 : $.objectIDs;
|
|
494
494
|
if (!g || g.length === 0)
|
|
495
495
|
return "No items selected";
|
|
496
|
-
const V =
|
|
497
|
-
return V && g.length <= 3 ? g.map((
|
|
498
|
-
const
|
|
499
|
-
return
|
|
496
|
+
const V = u.menu.value;
|
|
497
|
+
return V && g.length <= 3 ? g.map((T) => {
|
|
498
|
+
const D = V.modules.item.find((A) => A._id === T);
|
|
499
|
+
return D ? (D.name2 || D.name).trim() : `Item ${T}`;
|
|
500
500
|
}).join(", ") : g.length === 1 ? "1 item selected" : `${g.length} items selected`;
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
var
|
|
504
|
-
const g = (
|
|
502
|
+
function w() {
|
|
503
|
+
var $;
|
|
504
|
+
const g = ($ = n.value.scope) == null ? void 0 : $.objectIDs;
|
|
505
505
|
if (!g || g.length === 0)
|
|
506
506
|
return "No categories selected";
|
|
507
|
-
const V =
|
|
508
|
-
return V && g.length <= 3 ? g.map((
|
|
509
|
-
const
|
|
510
|
-
return
|
|
507
|
+
const V = u.menu.value;
|
|
508
|
+
return V && g.length <= 3 ? g.map((T) => {
|
|
509
|
+
const D = V.modules.category.find((A) => A._id === T);
|
|
510
|
+
return D ? D.name : `Category ${T}`;
|
|
511
511
|
}).join(", ") : g.length === 1 ? "1 category selected" : `${g.length} categories selected`;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function E() {
|
|
514
514
|
l.value = !0;
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function F() {
|
|
517
517
|
o.value = !0;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
519
|
+
function U(g) {
|
|
520
|
+
c("objectIDs", g), l.value = !1;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
|
|
522
|
+
function R(g) {
|
|
523
|
+
c("objectIDs", g), o.value = !1;
|
|
524
524
|
}
|
|
525
525
|
function Y() {
|
|
526
526
|
l.value = !1;
|
|
@@ -528,13 +528,13 @@ const _hoisted_1$l = {
|
|
|
528
528
|
function G() {
|
|
529
529
|
o.value = !1;
|
|
530
530
|
}
|
|
531
|
-
const
|
|
532
|
-
var V,
|
|
531
|
+
const j = computed(() => {
|
|
532
|
+
var V, $, O;
|
|
533
533
|
const g = [];
|
|
534
|
-
return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"),
|
|
534
|
+
return n.value.type || g.push("Discount type is required"), (V = n.value.scope) != null && V.type || g.push("Scope type is required"), y(n.value.type) && (!n.value.value || n.value.value <= 0) && g.push("Discount amount must be greater than 0"), (($ = n.value.scope) == null ? void 0 : $.type) === "items" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one item"), ((O = n.value.scope) == null ? void 0 : O.type) === "category" && (!n.value.scope.objectIDs || n.value.scope.objectIDs.length === 0) && g.push("Please select at least one category"), g;
|
|
535
535
|
});
|
|
536
536
|
function Z() {
|
|
537
|
-
|
|
537
|
+
d("update:model-value", n.value), s.value = !1;
|
|
538
538
|
}
|
|
539
539
|
const q = [
|
|
540
540
|
{ label: "Bill discount", value: "order" },
|
|
@@ -542,36 +542,36 @@ const _hoisted_1$l = {
|
|
|
542
542
|
{ label: "Category discount", value: "category" }
|
|
543
543
|
];
|
|
544
544
|
return (g, V) => {
|
|
545
|
-
const
|
|
546
|
-
return openBlock(), createBlock(
|
|
545
|
+
const $ = resolveComponent("FmButton"), O = resolveComponent("FmSelect"), T = resolveComponent("FmStepperField"), D = resolveComponent("FmIcon"), A = resolveComponent("FmSideSheet");
|
|
546
|
+
return openBlock(), createBlock(A, {
|
|
547
547
|
"max-width": 550,
|
|
548
548
|
header: "Apply discount",
|
|
549
549
|
modelValue: unref(s),
|
|
550
550
|
"onUpdate:modelValue": [
|
|
551
|
-
V[5] || (V[5] = (
|
|
552
|
-
V[6] || (V[6] = (
|
|
551
|
+
V[5] || (V[5] = (I) => isRef(s) ? s.value = I : null),
|
|
552
|
+
V[6] || (V[6] = (I) => s.value = I)
|
|
553
553
|
]
|
|
554
554
|
}, {
|
|
555
555
|
"side-sheet-button": withCtx(() => {
|
|
556
|
-
var
|
|
556
|
+
var I, L, H, M;
|
|
557
557
|
return [
|
|
558
558
|
createElementVNode("div", _hoisted_1$j, [
|
|
559
559
|
V[7] || (V[7] = createElementVNode("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Configure the Grab campaign discount you want to offer your customers. ", -1)),
|
|
560
560
|
e.modelValue ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
|
|
561
561
|
createElementVNode("div", _hoisted_3$c, [
|
|
562
|
-
createElementVNode("div", null, toDisplayString((
|
|
562
|
+
createElementVNode("div", null, toDisplayString((I = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : I.type), 1),
|
|
563
563
|
createElementVNode("div", _hoisted_4$b, [
|
|
564
|
-
createTextVNode(toDisplayString((
|
|
565
|
-
(
|
|
564
|
+
createTextVNode(toDisplayString((L = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : L.adjustment) + " ", 1),
|
|
565
|
+
(H = unref(summarizeGrabDiscount)(e.modelValue)) != null && H.cap ? (openBlock(), createElementBlock("span", _hoisted_5$8, toDisplayString((M = unref(summarizeGrabDiscount)(e.modelValue)) == null ? void 0 : M.cap), 1)) : createCommentVNode("", !0)
|
|
566
566
|
])
|
|
567
567
|
]),
|
|
568
|
-
createVNode(
|
|
568
|
+
createVNode($, {
|
|
569
569
|
icon: "delete",
|
|
570
570
|
"icon-color": "neutral-gray-400",
|
|
571
571
|
variant: "tertiary",
|
|
572
|
-
onClick:
|
|
572
|
+
onClick: p
|
|
573
573
|
})
|
|
574
|
-
])) : (openBlock(), createBlock(
|
|
574
|
+
])) : (openBlock(), createBlock($, {
|
|
575
575
|
key: 0,
|
|
576
576
|
label: "Apply Grab discount",
|
|
577
577
|
icon: "add",
|
|
@@ -584,13 +584,13 @@ const _hoisted_1$l = {
|
|
|
584
584
|
}),
|
|
585
585
|
"side-sheet-footer": withCtx(() => [
|
|
586
586
|
createElementVNode("div", _hoisted_26, [
|
|
587
|
-
createVNode(
|
|
587
|
+
createVNode($, {
|
|
588
588
|
variant: "secondary",
|
|
589
589
|
label: "Cancel",
|
|
590
590
|
class: "flex-1",
|
|
591
|
-
onClick: V[4] || (V[4] = (
|
|
591
|
+
onClick: V[4] || (V[4] = (I) => s.value = !1)
|
|
592
592
|
}),
|
|
593
|
-
createVNode(
|
|
593
|
+
createVNode($, {
|
|
594
594
|
variant: "primary",
|
|
595
595
|
label: unref(r) ? "Confirm" : "Complete Required Fields",
|
|
596
596
|
class: "flex-1",
|
|
@@ -600,64 +600,64 @@ const _hoisted_1$l = {
|
|
|
600
600
|
])
|
|
601
601
|
]),
|
|
602
602
|
default: withCtx(() => {
|
|
603
|
-
var
|
|
603
|
+
var I, L, H, M;
|
|
604
604
|
return [
|
|
605
605
|
createElementVNode("div", _hoisted_6$4, [
|
|
606
606
|
createElementVNode("div", null, [
|
|
607
607
|
V[8] || (V[8] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Campaign type", -1)),
|
|
608
|
-
createVNode(
|
|
609
|
-
"model-value": ((
|
|
610
|
-
"onUpdate:modelValue": V[0] || (V[0] = (
|
|
608
|
+
createVNode(O, {
|
|
609
|
+
"model-value": ((I = unref(n).scope) == null ? void 0 : I.type) || "order",
|
|
610
|
+
"onUpdate:modelValue": V[0] || (V[0] = (P) => c("type", P)),
|
|
611
611
|
placeholder: "Select campaign type",
|
|
612
612
|
items: q
|
|
613
613
|
}, null, 8, ["model-value"]),
|
|
614
|
-
createElementVNode("div", _hoisted_7$4, toDisplayString(b((
|
|
614
|
+
createElementVNode("div", _hoisted_7$4, toDisplayString(b((L = unref(n).scope) == null ? void 0 : L.type)), 1)
|
|
615
615
|
]),
|
|
616
616
|
createElementVNode("div", null, [
|
|
617
617
|
V[9] || (V[9] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount type", -1)),
|
|
618
|
-
createVNode(
|
|
618
|
+
createVNode(O, {
|
|
619
619
|
"model-value": unref(n).type,
|
|
620
|
-
"onUpdate:modelValue": V[1] || (V[1] = (
|
|
620
|
+
"onUpdate:modelValue": V[1] || (V[1] = (P) => i("type", P)),
|
|
621
621
|
placeholder: "Select discount type",
|
|
622
|
-
items:
|
|
622
|
+
items: h()
|
|
623
623
|
}, null, 8, ["model-value", "items"])
|
|
624
624
|
]),
|
|
625
|
-
|
|
626
|
-
createElementVNode("label", _hoisted_9$3, toDisplayString(
|
|
627
|
-
createVNode(
|
|
625
|
+
y(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_8$3, [
|
|
626
|
+
createElementVNode("label", _hoisted_9$3, toDisplayString(x(unref(n).type)), 1),
|
|
627
|
+
createVNode(T, {
|
|
628
628
|
modelValue: unref(n).value,
|
|
629
|
-
"onUpdate:modelValue": V[2] || (V[2] = (
|
|
630
|
-
placeholder:
|
|
631
|
-
suffix:
|
|
629
|
+
"onUpdate:modelValue": V[2] || (V[2] = (P) => unref(n).value = P),
|
|
630
|
+
placeholder: v(unref(n).type),
|
|
631
|
+
suffix: f(unref(n).type),
|
|
632
632
|
type: "number"
|
|
633
633
|
}, null, 8, ["modelValue", "placeholder", "suffix"])
|
|
634
634
|
])) : createCommentVNode("", !0),
|
|
635
|
-
|
|
635
|
+
C(unref(n).type) ? (openBlock(), createElementBlock("div", _hoisted_10$3, [
|
|
636
636
|
V[10] || (V[10] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Discount cap (optional)", -1)),
|
|
637
|
-
createVNode(
|
|
637
|
+
createVNode(T, {
|
|
638
638
|
modelValue: unref(n).cap,
|
|
639
|
-
"onUpdate:modelValue": V[3] || (V[3] = (
|
|
639
|
+
"onUpdate:modelValue": V[3] || (V[3] = (P) => unref(n).cap = P),
|
|
640
640
|
placeholder: "Maximum discount amount",
|
|
641
641
|
type: "number"
|
|
642
642
|
}, null, 8, ["modelValue"])
|
|
643
643
|
])) : createCommentVNode("", !0),
|
|
644
|
-
|
|
644
|
+
S() ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
|
|
645
645
|
unref(l) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
646
646
|
V[12] || (V[12] = createElementVNode("label", { class: "fm-typo-en-body-md-600 mb-8 block" }, "Select Items", -1)),
|
|
647
647
|
createElementVNode("div", _hoisted_13, [
|
|
648
648
|
createElementVNode("div", _hoisted_14, [
|
|
649
649
|
createElementVNode("div", _hoisted_15, [
|
|
650
|
-
createVNode(
|
|
650
|
+
createVNode(D, {
|
|
651
651
|
name: "restaurant",
|
|
652
652
|
size: "md"
|
|
653
653
|
}),
|
|
654
|
-
createElementVNode("span", _hoisted_16, toDisplayString(
|
|
654
|
+
createElementVNode("span", _hoisted_16, toDisplayString(B()), 1)
|
|
655
655
|
]),
|
|
656
|
-
createVNode(
|
|
656
|
+
createVNode($, {
|
|
657
657
|
variant: "secondary",
|
|
658
658
|
label: "Select Items",
|
|
659
659
|
icon: "chevron_right",
|
|
660
|
-
onClick:
|
|
660
|
+
onClick: E
|
|
661
661
|
})
|
|
662
662
|
]),
|
|
663
663
|
V[11] || (V[11] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which items this discount applies to. Bundle discounts require multiple items. ", -1))
|
|
@@ -665,8 +665,8 @@ const _hoisted_1$l = {
|
|
|
665
665
|
])),
|
|
666
666
|
createVNode(_sfc_main$n, {
|
|
667
667
|
visible: unref(l),
|
|
668
|
-
"initial-value": ((
|
|
669
|
-
onConfirm:
|
|
668
|
+
"initial-value": ((H = unref(n).scope) == null ? void 0 : H.objectIDs) || [],
|
|
669
|
+
onConfirm: U,
|
|
670
670
|
onCancel: Y
|
|
671
671
|
}, null, 8, ["visible", "initial-value"])
|
|
672
672
|
])) : createCommentVNode("", !0),
|
|
@@ -676,17 +676,17 @@ const _hoisted_1$l = {
|
|
|
676
676
|
createElementVNode("div", _hoisted_19, [
|
|
677
677
|
createElementVNode("div", _hoisted_20, [
|
|
678
678
|
createElementVNode("div", _hoisted_21, [
|
|
679
|
-
createVNode(
|
|
679
|
+
createVNode(D, {
|
|
680
680
|
name: "category",
|
|
681
681
|
size: "md"
|
|
682
682
|
}),
|
|
683
|
-
createElementVNode("span", _hoisted_22, toDisplayString(
|
|
683
|
+
createElementVNode("span", _hoisted_22, toDisplayString(w()), 1)
|
|
684
684
|
]),
|
|
685
|
-
createVNode(
|
|
685
|
+
createVNode($, {
|
|
686
686
|
variant: "secondary",
|
|
687
687
|
label: "Select Categories",
|
|
688
688
|
icon: "chevron_right",
|
|
689
|
-
onClick:
|
|
689
|
+
onClick: F
|
|
690
690
|
})
|
|
691
691
|
]),
|
|
692
692
|
V[13] || (V[13] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Choose which categories this discount applies to. ", -1))
|
|
@@ -694,24 +694,24 @@ const _hoisted_1$l = {
|
|
|
694
694
|
])),
|
|
695
695
|
createVNode(_sfc_main$m, {
|
|
696
696
|
visible: unref(o),
|
|
697
|
-
"initial-value": ((
|
|
698
|
-
onConfirm:
|
|
697
|
+
"initial-value": ((M = unref(n).scope) == null ? void 0 : M.objectIDs) || [],
|
|
698
|
+
onConfirm: R,
|
|
699
699
|
onCancel: G
|
|
700
700
|
}, null, 8, ["visible", "initial-value"])
|
|
701
701
|
])) : createCommentVNode("", !0)
|
|
702
702
|
]),
|
|
703
|
-
unref(
|
|
703
|
+
unref(j).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_23, [
|
|
704
704
|
createElementVNode("div", _hoisted_24, [
|
|
705
|
-
createVNode(
|
|
705
|
+
createVNode(D, { name: "warning" }),
|
|
706
706
|
V[15] || (V[15] = createElementVNode("span", { class: "fm-typo-en-body-sm-600" }, "Please fix the following issues:", -1))
|
|
707
707
|
]),
|
|
708
708
|
createElementVNode("ul", _hoisted_25, [
|
|
709
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
710
|
-
key:
|
|
709
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(j), (P) => (openBlock(), createElementBlock("li", {
|
|
710
|
+
key: P,
|
|
711
711
|
class: "fm-typo-en-body-sm-400 text-fm-color-feedback-error-main flex items-start gap-8"
|
|
712
712
|
}, [
|
|
713
713
|
V[16] || (V[16] = createElementVNode("span", { class: "w-4 h-4 bg-fm-color-feedback-error-main rounded-full mt-6 flex-shrink-0" }, null, -1)),
|
|
714
|
-
createTextVNode(" " + toDisplayString(
|
|
714
|
+
createTextVNode(" " + toDisplayString(P), 1)
|
|
715
715
|
]))), 128))
|
|
716
716
|
])
|
|
717
717
|
])) : createCommentVNode("", !0)
|
|
@@ -732,30 +732,30 @@ const _hoisted_1$l = {
|
|
|
732
732
|
},
|
|
733
733
|
emits: ["update:model-value"],
|
|
734
734
|
setup(e, { emit: m }) {
|
|
735
|
-
const { t: a } = useI18n(),
|
|
736
|
-
!
|
|
735
|
+
const { t: a } = useI18n(), d = e, u = m, s = ref(
|
|
736
|
+
!d.modelValue || !d.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(d.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
737
737
|
);
|
|
738
738
|
watch(s, async (o, n) => {
|
|
739
739
|
var r;
|
|
740
|
-
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r =
|
|
741
|
-
const
|
|
740
|
+
if (n == "custom" && o == "all_time" && RuleBuilder.getRules((r = d.modelValue) == null ? void 0 : r.rules.g_time).length > 0) {
|
|
741
|
+
const p = await prompt.confirm(
|
|
742
742
|
a("connect.template.rule.time.confirm_remove"),
|
|
743
743
|
a("connect.common.confirm"),
|
|
744
744
|
a("connect.common.confirm"),
|
|
745
745
|
a("connect.common.cancel")
|
|
746
746
|
);
|
|
747
|
-
|
|
747
|
+
p && u(
|
|
748
748
|
"update:model-value",
|
|
749
749
|
RuleBuilder.setRuleToGroup(
|
|
750
|
-
|
|
750
|
+
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
751
751
|
RuleBuilder.scaffoldGroup("g_time")
|
|
752
752
|
)
|
|
753
|
-
), s.value =
|
|
753
|
+
), s.value = p ? o : n;
|
|
754
754
|
}
|
|
755
755
|
});
|
|
756
756
|
async function l(o) {
|
|
757
757
|
var n;
|
|
758
|
-
if (o == "custom" && RuleBuilder.getRules((n =
|
|
758
|
+
if (o == "custom" && RuleBuilder.getRules((n = d.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
|
|
759
759
|
if (!await prompt.confirm(
|
|
760
760
|
a("connect.template.rule.time.confirm_remove"),
|
|
761
761
|
a("connect.common.confirm"),
|
|
@@ -765,24 +765,24 @@ const _hoisted_1$l = {
|
|
|
765
765
|
s.value = "all_time";
|
|
766
766
|
return;
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
u(
|
|
769
769
|
"update:model-value",
|
|
770
770
|
RuleBuilder.setRuleToGroup(
|
|
771
|
-
|
|
771
|
+
d.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
772
772
|
RuleBuilder.scaffoldGroup("g_time")
|
|
773
773
|
)
|
|
774
774
|
);
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
return (o, n) => {
|
|
778
|
-
var
|
|
779
|
-
const r = resolveComponent("FmRadio"),
|
|
778
|
+
var h;
|
|
779
|
+
const r = resolveComponent("FmRadio"), p = resolveComponent("FmRadioGroup");
|
|
780
780
|
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
781
|
-
createVNode(
|
|
781
|
+
createVNode(p, {
|
|
782
782
|
modelValue: unref(s),
|
|
783
783
|
"onUpdate:modelValue": [
|
|
784
|
-
n[0] || (n[0] = (
|
|
785
|
-
n[1] || (n[1] = (
|
|
784
|
+
n[0] || (n[0] = (y) => isRef(s) ? s.value = y : null),
|
|
785
|
+
n[1] || (n[1] = (y) => l(y))
|
|
786
786
|
]
|
|
787
787
|
}, {
|
|
788
788
|
default: withCtx(() => [
|
|
@@ -802,12 +802,12 @@ const _hoisted_1$l = {
|
|
|
802
802
|
class: "!mt-[0px]",
|
|
803
803
|
"include-only": "trigger",
|
|
804
804
|
"trigger-type": "SCHEDULE",
|
|
805
|
-
"model-value": ((
|
|
806
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
805
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
806
|
+
"onUpdate:modelValue": n[2] || (n[2] = (y) => u(
|
|
807
807
|
"update:model-value",
|
|
808
808
|
unref(RuleBuilder).setRuleToGroup(
|
|
809
809
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
810
|
-
|
|
810
|
+
y,
|
|
811
811
|
"&&"
|
|
812
812
|
)
|
|
813
813
|
))
|
|
@@ -824,9 +824,9 @@ const _hoisted_1$l = {
|
|
|
824
824
|
},
|
|
825
825
|
emits: ["update:model-value"],
|
|
826
826
|
setup(e, { emit: m }) {
|
|
827
|
-
const { t: a } = useI18n(),
|
|
827
|
+
const { t: a } = useI18n(), d = e, u = m, s = computed(() => {
|
|
828
828
|
const { property: l, operator: o, equator: n } = RuleBuilder.simplify(
|
|
829
|
-
|
|
829
|
+
d.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
830
830
|
op: "before",
|
|
831
831
|
x: 1
|
|
832
832
|
})
|
|
@@ -845,7 +845,7 @@ const _hoisted_1$l = {
|
|
|
845
845
|
value: "_isRange-day",
|
|
846
846
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
847
847
|
"onUpdate:modelValue": o[0] || (o[0] = () => {
|
|
848
|
-
|
|
848
|
+
u(
|
|
849
849
|
"update:model-value",
|
|
850
850
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
851
851
|
op: "this",
|
|
@@ -860,7 +860,7 @@ const _hoisted_1$l = {
|
|
|
860
860
|
value: "_isDay",
|
|
861
861
|
"model-value": unref(s).operator,
|
|
862
862
|
"onUpdate:modelValue": o[1] || (o[1] = () => {
|
|
863
|
-
|
|
863
|
+
u(
|
|
864
864
|
"update:model-value",
|
|
865
865
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
866
866
|
op: "after",
|
|
@@ -875,11 +875,11 @@ const _hoisted_1$l = {
|
|
|
875
875
|
label: unref(a)("connect.template.rule.birthday.days_before_label"),
|
|
876
876
|
"show-steppers": !1,
|
|
877
877
|
"model-value": unref(s).equator.x,
|
|
878
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
878
|
+
"onUpdate:modelValue": o[2] || (o[2] = (p) => u(
|
|
879
879
|
"update:model-value",
|
|
880
880
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
881
881
|
op: "after",
|
|
882
|
-
x:
|
|
882
|
+
x: p,
|
|
883
883
|
ignoreYear: !0
|
|
884
884
|
})
|
|
885
885
|
))
|
|
@@ -889,7 +889,7 @@ const _hoisted_1$l = {
|
|
|
889
889
|
value: "_isRange-week",
|
|
890
890
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
891
891
|
"onUpdate:modelValue": o[3] || (o[3] = () => {
|
|
892
|
-
|
|
892
|
+
u(
|
|
893
893
|
"update:model-value",
|
|
894
894
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
895
895
|
op: "this",
|
|
@@ -904,7 +904,7 @@ const _hoisted_1$l = {
|
|
|
904
904
|
value: "_isRange-month",
|
|
905
905
|
"model-value": `${unref(s).operator}-${unref(s).equator.unit}`,
|
|
906
906
|
"onUpdate:modelValue": o[4] || (o[4] = () => {
|
|
907
|
-
|
|
907
|
+
u(
|
|
908
908
|
"update:model-value",
|
|
909
909
|
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
910
910
|
op: "this",
|
|
@@ -934,9 +934,9 @@ const _hoisted_1$l = {
|
|
|
934
934
|
},
|
|
935
935
|
emits: ["update:model-value"],
|
|
936
936
|
setup(e, { emit: m }) {
|
|
937
|
-
const { t: a } = useI18n(),
|
|
938
|
-
(l) => l.value ==
|
|
939
|
-
) : TypeToTriggerOptions[
|
|
937
|
+
const { t: a } = useI18n(), d = e, u = m, s = computed(() => d.disabled ? TypeToTriggerOptions[d.campaignType].filter(
|
|
938
|
+
(l) => l.value == d.modelValue
|
|
939
|
+
) : TypeToTriggerOptions[d.campaignType]);
|
|
940
940
|
return (l, o) => {
|
|
941
941
|
const n = resolveComponent("FmCard");
|
|
942
942
|
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
@@ -944,14 +944,14 @@ const _hoisted_1$l = {
|
|
|
944
944
|
createElementVNode("div", _hoisted_3$b, [
|
|
945
945
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (r) => (openBlock(), createBlock(n, {
|
|
946
946
|
variant: "outlined",
|
|
947
|
-
disabled:
|
|
947
|
+
disabled: d.disabled,
|
|
948
948
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
949
949
|
"col-span-3": unref(s).length == 1,
|
|
950
950
|
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == r.value,
|
|
951
951
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
952
952
|
}]),
|
|
953
953
|
onClick: () => {
|
|
954
|
-
|
|
954
|
+
d.modelValue != r.value && !d.disabled && u("update:model-value", r.value);
|
|
955
955
|
},
|
|
956
956
|
key: r.name
|
|
957
957
|
}, {
|
|
@@ -980,12 +980,12 @@ const _hoisted_1$l = {
|
|
|
980
980
|
emits: ["update:model-value"],
|
|
981
981
|
setup(e, { emit: m }) {
|
|
982
982
|
const a = m;
|
|
983
|
-
return (
|
|
983
|
+
return (d, u) => {
|
|
984
984
|
const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
|
|
985
985
|
return openBlock(), createBlock(o, {
|
|
986
986
|
label: e.label,
|
|
987
987
|
"model-value": e.modelValue || "",
|
|
988
|
-
"onUpdate:modelValue":
|
|
988
|
+
"onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
|
|
989
989
|
}, {
|
|
990
990
|
"trigger-button": withCtx(({ opened: n }) => [
|
|
991
991
|
createVNode(l, {
|
|
@@ -998,7 +998,7 @@ const _hoisted_1$l = {
|
|
|
998
998
|
key: 0,
|
|
999
999
|
variant: "tertiary",
|
|
1000
1000
|
icon: "clear",
|
|
1001
|
-
onClick:
|
|
1001
|
+
onClick: u[0] || (u[0] = (r) => (r.stopPropagation(), a("update:model-value", null)))
|
|
1002
1002
|
})) : createCommentVNode("", !0)
|
|
1003
1003
|
]),
|
|
1004
1004
|
default: withCtx(() => [
|
|
@@ -1023,8 +1023,8 @@ const _hoisted_1$l = {
|
|
|
1023
1023
|
},
|
|
1024
1024
|
emits: ["update:model-value"],
|
|
1025
1025
|
setup(e, { emit: m }) {
|
|
1026
|
-
const { t: a } = useI18n(),
|
|
1027
|
-
return (
|
|
1026
|
+
const { t: a } = useI18n(), d = m;
|
|
1027
|
+
return (u, s) => {
|
|
1028
1028
|
var l, o;
|
|
1029
1029
|
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1030
1030
|
createElementVNode("div", _hoisted_2$d, [
|
|
@@ -1033,7 +1033,7 @@ const _hoisted_1$l = {
|
|
|
1033
1033
|
label: unref(a)("connect.common.startDate"),
|
|
1034
1034
|
"onUpdate:modelValue": s[0] || (s[0] = (n) => {
|
|
1035
1035
|
var r;
|
|
1036
|
-
return
|
|
1036
|
+
return d("update:model-value", {
|
|
1037
1037
|
startDate: n,
|
|
1038
1038
|
endDate: ((r = e.modelValue) == null ? void 0 : r.endDate) ?? null
|
|
1039
1039
|
});
|
|
@@ -1047,7 +1047,7 @@ const _hoisted_1$l = {
|
|
|
1047
1047
|
label: unref(a)("connect.common.endDate"),
|
|
1048
1048
|
"onUpdate:modelValue": s[1] || (s[1] = (n) => {
|
|
1049
1049
|
var r;
|
|
1050
|
-
return
|
|
1050
|
+
return d("update:model-value", {
|
|
1051
1051
|
startDate: ((r = e.modelValue) == null ? void 0 : r.startDate) ?? null,
|
|
1052
1052
|
endDate: n
|
|
1053
1053
|
});
|
|
@@ -1076,38 +1076,60 @@ const _hoisted_1$l = {
|
|
|
1076
1076
|
},
|
|
1077
1077
|
emits: ["update:model-value"],
|
|
1078
1078
|
setup(e, { emit: m }) {
|
|
1079
|
-
const { t: a } = useI18n(),
|
|
1079
|
+
const { t: a } = useI18n(), d = e, u = m, s = useCoreStore(), l = computed(
|
|
1080
1080
|
() => CountryTimezone[s.currentCountry.value || "MY"]
|
|
1081
1081
|
);
|
|
1082
1082
|
function o() {
|
|
1083
|
-
const
|
|
1084
|
-
return
|
|
1085
|
-
(
|
|
1083
|
+
const i = RuleBuilder.getRules(d.modelValue);
|
|
1084
|
+
return i.length == 0 ? "fixed" : i.some(
|
|
1085
|
+
(c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
|
|
1086
1086
|
) ? "repeating" : "fixed";
|
|
1087
1087
|
}
|
|
1088
|
-
const n = ref(o()), r = ref(!1),
|
|
1088
|
+
const n = ref(o()), r = ref(!1), p = ref(!1), h = computed(() => [
|
|
1089
1089
|
{ label: a("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1090
1090
|
{ label: a("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1091
|
-
]),
|
|
1092
|
-
const
|
|
1093
|
-
(
|
|
1094
|
-
),
|
|
1095
|
-
(
|
|
1091
|
+
]), y = computed(() => {
|
|
1092
|
+
const i = RuleBuilder.getRules(d.modelValue), c = i.find(
|
|
1093
|
+
(b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.date"
|
|
1094
|
+
), k = i.find(
|
|
1095
|
+
(b) => isRuleEntry(b) && RuleBuilder.simplify(b).property == "trigger.time"
|
|
1096
1096
|
);
|
|
1097
1097
|
return {
|
|
1098
|
-
date:
|
|
1099
|
-
time:
|
|
1098
|
+
date: c ? RuleBuilder.simplify(c).equator : null,
|
|
1099
|
+
time: k ? RuleBuilder.simplify(k).equator : null
|
|
1100
1100
|
};
|
|
1101
|
-
}),
|
|
1101
|
+
}), C = computed(
|
|
1102
1102
|
() => calculateNextScheduleAt(
|
|
1103
|
-
|
|
1103
|
+
d.modelValue,
|
|
1104
1104
|
/* @__PURE__ */ new Date(),
|
|
1105
|
-
|
|
1106
|
-
|
|
1105
|
+
d.startDate ? new Date(d.startDate) : /* @__PURE__ */ new Date(),
|
|
1106
|
+
d.endDate ? new Date(d.endDate) : void 0
|
|
1107
1107
|
)
|
|
1108
1108
|
);
|
|
1109
|
-
function x(
|
|
1110
|
-
|
|
1109
|
+
function x(i, c) {
|
|
1110
|
+
u(
|
|
1111
|
+
"update:model-value",
|
|
1112
|
+
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1113
|
+
RuleBuilder.constructEntry("trigger.date", "_rrule", i),
|
|
1114
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", c ?? "00:00")
|
|
1115
|
+
])
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
watch(
|
|
1119
|
+
() => d.startDate,
|
|
1120
|
+
(i, c) => {
|
|
1121
|
+
if (!i || i === c || n.value !== "repeating" || !y.value.date) return;
|
|
1122
|
+
const k = RRule.fromString(y.value.date), b = new RRule({
|
|
1123
|
+
...k.origOptions,
|
|
1124
|
+
dtstart: new Date(i)
|
|
1125
|
+
}).toString();
|
|
1126
|
+
b !== y.value.date && (x(b, y.value.time), p.value = !0);
|
|
1127
|
+
}
|
|
1128
|
+
);
|
|
1129
|
+
function v(i) {
|
|
1130
|
+
const c = i.value, k = getRruleAnchorDate({
|
|
1131
|
+
startDate: d.startDate ? new Date(d.startDate) : void 0
|
|
1132
|
+
}), b = c == "fixed" ? [
|
|
1111
1133
|
RuleBuilder.constructEntry(
|
|
1112
1134
|
"trigger.date",
|
|
1113
1135
|
"_isOnDate",
|
|
@@ -1119,7 +1141,7 @@ const _hoisted_1$l = {
|
|
|
1119
1141
|
"trigger.date",
|
|
1120
1142
|
"_rrule",
|
|
1121
1143
|
new RRule({
|
|
1122
|
-
dtstart:
|
|
1144
|
+
dtstart: k,
|
|
1123
1145
|
freq: RRule.DAILY,
|
|
1124
1146
|
interval: 1,
|
|
1125
1147
|
byhour: 0,
|
|
@@ -1130,73 +1152,59 @@ const _hoisted_1$l = {
|
|
|
1130
1152
|
),
|
|
1131
1153
|
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
1132
1154
|
];
|
|
1133
|
-
|
|
1155
|
+
u(
|
|
1134
1156
|
"update:model-value",
|
|
1135
1157
|
RuleBuilder.setRuleToGroup(
|
|
1136
1158
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1137
|
-
|
|
1159
|
+
b
|
|
1138
1160
|
)
|
|
1139
|
-
), n.value =
|
|
1161
|
+
), n.value = c, p.value = !1;
|
|
1140
1162
|
}
|
|
1141
|
-
function
|
|
1142
|
-
n.value == "fixed" ?
|
|
1163
|
+
function f(i) {
|
|
1164
|
+
n.value == "fixed" ? u(
|
|
1143
1165
|
"update:model-value",
|
|
1144
1166
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1145
1167
|
RuleBuilder.constructEntry(
|
|
1146
1168
|
"trigger.date",
|
|
1147
1169
|
"_isOnDate",
|
|
1148
|
-
|
|
1149
|
-
),
|
|
1150
|
-
RuleBuilder.constructEntry(
|
|
1151
|
-
"trigger.time",
|
|
1152
|
-
"_isOnTime",
|
|
1153
|
-
p.time
|
|
1154
|
-
)
|
|
1155
|
-
])
|
|
1156
|
-
) : i(
|
|
1157
|
-
"update:model-value",
|
|
1158
|
-
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1159
|
-
RuleBuilder.constructEntry(
|
|
1160
|
-
"trigger.date",
|
|
1161
|
-
"_rrule",
|
|
1162
|
-
p.date
|
|
1170
|
+
i.date
|
|
1163
1171
|
),
|
|
1164
1172
|
RuleBuilder.constructEntry(
|
|
1165
1173
|
"trigger.time",
|
|
1166
1174
|
"_isOnTime",
|
|
1167
|
-
|
|
1175
|
+
i.time
|
|
1168
1176
|
)
|
|
1169
1177
|
])
|
|
1170
|
-
);
|
|
1178
|
+
) : x(i.date, i.time), p.value = !1;
|
|
1171
1179
|
}
|
|
1172
|
-
return (
|
|
1173
|
-
const
|
|
1180
|
+
return (i, c) => {
|
|
1181
|
+
const k = resolveComponent("FmButtonGroup"), b = resolveComponent("FmTimePicker"), S = resolveComponent("FmIcon"), N = resolveComponent("FmTooltip"), B = resolveComponent("FmField"), w = resolveComponent("FmCard"), E = resolveComponent("FmPopover"), F = resolveComponent("FmDatePicker"), U = resolveComponent("FmHelperText");
|
|
1174
1182
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1175
|
-
createVNode(
|
|
1176
|
-
items: unref(
|
|
1177
|
-
"model-value": unref(
|
|
1178
|
-
"onUpdate:modelValue":
|
|
1183
|
+
createVNode(k, {
|
|
1184
|
+
items: unref(h),
|
|
1185
|
+
"model-value": unref(h).find((R) => R.value === unref(n)) ?? null,
|
|
1186
|
+
"onUpdate:modelValue": v,
|
|
1179
1187
|
class: "mb-8"
|
|
1180
1188
|
}, null, 8, ["items", "model-value"]),
|
|
1181
1189
|
createElementVNode("div", _hoisted_1$f, [
|
|
1182
1190
|
createElementVNode("div", _hoisted_2$c, [
|
|
1183
|
-
createVNode(
|
|
1191
|
+
createVNode(b, {
|
|
1184
1192
|
label: unref(a)("connect.template.rule.schedule.notify_time"),
|
|
1185
|
-
"model-value": unref(
|
|
1186
|
-
"onUpdate:modelValue":
|
|
1187
|
-
"helper-text": unref(
|
|
1188
|
-
"helper-state": unref(
|
|
1193
|
+
"model-value": unref(y).time,
|
|
1194
|
+
"onUpdate:modelValue": c[0] || (c[0] = (R) => f({ date: unref(y).date, time: R })),
|
|
1195
|
+
"helper-text": unref(y).time ? void 0 : unref(a)("connect.template.rule.schedule.time_required"),
|
|
1196
|
+
"helper-state": unref(y).time ? void 0 : "error"
|
|
1189
1197
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
1190
1198
|
unref(n) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
1191
1199
|
createElementVNode("div", _hoisted_4$8, [
|
|
1192
1200
|
createElementVNode("div", null, toDisplayString(unref(a)("connect.template.rule.schedule.notify_date")), 1),
|
|
1193
|
-
unref(
|
|
1201
|
+
unref(y).date ? (openBlock(), createBlock(N, {
|
|
1194
1202
|
key: 0,
|
|
1195
1203
|
"z-index": 9999,
|
|
1196
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
1204
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
|
|
1197
1205
|
}, {
|
|
1198
1206
|
default: withCtx(() => [
|
|
1199
|
-
createVNode(
|
|
1207
|
+
createVNode(S, {
|
|
1200
1208
|
name: "info",
|
|
1201
1209
|
size: "sm",
|
|
1202
1210
|
outline: !0
|
|
@@ -1205,31 +1213,31 @@ const _hoisted_1$l = {
|
|
|
1205
1213
|
_: 1
|
|
1206
1214
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
1207
1215
|
]),
|
|
1208
|
-
createVNode(
|
|
1216
|
+
createVNode(E, {
|
|
1209
1217
|
"show-popover": unref(r),
|
|
1210
|
-
onPopoverChanged:
|
|
1218
|
+
onPopoverChanged: c[3] || (c[3] = (R) => r.value = R)
|
|
1211
1219
|
}, {
|
|
1212
1220
|
"popover-button": withCtx(() => [
|
|
1213
|
-
createVNode(
|
|
1221
|
+
createVNode(B, {
|
|
1214
1222
|
class: "cursor-pointer",
|
|
1215
|
-
"helper-text": unref(
|
|
1216
|
-
"helper-state": unref(
|
|
1223
|
+
"helper-text": unref(y).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
|
|
1224
|
+
"helper-state": unref(y).date ? void 0 : "error"
|
|
1217
1225
|
}, {
|
|
1218
1226
|
default: withCtx(() => [
|
|
1219
|
-
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(
|
|
1227
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(unref(y).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options) : unref(a)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
1220
1228
|
]),
|
|
1221
1229
|
_: 1
|
|
1222
1230
|
}, 8, ["helper-text", "helper-state"])
|
|
1223
1231
|
]),
|
|
1224
1232
|
default: withCtx(() => [
|
|
1225
|
-
createVNode(
|
|
1233
|
+
createVNode(w, { class: "elevated p-8 w-[450px]" }, {
|
|
1226
1234
|
default: withCtx(() => [
|
|
1227
1235
|
createVNode(_sfc_main$q, {
|
|
1228
1236
|
"apply-button": !0,
|
|
1229
|
-
"model-value": unref(
|
|
1230
|
-
"start-date": e.startDate ? new Date(e.startDate) :
|
|
1231
|
-
onCancel:
|
|
1232
|
-
"onUpdate:modelValue":
|
|
1237
|
+
"model-value": unref(y).date || "",
|
|
1238
|
+
"start-date": e.startDate ? new Date(e.startDate) : /* @__PURE__ */ new Date(),
|
|
1239
|
+
onCancel: c[1] || (c[1] = (R) => r.value = !1),
|
|
1240
|
+
"onUpdate:modelValue": c[2] || (c[2] = (R) => (f({ date: R, time: unref(y).time }), r.value = !1))
|
|
1233
1241
|
}, null, 8, ["model-value", "start-date"])
|
|
1234
1242
|
]),
|
|
1235
1243
|
_: 1
|
|
@@ -1237,20 +1245,25 @@ const _hoisted_1$l = {
|
|
|
1237
1245
|
]),
|
|
1238
1246
|
_: 1
|
|
1239
1247
|
}, 8, ["show-popover"])
|
|
1240
|
-
])) : (openBlock(), createBlock(
|
|
1248
|
+
])) : (openBlock(), createBlock(F, {
|
|
1241
1249
|
key: 1,
|
|
1242
1250
|
label: unref(a)("connect.template.rule.schedule.notify_date"),
|
|
1243
|
-
"model-value": unref(
|
|
1244
|
-
"onUpdate:modelValue":
|
|
1245
|
-
"helper-text": unref(
|
|
1246
|
-
"helper-state": unref(
|
|
1251
|
+
"model-value": unref(y).date || "",
|
|
1252
|
+
"onUpdate:modelValue": c[4] || (c[4] = (R) => f({ date: R, time: unref(y).time })),
|
|
1253
|
+
"helper-text": unref(y).date ? void 0 : unref(a)("connect.template.rule.schedule.date_required"),
|
|
1254
|
+
"helper-state": unref(y).date ? void 0 : "error"
|
|
1247
1255
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
1248
1256
|
]),
|
|
1249
|
-
unref(
|
|
1257
|
+
unref(y).date && unref(y).time && unref(C) ? (openBlock(), createBlock(U, {
|
|
1250
1258
|
key: 0,
|
|
1251
|
-
text: `${unref(moment)(unref(
|
|
1252
|
-
${unref(moment)(unref(
|
|
1253
|
-
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1259
|
+
text: `${unref(moment)(unref(C)).isAfter(unref(moment)()) ? unref(a)("connect.template.rule.schedule.next_notification") : unref(a)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(C)).format("dddd, DD MMM YYYY")} at
|
|
1260
|
+
${unref(moment)(unref(C)).format("hh:mmA")}(UTC${unref(moment).tz(unref(l)).format("Z")}) (${unref(moment)(unref(C)).fromNow()})`
|
|
1261
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
1262
|
+
unref(p) ? (openBlock(), createBlock(U, {
|
|
1263
|
+
key: 1,
|
|
1264
|
+
text: "Repeating schedule was updated to stay anchored to the campaign start date.",
|
|
1265
|
+
state: "warning"
|
|
1266
|
+
})) : createCommentVNode("", !0)
|
|
1254
1267
|
])
|
|
1255
1268
|
], 64);
|
|
1256
1269
|
};
|
|
@@ -1264,7 +1277,7 @@ const _hoisted_1$l = {
|
|
|
1264
1277
|
},
|
|
1265
1278
|
emits: ["update:model-value"],
|
|
1266
1279
|
setup(e, { emit: m }) {
|
|
1267
|
-
const { t: a } = useI18n(),
|
|
1280
|
+
const { t: a } = useI18n(), d = e, u = m, s = computed(
|
|
1268
1281
|
() => [
|
|
1269
1282
|
{
|
|
1270
1283
|
label: a("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -1293,7 +1306,7 @@ const _hoisted_1$l = {
|
|
|
1293
1306
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1294
1307
|
}]),
|
|
1295
1308
|
onClick: () => {
|
|
1296
|
-
|
|
1309
|
+
d.modelValue != r.value && u("update:model-value", r.value);
|
|
1297
1310
|
},
|
|
1298
1311
|
key: r.value
|
|
1299
1312
|
}, {
|
|
@@ -1314,28 +1327,28 @@ const _hoisted_1$l = {
|
|
|
1314
1327
|
__name: "EditRewardPoolSheet",
|
|
1315
1328
|
emits: ["update:model-value"],
|
|
1316
1329
|
setup(e, { expose: m, emit: a }) {
|
|
1317
|
-
const
|
|
1318
|
-
var
|
|
1319
|
-
return ((
|
|
1320
|
-
(
|
|
1321
|
-
var
|
|
1322
|
-
return
|
|
1330
|
+
const d = useMembershipStore(), { minor: u } = useLoading, s = ref(!1), l = ref(), o = ref(), n = ref(0), r = computed(() => {
|
|
1331
|
+
var v;
|
|
1332
|
+
return ((v = d.loyaltyRewards.items.find(
|
|
1333
|
+
(f) => {
|
|
1334
|
+
var i;
|
|
1335
|
+
return f.value === ((i = l.value) == null ? void 0 : i.collectible);
|
|
1323
1336
|
}
|
|
1324
|
-
)) == null ? void 0 :
|
|
1325
|
-
}),
|
|
1326
|
-
const
|
|
1327
|
-
return
|
|
1337
|
+
)) == null ? void 0 : v.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1338
|
+
}), p = computed(() => {
|
|
1339
|
+
const x = r.value.safeParse(l.value);
|
|
1340
|
+
return x.success ? [] : x.error.errors;
|
|
1328
1341
|
});
|
|
1329
|
-
function
|
|
1330
|
-
|
|
1342
|
+
function h(x, v, f) {
|
|
1343
|
+
x && (l.value = v, n.value = f), s.value = x;
|
|
1331
1344
|
}
|
|
1332
|
-
const
|
|
1333
|
-
async function
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1345
|
+
const y = a;
|
|
1346
|
+
async function C() {
|
|
1347
|
+
const x = r.value.safeParse(l.value);
|
|
1348
|
+
x.success && (await u(
|
|
1336
1349
|
async () => {
|
|
1337
|
-
|
|
1338
|
-
|
|
1350
|
+
x.data.type === "VOUCHER" && o.value && (x.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1351
|
+
x.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
1339
1352
|
o.value
|
|
1340
1353
|
));
|
|
1341
1354
|
},
|
|
@@ -1343,44 +1356,44 @@ const _hoisted_1$l = {
|
|
|
1343
1356
|
message: "Uploading reward image",
|
|
1344
1357
|
successMessage: "Reward image updated"
|
|
1345
1358
|
}
|
|
1346
|
-
),
|
|
1359
|
+
), y("update:model-value", x.data, n.value));
|
|
1347
1360
|
}
|
|
1348
1361
|
return m({
|
|
1349
|
-
showSheet:
|
|
1350
|
-
}), (
|
|
1351
|
-
const
|
|
1352
|
-
return openBlock(), createBlock(
|
|
1362
|
+
showSheet: h
|
|
1363
|
+
}), (x, v) => {
|
|
1364
|
+
const f = resolveComponent("FmSelect"), i = resolveComponent("FmStepperField"), c = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
|
|
1365
|
+
return openBlock(), createBlock(k, {
|
|
1353
1366
|
"max-width": 560,
|
|
1354
1367
|
modelValue: unref(s),
|
|
1355
1368
|
"onUpdate:modelValue": [
|
|
1356
|
-
|
|
1357
|
-
|
|
1369
|
+
v[9] || (v[9] = (b) => isRef(s) ? s.value = b : null),
|
|
1370
|
+
v[10] || (v[10] = (b) => s.value = b)
|
|
1358
1371
|
],
|
|
1359
1372
|
header: "Edit reward",
|
|
1360
1373
|
"dismiss-away": ""
|
|
1361
1374
|
}, {
|
|
1362
1375
|
"side-sheet-footer": withCtx(() => [
|
|
1363
1376
|
createElementVNode("div", _hoisted_2$a, [
|
|
1364
|
-
createVNode(
|
|
1377
|
+
createVNode(c, {
|
|
1365
1378
|
variant: "primary",
|
|
1366
1379
|
type: "button",
|
|
1367
|
-
disabled: unref(
|
|
1380
|
+
disabled: unref(p).length > 0,
|
|
1368
1381
|
label: "Confirm",
|
|
1369
|
-
onClick:
|
|
1382
|
+
onClick: v[7] || (v[7] = (b) => C())
|
|
1370
1383
|
}, null, 8, ["disabled"]),
|
|
1371
|
-
createVNode(
|
|
1384
|
+
createVNode(c, {
|
|
1372
1385
|
variant: "secondary",
|
|
1373
1386
|
type: "button",
|
|
1374
1387
|
label: "Cancel",
|
|
1375
|
-
onClick:
|
|
1388
|
+
onClick: v[8] || (v[8] = (b) => s.value = !1)
|
|
1376
1389
|
})
|
|
1377
1390
|
])
|
|
1378
1391
|
]),
|
|
1379
1392
|
default: withCtx(() => {
|
|
1380
|
-
var b,
|
|
1393
|
+
var b, S, N;
|
|
1381
1394
|
return [
|
|
1382
1395
|
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1383
|
-
createVNode(
|
|
1396
|
+
createVNode(f, {
|
|
1384
1397
|
label: "Reward Type",
|
|
1385
1398
|
items: [
|
|
1386
1399
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1388,12 +1401,12 @@ const _hoisted_1$l = {
|
|
|
1388
1401
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1389
1402
|
],
|
|
1390
1403
|
"model-value": unref(l).type,
|
|
1391
|
-
"onUpdate:modelValue":
|
|
1392
|
-
|
|
1404
|
+
"onUpdate:modelValue": v[0] || (v[0] = (B) => {
|
|
1405
|
+
B == "NO_REWARD" ? l.value = {
|
|
1393
1406
|
type: "NO_REWARD",
|
|
1394
1407
|
collectible: null,
|
|
1395
1408
|
weight: 1
|
|
1396
|
-
} :
|
|
1409
|
+
} : B === "VOUCHER" ? l.value = {
|
|
1397
1410
|
collectible: null,
|
|
1398
1411
|
type: "VOUCHER",
|
|
1399
1412
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1408,7 +1421,7 @@ const _hoisted_1$l = {
|
|
|
1408
1421
|
},
|
|
1409
1422
|
weight: 1
|
|
1410
1423
|
} : l.value = {
|
|
1411
|
-
collectible: unref(
|
|
1424
|
+
collectible: unref(d).loyaltyRewards.raw[0]._id,
|
|
1412
1425
|
type: "LOYALTY",
|
|
1413
1426
|
earningOption: {
|
|
1414
1427
|
amount: 1,
|
|
@@ -1421,61 +1434,61 @@ const _hoisted_1$l = {
|
|
|
1421
1434
|
};
|
|
1422
1435
|
})
|
|
1423
1436
|
}, null, 8, ["model-value"]),
|
|
1424
|
-
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1437
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
|
|
1425
1438
|
key: 0,
|
|
1426
1439
|
label: "Loyalty type",
|
|
1427
1440
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "collectible", [unref(l).type])],
|
|
1428
|
-
items: unref(
|
|
1441
|
+
items: unref(d).loyaltyRewards.items,
|
|
1429
1442
|
"model-value": unref(l).collectible,
|
|
1430
|
-
"onUpdate:modelValue":
|
|
1443
|
+
"onUpdate:modelValue": v[1] || (v[1] = (B) => unref(l).collectible = B)
|
|
1431
1444
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1432
|
-
createVNode(
|
|
1445
|
+
createVNode(i, {
|
|
1433
1446
|
label: "Weight",
|
|
1434
1447
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "weight", [unref(l).type])],
|
|
1435
1448
|
"model-value": unref(l).weight,
|
|
1436
|
-
"onUpdate:modelValue":
|
|
1449
|
+
"onUpdate:modelValue": v[2] || (v[2] = (B) => l.value = {
|
|
1437
1450
|
...unref(l),
|
|
1438
|
-
weight:
|
|
1451
|
+
weight: B
|
|
1439
1452
|
})
|
|
1440
1453
|
}, null, 8, ["rules", "model-value"]),
|
|
1441
1454
|
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1442
|
-
((b = unref(
|
|
1443
|
-
(
|
|
1444
|
-
var
|
|
1445
|
-
return
|
|
1455
|
+
((b = unref(d).loyaltyRewards.items.find(
|
|
1456
|
+
(B) => {
|
|
1457
|
+
var w;
|
|
1458
|
+
return B.value === ((w = unref(l)) == null ? void 0 : w.collectible);
|
|
1446
1459
|
}
|
|
1447
1460
|
)) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1448
|
-
|
|
1461
|
+
v[11] || (v[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1449
1462
|
createVNode(_sfc_main$r, {
|
|
1450
1463
|
class: "mt-[-8px]",
|
|
1451
1464
|
rules: [
|
|
1452
1465
|
unref(ZodHelper).ruleAtPath(unref(r), "earningOption", [unref(l).type])
|
|
1453
1466
|
],
|
|
1454
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1455
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1467
|
+
"helper-state": unref(ZodHelper).helperState(unref(p), "earningOption"),
|
|
1468
|
+
"error-text": unref(ZodHelper).helperText(unref(p), "earningOption"),
|
|
1456
1469
|
"fixed-type": !0,
|
|
1457
1470
|
"model-value": unref(l).earningOption,
|
|
1458
|
-
"onUpdate:modelValue":
|
|
1471
|
+
"onUpdate:modelValue": v[3] || (v[3] = (B) => l.value = {
|
|
1459
1472
|
...unref(l),
|
|
1460
|
-
earningOption:
|
|
1473
|
+
earningOption: B
|
|
1461
1474
|
})
|
|
1462
1475
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1463
1476
|
], 64)) : createCommentVNode("", !0),
|
|
1464
|
-
|
|
1477
|
+
v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1465
1478
|
createVNode(_sfc_main$s, {
|
|
1466
1479
|
type: unref(l).type === "LOYALTY" ? "custom" : "range",
|
|
1467
|
-
"for-credit": unref(l).type === "LOYALTY" && ((
|
|
1468
|
-
(
|
|
1469
|
-
var
|
|
1470
|
-
return
|
|
1480
|
+
"for-credit": unref(l).type === "LOYALTY" && ((S = unref(d).loyaltyRewards.items.find(
|
|
1481
|
+
(B) => {
|
|
1482
|
+
var w;
|
|
1483
|
+
return B.value === ((w = unref(l)) == null ? void 0 : w.collectible);
|
|
1471
1484
|
}
|
|
1472
|
-
)) == null ? void 0 :
|
|
1485
|
+
)) == null ? void 0 : S.raw.type) === "CREDIT",
|
|
1473
1486
|
class: "!gap-24",
|
|
1474
1487
|
rules: [unref(ZodHelper).ruleAtPath(unref(r), "validityOption", [unref(l).type])],
|
|
1475
1488
|
"model-value": unref(l).validityOption,
|
|
1476
|
-
"onUpdate:modelValue":
|
|
1489
|
+
"onUpdate:modelValue": v[4] || (v[4] = (B) => l.value = {
|
|
1477
1490
|
...unref(l),
|
|
1478
|
-
validityOption:
|
|
1491
|
+
validityOption: B
|
|
1479
1492
|
})
|
|
1480
1493
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1481
1494
|
], 64)) : createCommentVNode("", !0),
|
|
@@ -1483,13 +1496,13 @@ const _hoisted_1$l = {
|
|
|
1483
1496
|
key: 2,
|
|
1484
1497
|
"reward-image": unref(o),
|
|
1485
1498
|
"model-value": ((N = unref(l)) == null ? void 0 : N.collectibleConfig) ?? void 0,
|
|
1486
|
-
"onUpdate:modelValue":
|
|
1499
|
+
"onUpdate:modelValue": v[5] || (v[5] = (B) => l.value = {
|
|
1487
1500
|
...unref(l),
|
|
1488
|
-
collectibleConfig:
|
|
1501
|
+
collectibleConfig: B
|
|
1489
1502
|
}),
|
|
1490
|
-
"onUpdate:rewardImage":
|
|
1503
|
+
"onUpdate:rewardImage": v[6] || (v[6] = (B) => o.value = B)
|
|
1491
1504
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1492
|
-
createVNode(JsonViewer, { json: unref(
|
|
1505
|
+
createVNode(JsonViewer, { json: unref(p) }, null, 8, ["json"])
|
|
1493
1506
|
])) : createCommentVNode("", !0)
|
|
1494
1507
|
];
|
|
1495
1508
|
}),
|
|
@@ -1517,36 +1530,36 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1517
1530
|
},
|
|
1518
1531
|
emits: ["update:model-value"],
|
|
1519
1532
|
setup(e, { emit: m }) {
|
|
1520
|
-
const a = e,
|
|
1521
|
-
const
|
|
1522
|
-
return
|
|
1533
|
+
const a = e, d = m, u = useMembershipStore(), { t: s } = useI18n(), l = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), n = computed(() => {
|
|
1534
|
+
const v = l.safeParse(o.value);
|
|
1535
|
+
return v.success ? [] : v.error.errors;
|
|
1523
1536
|
}), r = ref();
|
|
1524
|
-
function
|
|
1525
|
-
var
|
|
1526
|
-
const
|
|
1527
|
-
|
|
1528
|
-
}
|
|
1529
|
-
function v
|
|
1530
|
-
const
|
|
1531
|
-
(
|
|
1532
|
-
),
|
|
1537
|
+
function p(v, f) {
|
|
1538
|
+
var c;
|
|
1539
|
+
const i = [...o.value];
|
|
1540
|
+
i[f] = v, (c = r.value) == null || c.showSheet(!1), d("update:model-value", i);
|
|
1541
|
+
}
|
|
1542
|
+
function h(v) {
|
|
1543
|
+
const f = v.type == "VOUCHER" ? v.collectibleConfig : u.collectibles.find(
|
|
1544
|
+
(k) => k._id.toString() == v.collectible
|
|
1545
|
+
), i = CollectionUtils.formattedType((f == null ? void 0 : f.name) || ""), c = v.weight;
|
|
1533
1546
|
return {
|
|
1534
|
-
label: isNullOrEmpty(
|
|
1535
|
-
sublabel: `${
|
|
1547
|
+
label: isNullOrEmpty(i) ? "NO REWARD" : i,
|
|
1548
|
+
sublabel: `${c} (${(c / o.value.reduce((k, b) => k + b.weight, 0) * 100).toFixed(2)}%)`
|
|
1536
1549
|
};
|
|
1537
1550
|
}
|
|
1538
|
-
function
|
|
1539
|
-
var
|
|
1540
|
-
const
|
|
1541
|
-
(
|
|
1551
|
+
function y(v) {
|
|
1552
|
+
var i;
|
|
1553
|
+
const f = [...o.value];
|
|
1554
|
+
(i = r.value) == null || i.showSheet(!0, f[v], v);
|
|
1542
1555
|
}
|
|
1543
|
-
function
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1556
|
+
function C(v) {
|
|
1557
|
+
const f = [...o.value];
|
|
1558
|
+
f.splice(v, 1), d("update:model-value", f);
|
|
1546
1559
|
}
|
|
1547
|
-
function
|
|
1548
|
-
var
|
|
1549
|
-
(
|
|
1560
|
+
function x() {
|
|
1561
|
+
var v;
|
|
1562
|
+
(v = r.value) == null || v.showSheet(
|
|
1550
1563
|
!0,
|
|
1551
1564
|
{
|
|
1552
1565
|
type: "NO_REWARD",
|
|
@@ -1556,39 +1569,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1556
1569
|
o.value.length
|
|
1557
1570
|
);
|
|
1558
1571
|
}
|
|
1559
|
-
return (
|
|
1560
|
-
const
|
|
1572
|
+
return (v, f) => {
|
|
1573
|
+
const i = resolveComponent("FmButton"), c = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1561
1574
|
return openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1562
1575
|
createElementVNode("div", _hoisted_2$9, toDisplayString(unref(s)("connect.template.configure_reward_type")), 1),
|
|
1563
|
-
createVNode(
|
|
1576
|
+
createVNode(i, {
|
|
1564
1577
|
label: unref(s)("connect.campaign.rewardPool.addReward"),
|
|
1565
|
-
onClick:
|
|
1578
|
+
onClick: f[0] || (f[0] = (b) => x()),
|
|
1566
1579
|
variant: "plain",
|
|
1567
1580
|
icon: "add"
|
|
1568
1581
|
}, null, 8, ["label"]),
|
|
1569
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b,
|
|
1570
|
-
key:
|
|
1582
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (b, S) => (openBlock(), createBlock(c, {
|
|
1583
|
+
key: S,
|
|
1571
1584
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1572
1585
|
variant: "outlined",
|
|
1573
|
-
onClick: (N) =>
|
|
1586
|
+
onClick: (N) => y(S)
|
|
1574
1587
|
}, {
|
|
1575
1588
|
default: withCtx(() => {
|
|
1576
1589
|
var N;
|
|
1577
1590
|
return [
|
|
1578
1591
|
createElementVNode("div", null, [
|
|
1579
|
-
createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (N = b == null ? void 0 : b.earningOption) == null ? void 0 : N.amount : "") + " " + toDisplayString(
|
|
1580
|
-
createElementVNode("div", _hoisted_4$6, toDisplayString(
|
|
1592
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(b.type == "LOYALTY" ? (N = b == null ? void 0 : b.earningOption) == null ? void 0 : N.amount : "") + " " + toDisplayString(h(b).label), 1),
|
|
1593
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(h(b).sublabel), 1)
|
|
1581
1594
|
]),
|
|
1582
|
-
createVNode(
|
|
1595
|
+
createVNode(i, {
|
|
1583
1596
|
icon: "delete",
|
|
1584
1597
|
variant: "tertiary",
|
|
1585
|
-
onClick: (
|
|
1598
|
+
onClick: (B) => (B.stopPropagation(), C(S))
|
|
1586
1599
|
}, null, 8, ["onClick"])
|
|
1587
1600
|
];
|
|
1588
1601
|
}),
|
|
1589
1602
|
_: 2
|
|
1590
1603
|
}, 1032, ["onClick"]))), 128)),
|
|
1591
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(
|
|
1604
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(k, {
|
|
1592
1605
|
key: b.message,
|
|
1593
1606
|
text: b.message,
|
|
1594
1607
|
state: "error"
|
|
@@ -1596,7 +1609,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1596
1609
|
createVNode(_sfc_main$d, {
|
|
1597
1610
|
ref_key: "sheetRef",
|
|
1598
1611
|
ref: r,
|
|
1599
|
-
"onUpdate:modelValue":
|
|
1612
|
+
"onUpdate:modelValue": p
|
|
1600
1613
|
}, null, 512)
|
|
1601
1614
|
]);
|
|
1602
1615
|
};
|
|
@@ -1613,7 +1626,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1613
1626
|
},
|
|
1614
1627
|
emits: ["update:model-value"],
|
|
1615
1628
|
setup(e, { emit: m }) {
|
|
1616
|
-
const { t: a } = useI18n(),
|
|
1629
|
+
const { t: a } = useI18n(), d = e, u = m, s = computed(() => [
|
|
1617
1630
|
{
|
|
1618
1631
|
label: a("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
1619
1632
|
description: a("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -1621,39 +1634,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1621
1634
|
}
|
|
1622
1635
|
]);
|
|
1623
1636
|
return (l, o) => {
|
|
1624
|
-
var
|
|
1625
|
-
const n = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"),
|
|
1637
|
+
var h, y, C;
|
|
1638
|
+
const n = resolveComponent("FmSwitch"), r = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
|
|
1626
1639
|
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1627
1640
|
createVNode(n, {
|
|
1628
1641
|
label: unref(a)("connect.template.promotion_game.enable"),
|
|
1629
|
-
"model-value": !!((
|
|
1630
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
1642
|
+
"model-value": !!((h = e.modelValue) != null && h.gameType),
|
|
1643
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => x ? u("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : u("update:model-value", null))
|
|
1631
1644
|
}, null, 8, ["label", "model-value"]),
|
|
1632
|
-
((
|
|
1633
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (
|
|
1634
|
-
var
|
|
1645
|
+
((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1646
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (x) => {
|
|
1647
|
+
var v, f;
|
|
1635
1648
|
return openBlock(), createBlock(r, {
|
|
1636
1649
|
variant: "outlined",
|
|
1637
1650
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1638
1651
|
"col-span-2": unref(s).length == 1,
|
|
1639
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
1640
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
1652
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.gameType) == x.value,
|
|
1653
|
+
"hover:bg-fm-color-opacity-sm": ((f = e.modelValue) == null ? void 0 : f.gameType) != x.value
|
|
1641
1654
|
}]),
|
|
1642
1655
|
onClick: () => {
|
|
1643
|
-
var
|
|
1644
|
-
((
|
|
1656
|
+
var i;
|
|
1657
|
+
((i = d.modelValue) == null ? void 0 : i.gameType) != x.value && u("update:model-value", { gameType: x.value });
|
|
1645
1658
|
},
|
|
1646
|
-
key:
|
|
1659
|
+
key: x.value
|
|
1647
1660
|
}, {
|
|
1648
1661
|
default: withCtx(() => [
|
|
1649
|
-
createElementVNode("div", _hoisted_3$6, toDisplayString(
|
|
1650
|
-
createElementVNode("div", _hoisted_4$5, toDisplayString(
|
|
1662
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(x.label), 1),
|
|
1663
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(x.description), 1)
|
|
1651
1664
|
]),
|
|
1652
1665
|
_: 2
|
|
1653
1666
|
}, 1032, ["class", "onClick"]);
|
|
1654
1667
|
}), 128))
|
|
1655
1668
|
])) : createCommentVNode("", !0),
|
|
1656
|
-
((
|
|
1669
|
+
((C = e.modelValue) == null ? void 0 : C.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
|
|
1657
1670
|
key: 1,
|
|
1658
1671
|
text: unref(a)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
1659
1672
|
state: "warning"
|
|
@@ -1677,13 +1690,13 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1677
1690
|
},
|
|
1678
1691
|
emits: ["update:model-value"],
|
|
1679
1692
|
setup(e, { emit: m }) {
|
|
1680
|
-
const { t: a } = useI18n(),
|
|
1693
|
+
const { t: a } = useI18n(), d = e, u = m, s = ref(d.modelValue ?? {}), l = ref(
|
|
1681
1694
|
(() => {
|
|
1682
|
-
const
|
|
1683
|
-
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((
|
|
1684
|
-
const
|
|
1685
|
-
|
|
1686
|
-
}),
|
|
1695
|
+
const h = {};
|
|
1696
|
+
return s.value.workingHour && Object.keys(s.value.workingHour).forEach((y) => {
|
|
1697
|
+
const C = s.value.workingHour[y];
|
|
1698
|
+
C && "periods" in C && Array.isArray(C.periods) ? h[y] = C.periods : Array.isArray(C) && (h[y] = C);
|
|
1699
|
+
}), h;
|
|
1687
1700
|
})()
|
|
1688
1701
|
), o = [
|
|
1689
1702
|
{ key: "mon", label: "Monday" },
|
|
@@ -1693,30 +1706,30 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1693
1706
|
{ key: "fri", label: "Friday" },
|
|
1694
1707
|
{ key: "sat", label: "Saturday" },
|
|
1695
1708
|
{ key: "sun", label: "Sunday" }
|
|
1696
|
-
], n = (
|
|
1697
|
-
l.value[
|
|
1709
|
+
], n = (h) => {
|
|
1710
|
+
l.value[h] || (l.value[h] = []), l.value[h].push({
|
|
1698
1711
|
startTime: "00:00",
|
|
1699
1712
|
endTime: "23:59"
|
|
1700
|
-
}),
|
|
1701
|
-
}, r = (
|
|
1702
|
-
l.value[
|
|
1703
|
-
},
|
|
1704
|
-
const
|
|
1705
|
-
(
|
|
1706
|
-
periods: l.value[
|
|
1707
|
-
}),
|
|
1713
|
+
}), p();
|
|
1714
|
+
}, r = (h, y) => {
|
|
1715
|
+
l.value[h] && l.value[h].length > y && (l.value[h].splice(y, 1), l.value[h].length === 0 && delete l.value[h], p());
|
|
1716
|
+
}, p = () => {
|
|
1717
|
+
const h = Object.keys(l.value).reduce(
|
|
1718
|
+
(y, C) => (l.value[C] && l.value[C].length > 0 && (y[C] = {
|
|
1719
|
+
periods: l.value[C]
|
|
1720
|
+
}), y),
|
|
1708
1721
|
{}
|
|
1709
1722
|
);
|
|
1710
|
-
s.value.workingHour = Object.keys(
|
|
1723
|
+
s.value.workingHour = Object.keys(h).length > 0 ? h : void 0;
|
|
1711
1724
|
};
|
|
1712
|
-
return watch(s, () =>
|
|
1713
|
-
const
|
|
1725
|
+
return watch(s, () => u("update:model-value", s.value), { deep: !0 }), watch(l, p, { deep: !0 }), (h, y) => {
|
|
1726
|
+
const C = resolveComponent("FmSelect"), x = resolveComponent("FmStepperField"), v = resolveComponent("FmCheckbox"), f = resolveComponent("FmTimePicker"), i = resolveComponent("FmButton");
|
|
1714
1727
|
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1715
1728
|
createElementVNode("div", _hoisted_2$7, [
|
|
1716
|
-
createVNode(
|
|
1729
|
+
createVNode(C, {
|
|
1717
1730
|
label: unref(a)("connect.template.eaterType"),
|
|
1718
1731
|
modelValue: unref(s).eaterType,
|
|
1719
|
-
"onUpdate:modelValue":
|
|
1732
|
+
"onUpdate:modelValue": y[0] || (y[0] = (c) => unref(s).eaterType = c),
|
|
1720
1733
|
items: [
|
|
1721
1734
|
{ label: unref(a)("connect.template.allEaters"), value: "all" },
|
|
1722
1735
|
{ label: unref(a)("connect.template.newEatersOnly"), value: "new" },
|
|
@@ -1727,9 +1740,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1727
1740
|
],
|
|
1728
1741
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "eaterType")]
|
|
1729
1742
|
}, null, 8, ["label", "modelValue", "items", "rules"]),
|
|
1730
|
-
createVNode(
|
|
1743
|
+
createVNode(x, {
|
|
1731
1744
|
modelValue: unref(s).minBasketAmount,
|
|
1732
|
-
"onUpdate:modelValue":
|
|
1745
|
+
"onUpdate:modelValue": y[1] || (y[1] = (c) => unref(s).minBasketAmount = c),
|
|
1733
1746
|
"show-steppers": !1,
|
|
1734
1747
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "minBasketAmount")]
|
|
1735
1748
|
}, {
|
|
@@ -1743,9 +1756,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1743
1756
|
]),
|
|
1744
1757
|
_: 1
|
|
1745
1758
|
}, 8, ["modelValue", "rules"]),
|
|
1746
|
-
createVNode(
|
|
1759
|
+
createVNode(x, {
|
|
1747
1760
|
modelValue: unref(s).bundleQuantity,
|
|
1748
|
-
"onUpdate:modelValue":
|
|
1761
|
+
"onUpdate:modelValue": y[2] || (y[2] = (c) => unref(s).bundleQuantity = c),
|
|
1749
1762
|
"show-steppers": !1,
|
|
1750
1763
|
rules: [unref(ZodHelper).ruleAtPath(e.schema, "bundleQuantity")]
|
|
1751
1764
|
}, {
|
|
@@ -1763,46 +1776,46 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1763
1776
|
createElementVNode("div", _hoisted_3$5, [
|
|
1764
1777
|
createElementVNode("div", _hoisted_4$4, [
|
|
1765
1778
|
createElementVNode("div", _hoisted_5$4, toDisplayString(unref(a)("connect.template.operationHours")), 1),
|
|
1766
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(o, (
|
|
1767
|
-
key:
|
|
1779
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(o, (c) => createElementVNode("div", {
|
|
1780
|
+
key: c.key,
|
|
1768
1781
|
class: "space-y-2"
|
|
1769
1782
|
}, [
|
|
1770
1783
|
createElementVNode("div", _hoisted_6$3, [
|
|
1771
|
-
createVNode(
|
|
1772
|
-
label:
|
|
1773
|
-
"model-value": !!(unref(l)[
|
|
1774
|
-
"onUpdate:modelValue": (
|
|
1775
|
-
|
|
1784
|
+
createVNode(v, {
|
|
1785
|
+
label: c.label,
|
|
1786
|
+
"model-value": !!(unref(l)[c.key] && unref(l)[c.key].length > 0),
|
|
1787
|
+
"onUpdate:modelValue": (k) => {
|
|
1788
|
+
k ? n(c.key) : (unref(l)[c.key] = [], delete unref(l)[c.key], p());
|
|
1776
1789
|
}
|
|
1777
1790
|
}, null, 8, ["label", "model-value", "onUpdate:modelValue"])
|
|
1778
1791
|
]),
|
|
1779
|
-
unref(l)[
|
|
1780
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[
|
|
1792
|
+
unref(l)[c.key] && unref(l)[c.key].length > 0 ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
|
|
1793
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l)[c.key] || [], (k, b) => (openBlock(), createElementBlock("div", {
|
|
1781
1794
|
key: b,
|
|
1782
1795
|
class: "flex items-center space-x-2 w-100"
|
|
1783
1796
|
}, [
|
|
1784
|
-
createVNode(
|
|
1785
|
-
"model-value":
|
|
1786
|
-
"onUpdate:modelValue": (
|
|
1787
|
-
unref(l)[
|
|
1797
|
+
createVNode(f, {
|
|
1798
|
+
"model-value": k.startTime || "",
|
|
1799
|
+
"onUpdate:modelValue": (S) => {
|
|
1800
|
+
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].startTime = S || "", p());
|
|
1788
1801
|
}
|
|
1789
1802
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1790
|
-
|
|
1791
|
-
createVNode(
|
|
1792
|
-
"model-value":
|
|
1793
|
-
"onUpdate:modelValue": (
|
|
1794
|
-
unref(l)[
|
|
1803
|
+
y[3] || (y[3] = createElementVNode("span", null, "to", -1)),
|
|
1804
|
+
createVNode(f, {
|
|
1805
|
+
"model-value": k.endTime || "",
|
|
1806
|
+
"onUpdate:modelValue": (S) => {
|
|
1807
|
+
unref(l)[c.key] && unref(l)[c.key][b] && (unref(l)[c.key][b].endTime = S || "", p());
|
|
1795
1808
|
}
|
|
1796
1809
|
}, null, 8, ["model-value", "onUpdate:modelValue"]),
|
|
1797
|
-
createVNode(
|
|
1810
|
+
createVNode(i, {
|
|
1798
1811
|
variant: "tertiary",
|
|
1799
1812
|
size: "sm",
|
|
1800
|
-
onClick: (
|
|
1813
|
+
onClick: (S) => r(c.key, b),
|
|
1801
1814
|
icon: "close"
|
|
1802
1815
|
}, null, 8, ["onClick"]),
|
|
1803
|
-
b === 0 ? (openBlock(), createBlock(
|
|
1816
|
+
b === 0 ? (openBlock(), createBlock(i, {
|
|
1804
1817
|
key: 0,
|
|
1805
|
-
onClick: (
|
|
1818
|
+
onClick: (S) => n(c.key),
|
|
1806
1819
|
icon: "add",
|
|
1807
1820
|
variant: "plain"
|
|
1808
1821
|
}, null, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
@@ -1827,8 +1840,8 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1827
1840
|
},
|
|
1828
1841
|
emits: ["update:model-value"],
|
|
1829
1842
|
setup(e, { emit: m }) {
|
|
1830
|
-
const { t: a } = useI18n(),
|
|
1831
|
-
return watch(s, () =>
|
|
1843
|
+
const { t: a } = useI18n(), d = e, u = m, s = ref(d.modelValue ?? {});
|
|
1844
|
+
return watch(s, () => u("update:model-value", s.value)), (l, o) => {
|
|
1832
1845
|
const n = resolveComponent("FmStepperField");
|
|
1833
1846
|
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1834
1847
|
createElementVNode("div", _hoisted_2$6, [
|
|
@@ -1877,7 +1890,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1877
1890
|
},
|
|
1878
1891
|
emits: ["update:model-value"],
|
|
1879
1892
|
setup(e, { emit: m }) {
|
|
1880
|
-
const { t: a } = useI18n(),
|
|
1893
|
+
const { t: a } = useI18n(), d = e, u = m, s = computed(() => [
|
|
1881
1894
|
{
|
|
1882
1895
|
label: a("connect.campaign.mission.typeOption.STAMP.label"),
|
|
1883
1896
|
description: a("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -1902,7 +1915,7 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1902
1915
|
"hover:bg-fm-color-opacity-sm": e.modelValue != r.value
|
|
1903
1916
|
}]),
|
|
1904
1917
|
onClick: () => {
|
|
1905
|
-
|
|
1918
|
+
d.modelValue != r.value && u("update:model-value", r.value);
|
|
1906
1919
|
},
|
|
1907
1920
|
key: r.value
|
|
1908
1921
|
}, {
|
|
@@ -1932,14 +1945,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1932
1945
|
emits: ["update:model-value"],
|
|
1933
1946
|
setup(e, { emit: m }) {
|
|
1934
1947
|
const a = m;
|
|
1935
|
-
return (
|
|
1948
|
+
return (d, u) => {
|
|
1936
1949
|
const s = resolveComponent("FmStepperField");
|
|
1937
1950
|
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1938
|
-
|
|
1951
|
+
u[1] || (u[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1)),
|
|
1939
1952
|
createVNode(s, {
|
|
1940
1953
|
label: "Maximum to collect",
|
|
1941
1954
|
"model-value": e.modelValue || null,
|
|
1942
|
-
"onUpdate:modelValue":
|
|
1955
|
+
"onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
|
|
1943
1956
|
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1944
1957
|
"helper-state": e.helperState || "none"
|
|
1945
1958
|
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
@@ -1956,28 +1969,28 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1956
1969
|
},
|
|
1957
1970
|
emits: ["update:model-value"],
|
|
1958
1971
|
setup(e, { expose: m, emit: a }) {
|
|
1959
|
-
const
|
|
1960
|
-
var
|
|
1961
|
-
return ((
|
|
1962
|
-
(
|
|
1963
|
-
var
|
|
1964
|
-
return
|
|
1972
|
+
const d = e, u = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), o = ref(), n = ref(), r = ref(0), p = computed(() => {
|
|
1973
|
+
var i;
|
|
1974
|
+
return ((i = u.loyaltyRewards.items.find(
|
|
1975
|
+
(c) => {
|
|
1976
|
+
var k;
|
|
1977
|
+
return c.value === ((k = o.value) == null ? void 0 : k.collectible);
|
|
1965
1978
|
}
|
|
1966
|
-
)) == null ? void 0 :
|
|
1967
|
-
}),
|
|
1968
|
-
const
|
|
1969
|
-
return
|
|
1979
|
+
)) == null ? void 0 : i.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
|
|
1980
|
+
}), h = computed(() => {
|
|
1981
|
+
const f = p.value.safeParse(o.value);
|
|
1982
|
+
return f.success ? [] : f.error.errors;
|
|
1970
1983
|
});
|
|
1971
|
-
function
|
|
1972
|
-
|
|
1984
|
+
function y(f, i, c) {
|
|
1985
|
+
f && (o.value = i, r.value = c), l.value = f;
|
|
1973
1986
|
}
|
|
1974
|
-
const
|
|
1975
|
-
async function
|
|
1976
|
-
const
|
|
1977
|
-
|
|
1987
|
+
const C = a;
|
|
1988
|
+
async function x() {
|
|
1989
|
+
const f = p.value.safeParse(o.value);
|
|
1990
|
+
f.success && (await s(
|
|
1978
1991
|
async () => {
|
|
1979
|
-
|
|
1980
|
-
|
|
1992
|
+
f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1993
|
+
f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
1981
1994
|
n.value
|
|
1982
1995
|
));
|
|
1983
1996
|
},
|
|
@@ -1985,40 +1998,40 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
1985
1998
|
message: "Uploading reward image",
|
|
1986
1999
|
successMessage: "Reward image updated"
|
|
1987
2000
|
}
|
|
1988
|
-
),
|
|
2001
|
+
), C("update:model-value", f.data, r.value));
|
|
1989
2002
|
}
|
|
1990
|
-
const
|
|
2003
|
+
const v = ref();
|
|
1991
2004
|
return m({
|
|
1992
|
-
showSheet:
|
|
1993
|
-
}), (
|
|
1994
|
-
const
|
|
2005
|
+
showSheet: y
|
|
2006
|
+
}), (f, i) => {
|
|
2007
|
+
const c = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), S = resolveComponent("FmButton"), N = resolveComponent("FmSideSheet");
|
|
1995
2008
|
return openBlock(), createBlock(N, {
|
|
1996
2009
|
"max-width": 560,
|
|
1997
2010
|
modelValue: unref(l),
|
|
1998
2011
|
"onUpdate:modelValue": [
|
|
1999
|
-
|
|
2000
|
-
|
|
2012
|
+
i[10] || (i[10] = (B) => isRef(l) ? l.value = B : null),
|
|
2013
|
+
i[11] || (i[11] = (B) => l.value = B)
|
|
2001
2014
|
],
|
|
2002
2015
|
header: "Edit reward",
|
|
2003
2016
|
"dismiss-away": ""
|
|
2004
2017
|
}, {
|
|
2005
2018
|
"side-sheet-footer": withCtx(() => [
|
|
2006
2019
|
createElementVNode("div", _hoisted_1$6, [
|
|
2007
|
-
createVNode(
|
|
2020
|
+
createVNode(S, {
|
|
2008
2021
|
variant: "primary",
|
|
2009
2022
|
type: "button",
|
|
2010
2023
|
label: "Confirm",
|
|
2011
|
-
disabled: unref(
|
|
2012
|
-
onClick:
|
|
2013
|
-
var
|
|
2014
|
-
return (
|
|
2024
|
+
disabled: unref(h).length > 0,
|
|
2025
|
+
onClick: i[8] || (i[8] = async () => {
|
|
2026
|
+
var B;
|
|
2027
|
+
return (B = unref(v)) == null ? void 0 : B.validateInputs();
|
|
2015
2028
|
})
|
|
2016
2029
|
}, null, 8, ["disabled"]),
|
|
2017
|
-
createVNode(
|
|
2030
|
+
createVNode(S, {
|
|
2018
2031
|
variant: "secondary",
|
|
2019
2032
|
type: "button",
|
|
2020
2033
|
label: "Cancel",
|
|
2021
|
-
onClick:
|
|
2034
|
+
onClick: i[9] || (i[9] = (B) => l.value = !1)
|
|
2022
2035
|
})
|
|
2023
2036
|
])
|
|
2024
2037
|
]),
|
|
@@ -2028,39 +2041,39 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2028
2041
|
key: 0,
|
|
2029
2042
|
class: "flex flex-col gap-y-24",
|
|
2030
2043
|
ref_key: "formRef",
|
|
2031
|
-
ref:
|
|
2032
|
-
onValidationSuccess:
|
|
2044
|
+
ref: v,
|
|
2045
|
+
onValidationSuccess: i[7] || (i[7] = (B) => x())
|
|
2033
2046
|
}, {
|
|
2034
2047
|
default: withCtx(() => {
|
|
2035
|
-
var
|
|
2048
|
+
var B, w;
|
|
2036
2049
|
return [
|
|
2037
|
-
unref(o).type ? (openBlock(), createBlock(
|
|
2050
|
+
unref(o).type ? (openBlock(), createBlock(c, {
|
|
2038
2051
|
key: 0,
|
|
2039
2052
|
label: "Threshold",
|
|
2040
2053
|
rules: [
|
|
2041
2054
|
unref(ZodHelper).toRule(
|
|
2042
2055
|
unref(z).number().min(1).max(
|
|
2043
|
-
|
|
2044
|
-
`Number cannot be more than ${
|
|
2056
|
+
d.maxThreshold,
|
|
2057
|
+
`Number cannot be more than ${d.maxThreshold}`
|
|
2045
2058
|
)
|
|
2046
2059
|
)
|
|
2047
2060
|
],
|
|
2048
2061
|
"model-value": unref(o).threshold,
|
|
2049
|
-
"onUpdate:modelValue":
|
|
2062
|
+
"onUpdate:modelValue": i[0] || (i[0] = (E) => o.value = {
|
|
2050
2063
|
...unref(o),
|
|
2051
|
-
threshold:
|
|
2064
|
+
threshold: E
|
|
2052
2065
|
})
|
|
2053
2066
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
2054
|
-
createVNode(
|
|
2067
|
+
createVNode(k, {
|
|
2055
2068
|
label: "Reward Type",
|
|
2056
2069
|
items: [
|
|
2057
2070
|
{ label: "Voucher", value: "VOUCHER" },
|
|
2058
2071
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2059
2072
|
],
|
|
2060
2073
|
"model-value": unref(o).type,
|
|
2061
|
-
"onUpdate:modelValue":
|
|
2062
|
-
var
|
|
2063
|
-
|
|
2074
|
+
"onUpdate:modelValue": i[1] || (i[1] = (E) => {
|
|
2075
|
+
var F, U;
|
|
2076
|
+
E === "VOUCHER" ? o.value = {
|
|
2064
2077
|
collectible: null,
|
|
2065
2078
|
type: "VOUCHER",
|
|
2066
2079
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2073,9 +2086,9 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2073
2086
|
validityOption: {
|
|
2074
2087
|
validForDay: 7
|
|
2075
2088
|
},
|
|
2076
|
-
threshold: (
|
|
2089
|
+
threshold: (F = unref(o)) == null ? void 0 : F.threshold
|
|
2077
2090
|
} : o.value = {
|
|
2078
|
-
collectible: unref(
|
|
2091
|
+
collectible: unref(u).loyaltyRewards.raw[0]._id,
|
|
2079
2092
|
type: "LOYALTY",
|
|
2080
2093
|
earningOption: {
|
|
2081
2094
|
amount: 1,
|
|
@@ -2084,60 +2097,60 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2084
2097
|
validityOption: {
|
|
2085
2098
|
validForDay: 7
|
|
2086
2099
|
},
|
|
2087
|
-
threshold: (
|
|
2100
|
+
threshold: (U = unref(o)) == null ? void 0 : U.threshold
|
|
2088
2101
|
};
|
|
2089
2102
|
})
|
|
2090
2103
|
}, null, 8, ["model-value"]),
|
|
2091
|
-
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
2104
|
+
unref(o).type == "LOYALTY" ? (openBlock(), createBlock(k, {
|
|
2092
2105
|
key: 1,
|
|
2093
2106
|
label: "Loyalty type",
|
|
2094
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2095
|
-
items: unref(
|
|
2107
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(o).type])],
|
|
2108
|
+
items: unref(u).loyaltyRewards.items,
|
|
2096
2109
|
"model-value": unref(o).collectible,
|
|
2097
|
-
"onUpdate:modelValue":
|
|
2110
|
+
"onUpdate:modelValue": i[2] || (i[2] = (E) => unref(o).collectible = E)
|
|
2098
2111
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2099
2112
|
unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2100
|
-
|
|
2113
|
+
i[12] || (i[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2101
2114
|
createVNode(_sfc_main$r, {
|
|
2102
2115
|
class: "mt-[-8px]",
|
|
2103
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2104
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2105
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
2116
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(o).type])],
|
|
2117
|
+
"helper-state": unref(ZodHelper).helperState(unref(h), "earningOption"),
|
|
2118
|
+
"error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
|
|
2106
2119
|
"fixed-type": !0,
|
|
2107
2120
|
"model-value": unref(o).earningOption,
|
|
2108
|
-
"onUpdate:modelValue":
|
|
2121
|
+
"onUpdate:modelValue": i[3] || (i[3] = (E) => o.value = {
|
|
2109
2122
|
...unref(o),
|
|
2110
|
-
earningOption:
|
|
2123
|
+
earningOption: E
|
|
2111
2124
|
})
|
|
2112
2125
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
2113
2126
|
createVNode(_sfc_main$s, {
|
|
2114
2127
|
class: "!gap-24",
|
|
2115
2128
|
type: unref(o).type === "LOYALTY" ? "custom" : "range",
|
|
2116
|
-
"for-credit": unref(o).type === "LOYALTY" && ((
|
|
2117
|
-
(
|
|
2118
|
-
var
|
|
2119
|
-
return
|
|
2129
|
+
"for-credit": unref(o).type === "LOYALTY" && ((B = unref(u).loyaltyRewards.items.find(
|
|
2130
|
+
(E) => {
|
|
2131
|
+
var F;
|
|
2132
|
+
return E.value === ((F = unref(o)) == null ? void 0 : F.collectible);
|
|
2120
2133
|
}
|
|
2121
|
-
)) == null ? void 0 :
|
|
2122
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2134
|
+
)) == null ? void 0 : B.raw.type) === "CREDIT",
|
|
2135
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(o).type])],
|
|
2123
2136
|
"model-value": unref(o).validityOption,
|
|
2124
|
-
"onUpdate:modelValue":
|
|
2137
|
+
"onUpdate:modelValue": i[4] || (i[4] = (E) => o.value = {
|
|
2125
2138
|
...unref(o),
|
|
2126
|
-
validityOption:
|
|
2139
|
+
validityOption: E
|
|
2127
2140
|
})
|
|
2128
2141
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2129
2142
|
], 64)) : createCommentVNode("", !0),
|
|
2130
2143
|
unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$t, {
|
|
2131
2144
|
key: 3,
|
|
2132
2145
|
"reward-image": unref(n),
|
|
2133
|
-
"model-value": ((
|
|
2134
|
-
"onUpdate:modelValue":
|
|
2146
|
+
"model-value": ((w = unref(o)) == null ? void 0 : w.collectibleConfig) ?? void 0,
|
|
2147
|
+
"onUpdate:modelValue": i[5] || (i[5] = (E) => o.value = {
|
|
2135
2148
|
...unref(o),
|
|
2136
|
-
collectibleConfig:
|
|
2149
|
+
collectibleConfig: E
|
|
2137
2150
|
}),
|
|
2138
|
-
"onUpdate:rewardImage":
|
|
2151
|
+
"onUpdate:rewardImage": i[6] || (i[6] = (E) => n.value = E)
|
|
2139
2152
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2140
|
-
createVNode(JsonViewer, { json: unref(
|
|
2153
|
+
createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
|
|
2141
2154
|
];
|
|
2142
2155
|
}),
|
|
2143
2156
|
_: 1
|
|
@@ -2171,19 +2184,19 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2171
2184
|
}
|
|
2172
2185
|
},
|
|
2173
2186
|
setup(e) {
|
|
2174
|
-
const m = e, { maxRange: a, currentRange:
|
|
2175
|
-
() => Math.min(
|
|
2187
|
+
const m = e, { maxRange: a, currentRange: d, markers: u } = toRefs(m), s = computed(
|
|
2188
|
+
() => Math.min(d.value / a.value * 100, 100)
|
|
2176
2189
|
), l = (o) => o / a.value * 100;
|
|
2177
2190
|
return (o, n) => {
|
|
2178
2191
|
const r = resolveComponent("FmIcon");
|
|
2179
2192
|
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2180
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (
|
|
2193
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (p) => (openBlock(), createBlock(r, {
|
|
2181
2194
|
class: normalizeClass(
|
|
2182
|
-
unref(
|
|
2195
|
+
unref(d) >= p ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2183
2196
|
),
|
|
2184
|
-
outline: unref(
|
|
2185
|
-
key:
|
|
2186
|
-
name: unref(
|
|
2197
|
+
outline: unref(d) < p,
|
|
2198
|
+
key: p,
|
|
2199
|
+
name: unref(u).some((h) => h === p) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2187
2200
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
2188
2201
|
])) : (openBlock(), createElementBlock("div", {
|
|
2189
2202
|
key: 1,
|
|
@@ -2193,10 +2206,10 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2193
2206
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
2194
2207
|
style: normalizeStyle({ width: unref(s) + "%" })
|
|
2195
2208
|
}, null, 4),
|
|
2196
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2197
|
-
key:
|
|
2209
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (p, h) => (openBlock(), createElementBlock("div", {
|
|
2210
|
+
key: h,
|
|
2198
2211
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
2199
|
-
style: normalizeStyle({ left: l(
|
|
2212
|
+
style: normalizeStyle({ left: l(p) + "%" })
|
|
2200
2213
|
}, [
|
|
2201
2214
|
createElementVNode("div", _hoisted_2$4, [
|
|
2202
2215
|
createElementVNode("div", {
|
|
@@ -2210,14 +2223,14 @@ const _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-e
|
|
|
2210
2223
|
}
|
|
2211
2224
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2212
2225
|
function changeKeysFactory(e) {
|
|
2213
|
-
return function m(a,
|
|
2214
|
-
if (
|
|
2226
|
+
return function m(a, d = 1, u) {
|
|
2227
|
+
if (d === 0 || !isObject(a))
|
|
2215
2228
|
return a;
|
|
2216
2229
|
if (Array.isArray(a))
|
|
2217
|
-
return a.map((l) => m(l,
|
|
2230
|
+
return a.map((l) => m(l, d - 1, u));
|
|
2218
2231
|
const s = Object.create(Object.getPrototypeOf(a));
|
|
2219
2232
|
return Object.keys(a).forEach((l) => {
|
|
2220
|
-
const o = a[l], n = e(l,
|
|
2233
|
+
const o = a[l], n = e(l, u), r = m(o, d - 1, u);
|
|
2221
2234
|
s[n] = r;
|
|
2222
2235
|
}), s;
|
|
2223
2236
|
};
|
|
@@ -2236,45 +2249,45 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2236
2249
|
},
|
|
2237
2250
|
emits: ["update:model-value"],
|
|
2238
2251
|
setup(e, { emit: m }) {
|
|
2239
|
-
const { t: a } = useI18n(),
|
|
2240
|
-
() =>
|
|
2252
|
+
const { t: a } = useI18n(), d = e, u = m, s = useMembershipStore(), l = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
|
|
2253
|
+
() => d.modelValue.sort((f, i) => f.threshold - i.threshold) ?? []
|
|
2241
2254
|
), n = computed(() => {
|
|
2242
|
-
const
|
|
2243
|
-
return
|
|
2255
|
+
const f = l.safeParse(o.value);
|
|
2256
|
+
return f.success ? [] : f.error.errors;
|
|
2244
2257
|
}), r = ref();
|
|
2245
|
-
function
|
|
2246
|
-
var
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2249
|
-
}
|
|
2250
|
-
function
|
|
2251
|
-
const
|
|
2252
|
-
(b) => b._id.toString() ==
|
|
2253
|
-
),
|
|
2254
|
-
threshold:
|
|
2255
|
-
amount:
|
|
2258
|
+
function p(f, i) {
|
|
2259
|
+
var k;
|
|
2260
|
+
const c = [...o.value];
|
|
2261
|
+
c[i] = f, (k = r.value) == null || k.showSheet(!1), u("update:model-value", c);
|
|
2262
|
+
}
|
|
2263
|
+
function h(f) {
|
|
2264
|
+
const i = f.type == "VOUCHER" ? f.collectibleConfig : s.collectibles.find(
|
|
2265
|
+
(b) => b._id.toString() == f.collectible
|
|
2266
|
+
), c = CollectionUtils.formattedType((i == null ? void 0 : i.name) || ""), k = f.earningOption.type == "FIXED" ? a("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
2267
|
+
threshold: f.threshold,
|
|
2268
|
+
amount: f.earningOption.amount
|
|
2256
2269
|
}) : a("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
2257
|
-
threshold:
|
|
2258
|
-
amount:
|
|
2259
|
-
every:
|
|
2270
|
+
threshold: f.threshold,
|
|
2271
|
+
amount: f.earningOption.amount,
|
|
2272
|
+
every: f.earningOption.every
|
|
2260
2273
|
});
|
|
2261
2274
|
return {
|
|
2262
|
-
label: isNullOrEmpty(
|
|
2263
|
-
sublabel:
|
|
2275
|
+
label: isNullOrEmpty(c) ? a("connect.template.mission_pool.no_reward") : c,
|
|
2276
|
+
sublabel: k
|
|
2264
2277
|
};
|
|
2265
2278
|
}
|
|
2266
|
-
function
|
|
2267
|
-
var
|
|
2268
|
-
const
|
|
2269
|
-
(
|
|
2279
|
+
function y(f) {
|
|
2280
|
+
var c;
|
|
2281
|
+
const i = [...o.value];
|
|
2282
|
+
(c = r.value) == null || c.showSheet(!0, i[f], f);
|
|
2270
2283
|
}
|
|
2271
|
-
function
|
|
2272
|
-
const
|
|
2273
|
-
|
|
2284
|
+
function C(f) {
|
|
2285
|
+
const i = [...o.value];
|
|
2286
|
+
i.splice(f, 1), u("update:model-value", i);
|
|
2274
2287
|
}
|
|
2275
|
-
function
|
|
2276
|
-
var
|
|
2277
|
-
(
|
|
2288
|
+
function x() {
|
|
2289
|
+
var f;
|
|
2290
|
+
(f = r.value) == null || f.showSheet(
|
|
2278
2291
|
!0,
|
|
2279
2292
|
{
|
|
2280
2293
|
type: "LOYALTY",
|
|
@@ -2291,60 +2304,60 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2291
2304
|
o.value.length
|
|
2292
2305
|
);
|
|
2293
2306
|
}
|
|
2294
|
-
function
|
|
2295
|
-
var
|
|
2296
|
-
return
|
|
2297
|
-
((
|
|
2298
|
-
(
|
|
2299
|
-
)) == null ? void 0 :
|
|
2307
|
+
function v(f) {
|
|
2308
|
+
var i, c;
|
|
2309
|
+
return f.type == "VOUCHER" ? (i = f.collectibleConfig) == null ? void 0 : i.name : sentenceCase(
|
|
2310
|
+
((c = s.loyaltyRewards.items.find(
|
|
2311
|
+
(k) => k.value == f.collectible
|
|
2312
|
+
)) == null ? void 0 : c.label) || ""
|
|
2300
2313
|
);
|
|
2301
2314
|
}
|
|
2302
|
-
return (
|
|
2303
|
-
const
|
|
2315
|
+
return (f, i) => {
|
|
2316
|
+
const c = resolveComponent("FmButton"), k = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
2304
2317
|
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2305
2318
|
createElementVNode("div", _hoisted_2$3, toDisplayString(unref(a)("connect.template.configure_reward_customer")), 1),
|
|
2306
|
-
createVNode(
|
|
2319
|
+
createVNode(c, {
|
|
2307
2320
|
label: unref(a)("connect.template.mission_pool.add_reward"),
|
|
2308
|
-
onClick:
|
|
2321
|
+
onClick: i[0] || (i[0] = (S) => x()),
|
|
2309
2322
|
variant: "plain",
|
|
2310
2323
|
icon: "add"
|
|
2311
2324
|
}, null, 8, ["label"]),
|
|
2312
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (
|
|
2325
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (S, N) => (openBlock(), createBlock(k, {
|
|
2313
2326
|
key: N,
|
|
2314
2327
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2315
2328
|
variant: "outlined",
|
|
2316
|
-
onClick: (
|
|
2329
|
+
onClick: (B) => y(N)
|
|
2317
2330
|
}, {
|
|
2318
2331
|
default: withCtx(() => [
|
|
2319
2332
|
createElementVNode("div", null, [
|
|
2320
|
-
createElementVNode("div", _hoisted_3$3, toDisplayString(
|
|
2321
|
-
createElementVNode("div", _hoisted_4$2, toDisplayString(
|
|
2333
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(h(S).label), 1),
|
|
2334
|
+
createElementVNode("div", _hoisted_4$2, toDisplayString(h(S).sublabel), 1)
|
|
2322
2335
|
]),
|
|
2323
|
-
createVNode(
|
|
2336
|
+
createVNode(c, {
|
|
2324
2337
|
icon: "delete",
|
|
2325
2338
|
variant: "tertiary",
|
|
2326
|
-
onClick: (
|
|
2339
|
+
onClick: (B) => (B.stopPropagation(), C(N))
|
|
2327
2340
|
}, null, 8, ["onClick"])
|
|
2328
2341
|
]),
|
|
2329
2342
|
_: 2
|
|
2330
2343
|
}, 1032, ["onClick"]))), 128)),
|
|
2331
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((
|
|
2332
|
-
key:
|
|
2333
|
-
text:
|
|
2344
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n).filter((S) => S.path.join(".") == ""), (S) => (openBlock(), createBlock(b, {
|
|
2345
|
+
key: S.message,
|
|
2346
|
+
text: S.message,
|
|
2334
2347
|
state: "error"
|
|
2335
2348
|
}, null, 8, ["text"]))), 128)),
|
|
2336
2349
|
createElementVNode("div", _hoisted_5$2, toDisplayString(unref(a)("connect.template.mission_pool.preview")), 1),
|
|
2337
|
-
(openBlock(), createBlock(
|
|
2350
|
+
(openBlock(), createBlock(k, {
|
|
2338
2351
|
key: 0,
|
|
2339
2352
|
variant: "outlined",
|
|
2340
2353
|
class: "p-24 space-y-16 w-fit"
|
|
2341
2354
|
}, {
|
|
2342
2355
|
default: withCtx(() => {
|
|
2343
|
-
var
|
|
2356
|
+
var S, N;
|
|
2344
2357
|
return [
|
|
2345
2358
|
createElementVNode("div", _hoisted_6$2, [
|
|
2346
2359
|
createElementVNode("div", null, [
|
|
2347
|
-
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((
|
|
2360
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(unref(a)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((S = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : S.earningOption.amount) > 1 ? (N = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : N.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? v(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2348
2361
|
createElementVNode("div", _hoisted_8$2, toDisplayString(unref(a)("connect.template.mission_pool.earn_stamp")), 1)
|
|
2349
2362
|
])
|
|
2350
2363
|
]),
|
|
@@ -2353,7 +2366,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2353
2366
|
type: e.mission.type,
|
|
2354
2367
|
"max-range": e.mission.end,
|
|
2355
2368
|
currentRange: e.mission.end / 4,
|
|
2356
|
-
markers: e.modelValue.map((
|
|
2369
|
+
markers: e.modelValue.map((B) => B.threshold)
|
|
2357
2370
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2358
2371
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2359
2372
|
])
|
|
@@ -2364,7 +2377,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2364
2377
|
createVNode(_sfc_main$6, {
|
|
2365
2378
|
ref_key: "sheetRef",
|
|
2366
2379
|
ref: r,
|
|
2367
|
-
"onUpdate:modelValue":
|
|
2380
|
+
"onUpdate:modelValue": p,
|
|
2368
2381
|
"max-threshold": e.mission.end
|
|
2369
2382
|
}, null, 8, ["max-threshold"])
|
|
2370
2383
|
]);
|
|
@@ -2377,8 +2390,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2377
2390
|
},
|
|
2378
2391
|
emits: ["update:model-value"],
|
|
2379
2392
|
setup(e, { emit: m }) {
|
|
2380
|
-
const { t: a } = useI18n(),
|
|
2381
|
-
const o = FdoMission.safeParse(
|
|
2393
|
+
const { t: a } = useI18n(), d = e, u = computed(() => {
|
|
2394
|
+
const o = FdoMission.safeParse(d.modelValue);
|
|
2382
2395
|
return o.success ? [] : o.error.errors;
|
|
2383
2396
|
}), s = computed(() => [
|
|
2384
2397
|
{
|
|
@@ -2393,35 +2406,35 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2393
2406
|
}
|
|
2394
2407
|
]), l = m;
|
|
2395
2408
|
return (o, n) => {
|
|
2396
|
-
var
|
|
2397
|
-
const r = resolveComponent("FmCard"),
|
|
2409
|
+
var h;
|
|
2410
|
+
const r = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
|
|
2398
2411
|
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
2399
2412
|
createElementVNode("div", _hoisted_2$2, [
|
|
2400
2413
|
createElementVNode("div", _hoisted_3$2, toDisplayString(unref(a)("connect.campaign.mission.missionType")), 1),
|
|
2401
2414
|
createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)("connect.template.select_game")), 1),
|
|
2402
2415
|
createElementVNode("div", _hoisted_5$1, [
|
|
2403
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (
|
|
2404
|
-
var
|
|
2416
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (y) => {
|
|
2417
|
+
var C, x;
|
|
2405
2418
|
return openBlock(), createBlock(r, {
|
|
2406
2419
|
variant: "outlined",
|
|
2407
2420
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2408
2421
|
"col-span-2": unref(s).length == 1,
|
|
2409
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2410
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2422
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((C = e.modelValue) == null ? void 0 : C.type) == y.value,
|
|
2423
|
+
"hover:bg-fm-color-opacity-sm": ((x = e.modelValue) == null ? void 0 : x.type) != y.value
|
|
2411
2424
|
}]),
|
|
2412
2425
|
onClick: () => {
|
|
2413
|
-
var
|
|
2414
|
-
((
|
|
2426
|
+
var v, f;
|
|
2427
|
+
((v = e.modelValue) == null ? void 0 : v.type) != y.value && l("update:model-value", {
|
|
2415
2428
|
...e.modelValue,
|
|
2416
|
-
type:
|
|
2417
|
-
end: ((
|
|
2429
|
+
type: y.value,
|
|
2430
|
+
end: ((f = e.modelValue) == null ? void 0 : f.end) || 1
|
|
2418
2431
|
});
|
|
2419
2432
|
},
|
|
2420
|
-
key:
|
|
2433
|
+
key: y.value
|
|
2421
2434
|
}, {
|
|
2422
2435
|
default: withCtx(() => [
|
|
2423
|
-
createElementVNode("div", _hoisted_6$1, toDisplayString(
|
|
2424
|
-
createElementVNode("div", _hoisted_7$1, toDisplayString(
|
|
2436
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(y.label), 1),
|
|
2437
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(y.description), 1)
|
|
2425
2438
|
]),
|
|
2426
2439
|
_: 2
|
|
2427
2440
|
}, 1032, ["class", "onClick"]);
|
|
@@ -2431,19 +2444,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2431
2444
|
createElementVNode("div", _hoisted_8$1, [
|
|
2432
2445
|
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequired")), 1),
|
|
2433
2446
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(a)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
2434
|
-
createVNode(
|
|
2447
|
+
createVNode(p, {
|
|
2435
2448
|
label: unref(a)("connect.campaign.mission.maximumToCollect"),
|
|
2436
|
-
"model-value": ((
|
|
2437
|
-
"onUpdate:modelValue": n[0] || (n[0] = (
|
|
2438
|
-
var
|
|
2449
|
+
"model-value": ((h = e.modelValue) == null ? void 0 : h.end) || null,
|
|
2450
|
+
"onUpdate:modelValue": n[0] || (n[0] = (y) => {
|
|
2451
|
+
var C;
|
|
2439
2452
|
return l("update:model-value", {
|
|
2440
2453
|
...e.modelValue,
|
|
2441
|
-
type: ((
|
|
2442
|
-
end:
|
|
2454
|
+
type: ((C = e.modelValue) == null ? void 0 : C.type) || "STAMP",
|
|
2455
|
+
end: y
|
|
2443
2456
|
});
|
|
2444
2457
|
}),
|
|
2445
|
-
"helper-text": unref(ZodHelper).helperText(unref(
|
|
2446
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2458
|
+
"helper-text": unref(ZodHelper).helperText(unref(u), "end") || unref(a)("connect.campaign.mission.thresholdHelperText"),
|
|
2459
|
+
"helper-state": unref(ZodHelper).helperState(unref(u), "end") || "none"
|
|
2447
2460
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"])
|
|
2448
2461
|
])
|
|
2449
2462
|
]);
|
|
@@ -2452,8 +2465,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2452
2465
|
});
|
|
2453
2466
|
function useLocaleText() {
|
|
2454
2467
|
const { locale: e, t: m } = useI18n();
|
|
2455
|
-
function a(
|
|
2456
|
-
return
|
|
2468
|
+
function a(d, u) {
|
|
2469
|
+
return d ? d[e.value] ?? d["en-US"] ?? m(u) : m(u);
|
|
2457
2470
|
}
|
|
2458
2471
|
return { getLocaleText: a };
|
|
2459
2472
|
}
|
|
@@ -2484,65 +2497,65 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2484
2497
|
},
|
|
2485
2498
|
emits: ["update:model-value", "update:file"],
|
|
2486
2499
|
setup(e, { emit: m }) {
|
|
2487
|
-
const { t: a } = useI18n(), { getLocaleText:
|
|
2488
|
-
function l(
|
|
2489
|
-
switch (
|
|
2500
|
+
const { t: a } = useI18n(), { getLocaleText: d } = useLocaleText(), u = e, s = m;
|
|
2501
|
+
function l(p) {
|
|
2502
|
+
switch (u.field.type) {
|
|
2490
2503
|
case "timeframe":
|
|
2491
|
-
const
|
|
2504
|
+
const h = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
|
|
2492
2505
|
s("update:model-value", {
|
|
2493
2506
|
type: "timeframe",
|
|
2494
2507
|
property: "__now",
|
|
2495
|
-
start:
|
|
2496
|
-
end:
|
|
2508
|
+
start: h,
|
|
2509
|
+
end: y
|
|
2497
2510
|
});
|
|
2498
2511
|
break;
|
|
2499
2512
|
case "image": {
|
|
2500
2513
|
s(
|
|
2501
2514
|
"update:file",
|
|
2502
|
-
|
|
2503
|
-
o.value || firebaseStorage.collectibleImagePath(void 0,
|
|
2515
|
+
p,
|
|
2516
|
+
o.value || firebaseStorage.collectibleImagePath(void 0, p)
|
|
2504
2517
|
);
|
|
2505
2518
|
break;
|
|
2506
2519
|
}
|
|
2507
2520
|
default:
|
|
2508
|
-
s("update:model-value",
|
|
2521
|
+
s("update:model-value", p);
|
|
2509
2522
|
break;
|
|
2510
2523
|
}
|
|
2511
2524
|
}
|
|
2512
2525
|
const o = computed(() => {
|
|
2513
|
-
switch (
|
|
2526
|
+
switch (u.field.type) {
|
|
2514
2527
|
case "timeframe": {
|
|
2515
|
-
const
|
|
2528
|
+
const p = u.modelValue;
|
|
2516
2529
|
return {
|
|
2517
|
-
startDate:
|
|
2518
|
-
endDate:
|
|
2530
|
+
startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
|
|
2531
|
+
endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
|
|
2519
2532
|
};
|
|
2520
2533
|
}
|
|
2521
2534
|
default:
|
|
2522
|
-
return
|
|
2535
|
+
return u.modelValue;
|
|
2523
2536
|
}
|
|
2524
2537
|
});
|
|
2525
2538
|
function n() {
|
|
2526
2539
|
if (!r.value.schema) return [];
|
|
2527
|
-
const
|
|
2528
|
-
return
|
|
2540
|
+
const p = r.value.schema.safeParse(u.modelValue);
|
|
2541
|
+
return p.success ? [] : p.error.errors;
|
|
2529
2542
|
}
|
|
2530
2543
|
const r = computed(() => ({
|
|
2531
|
-
schema:
|
|
2532
|
-
unwrapped:
|
|
2533
|
-
rules:
|
|
2534
|
-
labelMark:
|
|
2535
|
-
zodLabel:
|
|
2536
|
-
|
|
2537
|
-
|
|
2544
|
+
schema: u.schema,
|
|
2545
|
+
unwrapped: u.schema ? ZodHelper.unwrap(u.schema) : void 0,
|
|
2546
|
+
rules: u.schema ? [ZodHelper.ruleAtPath(u.schema, "")] : void 0,
|
|
2547
|
+
labelMark: u.schema && ZodHelper.isRequired(u.schema) == !1 ? "optional" : void 0,
|
|
2548
|
+
zodLabel: u.schema ? ZodHelper.toInputLabel(
|
|
2549
|
+
u.schema,
|
|
2550
|
+
d(u.field.label_locale, u.field.label ?? "")
|
|
2538
2551
|
) : void 0
|
|
2539
2552
|
}));
|
|
2540
|
-
return (
|
|
2541
|
-
var
|
|
2542
|
-
const
|
|
2543
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
2553
|
+
return (p, h) => {
|
|
2554
|
+
var i, c, k, b, S;
|
|
2555
|
+
const y = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), x = resolveComponent("FmTextarea"), v = resolveComponent("FmHelperText"), f = resolveComponent("FmSwitch");
|
|
2556
|
+
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
2544
2557
|
key: 0,
|
|
2545
|
-
label: unref(
|
|
2558
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2546
2559
|
"label-mark": unref(r).labelMark,
|
|
2547
2560
|
rules: unref(r).rules,
|
|
2548
2561
|
"model-value": unref(o),
|
|
@@ -2551,10 +2564,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2551
2564
|
"helper-text": e.helperText
|
|
2552
2565
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2553
2566
|
createVNode(JsonViewer, {
|
|
2554
|
-
json: { schema: unref(r).unwrapped, props:
|
|
2567
|
+
json: { schema: unref(r).unwrapped, props: u }
|
|
2555
2568
|
}, null, 8, ["json"]),
|
|
2556
|
-
createVNode(
|
|
2557
|
-
label: unref(
|
|
2569
|
+
createVNode(C, {
|
|
2570
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2558
2571
|
"label-mark": e.field.isRuleChildren ? void 0 : unref(r).labelMark,
|
|
2559
2572
|
"model-value": unref(o),
|
|
2560
2573
|
rules: e.field.isRuleChildren ? [] : unref(r).rules,
|
|
@@ -2562,15 +2575,15 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2562
2575
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2563
2576
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2564
2577
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2565
|
-
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(
|
|
2578
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(x, {
|
|
2566
2579
|
key: 2,
|
|
2567
|
-
label: unref(
|
|
2580
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2568
2581
|
"label-mark": unref(r).labelMark,
|
|
2569
2582
|
rules: unref(r).rules,
|
|
2570
2583
|
"model-value": unref(o),
|
|
2571
2584
|
"onUpdate:modelValue": l,
|
|
2572
2585
|
"show-word-count": "",
|
|
2573
|
-
"max-length": (
|
|
2586
|
+
"max-length": (S = (b = (k = (c = (i = unref(r)) == null ? void 0 : i.unwrapped) == null ? void 0 : c._def) == null ? void 0 : k.checks) == null ? void 0 : b.find((N) => N.kind == "max")) == null ? void 0 : S.value
|
|
2574
2587
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2575
2588
|
key: 3,
|
|
2576
2589
|
"campaign-type": e.extras,
|
|
@@ -2582,7 +2595,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2582
2595
|
"model-value": unref(o),
|
|
2583
2596
|
"onUpdate:modelValue": l
|
|
2584
2597
|
}, null, 8, ["model-value"]),
|
|
2585
|
-
createVNode(
|
|
2598
|
+
createVNode(v, {
|
|
2586
2599
|
class: "!mt-[8px]",
|
|
2587
2600
|
text: unref(ZodHelper).helperText(n(), ""),
|
|
2588
2601
|
state: unref(ZodHelper).helperState(n(), "")
|
|
@@ -2598,9 +2611,9 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2598
2611
|
(openBlock(), createBlock(resolveDynamicComponent(unref(r).zodLabel)))
|
|
2599
2612
|
]),
|
|
2600
2613
|
_: 1
|
|
2601
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2614
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(f, {
|
|
2602
2615
|
key: 6,
|
|
2603
|
-
label: unref(
|
|
2616
|
+
label: unref(d)(e.field.label_locale, e.field.label ?? ""),
|
|
2604
2617
|
"label-placement": "right",
|
|
2605
2618
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2606
2619
|
"label-mark": unref(r).labelMark,
|
|
@@ -2634,7 +2647,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2634
2647
|
"onUpdate:modelValue": l,
|
|
2635
2648
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2636
2649
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2637
|
-
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
2650
|
+
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(v, {
|
|
2638
2651
|
key: 0,
|
|
2639
2652
|
class: "!mt-[8px]",
|
|
2640
2653
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
@@ -2645,7 +2658,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2645
2658
|
"model-value": unref(o),
|
|
2646
2659
|
"onUpdate:modelValue": l
|
|
2647
2660
|
}, null, 8, ["model-value"]),
|
|
2648
|
-
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
2661
|
+
unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(v, {
|
|
2649
2662
|
key: 0,
|
|
2650
2663
|
class: "!mt-[8px]",
|
|
2651
2664
|
text: unref(a)("connect.campaign.common.effect_required"),
|
|
@@ -2672,7 +2685,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2672
2685
|
"model-value": unref(o),
|
|
2673
2686
|
"onUpdate:modelValue": l,
|
|
2674
2687
|
"helper-text": e.helperText || unref(ZodHelper).helperText(n(), ""),
|
|
2675
|
-
"for-credit":
|
|
2688
|
+
"for-credit": u.campaignType === "CREDIT"
|
|
2676
2689
|
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2677
2690
|
key: 16,
|
|
2678
2691
|
"model-value": unref(o),
|
|
@@ -2707,7 +2720,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2707
2720
|
"start-date": e.extras.start,
|
|
2708
2721
|
"end-date": e.extras.end
|
|
2709
2722
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2710
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2723
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2711
2724
|
key: 0,
|
|
2712
2725
|
class: "!mt-[8px]",
|
|
2713
2726
|
text: e.helperText,
|
|
@@ -2718,14 +2731,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2718
2731
|
"model-value": unref(o),
|
|
2719
2732
|
"onUpdate:modelValue": l
|
|
2720
2733
|
}, null, 8, ["model-value"]),
|
|
2721
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2734
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2722
2735
|
key: 0,
|
|
2723
2736
|
class: "!mt-[8px]",
|
|
2724
2737
|
text: e.helperText,
|
|
2725
2738
|
state: "error"
|
|
2726
2739
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2727
2740
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
2728
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
2741
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(v, {
|
|
2729
2742
|
key: 0,
|
|
2730
2743
|
state: "warning",
|
|
2731
2744
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
@@ -2734,7 +2747,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2734
2747
|
"model-value": unref(o),
|
|
2735
2748
|
"onUpdate:modelValue": l
|
|
2736
2749
|
}, null, 8, ["model-value"]),
|
|
2737
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2750
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2738
2751
|
key: 1,
|
|
2739
2752
|
class: "!mt-[8px]",
|
|
2740
2753
|
text: e.helperText,
|
|
@@ -2745,7 +2758,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2745
2758
|
"model-value": unref(o),
|
|
2746
2759
|
"onUpdate:modelValue": l
|
|
2747
2760
|
}, null, 8, ["model-value"]),
|
|
2748
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2761
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2749
2762
|
key: 0,
|
|
2750
2763
|
class: "!mt-[8px]",
|
|
2751
2764
|
text: e.helperText,
|
|
@@ -2756,7 +2769,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2756
2769
|
"model-value": unref(o),
|
|
2757
2770
|
"onUpdate:modelValue": l
|
|
2758
2771
|
}, null, 8, ["model-value"]),
|
|
2759
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2772
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2760
2773
|
key: 0,
|
|
2761
2774
|
class: "!mt-[8px]",
|
|
2762
2775
|
text: e.helperText,
|
|
@@ -2767,7 +2780,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2767
2780
|
"model-value": unref(o),
|
|
2768
2781
|
"onUpdate:modelValue": l
|
|
2769
2782
|
}, null, 8, ["model-value"]),
|
|
2770
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2783
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2771
2784
|
key: 0,
|
|
2772
2785
|
class: "!mt-[8px]",
|
|
2773
2786
|
text: e.helperText,
|
|
@@ -2778,13 +2791,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2778
2791
|
"model-value": unref(o),
|
|
2779
2792
|
"onUpdate:modelValue": l
|
|
2780
2793
|
}, null, 8, ["model-value"]),
|
|
2781
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2794
|
+
e.helperText ? (openBlock(), createBlock(v, {
|
|
2782
2795
|
key: 0,
|
|
2783
2796
|
class: "!mt-[8px]",
|
|
2784
2797
|
text: e.helperText,
|
|
2785
2798
|
state: "error"
|
|
2786
2799
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2787
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(
|
|
2800
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(u.field), 1));
|
|
2788
2801
|
};
|
|
2789
2802
|
}
|
|
2790
2803
|
}), _hoisted_1$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_2$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
@@ -2797,7 +2810,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2797
2810
|
},
|
|
2798
2811
|
setup(e) {
|
|
2799
2812
|
const { t: m, te: a } = useI18n();
|
|
2800
|
-
return (
|
|
2813
|
+
return (d, u) => {
|
|
2801
2814
|
const s = resolveComponent("FmCard");
|
|
2802
2815
|
return openBlock(), createBlock(s, {
|
|
2803
2816
|
variant: "outlined",
|
|
@@ -2805,7 +2818,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2805
2818
|
}, {
|
|
2806
2819
|
default: withCtx(() => [
|
|
2807
2820
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
|
|
2808
|
-
|
|
2821
|
+
u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
2809
2822
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
|
|
2810
2823
|
class: "space-y-4",
|
|
2811
2824
|
key: o
|
|
@@ -2837,18 +2850,18 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2837
2850
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2838
2851
|
} catch {
|
|
2839
2852
|
} finally {
|
|
2840
|
-
await new Promise((
|
|
2853
|
+
await new Promise((d) => setTimeout(d, 120)), isLoading.value = !1;
|
|
2841
2854
|
}
|
|
2842
2855
|
console.log(
|
|
2843
2856
|
TEMPLATES[type],
|
|
2844
2857
|
"base template"
|
|
2845
|
-
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
2858
|
+
), template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((d, u) => {
|
|
2846
2859
|
var s;
|
|
2847
|
-
if (
|
|
2848
|
-
const l = (s =
|
|
2860
|
+
if (d.campaign.type === "VOUCHER" && d.campaign.code) {
|
|
2861
|
+
const l = (s = d.campaign._id) == null ? void 0 : s.toString();
|
|
2849
2862
|
useCampaignStore().campaigns.voucher.some(
|
|
2850
|
-
(o) => o.code ===
|
|
2851
|
-
) &&
|
|
2863
|
+
(o) => o.code === d.campaign.code && o._id.toString() !== l
|
|
2864
|
+
) && u.addIssue({
|
|
2852
2865
|
code: "custom",
|
|
2853
2866
|
message: "Code already exists, please use another code",
|
|
2854
2867
|
path: ["campaign", "code"]
|
|
@@ -2887,10 +2900,10 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2887
2900
|
});
|
|
2888
2901
|
function stepErrors(e = currentStep.value - 1) {
|
|
2889
2902
|
const m = template.value.steps[e].groups.flatMap(
|
|
2890
|
-
(a) => a.fields.map((
|
|
2903
|
+
(a) => a.fields.map((d) => d.property)
|
|
2891
2904
|
);
|
|
2892
2905
|
return errors.value.filter(
|
|
2893
|
-
(a) => m.some((
|
|
2906
|
+
(a) => m.some((d) => a.path.join(".").includes(d))
|
|
2894
2907
|
);
|
|
2895
2908
|
}
|
|
2896
2909
|
__expose({ showSheet });
|
|
@@ -2904,16 +2917,16 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2904
2917
|
});
|
|
2905
2918
|
}
|
|
2906
2919
|
function onUpdateProperty(e, m) {
|
|
2907
|
-
var a,
|
|
2920
|
+
var a, d, u, s, l, o, n, r;
|
|
2908
2921
|
if (_.set(data.value, e, m), e == "campaign.event.type") {
|
|
2909
|
-
const
|
|
2922
|
+
const h = ((s = (u = (d = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : d.campaign) == null ? void 0 : u.event) == null ? void 0 : s.rule) ? _.cloneDeep({
|
|
2910
2923
|
...(r = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : r.rule
|
|
2911
2924
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
2912
2925
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2913
2926
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
2914
2927
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
2915
2928
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
2916
|
-
]),
|
|
2929
|
+
]), y = RuleBuilder.setRuleToGroup(
|
|
2917
2930
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2918
2931
|
[
|
|
2919
2932
|
RuleBuilder.constructEntry(
|
|
@@ -2926,13 +2939,13 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2926
2939
|
"&&"
|
|
2927
2940
|
);
|
|
2928
2941
|
if (m != "SCHEDULE") {
|
|
2929
|
-
_.set(data.value, "campaign.event.rule",
|
|
2942
|
+
_.set(data.value, "campaign.event.rule", h);
|
|
2930
2943
|
return;
|
|
2931
2944
|
}
|
|
2932
2945
|
_.set(
|
|
2933
2946
|
data.value,
|
|
2934
2947
|
"campaign.event.rule",
|
|
2935
|
-
RuleBuilder.setRuleToGroup(
|
|
2948
|
+
RuleBuilder.setRuleToGroup(h, y)
|
|
2936
2949
|
);
|
|
2937
2950
|
}
|
|
2938
2951
|
e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -2963,7 +2976,7 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2963
2976
|
(m || m === void 0) && (sheetVisible.value = !1);
|
|
2964
2977
|
}
|
|
2965
2978
|
return (e, m) => {
|
|
2966
|
-
const a = resolveComponent("FmButton"),
|
|
2979
|
+
const a = resolveComponent("FmButton"), d = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2967
2980
|
return openBlock(), createBlock(l, {
|
|
2968
2981
|
"fullscreen-size": "lg",
|
|
2969
2982
|
modelValue: unref(sheetVisible),
|
|
@@ -3029,14 +3042,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3029
3042
|
name: "default",
|
|
3030
3043
|
fn: withCtx(() => [
|
|
3031
3044
|
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
3032
|
-
createVNode(
|
|
3045
|
+
createVNode(u, {
|
|
3033
3046
|
modelValue: unref(currentStep),
|
|
3034
3047
|
"onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
3035
3048
|
orientation: "horizontal",
|
|
3036
3049
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3037
3050
|
}, {
|
|
3038
3051
|
default: withCtx(() => [
|
|
3039
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3052
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
|
|
3040
3053
|
key: o.name,
|
|
3041
3054
|
title: unref(getLocaleText)(o.name_locale, o.name),
|
|
3042
3055
|
value: n + 1,
|
|
@@ -3052,14 +3065,14 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3052
3065
|
variant: "tertiary",
|
|
3053
3066
|
onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
|
|
3054
3067
|
}),
|
|
3055
|
-
createVNode(
|
|
3068
|
+
createVNode(u, {
|
|
3056
3069
|
modelValue: unref(currentStep),
|
|
3057
3070
|
"onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
|
|
3058
3071
|
orientation: "horizontal",
|
|
3059
3072
|
class: "flex-1"
|
|
3060
3073
|
}, {
|
|
3061
3074
|
default: withCtx(() => [
|
|
3062
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(
|
|
3075
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(d, {
|
|
3063
3076
|
key: o.name,
|
|
3064
3077
|
title: unref(sheetTitle),
|
|
3065
3078
|
description: unref(getLocaleText)(o.name_locale, o.name),
|
|
@@ -3097,17 +3110,17 @@ const _hoisted_1$2 = { key: 29 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3097
3110
|
class: "space-y-24"
|
|
3098
3111
|
}, [
|
|
3099
3112
|
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(o.name_locale, o.name ?? "")), 1),
|
|
3100
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (r,
|
|
3113
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (r, p) => (openBlock(), createElementBlock("div", { key: p }, [
|
|
3101
3114
|
(openBlock(), createBlock(_sfc_main$2, {
|
|
3102
|
-
key:
|
|
3115
|
+
key: p,
|
|
3103
3116
|
field: r,
|
|
3104
3117
|
modelValue: unref(_).get(unref(data), r.property),
|
|
3105
3118
|
disabled: isDisable(r),
|
|
3106
3119
|
"campaign-type": unref(campaignType),
|
|
3107
|
-
"onUpdate:modelValue": (
|
|
3108
|
-
"onUpdate:file": async (
|
|
3109
|
-
const
|
|
3110
|
-
onUpdateProperty(r.property,
|
|
3120
|
+
"onUpdate:modelValue": (h) => onUpdateProperty(r.property, h),
|
|
3121
|
+
"onUpdate:file": async (h, y) => {
|
|
3122
|
+
const C = await onUpdateFile(h, y);
|
|
3123
|
+
onUpdateProperty(r.property, C || "");
|
|
3111
3124
|
},
|
|
3112
3125
|
schema: unref(ZodHelper).typeAtPath(
|
|
3113
3126
|
unref(schema),
|