@feedmepos/mf-connect 0.1.125-prod → 0.1.126-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-VvS6HIoz.js → App-DRHHPaMz.js} +10 -10
- package/dist/{Bin-dVF9Q1iu.js → Bin-FkcYLSTm.js} +8 -8
- package/dist/{Broadcast-BIZbCshz.js → Broadcast-Cgqp_BMa.js} +11 -11
- package/dist/{CampaignAnalytic-Ci8Ryoig.js → CampaignAnalytic-kKZ_BwW0.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CMgvX7Qs.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CX0mWLjO.js} +9 -9
- package/dist/{Card-CZkmyXaw.js → Card-Bu1y37hV.js} +22 -22
- package/dist/{Collections-Inv8osLz.js → Collections-B3mJkBCT.js} +9 -9
- package/dist/{Credit-C0sAkt2c.js → Credit-Bn-2EcVy.js} +11 -11
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BiJ_wHig.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Cz7pZ7LD.js} +1 -1
- package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-B28ds81U.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DIUEjCFW.js} +1092 -947
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BU1c2K1g.js → EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js} +6 -6
- package/dist/{Experience-BNEfKjkq.js → Experience-CunbmoAu.js} +12 -12
- package/dist/{FileSaver.min-C5THVA6m.js → FileSaver.min-ChFSxYyS.js} +1 -1
- package/dist/{Game-S9z8ZBF3.js → Game-dFDwx_UJ.js} +12 -12
- package/dist/{GiftCardSetup-nVMJLp50.js → GiftCardSetup-DYpEqqX0.js} +10 -10
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-DC2QB9kR.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxJdI6gc.js} +7 -7
- package/dist/{Goals-Do6Z0FfW.js → Goals-DuZzgM_K.js} +4 -4
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CFb4EUQ5.js → ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js} +1 -1
- package/dist/{Index-CLVDmWRo.js → Index-BxB2ohT0.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CZwKWjn6.js → LocationPicker.vue_vue_type_script_setup_true_lang-9sKJE1A5.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-CGPZUYnY.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CxBNYzcz.js} +1 -1
- package/dist/{LoyaltyDashboard-B_HpEQdz.js → LoyaltyDashboard-DQzGvQ7j.js} +15 -15
- package/dist/{MainLayout-uQfsgnnu.js → MainLayout-MAZ1S06H.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DNPmnCA8.js → MainLayout.vue_vue_type_script_setup_true_lang-CeF3LU-N.js} +3 -3
- package/dist/{Marketing-DPWybdMq.js → Marketing-ACF6F7be.js} +4 -4
- package/dist/{MarketingMaterialEdit-BfBgdPyz.js → MarketingMaterialEdit-B8NfkoHg.js} +6 -6
- package/dist/{Member-Bkt3UPXA.js → Member-rLxDUOr8.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-EIc8nFZ0.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-Bq3UKX7v.js} +23 -23
- package/dist/{MemberImportHistory-DbzrfaI6.js → MemberImportHistory-BuG6DmdV.js} +7 -7
- package/dist/{MemberList-CAxUgRRp.js → MemberList-CC6zm_I6.js} +14 -14
- package/dist/{MemberTransactions-DDGkVcHw.js → MemberTransactions-Bw2xu6jZ.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-C2D5J4Ja.js → MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js} +10 -10
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-2f1SFptj.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8wdY4FnI.js} +1 -1
- package/dist/{Mission-CTa5syv8.js → Mission-DnEcbALs.js} +13 -13
- package/dist/{Overview-CD6Q9DJm.js → Overview-COytI5xN.js} +20 -20
- package/dist/{Overview-DLXj9lo5.js → Overview-DShFohlk.js} +4 -4
- package/dist/{Point-ktWnL8q5.js → Point-CWYwlx0i.js} +13 -13
- package/dist/{Promotion-hqaOxx8q.js → Promotion-LBrQYtad.js} +13 -13
- package/dist/{Queue-BE-fU8IM.js → Queue-DKg5EvDM.js} +12 -12
- package/dist/{Record-BEFt0lae.js → Record--lYpawLN.js} +9 -9
- package/dist/{Review-DcLFxegb.js → Review-C4pNmJ7n.js} +2 -2
- package/dist/{ReviewFacebookCallback-6BapqO6b.js → ReviewFacebookCallback-BYXwKQNG.js} +5 -5
- package/dist/{ReviewGoogleCallback-CQ1awmJH.js → ReviewGoogleCallback-ge8fL_A-.js} +5 -5
- package/dist/{Reward-eZLQ_qzv.js → Reward-B67r1Bpz.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DT4cU2lr.js → RewardGroup.vue_vue_type_script_setup_true_lang-Bt0Kx2--.js} +13 -13
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CdWm80id.js → RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js} +15 -15
- package/dist/{Segment-C1Xbqlcv.js → Segment-DeSC3z5G.js} +26 -26
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-C_1xj3Cl.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DdjC7X1V.js} +14 -14
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DwejRzlR.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Crys59UO.js} +4 -4
- package/dist/{Setting-Cg21mqEc.js → Setting-DiDcMU5E.js} +15 -15
- package/dist/{SettingAdvertisements-CA6x_w-6.js → SettingAdvertisements-3wMI9egH.js} +12 -12
- package/dist/{Settings-CbrC5bN2.js → Settings-BR6Y1DBZ.js} +5 -5
- package/dist/{Store-CFDsun8N.js → Store-DgefqByH.js} +26 -26
- package/dist/{StoreRewards-BhURDAsS.js → StoreRewards-CS2h5RVB.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-JkpE5XsA.js → StoreTransactions.vue_vue_type_script_setup_true_lang-gPR8sn4k.js} +24 -24
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DzMfetDA.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js} +2 -2
- package/dist/{Tier-B4iofOYH.js → Tier-Cye6888q.js} +25 -25
- package/dist/{Title-3YNx77l4.js → Title-B1eJh5oy.js} +23 -23
- package/dist/{Transaction-CX9SxMEG.js → Transaction-ouzdsBUx.js} +2 -2
- package/dist/{Upselling-CznVPMJC.js → Upselling-CdQd2Fuk.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BZVdb3An.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js} +6 -6
- package/dist/{Voucher-7Hl1LPrh.js → Voucher-CJJt8VlJ.js} +18 -18
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-dFJXQsFv.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js} +12 -12
- package/dist/{WhatsappAccount-DQbkWBel.js → WhatsappAccount-DIxSP6Tp.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-CvqJzTXs.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-L9Y5lAft.js} +1 -1
- package/dist/{WhatsappBot-B0nZTeT7.js → WhatsappBot-BXxoaz7-.js} +6 -6
- package/dist/{WhatsappBotLogs-DujpGQWa.js → WhatsappBotLogs-D8IfLHk3.js} +6 -6
- package/dist/{WhatsappBotSettings-CfhMycMW.js → WhatsappBotSettings-Bq9C7pNZ.js} +4 -4
- package/dist/{WhatsappLayout-b1gwbBm0.js → WhatsappLayout-3rWwmGRd.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DiQnP4cp.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-C3N-loYJ.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-Cidk_OlM.js → ZodTextField.vue_vue_type_script_setup_true_lang-D1dORvMi.js} +2 -2
- package/dist/{app-C5LDuXmt.js → app-BXqas0p1.js} +73 -67
- package/dist/app.js +1 -1
- package/dist/{base.export-BBrPA7Jg.js → base.export-DQCZiS2E.js} +2 -2
- package/dist/{business-ClZ-GkSj.js → business-RsRhXSh8.js} +1 -1
- package/dist/{campaign-DefEj7jV.js → campaign-C2X6aa7B.js} +2 -2
- package/dist/{campaign-B-h5N3HR.js → campaign-DASPASQ0.js} +99 -85
- package/dist/{campaign.fn-C5ZXEU8C.js → campaign.fn-BEX99lsa.js} +36 -36
- package/dist/{collection.fn-DZ0ViZdo.js → collection.fn-C7jNdh0A.js} +2 -2
- package/dist/{currency-C0Qn4nj3.js → currency-BvBM_Io9.js} +1 -1
- package/dist/{effect-CJHdpc35.js → effect-BA1yh6Mj.js} +1 -1
- package/dist/{email-addresses-CipYiyL4.js → email-addresses-haS5P7hq.js} +2 -2
- package/dist/{feature-flag-BBsHJnnj.js → feature-flag-B4bJnuei.js} +1 -1
- package/dist/{helper-Cn8vgyK3.js → helper-BtTBvFuA.js} +1 -1
- package/dist/{index-DBqf8mMi.js → index-B1dAoOWi.js} +1 -1
- package/dist/{index-Wm89O5a0.js → index-B6A6sHpy.js} +1 -1
- package/dist/{index-DKg5PbUy.js → index-BRTy6G9c.js} +2 -2
- package/dist/{index-BkXjF7ZI.js → index-BV-YiCDM.js} +2 -2
- package/dist/{index-sntP2S4R.js → index-BvFq5REc.js} +2 -2
- package/dist/{index-CazcZ2A4.js → index-C2rjmdar.js} +2 -2
- package/dist/{index-xn_PXhGL.js → index-C7UBk5gq.js} +1 -1
- package/dist/{index-DYMRcL11.js → index-CBfVFFME.js} +3 -3
- package/dist/{index-BREObqqd.js → index-CJ-BZCvB.js} +4 -4
- package/dist/{index-BzLz01zb.js → index-CXznvd79.js} +1 -1
- package/dist/{index-0Ub4nEKy.js → index-ChGZ_S3V.js} +1 -1
- package/dist/{index-BcjArc8W.js → index-D-D0s8PB.js} +4 -4
- package/dist/{index-CWs0a5Bx.js → index-D9zjHXFU.js} +3 -3
- package/dist/{index-C5o2Pc_f.js → index-DAtVp1NI.js} +2 -2
- package/dist/{index-BcwGxZje.js → index-DeomfIu9.js} +8 -8
- package/dist/{index-CZ3CQEXM.js → index-Dg972Dfv.js} +1 -1
- package/dist/{index-BAvmo8cc.js → index-Dm2Dvxph.js} +2 -2
- package/dist/{index-DLKFoHdk.js → index-DtbR7I4C.js} +8 -8
- package/dist/{index-auS6xhgf.js → index-Q-iHraJ3.js} +1 -1
- package/dist/{index-B2r_X6DR.js → index-g_SHjVWE.js} +1 -1
- package/dist/{index.esm2017-ePnKsRWd.js → index.esm2017-B7iE1Ggr.js} +37 -37
- package/dist/{loading-DyfvdnK3.js → loading-BvlSfSVK.js} +1 -1
- package/dist/{lodash-OSOEHuHV.js → lodash-Daey2k0N.js} +1 -1
- package/dist/{member-import-DyKhgdl1.js → member-import-CF9aym_y.js} +1 -1
- package/dist/{membership-E97L9c1m.js → membership-DfG-fl80.js} +2 -2
- package/dist/{money-BizInVDg.js → money-SBIQhxqf.js} +1 -1
- package/dist/{number-BLjNuAXB.js → number-Cp1bFK9U.js} +1 -1
- package/dist/{objectid-CfbfYlrU.js → objectid-BMRA1fIL.js} +9 -9
- package/dist/{onboarding-BVOkoMd2.js → onboarding-bjc7C8O-.js} +3 -3
- package/dist/{onboardingSetup-WWZ5x3uC.js → onboardingSetup-BAu9TDI6.js} +2 -2
- package/dist/{plugins-BFwgESNo.js → plugins-Def73Eyk.js} +3 -3
- package/dist/{reward-BOldgYfT.js → reward-KecVeztH.js} +1 -1
- package/dist/{rule-builder-dOQCz1XZ.js → rule-builder-DgU6P24U.js} +1 -1
- package/dist/{rule-CffnxtCw.js → rule-kMIC0vOi.js} +3 -3
- package/dist/{template-CbHOOFuo.js → template-BH9vS8A9.js} +7 -7
- package/dist/{timezone-CDbzzKWe.js → timezone-CMX1sJ0a.js} +1 -1
- package/dist/{transaction.fn-CM89jnhJ.js → transaction.fn-Bjy5utxD.js} +2 -2
- package/dist/{trigger-BUKAiVxy.js → trigger-DnnOJVUi.js} +5 -5
- package/dist/{useMarketingMaterialActions-D-AWVN4e.js → useMarketingMaterialActions-DMrNOpok.js} +4 -4
- package/dist/{usePagination-3kKtIKVu.js → usePagination-BCY4a-dh.js} +1 -1
- package/dist/{user-CHb8XZ5i.js → user-BTc0S1Vx.js} +1 -1
- package/dist/{vue-i18n-CqhxVhhE.js → vue-i18n-7BKLPLxj.js} +112 -112
- package/dist/{xlsx-BR-cAoRJ.js → xlsx-DR5oLrEs.js} +1 -1
- package/dist/{zod-dX5GDNHW.js → zod-CMq39HWn.js} +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, createTextVNode, watchEffect, onMounted, withModifiers, toRefs, normalizeStyle, resolveDynamicComponent, onBeforeUnmount, createSlots } from "vue";
|
|
2
|
-
import { _ } from "./lodash-
|
|
3
|
-
import { h as axios, S as SvcConfig } from "./index-
|
|
4
|
-
import { z } from "./app-
|
|
5
|
-
import { Z as ZodHelper } from "./zod-
|
|
1
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, createTextVNode, watchEffect, onMounted, withModifiers, toRefs, normalizeStyle, resolveDynamicComponent, nextTick, onBeforeUnmount, createSlots } from "vue";
|
|
2
|
+
import { _ } from "./lodash-Daey2k0N.js";
|
|
3
|
+
import { h as axios, S as SvcConfig } from "./index-BvFq5REc.js";
|
|
4
|
+
import { z } from "./app-BXqas0p1.js";
|
|
5
|
+
import { Z as ZodHelper } from "./zod-CMq39HWn.js";
|
|
6
6
|
import { z as z$1 } from "./index-C_H8jFYf.js";
|
|
7
|
-
import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-
|
|
8
|
-
import { F as FdoObjectId } from "./index-
|
|
9
|
-
import { F as FdtoCollectibleConfig } from "./index-
|
|
10
|
-
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-
|
|
11
|
-
import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-
|
|
12
|
-
import { d as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, e as isChannelComplete, f as setMode, h as addChannel, j as hasDraft, k as setPrimaryChannel, r as removeChannel, m as moveChannel, l as setChannelContent, n as getCampaignSummaryObject, o as normaliseBroadcastDelivery } from "./campaign-
|
|
13
|
-
import { u as useMembershipStore } from "./membership-
|
|
14
|
-
import { u as useBusinessStore } from "./business-
|
|
7
|
+
import { e as FdoGroup, F as F_RUNNABLE_CAMPAIGN_TYPE, f as FdtoRunnableCampaign, g as FdoCreditLoyaltyReward, h as FdtoRandomReward, i as F_MISSION_TYPE, j as FdoThresholdCreditReward, k as FdtoThresholdReward, l as FdoMission } from "./index-D-D0s8PB.js";
|
|
8
|
+
import { F as FdoObjectId } from "./index-D9zjHXFU.js";
|
|
9
|
+
import { F as FdtoCollectibleConfig } from "./index-DAtVp1NI.js";
|
|
10
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-DgU6P24U.js";
|
|
11
|
+
import { A as APP_INBOX_BODY_LIMIT, g as FdoBroadcastUrl, h as F_PUSH_DESTINATION, t as toDelivery, i as toLegacyMessage } from "./index-CBfVFFME.js";
|
|
12
|
+
import { d as CHANNEL_DISPLAY_ORDER, i as isPaidChannel, e as isChannelComplete, f as setMode, h as addChannel, j as hasDraft, k as setPrimaryChannel, r as removeChannel, m as moveChannel, l as setChannelContent, n as getCampaignSummaryObject, o as normaliseBroadcastDelivery } from "./campaign-DASPASQ0.js";
|
|
13
|
+
import { u as useMembershipStore } from "./membership-DfG-fl80.js";
|
|
14
|
+
import { u as useBusinessStore } from "./business-RsRhXSh8.js";
|
|
15
15
|
import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
|
|
16
16
|
import { h as hooks } from "./moment-D7p2TMB-.js";
|
|
17
17
|
import { f as featureVersionMapping } from "./campaign.enum-BqekIiiN.js";
|
|
18
|
-
import { _ as _sfc_main$
|
|
19
|
-
import { _ as _sfc_main$
|
|
20
|
-
import { _ as _sfc_main$
|
|
21
|
-
import { _ as _sfc_main$
|
|
22
|
-
import { _ as _sfc_main$
|
|
23
|
-
import { p as prompt, f as firebaseStorage } from "./plugins-
|
|
24
|
-
import { u as useI18n } from "./vue-i18n-
|
|
25
|
-
import { T as TypeToTriggerOptions, _ as _sfc_main$
|
|
26
|
-
import { D as DEFAULT_MESSAGE_VARIABLES, a as _sfc_main$
|
|
18
|
+
import { _ as _sfc_main$y } from "./ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js";
|
|
19
|
+
import { _ as _sfc_main$w, a as _sfc_main$z, b as _sfc_main$B } from "./EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js";
|
|
20
|
+
import { _ as _sfc_main$A } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js";
|
|
21
|
+
import { _ as _sfc_main$C } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js";
|
|
22
|
+
import { _ as _sfc_main$q, a as _sfc_main$u } from "./RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js";
|
|
23
|
+
import { p as prompt, f as firebaseStorage } from "./plugins-Def73Eyk.js";
|
|
24
|
+
import { u as useI18n } from "./vue-i18n-7BKLPLxj.js";
|
|
25
|
+
import { T as TypeToTriggerOptions, _ as _sfc_main$D, b as _sfc_main$E } from "./trigger-DnnOJVUi.js";
|
|
26
|
+
import { D as DEFAULT_MESSAGE_VARIABLES, a as _sfc_main$r, g as getSmsMessageMetrics, _ as _sfc_main$s, b as _sfc_main$t } from "./MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js";
|
|
27
27
|
import { useDialog } from "@feedmepos/ui-library";
|
|
28
28
|
import { useCoreStore } from "@feedmepos/mf-common";
|
|
29
|
-
import { c as campaignApi } from "./index-
|
|
30
|
-
import { m as membershipApi } from "./index-
|
|
31
|
-
import { a as useChannelFlag } from "./feature-flag-
|
|
32
|
-
import { m as moment } from "./index-
|
|
33
|
-
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-
|
|
34
|
-
import { C as CountryTimezone } from "./timezone-
|
|
35
|
-
import { _ as _sfc_main$
|
|
36
|
-
import "./index-
|
|
37
|
-
import { T as TEMPLATES } from "./index-
|
|
38
|
-
import "./index-
|
|
29
|
+
import { c as campaignApi } from "./index-BV-YiCDM.js";
|
|
30
|
+
import { m as membershipApi } from "./index-B1dAoOWi.js";
|
|
31
|
+
import { a as useChannelFlag } from "./feature-flag-B4bJnuei.js";
|
|
32
|
+
import { m as moment } from "./index-B6A6sHpy.js";
|
|
33
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-kMIC0vOi.js";
|
|
34
|
+
import { C as CountryTimezone } from "./timezone-CMX1sJ0a.js";
|
|
35
|
+
import { _ as _sfc_main$v, a as _sfc_main$x } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js";
|
|
36
|
+
import "./index-CJ-BZCvB.js";
|
|
37
|
+
import { T as TEMPLATES } from "./index-DeomfIu9.js";
|
|
38
|
+
import "./index-C2rjmdar.js";
|
|
39
39
|
import "./index-CH-uRaZH.js";
|
|
40
|
-
import "./index-
|
|
40
|
+
import "./index-Q-iHraJ3.js";
|
|
41
41
|
import { a as F_GAME_TYPE } from "./collectible.enum-Liy2wH3s.js";
|
|
42
|
-
import { u as useLoading } from "./loading-
|
|
43
|
-
import { i as initCollectibleConfig } from "./helper-
|
|
44
|
-
import { C as CollectionUtils } from "./collection.fn-
|
|
42
|
+
import { u as useLoading } from "./loading-BvlSfSVK.js";
|
|
43
|
+
import { i as initCollectibleConfig } from "./helper-BtTBvFuA.js";
|
|
44
|
+
import { C as CollectionUtils } from "./collection.fn-C7jNdh0A.js";
|
|
45
45
|
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
46
|
-
import { u as useCampaignStore } from "./campaign-
|
|
46
|
+
import { u as useCampaignStore } from "./campaign-C2X6aa7B.js";
|
|
47
47
|
import { a as cleanPF } from "./object-BYyQ0PZp.js";
|
|
48
48
|
const publicClient = axios.create({ withCredentials: !1, timeout: 5e3 });
|
|
49
49
|
async function getNativeApp(e) {
|
|
@@ -62,8 +62,8 @@ function campaignRefinement(e, l) {
|
|
|
62
62
|
if (!e) return;
|
|
63
63
|
const o = e.campaign;
|
|
64
64
|
if (!o) return;
|
|
65
|
-
const
|
|
66
|
-
if (!
|
|
65
|
+
const s = o.event.rule;
|
|
66
|
+
if (!s || !isRuleGroup(s)) {
|
|
67
67
|
l.addIssue({
|
|
68
68
|
code: "custom",
|
|
69
69
|
path: ["campaign", "event", "rule"],
|
|
@@ -88,7 +88,7 @@ function campaignRefinement(e, l) {
|
|
|
88
88
|
}
|
|
89
89
|
case "CREDIT": {
|
|
90
90
|
const a = (r = o.config) == null ? void 0 : r.validityOption;
|
|
91
|
-
(!a || ["validForDay", "validBefore"].every((
|
|
91
|
+
(!a || ["validForDay", "validBefore"].every((m) => a[m] == null)) && l.addIssue({
|
|
92
92
|
code: "custom",
|
|
93
93
|
path: ["campaign", "config", "validityOption"],
|
|
94
94
|
params: {
|
|
@@ -116,7 +116,7 @@ function campaignRefinement(e, l) {
|
|
|
116
116
|
}));
|
|
117
117
|
break;
|
|
118
118
|
case "SCHEDULE": {
|
|
119
|
-
if (!
|
|
119
|
+
if (!s.rules.g_schedule) {
|
|
120
120
|
l.addIssue({
|
|
121
121
|
code: "custom",
|
|
122
122
|
path: ["campaign", "event", "rule"],
|
|
@@ -128,7 +128,7 @@ function campaignRefinement(e, l) {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const a = RuleBuilder.getRules(
|
|
131
|
-
|
|
131
|
+
s.rules.g_schedule
|
|
132
132
|
), n = [
|
|
133
133
|
{
|
|
134
134
|
property: "trigger.date",
|
|
@@ -139,9 +139,9 @@ function campaignRefinement(e, l) {
|
|
|
139
139
|
operator: ["_isOnTime"]
|
|
140
140
|
}
|
|
141
141
|
];
|
|
142
|
-
n.length == a.length && n.every((
|
|
143
|
-
const
|
|
144
|
-
return
|
|
142
|
+
n.length == a.length && n.every((i) => a.some((f) => {
|
|
143
|
+
const c = RuleBuilder.simplify(f);
|
|
144
|
+
return c.property === i.property && i.operator.includes(c.operator);
|
|
145
145
|
})) || l.addIssue({
|
|
146
146
|
code: "custom",
|
|
147
147
|
path: ["campaign", "event", "rule"],
|
|
@@ -166,20 +166,20 @@ function campaignRefinement(e, l) {
|
|
|
166
166
|
function campaignTransform(e) {
|
|
167
167
|
var o;
|
|
168
168
|
if (e.campaign.type === "VOUCHER" && "configs" in e) {
|
|
169
|
-
const
|
|
170
|
-
|
|
169
|
+
const s = e.configs;
|
|
170
|
+
s.extras.targetLocation = e.campaign.targetLocation;
|
|
171
171
|
const r = Math.max(
|
|
172
172
|
e.campaign.earningOption.amount,
|
|
173
|
-
|
|
173
|
+
s.options.maxUse ?? 1
|
|
174
174
|
);
|
|
175
|
-
e.campaign.earningOption.amount = r,
|
|
175
|
+
e.campaign.earningOption.amount = r, s.options.maxUse = r, e.campaign.earningOption = {
|
|
176
176
|
type: "FIXED",
|
|
177
177
|
amount: 1
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
if (e.campaign.type == "MISSION" && "configs" in e) {
|
|
181
|
-
const
|
|
182
|
-
|
|
181
|
+
const s = e.configs;
|
|
182
|
+
s.options.validityOption = (o = e.campaign.config) == null ? void 0 : o.validityOption;
|
|
183
183
|
}
|
|
184
184
|
const l = e.campaign.event;
|
|
185
185
|
return l.type != "BILL_COMPLETED" && l.rule && isRuleGroup(l.rule) && (l.rule = RuleBuilder.removeEntry(l.rule, "g_bill"), e.campaign.event = l), e;
|
|
@@ -266,7 +266,7 @@ const CampaignDtos = {
|
|
|
266
266
|
[F_RUNNABLE_CAMPAIGN_TYPE.enum.REWARD_POOL]: GenerateCampaignReq("REWARD_POOL"),
|
|
267
267
|
[F_RUNNABLE_CAMPAIGN_TYPE.enum.GAME]: GenerateCampaignReq("GAME"),
|
|
268
268
|
[F_RUNNABLE_CAMPAIGN_TYPE.enum.MISSION]: GenerateCampaignReq("MISSION")
|
|
269
|
-
}, _hoisted_1$
|
|
269
|
+
}, _hoisted_1$n = { class: "space-y-24" }, _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
270
270
|
__name: "TimeRuleGroup",
|
|
271
271
|
props: {
|
|
272
272
|
modelValue: {
|
|
@@ -277,30 +277,30 @@ const CampaignDtos = {
|
|
|
277
277
|
},
|
|
278
278
|
emits: ["update:model-value"],
|
|
279
279
|
setup(e, { emit: l }) {
|
|
280
|
-
const { t: o } = useI18n(),
|
|
281
|
-
!
|
|
280
|
+
const { t: o } = useI18n(), s = e, r = l, y = ref(
|
|
281
|
+
!s.modelValue || !s.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(s.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
282
282
|
);
|
|
283
|
-
watch(y, async (n,
|
|
284
|
-
var
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
283
|
+
watch(y, async (n, m) => {
|
|
284
|
+
var i;
|
|
285
|
+
if (m == "custom" && n == "all_time" && RuleBuilder.getRules((i = s.modelValue) == null ? void 0 : i.rules.g_time).length > 0) {
|
|
286
|
+
const f = await prompt.confirm(
|
|
287
287
|
o("connect.template.rule.time.confirm_remove"),
|
|
288
288
|
o("connect.common.confirm"),
|
|
289
289
|
o("connect.common.confirm"),
|
|
290
290
|
o("connect.common.cancel")
|
|
291
291
|
);
|
|
292
|
-
|
|
292
|
+
f && r(
|
|
293
293
|
"update:model-value",
|
|
294
294
|
RuleBuilder.setRuleToGroup(
|
|
295
|
-
|
|
295
|
+
s.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
296
296
|
RuleBuilder.scaffoldGroup("g_time")
|
|
297
297
|
)
|
|
298
|
-
), y.value =
|
|
298
|
+
), y.value = f ? n : m;
|
|
299
299
|
}
|
|
300
300
|
});
|
|
301
301
|
async function a(n) {
|
|
302
|
-
var
|
|
303
|
-
if (n == "custom" && RuleBuilder.getRules((
|
|
302
|
+
var m;
|
|
303
|
+
if (n == "custom" && RuleBuilder.getRules((m = s.modelValue) == null ? void 0 : m.rules.g_time).length > 0) {
|
|
304
304
|
if (!await prompt.confirm(
|
|
305
305
|
o("connect.template.rule.time.confirm_remove"),
|
|
306
306
|
o("connect.common.confirm"),
|
|
@@ -313,46 +313,46 @@ const CampaignDtos = {
|
|
|
313
313
|
r(
|
|
314
314
|
"update:model-value",
|
|
315
315
|
RuleBuilder.setRuleToGroup(
|
|
316
|
-
|
|
316
|
+
s.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
317
317
|
RuleBuilder.scaffoldGroup("g_time")
|
|
318
318
|
)
|
|
319
319
|
);
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
|
-
return (n,
|
|
323
|
-
var
|
|
324
|
-
const
|
|
325
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
326
|
-
createVNode(
|
|
322
|
+
return (n, m) => {
|
|
323
|
+
var c;
|
|
324
|
+
const i = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
|
|
325
|
+
return openBlock(), createElementBlock("div", _hoisted_1$n, [
|
|
326
|
+
createVNode(f, {
|
|
327
327
|
modelValue: unref(y),
|
|
328
328
|
"onUpdate:modelValue": [
|
|
329
|
-
|
|
330
|
-
|
|
329
|
+
m[0] || (m[0] = (u) => isRef(y) ? y.value = u : null),
|
|
330
|
+
m[1] || (m[1] = (u) => a(u))
|
|
331
331
|
]
|
|
332
332
|
}, {
|
|
333
333
|
default: withCtx(() => [
|
|
334
|
-
createVNode(
|
|
334
|
+
createVNode(i, {
|
|
335
335
|
label: unref(o)("connect.template.rule.time.all_time"),
|
|
336
336
|
value: "all_time"
|
|
337
337
|
}, null, 8, ["label"]),
|
|
338
|
-
createVNode(
|
|
338
|
+
createVNode(i, {
|
|
339
339
|
label: unref(o)("connect.template.rule.time.custom"),
|
|
340
340
|
value: "custom"
|
|
341
341
|
}, null, 8, ["label"])
|
|
342
342
|
]),
|
|
343
343
|
_: 1
|
|
344
344
|
}, 8, ["modelValue"]),
|
|
345
|
-
unref(y) == "custom" ? (openBlock(), createBlock(_sfc_main$
|
|
345
|
+
unref(y) == "custom" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
346
346
|
key: 0,
|
|
347
347
|
class: "!mt-[0px]",
|
|
348
348
|
"include-only": "trigger",
|
|
349
349
|
"trigger-type": "SCHEDULE",
|
|
350
|
-
"model-value": ((
|
|
351
|
-
"onUpdate:modelValue":
|
|
350
|
+
"model-value": ((c = e.modelValue) == null ? void 0 : c.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
351
|
+
"onUpdate:modelValue": m[2] || (m[2] = (u) => r(
|
|
352
352
|
"update:model-value",
|
|
353
353
|
unref(RuleBuilder).setRuleToGroup(
|
|
354
354
|
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
355
|
-
|
|
355
|
+
u,
|
|
356
356
|
"&&"
|
|
357
357
|
)
|
|
358
358
|
))
|
|
@@ -360,7 +360,7 @@ const CampaignDtos = {
|
|
|
360
360
|
]);
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
|
-
}), _sfc_main$
|
|
363
|
+
}), _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
364
364
|
__name: "BirthdayInput",
|
|
365
365
|
props: {
|
|
366
366
|
modelValue: {
|
|
@@ -369,9 +369,9 @@ const CampaignDtos = {
|
|
|
369
369
|
},
|
|
370
370
|
emits: ["update:model-value"],
|
|
371
371
|
setup(e, { emit: l }) {
|
|
372
|
-
const { t: o } = useI18n(),
|
|
373
|
-
const { property: a, operator: n, equator:
|
|
374
|
-
|
|
372
|
+
const { t: o } = useI18n(), s = e, r = l, y = computed(() => {
|
|
373
|
+
const { property: a, operator: n, equator: m } = RuleBuilder.simplify(
|
|
374
|
+
s.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
375
375
|
op: "before",
|
|
376
376
|
x: 1
|
|
377
377
|
})
|
|
@@ -379,13 +379,13 @@ const CampaignDtos = {
|
|
|
379
379
|
return {
|
|
380
380
|
property: a,
|
|
381
381
|
operator: n,
|
|
382
|
-
equator:
|
|
382
|
+
equator: m
|
|
383
383
|
};
|
|
384
384
|
});
|
|
385
385
|
return (a, n) => {
|
|
386
|
-
const
|
|
386
|
+
const m = resolveComponent("FmRadio"), i = resolveComponent("FmStepperField");
|
|
387
387
|
return openBlock(), createElementBlock("div", null, [
|
|
388
|
-
createVNode(
|
|
388
|
+
createVNode(m, {
|
|
389
389
|
label: unref(o)("connect.template.rule.birthday.on_birthday"),
|
|
390
390
|
value: "_isRange-day",
|
|
391
391
|
"model-value": `${unref(y).operator}-${unref(y).equator.unit}`,
|
|
@@ -400,7 +400,7 @@ const CampaignDtos = {
|
|
|
400
400
|
);
|
|
401
401
|
})
|
|
402
402
|
}, null, 8, ["label", "model-value"]),
|
|
403
|
-
createVNode(
|
|
403
|
+
createVNode(m, {
|
|
404
404
|
label: unref(o)("connect.template.rule.birthday.days_before"),
|
|
405
405
|
value: "_isDay",
|
|
406
406
|
"model-value": unref(y).operator,
|
|
@@ -415,21 +415,21 @@ const CampaignDtos = {
|
|
|
415
415
|
);
|
|
416
416
|
})
|
|
417
417
|
}, null, 8, ["label", "model-value"]),
|
|
418
|
-
unref(y).operator == "_isDay" ? (openBlock(), createBlock(
|
|
418
|
+
unref(y).operator == "_isDay" ? (openBlock(), createBlock(i, {
|
|
419
419
|
key: 0,
|
|
420
420
|
label: unref(o)("connect.template.rule.birthday.days_before_label"),
|
|
421
421
|
"show-steppers": !1,
|
|
422
422
|
"model-value": unref(y).equator.x,
|
|
423
|
-
"onUpdate:modelValue": n[2] || (n[2] = (
|
|
423
|
+
"onUpdate:modelValue": n[2] || (n[2] = (f) => r(
|
|
424
424
|
"update:model-value",
|
|
425
425
|
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
426
426
|
op: "after",
|
|
427
|
-
x:
|
|
427
|
+
x: f,
|
|
428
428
|
ignoreYear: !0
|
|
429
429
|
})
|
|
430
430
|
))
|
|
431
431
|
}, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
|
|
432
|
-
createVNode(
|
|
432
|
+
createVNode(m, {
|
|
433
433
|
label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
|
|
434
434
|
value: "_isRange-week",
|
|
435
435
|
"model-value": `${unref(y).operator}-${unref(y).equator.unit}`,
|
|
@@ -444,7 +444,7 @@ const CampaignDtos = {
|
|
|
444
444
|
);
|
|
445
445
|
})
|
|
446
446
|
}, null, 8, ["label", "model-value"]),
|
|
447
|
-
createVNode(
|
|
447
|
+
createVNode(m, {
|
|
448
448
|
label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
|
|
449
449
|
value: "_isRange-month",
|
|
450
450
|
"model-value": `${unref(y).operator}-${unref(y).equator.unit}`,
|
|
@@ -462,7 +462,7 @@ const CampaignDtos = {
|
|
|
462
462
|
]);
|
|
463
463
|
};
|
|
464
464
|
}
|
|
465
|
-
}), _hoisted_1$
|
|
465
|
+
}), _hoisted_1$m = { class: "space-y-16" }, _hoisted_2$j = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$h = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$h = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$e = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
466
466
|
__name: "CampaignTriggerInput",
|
|
467
467
|
props: {
|
|
468
468
|
campaignType: {
|
|
@@ -479,30 +479,30 @@ const CampaignDtos = {
|
|
|
479
479
|
},
|
|
480
480
|
emits: ["update:model-value"],
|
|
481
481
|
setup(e, { emit: l }) {
|
|
482
|
-
const { t: o } = useI18n(),
|
|
483
|
-
(a) => a.value ==
|
|
484
|
-
) : TypeToTriggerOptions[
|
|
482
|
+
const { t: o } = useI18n(), s = e, r = l, y = computed(() => s.disabled ? TypeToTriggerOptions[s.campaignType].filter(
|
|
483
|
+
(a) => a.value == s.modelValue
|
|
484
|
+
) : TypeToTriggerOptions[s.campaignType]);
|
|
485
485
|
return (a, n) => {
|
|
486
|
-
const
|
|
487
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
488
|
-
createElementVNode("div", _hoisted_2$
|
|
489
|
-
createElementVNode("div", _hoisted_3$
|
|
490
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (
|
|
486
|
+
const m = resolveComponent("FmCard");
|
|
487
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
488
|
+
createElementVNode("div", _hoisted_2$j, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
|
|
489
|
+
createElementVNode("div", _hoisted_3$h, [
|
|
490
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (i) => (openBlock(), createBlock(m, {
|
|
491
491
|
variant: "outlined",
|
|
492
|
-
disabled:
|
|
492
|
+
disabled: s.disabled,
|
|
493
493
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
494
494
|
"col-span-3": unref(y).length == 1,
|
|
495
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
496
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
495
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == i.value,
|
|
496
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != i.value
|
|
497
497
|
}]),
|
|
498
498
|
onClick: () => {
|
|
499
|
-
|
|
499
|
+
s.modelValue != i.value && !s.disabled && r("update:model-value", i.value);
|
|
500
500
|
},
|
|
501
|
-
key:
|
|
501
|
+
key: i.name
|
|
502
502
|
}, {
|
|
503
503
|
default: withCtx(() => [
|
|
504
|
-
createElementVNode("div", _hoisted_4$
|
|
505
|
-
createElementVNode("div", _hoisted_5$
|
|
504
|
+
createElementVNode("div", _hoisted_4$h, toDisplayString(i.name), 1),
|
|
505
|
+
createElementVNode("div", _hoisted_5$e, toDisplayString(i.description), 1)
|
|
506
506
|
]),
|
|
507
507
|
_: 2
|
|
508
508
|
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
@@ -510,7 +510,7 @@ const CampaignDtos = {
|
|
|
510
510
|
]);
|
|
511
511
|
};
|
|
512
512
|
}
|
|
513
|
-
}), _sfc_main$
|
|
513
|
+
}), _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
514
514
|
__name: "DateInput",
|
|
515
515
|
props: {
|
|
516
516
|
label: {
|
|
@@ -525,25 +525,25 @@ const CampaignDtos = {
|
|
|
525
525
|
emits: ["update:model-value"],
|
|
526
526
|
setup(e, { emit: l }) {
|
|
527
527
|
const o = l;
|
|
528
|
-
return (
|
|
528
|
+
return (s, r) => {
|
|
529
529
|
const y = resolveComponent("FmButton"), a = resolveComponent("FmField"), n = resolveComponent("FmDatePicker");
|
|
530
530
|
return openBlock(), createBlock(n, {
|
|
531
531
|
label: e.label,
|
|
532
532
|
"model-value": e.modelValue || "",
|
|
533
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
533
|
+
"onUpdate:modelValue": r[1] || (r[1] = (m) => o("update:model-value", m))
|
|
534
534
|
}, {
|
|
535
|
-
"trigger-button": withCtx(({ opened:
|
|
535
|
+
"trigger-button": withCtx(({ opened: m }) => [
|
|
536
536
|
createVNode(a, {
|
|
537
537
|
class: "flex items-center",
|
|
538
538
|
"prepend-icon": "calendar_month",
|
|
539
|
-
"icon-outlined": !
|
|
539
|
+
"icon-outlined": !m
|
|
540
540
|
}, {
|
|
541
541
|
append: withCtx(() => [
|
|
542
542
|
e.modelValue ? (openBlock(), createBlock(y, {
|
|
543
543
|
key: 0,
|
|
544
544
|
variant: "tertiary",
|
|
545
545
|
icon: "clear",
|
|
546
|
-
onClick: r[0] || (r[0] = (
|
|
546
|
+
onClick: r[0] || (r[0] = (i) => (i.stopPropagation(), o("update:model-value", null)))
|
|
547
547
|
})) : createCommentVNode("", !0)
|
|
548
548
|
]),
|
|
549
549
|
default: withCtx(() => [
|
|
@@ -558,7 +558,7 @@ const CampaignDtos = {
|
|
|
558
558
|
}, 8, ["label", "model-value"]);
|
|
559
559
|
};
|
|
560
560
|
}
|
|
561
|
-
}), _hoisted_1$
|
|
561
|
+
}), _hoisted_1$l = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$i = { class: "flex-1 xs:w-full" }, _hoisted_3$g = { class: "mt-5 xs:hidden" }, _hoisted_4$g = { class: "flex-1 xs:w-full" }, _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
562
562
|
__name: "DateRangeInput",
|
|
563
563
|
props: {
|
|
564
564
|
modelValue: {
|
|
@@ -568,33 +568,33 @@ const CampaignDtos = {
|
|
|
568
568
|
},
|
|
569
569
|
emits: ["update:model-value"],
|
|
570
570
|
setup(e, { emit: l }) {
|
|
571
|
-
const { t: o } = useI18n(),
|
|
571
|
+
const { t: o } = useI18n(), s = l;
|
|
572
572
|
return (r, y) => {
|
|
573
573
|
var a, n;
|
|
574
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
575
|
-
createElementVNode("div", _hoisted_2$
|
|
576
|
-
createVNode(_sfc_main$
|
|
574
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
575
|
+
createElementVNode("div", _hoisted_2$i, [
|
|
576
|
+
createVNode(_sfc_main$m, {
|
|
577
577
|
"model-value": ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
|
|
578
578
|
label: unref(o)("connect.common.startDate"),
|
|
579
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
580
|
-
var
|
|
581
|
-
return
|
|
582
|
-
startDate:
|
|
583
|
-
endDate: ((
|
|
579
|
+
"onUpdate:modelValue": y[0] || (y[0] = (m) => {
|
|
580
|
+
var i;
|
|
581
|
+
return s("update:model-value", {
|
|
582
|
+
startDate: m,
|
|
583
|
+
endDate: ((i = e.modelValue) == null ? void 0 : i.endDate) ?? null
|
|
584
584
|
});
|
|
585
585
|
})
|
|
586
586
|
}, null, 8, ["model-value", "label"])
|
|
587
587
|
]),
|
|
588
|
-
createElementVNode("div", _hoisted_3$
|
|
589
|
-
createElementVNode("div", _hoisted_4$
|
|
590
|
-
createVNode(_sfc_main$
|
|
588
|
+
createElementVNode("div", _hoisted_3$g, toDisplayString(unref(o)("connect.common.to")), 1),
|
|
589
|
+
createElementVNode("div", _hoisted_4$g, [
|
|
590
|
+
createVNode(_sfc_main$m, {
|
|
591
591
|
"model-value": ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null,
|
|
592
592
|
label: unref(o)("connect.common.endDate"),
|
|
593
|
-
"onUpdate:modelValue": y[1] || (y[1] = (
|
|
594
|
-
var
|
|
595
|
-
return
|
|
596
|
-
startDate: ((
|
|
597
|
-
endDate:
|
|
593
|
+
"onUpdate:modelValue": y[1] || (y[1] = (m) => {
|
|
594
|
+
var i;
|
|
595
|
+
return s("update:model-value", {
|
|
596
|
+
startDate: ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
|
|
597
|
+
endDate: m
|
|
598
598
|
});
|
|
599
599
|
})
|
|
600
600
|
}, null, 8, ["model-value", "label"])
|
|
@@ -602,7 +602,7 @@ const CampaignDtos = {
|
|
|
602
602
|
]);
|
|
603
603
|
};
|
|
604
604
|
}
|
|
605
|
-
}), _hoisted_1$
|
|
605
|
+
}), _hoisted_1$k = { class: "flex flex-col gap-16" }, _hoisted_2$h = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$f = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$f = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$d = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$a = { class: "flex items-center justify-between gap-8" }, _hoisted_7$8 = { class: "fm-typo-en-body-lg-400" }, _hoisted_8$8 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_9$7 = { class: "flex flex-col gap-8" }, _hoisted_10$6 = { class: "flex items-baseline justify-between" }, _hoisted_11$4 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_13$3 = { class: "min-w-[160px] flex-1" }, _hoisted_14$3 = { class: "min-w-[180px] flex-1" }, TITLE_LIMIT$1 = 40, PREVIEW_LIMIT = 120, MAX_BUTTONS = 2, TITLE_WARN_AT$1 = 34, PREVIEW_WARN_AT = 110, _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
606
606
|
__name: "AppInboxInput",
|
|
607
607
|
props: {
|
|
608
608
|
modelValue: {
|
|
@@ -621,88 +621,88 @@ const CampaignDtos = {
|
|
|
621
621
|
},
|
|
622
622
|
emits: ["update:model-value"],
|
|
623
623
|
setup(e, { emit: l }) {
|
|
624
|
-
const { t: o } = useI18n(),
|
|
624
|
+
const { t: o } = useI18n(), s = e, r = l;
|
|
625
625
|
function y(k) {
|
|
626
|
-
r("update:model-value", { ...
|
|
626
|
+
r("update:model-value", { ...s.modelValue, ...k });
|
|
627
627
|
}
|
|
628
628
|
function a(k, b) {
|
|
629
629
|
return k >= b ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
630
630
|
}
|
|
631
|
-
const n = computed(() =>
|
|
631
|
+
const n = computed(() => s.modelValue.buttons ?? []), m = computed(() => {
|
|
632
632
|
var k;
|
|
633
|
-
return ((k =
|
|
633
|
+
return ((k = s.modelValue.content) == null ? void 0 : k.length) ?? 0;
|
|
634
634
|
});
|
|
635
|
-
function
|
|
635
|
+
function i(k, b) {
|
|
636
636
|
y({
|
|
637
637
|
buttons: n.value.map(
|
|
638
|
-
(
|
|
638
|
+
(h, d) => d === k ? { ...h, ...b } : h
|
|
639
639
|
)
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function f() {
|
|
643
643
|
n.value.length >= MAX_BUTTONS || y({ buttons: [...n.value, { label: "", url: "" }] });
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
var
|
|
647
|
-
if (!
|
|
648
|
-
const b = (
|
|
649
|
-
let
|
|
650
|
-
return b ? FdoBroadcastUrl.safeParse(b).success || (
|
|
645
|
+
function c(k) {
|
|
646
|
+
var d;
|
|
647
|
+
if (!s.showValidation) return { label: void 0, url: void 0 };
|
|
648
|
+
const b = (d = k.url) == null ? void 0 : d.trim();
|
|
649
|
+
let h;
|
|
650
|
+
return b ? FdoBroadcastUrl.safeParse(b).success || (h = o("connect.campaign.push.linkUrlInvalid")) : h = o("connect.campaign.appInbox.buttonUrlRequired"), {
|
|
651
651
|
label: k.label.trim() ? void 0 : o("connect.campaign.appInbox.buttonLabelRequired"),
|
|
652
|
-
url:
|
|
652
|
+
url: h
|
|
653
653
|
};
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
y({ buttons: n.value.filter((b,
|
|
655
|
+
function u(k) {
|
|
656
|
+
y({ buttons: n.value.filter((b, h) => h !== k) });
|
|
657
657
|
}
|
|
658
658
|
return (k, b) => {
|
|
659
|
-
const
|
|
660
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
659
|
+
const h = resolveComponent("FmTextField"), d = resolveComponent("FmButton");
|
|
660
|
+
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
661
661
|
createElementVNode("div", null, [
|
|
662
|
-
createElementVNode("div", _hoisted_2$
|
|
663
|
-
createElementVNode("span", _hoisted_3$
|
|
662
|
+
createElementVNode("div", _hoisted_2$h, [
|
|
663
|
+
createElementVNode("span", _hoisted_3$f, toDisplayString(unref(o)("connect.campaign.appInbox.title")), 1),
|
|
664
664
|
createElementVNode("span", {
|
|
665
665
|
class: normalizeClass(["fm-typo-en-body-sm-400", a(e.modelValue.title.length, TITLE_WARN_AT$1)])
|
|
666
666
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT$1), 3)
|
|
667
667
|
]),
|
|
668
|
-
createVNode(
|
|
668
|
+
createVNode(h, {
|
|
669
669
|
"model-value": e.modelValue.title,
|
|
670
670
|
"max-length": TITLE_LIMIT$1,
|
|
671
671
|
placeholder: unref(o)("connect.campaign.appInbox.titlePlaceholder"),
|
|
672
|
-
"onUpdate:modelValue": b[0] || (b[0] = (
|
|
672
|
+
"onUpdate:modelValue": b[0] || (b[0] = (p) => y({ title: p }))
|
|
673
673
|
}, null, 8, ["model-value", "placeholder"])
|
|
674
674
|
]),
|
|
675
675
|
createElementVNode("div", null, [
|
|
676
|
-
createElementVNode("div", _hoisted_4$
|
|
677
|
-
createElementVNode("span", _hoisted_5$
|
|
676
|
+
createElementVNode("div", _hoisted_4$f, [
|
|
677
|
+
createElementVNode("span", _hoisted_5$d, toDisplayString(unref(o)("connect.campaign.appInbox.previewText")), 1),
|
|
678
678
|
createElementVNode("span", {
|
|
679
679
|
class: normalizeClass(["fm-typo-en-body-sm-400", a(e.modelValue.previewText.length, PREVIEW_WARN_AT)])
|
|
680
680
|
}, toDisplayString(e.modelValue.previewText.length) + " / " + toDisplayString(PREVIEW_LIMIT), 3)
|
|
681
681
|
]),
|
|
682
|
-
createVNode(
|
|
682
|
+
createVNode(h, {
|
|
683
683
|
"model-value": e.modelValue.previewText,
|
|
684
684
|
"max-length": PREVIEW_LIMIT,
|
|
685
685
|
placeholder: unref(o)("connect.campaign.appInbox.previewTextPlaceholder"),
|
|
686
|
-
"onUpdate:modelValue": b[1] || (b[1] = (
|
|
686
|
+
"onUpdate:modelValue": b[1] || (b[1] = (p) => y({ previewText: p }))
|
|
687
687
|
}, null, 8, ["model-value", "placeholder"])
|
|
688
688
|
]),
|
|
689
|
-
createElementVNode("div", _hoisted_6$
|
|
689
|
+
createElementVNode("div", _hoisted_6$a, [
|
|
690
690
|
createElementVNode("div", null, [
|
|
691
|
-
createElementVNode("div", _hoisted_7$
|
|
692
|
-
createElementVNode("div", _hoisted_8$
|
|
691
|
+
createElementVNode("div", _hoisted_7$8, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessage")), 1),
|
|
692
|
+
createElementVNode("div", _hoisted_8$8, toDisplayString(unref(o)("connect.campaign.appInbox.bodyMessageDescription")), 1),
|
|
693
693
|
createElementVNode("div", {
|
|
694
694
|
class: normalizeClass([
|
|
695
695
|
"mt-[2px] fm-typo-en-body-sm-400",
|
|
696
|
-
unref(
|
|
696
|
+
unref(m) > unref(APP_INBOX_BODY_LIMIT) ? "text-fm-color-system-error-400" : "text-fm-color-typo-secondary"
|
|
697
697
|
])
|
|
698
|
-
}, toDisplayString(unref(
|
|
698
|
+
}, toDisplayString(unref(m)) + " / " + toDisplayString(unref(APP_INBOX_BODY_LIMIT)), 3)
|
|
699
699
|
]),
|
|
700
|
-
createVNode(_sfc_main$
|
|
700
|
+
createVNode(_sfc_main$r, {
|
|
701
701
|
html: e.modelValue.content,
|
|
702
702
|
variables: e.variables,
|
|
703
703
|
"media-limit": 1,
|
|
704
704
|
"button-label": unref(o)("connect.campaign.appInbox.editBodyMessage"),
|
|
705
|
-
"onUpdate:html": b[2] || (b[2] = (
|
|
705
|
+
"onUpdate:html": b[2] || (b[2] = (p) => y({ content: p.html }))
|
|
706
706
|
}, null, 8, ["html", "variables", "button-label"])
|
|
707
707
|
]),
|
|
708
708
|
createElementVNode("div", _hoisted_9$7, [
|
|
@@ -710,55 +710,55 @@ const CampaignDtos = {
|
|
|
710
710
|
createElementVNode("span", _hoisted_11$4, toDisplayString(unref(o)("connect.campaign.appInbox.buttons")), 1),
|
|
711
711
|
createElementVNode("span", _hoisted_12$3, toDisplayString(unref(n).length) + " / " + toDisplayString(MAX_BUTTONS), 1)
|
|
712
712
|
]),
|
|
713
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (
|
|
714
|
-
key:
|
|
713
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (p, v) => (openBlock(), createElementBlock("div", {
|
|
714
|
+
key: v,
|
|
715
715
|
class: "flex flex-wrap items-start gap-8"
|
|
716
716
|
}, [
|
|
717
717
|
createElementVNode("div", _hoisted_13$3, [
|
|
718
|
-
createVNode(
|
|
719
|
-
"model-value":
|
|
718
|
+
createVNode(h, {
|
|
719
|
+
"model-value": p.label,
|
|
720
720
|
"max-length": 20,
|
|
721
721
|
placeholder: unref(o)("connect.campaign.appInbox.buttonLabel"),
|
|
722
|
-
"helper-state":
|
|
723
|
-
"helper-text":
|
|
724
|
-
"onUpdate:modelValue": (C) =>
|
|
722
|
+
"helper-state": c(p).label ? "error" : "none",
|
|
723
|
+
"helper-text": c(p).label,
|
|
724
|
+
"onUpdate:modelValue": (C) => i(v, { label: C })
|
|
725
725
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
726
726
|
]),
|
|
727
727
|
createElementVNode("div", _hoisted_14$3, [
|
|
728
|
-
createVNode(
|
|
729
|
-
"model-value":
|
|
728
|
+
createVNode(h, {
|
|
729
|
+
"model-value": p.url ?? "",
|
|
730
730
|
inputmode: "url",
|
|
731
731
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
732
|
-
"helper-state":
|
|
733
|
-
"helper-text":
|
|
734
|
-
"onUpdate:modelValue": (C) =>
|
|
732
|
+
"helper-state": c(p).url ? "error" : "none",
|
|
733
|
+
"helper-text": c(p).url,
|
|
734
|
+
"onUpdate:modelValue": (C) => i(v, { url: C.trim() })
|
|
735
735
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
736
736
|
]),
|
|
737
|
-
createVNode(
|
|
737
|
+
createVNode(d, {
|
|
738
738
|
icon: "delete",
|
|
739
739
|
"icon-color": "neutral-gray-400",
|
|
740
740
|
variant: "tertiary",
|
|
741
|
-
onClick: (C) =>
|
|
741
|
+
onClick: (C) => u(v)
|
|
742
742
|
}, null, 8, ["onClick"])
|
|
743
743
|
]))), 128)),
|
|
744
|
-
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(
|
|
744
|
+
unref(n).length < MAX_BUTTONS ? (openBlock(), createBlock(d, {
|
|
745
745
|
key: 0,
|
|
746
746
|
variant: "tertiary",
|
|
747
747
|
icon: "add",
|
|
748
748
|
label: unref(o)("connect.campaign.appInbox.addButton"),
|
|
749
|
-
onClick:
|
|
749
|
+
onClick: f
|
|
750
750
|
}, null, 8, ["label"])) : createCommentVNode("", !0)
|
|
751
751
|
])
|
|
752
752
|
]);
|
|
753
753
|
};
|
|
754
754
|
}
|
|
755
|
-
}), _hoisted_1$
|
|
755
|
+
}), _hoisted_1$j = { class: "flex flex-col gap-16" }, _hoisted_2$g = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_3$e = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_4$e = { class: "mb-[6px] flex items-baseline justify-between" }, _hoisted_5$c = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_6$9 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, _hoisted_7$7 = {
|
|
756
756
|
key: 0,
|
|
757
757
|
class: "mt-4 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
758
|
-
}, _hoisted_8$
|
|
758
|
+
}, _hoisted_8$7 = {
|
|
759
759
|
key: 1,
|
|
760
760
|
class: "mt-12"
|
|
761
|
-
}, _hoisted_9$6 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, TITLE_LIMIT = 40, BODY_LIMIT = 120, TITLE_WARN_AT = 34, BODY_WARN_AT = 110, _sfc_main$
|
|
761
|
+
}, _hoisted_9$6 = { class: "mb-[6px] fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, TITLE_LIMIT = 40, BODY_LIMIT = 120, TITLE_WARN_AT = 34, BODY_WARN_AT = 110, _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
762
762
|
__name: "PushInput",
|
|
763
763
|
props: {
|
|
764
764
|
modelValue: {
|
|
@@ -773,64 +773,64 @@ const CampaignDtos = {
|
|
|
773
773
|
},
|
|
774
774
|
emits: ["update:model-value"],
|
|
775
775
|
setup(e, { emit: l }) {
|
|
776
|
-
const { t: o } = useI18n(),
|
|
777
|
-
var
|
|
778
|
-
if (!
|
|
779
|
-
const
|
|
780
|
-
return
|
|
776
|
+
const { t: o } = useI18n(), s = e, r = l, y = F_PUSH_DESTINATION.options, a = computed(() => s.modelValue.destination === "EXTERNAL"), n = computed(() => {
|
|
777
|
+
var u;
|
|
778
|
+
if (!s.showValidation || !a.value) return;
|
|
779
|
+
const c = (u = s.modelValue.url) == null ? void 0 : u.trim();
|
|
780
|
+
return c ? FdoBroadcastUrl.safeParse(c).success ? void 0 : o("connect.campaign.push.linkUrlInvalid") : o("connect.campaign.push.linkUrlRequired");
|
|
781
781
|
});
|
|
782
|
-
function
|
|
783
|
-
r("update:model-value", { ...
|
|
782
|
+
function m(c) {
|
|
783
|
+
r("update:model-value", { ...s.modelValue, ...c });
|
|
784
784
|
}
|
|
785
|
-
function
|
|
786
|
-
|
|
785
|
+
function i(c) {
|
|
786
|
+
m(c === "EXTERNAL" ? { destination: c } : { destination: c, url: null });
|
|
787
787
|
}
|
|
788
|
-
function
|
|
789
|
-
return
|
|
788
|
+
function f(c, u) {
|
|
789
|
+
return c >= u ? "text-fm-color-system-warning-400" : "text-fm-color-typo-secondary";
|
|
790
790
|
}
|
|
791
|
-
return (
|
|
792
|
-
const k = resolveComponent("FmTextField"), b = resolveComponent("FmTextarea"),
|
|
793
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
791
|
+
return (c, u) => {
|
|
792
|
+
const k = resolveComponent("FmTextField"), b = resolveComponent("FmTextarea"), h = resolveComponent("FmSelect");
|
|
793
|
+
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
794
794
|
createElementVNode("div", null, [
|
|
795
|
-
createElementVNode("div", _hoisted_2$
|
|
796
|
-
createElementVNode("span", _hoisted_3$
|
|
795
|
+
createElementVNode("div", _hoisted_2$g, [
|
|
796
|
+
createElementVNode("span", _hoisted_3$e, toDisplayString(unref(o)("connect.campaign.push.title")), 1),
|
|
797
797
|
createElementVNode("span", {
|
|
798
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
798
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", f(e.modelValue.title.length, TITLE_WARN_AT)])
|
|
799
799
|
}, toDisplayString(e.modelValue.title.length) + " / " + toDisplayString(TITLE_LIMIT), 3)
|
|
800
800
|
]),
|
|
801
801
|
createVNode(k, {
|
|
802
802
|
"model-value": e.modelValue.title,
|
|
803
803
|
"max-length": TITLE_LIMIT,
|
|
804
804
|
placeholder: unref(o)("connect.campaign.push.titlePlaceholder"),
|
|
805
|
-
"onUpdate:modelValue":
|
|
805
|
+
"onUpdate:modelValue": u[0] || (u[0] = (d) => m({ title: d }))
|
|
806
806
|
}, null, 8, ["model-value", "placeholder"])
|
|
807
807
|
]),
|
|
808
808
|
createElementVNode("div", null, [
|
|
809
|
-
createElementVNode("div", _hoisted_4$
|
|
810
|
-
createElementVNode("span", _hoisted_5$
|
|
809
|
+
createElementVNode("div", _hoisted_4$e, [
|
|
810
|
+
createElementVNode("span", _hoisted_5$c, toDisplayString(unref(o)("connect.campaign.push.body")), 1),
|
|
811
811
|
createElementVNode("span", {
|
|
812
|
-
class: normalizeClass(["fm-typo-en-body-sm-400",
|
|
812
|
+
class: normalizeClass(["fm-typo-en-body-sm-400", f(e.modelValue.body.length, BODY_WARN_AT)])
|
|
813
813
|
}, toDisplayString(e.modelValue.body.length) + " / " + toDisplayString(BODY_LIMIT), 3)
|
|
814
814
|
]),
|
|
815
815
|
createVNode(b, {
|
|
816
816
|
"model-value": e.modelValue.body,
|
|
817
817
|
"max-length": BODY_LIMIT,
|
|
818
818
|
placeholder: unref(o)("connect.campaign.push.bodyPlaceholder"),
|
|
819
|
-
"onUpdate:modelValue":
|
|
819
|
+
"onUpdate:modelValue": u[1] || (u[1] = (d) => m({ body: d }))
|
|
820
820
|
}, null, 8, ["model-value", "placeholder"])
|
|
821
821
|
]),
|
|
822
822
|
createElementVNode("div", null, [
|
|
823
|
-
createElementVNode("div", _hoisted_6$
|
|
824
|
-
createVNode(
|
|
823
|
+
createElementVNode("div", _hoisted_6$9, toDisplayString(unref(o)("connect.campaign.push.link")), 1),
|
|
824
|
+
createVNode(h, {
|
|
825
825
|
"model-value": e.modelValue.destination ?? "NONE",
|
|
826
|
-
items: unref(y).map((
|
|
827
|
-
label: unref(o)(`connect.campaign.appInbox.destination.${
|
|
828
|
-
value:
|
|
826
|
+
items: unref(y).map((d) => ({
|
|
827
|
+
label: unref(o)(`connect.campaign.appInbox.destination.${d}`),
|
|
828
|
+
value: d
|
|
829
829
|
})),
|
|
830
|
-
"onUpdate:modelValue":
|
|
830
|
+
"onUpdate:modelValue": u[2] || (u[2] = (d) => i(d))
|
|
831
831
|
}, null, 8, ["model-value", "items"]),
|
|
832
|
-
unref(a) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$
|
|
833
|
-
unref(a) ? (openBlock(), createElementBlock("div", _hoisted_8$
|
|
832
|
+
unref(a) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$7, toDisplayString(unref(o)("connect.campaign.push.linkHelper")), 1)),
|
|
833
|
+
unref(a) ? (openBlock(), createElementBlock("div", _hoisted_8$7, [
|
|
834
834
|
createElementVNode("div", _hoisted_9$6, toDisplayString(unref(o)("connect.campaign.push.linkUrl")), 1),
|
|
835
835
|
createVNode(k, {
|
|
836
836
|
"model-value": e.modelValue.url ?? "",
|
|
@@ -838,18 +838,18 @@ const CampaignDtos = {
|
|
|
838
838
|
placeholder: unref(o)("connect.campaign.push.linkUrlPlaceholder"),
|
|
839
839
|
"helper-state": unref(n) ? "error" : "none",
|
|
840
840
|
"helper-text": unref(n),
|
|
841
|
-
"onUpdate:modelValue":
|
|
841
|
+
"onUpdate:modelValue": u[3] || (u[3] = (d) => m({ url: d.trim() || null }))
|
|
842
842
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
|
|
843
843
|
])) : createCommentVNode("", !0)
|
|
844
844
|
])
|
|
845
845
|
]);
|
|
846
846
|
};
|
|
847
847
|
}
|
|
848
|
-
}), _hoisted_1$
|
|
848
|
+
}), _hoisted_1$i = { class: "flex items-stretch overflow-x-auto pb-4" }, _hoisted_2$f = {
|
|
849
849
|
key: 0,
|
|
850
850
|
class: "flex flex-none items-center px-8 fm-typo-en-body-lg-600 text-fm-color-neutral-gray-300",
|
|
851
851
|
"aria-hidden": "true"
|
|
852
|
-
}, _hoisted_3$
|
|
852
|
+
}, _hoisted_3$d = ["aria-current", "onClick"], _hoisted_4$d = { class: "flex items-center gap-[6px]" }, _hoisted_5$b = ["title"], _hoisted_6$8 = { class: "mt-[3px] block text-[11px] leading-[1.3] text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
853
853
|
__name: "ChannelContentTabs",
|
|
854
854
|
props: {
|
|
855
855
|
tabs: {},
|
|
@@ -858,12 +858,12 @@ const CampaignDtos = {
|
|
|
858
858
|
emits: ["update:model-value"],
|
|
859
859
|
setup(e) {
|
|
860
860
|
const { t: l } = useI18n();
|
|
861
|
-
return (o,
|
|
861
|
+
return (o, s) => (openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
862
862
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.tabs, (r) => (openBlock(), createElementBlock("div", {
|
|
863
863
|
key: r.key,
|
|
864
864
|
class: "flex flex-none items-center"
|
|
865
865
|
}, [
|
|
866
|
-
r.connector ? (openBlock(), createElementBlock("span", _hoisted_2$
|
|
866
|
+
r.connector ? (openBlock(), createElementBlock("span", _hoisted_2$f, toDisplayString(r.connector), 1)) : createCommentVNode("", !0),
|
|
867
867
|
createElementVNode("button", {
|
|
868
868
|
type: "button",
|
|
869
869
|
class: normalizeClass([
|
|
@@ -873,7 +873,7 @@ const CampaignDtos = {
|
|
|
873
873
|
"aria-current": e.modelValue === r.key ? "true" : void 0,
|
|
874
874
|
onClick: (y) => o.$emit("update:model-value", r.key)
|
|
875
875
|
}, [
|
|
876
|
-
createElementVNode("span", _hoisted_4$
|
|
876
|
+
createElementVNode("span", _hoisted_4$d, [
|
|
877
877
|
r.step ? (openBlock(), createElementBlock("span", {
|
|
878
878
|
key: 0,
|
|
879
879
|
class: normalizeClass([
|
|
@@ -891,20 +891,20 @@ const CampaignDtos = {
|
|
|
891
891
|
key: 1,
|
|
892
892
|
class: "h-[7px] w-[7px] flex-none rounded-full bg-fm-color-system-error-400",
|
|
893
893
|
title: unref(l)("connect.campaign.broadcast.messageMissing")
|
|
894
|
-
}, null, 8, _hoisted_5$
|
|
894
|
+
}, null, 8, _hoisted_5$b))
|
|
895
895
|
]),
|
|
896
|
-
createElementVNode("span", _hoisted_6$
|
|
897
|
-
], 10, _hoisted_3$
|
|
896
|
+
createElementVNode("span", _hoisted_6$8, toDisplayString(r.sub), 1)
|
|
897
|
+
], 10, _hoisted_3$d)
|
|
898
898
|
]))), 128))
|
|
899
899
|
]));
|
|
900
900
|
}
|
|
901
|
-
}), _hoisted_1$
|
|
901
|
+
}), _hoisted_1$h = {
|
|
902
902
|
key: 0,
|
|
903
903
|
class: "flex w-[264px] shrink-0 flex-col gap-8"
|
|
904
|
-
}, _hoisted_2$
|
|
904
|
+
}, _hoisted_2$e = { class: "fm-typo-en-body-md-600" }, _hoisted_3$c = { class: "flex justify-center py-8" }, _hoisted_4$c = {
|
|
905
905
|
key: 0,
|
|
906
906
|
class: "px-12 pb-16 pt-16"
|
|
907
|
-
}, _hoisted_5$
|
|
907
|
+
}, _hoisted_5$a = { class: "mb-12 text-center text-[11px] text-[rgba(255,255,255,0.6)]" }, _hoisted_6$7 = { class: "rounded-[14px] border border-[rgba(255,255,255,0.12)] bg-[rgba(255,255,255,0.14)] p-12 backdrop-blur" }, _hoisted_7$6 = { class: "fm-typo-en-body-md-600 text-fm-color-typo-white line-clamp-2" }, _hoisted_8$6 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-[rgba(255,255,255,0.72)] line-clamp-3" }, _hoisted_9$5 = {
|
|
908
908
|
key: 1,
|
|
909
909
|
class: "px-12 pb-16"
|
|
910
910
|
}, _hoisted_10$5 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_11$3 = { class: "rounded-[12px] border border-fm-color-neutral-gray-100 p-12" }, _hoisted_12$2 = { class: "fm-typo-en-body-md-600 line-clamp-2" }, _hoisted_13$2 = { class: "mt-[2px] fm-typo-en-body-sm-400 text-fm-color-typo-secondary line-clamp-3" }, _hoisted_14$2 = ["src"], _hoisted_15$2 = ["srcdoc", "title"], _hoisted_16$1 = {
|
|
@@ -913,7 +913,7 @@ const CampaignDtos = {
|
|
|
913
913
|
}, _hoisted_17$1 = {
|
|
914
914
|
key: 2,
|
|
915
915
|
class: "px-12 pb-16"
|
|
916
|
-
}, _hoisted_18$1 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_19$1 = { class: "whitespace-pre-wrap break-words rounded-[12px] bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400" }, _hoisted_20$1 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _sfc_main$
|
|
916
|
+
}, _hoisted_18$1 = { class: "fm-typo-en-body-md-600 mb-8" }, _hoisted_19$1 = { class: "whitespace-pre-wrap break-words rounded-[12px] bg-fm-color-neutral-gray-100 p-12 fm-typo-en-body-sm-400" }, _hoisted_20$1 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
917
917
|
__name: "ChannelPreview",
|
|
918
918
|
props: {
|
|
919
919
|
target: {},
|
|
@@ -921,45 +921,45 @@ const CampaignDtos = {
|
|
|
921
921
|
senderPrefix: {}
|
|
922
922
|
},
|
|
923
923
|
setup(e) {
|
|
924
|
-
const { t: l } = useI18n(), o = e,
|
|
924
|
+
const { t: l } = useI18n(), o = e, s = computed(
|
|
925
925
|
() => o.target === "PUSH" ? o.content : void 0
|
|
926
926
|
), r = computed(
|
|
927
927
|
() => o.target === "APP_INBOX" ? o.content : void 0
|
|
928
928
|
), y = computed(
|
|
929
929
|
() => o.target === "SMS" || o.target === "WHATSAPP" ? o.content : void 0
|
|
930
930
|
), a = computed(() => {
|
|
931
|
-
var
|
|
932
|
-
const
|
|
933
|
-
return
|
|
931
|
+
var c, u;
|
|
932
|
+
const f = (u = (c = y.value) == null ? void 0 : c.content) == null ? void 0 : u.trim();
|
|
933
|
+
return f ? o.senderPrefix ? `${o.senderPrefix}${f}` : f : l("connect.campaign.broadcast.preview.emptyText");
|
|
934
934
|
}), n = computed(() => {
|
|
935
|
-
var
|
|
936
|
-
const
|
|
937
|
-
return
|
|
935
|
+
var c;
|
|
936
|
+
const f = ((c = r.value) == null ? void 0 : c.content) ?? "";
|
|
937
|
+
return f.trim() ? `<!doctype html><meta charset="utf-8"><base target="_blank"><style>
|
|
938
938
|
html,body{margin:0;font:400 12px/1.5 Inter,system-ui,sans-serif;color:#1C1C1E;word-break:break-word}
|
|
939
939
|
img{max-width:100%;height:auto}
|
|
940
|
-
</style>${
|
|
941
|
-
}),
|
|
942
|
-
const
|
|
940
|
+
</style>${f}` : "";
|
|
941
|
+
}), m = computed(() => {
|
|
942
|
+
const f = /* @__PURE__ */ new Date(), c = f.toLocaleDateString(void 0, {
|
|
943
943
|
weekday: "short",
|
|
944
944
|
day: "2-digit",
|
|
945
945
|
month: "short"
|
|
946
|
-
}),
|
|
946
|
+
}), u = f.toLocaleTimeString(void 0, {
|
|
947
947
|
hour: "2-digit",
|
|
948
948
|
minute: "2-digit"
|
|
949
949
|
});
|
|
950
|
-
return `${
|
|
951
|
-
}),
|
|
952
|
-
return (
|
|
953
|
-
var
|
|
954
|
-
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
955
|
-
createElementVNode("div", _hoisted_2$
|
|
950
|
+
return `${c} · ${u}`;
|
|
951
|
+
}), i = computed(() => o.target === "PUSH" ? l("connect.campaign.broadcast.preview.note.push") : o.target === "APP_INBOX" ? l("connect.campaign.broadcast.preview.note.inbox") : l("connect.campaign.broadcast.preview.note.text"));
|
|
952
|
+
return (f, c) => {
|
|
953
|
+
var u, k, b, h, d, p, v, C, V, B, S;
|
|
954
|
+
return e.target !== "EMAIL" ? (openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
955
|
+
createElementVNode("div", _hoisted_2$e, toDisplayString(unref(l)("connect.campaign.broadcast.preview.title")), 1),
|
|
956
956
|
createElementVNode("div", {
|
|
957
957
|
class: normalizeClass([
|
|
958
958
|
"overflow-hidden rounded-[22px] border border-fm-color-neutral-gray-100",
|
|
959
959
|
e.target === "PUSH" ? "bg-fm-color-neutral-black" : "bg-fm-color-neutral-white"
|
|
960
960
|
])
|
|
961
961
|
}, [
|
|
962
|
-
createElementVNode("div", _hoisted_3$
|
|
962
|
+
createElementVNode("div", _hoisted_3$c, [
|
|
963
963
|
createElementVNode("div", {
|
|
964
964
|
class: normalizeClass([
|
|
965
965
|
"h-4 w-40 rounded-full",
|
|
@@ -967,17 +967,17 @@ const CampaignDtos = {
|
|
|
967
967
|
])
|
|
968
968
|
}, null, 2)
|
|
969
969
|
]),
|
|
970
|
-
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
971
|
-
createElementVNode("div", _hoisted_5$
|
|
972
|
-
createElementVNode("div", _hoisted_6$
|
|
973
|
-
createElementVNode("div", _hoisted_7$
|
|
974
|
-
createElementVNode("div", _hoisted_8$
|
|
970
|
+
e.target === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_4$c, [
|
|
971
|
+
createElementVNode("div", _hoisted_5$a, toDisplayString(unref(m)), 1),
|
|
972
|
+
createElementVNode("div", _hoisted_6$7, [
|
|
973
|
+
createElementVNode("div", _hoisted_7$6, toDisplayString(((k = (u = unref(s)) == null ? void 0 : u.title) == null ? void 0 : k.trim()) || unref(l)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
974
|
+
createElementVNode("div", _hoisted_8$6, toDisplayString(((h = (b = unref(s)) == null ? void 0 : b.body) == null ? void 0 : h.trim()) || unref(l)("connect.campaign.broadcast.preview.emptyBody")), 1)
|
|
975
975
|
])
|
|
976
976
|
])) : e.target === "APP_INBOX" ? (openBlock(), createElementBlock("div", _hoisted_9$5, [
|
|
977
977
|
createElementVNode("div", _hoisted_10$5, toDisplayString(unref(l)("connect.campaign.broadcast.preview.inboxHeading")), 1),
|
|
978
978
|
createElementVNode("div", _hoisted_11$3, [
|
|
979
|
-
createElementVNode("div", _hoisted_12$2, toDisplayString(((
|
|
980
|
-
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (
|
|
979
|
+
createElementVNode("div", _hoisted_12$2, toDisplayString(((p = (d = unref(r)) == null ? void 0 : d.title) == null ? void 0 : p.trim()) || unref(l)("connect.campaign.broadcast.preview.emptyTitle")), 1),
|
|
980
|
+
createElementVNode("div", _hoisted_13$2, toDisplayString(((C = (v = unref(r)) == null ? void 0 : v.previewText) == null ? void 0 : C.trim()) || unref(l)("connect.campaign.broadcast.preview.emptyBody")), 1),
|
|
981
981
|
(V = unref(r)) != null && V.imageUrl ? (openBlock(), createElementBlock("img", {
|
|
982
982
|
key: 0,
|
|
983
983
|
src: unref(r).imageUrl,
|
|
@@ -993,10 +993,10 @@ const CampaignDtos = {
|
|
|
993
993
|
title: unref(l)("connect.campaign.broadcast.preview.bodyFrameTitle")
|
|
994
994
|
}, null, 8, _hoisted_15$2)) : createCommentVNode("", !0),
|
|
995
995
|
(S = (B = unref(r)) == null ? void 0 : B.buttons) != null && S.length ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
|
|
996
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r).buttons, (
|
|
997
|
-
key:
|
|
996
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r).buttons, ($, w) => (openBlock(), createElementBlock("div", {
|
|
997
|
+
key: w,
|
|
998
998
|
class: "rounded-[8px] bg-fm-color-primary px-12 py-8 text-center fm-typo-en-body-sm-400 text-fm-color-typo-white"
|
|
999
|
-
}, toDisplayString(
|
|
999
|
+
}, toDisplayString($.label || unref(l)("connect.campaign.appInbox.buttonLabel")), 1))), 128))
|
|
1000
1000
|
])) : createCommentVNode("", !0)
|
|
1001
1001
|
])
|
|
1002
1002
|
])) : (openBlock(), createElementBlock("div", _hoisted_17$1, [
|
|
@@ -1004,11 +1004,11 @@ const CampaignDtos = {
|
|
|
1004
1004
|
createElementVNode("div", _hoisted_19$1, toDisplayString(unref(a)), 1)
|
|
1005
1005
|
]))
|
|
1006
1006
|
], 2),
|
|
1007
|
-
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(
|
|
1007
|
+
createElementVNode("div", _hoisted_20$1, toDisplayString(unref(i)), 1)
|
|
1008
1008
|
])) : createCommentVNode("", !0);
|
|
1009
1009
|
};
|
|
1010
1010
|
}
|
|
1011
|
-
}), _hoisted_1$
|
|
1011
|
+
}), _hoisted_1$g = { class: "flex flex-col gap-12 pt-8" }, _hoisted_2$d = { class: "flex flex-wrap items-baseline justify-between gap-16" }, _hoisted_3$b = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$b = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_5$9 = { class: "h-24 w-24 flex-none rounded-full bg-fm-color-neutral-gray-100 text-center fm-typo-en-body-sm-400 leading-[24px]" }, _hoisted_6$6 = { class: "min-w-0 flex-1" }, _hoisted_7$5 = { class: "flex flex-wrap items-center gap-[10px]" }, _hoisted_8$5 = { class: "fm-typo-en-body-md-600" }, _hoisted_9$4 = {
|
|
1012
1012
|
key: 0,
|
|
1013
1013
|
class: "inline-flex items-center gap-[5px] fm-typo-en-body-sm-400 text-fm-color-system-error-400"
|
|
1014
1014
|
}, _hoisted_10$4 = { class: "ml-auto flex flex-none items-center gap-[2px] border-l border-fm-color-neutral-gray-100 pl-4" }, _hoisted_11$2 = ["title"], _hoisted_12$1 = ["title"], _hoisted_13$1 = ["title"], _hoisted_14$1 = {
|
|
@@ -1017,7 +1017,7 @@ const CampaignDtos = {
|
|
|
1017
1017
|
}, _hoisted_15$1 = {
|
|
1018
1018
|
key: 1,
|
|
1019
1019
|
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1020
|
-
}, _sfc_main$
|
|
1020
|
+
}, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
1021
1021
|
__name: "FallbackChannelList",
|
|
1022
1022
|
props: {
|
|
1023
1023
|
rows: {},
|
|
@@ -1025,23 +1025,23 @@ const CampaignDtos = {
|
|
|
1025
1025
|
},
|
|
1026
1026
|
emits: ["move", "remove", "add"],
|
|
1027
1027
|
setup(e) {
|
|
1028
|
-
const { t: l } = useI18n(), o = e,
|
|
1028
|
+
const { t: l } = useI18n(), o = e, s = computed(() => o.addable.length > 0);
|
|
1029
1029
|
return (r, y) => {
|
|
1030
|
-
const a = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"),
|
|
1031
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1032
|
-
createElementVNode("div", _hoisted_2$
|
|
1033
|
-
createElementVNode("span", _hoisted_3$
|
|
1034
|
-
createElementVNode("span", _hoisted_4$
|
|
1030
|
+
const a = resolveComponent("FmButton"), n = resolveComponent("FmMenuItem"), m = resolveComponent("FmMenu");
|
|
1031
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
1032
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
1033
|
+
createElementVNode("span", _hoisted_3$b, toDisplayString(unref(l)("connect.campaign.broadcast.fallbackChannels")), 1),
|
|
1034
|
+
createElementVNode("span", _hoisted_4$b, toDisplayString(unref(l)("connect.campaign.broadcast.fallbackChannelsHint")), 1)
|
|
1035
1035
|
]),
|
|
1036
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (
|
|
1037
|
-
key:
|
|
1036
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.rows, (i, f) => (openBlock(), createElementBlock("div", {
|
|
1037
|
+
key: i.channel,
|
|
1038
1038
|
class: "flex flex-wrap items-center gap-12 rounded-[8px] border border-fm-color-neutral-gray-100 px-16 py-[14px]"
|
|
1039
1039
|
}, [
|
|
1040
|
-
createElementVNode("span", _hoisted_5$
|
|
1041
|
-
createElementVNode("span", _hoisted_6$
|
|
1042
|
-
createElementVNode("span", _hoisted_7$
|
|
1043
|
-
createElementVNode("span", _hoisted_8$
|
|
1044
|
-
|
|
1040
|
+
createElementVNode("span", _hoisted_5$9, toDisplayString(i.position), 1),
|
|
1041
|
+
createElementVNode("span", _hoisted_6$6, [
|
|
1042
|
+
createElementVNode("span", _hoisted_7$5, [
|
|
1043
|
+
createElementVNode("span", _hoisted_8$5, toDisplayString(i.label), 1),
|
|
1044
|
+
i.complete ? createCommentVNode("", !0) : (openBlock(), createElementBlock("span", _hoisted_9$4, [
|
|
1045
1045
|
y[0] || (y[0] = createElementVNode("span", { class: "h-[6px] w-[6px] rounded-full bg-fm-color-system-error-400" }, null, -1)),
|
|
1046
1046
|
createTextVNode(" " + toDisplayString(unref(l)("connect.campaign.broadcast.messageMissing")), 1)
|
|
1047
1047
|
]))
|
|
@@ -1056,8 +1056,8 @@ const CampaignDtos = {
|
|
|
1056
1056
|
icon: "arrow_upward",
|
|
1057
1057
|
"icon-color": "neutral-gray-400",
|
|
1058
1058
|
variant: "tertiary",
|
|
1059
|
-
disabled:
|
|
1060
|
-
onClick: (
|
|
1059
|
+
disabled: f === 0,
|
|
1060
|
+
onClick: (c) => r.$emit("move", i.channel, -1)
|
|
1061
1061
|
}, null, 8, ["disabled", "onClick"])
|
|
1062
1062
|
], 8, _hoisted_11$2),
|
|
1063
1063
|
createElementVNode("span", {
|
|
@@ -1068,8 +1068,8 @@ const CampaignDtos = {
|
|
|
1068
1068
|
icon: "arrow_downward",
|
|
1069
1069
|
"icon-color": "neutral-gray-400",
|
|
1070
1070
|
variant: "tertiary",
|
|
1071
|
-
disabled:
|
|
1072
|
-
onClick: (
|
|
1071
|
+
disabled: f === e.rows.length - 1,
|
|
1072
|
+
onClick: (c) => r.$emit("move", i.channel, 1)
|
|
1073
1073
|
}, null, 8, ["disabled", "onClick"])
|
|
1074
1074
|
], 8, _hoisted_12$1),
|
|
1075
1075
|
createElementVNode("span", {
|
|
@@ -1080,12 +1080,12 @@ const CampaignDtos = {
|
|
|
1080
1080
|
icon: "delete",
|
|
1081
1081
|
"icon-color": "neutral-gray-400",
|
|
1082
1082
|
variant: "tertiary",
|
|
1083
|
-
onClick: (
|
|
1083
|
+
onClick: (c) => r.$emit("remove", i.channel)
|
|
1084
1084
|
}, null, 8, ["onClick"])
|
|
1085
1085
|
], 8, _hoisted_13$1)
|
|
1086
1086
|
])
|
|
1087
1087
|
]))), 128)),
|
|
1088
|
-
unref(
|
|
1088
|
+
unref(s) ? (openBlock(), createBlock(m, {
|
|
1089
1089
|
key: 0,
|
|
1090
1090
|
placement: "bottom-start"
|
|
1091
1091
|
}, {
|
|
@@ -1093,10 +1093,10 @@ const CampaignDtos = {
|
|
|
1093
1093
|
createElementVNode("button", _hoisted_14$1, " + " + toDisplayString(unref(l)("connect.campaign.broadcast.addFallbackChannel")), 1)
|
|
1094
1094
|
]),
|
|
1095
1095
|
default: withCtx(() => [
|
|
1096
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (
|
|
1097
|
-
key:
|
|
1098
|
-
label:
|
|
1099
|
-
onClick: (
|
|
1096
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(e.addable, (i) => (openBlock(), createBlock(n, {
|
|
1097
|
+
key: i.channel,
|
|
1098
|
+
label: i.label,
|
|
1099
|
+
onClick: (f) => r.$emit("add", i.channel)
|
|
1100
1100
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
1101
1101
|
]),
|
|
1102
1102
|
_: 1
|
|
@@ -1106,7 +1106,7 @@ const CampaignDtos = {
|
|
|
1106
1106
|
}
|
|
1107
1107
|
});
|
|
1108
1108
|
var define_appEndpoint_default = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
|
|
1109
|
-
const _hoisted_1$
|
|
1109
|
+
const _hoisted_1$f = { class: "flex flex-col gap-[28px]" }, _hoisted_2$c = { class: "flex flex-col gap-[14px]" }, _hoisted_3$a = { class: "fm-typo-en-body-lg-600" }, _hoisted_4$a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$8 = { class: "grid gap-12 md:grid-cols-2 lg:grid-cols-2" }, _hoisted_6$5 = { class: "flex items-start justify-between gap-12" }, _hoisted_7$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_8$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
|
|
1110
1110
|
key: 0,
|
|
1111
1111
|
class: "flex items-start gap-8 fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
1112
1112
|
}, _hoisted_10$3 = { class: "flex flex-col gap-12" }, _hoisted_11$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_12 = { class: "grid items-stretch gap-12 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-4" }, _hoisted_13 = { class: "flex items-start justify-between gap-12" }, _hoisted_14 = {
|
|
@@ -1136,7 +1136,7 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1136
1136
|
}, _hoisted_25 = { class: "min-w-0 flex-1 basis-[340px]" }, _hoisted_26 = {
|
|
1137
1137
|
key: 1,
|
|
1138
1138
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
1139
|
-
}, _sfc_main$
|
|
1139
|
+
}, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1140
1140
|
__name: "BroadcastDeliveryInput",
|
|
1141
1141
|
props: {
|
|
1142
1142
|
pushAvailability: {
|
|
@@ -1167,12 +1167,12 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1167
1167
|
},
|
|
1168
1168
|
emits: ["retry-push", "update:model-value"],
|
|
1169
1169
|
setup(e, { emit: l }) {
|
|
1170
|
-
const { t: o } = useI18n(),
|
|
1171
|
-
let
|
|
1172
|
-
return
|
|
1170
|
+
const { t: o } = useI18n(), s = useDialog(), r = computed(() => {
|
|
1171
|
+
let g = "unavailable";
|
|
1172
|
+
return m.pushAvailability === "checking" ? g = "checking" : m.pushAvailability === "non-native" && (g = "requiresNativeApp"), o("connect.campaign.broadcast.pushAvailability." + g);
|
|
1173
1173
|
});
|
|
1174
1174
|
function y() {
|
|
1175
|
-
|
|
1175
|
+
s.open({
|
|
1176
1176
|
title: o("connect.campaign.broadcast.pushAvailability.contactSales"),
|
|
1177
1177
|
message: o("connect.campaign.broadcast.pushAvailability.dialogMessage"),
|
|
1178
1178
|
primaryActions: {
|
|
@@ -1181,42 +1181,42 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1181
1181
|
}
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
|
-
const a = useCoreStore(), n = useMembershipStore(),
|
|
1185
|
-
const
|
|
1186
|
-
return
|
|
1184
|
+
const a = useCoreStore(), n = useMembershipStore(), m = e, i = l, f = ref(!1), c = ref("SMS"), u = computed(() => {
|
|
1185
|
+
const g = m.modelValue;
|
|
1186
|
+
return g && "channels" in g ? g : toDelivery({ message: g });
|
|
1187
1187
|
});
|
|
1188
|
-
function k(
|
|
1189
|
-
|
|
1188
|
+
function k(g) {
|
|
1189
|
+
i("update:model-value", g);
|
|
1190
1190
|
}
|
|
1191
|
-
function b(
|
|
1192
|
-
return o(`connect.campaign.broadcast.channel.${
|
|
1191
|
+
function b(g) {
|
|
1192
|
+
return o(`connect.campaign.broadcast.channel.${g}`);
|
|
1193
1193
|
}
|
|
1194
|
-
const
|
|
1194
|
+
const h = {
|
|
1195
1195
|
SMS: "chat",
|
|
1196
1196
|
WHATSAPP: "chat",
|
|
1197
1197
|
EMAIL: "mail",
|
|
1198
1198
|
APP_INBOX: "inbox",
|
|
1199
1199
|
PUSH: "notifications"
|
|
1200
1200
|
};
|
|
1201
|
-
function
|
|
1202
|
-
return
|
|
1201
|
+
function d(g) {
|
|
1202
|
+
return h[g];
|
|
1203
1203
|
}
|
|
1204
|
-
const
|
|
1205
|
-
() =>
|
|
1206
|
-
(
|
|
1204
|
+
const p = computed(() => u.value.mode === "fallback"), v = computed(
|
|
1205
|
+
() => m.variables.filter(
|
|
1206
|
+
(g) => m.triggerType == "SCHEDULE" ? !g.startsWith("transaction.") : !0
|
|
1207
1207
|
)
|
|
1208
1208
|
), C = useChannelFlag();
|
|
1209
|
-
function V(
|
|
1210
|
-
return C(
|
|
1209
|
+
function V(g) {
|
|
1210
|
+
return C(g) === "off" ? !1 : g === "PUSH" ? m.pushAvailability === "native" : g === "WHATSAPP" ? f.value : !0;
|
|
1211
1211
|
}
|
|
1212
1212
|
const B = ["fallback", "all"];
|
|
1213
|
-
function S(
|
|
1214
|
-
|
|
1213
|
+
function S(g) {
|
|
1214
|
+
g !== u.value.mode && k(setMode(u.value, g));
|
|
1215
1215
|
}
|
|
1216
|
-
const
|
|
1217
|
-
function
|
|
1218
|
-
var
|
|
1219
|
-
const x = (
|
|
1216
|
+
const $ = ref(null);
|
|
1217
|
+
function w(g) {
|
|
1218
|
+
var N;
|
|
1219
|
+
const x = (N = $.value) == null ? void 0 : N[g];
|
|
1220
1220
|
return x ? new Intl.NumberFormat(void 0, {
|
|
1221
1221
|
style: "currency",
|
|
1222
1222
|
currency: x.currency,
|
|
@@ -1224,176 +1224,176 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1224
1224
|
maximumFractionDigits: x.precision
|
|
1225
1225
|
}).format(x.amount / 10 ** x.precision) : null;
|
|
1226
1226
|
}
|
|
1227
|
-
const
|
|
1227
|
+
const R = computed(
|
|
1228
1228
|
() => (
|
|
1229
1229
|
// A flagged-off channel stays visible while selected, so it can be removed.
|
|
1230
1230
|
CHANNEL_DISPLAY_ORDER.filter(
|
|
1231
|
-
(
|
|
1232
|
-
).map((
|
|
1233
|
-
const x =
|
|
1231
|
+
(g) => C(g) === "on" || u.value.channels.includes(g)
|
|
1232
|
+
).map((g) => {
|
|
1233
|
+
const x = u.value.channels.includes(g), N = w(g);
|
|
1234
1234
|
let F = o("connect.campaign.broadcast.freeChannel");
|
|
1235
|
-
return isPaidChannel(
|
|
1236
|
-
channel:
|
|
1237
|
-
label: b(
|
|
1235
|
+
return isPaidChannel(g) && (F = N ? o("connect.campaign.broadcast.perMessage", { price: N }) : null), {
|
|
1236
|
+
channel: g,
|
|
1237
|
+
label: b(g),
|
|
1238
1238
|
selected: x,
|
|
1239
|
-
available: V(
|
|
1239
|
+
available: V(g),
|
|
1240
1240
|
rateNote: F,
|
|
1241
1241
|
// In fallback mode the grid is a radio for the primary channel, so only
|
|
1242
1242
|
// the primary reads as checked; a fallback is tagged instead.
|
|
1243
|
-
checked:
|
|
1244
|
-
usedAsFallback:
|
|
1243
|
+
checked: p.value ? u.value.channels[0] === g : x,
|
|
1244
|
+
usedAsFallback: p.value && u.value.channels.indexOf(g) > 0
|
|
1245
1245
|
};
|
|
1246
1246
|
})
|
|
1247
1247
|
)
|
|
1248
1248
|
);
|
|
1249
|
-
async function T(
|
|
1250
|
-
if (
|
|
1251
|
-
await O(
|
|
1249
|
+
async function T(g) {
|
|
1250
|
+
if (p.value) {
|
|
1251
|
+
await O(g);
|
|
1252
1252
|
return;
|
|
1253
1253
|
}
|
|
1254
|
-
if (
|
|
1255
|
-
await I(
|
|
1254
|
+
if (u.value.channels.includes(g)) {
|
|
1255
|
+
await I(g);
|
|
1256
1256
|
return;
|
|
1257
1257
|
}
|
|
1258
|
-
V(
|
|
1258
|
+
V(g) && k(addChannel(u.value, g, v.value));
|
|
1259
1259
|
}
|
|
1260
|
-
async function O(
|
|
1261
|
-
if (!V(
|
|
1262
|
-
const x =
|
|
1263
|
-
x !==
|
|
1260
|
+
async function O(g) {
|
|
1261
|
+
if (!V(g)) return;
|
|
1262
|
+
const x = u.value.channels[0];
|
|
1263
|
+
x !== g && (x && hasDraft(u.value, x) && !await prompt.remove(
|
|
1264
1264
|
o("connect.campaign.broadcast.replaceChannelConfirm", {
|
|
1265
1265
|
channel: b(x),
|
|
1266
|
-
next: b(
|
|
1266
|
+
next: b(g)
|
|
1267
1267
|
})
|
|
1268
|
-
) || V(
|
|
1268
|
+
) || V(g) && (k(setPrimaryChannel(u.value, g, v.value)), c.value = g));
|
|
1269
1269
|
}
|
|
1270
|
-
async function I(
|
|
1271
|
-
if (hasDraft(
|
|
1270
|
+
async function I(g) {
|
|
1271
|
+
if (hasDraft(u.value, g) && !await prompt.remove(
|
|
1272
1272
|
o("connect.campaign.broadcast.removeChannelConfirm", {
|
|
1273
|
-
channel: b(
|
|
1273
|
+
channel: b(g)
|
|
1274
1274
|
})
|
|
1275
1275
|
))
|
|
1276
1276
|
return;
|
|
1277
|
-
const x = removeChannel(
|
|
1278
|
-
k(x),
|
|
1277
|
+
const x = removeChannel(u.value, g);
|
|
1278
|
+
k(x), c.value === g && (c.value = x.channels[0] ?? "SMS");
|
|
1279
1279
|
}
|
|
1280
|
-
function Y(
|
|
1281
|
-
k(moveChannel(
|
|
1280
|
+
function Y(g, x) {
|
|
1281
|
+
k(moveChannel(u.value, g, x));
|
|
1282
1282
|
}
|
|
1283
|
-
function j(
|
|
1284
|
-
V(
|
|
1283
|
+
function j(g) {
|
|
1284
|
+
V(g) && k(addChannel(u.value, g, v.value));
|
|
1285
1285
|
}
|
|
1286
1286
|
const G = computed(
|
|
1287
|
-
() =>
|
|
1288
|
-
channel:
|
|
1289
|
-
label: b(
|
|
1287
|
+
() => u.value.channels.slice(1).map((g, x) => ({
|
|
1288
|
+
channel: g,
|
|
1289
|
+
label: b(g),
|
|
1290
1290
|
position: x + 2,
|
|
1291
|
-
complete: !
|
|
1291
|
+
complete: !m.showValidation || isChannelComplete(u.value, g)
|
|
1292
1292
|
}))
|
|
1293
1293
|
), q = computed(
|
|
1294
1294
|
() => CHANNEL_DISPLAY_ORDER.filter(
|
|
1295
|
-
(
|
|
1296
|
-
).map((
|
|
1297
|
-
channel:
|
|
1298
|
-
label: b(
|
|
1295
|
+
(g) => !u.value.channels.includes(g) && V(g)
|
|
1296
|
+
).map((g) => ({
|
|
1297
|
+
channel: g,
|
|
1298
|
+
label: b(g)
|
|
1299
1299
|
}))
|
|
1300
1300
|
), U = computed(
|
|
1301
|
-
() =>
|
|
1302
|
-
let
|
|
1303
|
-
|
|
1301
|
+
() => u.value.channels.map((g, x) => {
|
|
1302
|
+
let N = o("connect.campaign.broadcast.tab.sendsToEligible");
|
|
1303
|
+
p.value && (N = o(
|
|
1304
1304
|
x === 0 ? "connect.campaign.broadcast.tab.firstAttempt" : "connect.campaign.broadcast.tab.ifNotReached"
|
|
1305
1305
|
));
|
|
1306
1306
|
let F;
|
|
1307
|
-
return x > 0 && (F =
|
|
1308
|
-
key:
|
|
1309
|
-
label: b(
|
|
1310
|
-
sub:
|
|
1311
|
-
complete: !
|
|
1312
|
-
step:
|
|
1307
|
+
return x > 0 && (F = p.value ? "→" : "+"), {
|
|
1308
|
+
key: g,
|
|
1309
|
+
label: b(g),
|
|
1310
|
+
sub: N,
|
|
1311
|
+
complete: !m.showValidation || isChannelComplete(u.value, g),
|
|
1312
|
+
step: p.value ? x + 1 : void 0,
|
|
1313
1313
|
connector: F
|
|
1314
1314
|
};
|
|
1315
1315
|
})
|
|
1316
1316
|
);
|
|
1317
1317
|
watchEffect(() => {
|
|
1318
|
-
const
|
|
1319
|
-
|
|
1318
|
+
const g = U.value.map((x) => x.key);
|
|
1319
|
+
g.length && !g.includes(c.value) && (c.value = g[0]);
|
|
1320
1320
|
});
|
|
1321
|
-
const D = computed(() =>
|
|
1322
|
-
const
|
|
1323
|
-
if (!(
|
|
1324
|
-
return
|
|
1321
|
+
const D = computed(() => c.value), W = computed(() => {
|
|
1322
|
+
const g = D.value;
|
|
1323
|
+
if (!(g === "APP_INBOX" || g === "PUSH"))
|
|
1324
|
+
return u.value.content[g];
|
|
1325
1325
|
}), L = computed(
|
|
1326
|
-
() =>
|
|
1326
|
+
() => u.value.content.APP_INBOX
|
|
1327
1327
|
), M = computed(
|
|
1328
|
-
() =>
|
|
1328
|
+
() => u.value.content.PUSH
|
|
1329
1329
|
);
|
|
1330
|
-
function
|
|
1331
|
-
k(setChannelContent(
|
|
1330
|
+
function Z(g) {
|
|
1331
|
+
k(setChannelContent(u.value, "APP_INBOX", g));
|
|
1332
1332
|
}
|
|
1333
|
-
function X(
|
|
1334
|
-
V("PUSH") && k(setChannelContent(
|
|
1333
|
+
function X(g) {
|
|
1334
|
+
V("PUSH") && k(setChannelContent(u.value, "PUSH", g));
|
|
1335
1335
|
}
|
|
1336
|
-
function K(
|
|
1337
|
-
|
|
1336
|
+
function K(g, x) {
|
|
1337
|
+
g === "APP_INBOX" || g === "PUSH" || k(setChannelContent(u.value, g, { ...x, channel: g }));
|
|
1338
1338
|
}
|
|
1339
1339
|
const H = computed(
|
|
1340
|
-
() =>
|
|
1340
|
+
() => u.value.channels.filter(isPaidChannel)
|
|
1341
1341
|
), J = computed(() => {
|
|
1342
|
-
var x,
|
|
1343
|
-
const
|
|
1344
|
-
return getSmsMessageMetrics({ brandName:
|
|
1342
|
+
var x, N, F;
|
|
1343
|
+
const g = ((x = n.membership) == null ? void 0 : x.brand) || ((F = (N = a.currentBusiness) == null ? void 0 : N.value) == null ? void 0 : F.name) || "";
|
|
1344
|
+
return getSmsMessageMetrics({ brandName: g, content: "" }).prefix;
|
|
1345
1345
|
}), Q = `${define_appEndpoint_default.licensePortalUrl}settings?businessId=${SvcConfig.businessId}`;
|
|
1346
1346
|
async function ee() {
|
|
1347
1347
|
try {
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1348
|
+
const g = await membershipApi.getWhatsappNumbers();
|
|
1349
|
+
f.value = g.some(
|
|
1350
1350
|
(x) => {
|
|
1351
|
-
var
|
|
1352
|
-
return (
|
|
1351
|
+
var N;
|
|
1352
|
+
return (N = x == null ? void 0 : x.default) == null ? void 0 : N.includes("Marketing");
|
|
1353
1353
|
}
|
|
1354
1354
|
);
|
|
1355
|
-
} catch (
|
|
1356
|
-
console.error("Failed to fetch WhatsApp numbers:",
|
|
1355
|
+
} catch (g) {
|
|
1356
|
+
console.error("Failed to fetch WhatsApp numbers:", g);
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
return onMounted(async () => {
|
|
1360
|
-
const
|
|
1361
|
-
|
|
1362
|
-
}), (
|
|
1363
|
-
const
|
|
1364
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1365
|
-
createElementVNode("div", _hoisted_2$
|
|
1360
|
+
const g = u.value.channels[0];
|
|
1361
|
+
g && (c.value = g), campaignApi.readBroadcastCreditSummary().then((x) => $.value = x.prices).catch(() => $.value = null), await ee();
|
|
1362
|
+
}), (g, x) => {
|
|
1363
|
+
const N = resolveComponent("FmIcon"), F = resolveComponent("FmCard"), A = resolveComponent("FmButton");
|
|
1364
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
1365
|
+
createElementVNode("div", _hoisted_2$c, [
|
|
1366
1366
|
createElementVNode("div", null, [
|
|
1367
|
-
createElementVNode("div", _hoisted_3$
|
|
1368
|
-
createElementVNode("div", _hoisted_4$
|
|
1367
|
+
createElementVNode("div", _hoisted_3$a, toDisplayString(unref(o)("connect.campaign.broadcast.delivery")), 1),
|
|
1368
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(unref(o)("connect.campaign.broadcast.deliveryDescription")), 1)
|
|
1369
1369
|
]),
|
|
1370
|
-
createElementVNode("div", _hoisted_5$
|
|
1370
|
+
createElementVNode("div", _hoisted_5$8, [
|
|
1371
1371
|
(openBlock(), createElementBlock(Fragment, null, renderList(B, (E) => createVNode(F, {
|
|
1372
1372
|
key: E,
|
|
1373
1373
|
variant: "outlined",
|
|
1374
1374
|
class: normalizeClass(["h-full cursor-pointer select-none p-16 space-y-8", {
|
|
1375
|
-
"border-fm-color-primary bg-fm-color-system-warning-100": unref(
|
|
1376
|
-
"hover:bg-fm-color-opacity-sm": unref(
|
|
1375
|
+
"border-fm-color-primary bg-fm-color-system-warning-100": unref(u).mode === E,
|
|
1376
|
+
"hover:bg-fm-color-opacity-sm": unref(u).mode !== E
|
|
1377
1377
|
}]),
|
|
1378
1378
|
onClick: (P) => S(E)
|
|
1379
1379
|
}, {
|
|
1380
1380
|
default: withCtx(() => [
|
|
1381
|
-
createElementVNode("div", _hoisted_6$
|
|
1382
|
-
createElementVNode("div", _hoisted_7$
|
|
1383
|
-
unref(
|
|
1381
|
+
createElementVNode("div", _hoisted_6$5, [
|
|
1382
|
+
createElementVNode("div", _hoisted_7$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${E}.label`)), 1),
|
|
1383
|
+
unref(u).mode === E ? (openBlock(), createBlock(N, {
|
|
1384
1384
|
key: 0,
|
|
1385
1385
|
name: "check_circle",
|
|
1386
1386
|
size: "md",
|
|
1387
1387
|
class: "shrink-0 text-fm-color-primary"
|
|
1388
1388
|
})) : createCommentVNode("", !0)
|
|
1389
1389
|
]),
|
|
1390
|
-
createElementVNode("div", _hoisted_8$
|
|
1390
|
+
createElementVNode("div", _hoisted_8$4, toDisplayString(unref(o)(`connect.campaign.broadcast.mode.${E}.description`)), 1)
|
|
1391
1391
|
]),
|
|
1392
1392
|
_: 2
|
|
1393
1393
|
}, 1032, ["class", "onClick"])), 64))
|
|
1394
1394
|
]),
|
|
1395
|
-
unref(
|
|
1396
|
-
createVNode(
|
|
1395
|
+
unref(u).channels.length < 2 ? (openBlock(), createElementBlock("div", _hoisted_9$3, [
|
|
1396
|
+
createVNode(N, {
|
|
1397
1397
|
name: "info",
|
|
1398
1398
|
size: "sm",
|
|
1399
1399
|
class: "mt-[2px]"
|
|
@@ -1402,9 +1402,9 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1402
1402
|
])) : createCommentVNode("", !0)
|
|
1403
1403
|
]),
|
|
1404
1404
|
createElementVNode("div", _hoisted_10$3, [
|
|
1405
|
-
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(
|
|
1405
|
+
createElementVNode("div", _hoisted_11$1, toDisplayString(unref(p) ? unref(o)("connect.campaign.broadcast.primaryChannel") : unref(o)("connect.campaign.broadcast.channels")), 1),
|
|
1406
1406
|
createElementVNode("div", _hoisted_12, [
|
|
1407
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
1407
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(R), (E) => (openBlock(), createBlock(F, {
|
|
1408
1408
|
key: E.channel,
|
|
1409
1409
|
variant: "outlined",
|
|
1410
1410
|
class: normalizeClass(["flex h-full flex-col gap-12 p-16", [
|
|
@@ -1422,19 +1422,19 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1422
1422
|
E.available ? "bg-fm-color-primary-oats text-fm-color-primary" : "bg-fm-color-neutral-gray-200 text-fm-color-neutral-gray-400"
|
|
1423
1423
|
])
|
|
1424
1424
|
}, [
|
|
1425
|
-
createVNode(
|
|
1426
|
-
name:
|
|
1425
|
+
createVNode(N, {
|
|
1426
|
+
name: d(E.channel),
|
|
1427
1427
|
size: "md"
|
|
1428
1428
|
}, null, 8, ["name"])
|
|
1429
1429
|
], 2),
|
|
1430
1430
|
E.available ? (openBlock(), createElementBlock("span", {
|
|
1431
1431
|
key: 0,
|
|
1432
1432
|
class: normalizeClass(["flex h-[22px] w-[22px] flex-none items-center justify-center border-2 transition-colors", [
|
|
1433
|
-
unref(
|
|
1433
|
+
unref(p) ? "rounded-full" : "rounded-[4px]",
|
|
1434
1434
|
E.checked ? "border-fm-color-primary bg-fm-color-primary text-fm-color-typo-white" : "border-fm-color-neutral-gray-300 bg-fm-color-neutral-white"
|
|
1435
1435
|
]])
|
|
1436
1436
|
}, [
|
|
1437
|
-
E.checked && !unref(
|
|
1437
|
+
E.checked && !unref(p) ? (openBlock(), createBlock(N, {
|
|
1438
1438
|
key: 0,
|
|
1439
1439
|
name: "check",
|
|
1440
1440
|
size: "sm"
|
|
@@ -1465,7 +1465,7 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1465
1465
|
e.pushAvailability === "failed" ? (openBlock(), createBlock(A, {
|
|
1466
1466
|
key: 1,
|
|
1467
1467
|
label: unref(o)("connect.campaign.broadcast.pushAvailability.retry"),
|
|
1468
|
-
onClick: x[1] || (x[1] = withModifiers((P) =>
|
|
1468
|
+
onClick: x[1] || (x[1] = withModifiers((P) => i("retry-push"), ["stop"]))
|
|
1469
1469
|
}, null, 8, ["label"])) : createCommentVNode("", !0),
|
|
1470
1470
|
E.selected ? (openBlock(), createBlock(A, {
|
|
1471
1471
|
key: 2,
|
|
@@ -1477,9 +1477,9 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1477
1477
|
_: 2
|
|
1478
1478
|
}, 1032, ["class", "aria-disabled", "onClick"]))), 128))
|
|
1479
1479
|
]),
|
|
1480
|
-
unref(
|
|
1481
|
-
e.showValidation && !unref(
|
|
1482
|
-
unref(
|
|
1480
|
+
unref(u).channels.includes("PUSH") && !V("PUSH") ? (openBlock(), createElementBlock("div", _hoisted_18, toDisplayString(unref(o)("connect.campaign.broadcast.pushAvailability.removeBeforeSave")), 1)) : createCommentVNode("", !0),
|
|
1481
|
+
e.showValidation && !unref(u).channels.length ? (openBlock(), createElementBlock("div", _hoisted_19, toDisplayString(unref(o)("connect.campaign.broadcast.selectChannelRequired")), 1)) : createCommentVNode("", !0),
|
|
1482
|
+
unref(p) && unref(u).channels.length ? (openBlock(), createBlock(_sfc_main$g, {
|
|
1483
1483
|
key: 2,
|
|
1484
1484
|
rows: unref(G),
|
|
1485
1485
|
addable: unref(q),
|
|
@@ -1493,45 +1493,45 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1493
1493
|
createElementVNode("div", _hoisted_21, toDisplayString(unref(o)("connect.campaign.broadcast.content")), 1),
|
|
1494
1494
|
createElementVNode("div", _hoisted_22, toDisplayString(unref(o)("connect.campaign.broadcast.contentDescription")), 1)
|
|
1495
1495
|
]),
|
|
1496
|
-
unref(H).length ? (openBlock(), createBlock(_sfc_main$
|
|
1496
|
+
unref(H).length ? (openBlock(), createBlock(_sfc_main$s, {
|
|
1497
1497
|
key: 0,
|
|
1498
1498
|
channels: unref(H)
|
|
1499
1499
|
}, null, 8, ["channels"])) : createCommentVNode("", !0),
|
|
1500
|
-
unref(
|
|
1501
|
-
unref(
|
|
1500
|
+
unref(u).channels.length ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_23, toDisplayString(unref(o)("connect.campaign.broadcast.noChannelContent")), 1)),
|
|
1501
|
+
unref(u).channels.length ? (openBlock(), createBlock(_sfc_main$i, {
|
|
1502
1502
|
key: 2,
|
|
1503
|
-
modelValue: unref(
|
|
1504
|
-
"onUpdate:modelValue": x[3] || (x[3] = (E) => isRef(
|
|
1503
|
+
modelValue: unref(c),
|
|
1504
|
+
"onUpdate:modelValue": x[3] || (x[3] = (E) => isRef(c) ? c.value = E : null),
|
|
1505
1505
|
tabs: unref(U)
|
|
1506
1506
|
}, null, 8, ["modelValue", "tabs"])) : createCommentVNode("", !0),
|
|
1507
|
-
unref(
|
|
1507
|
+
unref(u).channels.includes(unref(c)) ? (openBlock(), createElementBlock("div", _hoisted_24, [
|
|
1508
1508
|
createElementVNode("div", _hoisted_25, [
|
|
1509
|
-
unref(
|
|
1509
|
+
unref(c) === "PUSH" && unref(M) && V("PUSH") ? (openBlock(), createBlock(_sfc_main$j, {
|
|
1510
1510
|
key: 0,
|
|
1511
1511
|
"model-value": unref(M),
|
|
1512
1512
|
"show-validation": e.showValidation,
|
|
1513
1513
|
"onUpdate:modelValue": X
|
|
1514
|
-
}, null, 8, ["model-value", "show-validation"])) : unref(
|
|
1514
|
+
}, null, 8, ["model-value", "show-validation"])) : unref(c) === "PUSH" ? (openBlock(), createElementBlock("div", _hoisted_26, toDisplayString(unref(r)), 1)) : unref(c) === "APP_INBOX" && unref(L) ? (openBlock(), createBlock(_sfc_main$k, {
|
|
1515
1515
|
key: 2,
|
|
1516
1516
|
"model-value": unref(L),
|
|
1517
|
-
variables: unref(
|
|
1517
|
+
variables: unref(v),
|
|
1518
1518
|
"show-validation": e.showValidation,
|
|
1519
|
-
"onUpdate:modelValue":
|
|
1520
|
-
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(
|
|
1521
|
-
key: unref(
|
|
1522
|
-
"model-value": unref(
|
|
1519
|
+
"onUpdate:modelValue": Z
|
|
1520
|
+
}, null, 8, ["model-value", "variables", "show-validation"])) : unref(c) !== "APP_INBOX" ? (openBlock(), createBlock(_sfc_main$t, {
|
|
1521
|
+
key: unref(c),
|
|
1522
|
+
"model-value": unref(W),
|
|
1523
1523
|
"allow-email": !1,
|
|
1524
1524
|
"allow-whatsapp": !1,
|
|
1525
1525
|
"hide-credit-card": !0,
|
|
1526
1526
|
"trigger-type": e.triggerType,
|
|
1527
|
-
variables: unref(
|
|
1527
|
+
variables: unref(v),
|
|
1528
1528
|
placeholder: e.placeholder,
|
|
1529
1529
|
"onUpdate:modelValue": x[4] || (x[4] = (E) => K(unref(D), E))
|
|
1530
1530
|
}, null, 8, ["model-value", "trigger-type", "variables", "placeholder"])) : createCommentVNode("", !0)
|
|
1531
1531
|
]),
|
|
1532
|
-
createVNode(_sfc_main$
|
|
1533
|
-
target: unref(
|
|
1534
|
-
content: unref(
|
|
1532
|
+
createVNode(_sfc_main$h, {
|
|
1533
|
+
target: unref(c),
|
|
1534
|
+
content: unref(u).content[unref(D)],
|
|
1535
1535
|
"sender-prefix": unref(J)
|
|
1536
1536
|
}, null, 8, ["target", "content", "sender-prefix"])
|
|
1537
1537
|
])) : createCommentVNode("", !0)
|
|
@@ -1539,10 +1539,10 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1539
1539
|
]);
|
|
1540
1540
|
};
|
|
1541
1541
|
}
|
|
1542
|
-
}), _hoisted_1$
|
|
1542
|
+
}), _hoisted_1$e = { class: "space-y-8" }, _hoisted_2$b = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
|
|
1543
1543
|
key: 0,
|
|
1544
1544
|
class: "space-y-4"
|
|
1545
|
-
}, _hoisted_4$
|
|
1545
|
+
}, _hoisted_4$9 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
1546
1546
|
__name: "ScheduleRuleInput",
|
|
1547
1547
|
props: {
|
|
1548
1548
|
modelValue: {
|
|
@@ -1558,38 +1558,38 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1558
1558
|
},
|
|
1559
1559
|
emits: ["update:model-value"],
|
|
1560
1560
|
setup(e, { emit: l }) {
|
|
1561
|
-
const { t: o } = useI18n(),
|
|
1561
|
+
const { t: o } = useI18n(), s = e, r = l, y = useCoreStore(), a = computed(
|
|
1562
1562
|
() => CountryTimezone[y.currentCountry.value || "MY"]
|
|
1563
1563
|
);
|
|
1564
1564
|
function n() {
|
|
1565
|
-
const
|
|
1566
|
-
return
|
|
1567
|
-
(
|
|
1565
|
+
const h = RuleBuilder.getRules(s.modelValue);
|
|
1566
|
+
return h.length == 0 ? "fixed" : h.some(
|
|
1567
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).operator == "_rrule"
|
|
1568
1568
|
) ? "repeating" : "fixed";
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1570
|
+
const m = ref(n()), i = ref(!1), f = computed(() => [
|
|
1571
1571
|
{ label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
|
|
1572
1572
|
{ label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
|
|
1573
|
-
]),
|
|
1574
|
-
const
|
|
1575
|
-
(
|
|
1576
|
-
),
|
|
1577
|
-
(
|
|
1573
|
+
]), c = computed(() => {
|
|
1574
|
+
const h = RuleBuilder.getRules(s.modelValue), d = h.find(
|
|
1575
|
+
(v) => isRuleEntry(v) && RuleBuilder.simplify(v).property == "trigger.date"
|
|
1576
|
+
), p = h.find(
|
|
1577
|
+
(v) => isRuleEntry(v) && RuleBuilder.simplify(v).property == "trigger.time"
|
|
1578
1578
|
);
|
|
1579
1579
|
return {
|
|
1580
|
-
date:
|
|
1581
|
-
time:
|
|
1580
|
+
date: d ? RuleBuilder.simplify(d).equator : null,
|
|
1581
|
+
time: p ? RuleBuilder.simplify(p).equator : null
|
|
1582
1582
|
};
|
|
1583
|
-
}),
|
|
1583
|
+
}), u = computed(
|
|
1584
1584
|
() => calculateNextScheduleAt(
|
|
1585
|
-
|
|
1585
|
+
s.modelValue,
|
|
1586
1586
|
/* @__PURE__ */ new Date(),
|
|
1587
|
-
|
|
1588
|
-
|
|
1587
|
+
s.startDate ? new Date(s.startDate) : void 0,
|
|
1588
|
+
s.endDate ? new Date(s.endDate) : void 0
|
|
1589
1589
|
)
|
|
1590
1590
|
);
|
|
1591
|
-
function k(
|
|
1592
|
-
const
|
|
1591
|
+
function k(h) {
|
|
1592
|
+
const d = h.value, p = d == "fixed" ? [
|
|
1593
1593
|
RuleBuilder.constructEntry(
|
|
1594
1594
|
"trigger.date",
|
|
1595
1595
|
"_isOnDate",
|
|
@@ -1608,23 +1608,23 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1608
1608
|
"update:model-value",
|
|
1609
1609
|
RuleBuilder.setRuleToGroup(
|
|
1610
1610
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
1611
|
-
|
|
1611
|
+
p
|
|
1612
1612
|
)
|
|
1613
|
-
),
|
|
1613
|
+
), m.value = d;
|
|
1614
1614
|
}
|
|
1615
|
-
function b(
|
|
1616
|
-
|
|
1615
|
+
function b(h) {
|
|
1616
|
+
m.value == "fixed" ? r(
|
|
1617
1617
|
"update:model-value",
|
|
1618
1618
|
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
1619
1619
|
RuleBuilder.constructEntry(
|
|
1620
1620
|
"trigger.date",
|
|
1621
1621
|
"_isOnDate",
|
|
1622
|
-
|
|
1622
|
+
h.date
|
|
1623
1623
|
),
|
|
1624
1624
|
RuleBuilder.constructEntry(
|
|
1625
1625
|
"trigger.time",
|
|
1626
1626
|
"_isOnTime",
|
|
1627
|
-
|
|
1627
|
+
h.time
|
|
1628
1628
|
)
|
|
1629
1629
|
])
|
|
1630
1630
|
) : r(
|
|
@@ -1633,41 +1633,41 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1633
1633
|
RuleBuilder.constructEntry(
|
|
1634
1634
|
"trigger.date",
|
|
1635
1635
|
"_rrule",
|
|
1636
|
-
|
|
1636
|
+
h.date
|
|
1637
1637
|
),
|
|
1638
1638
|
RuleBuilder.constructEntry(
|
|
1639
1639
|
"trigger.time",
|
|
1640
1640
|
"_isOnTime",
|
|
1641
|
-
|
|
1641
|
+
h.time
|
|
1642
1642
|
)
|
|
1643
1643
|
])
|
|
1644
1644
|
);
|
|
1645
1645
|
}
|
|
1646
|
-
return (
|
|
1647
|
-
const
|
|
1646
|
+
return (h, d) => {
|
|
1647
|
+
const p = resolveComponent("FmButtonGroup"), v = resolveComponent("FmTimePicker"), C = resolveComponent("FmIcon"), V = resolveComponent("FmTooltip"), B = resolveComponent("FmField"), S = resolveComponent("FmCard"), $ = resolveComponent("FmPopover"), w = resolveComponent("FmDatePicker"), R = resolveComponent("FmHelperText");
|
|
1648
1648
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
1649
|
-
createVNode(
|
|
1650
|
-
items: unref(
|
|
1651
|
-
"model-value": unref(
|
|
1649
|
+
createVNode(p, {
|
|
1650
|
+
items: unref(f),
|
|
1651
|
+
"model-value": unref(f).find((T) => T.value === unref(m)) ?? null,
|
|
1652
1652
|
"onUpdate:modelValue": k,
|
|
1653
1653
|
class: "mb-8"
|
|
1654
1654
|
}, null, 8, ["items", "model-value"]),
|
|
1655
|
-
createElementVNode("div", _hoisted_1$
|
|
1656
|
-
createElementVNode("div", _hoisted_2$
|
|
1657
|
-
createVNode(
|
|
1655
|
+
createElementVNode("div", _hoisted_1$e, [
|
|
1656
|
+
createElementVNode("div", _hoisted_2$b, [
|
|
1657
|
+
createVNode(v, {
|
|
1658
1658
|
label: unref(o)("connect.template.rule.schedule.notify_time"),
|
|
1659
|
-
"model-value": unref(
|
|
1660
|
-
"onUpdate:modelValue":
|
|
1661
|
-
"helper-text": unref(
|
|
1662
|
-
"helper-state": unref(
|
|
1659
|
+
"model-value": unref(c).time,
|
|
1660
|
+
"onUpdate:modelValue": d[0] || (d[0] = (T) => b({ date: unref(c).date, time: T })),
|
|
1661
|
+
"helper-text": unref(c).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
|
|
1662
|
+
"helper-state": unref(c).time ? void 0 : "error"
|
|
1663
1663
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
|
|
1664
|
-
unref(
|
|
1665
|
-
createElementVNode("div", _hoisted_4$
|
|
1664
|
+
unref(m) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
|
|
1665
|
+
createElementVNode("div", _hoisted_4$9, [
|
|
1666
1666
|
createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
|
|
1667
|
-
unref(
|
|
1667
|
+
unref(c).date ? (openBlock(), createBlock(V, {
|
|
1668
1668
|
key: 0,
|
|
1669
1669
|
"z-index": 9999,
|
|
1670
|
-
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(
|
|
1670
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options)
|
|
1671
1671
|
}, {
|
|
1672
1672
|
default: withCtx(() => [
|
|
1673
1673
|
createVNode(C, {
|
|
@@ -1679,18 +1679,18 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1679
1679
|
_: 1
|
|
1680
1680
|
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
1681
1681
|
]),
|
|
1682
|
-
createVNode(
|
|
1683
|
-
"show-popover": unref(
|
|
1684
|
-
onPopoverChanged:
|
|
1682
|
+
createVNode($, {
|
|
1683
|
+
"show-popover": unref(i),
|
|
1684
|
+
onPopoverChanged: d[3] || (d[3] = (T) => i.value = T)
|
|
1685
1685
|
}, {
|
|
1686
1686
|
"popover-button": withCtx(() => [
|
|
1687
1687
|
createVNode(B, {
|
|
1688
1688
|
class: "cursor-pointer",
|
|
1689
|
-
"helper-text": unref(
|
|
1690
|
-
"helper-state": unref(
|
|
1689
|
+
"helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
1690
|
+
"helper-state": unref(c).date ? void 0 : "error"
|
|
1691
1691
|
}, {
|
|
1692
1692
|
default: withCtx(() => [
|
|
1693
|
-
createElementVNode("div", _hoisted_5$
|
|
1693
|
+
createElementVNode("div", _hoisted_5$7, toDisplayString(unref(c).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(c).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
|
|
1694
1694
|
]),
|
|
1695
1695
|
_: 1
|
|
1696
1696
|
}, 8, ["helper-text", "helper-state"])
|
|
@@ -1698,11 +1698,11 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1698
1698
|
default: withCtx(() => [
|
|
1699
1699
|
createVNode(S, { class: "elevated p-8 w-[450px]" }, {
|
|
1700
1700
|
default: withCtx(() => [
|
|
1701
|
-
createVNode(_sfc_main$
|
|
1701
|
+
createVNode(_sfc_main$u, {
|
|
1702
1702
|
"apply-button": !0,
|
|
1703
|
-
"model-value": unref(
|
|
1704
|
-
onCancel:
|
|
1705
|
-
"onUpdate:modelValue":
|
|
1703
|
+
"model-value": unref(c).date || "",
|
|
1704
|
+
onCancel: d[1] || (d[1] = (T) => i.value = !1),
|
|
1705
|
+
"onUpdate:modelValue": d[2] || (d[2] = (T) => (b({ date: T, time: unref(c).time }), i.value = !1))
|
|
1706
1706
|
}, null, 8, ["model-value"])
|
|
1707
1707
|
]),
|
|
1708
1708
|
_: 1
|
|
@@ -1710,25 +1710,25 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1710
1710
|
]),
|
|
1711
1711
|
_: 1
|
|
1712
1712
|
}, 8, ["show-popover"])
|
|
1713
|
-
])) : (openBlock(), createBlock(
|
|
1713
|
+
])) : (openBlock(), createBlock(w, {
|
|
1714
1714
|
key: 1,
|
|
1715
1715
|
label: unref(o)("connect.template.rule.schedule.notify_date"),
|
|
1716
|
-
"model-value": unref(
|
|
1717
|
-
"onUpdate:modelValue":
|
|
1718
|
-
"helper-text": unref(
|
|
1719
|
-
"helper-state": unref(
|
|
1716
|
+
"model-value": unref(c).date || "",
|
|
1717
|
+
"onUpdate:modelValue": d[4] || (d[4] = (T) => b({ date: T, time: unref(c).time })),
|
|
1718
|
+
"helper-text": unref(c).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
|
|
1719
|
+
"helper-state": unref(c).date ? void 0 : "error"
|
|
1720
1720
|
}, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
|
|
1721
1721
|
]),
|
|
1722
|
-
unref(
|
|
1722
|
+
unref(c).date && unref(c).time && unref(u) ? (openBlock(), createBlock(R, {
|
|
1723
1723
|
key: 0,
|
|
1724
|
-
text: `${unref(moment)(unref(
|
|
1725
|
-
${unref(moment)(unref(
|
|
1724
|
+
text: `${unref(moment)(unref(u)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(u)).format("dddd, DD MMM YYYY")} at
|
|
1725
|
+
${unref(moment)(unref(u)).format("hh:mmA")}(UTC${unref(moment).tz(unref(a)).format("Z")}) (${unref(moment)(unref(u)).fromNow()})`
|
|
1726
1726
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
1727
1727
|
])
|
|
1728
1728
|
], 64);
|
|
1729
1729
|
};
|
|
1730
1730
|
}
|
|
1731
|
-
}), _hoisted_1$
|
|
1731
|
+
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$8 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
1732
1732
|
__name: "GameTypeInput",
|
|
1733
1733
|
props: {
|
|
1734
1734
|
modelValue: {
|
|
@@ -1737,7 +1737,7 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1737
1737
|
},
|
|
1738
1738
|
emits: ["update:model-value"],
|
|
1739
1739
|
setup(e, { emit: l }) {
|
|
1740
|
-
const { t: o } = useI18n(),
|
|
1740
|
+
const { t: o } = useI18n(), s = e, r = l, y = computed(
|
|
1741
1741
|
() => [
|
|
1742
1742
|
{
|
|
1743
1743
|
label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
|
|
@@ -1754,25 +1754,25 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1754
1754
|
].filter((a) => !a.hidden)
|
|
1755
1755
|
);
|
|
1756
1756
|
return (a, n) => {
|
|
1757
|
-
const
|
|
1758
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1759
|
-
createElementVNode("div", _hoisted_2$
|
|
1760
|
-
createElementVNode("div", _hoisted_3$
|
|
1761
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (
|
|
1757
|
+
const m = resolveComponent("FmCard");
|
|
1758
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
1759
|
+
createElementVNode("div", _hoisted_2$a, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
1760
|
+
createElementVNode("div", _hoisted_3$8, [
|
|
1761
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (i) => (openBlock(), createBlock(m, {
|
|
1762
1762
|
variant: "outlined",
|
|
1763
1763
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1764
1764
|
"col-span-2": unref(y).length == 1,
|
|
1765
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
1766
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
1765
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == i.value,
|
|
1766
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != i.value
|
|
1767
1767
|
}]),
|
|
1768
1768
|
onClick: () => {
|
|
1769
|
-
|
|
1769
|
+
s.modelValue != i.value && r("update:model-value", i.value);
|
|
1770
1770
|
},
|
|
1771
|
-
key:
|
|
1771
|
+
key: i.value
|
|
1772
1772
|
}, {
|
|
1773
1773
|
default: withCtx(() => [
|
|
1774
|
-
createElementVNode("div", _hoisted_4$
|
|
1775
|
-
createElementVNode("div", _hoisted_5$
|
|
1774
|
+
createElementVNode("div", _hoisted_4$8, toDisplayString(i.label), 1),
|
|
1775
|
+
createElementVNode("div", _hoisted_5$6, toDisplayString(i.description), 1)
|
|
1776
1776
|
]),
|
|
1777
1777
|
_: 2
|
|
1778
1778
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -1780,44 +1780,44 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1780
1780
|
]);
|
|
1781
1781
|
};
|
|
1782
1782
|
}
|
|
1783
|
-
}), _hoisted_1$
|
|
1783
|
+
}), _hoisted_1$c = {
|
|
1784
1784
|
key: 0,
|
|
1785
1785
|
class: "flex flex-col gap-y-24"
|
|
1786
|
-
}, _hoisted_2$
|
|
1786
|
+
}, _hoisted_2$9 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
1787
1787
|
__name: "EditRewardPoolSheet",
|
|
1788
1788
|
emits: ["update:model-value"],
|
|
1789
1789
|
setup(e, { expose: l, emit: o }) {
|
|
1790
|
-
const
|
|
1790
|
+
const s = useMembershipStore(), { minor: r } = useLoading, y = ref(!1), a = ref(), n = ref(), m = ref(0), i = computed(
|
|
1791
1791
|
() => {
|
|
1792
|
-
var
|
|
1793
|
-
return (
|
|
1794
|
-
(
|
|
1795
|
-
var
|
|
1796
|
-
return
|
|
1792
|
+
var d;
|
|
1793
|
+
return (d = s.loyaltyRewards.items.find(
|
|
1794
|
+
(p) => {
|
|
1795
|
+
var v;
|
|
1796
|
+
return p.value === ((v = a.value) == null ? void 0 : v.collectible);
|
|
1797
1797
|
}
|
|
1798
|
-
)) == null ? void 0 :
|
|
1798
|
+
)) == null ? void 0 : d.raw.type;
|
|
1799
1799
|
}
|
|
1800
|
-
),
|
|
1800
|
+
), f = computed(
|
|
1801
1801
|
() => {
|
|
1802
|
-
var
|
|
1803
|
-
return ((
|
|
1802
|
+
var d;
|
|
1803
|
+
return ((d = a.value) == null ? void 0 : d.type) === "LOYALTY" && (i.value === "CREDIT" || i.value === "TITLE");
|
|
1804
1804
|
}
|
|
1805
|
-
),
|
|
1806
|
-
() =>
|
|
1807
|
-
),
|
|
1808
|
-
const
|
|
1809
|
-
return
|
|
1805
|
+
), c = computed(
|
|
1806
|
+
() => f.value ? FdoCreditLoyaltyReward : FdtoRandomReward
|
|
1807
|
+
), u = computed(() => {
|
|
1808
|
+
const d = c.value.safeParse(a.value);
|
|
1809
|
+
return d.success ? [] : d.error.errors;
|
|
1810
1810
|
});
|
|
1811
|
-
function k(
|
|
1812
|
-
|
|
1811
|
+
function k(d, p, v) {
|
|
1812
|
+
d && (a.value = p, m.value = v), y.value = d;
|
|
1813
1813
|
}
|
|
1814
1814
|
const b = o;
|
|
1815
|
-
async function
|
|
1816
|
-
const
|
|
1817
|
-
|
|
1815
|
+
async function h() {
|
|
1816
|
+
const d = c.value.safeParse(a.value);
|
|
1817
|
+
d.success && (await r(
|
|
1818
1818
|
async () => {
|
|
1819
|
-
|
|
1820
|
-
|
|
1819
|
+
d.data.type === "VOUCHER" && n.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1820
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
|
|
1821
1821
|
n.value
|
|
1822
1822
|
));
|
|
1823
1823
|
},
|
|
@@ -1825,44 +1825,44 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1825
1825
|
message: "Uploading reward image",
|
|
1826
1826
|
successMessage: "Reward image updated"
|
|
1827
1827
|
}
|
|
1828
|
-
), b("update:model-value",
|
|
1828
|
+
), b("update:model-value", d.data, m.value));
|
|
1829
1829
|
}
|
|
1830
1830
|
return l({
|
|
1831
1831
|
showSheet: k
|
|
1832
|
-
}), (
|
|
1833
|
-
const
|
|
1832
|
+
}), (d, p) => {
|
|
1833
|
+
const v = resolveComponent("FmSelect"), C = resolveComponent("FmStepperField"), V = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
|
|
1834
1834
|
return openBlock(), createBlock(B, {
|
|
1835
1835
|
"max-width": 560,
|
|
1836
1836
|
modelValue: unref(y),
|
|
1837
1837
|
"onUpdate:modelValue": [
|
|
1838
|
-
|
|
1839
|
-
|
|
1838
|
+
p[9] || (p[9] = (S) => isRef(y) ? y.value = S : null),
|
|
1839
|
+
p[10] || (p[10] = (S) => y.value = S)
|
|
1840
1840
|
],
|
|
1841
1841
|
header: "Edit reward",
|
|
1842
1842
|
"dismiss-away": ""
|
|
1843
1843
|
}, {
|
|
1844
1844
|
"side-sheet-footer": withCtx(() => [
|
|
1845
|
-
createElementVNode("div", _hoisted_2$
|
|
1845
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
1846
1846
|
createVNode(V, {
|
|
1847
1847
|
variant: "primary",
|
|
1848
1848
|
type: "button",
|
|
1849
|
-
disabled: unref(
|
|
1849
|
+
disabled: unref(u).length > 0,
|
|
1850
1850
|
label: "Confirm",
|
|
1851
|
-
onClick:
|
|
1851
|
+
onClick: p[7] || (p[7] = (S) => h())
|
|
1852
1852
|
}, null, 8, ["disabled"]),
|
|
1853
1853
|
createVNode(V, {
|
|
1854
1854
|
variant: "secondary",
|
|
1855
1855
|
type: "button",
|
|
1856
1856
|
label: "Cancel",
|
|
1857
|
-
onClick:
|
|
1857
|
+
onClick: p[8] || (p[8] = (S) => y.value = !1)
|
|
1858
1858
|
})
|
|
1859
1859
|
])
|
|
1860
1860
|
]),
|
|
1861
1861
|
default: withCtx(() => {
|
|
1862
1862
|
var S;
|
|
1863
1863
|
return [
|
|
1864
|
-
unref(a) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
1865
|
-
createVNode(
|
|
1864
|
+
unref(a) ? (openBlock(), createElementBlock("div", _hoisted_1$c, [
|
|
1865
|
+
createVNode(v, {
|
|
1866
1866
|
label: "Reward Type",
|
|
1867
1867
|
items: [
|
|
1868
1868
|
{ label: "No Reward", value: "NO_REWARD" },
|
|
@@ -1870,12 +1870,12 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1870
1870
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
1871
1871
|
],
|
|
1872
1872
|
"model-value": unref(a).type,
|
|
1873
|
-
"onUpdate:modelValue":
|
|
1874
|
-
|
|
1873
|
+
"onUpdate:modelValue": p[0] || (p[0] = ($) => {
|
|
1874
|
+
$ == "NO_REWARD" ? a.value = {
|
|
1875
1875
|
type: "NO_REWARD",
|
|
1876
1876
|
collectible: null,
|
|
1877
1877
|
weight: 1
|
|
1878
|
-
} :
|
|
1878
|
+
} : $ === "VOUCHER" ? a.value = {
|
|
1879
1879
|
collectible: null,
|
|
1880
1880
|
type: "VOUCHER",
|
|
1881
1881
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -1890,7 +1890,7 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1890
1890
|
},
|
|
1891
1891
|
weight: 1
|
|
1892
1892
|
} : a.value = {
|
|
1893
|
-
collectible: unref(
|
|
1893
|
+
collectible: unref(s).loyaltyRewards.raw[0]._id,
|
|
1894
1894
|
type: "LOYALTY",
|
|
1895
1895
|
earningOption: {
|
|
1896
1896
|
amount: 1,
|
|
@@ -1903,65 +1903,65 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1903
1903
|
};
|
|
1904
1904
|
})
|
|
1905
1905
|
}, null, 8, ["model-value"]),
|
|
1906
|
-
unref(a).type == "LOYALTY" ? (openBlock(), createBlock(
|
|
1906
|
+
unref(a).type == "LOYALTY" ? (openBlock(), createBlock(v, {
|
|
1907
1907
|
key: 0,
|
|
1908
1908
|
label: "Loyalty type",
|
|
1909
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1910
|
-
items: unref(
|
|
1909
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(a).type])],
|
|
1910
|
+
items: unref(s).loyaltyRewards.items,
|
|
1911
1911
|
"model-value": unref(a).collectible,
|
|
1912
|
-
"onUpdate:modelValue":
|
|
1912
|
+
"onUpdate:modelValue": p[1] || (p[1] = ($) => unref(a).collectible = $)
|
|
1913
1913
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1914
1914
|
createVNode(C, {
|
|
1915
1915
|
label: "Weight",
|
|
1916
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1916
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(a).type])],
|
|
1917
1917
|
"model-value": unref(a).weight,
|
|
1918
|
-
"onUpdate:modelValue":
|
|
1918
|
+
"onUpdate:modelValue": p[2] || (p[2] = ($) => a.value = {
|
|
1919
1919
|
...unref(a),
|
|
1920
|
-
weight:
|
|
1920
|
+
weight: $
|
|
1921
1921
|
})
|
|
1922
1922
|
}, null, 8, ["rules", "model-value"]),
|
|
1923
1923
|
unref(a).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1924
|
-
unref(
|
|
1925
|
-
|
|
1926
|
-
createVNode(_sfc_main$
|
|
1924
|
+
unref(i) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1925
|
+
p[11] || (p[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
1926
|
+
createVNode(_sfc_main$v, {
|
|
1927
1927
|
class: "mt-[-8px]",
|
|
1928
1928
|
rules: [
|
|
1929
|
-
unref(ZodHelper).ruleAtPath(unref(
|
|
1929
|
+
unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(a).type])
|
|
1930
1930
|
],
|
|
1931
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
1932
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
1931
|
+
"helper-state": unref(ZodHelper).helperState(unref(u), "earningOption"),
|
|
1932
|
+
"error-text": unref(ZodHelper).helperText(unref(u), "earningOption"),
|
|
1933
1933
|
"fixed-type": !0,
|
|
1934
1934
|
"model-value": unref(a).earningOption,
|
|
1935
|
-
"onUpdate:modelValue":
|
|
1935
|
+
"onUpdate:modelValue": p[3] || (p[3] = ($) => a.value = {
|
|
1936
1936
|
...unref(a),
|
|
1937
|
-
earningOption:
|
|
1937
|
+
earningOption: $
|
|
1938
1938
|
})
|
|
1939
1939
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1940
1940
|
], 64)) : createCommentVNode("", !0),
|
|
1941
|
-
|
|
1942
|
-
createVNode(_sfc_main$
|
|
1941
|
+
p[12] || (p[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
|
|
1942
|
+
createVNode(_sfc_main$w, {
|
|
1943
1943
|
type: unref(a).type === "LOYALTY" ? "custom" : "range",
|
|
1944
|
-
"for-credit": unref(
|
|
1944
|
+
"for-credit": unref(f),
|
|
1945
1945
|
class: "!gap-24",
|
|
1946
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
1946
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(a).type])],
|
|
1947
1947
|
"model-value": unref(a).validityOption,
|
|
1948
|
-
"onUpdate:modelValue":
|
|
1948
|
+
"onUpdate:modelValue": p[4] || (p[4] = ($) => a.value = {
|
|
1949
1949
|
...unref(a),
|
|
1950
|
-
validityOption:
|
|
1950
|
+
validityOption: $
|
|
1951
1951
|
})
|
|
1952
1952
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
1953
1953
|
], 64)) : createCommentVNode("", !0),
|
|
1954
|
-
unref(a).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$
|
|
1954
|
+
unref(a).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
1955
1955
|
key: 2,
|
|
1956
1956
|
"reward-image": unref(n),
|
|
1957
1957
|
"model-value": ((S = unref(a)) == null ? void 0 : S.collectibleConfig) ?? void 0,
|
|
1958
|
-
"onUpdate:modelValue":
|
|
1958
|
+
"onUpdate:modelValue": p[5] || (p[5] = ($) => a.value = {
|
|
1959
1959
|
...unref(a),
|
|
1960
|
-
collectibleConfig:
|
|
1960
|
+
collectibleConfig: $
|
|
1961
1961
|
}),
|
|
1962
|
-
"onUpdate:rewardImage":
|
|
1962
|
+
"onUpdate:rewardImage": p[6] || (p[6] = ($) => n.value = $)
|
|
1963
1963
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1964
|
-
createVNode(JsonViewer, { json: unref(
|
|
1964
|
+
createVNode(JsonViewer, { json: unref(u) }, null, 8, ["json"])
|
|
1965
1965
|
])) : createCommentVNode("", !0)
|
|
1966
1966
|
];
|
|
1967
1967
|
}),
|
|
@@ -1973,7 +1973,7 @@ const _hoisted_1$e = { class: "flex flex-col gap-[28px]" }, _hoisted_2$b = { cla
|
|
|
1973
1973
|
function isNullOrEmpty(e) {
|
|
1974
1974
|
return e == null || e === "";
|
|
1975
1975
|
}
|
|
1976
|
-
const _hoisted_1$
|
|
1976
|
+
const _hoisted_1$b = { class: "space-y-16" }, _hoisted_2$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$7 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1977
1977
|
__name: "RewardPoolInput",
|
|
1978
1978
|
props: {
|
|
1979
1979
|
modelValue: {
|
|
@@ -1989,36 +1989,36 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
1989
1989
|
},
|
|
1990
1990
|
emits: ["update:model-value"],
|
|
1991
1991
|
setup(e, { emit: l }) {
|
|
1992
|
-
const o = e,
|
|
1993
|
-
const
|
|
1994
|
-
return
|
|
1995
|
-
}),
|
|
1996
|
-
function
|
|
1997
|
-
var
|
|
1998
|
-
const
|
|
1999
|
-
d
|
|
1992
|
+
const o = e, s = l, r = useMembershipStore(), { t: y } = useI18n(), a = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), n = computed(() => o.modelValue ?? []), m = computed(() => {
|
|
1993
|
+
const h = a.safeParse(n.value);
|
|
1994
|
+
return h.success ? [] : h.error.errors;
|
|
1995
|
+
}), i = ref();
|
|
1996
|
+
function f(h, d) {
|
|
1997
|
+
var v;
|
|
1998
|
+
const p = [...n.value];
|
|
1999
|
+
p[d] = h, (v = i.value) == null || v.showSheet(!1), s("update:model-value", p);
|
|
2000
2000
|
}
|
|
2001
|
-
function
|
|
2002
|
-
const
|
|
2003
|
-
(C) => C._id.toString() ==
|
|
2004
|
-
),
|
|
2001
|
+
function c(h) {
|
|
2002
|
+
const d = h.type == "VOUCHER" ? h.collectibleConfig : r.collectibles.find(
|
|
2003
|
+
(C) => C._id.toString() == h.collectible
|
|
2004
|
+
), p = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), v = h.weight;
|
|
2005
2005
|
return {
|
|
2006
|
-
label: isNullOrEmpty(
|
|
2007
|
-
sublabel: `${
|
|
2006
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
2007
|
+
sublabel: `${v} (${(v / n.value.reduce((C, V) => C + V.weight, 0) * 100).toFixed(2)}%)`
|
|
2008
2008
|
};
|
|
2009
2009
|
}
|
|
2010
|
-
function
|
|
2011
|
-
var
|
|
2012
|
-
const
|
|
2013
|
-
(
|
|
2010
|
+
function u(h) {
|
|
2011
|
+
var p;
|
|
2012
|
+
const d = [...n.value];
|
|
2013
|
+
(p = i.value) == null || p.showSheet(!0, d[h], h);
|
|
2014
2014
|
}
|
|
2015
|
-
function k(
|
|
2016
|
-
const
|
|
2017
|
-
|
|
2015
|
+
function k(h) {
|
|
2016
|
+
const d = [...n.value];
|
|
2017
|
+
d.splice(h, 1), s("update:model-value", d);
|
|
2018
2018
|
}
|
|
2019
2019
|
function b() {
|
|
2020
|
-
var
|
|
2021
|
-
(
|
|
2020
|
+
var h;
|
|
2021
|
+
(h = i.value) == null || h.showSheet(
|
|
2022
2022
|
!0,
|
|
2023
2023
|
{
|
|
2024
2024
|
type: "NO_REWARD",
|
|
@@ -2028,55 +2028,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2028
2028
|
n.value.length
|
|
2029
2029
|
);
|
|
2030
2030
|
}
|
|
2031
|
-
return (
|
|
2032
|
-
const
|
|
2033
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2034
|
-
createElementVNode("div", _hoisted_2$
|
|
2035
|
-
createVNode(
|
|
2031
|
+
return (h, d) => {
|
|
2032
|
+
const p = resolveComponent("FmButton"), v = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
|
|
2033
|
+
return openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
2034
|
+
createElementVNode("div", _hoisted_2$8, toDisplayString(unref(y)("connect.template.configure_reward_type")), 1),
|
|
2035
|
+
createVNode(p, {
|
|
2036
2036
|
label: unref(y)("connect.campaign.rewardPool.addReward"),
|
|
2037
|
-
onClick:
|
|
2037
|
+
onClick: d[0] || (d[0] = (V) => b()),
|
|
2038
2038
|
variant: "plain",
|
|
2039
2039
|
icon: "add"
|
|
2040
2040
|
}, null, 8, ["label"]),
|
|
2041
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (V, B) => (openBlock(), createBlock(
|
|
2041
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (V, B) => (openBlock(), createBlock(v, {
|
|
2042
2042
|
key: B,
|
|
2043
2043
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2044
2044
|
variant: "outlined",
|
|
2045
|
-
onClick: (S) =>
|
|
2045
|
+
onClick: (S) => u(B)
|
|
2046
2046
|
}, {
|
|
2047
2047
|
default: withCtx(() => {
|
|
2048
2048
|
var S;
|
|
2049
2049
|
return [
|
|
2050
2050
|
createElementVNode("div", null, [
|
|
2051
|
-
createElementVNode("div", _hoisted_3$
|
|
2052
|
-
createElementVNode("div", _hoisted_4$
|
|
2051
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(V.type == "LOYALTY" ? (S = V == null ? void 0 : V.earningOption) == null ? void 0 : S.amount : "") + " " + toDisplayString(c(V).label), 1),
|
|
2052
|
+
createElementVNode("div", _hoisted_4$7, toDisplayString(c(V).sublabel), 1)
|
|
2053
2053
|
]),
|
|
2054
|
-
createVNode(
|
|
2054
|
+
createVNode(p, {
|
|
2055
2055
|
icon: "delete",
|
|
2056
2056
|
variant: "tertiary",
|
|
2057
|
-
onClick: (
|
|
2057
|
+
onClick: ($) => ($.stopPropagation(), k(B))
|
|
2058
2058
|
}, null, 8, ["onClick"])
|
|
2059
2059
|
];
|
|
2060
2060
|
}),
|
|
2061
2061
|
_: 2
|
|
2062
2062
|
}, 1032, ["onClick"]))), 128)),
|
|
2063
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2063
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(m).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(C, {
|
|
2064
2064
|
key: V.message,
|
|
2065
2065
|
text: V.message,
|
|
2066
2066
|
state: "error"
|
|
2067
2067
|
}, null, 8, ["text"]))), 128)),
|
|
2068
|
-
createVNode(_sfc_main$
|
|
2068
|
+
createVNode(_sfc_main$c, {
|
|
2069
2069
|
ref_key: "sheetRef",
|
|
2070
|
-
ref:
|
|
2071
|
-
"onUpdate:modelValue":
|
|
2070
|
+
ref: i,
|
|
2071
|
+
"onUpdate:modelValue": f
|
|
2072
2072
|
}, null, 512)
|
|
2073
2073
|
]);
|
|
2074
2074
|
};
|
|
2075
2075
|
}
|
|
2076
|
-
}), _hoisted_1$
|
|
2076
|
+
}), _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = {
|
|
2077
2077
|
key: 0,
|
|
2078
2078
|
class: "grid grid-cols-2 gap-16"
|
|
2079
|
-
}, _hoisted_3$
|
|
2079
|
+
}, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2080
2080
|
__name: "PromotionGameTypeInput",
|
|
2081
2081
|
props: {
|
|
2082
2082
|
modelValue: {
|
|
@@ -2085,7 +2085,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2085
2085
|
},
|
|
2086
2086
|
emits: ["update:model-value"],
|
|
2087
2087
|
setup(e, { emit: l }) {
|
|
2088
|
-
const { t: o } = useI18n(),
|
|
2088
|
+
const { t: o } = useI18n(), s = e, r = l, y = computed(() => [
|
|
2089
2089
|
{
|
|
2090
2090
|
label: o("connect.template.promotion_game.rock_paper_scissors.label"),
|
|
2091
2091
|
description: o("connect.template.promotion_game.rock_paper_scissors.description"),
|
|
@@ -2093,39 +2093,39 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2093
2093
|
}
|
|
2094
2094
|
]);
|
|
2095
2095
|
return (a, n) => {
|
|
2096
|
-
var
|
|
2097
|
-
const
|
|
2098
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2099
|
-
createVNode(
|
|
2096
|
+
var c, u, k;
|
|
2097
|
+
const m = resolveComponent("FmSwitch"), i = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
|
|
2098
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
2099
|
+
createVNode(m, {
|
|
2100
2100
|
label: unref(o)("connect.template.promotion_game.enable"),
|
|
2101
|
-
"model-value": !!((
|
|
2101
|
+
"model-value": !!((c = e.modelValue) != null && c.gameType),
|
|
2102
2102
|
"onUpdate:modelValue": n[0] || (n[0] = (b) => b ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
2103
2103
|
}, null, 8, ["label", "model-value"]),
|
|
2104
|
-
((
|
|
2104
|
+
((u = e.modelValue) == null ? void 0 : u.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$7, [
|
|
2105
2105
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (b) => {
|
|
2106
|
-
var
|
|
2107
|
-
return openBlock(), createBlock(
|
|
2106
|
+
var h, d;
|
|
2107
|
+
return openBlock(), createBlock(i, {
|
|
2108
2108
|
variant: "outlined",
|
|
2109
2109
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2110
2110
|
"col-span-2": unref(y).length == 1,
|
|
2111
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((
|
|
2112
|
-
"hover:bg-fm-color-opacity-sm": ((
|
|
2111
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.gameType) == b.value,
|
|
2112
|
+
"hover:bg-fm-color-opacity-sm": ((d = e.modelValue) == null ? void 0 : d.gameType) != b.value
|
|
2113
2113
|
}]),
|
|
2114
2114
|
onClick: () => {
|
|
2115
|
-
var
|
|
2116
|
-
((
|
|
2115
|
+
var p;
|
|
2116
|
+
((p = s.modelValue) == null ? void 0 : p.gameType) != b.value && r("update:model-value", { gameType: b.value });
|
|
2117
2117
|
},
|
|
2118
2118
|
key: b.value
|
|
2119
2119
|
}, {
|
|
2120
2120
|
default: withCtx(() => [
|
|
2121
|
-
createElementVNode("div", _hoisted_3$
|
|
2122
|
-
createElementVNode("div", _hoisted_4$
|
|
2121
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(b.label), 1),
|
|
2122
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(b.description), 1)
|
|
2123
2123
|
]),
|
|
2124
2124
|
_: 2
|
|
2125
2125
|
}, 1032, ["class", "onClick"]);
|
|
2126
2126
|
}), 128))
|
|
2127
2127
|
])) : createCommentVNode("", !0),
|
|
2128
|
-
((k = e.modelValue) == null ? void 0 : k.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(
|
|
2128
|
+
((k = e.modelValue) == null ? void 0 : k.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
|
|
2129
2129
|
key: 1,
|
|
2130
2130
|
text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
|
|
2131
2131
|
state: "warning"
|
|
@@ -2133,7 +2133,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2133
2133
|
]);
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
|
-
}), _hoisted_1$
|
|
2136
|
+
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$5 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2137
2137
|
__name: "MissionTypeInput",
|
|
2138
2138
|
props: {
|
|
2139
2139
|
modelValue: {
|
|
@@ -2142,7 +2142,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2142
2142
|
},
|
|
2143
2143
|
emits: ["update:model-value"],
|
|
2144
2144
|
setup(e, { emit: l }) {
|
|
2145
|
-
const { t: o } = useI18n(),
|
|
2145
|
+
const { t: o } = useI18n(), s = e, r = l, y = computed(() => [
|
|
2146
2146
|
{
|
|
2147
2147
|
label: o("connect.campaign.mission.typeOption.STAMP.label"),
|
|
2148
2148
|
description: o("connect.campaign.mission.typeOption.STAMP.description"),
|
|
@@ -2155,25 +2155,25 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2155
2155
|
}
|
|
2156
2156
|
]);
|
|
2157
2157
|
return (a, n) => {
|
|
2158
|
-
const
|
|
2159
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2160
|
-
createElementVNode("div", _hoisted_2$
|
|
2161
|
-
createElementVNode("div", _hoisted_3$
|
|
2162
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (
|
|
2158
|
+
const m = resolveComponent("FmCard");
|
|
2159
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
2160
|
+
createElementVNode("div", _hoisted_2$6, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2161
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
2162
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (i) => (openBlock(), createBlock(m, {
|
|
2163
2163
|
variant: "outlined",
|
|
2164
2164
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2165
2165
|
"col-span-2": unref(y).length == 1,
|
|
2166
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue ==
|
|
2167
|
-
"hover:bg-fm-color-opacity-sm": e.modelValue !=
|
|
2166
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == i.value,
|
|
2167
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != i.value
|
|
2168
2168
|
}]),
|
|
2169
2169
|
onClick: () => {
|
|
2170
|
-
|
|
2170
|
+
s.modelValue != i.value && r("update:model-value", i.value);
|
|
2171
2171
|
},
|
|
2172
|
-
key:
|
|
2172
|
+
key: i.value
|
|
2173
2173
|
}, {
|
|
2174
2174
|
default: withCtx(() => [
|
|
2175
|
-
createElementVNode("div", _hoisted_4$
|
|
2176
|
-
createElementVNode("div", _hoisted_5$
|
|
2175
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(i.label), 1),
|
|
2176
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(i.description), 1)
|
|
2177
2177
|
]),
|
|
2178
2178
|
_: 2
|
|
2179
2179
|
}, 1032, ["class", "onClick"]))), 128))
|
|
@@ -2181,7 +2181,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2181
2181
|
]);
|
|
2182
2182
|
};
|
|
2183
2183
|
}
|
|
2184
|
-
}), _hoisted_1$
|
|
2184
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2185
2185
|
__name: "MissionEndInput",
|
|
2186
2186
|
props: {
|
|
2187
2187
|
modelValue: {
|
|
@@ -2197,9 +2197,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2197
2197
|
emits: ["update:model-value"],
|
|
2198
2198
|
setup(e, { emit: l }) {
|
|
2199
2199
|
const o = l;
|
|
2200
|
-
return (
|
|
2200
|
+
return (s, r) => {
|
|
2201
2201
|
const y = resolveComponent("FmStepperField");
|
|
2202
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2202
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
2203
2203
|
r[1] || (r[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)),
|
|
2204
2204
|
createVNode(y, {
|
|
2205
2205
|
label: "Maximum to collect",
|
|
@@ -2211,7 +2211,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2211
2211
|
]);
|
|
2212
2212
|
};
|
|
2213
2213
|
}
|
|
2214
|
-
}), _hoisted_1$
|
|
2214
|
+
}), _hoisted_1$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
2215
2215
|
__name: "EditMissionPoolSheet",
|
|
2216
2216
|
props: {
|
|
2217
2217
|
maxThreshold: {
|
|
@@ -2221,72 +2221,72 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2221
2221
|
},
|
|
2222
2222
|
emits: ["update:model-value"],
|
|
2223
2223
|
setup(e, { expose: l, emit: o }) {
|
|
2224
|
-
const
|
|
2225
|
-
var
|
|
2226
|
-
const
|
|
2224
|
+
const s = e, r = useMembershipStore(), { minor: y } = useLoading, a = ref(!1), n = ref(), m = ref(), i = ref(0), f = computed(() => {
|
|
2225
|
+
var v, C;
|
|
2226
|
+
const p = (v = r.loyaltyRewards.items.find(
|
|
2227
2227
|
(V) => {
|
|
2228
2228
|
var B;
|
|
2229
2229
|
return V.value === ((B = n.value) == null ? void 0 : B.collectible);
|
|
2230
2230
|
}
|
|
2231
|
-
)) == null ? void 0 :
|
|
2232
|
-
return ((C = n.value) == null ? void 0 : C.type) === "LOYALTY" && (
|
|
2233
|
-
}),
|
|
2234
|
-
() =>
|
|
2235
|
-
),
|
|
2236
|
-
const
|
|
2237
|
-
return
|
|
2231
|
+
)) == null ? void 0 : v.raw.type;
|
|
2232
|
+
return ((C = n.value) == null ? void 0 : C.type) === "LOYALTY" && (p === "CREDIT" || p === "TITLE");
|
|
2233
|
+
}), c = computed(
|
|
2234
|
+
() => f.value ? FdoThresholdCreditReward : FdtoThresholdReward
|
|
2235
|
+
), u = computed(() => {
|
|
2236
|
+
const p = c.value.safeParse(n.value);
|
|
2237
|
+
return p.success ? [] : p.error.errors;
|
|
2238
2238
|
});
|
|
2239
|
-
function k(
|
|
2240
|
-
|
|
2239
|
+
function k(p, v, C) {
|
|
2240
|
+
p && (n.value = v, i.value = C), a.value = p;
|
|
2241
2241
|
}
|
|
2242
2242
|
const b = o;
|
|
2243
|
-
async function
|
|
2244
|
-
const
|
|
2245
|
-
|
|
2243
|
+
async function h() {
|
|
2244
|
+
const p = c.value.safeParse(n.value);
|
|
2245
|
+
p.success && (await y(
|
|
2246
2246
|
async () => {
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2247
|
+
p.data.type === "VOUCHER" && m.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
|
|
2248
|
+
p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, m.value),
|
|
2249
|
+
m.value
|
|
2250
2250
|
));
|
|
2251
2251
|
},
|
|
2252
2252
|
{
|
|
2253
2253
|
message: "Uploading reward image",
|
|
2254
2254
|
successMessage: "Reward image updated"
|
|
2255
2255
|
}
|
|
2256
|
-
), b("update:model-value",
|
|
2256
|
+
), b("update:model-value", p.data, i.value));
|
|
2257
2257
|
}
|
|
2258
|
-
const
|
|
2258
|
+
const d = ref();
|
|
2259
2259
|
return l({
|
|
2260
2260
|
showSheet: k
|
|
2261
|
-
}), (
|
|
2262
|
-
const C = resolveComponent("FmStepperField"), V = resolveComponent("FmSelect"), B = resolveComponent("FmForm"), S = resolveComponent("FmButton"),
|
|
2263
|
-
return openBlock(), createBlock(
|
|
2261
|
+
}), (p, v) => {
|
|
2262
|
+
const C = resolveComponent("FmStepperField"), V = resolveComponent("FmSelect"), B = resolveComponent("FmForm"), S = resolveComponent("FmButton"), $ = resolveComponent("FmSideSheet");
|
|
2263
|
+
return openBlock(), createBlock($, {
|
|
2264
2264
|
"max-width": 560,
|
|
2265
2265
|
modelValue: unref(a),
|
|
2266
2266
|
"onUpdate:modelValue": [
|
|
2267
|
-
|
|
2268
|
-
|
|
2267
|
+
v[10] || (v[10] = (w) => isRef(a) ? a.value = w : null),
|
|
2268
|
+
v[11] || (v[11] = (w) => a.value = w)
|
|
2269
2269
|
],
|
|
2270
2270
|
header: "Edit reward",
|
|
2271
2271
|
"dismiss-away": ""
|
|
2272
2272
|
}, {
|
|
2273
2273
|
"side-sheet-footer": withCtx(() => [
|
|
2274
|
-
createElementVNode("div", _hoisted_1$
|
|
2274
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
2275
2275
|
createVNode(S, {
|
|
2276
2276
|
variant: "primary",
|
|
2277
2277
|
type: "button",
|
|
2278
2278
|
label: "Confirm",
|
|
2279
|
-
disabled: unref(
|
|
2280
|
-
onClick:
|
|
2281
|
-
var
|
|
2282
|
-
return (
|
|
2279
|
+
disabled: unref(u).length > 0,
|
|
2280
|
+
onClick: v[8] || (v[8] = async () => {
|
|
2281
|
+
var w;
|
|
2282
|
+
return (w = unref(d)) == null ? void 0 : w.validateInputs();
|
|
2283
2283
|
})
|
|
2284
2284
|
}, null, 8, ["disabled"]),
|
|
2285
2285
|
createVNode(S, {
|
|
2286
2286
|
variant: "secondary",
|
|
2287
2287
|
type: "button",
|
|
2288
2288
|
label: "Cancel",
|
|
2289
|
-
onClick:
|
|
2289
|
+
onClick: v[9] || (v[9] = (w) => a.value = !1)
|
|
2290
2290
|
})
|
|
2291
2291
|
])
|
|
2292
2292
|
]),
|
|
@@ -2296,11 +2296,11 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2296
2296
|
key: 0,
|
|
2297
2297
|
class: "flex flex-col gap-y-24",
|
|
2298
2298
|
ref_key: "formRef",
|
|
2299
|
-
ref:
|
|
2300
|
-
onValidationSuccess:
|
|
2299
|
+
ref: d,
|
|
2300
|
+
onValidationSuccess: v[7] || (v[7] = (w) => h())
|
|
2301
2301
|
}, {
|
|
2302
2302
|
default: withCtx(() => {
|
|
2303
|
-
var
|
|
2303
|
+
var w;
|
|
2304
2304
|
return [
|
|
2305
2305
|
unref(n).type ? (openBlock(), createBlock(C, {
|
|
2306
2306
|
key: 0,
|
|
@@ -2308,15 +2308,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2308
2308
|
rules: [
|
|
2309
2309
|
unref(ZodHelper).toRule(
|
|
2310
2310
|
unref(z).number().min(1).max(
|
|
2311
|
-
|
|
2312
|
-
`Number cannot be more than ${
|
|
2311
|
+
s.maxThreshold,
|
|
2312
|
+
`Number cannot be more than ${s.maxThreshold}`
|
|
2313
2313
|
)
|
|
2314
2314
|
)
|
|
2315
2315
|
],
|
|
2316
2316
|
"model-value": unref(n).threshold,
|
|
2317
|
-
"onUpdate:modelValue":
|
|
2317
|
+
"onUpdate:modelValue": v[0] || (v[0] = (R) => n.value = {
|
|
2318
2318
|
...unref(n),
|
|
2319
|
-
threshold:
|
|
2319
|
+
threshold: R
|
|
2320
2320
|
})
|
|
2321
2321
|
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
2322
2322
|
createVNode(V, {
|
|
@@ -2326,9 +2326,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2326
2326
|
{ label: "Loyalty", value: "LOYALTY" }
|
|
2327
2327
|
],
|
|
2328
2328
|
"model-value": unref(n).type,
|
|
2329
|
-
"onUpdate:modelValue":
|
|
2329
|
+
"onUpdate:modelValue": v[1] || (v[1] = (R) => {
|
|
2330
2330
|
var T, O;
|
|
2331
|
-
|
|
2331
|
+
R === "VOUCHER" ? n.value = {
|
|
2332
2332
|
collectible: null,
|
|
2333
2333
|
type: "VOUCHER",
|
|
2334
2334
|
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
@@ -2359,48 +2359,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2359
2359
|
unref(n).type == "LOYALTY" ? (openBlock(), createBlock(V, {
|
|
2360
2360
|
key: 1,
|
|
2361
2361
|
label: "Loyalty type",
|
|
2362
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2362
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(n).type])],
|
|
2363
2363
|
items: unref(r).loyaltyRewards.items,
|
|
2364
2364
|
"model-value": unref(n).collectible,
|
|
2365
|
-
"onUpdate:modelValue":
|
|
2365
|
+
"onUpdate:modelValue": v[2] || (v[2] = (R) => unref(n).collectible = R)
|
|
2366
2366
|
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
2367
2367
|
unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
2368
|
-
|
|
2369
|
-
createVNode(_sfc_main$
|
|
2368
|
+
v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
|
|
2369
|
+
createVNode(_sfc_main$v, {
|
|
2370
2370
|
class: "mt-[-8px]",
|
|
2371
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2372
|
-
"helper-state": unref(ZodHelper).helperState(unref(
|
|
2373
|
-
"error-text": unref(ZodHelper).helperText(unref(
|
|
2371
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(n).type])],
|
|
2372
|
+
"helper-state": unref(ZodHelper).helperState(unref(u), "earningOption"),
|
|
2373
|
+
"error-text": unref(ZodHelper).helperText(unref(u), "earningOption"),
|
|
2374
2374
|
"fixed-type": !0,
|
|
2375
2375
|
"model-value": unref(n).earningOption,
|
|
2376
|
-
"onUpdate:modelValue":
|
|
2376
|
+
"onUpdate:modelValue": v[3] || (v[3] = (R) => n.value = {
|
|
2377
2377
|
...unref(n),
|
|
2378
|
-
earningOption:
|
|
2378
|
+
earningOption: R
|
|
2379
2379
|
})
|
|
2380
2380
|
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
2381
|
-
createVNode(_sfc_main$
|
|
2381
|
+
createVNode(_sfc_main$w, {
|
|
2382
2382
|
class: "!gap-24",
|
|
2383
2383
|
type: unref(n).type === "LOYALTY" ? "custom" : "range",
|
|
2384
|
-
"for-credit": unref(
|
|
2385
|
-
rules: [unref(ZodHelper).ruleAtPath(unref(
|
|
2384
|
+
"for-credit": unref(f),
|
|
2385
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(n).type])],
|
|
2386
2386
|
"model-value": unref(n).validityOption,
|
|
2387
|
-
"onUpdate:modelValue":
|
|
2387
|
+
"onUpdate:modelValue": v[4] || (v[4] = (R) => n.value = {
|
|
2388
2388
|
...unref(n),
|
|
2389
|
-
validityOption:
|
|
2389
|
+
validityOption: R
|
|
2390
2390
|
})
|
|
2391
2391
|
}, null, 8, ["type", "for-credit", "rules", "model-value"])
|
|
2392
2392
|
], 64)) : createCommentVNode("", !0),
|
|
2393
|
-
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$
|
|
2393
|
+
unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2394
2394
|
key: 3,
|
|
2395
|
-
"reward-image": unref(
|
|
2396
|
-
"model-value": ((
|
|
2397
|
-
"onUpdate:modelValue":
|
|
2395
|
+
"reward-image": unref(m),
|
|
2396
|
+
"model-value": ((w = unref(n)) == null ? void 0 : w.collectibleConfig) ?? void 0,
|
|
2397
|
+
"onUpdate:modelValue": v[5] || (v[5] = (R) => n.value = {
|
|
2398
2398
|
...unref(n),
|
|
2399
|
-
collectibleConfig:
|
|
2399
|
+
collectibleConfig: R
|
|
2400
2400
|
}),
|
|
2401
|
-
"onUpdate:rewardImage":
|
|
2401
|
+
"onUpdate:rewardImage": v[6] || (v[6] = (R) => m.value = R)
|
|
2402
2402
|
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
2403
|
-
createVNode(JsonViewer, { json: unref(
|
|
2403
|
+
createVNode(JsonViewer, { json: unref(u) }, null, 8, ["json"])
|
|
2404
2404
|
];
|
|
2405
2405
|
}),
|
|
2406
2406
|
_: 1
|
|
@@ -2410,10 +2410,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2410
2410
|
}, 8, ["modelValue"]);
|
|
2411
2411
|
};
|
|
2412
2412
|
}
|
|
2413
|
-
}), _hoisted_1$
|
|
2413
|
+
}), _hoisted_1$6 = {
|
|
2414
2414
|
key: 0,
|
|
2415
2415
|
class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
|
|
2416
|
-
}, _hoisted_2$
|
|
2416
|
+
}, _hoisted_2$5 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2417
2417
|
__name: "MissionProgress",
|
|
2418
2418
|
props: {
|
|
2419
2419
|
type: {
|
|
@@ -2434,19 +2434,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2434
2434
|
}
|
|
2435
2435
|
},
|
|
2436
2436
|
setup(e) {
|
|
2437
|
-
const l = e, { maxRange: o, currentRange:
|
|
2438
|
-
() => Math.min(
|
|
2437
|
+
const l = e, { maxRange: o, currentRange: s, markers: r } = toRefs(l), y = computed(
|
|
2438
|
+
() => Math.min(s.value / o.value * 100, 100)
|
|
2439
2439
|
), a = (n) => n / o.value * 100;
|
|
2440
|
-
return (n,
|
|
2441
|
-
const
|
|
2442
|
-
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
2443
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (
|
|
2440
|
+
return (n, m) => {
|
|
2441
|
+
const i = resolveComponent("FmIcon");
|
|
2442
|
+
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$6, [
|
|
2443
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (f) => (openBlock(), createBlock(i, {
|
|
2444
2444
|
class: normalizeClass(
|
|
2445
|
-
unref(
|
|
2445
|
+
unref(s) >= f ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
2446
2446
|
),
|
|
2447
|
-
outline: unref(
|
|
2448
|
-
key:
|
|
2449
|
-
name: unref(r).some((
|
|
2447
|
+
outline: unref(s) < f,
|
|
2448
|
+
key: f,
|
|
2449
|
+
name: unref(r).some((c) => c === f) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
2450
2450
|
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
2451
2451
|
])) : (openBlock(), createElementBlock("div", {
|
|
2452
2452
|
key: 1,
|
|
@@ -2456,16 +2456,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2456
2456
|
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
2457
2457
|
style: normalizeStyle({ width: unref(y) + "%" })
|
|
2458
2458
|
}, null, 4),
|
|
2459
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (
|
|
2460
|
-
key:
|
|
2459
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r), (f, c) => (openBlock(), createElementBlock("div", {
|
|
2460
|
+
key: c,
|
|
2461
2461
|
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
2462
|
-
style: normalizeStyle({ left: a(
|
|
2462
|
+
style: normalizeStyle({ left: a(f) + "%" })
|
|
2463
2463
|
}, [
|
|
2464
|
-
createElementVNode("div", _hoisted_2$
|
|
2464
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
2465
2465
|
createElementVNode("div", {
|
|
2466
2466
|
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
2467
2467
|
}),
|
|
2468
|
-
|
|
2468
|
+
m[0] || (m[0] = createElementVNode("div", null, "🎁", -1))
|
|
2469
2469
|
])
|
|
2470
2470
|
], 4))), 128))
|
|
2471
2471
|
]));
|
|
@@ -2473,19 +2473,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
|
|
|
2473
2473
|
}
|
|
2474
2474
|
}), isObject = (e) => e !== null && typeof e == "object";
|
|
2475
2475
|
function changeKeysFactory(e) {
|
|
2476
|
-
return function l(o,
|
|
2477
|
-
if (
|
|
2476
|
+
return function l(o, s = 1, r) {
|
|
2477
|
+
if (s === 0 || !isObject(o))
|
|
2478
2478
|
return o;
|
|
2479
2479
|
if (Array.isArray(o))
|
|
2480
|
-
return o.map((a) => l(a,
|
|
2480
|
+
return o.map((a) => l(a, s - 1, r));
|
|
2481
2481
|
const y = Object.create(Object.getPrototypeOf(o));
|
|
2482
2482
|
return Object.keys(o).forEach((a) => {
|
|
2483
|
-
const n = o[a],
|
|
2484
|
-
y[
|
|
2483
|
+
const n = o[a], m = e(a, r), i = l(n, s - 1, r);
|
|
2484
|
+
y[m] = i;
|
|
2485
2485
|
}), y;
|
|
2486
2486
|
};
|
|
2487
2487
|
}
|
|
2488
|
-
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$
|
|
2488
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$5 = { class: "space-y-16" }, _hoisted_2$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$4 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$4 = { class: "flex items-center gap-4" }, _hoisted_7$3 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$3 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
2489
2489
|
__name: "MissionPoolInput",
|
|
2490
2490
|
props: {
|
|
2491
2491
|
modelValue: {
|
|
@@ -2499,45 +2499,45 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2499
2499
|
},
|
|
2500
2500
|
emits: ["update:model-value"],
|
|
2501
2501
|
setup(e, { emit: l }) {
|
|
2502
|
-
const { t: o } = useI18n(),
|
|
2503
|
-
() =>
|
|
2504
|
-
),
|
|
2505
|
-
const
|
|
2506
|
-
return
|
|
2507
|
-
}),
|
|
2508
|
-
function
|
|
2502
|
+
const { t: o } = useI18n(), s = e, r = l, y = useMembershipStore(), a = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), n = computed(
|
|
2503
|
+
() => s.modelValue.sort((d, p) => d.threshold - p.threshold) ?? []
|
|
2504
|
+
), m = computed(() => {
|
|
2505
|
+
const d = a.safeParse(n.value);
|
|
2506
|
+
return d.success ? [] : d.error.errors;
|
|
2507
|
+
}), i = ref();
|
|
2508
|
+
function f(d, p) {
|
|
2509
2509
|
var C;
|
|
2510
|
-
const
|
|
2511
|
-
|
|
2512
|
-
}
|
|
2513
|
-
function
|
|
2514
|
-
const
|
|
2515
|
-
(V) => V._id.toString() ==
|
|
2516
|
-
),
|
|
2517
|
-
threshold:
|
|
2518
|
-
amount:
|
|
2510
|
+
const v = [...n.value];
|
|
2511
|
+
v[p] = d, (C = i.value) == null || C.showSheet(!1), r("update:model-value", v);
|
|
2512
|
+
}
|
|
2513
|
+
function c(d) {
|
|
2514
|
+
const p = d.type == "VOUCHER" ? d.collectibleConfig : y.collectibles.find(
|
|
2515
|
+
(V) => V._id.toString() == d.collectible
|
|
2516
|
+
), v = CollectionUtils.formattedType((p == null ? void 0 : p.name) || ""), C = d.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
|
|
2517
|
+
threshold: d.threshold,
|
|
2518
|
+
amount: d.earningOption.amount
|
|
2519
2519
|
}) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
|
|
2520
|
-
threshold:
|
|
2521
|
-
amount:
|
|
2522
|
-
every:
|
|
2520
|
+
threshold: d.threshold,
|
|
2521
|
+
amount: d.earningOption.amount,
|
|
2522
|
+
every: d.earningOption.every
|
|
2523
2523
|
});
|
|
2524
2524
|
return {
|
|
2525
|
-
label: isNullOrEmpty(
|
|
2525
|
+
label: isNullOrEmpty(v) ? o("connect.template.mission_pool.no_reward") : v,
|
|
2526
2526
|
sublabel: C
|
|
2527
2527
|
};
|
|
2528
2528
|
}
|
|
2529
|
-
function
|
|
2530
|
-
var
|
|
2531
|
-
const
|
|
2532
|
-
(
|
|
2529
|
+
function u(d) {
|
|
2530
|
+
var v;
|
|
2531
|
+
const p = [...n.value];
|
|
2532
|
+
(v = i.value) == null || v.showSheet(!0, p[d], d);
|
|
2533
2533
|
}
|
|
2534
|
-
function k(
|
|
2535
|
-
const
|
|
2536
|
-
|
|
2534
|
+
function k(d) {
|
|
2535
|
+
const p = [...n.value];
|
|
2536
|
+
p.splice(d, 1), r("update:model-value", p);
|
|
2537
2537
|
}
|
|
2538
2538
|
function b() {
|
|
2539
|
-
var
|
|
2540
|
-
(
|
|
2539
|
+
var d;
|
|
2540
|
+
(d = i.value) == null || d.showSheet(
|
|
2541
2541
|
!0,
|
|
2542
2542
|
{
|
|
2543
2543
|
type: "LOYALTY",
|
|
@@ -2554,21 +2554,21 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2554
2554
|
n.value.length
|
|
2555
2555
|
);
|
|
2556
2556
|
}
|
|
2557
|
-
function
|
|
2558
|
-
var
|
|
2559
|
-
return
|
|
2560
|
-
((
|
|
2561
|
-
(C) => C.value ==
|
|
2562
|
-
)) == null ? void 0 :
|
|
2557
|
+
function h(d) {
|
|
2558
|
+
var p, v;
|
|
2559
|
+
return d.type == "VOUCHER" ? (p = d.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
|
|
2560
|
+
((v = y.loyaltyRewards.items.find(
|
|
2561
|
+
(C) => C.value == d.collectible
|
|
2562
|
+
)) == null ? void 0 : v.label) || ""
|
|
2563
2563
|
);
|
|
2564
2564
|
}
|
|
2565
|
-
return (
|
|
2566
|
-
const
|
|
2567
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2568
|
-
createElementVNode("div", _hoisted_2$
|
|
2569
|
-
createVNode(
|
|
2565
|
+
return (d, p) => {
|
|
2566
|
+
const v = resolveComponent("FmButton"), C = resolveComponent("FmCard"), V = resolveComponent("FmHelperText");
|
|
2567
|
+
return openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
2568
|
+
createElementVNode("div", _hoisted_2$4, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
|
|
2569
|
+
createVNode(v, {
|
|
2570
2570
|
label: unref(o)("connect.template.mission_pool.add_reward"),
|
|
2571
|
-
onClick:
|
|
2571
|
+
onClick: p[0] || (p[0] = (B) => b()),
|
|
2572
2572
|
variant: "plain",
|
|
2573
2573
|
icon: "add"
|
|
2574
2574
|
}, null, 8, ["label"]),
|
|
@@ -2576,27 +2576,27 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2576
2576
|
key: S,
|
|
2577
2577
|
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
2578
2578
|
variant: "outlined",
|
|
2579
|
-
onClick: (
|
|
2579
|
+
onClick: ($) => u(S)
|
|
2580
2580
|
}, {
|
|
2581
2581
|
default: withCtx(() => [
|
|
2582
2582
|
createElementVNode("div", null, [
|
|
2583
|
-
createElementVNode("div", _hoisted_3$
|
|
2584
|
-
createElementVNode("div", _hoisted_4$
|
|
2583
|
+
createElementVNode("div", _hoisted_3$4, toDisplayString(c(B).label), 1),
|
|
2584
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(c(B).sublabel), 1)
|
|
2585
2585
|
]),
|
|
2586
|
-
createVNode(
|
|
2586
|
+
createVNode(v, {
|
|
2587
2587
|
icon: "delete",
|
|
2588
2588
|
variant: "tertiary",
|
|
2589
|
-
onClick: (
|
|
2589
|
+
onClick: ($) => ($.stopPropagation(), k(S))
|
|
2590
2590
|
}, null, 8, ["onClick"])
|
|
2591
2591
|
]),
|
|
2592
2592
|
_: 2
|
|
2593
2593
|
}, 1032, ["onClick"]))), 128)),
|
|
2594
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(
|
|
2594
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(m).filter((B) => B.path.join(".") == ""), (B) => (openBlock(), createBlock(V, {
|
|
2595
2595
|
key: B.message,
|
|
2596
2596
|
text: B.message,
|
|
2597
2597
|
state: "error"
|
|
2598
2598
|
}, null, 8, ["text"]))), 128)),
|
|
2599
|
-
createElementVNode("div", _hoisted_5$
|
|
2599
|
+
createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
|
|
2600
2600
|
(openBlock(), createBlock(C, {
|
|
2601
2601
|
key: 0,
|
|
2602
2602
|
variant: "outlined",
|
|
@@ -2605,18 +2605,18 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2605
2605
|
default: withCtx(() => {
|
|
2606
2606
|
var B, S;
|
|
2607
2607
|
return [
|
|
2608
|
-
createElementVNode("div", _hoisted_6$
|
|
2608
|
+
createElementVNode("div", _hoisted_6$4, [
|
|
2609
2609
|
createElementVNode("div", null, [
|
|
2610
|
-
createElementVNode("div", _hoisted_7$
|
|
2611
|
-
createElementVNode("div", _hoisted_8$
|
|
2610
|
+
createElementVNode("div", _hoisted_7$3, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((B = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : B.earningOption.amount) > 1 ? (S = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : S.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? h(e.modelValue[e.modelValue.length - 1]) : ""), 1),
|
|
2611
|
+
createElementVNode("div", _hoisted_8$3, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
|
|
2612
2612
|
])
|
|
2613
2613
|
]),
|
|
2614
2614
|
createElementVNode("div", _hoisted_9$2, [
|
|
2615
|
-
createVNode(_sfc_main$
|
|
2615
|
+
createVNode(_sfc_main$6, {
|
|
2616
2616
|
type: e.mission.type,
|
|
2617
2617
|
"max-range": e.mission.end,
|
|
2618
2618
|
currentRange: e.mission.end / 4,
|
|
2619
|
-
markers: e.modelValue.map((
|
|
2619
|
+
markers: e.modelValue.map(($) => $.threshold)
|
|
2620
2620
|
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
2621
2621
|
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
2622
2622
|
])
|
|
@@ -2624,24 +2624,24 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2624
2624
|
}),
|
|
2625
2625
|
_: 1
|
|
2626
2626
|
})),
|
|
2627
|
-
createVNode(_sfc_main$
|
|
2627
|
+
createVNode(_sfc_main$7, {
|
|
2628
2628
|
ref_key: "sheetRef",
|
|
2629
|
-
ref:
|
|
2630
|
-
"onUpdate:modelValue":
|
|
2629
|
+
ref: i,
|
|
2630
|
+
"onUpdate:modelValue": f,
|
|
2631
2631
|
"max-threshold": e.mission.end
|
|
2632
2632
|
}, null, 8, ["max-threshold"])
|
|
2633
2633
|
]);
|
|
2634
2634
|
};
|
|
2635
2635
|
}
|
|
2636
|
-
}), _hoisted_1$
|
|
2636
|
+
}), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "space-y-8" }, _hoisted_3$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$3 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$2 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
2637
2637
|
__name: "MissionInput",
|
|
2638
2638
|
props: {
|
|
2639
2639
|
modelValue: Object
|
|
2640
2640
|
},
|
|
2641
2641
|
emits: ["update:model-value"],
|
|
2642
2642
|
setup(e, { emit: l }) {
|
|
2643
|
-
const { t: o } = useI18n(),
|
|
2644
|
-
const n = FdoMission.safeParse(
|
|
2643
|
+
const { t: o } = useI18n(), s = e, r = computed(() => {
|
|
2644
|
+
const n = FdoMission.safeParse(s.modelValue);
|
|
2645
2645
|
return n.success ? [] : n.error.errors;
|
|
2646
2646
|
}), y = computed(() => [
|
|
2647
2647
|
{
|
|
@@ -2655,54 +2655,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2655
2655
|
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
2656
2656
|
}
|
|
2657
2657
|
]), a = l;
|
|
2658
|
-
return (n,
|
|
2659
|
-
var
|
|
2660
|
-
const
|
|
2661
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2662
|
-
createElementVNode("div", _hoisted_2$
|
|
2663
|
-
createElementVNode("div", _hoisted_3$
|
|
2664
|
-
createElementVNode("div", _hoisted_4$
|
|
2665
|
-
createElementVNode("div", _hoisted_5$
|
|
2666
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (
|
|
2658
|
+
return (n, m) => {
|
|
2659
|
+
var c;
|
|
2660
|
+
const i = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
|
|
2661
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
2662
|
+
createElementVNode("div", _hoisted_2$3, [
|
|
2663
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
|
|
2664
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(unref(o)("connect.template.select_game")), 1),
|
|
2665
|
+
createElementVNode("div", _hoisted_5$3, [
|
|
2666
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(y), (u) => {
|
|
2667
2667
|
var k, b;
|
|
2668
|
-
return openBlock(), createBlock(
|
|
2668
|
+
return openBlock(), createBlock(i, {
|
|
2669
2669
|
variant: "outlined",
|
|
2670
2670
|
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
2671
2671
|
"col-span-2": unref(y).length == 1,
|
|
2672
|
-
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((k = e.modelValue) == null ? void 0 : k.type) ==
|
|
2673
|
-
"hover:bg-fm-color-opacity-sm": ((b = e.modelValue) == null ? void 0 : b.type) !=
|
|
2672
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((k = e.modelValue) == null ? void 0 : k.type) == u.value,
|
|
2673
|
+
"hover:bg-fm-color-opacity-sm": ((b = e.modelValue) == null ? void 0 : b.type) != u.value
|
|
2674
2674
|
}]),
|
|
2675
2675
|
onClick: () => {
|
|
2676
|
-
var
|
|
2677
|
-
((
|
|
2676
|
+
var h, d;
|
|
2677
|
+
((h = e.modelValue) == null ? void 0 : h.type) != u.value && a("update:model-value", {
|
|
2678
2678
|
...e.modelValue,
|
|
2679
|
-
type:
|
|
2680
|
-
end: ((
|
|
2679
|
+
type: u.value,
|
|
2680
|
+
end: ((d = e.modelValue) == null ? void 0 : d.end) || 1
|
|
2681
2681
|
});
|
|
2682
2682
|
},
|
|
2683
|
-
key:
|
|
2683
|
+
key: u.value
|
|
2684
2684
|
}, {
|
|
2685
2685
|
default: withCtx(() => [
|
|
2686
|
-
createElementVNode("div", _hoisted_6$
|
|
2687
|
-
createElementVNode("div", _hoisted_7$
|
|
2686
|
+
createElementVNode("div", _hoisted_6$3, toDisplayString(u.label), 1),
|
|
2687
|
+
createElementVNode("div", _hoisted_7$2, toDisplayString(u.description), 1)
|
|
2688
2688
|
]),
|
|
2689
2689
|
_: 2
|
|
2690
2690
|
}, 1032, ["class", "onClick"]);
|
|
2691
2691
|
}), 128))
|
|
2692
2692
|
])
|
|
2693
2693
|
]),
|
|
2694
|
-
createElementVNode("div", _hoisted_8$
|
|
2694
|
+
createElementVNode("div", _hoisted_8$2, [
|
|
2695
2695
|
createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
|
|
2696
2696
|
createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
|
|
2697
|
-
createVNode(
|
|
2697
|
+
createVNode(f, {
|
|
2698
2698
|
label: unref(o)("connect.campaign.mission.maximumToCollect"),
|
|
2699
|
-
"model-value": ((
|
|
2700
|
-
"onUpdate:modelValue":
|
|
2699
|
+
"model-value": ((c = e.modelValue) == null ? void 0 : c.end) || null,
|
|
2700
|
+
"onUpdate:modelValue": m[0] || (m[0] = (u) => {
|
|
2701
2701
|
var k;
|
|
2702
2702
|
return a("update:model-value", {
|
|
2703
2703
|
...e.modelValue,
|
|
2704
2704
|
type: ((k = e.modelValue) == null ? void 0 : k.type) || "STAMP",
|
|
2705
|
-
end:
|
|
2705
|
+
end: u
|
|
2706
2706
|
});
|
|
2707
2707
|
}),
|
|
2708
2708
|
"helper-text": unref(ZodHelper).helperText(unref(r), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
|
|
@@ -2715,12 +2715,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
|
|
|
2715
2715
|
});
|
|
2716
2716
|
function useLocaleText() {
|
|
2717
2717
|
const { locale: e, t: l } = useI18n();
|
|
2718
|
-
function o(
|
|
2719
|
-
return
|
|
2718
|
+
function o(s, r) {
|
|
2719
|
+
return s ? s[e.value] ?? s["en-US"] ?? l(r) : l(r);
|
|
2720
2720
|
}
|
|
2721
2721
|
return { getLocaleText: o };
|
|
2722
2722
|
}
|
|
2723
|
-
const _hoisted_1$
|
|
2723
|
+
const _hoisted_1$3 = { key: 26 }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
2724
2724
|
__name: "TemplateInput",
|
|
2725
2725
|
props: {
|
|
2726
2726
|
pushAvailability: {
|
|
@@ -2756,110 +2756,110 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2756
2756
|
},
|
|
2757
2757
|
emits: ["retry-push", "update:model-value", "update:file"],
|
|
2758
2758
|
setup(e, { emit: l }) {
|
|
2759
|
-
const { t: o } = useI18n(), { getLocaleText:
|
|
2760
|
-
function a(
|
|
2759
|
+
const { t: o } = useI18n(), { getLocaleText: s } = useLocaleText(), r = e, y = l;
|
|
2760
|
+
function a(f) {
|
|
2761
2761
|
switch (r.field.type) {
|
|
2762
2762
|
case "timeframe":
|
|
2763
|
-
const
|
|
2763
|
+
const c = f.startDate ? hooks(f.startDate).startOf("day").toISOString() : void 0, u = f.endDate ? hooks(f.endDate).endOf("day").toISOString() : void 0;
|
|
2764
2764
|
y("update:model-value", {
|
|
2765
2765
|
type: "timeframe",
|
|
2766
2766
|
property: "__now",
|
|
2767
|
-
start:
|
|
2768
|
-
end:
|
|
2767
|
+
start: c,
|
|
2768
|
+
end: u
|
|
2769
2769
|
});
|
|
2770
2770
|
break;
|
|
2771
2771
|
case "image": {
|
|
2772
2772
|
y(
|
|
2773
2773
|
"update:file",
|
|
2774
|
-
|
|
2775
|
-
n.value || firebaseStorage.collectibleImagePath(void 0,
|
|
2774
|
+
f,
|
|
2775
|
+
n.value || firebaseStorage.collectibleImagePath(void 0, f)
|
|
2776
2776
|
);
|
|
2777
2777
|
break;
|
|
2778
2778
|
}
|
|
2779
2779
|
default:
|
|
2780
|
-
y("update:model-value",
|
|
2780
|
+
y("update:model-value", f);
|
|
2781
2781
|
break;
|
|
2782
2782
|
}
|
|
2783
2783
|
}
|
|
2784
2784
|
const n = computed(() => {
|
|
2785
2785
|
switch (r.field.type) {
|
|
2786
2786
|
case "timeframe": {
|
|
2787
|
-
const
|
|
2787
|
+
const f = r.modelValue;
|
|
2788
2788
|
return {
|
|
2789
|
-
startDate:
|
|
2790
|
-
endDate:
|
|
2789
|
+
startDate: f != null && f.start ? hooks(f == null ? void 0 : f.start).format("YYYY-MM-DD") : null,
|
|
2790
|
+
endDate: f != null && f.end ? hooks(f == null ? void 0 : f.end).format("YYYY-MM-DD") : null
|
|
2791
2791
|
};
|
|
2792
2792
|
}
|
|
2793
2793
|
default:
|
|
2794
2794
|
return r.modelValue;
|
|
2795
2795
|
}
|
|
2796
2796
|
});
|
|
2797
|
-
function
|
|
2798
|
-
if (!
|
|
2799
|
-
const
|
|
2800
|
-
return
|
|
2797
|
+
function m() {
|
|
2798
|
+
if (!i.value.schema) return [];
|
|
2799
|
+
const f = i.value.schema.safeParse(r.modelValue);
|
|
2800
|
+
return f.success ? [] : f.error.errors;
|
|
2801
2801
|
}
|
|
2802
|
-
const
|
|
2802
|
+
const i = computed(() => ({
|
|
2803
2803
|
schema: r.schema,
|
|
2804
2804
|
unwrapped: r.schema ? ZodHelper.unwrap(r.schema) : void 0,
|
|
2805
2805
|
rules: r.schema ? [ZodHelper.ruleAtPath(r.schema, "")] : void 0,
|
|
2806
2806
|
labelMark: r.schema && ZodHelper.isRequired(r.schema) == !1 ? "optional" : void 0,
|
|
2807
2807
|
zodLabel: r.schema ? ZodHelper.toInputLabel(
|
|
2808
2808
|
r.schema,
|
|
2809
|
-
|
|
2809
|
+
s(r.field.label_locale, r.field.label ?? "")
|
|
2810
2810
|
) : void 0
|
|
2811
2811
|
}));
|
|
2812
|
-
return (
|
|
2813
|
-
var
|
|
2814
|
-
const
|
|
2815
|
-
return e.field.type === "text" ? (openBlock(), createBlock(
|
|
2812
|
+
return (f, c) => {
|
|
2813
|
+
var p, v, C, V, B;
|
|
2814
|
+
const u = resolveComponent("FmTextField"), k = resolveComponent("FmStepperField"), b = resolveComponent("FmTextarea"), h = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2815
|
+
return e.field.type === "text" ? (openBlock(), createBlock(u, {
|
|
2816
2816
|
key: 0,
|
|
2817
|
-
label: unref(
|
|
2818
|
-
"label-mark": unref(
|
|
2819
|
-
rules: unref(
|
|
2817
|
+
label: unref(s)(e.field.label_locale, e.field.label ?? ""),
|
|
2818
|
+
"label-mark": unref(i).labelMark,
|
|
2819
|
+
rules: unref(i).rules,
|
|
2820
2820
|
"model-value": unref(n),
|
|
2821
2821
|
"onUpdate:modelValue": a,
|
|
2822
2822
|
"helper-state": e.helperText ? "error" : void 0,
|
|
2823
2823
|
"helper-text": e.helperText
|
|
2824
2824
|
}, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2825
2825
|
createVNode(JsonViewer, {
|
|
2826
|
-
json: { schema: unref(
|
|
2826
|
+
json: { schema: unref(i).unwrapped, props: r }
|
|
2827
2827
|
}, null, 8, ["json"]),
|
|
2828
2828
|
createVNode(k, {
|
|
2829
|
-
label: unref(
|
|
2830
|
-
"label-mark": e.field.isRuleChildren ? void 0 : unref(
|
|
2829
|
+
label: unref(s)(e.field.label_locale, e.field.label ?? ""),
|
|
2830
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(i).labelMark,
|
|
2831
2831
|
"model-value": unref(n),
|
|
2832
|
-
rules: e.field.isRuleChildren ? [] : unref(
|
|
2832
|
+
rules: e.field.isRuleChildren ? [] : unref(i).rules,
|
|
2833
2833
|
"onUpdate:modelValue": a,
|
|
2834
2834
|
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2835
2835
|
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2836
2836
|
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2837
2837
|
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(b, {
|
|
2838
2838
|
key: 2,
|
|
2839
|
-
label: unref(
|
|
2840
|
-
"label-mark": unref(
|
|
2841
|
-
rules: unref(
|
|
2839
|
+
label: unref(s)(e.field.label_locale, e.field.label ?? ""),
|
|
2840
|
+
"label-mark": unref(i).labelMark,
|
|
2841
|
+
rules: unref(i).rules,
|
|
2842
2842
|
"model-value": unref(n),
|
|
2843
2843
|
"onUpdate:modelValue": a,
|
|
2844
2844
|
"show-word-count": "",
|
|
2845
|
-
"max-length": (B = (V = (C = (
|
|
2846
|
-
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$
|
|
2845
|
+
"max-length": (B = (V = (C = (v = (p = unref(i)) == null ? void 0 : p.unwrapped) == null ? void 0 : v._def) == null ? void 0 : C.checks) == null ? void 0 : V.find((S) => S.kind == "max")) == null ? void 0 : B.value
|
|
2846
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$n, {
|
|
2847
2847
|
key: 3,
|
|
2848
2848
|
"campaign-type": e.extras,
|
|
2849
2849
|
"model-value": unref(n),
|
|
2850
2850
|
disabled: e.disabled,
|
|
2851
2851
|
"onUpdate:modelValue": a
|
|
2852
2852
|
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2853
|
-
createVNode(_sfc_main$
|
|
2853
|
+
createVNode(_sfc_main$l, {
|
|
2854
2854
|
"model-value": unref(n),
|
|
2855
2855
|
"onUpdate:modelValue": a
|
|
2856
2856
|
}, null, 8, ["model-value"]),
|
|
2857
|
-
createVNode(
|
|
2857
|
+
createVNode(h, {
|
|
2858
2858
|
class: "!mt-[8px]",
|
|
2859
|
-
text: unref(ZodHelper).helperText(
|
|
2860
|
-
state: unref(ZodHelper).helperState(
|
|
2859
|
+
text: unref(ZodHelper).helperText(m(), ""),
|
|
2860
|
+
state: unref(ZodHelper).helperState(m(), "")
|
|
2861
2861
|
}, null, 8, ["text", "state"])
|
|
2862
|
-
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$
|
|
2862
|
+
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2863
2863
|
key: 5,
|
|
2864
2864
|
thumbnail: unref(n),
|
|
2865
2865
|
"aspect-ratio": "16 / 9",
|
|
@@ -2867,218 +2867,362 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
2867
2867
|
"onUpdate:file": a
|
|
2868
2868
|
}, {
|
|
2869
2869
|
label: withCtx(() => [
|
|
2870
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(
|
|
2870
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(i).zodLabel)))
|
|
2871
2871
|
]),
|
|
2872
2872
|
_: 1
|
|
2873
|
-
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(
|
|
2873
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2874
2874
|
key: 6,
|
|
2875
|
-
label: unref(
|
|
2875
|
+
label: unref(s)(e.field.label_locale, e.field.label ?? ""),
|
|
2876
2876
|
"label-placement": "right",
|
|
2877
2877
|
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2878
|
-
"label-mark": unref(
|
|
2879
|
-
rules: unref(
|
|
2878
|
+
"label-mark": unref(i).labelMark,
|
|
2879
|
+
rules: unref(i).rules,
|
|
2880
2880
|
"model-value": unref(n),
|
|
2881
2881
|
"onUpdate:modelValue": a
|
|
2882
|
-
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$
|
|
2882
|
+
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$z, {
|
|
2883
2883
|
key: 7,
|
|
2884
2884
|
"model-value": unref(n),
|
|
2885
2885
|
"onUpdate:modelValue": a,
|
|
2886
2886
|
"no-campaign": !1,
|
|
2887
|
-
schema: unref(
|
|
2887
|
+
schema: unref(i).schema,
|
|
2888
2888
|
"is-mission": e.extras === "MISSION"
|
|
2889
|
-
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$
|
|
2889
|
+
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$A, {
|
|
2890
2890
|
key: 8,
|
|
2891
2891
|
"model-value": unref(n),
|
|
2892
2892
|
"onUpdate:modelValue": a
|
|
2893
2893
|
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
2894
|
-
createVNode(_sfc_main$
|
|
2894
|
+
createVNode(_sfc_main$B, {
|
|
2895
2895
|
"model-value": unref(n),
|
|
2896
2896
|
"onUpdate:modelValue": a,
|
|
2897
2897
|
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2898
2898
|
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2899
|
-
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(
|
|
2899
|
+
unref(n) ? createCommentVNode("", !0) : (openBlock(), createBlock(h, {
|
|
2900
2900
|
key: 0,
|
|
2901
2901
|
class: "!mt-[8px]",
|
|
2902
2902
|
text: unref(o)("connect.campaign.common.effect_required"),
|
|
2903
2903
|
state: "error"
|
|
2904
2904
|
}, null, 8, ["text"]))
|
|
2905
2905
|
], 64)) : e.field.type === "message" ? (openBlock(), createElementBlock(Fragment, { key: 10 }, [
|
|
2906
|
-
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$
|
|
2906
|
+
e.field.property === "campaign.message" ? (openBlock(), createBlock(_sfc_main$f, {
|
|
2907
2907
|
key: 0,
|
|
2908
2908
|
"push-availability": e.pushAvailability,
|
|
2909
|
-
onRetryPush:
|
|
2909
|
+
onRetryPush: c[0] || (c[0] = (S) => y("retry-push")),
|
|
2910
2910
|
"show-validation": e.showValidation,
|
|
2911
2911
|
"model-value": unref(n),
|
|
2912
2912
|
"onUpdate:modelValue": a,
|
|
2913
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2913
|
+
"helper-text": unref(ZodHelper).helperText(m(), ""),
|
|
2914
2914
|
"trigger-type": e.field.extras,
|
|
2915
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2916
|
-
}, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$
|
|
2915
|
+
"helper-state": unref(ZodHelper).helperState(m(), "")
|
|
2916
|
+
}, null, 8, ["push-availability", "show-validation", "model-value", "helper-text", "trigger-type", "helper-state"])) : (openBlock(), createBlock(_sfc_main$t, {
|
|
2917
2917
|
key: 1,
|
|
2918
2918
|
"allow-email": !0,
|
|
2919
2919
|
"allow-whatsapp": !0,
|
|
2920
2920
|
"model-value": unref(n),
|
|
2921
2921
|
"onUpdate:modelValue": a,
|
|
2922
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2922
|
+
"helper-text": unref(ZodHelper).helperText(m(), ""),
|
|
2923
2923
|
"trigger-type": e.field.extras,
|
|
2924
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2924
|
+
"helper-state": unref(ZodHelper).helperState(m(), "")
|
|
2925
2925
|
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"]))
|
|
2926
|
-
], 64)) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$
|
|
2926
|
+
], 64)) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
2927
2927
|
key: 11,
|
|
2928
2928
|
"model-value": unref(n),
|
|
2929
2929
|
"onUpdate:modelValue": a,
|
|
2930
2930
|
extras: e.extras,
|
|
2931
2931
|
"error-text": e.helperText
|
|
2932
|
-
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$
|
|
2932
|
+
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2933
2933
|
key: 12,
|
|
2934
2934
|
type: "custom",
|
|
2935
2935
|
"model-value": unref(n),
|
|
2936
2936
|
"onUpdate:modelValue": a,
|
|
2937
|
-
"helper-text": e.helperText || unref(ZodHelper).helperText(
|
|
2937
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(m(), ""),
|
|
2938
2938
|
"for-credit": r.campaignType === "CREDIT"
|
|
2939
|
-
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$
|
|
2939
|
+
}, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
|
|
2940
2940
|
key: 13,
|
|
2941
2941
|
"model-value": unref(n),
|
|
2942
2942
|
"onUpdate:modelValue": a
|
|
2943
|
-
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$
|
|
2943
|
+
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$b, {
|
|
2944
2944
|
key: 14,
|
|
2945
2945
|
"model-value": unref(n),
|
|
2946
2946
|
"onUpdate:modelValue": a
|
|
2947
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$
|
|
2947
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2948
2948
|
key: 15,
|
|
2949
2949
|
"model-value": unref(n),
|
|
2950
2950
|
"onUpdate:modelValue": a
|
|
2951
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$
|
|
2951
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$9, {
|
|
2952
2952
|
key: 16,
|
|
2953
2953
|
"model-value": unref(n),
|
|
2954
2954
|
"onUpdate:modelValue": a
|
|
2955
|
-
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$
|
|
2955
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2956
2956
|
key: 17,
|
|
2957
2957
|
"model-value": unref(n),
|
|
2958
2958
|
"onUpdate:modelValue": a,
|
|
2959
|
-
"helper-text": unref(ZodHelper).helperText(
|
|
2960
|
-
"helper-state": unref(ZodHelper).helperState(
|
|
2961
|
-
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$
|
|
2959
|
+
"helper-text": unref(ZodHelper).helperText(m(), ""),
|
|
2960
|
+
"helper-state": unref(ZodHelper).helperState(m(), "")
|
|
2961
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$5, {
|
|
2962
2962
|
key: 18,
|
|
2963
2963
|
"model-value": unref(n),
|
|
2964
2964
|
"onUpdate:modelValue": a,
|
|
2965
2965
|
mission: e.extras.mission
|
|
2966
2966
|
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
2967
|
-
createVNode(_sfc_main$
|
|
2967
|
+
createVNode(_sfc_main$e, {
|
|
2968
2968
|
"model-value": unref(n),
|
|
2969
2969
|
"onUpdate:modelValue": a,
|
|
2970
2970
|
"start-date": e.extras.start,
|
|
2971
2971
|
"end-date": e.extras.end
|
|
2972
2972
|
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2973
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2973
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
2974
2974
|
key: 0,
|
|
2975
2975
|
class: "!mt-[8px]",
|
|
2976
2976
|
text: e.helperText,
|
|
2977
2977
|
state: "error"
|
|
2978
2978
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2979
2979
|
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
2980
|
-
createVNode(_sfc_main$
|
|
2980
|
+
createVNode(_sfc_main$C, {
|
|
2981
2981
|
"model-value": unref(n),
|
|
2982
2982
|
"onUpdate:modelValue": a
|
|
2983
2983
|
}, null, 8, ["model-value"]),
|
|
2984
|
-
e.helperText ? (openBlock(), createBlock(
|
|
2984
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
2985
2985
|
key: 0,
|
|
2986
2986
|
class: "!mt-[8px]",
|
|
2987
2987
|
text: e.helperText,
|
|
2988
2988
|
state: "error"
|
|
2989
2989
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2990
2990
|
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2991
|
-
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(
|
|
2991
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(n).rules.g_time).length > 0 ? (openBlock(), createBlock(h, {
|
|
2992
2992
|
key: 0,
|
|
2993
2993
|
state: "warning",
|
|
2994
2994
|
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2995
2995
|
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2996
|
-
createVNode(_sfc_main$
|
|
2996
|
+
createVNode(_sfc_main$p, {
|
|
2997
2997
|
"model-value": unref(n),
|
|
2998
2998
|
"onUpdate:modelValue": a
|
|
2999
2999
|
}, null, 8, ["model-value"]),
|
|
3000
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3000
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3001
3001
|
key: 1,
|
|
3002
3002
|
class: "!mt-[8px]",
|
|
3003
3003
|
text: e.helperText,
|
|
3004
3004
|
state: "error"
|
|
3005
3005
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3006
3006
|
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
3007
|
-
createVNode(_sfc_main$
|
|
3007
|
+
createVNode(_sfc_main$D, {
|
|
3008
3008
|
"model-value": unref(n),
|
|
3009
3009
|
"onUpdate:modelValue": a
|
|
3010
3010
|
}, null, 8, ["model-value"]),
|
|
3011
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3011
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3012
3012
|
key: 0,
|
|
3013
3013
|
class: "!mt-[8px]",
|
|
3014
3014
|
text: e.helperText,
|
|
3015
3015
|
state: "error"
|
|
3016
3016
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3017
3017
|
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
3018
|
-
createVNode(_sfc_main$
|
|
3018
|
+
createVNode(_sfc_main$E, {
|
|
3019
3019
|
"model-value": unref(n),
|
|
3020
3020
|
"onUpdate:modelValue": a
|
|
3021
3021
|
}, null, 8, ["model-value"]),
|
|
3022
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3022
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3023
3023
|
key: 0,
|
|
3024
3024
|
class: "!mt-[8px]",
|
|
3025
3025
|
text: e.helperText,
|
|
3026
3026
|
state: "error"
|
|
3027
3027
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3028
3028
|
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
3029
|
-
createVNode(_sfc_main$
|
|
3029
|
+
createVNode(_sfc_main$o, {
|
|
3030
3030
|
"model-value": unref(n),
|
|
3031
3031
|
"onUpdate:modelValue": a
|
|
3032
3032
|
}, null, 8, ["model-value"]),
|
|
3033
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3033
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3034
3034
|
key: 0,
|
|
3035
3035
|
class: "!mt-[8px]",
|
|
3036
3036
|
text: e.helperText,
|
|
3037
3037
|
state: "error"
|
|
3038
3038
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3039
3039
|
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
3040
|
-
createVNode(_sfc_main$
|
|
3040
|
+
createVNode(_sfc_main$a, {
|
|
3041
3041
|
"model-value": unref(n),
|
|
3042
3042
|
"onUpdate:modelValue": a
|
|
3043
3043
|
}, null, 8, ["model-value"]),
|
|
3044
|
-
e.helperText ? (openBlock(), createBlock(
|
|
3044
|
+
e.helperText ? (openBlock(), createBlock(h, {
|
|
3045
3045
|
key: 0,
|
|
3046
3046
|
class: "!mt-[8px]",
|
|
3047
3047
|
text: e.helperText,
|
|
3048
3048
|
state: "error"
|
|
3049
3049
|
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
3050
|
-
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$
|
|
3050
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$3, toDisplayString(r.field), 1));
|
|
3051
|
+
};
|
|
3052
|
+
}
|
|
3053
|
+
}), _hoisted_1$2 = { class: "space-y-4" }, _hoisted_2$2 = {
|
|
3054
|
+
id: "location-list-title",
|
|
3055
|
+
class: "fm-typo-en-title-sm-800"
|
|
3056
|
+
}, _hoisted_3$2 = { class: "block fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = ["aria-label"], _hoisted_5$2 = ["title"], _hoisted_6$2 = ["title"], _hoisted_7$1 = {
|
|
3057
|
+
key: 1,
|
|
3058
|
+
class: "p-16 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
3059
|
+
}, _hoisted_8$1 = { class: "flex justify-end" }, ROW_HEIGHT = 44, VIEWPORT_HEIGHT = 352, OVERSCAN = 6, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
3060
|
+
__name: "LocationListDialog",
|
|
3061
|
+
props: {
|
|
3062
|
+
rows: {},
|
|
3063
|
+
total: {},
|
|
3064
|
+
unavailable: {}
|
|
3065
|
+
},
|
|
3066
|
+
setup(e) {
|
|
3067
|
+
const l = e, o = useDialog(), { t: s } = useI18n(), r = ref(""), y = ref(0), a = ref(), n = computed(() => {
|
|
3068
|
+
const f = r.value.trim().toLowerCase();
|
|
3069
|
+
return f ? l.rows.filter(
|
|
3070
|
+
(c) => {
|
|
3071
|
+
var u;
|
|
3072
|
+
return c.name.toLowerCase().includes(f) || ((u = c.code) == null ? void 0 : u.toLowerCase().includes(f));
|
|
3073
|
+
}
|
|
3074
|
+
) : l.rows;
|
|
3075
|
+
}), m = computed(
|
|
3076
|
+
() => Math.max(0, Math.floor(y.value / ROW_HEIGHT) - OVERSCAN)
|
|
3077
|
+
), i = computed(() => {
|
|
3078
|
+
const f = Math.ceil((y.value + VIEWPORT_HEIGHT) / ROW_HEIGHT);
|
|
3079
|
+
return n.value.slice(m.value, f + OVERSCAN);
|
|
3080
|
+
});
|
|
3081
|
+
return watch(r, () => {
|
|
3082
|
+
y.value = 0, a.value && (a.value.scrollTop = 0);
|
|
3083
|
+
}), (f, c) => {
|
|
3084
|
+
const u = resolveComponent("FmTextField"), k = resolveComponent("FmButton"), b = resolveComponent("FmCard");
|
|
3085
|
+
return openBlock(), createBlock(b, {
|
|
3086
|
+
class: "flex flex-col gap-12 p-24 xs:p-16 w-[640px] max-w-[calc(100vw-32px)] min-w-0",
|
|
3087
|
+
role: "dialog",
|
|
3088
|
+
"aria-labelledby": "location-list-title"
|
|
3089
|
+
}, {
|
|
3090
|
+
default: withCtx(() => [
|
|
3091
|
+
createElementVNode("div", _hoisted_1$2, [
|
|
3092
|
+
createElementVNode("h2", _hoisted_2$2, toDisplayString(unref(s)("connect.campaign.common.available_at")), 1),
|
|
3093
|
+
createElementVNode("output", _hoisted_3$2, [
|
|
3094
|
+
createTextVNode(toDisplayString(unref(r).trim() ? unref(s)("connect.campaign.common.locations_match", {
|
|
3095
|
+
count: unref(n).length.toLocaleString(),
|
|
3096
|
+
total: e.total.toLocaleString()
|
|
3097
|
+
}) : unref(s)("connect.campaign.common.locations_count", {
|
|
3098
|
+
count: e.rows.length.toLocaleString(),
|
|
3099
|
+
total: e.total.toLocaleString()
|
|
3100
|
+
})) + " ", 1),
|
|
3101
|
+
e.unavailable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3102
|
+
createTextVNode(" , " + toDisplayString(unref(s)("connect.campaign.common.locations_unavailable", {
|
|
3103
|
+
count: e.unavailable.toLocaleString()
|
|
3104
|
+
})), 1)
|
|
3105
|
+
], 64)) : createCommentVNode("", !0)
|
|
3106
|
+
])
|
|
3107
|
+
]),
|
|
3108
|
+
createVNode(u, {
|
|
3109
|
+
modelValue: unref(r),
|
|
3110
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => isRef(r) ? r.value = h : null),
|
|
3111
|
+
label: unref(s)("connect.setting.location.searchLocations"),
|
|
3112
|
+
placeholder: unref(s)("connect.setting.location.searchLocations")
|
|
3113
|
+
}, null, 8, ["modelValue", "label", "placeholder"]),
|
|
3114
|
+
createElementVNode("div", {
|
|
3115
|
+
ref_key: "listEl",
|
|
3116
|
+
ref: a,
|
|
3117
|
+
class: "overflow-y-auto border-y border-fm-color-neutral-gray-100",
|
|
3118
|
+
style: normalizeStyle({ height: `min(${VIEWPORT_HEIGHT}px, 50vh)` }),
|
|
3119
|
+
onScrollPassive: c[1] || (c[1] = (h) => y.value = h.target.scrollTop)
|
|
3120
|
+
}, [
|
|
3121
|
+
unref(n).length ? (openBlock(), createElementBlock("ul", {
|
|
3122
|
+
key: 0,
|
|
3123
|
+
class: "relative m-0 p-0 list-none",
|
|
3124
|
+
"aria-label": unref(s)("connect.campaign.common.available_at"),
|
|
3125
|
+
style: normalizeStyle({ height: `${unref(n).length * ROW_HEIGHT}px` })
|
|
3126
|
+
}, [
|
|
3127
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (h, d) => (openBlock(), createElementBlock("li", {
|
|
3128
|
+
key: h.id,
|
|
3129
|
+
class: "absolute left-0 right-0 flex items-center gap-12 px-8 border-b border-fm-color-neutral-gray-100 fm-typo-en-body-md-400",
|
|
3130
|
+
style: normalizeStyle({
|
|
3131
|
+
height: `${ROW_HEIGHT}px`,
|
|
3132
|
+
top: `${(unref(m) + d) * ROW_HEIGHT}px`
|
|
3133
|
+
})
|
|
3134
|
+
}, [
|
|
3135
|
+
h.code ? (openBlock(), createElementBlock("span", {
|
|
3136
|
+
key: 0,
|
|
3137
|
+
title: h.code,
|
|
3138
|
+
class: "w-[72px] shrink-0 truncate text-fm-color-typo-secondary"
|
|
3139
|
+
}, toDisplayString(h.code), 9, _hoisted_5$2)) : createCommentVNode("", !0),
|
|
3140
|
+
createElementVNode("span", {
|
|
3141
|
+
class: "min-w-0 truncate fm-typo-en-body-md-600",
|
|
3142
|
+
title: h.name
|
|
3143
|
+
}, toDisplayString(h.name), 9, _hoisted_6$2)
|
|
3144
|
+
], 4))), 128))
|
|
3145
|
+
], 12, _hoisted_4$2)) : (openBlock(), createElementBlock("div", _hoisted_7$1, toDisplayString(e.rows.length ? unref(s)("connect.campaign.common.locations_no_match") : unref(s)("connect.campaign.common.no_location")), 1))
|
|
3146
|
+
], 36),
|
|
3147
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
3148
|
+
createVNode(k, {
|
|
3149
|
+
label: unref(s)("connect.campaign.common.locations_close"),
|
|
3150
|
+
onClick: c[2] || (c[2] = (h) => unref(o).close())
|
|
3151
|
+
}, null, 8, ["label"])
|
|
3152
|
+
])
|
|
3153
|
+
]),
|
|
3154
|
+
_: 1
|
|
3155
|
+
});
|
|
3051
3156
|
};
|
|
3052
3157
|
}
|
|
3053
|
-
}), _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 = {
|
|
3158
|
+
}), _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 = {
|
|
3159
|
+
key: 0,
|
|
3160
|
+
class: "flex flex-wrap items-baseline gap-12"
|
|
3161
|
+
}, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _hoisted_5$1 = ["onClick"], _hoisted_6$1 = {
|
|
3162
|
+
key: 1,
|
|
3163
|
+
class: "fm-typo-en-body-lg-600"
|
|
3164
|
+
}, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
3054
3165
|
__name: "CampaignSummary",
|
|
3055
3166
|
props: {
|
|
3167
|
+
inDialog: {
|
|
3168
|
+
type: Boolean,
|
|
3169
|
+
default: !1
|
|
3170
|
+
},
|
|
3056
3171
|
data: {
|
|
3057
3172
|
type: Object,
|
|
3058
3173
|
required: !0
|
|
3059
3174
|
}
|
|
3060
3175
|
},
|
|
3061
3176
|
setup(e) {
|
|
3062
|
-
const { t: l, te: o } = useI18n();
|
|
3063
|
-
function
|
|
3064
|
-
|
|
3177
|
+
const { t: l, te: o } = useI18n(), s = useDialog();
|
|
3178
|
+
async function r(n) {
|
|
3179
|
+
a.inDialog && (s.close(), await nextTick()), s.open({
|
|
3180
|
+
title: "",
|
|
3181
|
+
dialogComponent: _sfc_main$2,
|
|
3182
|
+
dialogComponentProps: {
|
|
3183
|
+
rows: n.rows,
|
|
3184
|
+
total: n.total,
|
|
3185
|
+
unavailable: n.unavailable
|
|
3186
|
+
}
|
|
3187
|
+
});
|
|
3065
3188
|
}
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3189
|
+
function y(n) {
|
|
3190
|
+
return o(n) || o(n, "en-US");
|
|
3191
|
+
}
|
|
3192
|
+
const a = e;
|
|
3193
|
+
return (n, m) => {
|
|
3194
|
+
const i = resolveComponent("FmCard");
|
|
3195
|
+
return openBlock(), createBlock(i, {
|
|
3069
3196
|
variant: "outlined",
|
|
3070
3197
|
class: "p-16 space-y-8"
|
|
3071
3198
|
}, {
|
|
3072
3199
|
default: withCtx(() => [
|
|
3073
3200
|
createElementVNode("div", _hoisted_1$1, toDisplayString(unref(l)("connect.campaign.common.summary")), 1),
|
|
3074
|
-
|
|
3075
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (
|
|
3201
|
+
m[0] || (m[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
|
|
3202
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (f, c) => (openBlock(), createElementBlock("div", {
|
|
3076
3203
|
class: "space-y-4",
|
|
3077
|
-
key:
|
|
3204
|
+
key: c
|
|
3078
3205
|
}, [
|
|
3079
|
-
|
|
3080
|
-
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(l)(`${
|
|
3081
|
-
|
|
3206
|
+
f ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3207
|
+
createElementVNode("div", _hoisted_2$1, toDisplayString(unref(l)(`${c}`)), 1),
|
|
3208
|
+
typeof f == "object" ? (openBlock(), createElementBlock("div", _hoisted_3$1, [
|
|
3209
|
+
createElementVNode("span", _hoisted_4$1, [
|
|
3210
|
+
createTextVNode(toDisplayString(unref(l)("connect.campaign.common.locations_count", {
|
|
3211
|
+
count: f.rows.length.toLocaleString(),
|
|
3212
|
+
total: f.total.toLocaleString()
|
|
3213
|
+
})) + " ", 1),
|
|
3214
|
+
f.unavailable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
3215
|
+
createTextVNode(" , " + toDisplayString(unref(l)("connect.campaign.common.locations_unavailable", {
|
|
3216
|
+
count: f.unavailable.toLocaleString()
|
|
3217
|
+
})), 1)
|
|
3218
|
+
], 64)) : createCommentVNode("", !0)
|
|
3219
|
+
]),
|
|
3220
|
+
createElementVNode("button", {
|
|
3221
|
+
type: "button",
|
|
3222
|
+
class: "fm-typo-en-body-lg-600 text-fm-color-primary py-12 -my-12 px-8 -mx-8 underline underline-offset-2 hover:opacity-80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-fm-color-primary rounded-sm",
|
|
3223
|
+
onClick: (u) => r(f)
|
|
3224
|
+
}, toDisplayString(unref(l)("connect.campaign.common.locations_view")), 9, _hoisted_5$1)
|
|
3225
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_6$1, toDisplayString(y(`${f}`) ? unref(l)(`${f}`) : f), 1))
|
|
3082
3226
|
], 64)) : createCommentVNode("", !0)
|
|
3083
3227
|
]))), 128))
|
|
3084
3228
|
]),
|
|
@@ -3102,8 +3246,8 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3102
3246
|
pushAvailability.value = "checking";
|
|
3103
3247
|
try {
|
|
3104
3248
|
if (!l) throw new Error("Business ID is unavailable");
|
|
3105
|
-
const
|
|
3106
|
-
o() && (pushAvailability.value =
|
|
3249
|
+
const s = await getNativeApp(l);
|
|
3250
|
+
o() && (pushAvailability.value = s ? "native" : "non-native");
|
|
3107
3251
|
} catch {
|
|
3108
3252
|
o() && (pushAvailability.value = "failed");
|
|
3109
3253
|
}
|
|
@@ -3134,14 +3278,14 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3134
3278
|
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
3135
3279
|
} catch {
|
|
3136
3280
|
} finally {
|
|
3137
|
-
await new Promise((
|
|
3281
|
+
await new Promise((s) => setTimeout(s, 120)), isLoading.value = !1;
|
|
3138
3282
|
}
|
|
3139
|
-
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((
|
|
3283
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((s, r) => {
|
|
3140
3284
|
var y;
|
|
3141
|
-
if (
|
|
3142
|
-
const a = (y =
|
|
3285
|
+
if (s.campaign.type === "VOUCHER" && s.campaign.code) {
|
|
3286
|
+
const a = (y = s.campaign._id) == null ? void 0 : y.toString();
|
|
3143
3287
|
useCampaignStore().campaigns.voucher.some(
|
|
3144
|
-
(n) => n.code ===
|
|
3288
|
+
(n) => n.code === s.campaign.code && n._id.toString() !== a
|
|
3145
3289
|
) && r.addIssue({
|
|
3146
3290
|
code: "custom",
|
|
3147
3291
|
message: "Code already exists, please use another code",
|
|
@@ -3187,10 +3331,10 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3187
3331
|
});
|
|
3188
3332
|
function stepErrors(e = currentStep.value - 1) {
|
|
3189
3333
|
const l = template.value.steps[e].groups.flatMap(
|
|
3190
|
-
(o) => o.fields.map((
|
|
3334
|
+
(o) => o.fields.map((s) => schemaPathForField(s.property))
|
|
3191
3335
|
);
|
|
3192
3336
|
return errors.value.filter(
|
|
3193
|
-
(o) => l.some((
|
|
3337
|
+
(o) => l.some((s) => o.path.join(".").includes(s))
|
|
3194
3338
|
);
|
|
3195
3339
|
}
|
|
3196
3340
|
const validateOnSubmit = computed(() => campaignType.value === "BROADCAST"), submitAttempted = ref(!1), showValidation = computed(
|
|
@@ -3217,7 +3361,8 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3217
3361
|
title: "",
|
|
3218
3362
|
dialogComponent: _sfc_main$1,
|
|
3219
3363
|
dialogComponentProps: {
|
|
3220
|
-
data: data.value
|
|
3364
|
+
data: data.value,
|
|
3365
|
+
inDialog: !0
|
|
3221
3366
|
}
|
|
3222
3367
|
});
|
|
3223
3368
|
}
|
|
@@ -3234,22 +3379,22 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3234
3379
|
return e === "campaign.message" ? "campaign.delivery" : e;
|
|
3235
3380
|
}
|
|
3236
3381
|
function onUpdateProperty(e, l) {
|
|
3237
|
-
var o,
|
|
3382
|
+
var o, s, r, y, a, n, m, i;
|
|
3238
3383
|
if (e === "campaign.message" && l && "channels" in l) {
|
|
3239
3384
|
_.set(data.value, "campaign.delivery", l);
|
|
3240
|
-
const
|
|
3241
|
-
|
|
3385
|
+
const f = toLegacyMessage(l);
|
|
3386
|
+
f ? _.set(data.value, "campaign.message", f) : delete data.value.campaign.message;
|
|
3242
3387
|
return;
|
|
3243
3388
|
}
|
|
3244
3389
|
if (_.set(data.value, e, l), e == "campaign.event.type") {
|
|
3245
|
-
const
|
|
3246
|
-
...(
|
|
3390
|
+
const c = ((y = (r = (s = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : s.campaign) == null ? void 0 : r.event) == null ? void 0 : y.rule) ? _.cloneDeep({
|
|
3391
|
+
...(i = (m = (n = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : n.campaign) == null ? void 0 : m.event) == null ? void 0 : i.rule
|
|
3247
3392
|
}) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
|
|
3248
3393
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
3249
3394
|
RuleBuilder.scaffoldGroup("g_time"),
|
|
3250
3395
|
RuleBuilder.scaffoldGroup("g_user"),
|
|
3251
3396
|
RuleBuilder.scaffoldGroup("g_bill")
|
|
3252
|
-
]),
|
|
3397
|
+
]), u = RuleBuilder.setRuleToGroup(
|
|
3253
3398
|
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
3254
3399
|
[
|
|
3255
3400
|
RuleBuilder.constructEntry(
|
|
@@ -3262,13 +3407,13 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3262
3407
|
"&&"
|
|
3263
3408
|
);
|
|
3264
3409
|
if (l != "SCHEDULE") {
|
|
3265
|
-
_.set(data.value, "campaign.event.rule",
|
|
3410
|
+
_.set(data.value, "campaign.event.rule", c);
|
|
3266
3411
|
return;
|
|
3267
3412
|
}
|
|
3268
3413
|
_.set(
|
|
3269
3414
|
data.value,
|
|
3270
3415
|
"campaign.event.rule",
|
|
3271
|
-
RuleBuilder.setRuleToGroup(
|
|
3416
|
+
RuleBuilder.setRuleToGroup(c, u)
|
|
3272
3417
|
);
|
|
3273
3418
|
}
|
|
3274
3419
|
e == "campaign.notify" && l == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
@@ -3294,7 +3439,7 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3294
3439
|
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
3295
3440
|
}
|
|
3296
3441
|
return (e, l) => {
|
|
3297
|
-
const o = resolveComponent("FmButton"),
|
|
3442
|
+
const o = resolveComponent("FmButton"), s = resolveComponent("FmStep"), r = resolveComponent("FmStepper"), y = resolveComponent("FmCard"), a = resolveComponent("FmTopSheet");
|
|
3298
3443
|
return openBlock(), createBlock(a, {
|
|
3299
3444
|
"fullscreen-size": "lg",
|
|
3300
3445
|
modelValue: unref(sheetVisible),
|
|
@@ -3367,12 +3512,12 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3367
3512
|
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
3368
3513
|
}, {
|
|
3369
3514
|
default: withCtx(() => [
|
|
3370
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n,
|
|
3515
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, m) => (openBlock(), createBlock(s, {
|
|
3371
3516
|
key: n.name,
|
|
3372
3517
|
title: unref(getLocaleText)(n.name_locale, n.name),
|
|
3373
|
-
value:
|
|
3374
|
-
error: () => hasVisibleStepErrors(
|
|
3375
|
-
complete: () =>
|
|
3518
|
+
value: m + 1,
|
|
3519
|
+
error: () => hasVisibleStepErrors(m),
|
|
3520
|
+
complete: () => m + 1 <= unref(currentStep)
|
|
3376
3521
|
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
3377
3522
|
]),
|
|
3378
3523
|
_: 1
|
|
@@ -3390,13 +3535,13 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3390
3535
|
class: "flex-1"
|
|
3391
3536
|
}, {
|
|
3392
3537
|
default: withCtx(() => [
|
|
3393
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n,
|
|
3538
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (n, m) => (openBlock(), createBlock(s, {
|
|
3394
3539
|
key: n.name,
|
|
3395
3540
|
title: unref(sheetTitle),
|
|
3396
3541
|
description: unref(getLocaleText)(n.name_locale, n.name),
|
|
3397
|
-
value:
|
|
3398
|
-
error: () => hasVisibleStepErrors(
|
|
3399
|
-
complete: () =>
|
|
3542
|
+
value: m + 1,
|
|
3543
|
+
error: () => hasVisibleStepErrors(m),
|
|
3544
|
+
complete: () => m + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
3400
3545
|
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
3401
3546
|
]),
|
|
3402
3547
|
_: 1
|
|
@@ -3422,41 +3567,41 @@ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent(
|
|
|
3422
3567
|
}
|
|
3423
3568
|
}, null, 8, ["json"]),
|
|
3424
3569
|
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
3425
|
-
(n) => n.fields.length && (!n.condition || (Array.isArray(n.condition) ? n.condition.every((
|
|
3426
|
-
), (n,
|
|
3427
|
-
key:
|
|
3570
|
+
(n) => n.fields.length && (!n.condition || (Array.isArray(n.condition) ? n.condition.every((m) => unref(_).get(unref(data), m.property) == m.value == (m.not != !0)) : unref(_).get(unref(data), n.condition.property) == n.condition.value == (n.condition.not != !0)))
|
|
3571
|
+
), (n, m) => (openBlock(), createElementBlock("div", {
|
|
3572
|
+
key: m,
|
|
3428
3573
|
class: "space-y-24"
|
|
3429
3574
|
}, [
|
|
3430
3575
|
createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(n.name_locale, n.name ?? "")), 1),
|
|
3431
|
-
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (
|
|
3432
|
-
(openBlock(), createBlock(_sfc_main$
|
|
3433
|
-
key:
|
|
3434
|
-
field:
|
|
3435
|
-
modelValue: valueForField(
|
|
3436
|
-
disabled: isDisable(
|
|
3576
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(n.fields, (i, f) => (openBlock(), createElementBlock("div", { key: f }, [
|
|
3577
|
+
(openBlock(), createBlock(_sfc_main$3, {
|
|
3578
|
+
key: f,
|
|
3579
|
+
field: i,
|
|
3580
|
+
modelValue: valueForField(i.property),
|
|
3581
|
+
disabled: isDisable(i),
|
|
3437
3582
|
"campaign-type": unref(campaignType),
|
|
3438
3583
|
"show-validation": unref(showValidation),
|
|
3439
3584
|
"push-availability": unref(pushAvailability),
|
|
3440
3585
|
onRetryPush: checkPushAvailability,
|
|
3441
|
-
"onUpdate:modelValue": (
|
|
3442
|
-
"onUpdate:file": async (
|
|
3443
|
-
const k = await onUpdateFile(
|
|
3444
|
-
onUpdateProperty(
|
|
3586
|
+
"onUpdate:modelValue": (c) => onUpdateProperty(i.property, c),
|
|
3587
|
+
"onUpdate:file": async (c, u) => {
|
|
3588
|
+
const k = await onUpdateFile(c, u);
|
|
3589
|
+
onUpdateProperty(i.property, k || "");
|
|
3445
3590
|
},
|
|
3446
3591
|
schema: unref(ZodHelper).typeAtPath(
|
|
3447
3592
|
unref(schema),
|
|
3448
|
-
schemaPathForField(
|
|
3593
|
+
schemaPathForField(i.property),
|
|
3449
3594
|
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
3450
3595
|
),
|
|
3451
3596
|
"helper-state": unref(ZodHelper).helperState(
|
|
3452
3597
|
unref(visibleErrors),
|
|
3453
|
-
schemaPathForField(
|
|
3598
|
+
schemaPathForField(i.property)
|
|
3454
3599
|
),
|
|
3455
3600
|
"helper-text": unref(ZodHelper).helperText(
|
|
3456
3601
|
unref(visibleErrors),
|
|
3457
|
-
schemaPathForField(
|
|
3602
|
+
schemaPathForField(i.property)
|
|
3458
3603
|
),
|
|
3459
|
-
extras:
|
|
3604
|
+
extras: i.extras != null ? i.extras == "" ? unref(data) : unref(_).get(unref(data), i.extras) : void 0
|
|
3460
3605
|
}, null, 8, ["field", "modelValue", "disabled", "campaign-type", "show-validation", "push-availability", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
|
|
3461
3606
|
]))), 128))
|
|
3462
3607
|
]))), 128)),
|