@feedmepos/mf-connect 0.0.9 → 0.0.11-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Analytic-CwaN0mge.js → Analytic-CpXLcGWV.js} +7 -7
- package/dist/{Broadcast-Cjx5xzUC.js → Broadcast-CEMQS5PI.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D4mO5aik.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D0Kvpl_V.js} +8 -8
- package/dist/{Card-DbY6YaXk.js → Card-BqX-aRK9.js} +182 -187
- package/dist/{Collections-DRN2gzwh.js → Collections-SRmluAj0.js} +102 -84
- package/dist/{Credit-DOcrzykJ.js → Credit-DdBKFsII.js} +7 -7
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYNpBySQ.js +2600 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-EF_rHfwT.js → EffectSheet.vue_vue_type_style_index_0_lang-admNNBWu.js} +1864 -1830
- package/dist/{Experience-aQj-3H2Y.js → Experience-CSfRrWqI.js} +7 -7
- package/dist/Game-BV--qn0e.js +250 -0
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CG-GBVMP.js → ImageInput.vue_vue_type_script_setup_true_lang-DpYjrT3G.js} +1 -1
- package/dist/{MainLayout-Cxl9yLPs.js → MainLayout-B_ZXQrMD.js} +1 -1
- package/dist/{Marketing-BYUcbcMU.js → Marketing-Bac3EbOu.js} +16 -16
- package/dist/{Member-D7K9fm_Q.js → Member-CGMRVEuI.js} +2 -2
- package/dist/{MemberList-DbXkxUzF.js → MemberList-CSyb4bNE.js} +196 -195
- package/dist/{MemberTransactions-DED1SYwX.js → MemberTransactions-BdraBHg6.js} +2 -2
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CLqIp5wR.js → MessageInput.vue_vue_type_script_setup_true_lang-BvAFOoym.js} +2 -2
- package/dist/Mission-D8-D99g-.js +248 -0
- package/dist/Point-BOI4mT-K.js +220 -0
- package/dist/{Promotion-DzVXy_C9.js → Promotion-D0MLMo9m.js} +8 -8
- package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CeS6KlhP.js → RuleGroup.vue_vue_type_script_setup_true_lang-1L68zx5t.js} +58 -58
- package/dist/Segment-BeUbkVj7.js +444 -0
- package/dist/{Setting-pCzenLoL.js → Setting-uM4iKdyM.js} +386 -379
- package/dist/{Store-DEwEIFYD.js → Store-BkccNTnM.js} +432 -413
- package/dist/{StoreRewards-D7vnZN4f.js → StoreRewards-BLgP6Mfv.js} +9 -9
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-ALzQU3th.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Z0nqQyi8.js} +39 -38
- package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-GMIztWCj.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-C771jjYx.js} +1 -1
- package/dist/{Tier-BJbX5CPB.js → Tier-DwKAfz6f.js} +17 -16
- package/dist/{Title-C9xV6rBg.js → Title-B1_yd9pC.js} +16 -15
- package/dist/{Transaction-C8OHlhzR.js → Transaction-DcVCMUY4.js} +1 -1
- package/dist/{Voucher-eZwm7N1D.js → Voucher-Djvai5vL.js} +30 -30
- package/dist/{app-DgbDbhL-.js → app-BvizV9z5.js} +3192 -3178
- package/dist/app.js +1 -1
- package/dist/{campaign-BkvrUTEJ.js → campaign-BdSwq7MJ.js} +31 -27
- package/dist/dto-CkH5Zama.js +1150 -0
- package/dist/{effect-f7DAPYC8.js → effect-DT4ivttr.js} +1 -1
- package/dist/{export-BXbCXTfd.js → export-BAJL8_2G.js} +3 -3
- package/dist/{helper-BhvQ9m6d.js → helper-CiIZ1pUo.js} +21 -8
- package/dist/{index-CdtrQ9tR.js → index-7uOMMdXt.js} +245 -184
- package/dist/{index-Cfo2A0Se.js → index-8nrxC9d5.js} +1 -1
- package/dist/{index-FWp9M1yS.js → index-B5gJ6P15.js} +269 -21
- package/dist/{index-BhacKx5B.js → index-BLWw_MlC.js} +1363 -1341
- package/dist/{index-VmFlM704.js → index-C5N8jeJ1.js} +1 -1
- package/dist/{index-Cz5RZlYh.js → index-C8dIiNQb.js} +1 -1
- package/dist/{index-Dd3hrFcQ.js → index-Ccn7PGoB.js} +268 -267
- package/dist/{index-oQLJE4Uw.js → index-CjZxaXvZ.js} +69 -64
- package/dist/{index-DQC_1tRF.js → index-DCs4-zXS.js} +7 -17
- package/dist/{index-BsEqtUmY.js → index-DMyaEjMn.js} +26 -20
- package/dist/{loading-DQaawbHE.js → loading-C1IzY-n2.js} +1312 -1312
- package/dist/{lodash-DzdmTD20.js → lodash-BMQ4xbjY.js} +1 -1
- package/dist/membership-D3I4udu3.js +221 -0
- package/dist/{money-vzwOUBrp.js → money-BQEcWGhZ.js} +1 -1
- package/dist/{number-CBzs6rfW.js → number-DGx2QPUy.js} +1 -1
- package/dist/{rule-BR5rrmUV.js → rule-CvlhLEGy.js} +2 -2
- package/dist/{rule-builder-7GBNrPXt.js → rule-builder-Di3qiIBb.js} +1 -1
- package/dist/{template-CETJ6lkf.js → template-D6Abrya4.js} +5 -5
- package/dist/{usePagination-DdZeE4Tt.js → usePagination-MhbjQgN7.js} +1 -1
- package/dist/{xlsx-CDAKxZE_.js → xlsx-mL_3T1k3.js} +226 -226
- package/package.json +3 -3
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CUxfXaro.js +0 -2002
- package/dist/Game-Cnje-m_M.js +0 -242
- package/dist/Point-CQm8whVQ.js +0 -211
- package/dist/Segment-D3o0D3Uv.js +0 -407
- package/dist/dto-YYVhW73A.js +0 -1092
- package/dist/libs/packages/core/src/bill/bill.dto.d.ts +0 -75
- package/dist/libs/packages/core/src/bill/index.d.ts +0 -115
- package/dist/libs/packages/core/src/business/index.d.ts +0 -21
- package/dist/libs/packages/core/src/campaign/broadcast/index.d.ts +0 -36
- package/dist/libs/packages/core/src/campaign/campaign.enum.d.ts +0 -9
- package/dist/libs/packages/core/src/campaign/campaign.fn.d.ts +0 -7
- package/dist/libs/packages/core/src/campaign/dto.d.ts +0 -5517
- package/dist/libs/packages/core/src/campaign/group.d.ts +0 -25
- package/dist/libs/packages/core/src/campaign/index.d.ts +0 -33988
- package/dist/libs/packages/core/src/collectible/collectible.dto.d.ts +0 -21
- package/dist/libs/packages/core/src/collectible/collectible.enum.d.ts +0 -14
- package/dist/libs/packages/core/src/collectible/helper.d.ts +0 -195
- package/dist/libs/packages/core/src/collectible/index.d.ts +0 -1588
- package/dist/libs/packages/core/src/collectible/pool/index.d.ts +0 -1381
- package/dist/libs/packages/core/src/collection/collection.fn.d.ts +0 -5
- package/dist/libs/packages/core/src/collection/index.d.ts +0 -1014
- package/dist/libs/packages/core/src/collection/transaction.d.ts +0 -845
- package/dist/libs/packages/core/src/collection/transaction.fn.d.ts +0 -10
- package/dist/libs/packages/core/src/common/array.d.ts +0 -2
- package/dist/libs/packages/core/src/common/hash.d.ts +0 -10
- package/dist/libs/packages/core/src/common/index.d.ts +0 -42
- package/dist/libs/packages/core/src/common/number.d.ts +0 -7
- package/dist/libs/packages/core/src/common/object.d.ts +0 -5
- package/dist/libs/packages/core/src/common/objectId.d.ts +0 -2
- package/dist/libs/packages/core/src/common/string.d.ts +0 -4
- package/dist/libs/packages/core/src/counter/counter.dto.d.ts +0 -767
- package/dist/libs/packages/core/src/counter/index.d.ts +0 -1
- package/dist/libs/packages/core/src/event/index.d.ts +0 -4246
- package/dist/libs/packages/core/src/feedback/index.d.ts +0 -24
- package/dist/libs/packages/core/src/game/index.d.ts +0 -32
- package/dist/libs/packages/core/src/index.d.ts +0 -21
- package/dist/libs/packages/core/src/internal/index.d.ts +0 -56
- package/dist/libs/packages/core/src/legacy/setting/index.d.ts +0 -89
- package/dist/libs/packages/core/src/location/index.d.ts +0 -44
- package/dist/libs/packages/core/src/loyalty/card/index.d.ts +0 -1296
- package/dist/libs/packages/core/src/loyalty/index.d.ts +0 -3
- package/dist/libs/packages/core/src/loyalty/tier/helper.d.ts +0 -2
- package/dist/libs/packages/core/src/loyalty/tier/index.d.ts +0 -251
- package/dist/libs/packages/core/src/loyalty/title/index.d.ts +0 -4
- package/dist/libs/packages/core/src/marketing-material/index.d.ts +0 -186
- package/dist/libs/packages/core/src/marketing-material/marketing-material.enum.d.ts +0 -3
- package/dist/libs/packages/core/src/notification/index.d.ts +0 -130
- package/dist/libs/packages/core/src/pagination/index.d.ts +0 -25
- package/dist/libs/packages/core/src/permission/index.d.ts +0 -243
- package/dist/libs/packages/core/src/service/index.d.ts +0 -10
- package/dist/libs/packages/core/src/store/dto.d.ts +0 -1069
- package/dist/libs/packages/core/src/store/index.d.ts +0 -3942
- package/dist/libs/packages/core/src/store/store.fn.d.ts +0 -104
- package/dist/libs/packages/core/src/template/index.d.ts +0 -880
- package/dist/libs/packages/core/src/template/templates.d.ts +0 -1239
- package/dist/libs/packages/core/src/user/index.d.ts +0 -245
- package/dist/libs/packages/core/src/user/segment.dto.d.ts +0 -27
- package/dist/libs/packages/core/src/user/segmentation.d.ts +0 -28
- package/dist/libs/packages/core/src/user/user.dto.d.ts +0 -873
- package/dist/libs/packages/core/src/validation/index.d.ts +0 -1
- package/dist/libs/packages/core/src/validation/rule/builder.d.ts +0 -36
- package/dist/libs/packages/core/src/validation/rule/index.d.ts +0 -45
- package/dist/libs/packages/core/src/validation/rule/operator.enum.d.ts +0 -405
- package/dist/libs/packages/core/src/validation/rule/rule.fn.d.ts +0 -6
- package/dist/libs/packages/validation/src/index.d.ts +0 -3
- package/dist/libs/packages/validation/src/rule/rule-builder.d.ts +0 -19
- package/dist/libs/packages/validation/src/rule/rule.d.ts +0 -52
- package/dist/libs/packages/validation/src/rule/validate.d.ts +0 -2
- package/dist/membership-Dq2-b-S_.js +0 -210
- package/dist/packages/connect/src/App.vue.d.ts +0 -2
- package/dist/packages/connect/src/Entry.vue.d.ts +0 -2
- package/dist/packages/connect/src/api/auth/index.d.ts +0 -3
- package/dist/packages/connect/src/api/campaign/index.d.ts +0 -30
- package/dist/packages/connect/src/api/campaign/template.d.ts +0 -5
- package/dist/packages/connect/src/api/index.d.ts +0 -29
- package/dist/packages/connect/src/api/location/index.d.ts +0 -7
- package/dist/packages/connect/src/api/marketing-material/index.d.ts +0 -7
- package/dist/packages/connect/src/api/member/index.d.ts +0 -12
- package/dist/packages/connect/src/api/membership/index.d.ts +0 -28
- package/dist/packages/connect/src/api/segments/index.d.ts +0 -13
- package/dist/packages/connect/src/api/settings/index.d.ts +0 -4
- package/dist/packages/connect/src/api/transaction/index.d.ts +0 -9
- package/dist/packages/connect/src/api/users/index.d.ts +0 -8
- package/dist/packages/connect/src/app.d.ts +0 -16
- package/dist/packages/connect/src/components/NavigationTab.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/analytic/CampaignCard.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/analytic/CampaignChip.vue.d.ts +0 -47
- package/dist/packages/connect/src/components/analytic/CampaignGroup.vue.d.ts +0 -25
- package/dist/packages/connect/src/components/analytic/CampaignStat.vue.d.ts +0 -31
- package/dist/packages/connect/src/components/analytic/LinkCampaign.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/campaign/CampaignChip.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/campaign/CampaignSummary.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/campaign/CampaignTriggerInput.vue.d.ts +0 -34
- package/dist/packages/connect/src/components/campaign/EarningOptionInput.vue.d.ts +0 -50
- package/dist/packages/connect/src/components/campaign/GameTypeInput.vue.d.ts +0 -15
- package/dist/packages/connect/src/components/campaign/MessageInput.vue.d.ts +0 -64
- package/dist/packages/connect/src/components/campaign/PromotionGameTypeInput.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/campaign/ScheduleRuleInput.vue.d.ts +0 -29
- package/dist/packages/connect/src/components/campaign/TargetLocationInput.vue.d.ts +0 -32
- package/dist/packages/connect/src/components/campaign/ValidityInput.vue.d.ts +0 -59
- package/dist/packages/connect/src/components/collectible/CollectibleChip.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/collectible/CollectibleOptionInput.vue.d.ts +0 -59
- package/dist/packages/connect/src/components/collection/Collections.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/common/BaseTable.vue.d.ts +0 -80
- package/dist/packages/connect/src/components/common/FmTableSelection.vue.d.ts +0 -22
- package/dist/packages/connect/src/components/custom/ChipMenu.vue.d.ts +0 -96
- package/dist/packages/connect/src/components/custom/CustomSelect.vue.d.ts +0 -68
- package/dist/packages/connect/src/components/custom/DateInput.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/custom/DateRangeChip.vue.d.ts +0 -25
- package/dist/packages/connect/src/components/custom/DateRangeInput.vue.d.ts +0 -28
- package/dist/packages/connect/src/components/custom/FilterChip.vue.d.ts +0 -90
- package/dist/packages/connect/src/components/custom/ImageInput.vue.d.ts +0 -115
- package/dist/packages/connect/src/components/custom/json/JsonNode.vue.d.ts +0 -36
- package/dist/packages/connect/src/components/custom/json/JsonViewer.vue.d.ts +0 -22
- package/dist/packages/connect/src/components/custom/zod/ZodTextField.vue.d.ts +0 -52
- package/dist/packages/connect/src/components/loading/ImageLoading.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/loading/LottieAnimation.vue.d.ts +0 -39
- package/dist/packages/connect/src/components/loading/Splash.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/loyalty/CampaignTypeDialog.vue.d.ts +0 -13
- package/dist/packages/connect/src/components/loyalty/CreditCoinDialog.vue.d.ts +0 -29
- package/dist/packages/connect/src/components/loyalty/TierExpression.vue.d.ts +0 -32
- package/dist/packages/connect/src/components/marketing/HeadlineStyleSideSheet.vue.d.ts +0 -42
- package/dist/packages/connect/src/components/marketing/ImageSideSheet.vue.d.ts +0 -40
- package/dist/packages/connect/src/components/marketing/LinkRewardSideSheet.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/marketing/MarketingSheet.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/marketing/RewardDropDown.vue.d.ts +0 -26
- package/dist/packages/connect/src/components/marketing/RightSheet.vue.d.ts +0 -66
- package/dist/packages/connect/src/components/marketing/SlideUpDown.vue.d.ts +0 -27
- package/dist/packages/connect/src/components/marketing/platform/BrandAppImage.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/FacebookPost.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/FacebookStory.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/marketing/platform/ImageCanvas.vue.d.ts +0 -81
- package/dist/packages/connect/src/components/marketing/platform/InstagramPost.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/InstagramReel.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/InstagramStory.vue.d.ts +0 -102
- package/dist/packages/connect/src/components/marketing/platform/TvImage.vue.d.ts +0 -103
- package/dist/packages/connect/src/components/member/MemberDetail.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberList.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberOverview.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/member/MemberStatsDialog.vue.d.ts +0 -21
- package/dist/packages/connect/src/components/rule/BillRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/CustomRuleDialog.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/rule/FeedbackRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/PresetRuleDialog.vue.d.ts +0 -20
- package/dist/packages/connect/src/components/rule/RuleConfigurator.vue.d.ts +0 -37
- package/dist/packages/connect/src/components/rule/RuleEntry.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/RuleEquator.vue.d.ts +0 -31
- package/dist/packages/connect/src/components/rule/RuleGroup.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/rule/SegmentConfigurator.vue.d.ts +0 -17
- package/dist/packages/connect/src/components/rule/TimeRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/UserRuleGroup.vue.d.ts +0 -19
- package/dist/packages/connect/src/components/rule/equators/BirthdayInput.vue.d.ts +0 -15
- package/dist/packages/connect/src/components/rule/equators/IsDayInput.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/rule/equators/IsInMonthInput.vue.d.ts +0 -16
- package/dist/packages/connect/src/components/rule/equators/IsRangeInput.vue.d.ts +0 -55
- package/dist/packages/connect/src/components/rule/equators/RruleInput.vue.d.ts +0 -37
- package/dist/packages/connect/src/components/rule/presets.d.ts +0 -18
- package/dist/packages/connect/src/components/segment/ReviewSegment.vue.d.ts +0 -16
- package/dist/packages/connect/src/components/setting/LinkDeviceDialog.vue.d.ts +0 -2
- package/dist/packages/connect/src/components/store/AddBundleCard.vue.d.ts +0 -6
- package/dist/packages/connect/src/components/store/CategoryDialog.vue.d.ts +0 -23
- package/dist/packages/connect/src/components/store/StoreBundleCard.vue.d.ts +0 -20
- package/dist/packages/connect/src/components/store/StoreTransactions.vue.d.ts +0 -10
- package/dist/packages/connect/src/components/stripe/StripeSetting.vue.d.ts +0 -21
- package/dist/packages/connect/src/components/tax/TaxInclusiveSetting.vue.d.ts +0 -30
- package/dist/packages/connect/src/components/tax/TaxVariantSetting.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/template/TemplateDialog.vue.d.ts +0 -24
- package/dist/packages/connect/src/components/template/TemplateInput.vue.d.ts +0 -54
- package/dist/packages/connect/src/components/tier/TierCard.vue.d.ts +0 -39
- package/dist/packages/connect/src/components/transactions/CollectionTransactions.vue.d.ts +0 -10
- package/dist/packages/connect/src/components/transactions/MemberTransactions.vue.d.ts +0 -2
- package/dist/packages/connect/src/composables/export.d.ts +0 -11
- package/dist/packages/connect/src/composables/index.d.ts +0 -2
- package/dist/packages/connect/src/composables/loading.d.ts +0 -19
- package/dist/packages/connect/src/composables/template.d.ts +0 -7
- package/dist/packages/connect/src/composables/usePagination.d.ts +0 -32
- package/dist/packages/connect/src/export/base.export.d.ts +0 -7
- package/dist/packages/connect/src/export/card.export.d.ts +0 -9
- package/dist/packages/connect/src/export/collection-transaction.export.d.ts +0 -14
- package/dist/packages/connect/src/export/collection.export.d.ts +0 -9
- package/dist/packages/connect/src/export/index.d.ts +0 -11
- package/dist/packages/connect/src/export/member.export.d.ts +0 -33
- package/dist/packages/connect/src/export/store-transaction.export.d.ts +0 -14
- package/dist/packages/connect/src/helpers/campaign.d.ts +0 -94
- package/dist/packages/connect/src/helpers/collectible.d.ts +0 -58
- package/dist/packages/connect/src/helpers/common.d.ts +0 -1
- package/dist/packages/connect/src/helpers/country.d.ts +0 -21
- package/dist/packages/connect/src/helpers/currency.d.ts +0 -2
- package/dist/packages/connect/src/helpers/effect.d.ts +0 -7
- package/dist/packages/connect/src/helpers/message.d.ts +0 -32
- package/dist/packages/connect/src/helpers/number.d.ts +0 -3
- package/dist/packages/connect/src/helpers/qr.d.ts +0 -7
- package/dist/packages/connect/src/helpers/rrule.d.ts +0 -26
- package/dist/packages/connect/src/helpers/rule.d.ts +0 -91
- package/dist/packages/connect/src/helpers/string.d.ts +0 -16
- package/dist/packages/connect/src/helpers/tax.d.ts +0 -74
- package/dist/packages/connect/src/helpers/trigger.d.ts +0 -59
- package/dist/packages/connect/src/helpers/user.d.ts +0 -6
- package/dist/packages/connect/src/helpers/zod.d.ts +0 -27
- package/dist/packages/connect/src/layouts/MainLayout.vue.d.ts +0 -2
- package/dist/packages/connect/src/main.d.ts +0 -2
- package/dist/packages/connect/src/router/index.d.ts +0 -5
- package/dist/packages/connect/src/router/name.d.ts +0 -2
- package/dist/packages/connect/src/router/shared.d.ts +0 -11
- package/dist/packages/connect/src/sheets/analytic/AnalyticSheet.vue.d.ts +0 -12
- package/dist/packages/connect/src/sheets/campaign/EditCampaignSheet.vue.d.ts +0 -11
- package/dist/packages/connect/src/sheets/campaign/SendVoucherSheet.vue.d.ts +0 -13
- package/dist/packages/connect/src/sheets/card/CardDesignSheet.vue.d.ts +0 -9
- package/dist/packages/connect/src/sheets/card/CreateCardSheet.vue.d.ts +0 -11
- package/dist/packages/connect/src/sheets/collectible/EditRewardSheet.vue.d.ts +0 -15
- package/dist/packages/connect/src/sheets/collectible/EditTitleSheet.vue.d.ts +0 -15
- package/dist/packages/connect/src/sheets/collection/CreateCollectionSheet.vue.d.ts +0 -9
- package/dist/packages/connect/src/sheets/effect/EffectSheet.vue.d.ts +0 -135
- package/dist/packages/connect/src/sheets/member/MemberDetailSheet.vue.d.ts +0 -22
- package/dist/packages/connect/src/sheets/store/StoreSettingSheet.vue.d.ts +0 -80
- package/dist/packages/connect/src/types/index.d.ts +0 -4
- package/dist/packages/connect/src/views/Analytic.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Marketing.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Setting.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/Transaction.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Broadcast.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Promotion.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/campaign/Voucher.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Card.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Member.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/loyalty/Segment.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Credit.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Experience.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Game.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Point.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Tier.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/program/Title.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/store/Store.vue.d.ts +0 -2
- package/dist/packages/connect/src/views/store/StoreRewards.vue.d.ts +0 -2
|
@@ -0,0 +1,2600 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
|
|
2
|
+
import { _ } from "./lodash-BMQ4xbjY.js";
|
|
3
|
+
import { d as core, J as JsonViewer, z, a as useBusinessStore, S as SvcConfig } from "./app-BvizV9z5.js";
|
|
4
|
+
import { Z as ZodHelper, _ as _sfc_main$s } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
|
|
5
|
+
import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-CkH5Zama.js";
|
|
6
|
+
import { u as useMembershipStore, C as CollectibleOptions } from "./membership-D3I4udu3.js";
|
|
7
|
+
import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-BLWw_MlC.js";
|
|
8
|
+
import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-Di3qiIBb.js";
|
|
9
|
+
import { h as hooks } from "./moment-BWErdI6_.js";
|
|
10
|
+
import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-7uOMMdXt.js";
|
|
11
|
+
import { _ as _sfc_main$t } from "./ImageInput.vue_vue_type_script_setup_true_lang-DpYjrT3G.js";
|
|
12
|
+
import { _ as _sfc_main$u, a as _sfc_main$v, b as _sfc_main$x } from "./EffectSheet.vue_vue_type_style_index_0_lang-admNNBWu.js";
|
|
13
|
+
import { _ as _sfc_main$w } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-C771jjYx.js";
|
|
14
|
+
import { _ as _sfc_main$q, a as _sfc_main$r } from "./RuleGroup.vue_vue_type_script_setup_true_lang-1L68zx5t.js";
|
|
15
|
+
import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-C1IzY-n2.js";
|
|
16
|
+
import { _ as _sfc_main$p, T as TEMPLATES } from "./index-B5gJ6P15.js";
|
|
17
|
+
import { _ as _sfc_main$y } from "./MessageInput.vue_vue_type_script_setup_true_lang-BvAFOoym.js";
|
|
18
|
+
import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-CvlhLEGy.js";
|
|
19
|
+
import "./index-DMyaEjMn.js";
|
|
20
|
+
import "./index-Ccn7PGoB.js";
|
|
21
|
+
import "./index-CjZxaXvZ.js";
|
|
22
|
+
import "./index-8nrxC9d5.js";
|
|
23
|
+
import { useCoreStore } from "@feedmepos/mf-common";
|
|
24
|
+
import { i as initCollectibleConfig } from "./helper-CiIZ1pUo.js";
|
|
25
|
+
import { C as CollectionUtils } from "./collection.fn-DHlfGYAC.js";
|
|
26
|
+
import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
|
|
27
|
+
import { useDialog } from "@feedmepos/ui-library";
|
|
28
|
+
import { a as cleanPF } from "./object-qECH92oz.js";
|
|
29
|
+
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
30
|
+
__name: "SegmentConfigurator",
|
|
31
|
+
props: {
|
|
32
|
+
modelValue: {
|
|
33
|
+
type: Object,
|
|
34
|
+
required: !0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
emits: ["update:model-value"],
|
|
38
|
+
setup(e, { emit: i }) {
|
|
39
|
+
const a = e, r = computed(() => {
|
|
40
|
+
var t;
|
|
41
|
+
const [u] = isRuleGroup(a.modelValue) ? Object.values(((t = a.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
|
|
42
|
+
return (u ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
|
|
43
|
+
}), n = i;
|
|
44
|
+
return (u, l) => (openBlock(), createBlock(_sfc_main$p, {
|
|
45
|
+
multiselect: !0,
|
|
46
|
+
items: unref(useMembershipStore)().segmentOptions,
|
|
47
|
+
"model-value": unref(r),
|
|
48
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => n(
|
|
49
|
+
"update:model-value",
|
|
50
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
51
|
+
unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
52
|
+
unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
|
|
53
|
+
)
|
|
54
|
+
)),
|
|
55
|
+
label: "Select segment(s) to match"
|
|
56
|
+
}, null, 8, ["items", "model-value"]));
|
|
57
|
+
}
|
|
58
|
+
}), _hoisted_1$j = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
59
|
+
__name: "UserRuleGroup",
|
|
60
|
+
props: {
|
|
61
|
+
modelValue: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: () => {
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
emits: ["update:model-value"],
|
|
68
|
+
setup(e, { emit: i }) {
|
|
69
|
+
const a = e, r = i, n = ref(
|
|
70
|
+
a.modelValue ? RuleBuilder.getRules(a.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(a.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
|
|
71
|
+
), u = [
|
|
72
|
+
{
|
|
73
|
+
value: "all_users",
|
|
74
|
+
label: "All audience"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
value: "segment",
|
|
78
|
+
label: "Member segment"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
value: "custom",
|
|
82
|
+
label: "Custom audience"
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
return watch(n, async (l, t) => {
|
|
86
|
+
var o;
|
|
87
|
+
if (t != "all_users" && t != l && RuleBuilder.getRules(
|
|
88
|
+
(o = a.modelValue) == null ? void 0 : o.rules[t == "custom" ? "g_user" : "g_segment"]
|
|
89
|
+
).length > 0) {
|
|
90
|
+
const f = await prompt.confirm(
|
|
91
|
+
"Are you sure you want to change the audience type? This will remove all the rules you have set."
|
|
92
|
+
);
|
|
93
|
+
f && r(
|
|
94
|
+
"update:model-value",
|
|
95
|
+
RuleBuilder.setRuleToGroup(
|
|
96
|
+
a.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
97
|
+
RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
|
|
98
|
+
)
|
|
99
|
+
), n.value = f ? l : t;
|
|
100
|
+
}
|
|
101
|
+
}), (l, t) => {
|
|
102
|
+
var f, y;
|
|
103
|
+
const o = resolveComponent("FmRadio");
|
|
104
|
+
return openBlock(), createElementBlock("div", _hoisted_1$j, [
|
|
105
|
+
createElementVNode("div", null, [
|
|
106
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(u, (m) => createVNode(o, {
|
|
107
|
+
key: m.value,
|
|
108
|
+
value: m.value,
|
|
109
|
+
label: m.label,
|
|
110
|
+
modelValue: unref(n),
|
|
111
|
+
"onUpdate:modelValue": t[0] || (t[0] = (v) => isRef(n) ? n.value = v : null)
|
|
112
|
+
}, null, 8, ["value", "label", "modelValue"])), 64))
|
|
113
|
+
]),
|
|
114
|
+
unref(n) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
|
|
115
|
+
createVNode(_sfc_main$o, {
|
|
116
|
+
modelValue: ((f = e.modelValue) == null ? void 0 : f.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
|
|
117
|
+
"onUpdate:modelValue": t[1] || (t[1] = (m) => r(
|
|
118
|
+
"update:model-value",
|
|
119
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
120
|
+
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
121
|
+
m,
|
|
122
|
+
"&&"
|
|
123
|
+
)
|
|
124
|
+
))
|
|
125
|
+
}, null, 8, ["modelValue"])
|
|
126
|
+
])) : createCommentVNode("", !0),
|
|
127
|
+
unref(n) == "custom" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
128
|
+
key: 1,
|
|
129
|
+
"include-only": "user",
|
|
130
|
+
"trigger-type": "MEMBERSHIP_JOINED",
|
|
131
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
|
|
132
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
133
|
+
"update:model-value",
|
|
134
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
135
|
+
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
136
|
+
m,
|
|
137
|
+
"&&"
|
|
138
|
+
)
|
|
139
|
+
))
|
|
140
|
+
}, null, 8, ["model-value"])) : createCommentVNode("", !0)
|
|
141
|
+
]);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}), _hoisted_1$i = { class: "space-y-24" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
145
|
+
__name: "TimeRuleGroup",
|
|
146
|
+
props: {
|
|
147
|
+
modelValue: {
|
|
148
|
+
type: Object,
|
|
149
|
+
default: () => {
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
emits: ["update:model-value"],
|
|
154
|
+
setup(e, { emit: i }) {
|
|
155
|
+
const a = e, r = i, n = ref(
|
|
156
|
+
!a.modelValue || !a.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(a.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
|
|
157
|
+
);
|
|
158
|
+
watch(n, async (l, t) => {
|
|
159
|
+
var o;
|
|
160
|
+
if (t == "custom" && l == "all_time" && RuleBuilder.getRules((o = a.modelValue) == null ? void 0 : o.rules.g_time).length > 0) {
|
|
161
|
+
const f = await prompt.confirm(
|
|
162
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
163
|
+
);
|
|
164
|
+
f && r(
|
|
165
|
+
"update:model-value",
|
|
166
|
+
RuleBuilder.setRuleToGroup(
|
|
167
|
+
a.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
168
|
+
RuleBuilder.scaffoldGroup("g_time")
|
|
169
|
+
)
|
|
170
|
+
), n.value = f ? l : t;
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
async function u(l) {
|
|
174
|
+
var t;
|
|
175
|
+
if (l == "custom" && RuleBuilder.getRules((t = a.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
|
|
176
|
+
if (!await prompt.confirm(
|
|
177
|
+
"Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
|
|
178
|
+
)) {
|
|
179
|
+
n.value = "all_time";
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
r(
|
|
183
|
+
"update:model-value",
|
|
184
|
+
RuleBuilder.setRuleToGroup(
|
|
185
|
+
a.modelValue ?? RuleBuilder.scaffoldGroup(),
|
|
186
|
+
RuleBuilder.scaffoldGroup("g_time")
|
|
187
|
+
)
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return (l, t) => {
|
|
192
|
+
var y;
|
|
193
|
+
const o = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
|
|
194
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
195
|
+
createVNode(f, {
|
|
196
|
+
modelValue: unref(n),
|
|
197
|
+
"onUpdate:modelValue": [
|
|
198
|
+
t[0] || (t[0] = (m) => isRef(n) ? n.value = m : null),
|
|
199
|
+
t[1] || (t[1] = (m) => u(m))
|
|
200
|
+
]
|
|
201
|
+
}, {
|
|
202
|
+
default: withCtx(() => [
|
|
203
|
+
createVNode(o, {
|
|
204
|
+
label: "All time",
|
|
205
|
+
value: "all_time"
|
|
206
|
+
}),
|
|
207
|
+
createVNode(o, {
|
|
208
|
+
label: "Custom date/time",
|
|
209
|
+
value: "custom"
|
|
210
|
+
})
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}, 8, ["modelValue"]),
|
|
214
|
+
unref(n) == "custom" ? (openBlock(), createBlock(_sfc_main$q, {
|
|
215
|
+
key: 0,
|
|
216
|
+
class: "!mt-[0px]",
|
|
217
|
+
"include-only": "trigger",
|
|
218
|
+
"trigger-type": "SCHEDULE",
|
|
219
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
|
|
220
|
+
"onUpdate:modelValue": t[2] || (t[2] = (m) => r(
|
|
221
|
+
"update:model-value",
|
|
222
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
223
|
+
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
224
|
+
m,
|
|
225
|
+
"&&"
|
|
226
|
+
)
|
|
227
|
+
))
|
|
228
|
+
}, null, 8, ["model-value"])) : createCommentVNode("", !0)
|
|
229
|
+
]);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}), _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
233
|
+
__name: "BillRuleGroup",
|
|
234
|
+
props: {
|
|
235
|
+
modelValue: {
|
|
236
|
+
type: Object,
|
|
237
|
+
default: () => {
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
emits: ["update:model-value"],
|
|
242
|
+
setup(e, { emit: i }) {
|
|
243
|
+
const a = i;
|
|
244
|
+
return (r, n) => {
|
|
245
|
+
var u;
|
|
246
|
+
return openBlock(), createBlock(_sfc_main$q, {
|
|
247
|
+
"include-only": "bill",
|
|
248
|
+
"trigger-type": "BILL_COMPLETED",
|
|
249
|
+
"model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
|
|
250
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => a(
|
|
251
|
+
"update:model-value",
|
|
252
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
253
|
+
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
254
|
+
l,
|
|
255
|
+
"&&"
|
|
256
|
+
)
|
|
257
|
+
))
|
|
258
|
+
}, null, 8, ["model-value"]);
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}), _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
262
|
+
__name: "BirthdayInput",
|
|
263
|
+
props: {
|
|
264
|
+
modelValue: {
|
|
265
|
+
type: Object
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
emits: ["update:model-value"],
|
|
269
|
+
setup(e, { emit: i }) {
|
|
270
|
+
const a = e, r = i, n = computed(() => {
|
|
271
|
+
const { property: u, operator: l, equator: t } = RuleBuilder.simplify(
|
|
272
|
+
a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
|
|
273
|
+
op: "before",
|
|
274
|
+
x: 1
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
return {
|
|
278
|
+
property: u,
|
|
279
|
+
operator: l,
|
|
280
|
+
equator: t
|
|
281
|
+
};
|
|
282
|
+
});
|
|
283
|
+
return (u, l) => {
|
|
284
|
+
const t = resolveComponent("FmRadio"), o = resolveComponent("FmStepperField");
|
|
285
|
+
return openBlock(), createElementBlock("div", null, [
|
|
286
|
+
createVNode(t, {
|
|
287
|
+
label: "On birthday",
|
|
288
|
+
value: "_isRange-day",
|
|
289
|
+
"model-value": `${unref(n).operator}-${unref(n).equator.unit}`,
|
|
290
|
+
"onUpdate:modelValue": l[0] || (l[0] = () => {
|
|
291
|
+
r(
|
|
292
|
+
"update:model-value",
|
|
293
|
+
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
294
|
+
op: "this",
|
|
295
|
+
unit: "day",
|
|
296
|
+
ignoreYear: !0
|
|
297
|
+
})
|
|
298
|
+
);
|
|
299
|
+
})
|
|
300
|
+
}, null, 8, ["model-value"]),
|
|
301
|
+
createVNode(t, {
|
|
302
|
+
label: "N days before birthday",
|
|
303
|
+
value: "_isDay",
|
|
304
|
+
"model-value": unref(n).operator,
|
|
305
|
+
"onUpdate:modelValue": l[1] || (l[1] = () => {
|
|
306
|
+
r(
|
|
307
|
+
"update:model-value",
|
|
308
|
+
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
309
|
+
op: "after",
|
|
310
|
+
x: 1,
|
|
311
|
+
ignoreYear: !0
|
|
312
|
+
})
|
|
313
|
+
);
|
|
314
|
+
})
|
|
315
|
+
}, null, 8, ["model-value"]),
|
|
316
|
+
unref(n).operator == "_isDay" ? (openBlock(), createBlock(o, {
|
|
317
|
+
key: 0,
|
|
318
|
+
label: "Days before birthday",
|
|
319
|
+
"show-steppers": !1,
|
|
320
|
+
"model-value": unref(n).equator.x,
|
|
321
|
+
"onUpdate:modelValue": l[2] || (l[2] = (f) => r(
|
|
322
|
+
"update:model-value",
|
|
323
|
+
unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
|
|
324
|
+
op: "after",
|
|
325
|
+
x: f,
|
|
326
|
+
ignoreYear: !0
|
|
327
|
+
})
|
|
328
|
+
))
|
|
329
|
+
}, null, 8, ["model-value"])) : createCommentVNode("", !0),
|
|
330
|
+
createVNode(t, {
|
|
331
|
+
label: "In birthday week",
|
|
332
|
+
value: "_isRange-week",
|
|
333
|
+
"model-value": `${unref(n).operator}-${unref(n).equator.unit}`,
|
|
334
|
+
"onUpdate:modelValue": l[3] || (l[3] = () => {
|
|
335
|
+
r(
|
|
336
|
+
"update:model-value",
|
|
337
|
+
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
338
|
+
op: "this",
|
|
339
|
+
unit: "week",
|
|
340
|
+
ignoreYear: !0
|
|
341
|
+
})
|
|
342
|
+
);
|
|
343
|
+
})
|
|
344
|
+
}, null, 8, ["model-value"]),
|
|
345
|
+
createVNode(t, {
|
|
346
|
+
label: "In birthday month",
|
|
347
|
+
value: "_isRange-month",
|
|
348
|
+
"model-value": `${unref(n).operator}-${unref(n).equator.unit}`,
|
|
349
|
+
"onUpdate:modelValue": l[4] || (l[4] = () => {
|
|
350
|
+
r(
|
|
351
|
+
"update:model-value",
|
|
352
|
+
unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
|
|
353
|
+
op: "this",
|
|
354
|
+
unit: "month",
|
|
355
|
+
ignoreYear: !0
|
|
356
|
+
})
|
|
357
|
+
);
|
|
358
|
+
})
|
|
359
|
+
}, null, 8, ["model-value"])
|
|
360
|
+
]);
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
}), _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
364
|
+
__name: "FeedbackRuleGroup",
|
|
365
|
+
props: {
|
|
366
|
+
modelValue: {
|
|
367
|
+
type: Object,
|
|
368
|
+
default: () => {
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
emits: ["update:model-value"],
|
|
373
|
+
setup(e, { emit: i }) {
|
|
374
|
+
const a = i;
|
|
375
|
+
return (r, n) => {
|
|
376
|
+
var u;
|
|
377
|
+
return openBlock(), createBlock(_sfc_main$q, {
|
|
378
|
+
"include-only": "feedback",
|
|
379
|
+
"trigger-type": "FEEDBACK",
|
|
380
|
+
"model-value": ((u = e.modelValue) == null ? void 0 : u.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
|
|
381
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => a(
|
|
382
|
+
"update:model-value",
|
|
383
|
+
unref(RuleBuilder).setRuleToGroup(
|
|
384
|
+
e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
|
|
385
|
+
l,
|
|
386
|
+
"&&"
|
|
387
|
+
)
|
|
388
|
+
))
|
|
389
|
+
}, null, 8, ["model-value"]);
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
}), TriggerOptions = {
|
|
393
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED]: {
|
|
394
|
+
name: "Bill complete",
|
|
395
|
+
description: "Reward customers upon the completion of their bill.",
|
|
396
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.BILL_COMPLETED,
|
|
397
|
+
hidden: !1
|
|
398
|
+
},
|
|
399
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK]: {
|
|
400
|
+
name: "Feedback",
|
|
401
|
+
description: "Reward customers for providing feedback.",
|
|
402
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.FEEDBACK,
|
|
403
|
+
hidden: !1
|
|
404
|
+
},
|
|
405
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED]: {
|
|
406
|
+
name: "Game complete",
|
|
407
|
+
description: "Reward customers upon the completion of a game.",
|
|
408
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.GAME_COMPLETED,
|
|
409
|
+
hidden: !1
|
|
410
|
+
},
|
|
411
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER]: {
|
|
412
|
+
name: "Making order",
|
|
413
|
+
description: "Reward customers upon the creation of their order.",
|
|
414
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MAKING_ORDER,
|
|
415
|
+
hidden: !1
|
|
416
|
+
},
|
|
417
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED]: {
|
|
418
|
+
name: "Member joined ",
|
|
419
|
+
description: "Trigger rewards when customers join your membership program.",
|
|
420
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.MEMBERSHIP_JOINED,
|
|
421
|
+
hidden: !1
|
|
422
|
+
},
|
|
423
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE]: {
|
|
424
|
+
name: "Schedule",
|
|
425
|
+
description: "Set rewards to be triggered at specific times or dates.",
|
|
426
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SCHEDULE,
|
|
427
|
+
hidden: !1
|
|
428
|
+
},
|
|
429
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM]: {
|
|
430
|
+
name: "Simple claim",
|
|
431
|
+
description: "Activate rewards when customers claim an offer",
|
|
432
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.SIMPLE_CLAIM,
|
|
433
|
+
hidden: !1
|
|
434
|
+
},
|
|
435
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED]: {
|
|
436
|
+
name: "Tier upgrade",
|
|
437
|
+
description: "Activate rewards when their membership tier gets upgraded.",
|
|
438
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.TIER_UPGRADED,
|
|
439
|
+
hidden: !1
|
|
440
|
+
},
|
|
441
|
+
[F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD]: {
|
|
442
|
+
name: "Issue reward",
|
|
443
|
+
description: "Triggers whenever customer receives a reward in any kind.",
|
|
444
|
+
value: F_CAMPAIGN_TRIGGER_TYPE.enum.ISSUE_REWARD,
|
|
445
|
+
hidden: !0
|
|
446
|
+
}
|
|
447
|
+
}, TypeToTriggerOptions = Object.fromEntries(
|
|
448
|
+
[
|
|
449
|
+
"VOUCHER",
|
|
450
|
+
"PROMOTION",
|
|
451
|
+
"POINT",
|
|
452
|
+
"CREDIT",
|
|
453
|
+
"MEMBERSHIP",
|
|
454
|
+
"BROADCAST",
|
|
455
|
+
"COIN",
|
|
456
|
+
"REWARD_POOL",
|
|
457
|
+
"GAME",
|
|
458
|
+
"MISSION"
|
|
459
|
+
].map((e) => {
|
|
460
|
+
const i = CAMPAIGN_TRIGGER[e];
|
|
461
|
+
return [
|
|
462
|
+
e,
|
|
463
|
+
(i == null ? void 0 : i.map((a) => TriggerOptions[a]).filter((a) => !a.hidden)) ?? []
|
|
464
|
+
];
|
|
465
|
+
})
|
|
466
|
+
), _hoisted_1$h = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
467
|
+
__name: "CampaignTriggerInput",
|
|
468
|
+
props: {
|
|
469
|
+
campaignType: {
|
|
470
|
+
type: String,
|
|
471
|
+
required: !0
|
|
472
|
+
},
|
|
473
|
+
modelValue: {
|
|
474
|
+
type: String
|
|
475
|
+
},
|
|
476
|
+
disabled: {
|
|
477
|
+
type: Boolean,
|
|
478
|
+
default: !1
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
emits: ["update:model-value"],
|
|
482
|
+
setup(e, { emit: i }) {
|
|
483
|
+
const a = e, r = i, n = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
|
|
484
|
+
(u) => u.value == a.modelValue
|
|
485
|
+
) : TypeToTriggerOptions[a.campaignType]);
|
|
486
|
+
return (u, l) => {
|
|
487
|
+
const t = resolveComponent("FmCard");
|
|
488
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
489
|
+
_hoisted_2$g,
|
|
490
|
+
createElementVNode("div", _hoisted_3$e, [
|
|
491
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (o) => (openBlock(), createBlock(t, {
|
|
492
|
+
variant: "outlined",
|
|
493
|
+
disabled: a.disabled,
|
|
494
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
495
|
+
"col-span-3": unref(n).length == 1,
|
|
496
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == o.value,
|
|
497
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != o.value
|
|
498
|
+
}]),
|
|
499
|
+
onClick: () => {
|
|
500
|
+
a.modelValue != o.value && !a.disabled && r("update:model-value", o.value);
|
|
501
|
+
},
|
|
502
|
+
key: o.name
|
|
503
|
+
}, {
|
|
504
|
+
default: withCtx(() => [
|
|
505
|
+
createElementVNode("div", _hoisted_4$d, toDisplayString(o.name), 1),
|
|
506
|
+
createElementVNode("div", _hoisted_5$8, toDisplayString(o.description), 1)
|
|
507
|
+
]),
|
|
508
|
+
_: 2
|
|
509
|
+
}, 1032, ["disabled", "class", "onClick"]))), 128))
|
|
510
|
+
])
|
|
511
|
+
]);
|
|
512
|
+
};
|
|
513
|
+
}
|
|
514
|
+
}), _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
515
|
+
__name: "DateInput",
|
|
516
|
+
props: {
|
|
517
|
+
label: {
|
|
518
|
+
type: String,
|
|
519
|
+
required: !1
|
|
520
|
+
},
|
|
521
|
+
modelValue: {
|
|
522
|
+
type: Object,
|
|
523
|
+
required: !1
|
|
524
|
+
}
|
|
525
|
+
},
|
|
526
|
+
emits: ["update:model-value"],
|
|
527
|
+
setup(e, { emit: i }) {
|
|
528
|
+
const a = i;
|
|
529
|
+
return (r, n) => {
|
|
530
|
+
const u = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
|
|
531
|
+
return openBlock(), createBlock(t, {
|
|
532
|
+
label: e.label,
|
|
533
|
+
"model-value": e.modelValue || "",
|
|
534
|
+
"onUpdate:modelValue": n[1] || (n[1] = (o) => a("update:model-value", o))
|
|
535
|
+
}, {
|
|
536
|
+
"trigger-button": withCtx(({ opened: o }) => [
|
|
537
|
+
createVNode(l, {
|
|
538
|
+
class: "flex items-center",
|
|
539
|
+
"prepend-icon": "calendar_month",
|
|
540
|
+
"icon-outlined": !o
|
|
541
|
+
}, {
|
|
542
|
+
append: withCtx(() => [
|
|
543
|
+
e.modelValue ? (openBlock(), createBlock(u, {
|
|
544
|
+
key: 0,
|
|
545
|
+
variant: "tertiary",
|
|
546
|
+
icon: "clear",
|
|
547
|
+
onClick: n[0] || (n[0] = (f) => (f.stopPropagation(), a("update:model-value", null)))
|
|
548
|
+
})) : createCommentVNode("", !0)
|
|
549
|
+
]),
|
|
550
|
+
default: withCtx(() => [
|
|
551
|
+
createElementVNode("div", {
|
|
552
|
+
class: normalizeClass(["fm-typo-en-body-lg-400", { "text-fm-color-typo-secondary": !e.modelValue }])
|
|
553
|
+
}, toDisplayString(e.modelValue ? unref(hooks)(e.modelValue).format("DD MMM YYYY") : "DD MM YYYY"), 3)
|
|
554
|
+
]),
|
|
555
|
+
_: 2
|
|
556
|
+
}, 1032, ["icon-outlined"])
|
|
557
|
+
]),
|
|
558
|
+
_: 1
|
|
559
|
+
}, 8, ["label", "model-value"]);
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
}), _hoisted_1$g = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
563
|
+
__name: "DateRangeInput",
|
|
564
|
+
props: {
|
|
565
|
+
modelValue: {
|
|
566
|
+
type: Object,
|
|
567
|
+
required: !1
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
emits: ["update:model-value"],
|
|
571
|
+
setup(e, { emit: i }) {
|
|
572
|
+
const a = i;
|
|
573
|
+
return (r, n) => {
|
|
574
|
+
var u, l;
|
|
575
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
576
|
+
createElementVNode("div", _hoisted_2$f, [
|
|
577
|
+
createVNode(_sfc_main$h, {
|
|
578
|
+
"model-value": ((u = e.modelValue) == null ? void 0 : u.startDate) ?? null,
|
|
579
|
+
label: "Start date",
|
|
580
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => {
|
|
581
|
+
var o;
|
|
582
|
+
return a("update:model-value", {
|
|
583
|
+
startDate: t,
|
|
584
|
+
endDate: ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null
|
|
585
|
+
});
|
|
586
|
+
})
|
|
587
|
+
}, null, 8, ["model-value"])
|
|
588
|
+
]),
|
|
589
|
+
_hoisted_3$d,
|
|
590
|
+
createElementVNode("div", _hoisted_4$c, [
|
|
591
|
+
createVNode(_sfc_main$h, {
|
|
592
|
+
"model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
|
|
593
|
+
label: "End date",
|
|
594
|
+
"onUpdate:modelValue": n[1] || (n[1] = (t) => {
|
|
595
|
+
var o;
|
|
596
|
+
return a("update:model-value", {
|
|
597
|
+
startDate: ((o = e.modelValue) == null ? void 0 : o.startDate) ?? null,
|
|
598
|
+
endDate: t
|
|
599
|
+
});
|
|
600
|
+
})
|
|
601
|
+
}, null, 8, ["model-value"])
|
|
602
|
+
])
|
|
603
|
+
]);
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
}), _hoisted_1$f = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
|
|
607
|
+
key: 0,
|
|
608
|
+
class: "space-y-4"
|
|
609
|
+
}, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
610
|
+
__name: "ScheduleRuleInput",
|
|
611
|
+
props: {
|
|
612
|
+
modelValue: {
|
|
613
|
+
type: Object,
|
|
614
|
+
required: !0
|
|
615
|
+
},
|
|
616
|
+
startDate: {
|
|
617
|
+
type: String
|
|
618
|
+
},
|
|
619
|
+
endDate: {
|
|
620
|
+
type: String
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
emits: ["update:model-value"],
|
|
624
|
+
setup(e, { emit: i }) {
|
|
625
|
+
const a = e, r = i;
|
|
626
|
+
function n() {
|
|
627
|
+
const m = RuleBuilder.getRules(a.modelValue);
|
|
628
|
+
return m.length == 0 ? "fixed" : m.some(
|
|
629
|
+
(v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
|
|
630
|
+
) ? "repeating" : "fixed";
|
|
631
|
+
}
|
|
632
|
+
const u = ref(n()), l = ref(!1), t = computed(() => {
|
|
633
|
+
const m = RuleBuilder.getRules(a.modelValue), v = m.find(
|
|
634
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
|
|
635
|
+
), g = m.find(
|
|
636
|
+
(d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
|
|
637
|
+
);
|
|
638
|
+
return {
|
|
639
|
+
date: v ? RuleBuilder.simplify(v).equator : null,
|
|
640
|
+
time: g ? RuleBuilder.simplify(g).equator : null
|
|
641
|
+
};
|
|
642
|
+
}), o = computed(
|
|
643
|
+
() => calculateNextScheduleAt(
|
|
644
|
+
a.modelValue,
|
|
645
|
+
/* @__PURE__ */ new Date(),
|
|
646
|
+
a.startDate ? new Date(a.startDate) : void 0,
|
|
647
|
+
a.endDate ? new Date(a.endDate) : void 0
|
|
648
|
+
)
|
|
649
|
+
);
|
|
650
|
+
function f(m) {
|
|
651
|
+
const v = m.label.toLowerCase(), g = v == "fixed" ? [
|
|
652
|
+
RuleBuilder.constructEntry(
|
|
653
|
+
"trigger.date",
|
|
654
|
+
"_isOnDate",
|
|
655
|
+
(/* @__PURE__ */ new Date()).toISOString()
|
|
656
|
+
),
|
|
657
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
658
|
+
] : [
|
|
659
|
+
RuleBuilder.constructEntry(
|
|
660
|
+
"trigger.date",
|
|
661
|
+
"_rrule",
|
|
662
|
+
"RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
|
|
663
|
+
),
|
|
664
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
665
|
+
];
|
|
666
|
+
r(
|
|
667
|
+
"update:model-value",
|
|
668
|
+
RuleBuilder.setRuleToGroup(
|
|
669
|
+
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
670
|
+
g
|
|
671
|
+
)
|
|
672
|
+
), u.value = v;
|
|
673
|
+
}
|
|
674
|
+
function y(m) {
|
|
675
|
+
u.value == "fixed" ? r(
|
|
676
|
+
"update:model-value",
|
|
677
|
+
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
678
|
+
RuleBuilder.constructEntry(
|
|
679
|
+
"trigger.date",
|
|
680
|
+
"_isOnDate",
|
|
681
|
+
m.date
|
|
682
|
+
),
|
|
683
|
+
RuleBuilder.constructEntry(
|
|
684
|
+
"trigger.time",
|
|
685
|
+
"_isOnTime",
|
|
686
|
+
m.time
|
|
687
|
+
)
|
|
688
|
+
])
|
|
689
|
+
) : r(
|
|
690
|
+
"update:model-value",
|
|
691
|
+
RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
|
|
692
|
+
RuleBuilder.constructEntry(
|
|
693
|
+
"trigger.date",
|
|
694
|
+
"_rrule",
|
|
695
|
+
m.date
|
|
696
|
+
),
|
|
697
|
+
RuleBuilder.constructEntry(
|
|
698
|
+
"trigger.time",
|
|
699
|
+
"_isOnTime",
|
|
700
|
+
m.time
|
|
701
|
+
)
|
|
702
|
+
])
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
return (m, v) => {
|
|
706
|
+
const g = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), s = resolveComponent("FmIcon"), c = resolveComponent("FmTooltip"), p = resolveComponent("FmField"), b = resolveComponent("FmCard"), k = resolveComponent("FmPopover"), V = resolveComponent("FmDatePicker"), B = resolveComponent("FmHelperText");
|
|
707
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
708
|
+
createVNode(g, {
|
|
709
|
+
items: [{ label: "Fixed" }, { label: "Repeating" }],
|
|
710
|
+
"model-value": { label: unref(cases).title(unref(u)) },
|
|
711
|
+
"onUpdate:modelValue": f,
|
|
712
|
+
class: "mb-8"
|
|
713
|
+
}, null, 8, ["model-value"]),
|
|
714
|
+
createElementVNode("div", _hoisted_1$f, [
|
|
715
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
716
|
+
createVNode(d, {
|
|
717
|
+
label: "Notify time",
|
|
718
|
+
"model-value": unref(t).time,
|
|
719
|
+
"onUpdate:modelValue": v[0] || (v[0] = (C) => y({ date: unref(t).date, time: C })),
|
|
720
|
+
"helper-text": unref(t).time ? void 0 : "Time is required",
|
|
721
|
+
"helper-state": unref(t).time ? void 0 : "error"
|
|
722
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"]),
|
|
723
|
+
unref(u) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
|
|
724
|
+
createElementVNode("div", _hoisted_4$b, [
|
|
725
|
+
_hoisted_5$7,
|
|
726
|
+
unref(t).date ? (openBlock(), createBlock(c, {
|
|
727
|
+
key: 0,
|
|
728
|
+
"z-index": 9999,
|
|
729
|
+
content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
|
|
730
|
+
}, {
|
|
731
|
+
default: withCtx(() => [
|
|
732
|
+
createVNode(s, {
|
|
733
|
+
name: "info",
|
|
734
|
+
size: "sm",
|
|
735
|
+
outline: !0
|
|
736
|
+
})
|
|
737
|
+
]),
|
|
738
|
+
_: 1
|
|
739
|
+
}, 8, ["content"])) : createCommentVNode("", !0)
|
|
740
|
+
]),
|
|
741
|
+
createVNode(k, {
|
|
742
|
+
"show-popover": unref(l),
|
|
743
|
+
onPopoverChanged: v[3] || (v[3] = (C) => l.value = C)
|
|
744
|
+
}, {
|
|
745
|
+
"popover-button": withCtx(() => [
|
|
746
|
+
createVNode(p, {
|
|
747
|
+
class: "cursor-pointer",
|
|
748
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
749
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
750
|
+
}, {
|
|
751
|
+
default: withCtx(() => [
|
|
752
|
+
createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
|
|
753
|
+
]),
|
|
754
|
+
_: 1
|
|
755
|
+
}, 8, ["helper-text", "helper-state"])
|
|
756
|
+
]),
|
|
757
|
+
default: withCtx(() => [
|
|
758
|
+
createVNode(b, { class: "elevated p-8 w-[450px]" }, {
|
|
759
|
+
default: withCtx(() => [
|
|
760
|
+
createVNode(_sfc_main$r, {
|
|
761
|
+
"apply-button": !0,
|
|
762
|
+
"model-value": unref(t).date || "",
|
|
763
|
+
onCancel: v[1] || (v[1] = (C) => l.value = !1),
|
|
764
|
+
"onUpdate:modelValue": v[2] || (v[2] = (C) => (y({ date: C, time: unref(t).time }), l.value = !1))
|
|
765
|
+
}, null, 8, ["model-value"])
|
|
766
|
+
]),
|
|
767
|
+
_: 1
|
|
768
|
+
})
|
|
769
|
+
]),
|
|
770
|
+
_: 1
|
|
771
|
+
}, 8, ["show-popover"])
|
|
772
|
+
])) : (openBlock(), createBlock(V, {
|
|
773
|
+
key: 1,
|
|
774
|
+
label: "Notify date",
|
|
775
|
+
"model-value": unref(t).date || "",
|
|
776
|
+
"onUpdate:modelValue": v[4] || (v[4] = (C) => y({ date: C, time: unref(t).time })),
|
|
777
|
+
"helper-text": unref(t).date ? void 0 : "Date is required",
|
|
778
|
+
"helper-state": unref(t).date ? void 0 : "error"
|
|
779
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"]))
|
|
780
|
+
]),
|
|
781
|
+
unref(t).date && unref(t).time && unref(o) ? (openBlock(), createBlock(B, {
|
|
782
|
+
key: 0,
|
|
783
|
+
text: `${unref(hooks)(unref(o)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(o)).format("dddd, DD MMM YYYY")} at
|
|
784
|
+
${unref(hooks)(unref(o)).format("hh:mmA")} (${unref(hooks)(unref(o)).fromNow()})`
|
|
785
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
786
|
+
])
|
|
787
|
+
], 64);
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
}), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "flex items-center gap-16" }, _hoisted_6$3 = {
|
|
791
|
+
key: 0,
|
|
792
|
+
class: "mr-32"
|
|
793
|
+
}, _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", null, "to every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
794
|
+
__name: "EarningOptionInput",
|
|
795
|
+
props: {
|
|
796
|
+
modelValue: {
|
|
797
|
+
type: Object
|
|
798
|
+
},
|
|
799
|
+
extras: {
|
|
800
|
+
type: Object
|
|
801
|
+
},
|
|
802
|
+
fixedType: {
|
|
803
|
+
type: Boolean
|
|
804
|
+
},
|
|
805
|
+
errorText: {
|
|
806
|
+
type: String
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
emits: ["update:model-value"],
|
|
810
|
+
setup(e, { emit: i }) {
|
|
811
|
+
const a = e, r = i, n = [
|
|
812
|
+
{
|
|
813
|
+
label: "Based on spending",
|
|
814
|
+
sublabel: "Customers earn rewards based on how much they spend.",
|
|
815
|
+
value: "PROPORTIONAL"
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
label: "Fixed amount",
|
|
819
|
+
sublabel: "Customers earn a set amount of rewards for specific actions.",
|
|
820
|
+
value: "FIXED"
|
|
821
|
+
}
|
|
822
|
+
].filter((t) => {
|
|
823
|
+
var o;
|
|
824
|
+
return a.fixedType || ((o = a.extras) == null ? void 0 : o.event.type) != "BILL_COMPLETED" ? t.value == "FIXED" : !0;
|
|
825
|
+
}), u = computed(() => {
|
|
826
|
+
const t = FdoEarningOption.safeParse(a.modelValue);
|
|
827
|
+
return t.success ? [] : t.error.errors;
|
|
828
|
+
});
|
|
829
|
+
function l(t) {
|
|
830
|
+
var o;
|
|
831
|
+
t != ((o = a.modelValue) == null ? void 0 : o.type) && r(
|
|
832
|
+
"update:model-value",
|
|
833
|
+
t === "FIXED" ? {
|
|
834
|
+
type: "FIXED",
|
|
835
|
+
amount: 1
|
|
836
|
+
} : {
|
|
837
|
+
type: "PROPORTIONAL",
|
|
838
|
+
amount: 1,
|
|
839
|
+
every: 1
|
|
840
|
+
}
|
|
841
|
+
);
|
|
842
|
+
}
|
|
843
|
+
return (t, o) => {
|
|
844
|
+
var v, g, d;
|
|
845
|
+
const f = resolveComponent("FmCard"), y = resolveComponent("FmStepperField"), m = resolveComponent("FmHelperText");
|
|
846
|
+
return openBlock(), createElementBlock("div", _hoisted_1$e, [
|
|
847
|
+
createElementVNode("div", _hoisted_2$d, [
|
|
848
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (s) => {
|
|
849
|
+
var c, p;
|
|
850
|
+
return openBlock(), createBlock(f, {
|
|
851
|
+
variant: "outlined",
|
|
852
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
|
|
853
|
+
"col-span-2": unref(n).length == 1,
|
|
854
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((c = e.modelValue) == null ? void 0 : c.type) === s.value,
|
|
855
|
+
"hover:bg-fm-color-opacity-sm": ((p = e.modelValue) == null ? void 0 : p.type) != s.value
|
|
856
|
+
}]),
|
|
857
|
+
onClick: (b) => l(s.value),
|
|
858
|
+
key: s.value
|
|
859
|
+
}, {
|
|
860
|
+
default: withCtx(() => [
|
|
861
|
+
createElementVNode("div", _hoisted_3$b, toDisplayString(s.label), 1),
|
|
862
|
+
createElementVNode("div", _hoisted_4$a, toDisplayString(s.sublabel), 1)
|
|
863
|
+
]),
|
|
864
|
+
_: 2
|
|
865
|
+
}, 1032, ["class", "onClick"]);
|
|
866
|
+
}), 128))
|
|
867
|
+
]),
|
|
868
|
+
createElementVNode("div", _hoisted_5$6, [
|
|
869
|
+
createVNode(y, {
|
|
870
|
+
label: "Receive amount",
|
|
871
|
+
class: "flex-1",
|
|
872
|
+
"model-value": ((v = e.modelValue) == null ? void 0 : v.amount) ?? null,
|
|
873
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => r("update:model-value", {
|
|
874
|
+
...e.modelValue ?? { type: "FIXED" },
|
|
875
|
+
amount: s
|
|
876
|
+
}))
|
|
877
|
+
}, {
|
|
878
|
+
append: withCtx(() => {
|
|
879
|
+
var s, c;
|
|
880
|
+
return [
|
|
881
|
+
e.extras && ((c = unref(CollectibleOptions)[(s = e.extras) == null ? void 0 : s.type]) != null && c.name) ? (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString(unref(CollectibleOptions)[e.extras.type].name.toLowerCase()) + "(s) ", 1)) : createCommentVNode("", !0)
|
|
882
|
+
];
|
|
883
|
+
}),
|
|
884
|
+
_: 1
|
|
885
|
+
}, 8, ["model-value"]),
|
|
886
|
+
((g = e.modelValue) == null ? void 0 : g.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
887
|
+
_hoisted_7$3,
|
|
888
|
+
createVNode(y, {
|
|
889
|
+
label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
|
|
890
|
+
class: "flex-1",
|
|
891
|
+
"model-value": ((d = e.modelValue) == null ? void 0 : d.every) ?? null,
|
|
892
|
+
"onUpdate:modelValue": o[1] || (o[1] = (s) => r("update:model-value", { ...e.modelValue, every: s }))
|
|
893
|
+
}, {
|
|
894
|
+
prepend: withCtx(() => [
|
|
895
|
+
createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
|
|
896
|
+
]),
|
|
897
|
+
_: 1
|
|
898
|
+
}, 8, ["label", "model-value"])
|
|
899
|
+
], 64)) : createCommentVNode("", !0)
|
|
900
|
+
]),
|
|
901
|
+
e.errorText || unref(u).length > 0 ? (openBlock(), createBlock(m, {
|
|
902
|
+
key: 0,
|
|
903
|
+
class: "!mt-4",
|
|
904
|
+
text: e.errorText || unref(ZodHelper).helperText(unref(u), ""),
|
|
905
|
+
state: "error"
|
|
906
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
907
|
+
]);
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
}), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
911
|
+
__name: "GameTypeInput",
|
|
912
|
+
props: {
|
|
913
|
+
modelValue: {
|
|
914
|
+
type: String
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
emits: ["update:model-value"],
|
|
918
|
+
setup(e, { emit: i }) {
|
|
919
|
+
const a = e, r = i, n = computed(
|
|
920
|
+
() => [
|
|
921
|
+
{
|
|
922
|
+
label: "Fortune Wheel",
|
|
923
|
+
description: "Allow customers to spin the Fortune Wheel to win various rewards.",
|
|
924
|
+
value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
|
|
925
|
+
hidden: !1
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
label: "Rock paper scissor",
|
|
929
|
+
description: "Customers play a game of Rock Paper Scissors against the cashier.",
|
|
930
|
+
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
|
|
931
|
+
hidden: !0
|
|
932
|
+
}
|
|
933
|
+
].filter((u) => !u.hidden)
|
|
934
|
+
);
|
|
935
|
+
return (u, l) => {
|
|
936
|
+
const t = resolveComponent("FmCard");
|
|
937
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
938
|
+
_hoisted_2$c,
|
|
939
|
+
createElementVNode("div", _hoisted_3$a, [
|
|
940
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (o) => (openBlock(), createBlock(t, {
|
|
941
|
+
variant: "outlined",
|
|
942
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
943
|
+
"col-span-2": unref(n).length == 1,
|
|
944
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == o.value,
|
|
945
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != o.value
|
|
946
|
+
}]),
|
|
947
|
+
onClick: () => {
|
|
948
|
+
a.modelValue != o.value && r("update:model-value", o.value);
|
|
949
|
+
},
|
|
950
|
+
key: o.value
|
|
951
|
+
}, {
|
|
952
|
+
default: withCtx(() => [
|
|
953
|
+
createElementVNode("div", _hoisted_4$9, toDisplayString(o.label), 1),
|
|
954
|
+
createElementVNode("div", _hoisted_5$5, toDisplayString(o.description), 1)
|
|
955
|
+
]),
|
|
956
|
+
_: 2
|
|
957
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
958
|
+
])
|
|
959
|
+
]);
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
}), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
963
|
+
__name: "VoucherEditor",
|
|
964
|
+
props: {
|
|
965
|
+
modelValue: {
|
|
966
|
+
type: Object
|
|
967
|
+
},
|
|
968
|
+
rewardImage: {
|
|
969
|
+
type: Object
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
emits: ["update:model-value", "update:reward-image"],
|
|
973
|
+
setup(e, { emit: i }) {
|
|
974
|
+
const r = ref(
|
|
975
|
+
e.modelValue ?? initCollectibleConfig("VOUCHER", {
|
|
976
|
+
business: useCoreStore().currentBusiness.value._id,
|
|
977
|
+
name: ""
|
|
978
|
+
})
|
|
979
|
+
), n = FdtoCollectibleConfig, u = i;
|
|
980
|
+
return (l, t) => {
|
|
981
|
+
var m, v, g;
|
|
982
|
+
const o = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText"), y = resolveComponent("FmSwitch");
|
|
983
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
984
|
+
createVNode(_sfc_main$s, {
|
|
985
|
+
modelValue: unref(r).name,
|
|
986
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => unref(r).name = d),
|
|
987
|
+
label: "Voucher name",
|
|
988
|
+
schema: unref(ZodHelper).typeAtPath(unref(n), "name", [unref(r).type])
|
|
989
|
+
}, null, 8, ["modelValue", "schema"]),
|
|
990
|
+
createVNode(o, {
|
|
991
|
+
class: "!mb-[-16px]",
|
|
992
|
+
modelValue: unref(r).description,
|
|
993
|
+
"onUpdate:modelValue": t[1] || (t[1] = (d) => unref(r).description = d),
|
|
994
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(n), "description", [unref(r).type])]
|
|
995
|
+
}, {
|
|
996
|
+
label: withCtx(() => [
|
|
997
|
+
(openBlock(), createBlock(resolveDynamicComponent(
|
|
998
|
+
unref(ZodHelper).toInputLabel(
|
|
999
|
+
unref(ZodHelper).typeAtPath(unref(n), "description", [unref(r).type]),
|
|
1000
|
+
"Voucher description"
|
|
1001
|
+
)
|
|
1002
|
+
)))
|
|
1003
|
+
]),
|
|
1004
|
+
_: 1
|
|
1005
|
+
}, 8, ["modelValue", "rules"]),
|
|
1006
|
+
createElementVNode("div", _hoisted_1$c, [
|
|
1007
|
+
_hoisted_2$b,
|
|
1008
|
+
createElementVNode("div", null, toDisplayString(((m = unref(r).description) == null ? void 0 : m.length) ?? 0) + "/200", 1)
|
|
1009
|
+
]),
|
|
1010
|
+
createVNode(_sfc_main$t, {
|
|
1011
|
+
class: "w-1/2 xs:w-2/3",
|
|
1012
|
+
"aspect-ratio": "16/9",
|
|
1013
|
+
file: e.rewardImage ?? void 0,
|
|
1014
|
+
thumbnail: unref(r).image ?? void 0,
|
|
1015
|
+
"onUpdate:file": t[2] || (t[2] = async (d) => {
|
|
1016
|
+
u("update:reward-image", d), d || (unref(r).image = null);
|
|
1017
|
+
})
|
|
1018
|
+
}, {
|
|
1019
|
+
label: withCtx(() => [
|
|
1020
|
+
(openBlock(), createBlock(resolveDynamicComponent(
|
|
1021
|
+
unref(ZodHelper).toInputLabel(
|
|
1022
|
+
unref(ZodHelper).typeAtPath(unref(n), "image", [unref(r).type]),
|
|
1023
|
+
"Voucher image"
|
|
1024
|
+
)
|
|
1025
|
+
)))
|
|
1026
|
+
]),
|
|
1027
|
+
_: 1
|
|
1028
|
+
}, 8, ["file", "thumbnail"]),
|
|
1029
|
+
_hoisted_3$9,
|
|
1030
|
+
createVNode(_sfc_main$u, {
|
|
1031
|
+
"model-value": unref(r).extras.effect,
|
|
1032
|
+
"onUpdate:modelValue": t[3] || (t[3] = (d) => unref(r).extras.effect = d)
|
|
1033
|
+
}, null, 8, ["model-value"]),
|
|
1034
|
+
unref(r).extras.effect == null ? (openBlock(), createBlock(f, {
|
|
1035
|
+
key: 0,
|
|
1036
|
+
class: "!mt-8",
|
|
1037
|
+
text: "Effect is required",
|
|
1038
|
+
state: "error"
|
|
1039
|
+
})) : createCommentVNode("", !0),
|
|
1040
|
+
_hoisted_4$8,
|
|
1041
|
+
createVNode(_sfc_main$v, {
|
|
1042
|
+
"model-value": unref(r).options,
|
|
1043
|
+
"no-campaign": unref(r).noCampaign,
|
|
1044
|
+
"onUpdate:modelValue": t[4] || (t[4] = (d) => unref(r).options = d),
|
|
1045
|
+
schema: unref(ZodHelper).typeAtPath(unref(n), "options", ["VOUCHER"])
|
|
1046
|
+
}, null, 8, ["model-value", "no-campaign", "schema"]),
|
|
1047
|
+
_hoisted_5$4,
|
|
1048
|
+
unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$w, {
|
|
1049
|
+
key: 1,
|
|
1050
|
+
"model-value": ((g = (v = unref(r).extras) == null ? void 0 : v.targetLocation) == null ? void 0 : g.map(String)) ?? null,
|
|
1051
|
+
type: "select",
|
|
1052
|
+
"onUpdate:modelValue": t[5] || (t[5] = (d) => {
|
|
1053
|
+
unref(r).extras.targetLocation = d;
|
|
1054
|
+
}),
|
|
1055
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(n), "extras.targetLocation")]
|
|
1056
|
+
}, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0),
|
|
1057
|
+
createVNode(y, {
|
|
1058
|
+
modelValue: unref(r).internal,
|
|
1059
|
+
"onUpdate:modelValue": t[6] || (t[6] = (d) => unref(r).internal = d),
|
|
1060
|
+
"label-placement": "right",
|
|
1061
|
+
label: "Internal only",
|
|
1062
|
+
sublabel: "Voucher will not be shown to customer"
|
|
1063
|
+
}, null, 8, ["modelValue"])
|
|
1064
|
+
], 64);
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
}), _hoisted_1$b = {
|
|
1068
|
+
key: 0,
|
|
1069
|
+
class: "flex flex-col gap-y-24"
|
|
1070
|
+
}, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
1071
|
+
__name: "EditRewardPoolSheet",
|
|
1072
|
+
emits: ["update:model-value"],
|
|
1073
|
+
setup(e, { expose: i, emit: a }) {
|
|
1074
|
+
const r = useMembershipStore(), { minor: n } = useLoading, u = ref(!1), l = ref(), t = ref(), o = ref(0), f = computed(() => {
|
|
1075
|
+
var s;
|
|
1076
|
+
return ((s = r.loyaltyRewards.items.find(
|
|
1077
|
+
(c) => {
|
|
1078
|
+
var p;
|
|
1079
|
+
return c.value === ((p = l.value) == null ? void 0 : p.collectible);
|
|
1080
|
+
}
|
|
1081
|
+
)) == null ? void 0 : s.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
|
|
1082
|
+
}), y = computed(() => {
|
|
1083
|
+
const d = f.value.safeParse(l.value);
|
|
1084
|
+
return d.success ? [] : d.error.errors;
|
|
1085
|
+
});
|
|
1086
|
+
function m(d, s, c) {
|
|
1087
|
+
d && (l.value = s, o.value = c), u.value = d;
|
|
1088
|
+
}
|
|
1089
|
+
const v = a;
|
|
1090
|
+
async function g() {
|
|
1091
|
+
const d = f.value.safeParse(l.value);
|
|
1092
|
+
d.success && (await n(
|
|
1093
|
+
async () => {
|
|
1094
|
+
d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1095
|
+
d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
|
|
1096
|
+
t.value
|
|
1097
|
+
));
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
message: "Uploading reward image",
|
|
1101
|
+
successMessage: "Reward image updated"
|
|
1102
|
+
}
|
|
1103
|
+
), v("update:model-value", d.data, o.value));
|
|
1104
|
+
}
|
|
1105
|
+
return i({
|
|
1106
|
+
showSheet: m
|
|
1107
|
+
}), (d, s) => {
|
|
1108
|
+
const c = resolveComponent("FmSelect"), p = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
|
|
1109
|
+
return openBlock(), createBlock(k, {
|
|
1110
|
+
"max-width": 560,
|
|
1111
|
+
modelValue: unref(u),
|
|
1112
|
+
"onUpdate:modelValue": [
|
|
1113
|
+
s[9] || (s[9] = (V) => isRef(u) ? u.value = V : null),
|
|
1114
|
+
s[10] || (s[10] = (V) => u.value = V)
|
|
1115
|
+
],
|
|
1116
|
+
header: "Edit reward",
|
|
1117
|
+
"dismiss-away": ""
|
|
1118
|
+
}, {
|
|
1119
|
+
"side-sheet-footer": withCtx(() => [
|
|
1120
|
+
createElementVNode("div", _hoisted_4$7, [
|
|
1121
|
+
createVNode(b, {
|
|
1122
|
+
variant: "primary",
|
|
1123
|
+
type: "button",
|
|
1124
|
+
disabled: unref(y).length > 0,
|
|
1125
|
+
label: "Confirm",
|
|
1126
|
+
onClick: s[7] || (s[7] = (V) => g())
|
|
1127
|
+
}, null, 8, ["disabled"]),
|
|
1128
|
+
createVNode(b, {
|
|
1129
|
+
variant: "secondary",
|
|
1130
|
+
type: "button",
|
|
1131
|
+
label: "Cancel",
|
|
1132
|
+
onClick: s[8] || (s[8] = (V) => u.value = !1)
|
|
1133
|
+
})
|
|
1134
|
+
])
|
|
1135
|
+
]),
|
|
1136
|
+
default: withCtx(() => {
|
|
1137
|
+
var V, B, C;
|
|
1138
|
+
return [
|
|
1139
|
+
unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
|
|
1140
|
+
createVNode(c, {
|
|
1141
|
+
label: "Reward Type",
|
|
1142
|
+
items: [
|
|
1143
|
+
{ label: "No Reward", value: "NO_REWARD" },
|
|
1144
|
+
{ label: "Voucher", value: "VOUCHER" },
|
|
1145
|
+
{ label: "Loyalty", value: "LOYALTY" }
|
|
1146
|
+
],
|
|
1147
|
+
"model-value": unref(l).type,
|
|
1148
|
+
"onUpdate:modelValue": s[0] || (s[0] = (h) => {
|
|
1149
|
+
h == "NO_REWARD" ? l.value = {
|
|
1150
|
+
type: "NO_REWARD",
|
|
1151
|
+
collectible: null,
|
|
1152
|
+
weight: 1
|
|
1153
|
+
} : h === "VOUCHER" ? l.value = {
|
|
1154
|
+
collectible: null,
|
|
1155
|
+
type: "VOUCHER",
|
|
1156
|
+
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
1157
|
+
business: unref(useCoreStore)().currentBusiness.value._id
|
|
1158
|
+
}),
|
|
1159
|
+
earningOption: {
|
|
1160
|
+
amount: 1,
|
|
1161
|
+
type: "FIXED"
|
|
1162
|
+
},
|
|
1163
|
+
validityOption: {
|
|
1164
|
+
validForDay: 7
|
|
1165
|
+
},
|
|
1166
|
+
weight: 1
|
|
1167
|
+
} : l.value = {
|
|
1168
|
+
collectible: unref(r).loyaltyRewards.raw[0]._id,
|
|
1169
|
+
type: "LOYALTY",
|
|
1170
|
+
earningOption: {
|
|
1171
|
+
amount: 1,
|
|
1172
|
+
type: "FIXED"
|
|
1173
|
+
},
|
|
1174
|
+
validityOption: {
|
|
1175
|
+
validForDay: 7
|
|
1176
|
+
},
|
|
1177
|
+
weight: 1
|
|
1178
|
+
};
|
|
1179
|
+
})
|
|
1180
|
+
}, null, 8, ["model-value"]),
|
|
1181
|
+
unref(l).type == "LOYALTY" ? (openBlock(), createBlock(c, {
|
|
1182
|
+
key: 0,
|
|
1183
|
+
label: "Loyalty type",
|
|
1184
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
|
|
1185
|
+
items: unref(r).loyaltyRewards.items,
|
|
1186
|
+
"model-value": unref(l).collectible,
|
|
1187
|
+
"onUpdate:modelValue": s[1] || (s[1] = (h) => unref(l).collectible = h)
|
|
1188
|
+
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1189
|
+
createVNode(p, {
|
|
1190
|
+
label: "Weight",
|
|
1191
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "weight", [unref(l).type])],
|
|
1192
|
+
"model-value": unref(l).weight,
|
|
1193
|
+
"onUpdate:modelValue": s[2] || (s[2] = (h) => l.value = {
|
|
1194
|
+
...unref(l),
|
|
1195
|
+
weight: h
|
|
1196
|
+
})
|
|
1197
|
+
}, null, 8, ["rules", "model-value"]),
|
|
1198
|
+
unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1199
|
+
((V = unref(r).loyaltyRewards.items.find(
|
|
1200
|
+
(h) => {
|
|
1201
|
+
var R;
|
|
1202
|
+
return h.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1203
|
+
}
|
|
1204
|
+
)) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1205
|
+
_hoisted_2$a,
|
|
1206
|
+
createVNode(_sfc_main$e, {
|
|
1207
|
+
class: "mt-[-8px]",
|
|
1208
|
+
rules: [
|
|
1209
|
+
unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])
|
|
1210
|
+
],
|
|
1211
|
+
"helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
|
|
1212
|
+
"error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
|
|
1213
|
+
"fixed-type": !0,
|
|
1214
|
+
"model-value": unref(l).earningOption,
|
|
1215
|
+
"onUpdate:modelValue": s[3] || (s[3] = (h) => l.value = {
|
|
1216
|
+
...unref(l),
|
|
1217
|
+
earningOption: h
|
|
1218
|
+
})
|
|
1219
|
+
}, null, 8, ["rules", "helper-state", "error-text", "model-value"])
|
|
1220
|
+
], 64)) : createCommentVNode("", !0),
|
|
1221
|
+
_hoisted_3$8,
|
|
1222
|
+
createVNode(_sfc_main$x, {
|
|
1223
|
+
"for-credit": unref(l).type === "LOYALTY" && ((B = unref(r).loyaltyRewards.items.find(
|
|
1224
|
+
(h) => {
|
|
1225
|
+
var R;
|
|
1226
|
+
return h.value === ((R = unref(l)) == null ? void 0 : R.collectible);
|
|
1227
|
+
}
|
|
1228
|
+
)) == null ? void 0 : B.raw.type) === "CREDIT",
|
|
1229
|
+
class: "!gap-24",
|
|
1230
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
|
|
1231
|
+
"model-value": unref(l).validityOption,
|
|
1232
|
+
"onUpdate:modelValue": s[4] || (s[4] = (h) => l.value = {
|
|
1233
|
+
...unref(l),
|
|
1234
|
+
validityOption: h
|
|
1235
|
+
})
|
|
1236
|
+
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1237
|
+
], 64)) : createCommentVNode("", !0),
|
|
1238
|
+
unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1239
|
+
key: 2,
|
|
1240
|
+
"reward-image": unref(t),
|
|
1241
|
+
"model-value": ((C = unref(l)) == null ? void 0 : C.collectibleConfig) ?? void 0,
|
|
1242
|
+
"onUpdate:modelValue": s[5] || (s[5] = (h) => l.value = {
|
|
1243
|
+
...unref(l),
|
|
1244
|
+
collectibleConfig: h
|
|
1245
|
+
}),
|
|
1246
|
+
"onUpdate:rewardImage": s[6] || (s[6] = (h) => t.value = h)
|
|
1247
|
+
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1248
|
+
createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
|
|
1249
|
+
])) : createCommentVNode("", !0)
|
|
1250
|
+
];
|
|
1251
|
+
}),
|
|
1252
|
+
_: 1
|
|
1253
|
+
}, 8, ["modelValue"]);
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
});
|
|
1257
|
+
function isNullOrEmpty(e) {
|
|
1258
|
+
return e == null || e === "";
|
|
1259
|
+
}
|
|
1260
|
+
const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1), _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
1261
|
+
__name: "RewardPoolInput",
|
|
1262
|
+
props: {
|
|
1263
|
+
modelValue: {
|
|
1264
|
+
type: Array,
|
|
1265
|
+
default: () => [
|
|
1266
|
+
{
|
|
1267
|
+
collectible: null,
|
|
1268
|
+
type: "NO_REWARD",
|
|
1269
|
+
weight: 1
|
|
1270
|
+
}
|
|
1271
|
+
]
|
|
1272
|
+
}
|
|
1273
|
+
},
|
|
1274
|
+
emits: ["update:model-value"],
|
|
1275
|
+
setup(e, { emit: i }) {
|
|
1276
|
+
const a = e, r = i, n = useMembershipStore(), u = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), t = computed(() => {
|
|
1277
|
+
const d = u.safeParse(l.value);
|
|
1278
|
+
return d.success ? [] : d.error.errors;
|
|
1279
|
+
}), o = ref();
|
|
1280
|
+
function f(d, s) {
|
|
1281
|
+
var p;
|
|
1282
|
+
const c = [...l.value];
|
|
1283
|
+
c[s] = d, (p = o.value) == null || p.showSheet(!1), r("update:model-value", c);
|
|
1284
|
+
}
|
|
1285
|
+
function y(d) {
|
|
1286
|
+
const s = d.type == "VOUCHER" ? d.collectibleConfig : n.collectibles.find(
|
|
1287
|
+
(b) => b._id.toString() == d.collectible
|
|
1288
|
+
), c = CollectionUtils.formattedType((s == null ? void 0 : s.name) || ""), p = d.weight;
|
|
1289
|
+
return {
|
|
1290
|
+
label: isNullOrEmpty(c) ? "NO REWARD" : c,
|
|
1291
|
+
sublabel: `${p} (${(p / l.value.reduce((b, k) => b + k.weight, 0) * 100).toFixed(2)}%)`
|
|
1292
|
+
};
|
|
1293
|
+
}
|
|
1294
|
+
function m(d) {
|
|
1295
|
+
var c;
|
|
1296
|
+
const s = [...l.value];
|
|
1297
|
+
(c = o.value) == null || c.showSheet(!0, s[d], d);
|
|
1298
|
+
}
|
|
1299
|
+
function v(d) {
|
|
1300
|
+
const s = [...l.value];
|
|
1301
|
+
s.splice(d, 1), r("update:model-value", s);
|
|
1302
|
+
}
|
|
1303
|
+
function g() {
|
|
1304
|
+
var d;
|
|
1305
|
+
(d = o.value) == null || d.showSheet(
|
|
1306
|
+
!0,
|
|
1307
|
+
{
|
|
1308
|
+
type: "NO_REWARD",
|
|
1309
|
+
collectible: null,
|
|
1310
|
+
weight: 1
|
|
1311
|
+
},
|
|
1312
|
+
l.value.length
|
|
1313
|
+
);
|
|
1314
|
+
}
|
|
1315
|
+
return (d, s) => {
|
|
1316
|
+
const c = resolveComponent("FmButton"), p = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
|
|
1317
|
+
return openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
1318
|
+
_hoisted_2$9,
|
|
1319
|
+
createVNode(c, {
|
|
1320
|
+
label: "Add Reward",
|
|
1321
|
+
onClick: s[0] || (s[0] = (k) => g()),
|
|
1322
|
+
variant: "plain",
|
|
1323
|
+
icon: "add"
|
|
1324
|
+
}),
|
|
1325
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (k, V) => (openBlock(), createBlock(p, {
|
|
1326
|
+
key: V,
|
|
1327
|
+
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1328
|
+
variant: "outlined",
|
|
1329
|
+
onClick: (B) => m(V)
|
|
1330
|
+
}, {
|
|
1331
|
+
default: withCtx(() => [
|
|
1332
|
+
createElementVNode("div", null, [
|
|
1333
|
+
createElementVNode("div", _hoisted_3$7, toDisplayString(y(k).label), 1),
|
|
1334
|
+
createElementVNode("div", _hoisted_4$6, toDisplayString(y(k).sublabel), 1)
|
|
1335
|
+
]),
|
|
1336
|
+
createVNode(c, {
|
|
1337
|
+
icon: "delete",
|
|
1338
|
+
variant: "tertiary",
|
|
1339
|
+
onClick: (B) => (B.stopPropagation(), v(V))
|
|
1340
|
+
}, null, 8, ["onClick"])
|
|
1341
|
+
]),
|
|
1342
|
+
_: 2
|
|
1343
|
+
}, 1032, ["onClick"]))), 128)),
|
|
1344
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(b, {
|
|
1345
|
+
key: k.message,
|
|
1346
|
+
text: k.message,
|
|
1347
|
+
state: "error"
|
|
1348
|
+
}, null, 8, ["text"]))), 128)),
|
|
1349
|
+
createVNode(_sfc_main$b, {
|
|
1350
|
+
ref_key: "sheetRef",
|
|
1351
|
+
ref: o,
|
|
1352
|
+
"onUpdate:modelValue": f
|
|
1353
|
+
}, null, 512)
|
|
1354
|
+
]);
|
|
1355
|
+
};
|
|
1356
|
+
}
|
|
1357
|
+
}), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$8 = {
|
|
1358
|
+
key: 0,
|
|
1359
|
+
class: "grid grid-cols-2 gap-16"
|
|
1360
|
+
}, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
1361
|
+
__name: "PromotionGameTypeInput",
|
|
1362
|
+
props: {
|
|
1363
|
+
modelValue: {
|
|
1364
|
+
type: Object
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
emits: ["update:model-value"],
|
|
1368
|
+
setup(e, { emit: i }) {
|
|
1369
|
+
const a = e, r = i, n = computed(() => [
|
|
1370
|
+
{
|
|
1371
|
+
label: "Rock paper scissor",
|
|
1372
|
+
description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
|
|
1373
|
+
value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
|
|
1374
|
+
}
|
|
1375
|
+
]);
|
|
1376
|
+
return (u, l) => {
|
|
1377
|
+
var y, m, v;
|
|
1378
|
+
const t = resolveComponent("FmSwitch"), o = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
|
|
1379
|
+
return openBlock(), createElementBlock("div", _hoisted_1$9, [
|
|
1380
|
+
createVNode(t, {
|
|
1381
|
+
label: "Enable game",
|
|
1382
|
+
"model-value": !!((y = e.modelValue) != null && y.gameType),
|
|
1383
|
+
"onUpdate:modelValue": l[0] || (l[0] = (g) => g ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
|
|
1384
|
+
}, null, 8, ["model-value"]),
|
|
1385
|
+
((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
|
|
1386
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (g) => {
|
|
1387
|
+
var d, s;
|
|
1388
|
+
return openBlock(), createBlock(o, {
|
|
1389
|
+
variant: "outlined",
|
|
1390
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1391
|
+
"col-span-2": unref(n).length == 1,
|
|
1392
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == g.value,
|
|
1393
|
+
"hover:bg-fm-color-opacity-sm": ((s = e.modelValue) == null ? void 0 : s.gameType) != g.value
|
|
1394
|
+
}]),
|
|
1395
|
+
onClick: () => {
|
|
1396
|
+
var c;
|
|
1397
|
+
((c = a.modelValue) == null ? void 0 : c.gameType) != g.value && r("update:model-value", { gameType: g.value });
|
|
1398
|
+
},
|
|
1399
|
+
key: g.value
|
|
1400
|
+
}, {
|
|
1401
|
+
default: withCtx(() => [
|
|
1402
|
+
createElementVNode("div", _hoisted_3$6, toDisplayString(g.label), 1),
|
|
1403
|
+
createElementVNode("div", _hoisted_4$5, toDisplayString(g.description), 1)
|
|
1404
|
+
]),
|
|
1405
|
+
_: 2
|
|
1406
|
+
}, 1032, ["class", "onClick"]);
|
|
1407
|
+
}), 128))
|
|
1408
|
+
])) : createCommentVNode("", !0),
|
|
1409
|
+
((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
|
|
1410
|
+
key: 1,
|
|
1411
|
+
text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
|
|
1412
|
+
state: "warning"
|
|
1413
|
+
})) : createCommentVNode("", !0)
|
|
1414
|
+
]);
|
|
1415
|
+
};
|
|
1416
|
+
}
|
|
1417
|
+
}), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$7 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
1418
|
+
__name: "MissionTypeInput",
|
|
1419
|
+
props: {
|
|
1420
|
+
modelValue: {
|
|
1421
|
+
type: String
|
|
1422
|
+
}
|
|
1423
|
+
},
|
|
1424
|
+
emits: ["update:model-value"],
|
|
1425
|
+
setup(e, { emit: i }) {
|
|
1426
|
+
const a = e, r = i, n = computed(() => [
|
|
1427
|
+
{
|
|
1428
|
+
label: "Stamp",
|
|
1429
|
+
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
1430
|
+
value: F_MISSION_TYPE.enum.STAMP
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
label: "Progress",
|
|
1434
|
+
description: "Reward customers when they reach a cumulative spending goal.",
|
|
1435
|
+
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1436
|
+
}
|
|
1437
|
+
]);
|
|
1438
|
+
return (u, l) => {
|
|
1439
|
+
const t = resolveComponent("FmCard");
|
|
1440
|
+
return openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
1441
|
+
_hoisted_2$7,
|
|
1442
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
1443
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (o) => (openBlock(), createBlock(t, {
|
|
1444
|
+
variant: "outlined",
|
|
1445
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1446
|
+
"col-span-2": unref(n).length == 1,
|
|
1447
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == o.value,
|
|
1448
|
+
"hover:bg-fm-color-opacity-sm": e.modelValue != o.value
|
|
1449
|
+
}]),
|
|
1450
|
+
onClick: () => {
|
|
1451
|
+
a.modelValue != o.value && r("update:model-value", o.value);
|
|
1452
|
+
},
|
|
1453
|
+
key: o.value
|
|
1454
|
+
}, {
|
|
1455
|
+
default: withCtx(() => [
|
|
1456
|
+
createElementVNode("div", _hoisted_4$4, toDisplayString(o.label), 1),
|
|
1457
|
+
createElementVNode("div", _hoisted_5$3, toDisplayString(o.description), 1)
|
|
1458
|
+
]),
|
|
1459
|
+
_: 2
|
|
1460
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
1461
|
+
])
|
|
1462
|
+
]);
|
|
1463
|
+
};
|
|
1464
|
+
}
|
|
1465
|
+
}), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ 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), _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1466
|
+
__name: "MissionEndInput",
|
|
1467
|
+
props: {
|
|
1468
|
+
modelValue: {
|
|
1469
|
+
type: [String, Number]
|
|
1470
|
+
},
|
|
1471
|
+
helperText: {
|
|
1472
|
+
type: String
|
|
1473
|
+
},
|
|
1474
|
+
helperState: {
|
|
1475
|
+
type: String
|
|
1476
|
+
}
|
|
1477
|
+
},
|
|
1478
|
+
emits: ["update:model-value"],
|
|
1479
|
+
setup(e, { emit: i }) {
|
|
1480
|
+
const a = i;
|
|
1481
|
+
return (r, n) => {
|
|
1482
|
+
const u = resolveComponent("FmStepperField");
|
|
1483
|
+
return openBlock(), createElementBlock("div", _hoisted_1$7, [
|
|
1484
|
+
_hoisted_2$6,
|
|
1485
|
+
createVNode(u, {
|
|
1486
|
+
label: "Maximum to collect",
|
|
1487
|
+
"model-value": e.modelValue || null,
|
|
1488
|
+
"onUpdate:modelValue": n[0] || (n[0] = (l) => a("update:model-value", l)),
|
|
1489
|
+
"helper-text": e.helperText || "Set the threshold required for reward eligibility",
|
|
1490
|
+
"helper-state": e.helperState || "none"
|
|
1491
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1492
|
+
]);
|
|
1493
|
+
};
|
|
1494
|
+
}
|
|
1495
|
+
}), _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_2$5 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1496
|
+
__name: "EditMissionPoolSheet",
|
|
1497
|
+
props: {
|
|
1498
|
+
maxThreshold: {
|
|
1499
|
+
type: Number,
|
|
1500
|
+
required: !0
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
emits: ["update:model-value"],
|
|
1504
|
+
setup(e, { expose: i, emit: a }) {
|
|
1505
|
+
const r = e, n = useMembershipStore(), { minor: u } = useLoading, l = ref(!1), t = ref(), o = ref(), f = ref(0), y = FdtoThresholdReward, m = computed(() => {
|
|
1506
|
+
const c = y.safeParse(t.value);
|
|
1507
|
+
return c.success ? [] : c.error.errors;
|
|
1508
|
+
});
|
|
1509
|
+
function v(c, p, b) {
|
|
1510
|
+
c && (t.value = p, f.value = b), l.value = c;
|
|
1511
|
+
}
|
|
1512
|
+
const g = a;
|
|
1513
|
+
async function d() {
|
|
1514
|
+
console.log(t.value);
|
|
1515
|
+
const c = y.safeParse(t.value);
|
|
1516
|
+
c.success && (await u(
|
|
1517
|
+
async () => {
|
|
1518
|
+
c.data.type === "VOUCHER" && o.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
|
|
1519
|
+
c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
|
|
1520
|
+
o.value
|
|
1521
|
+
));
|
|
1522
|
+
},
|
|
1523
|
+
{
|
|
1524
|
+
message: "Uploading reward image",
|
|
1525
|
+
successMessage: "Reward image updated"
|
|
1526
|
+
}
|
|
1527
|
+
), g("update:model-value", c.data, f.value));
|
|
1528
|
+
}
|
|
1529
|
+
const s = ref();
|
|
1530
|
+
return i({
|
|
1531
|
+
showSheet: v
|
|
1532
|
+
}), (c, p) => {
|
|
1533
|
+
const b = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), B = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
|
|
1534
|
+
return openBlock(), createBlock(C, {
|
|
1535
|
+
"max-width": 560,
|
|
1536
|
+
modelValue: unref(l),
|
|
1537
|
+
"onUpdate:modelValue": [
|
|
1538
|
+
p[10] || (p[10] = (h) => isRef(l) ? l.value = h : null),
|
|
1539
|
+
p[11] || (p[11] = (h) => l.value = h)
|
|
1540
|
+
],
|
|
1541
|
+
header: "Edit reward",
|
|
1542
|
+
"dismiss-away": ""
|
|
1543
|
+
}, {
|
|
1544
|
+
"side-sheet-footer": withCtx(() => [
|
|
1545
|
+
createElementVNode("div", _hoisted_2$5, [
|
|
1546
|
+
createVNode(B, {
|
|
1547
|
+
variant: "primary",
|
|
1548
|
+
type: "button",
|
|
1549
|
+
label: "Confirm",
|
|
1550
|
+
onClick: p[8] || (p[8] = async () => {
|
|
1551
|
+
var h;
|
|
1552
|
+
return (h = unref(s)) == null ? void 0 : h.validateInputs();
|
|
1553
|
+
})
|
|
1554
|
+
}),
|
|
1555
|
+
createVNode(B, {
|
|
1556
|
+
variant: "secondary",
|
|
1557
|
+
type: "button",
|
|
1558
|
+
label: "Cancel",
|
|
1559
|
+
onClick: p[9] || (p[9] = (h) => l.value = !1)
|
|
1560
|
+
})
|
|
1561
|
+
])
|
|
1562
|
+
]),
|
|
1563
|
+
default: withCtx(() => [
|
|
1564
|
+
unref(t) ? (openBlock(), createBlock(V, {
|
|
1565
|
+
key: 0,
|
|
1566
|
+
class: "flex flex-col gap-y-24",
|
|
1567
|
+
ref_key: "formRef",
|
|
1568
|
+
ref: s,
|
|
1569
|
+
onValidationSuccess: p[7] || (p[7] = (h) => d())
|
|
1570
|
+
}, {
|
|
1571
|
+
default: withCtx(() => {
|
|
1572
|
+
var h, R;
|
|
1573
|
+
return [
|
|
1574
|
+
unref(t).type ? (openBlock(), createBlock(b, {
|
|
1575
|
+
key: 0,
|
|
1576
|
+
label: "Threshold",
|
|
1577
|
+
rules: [
|
|
1578
|
+
unref(ZodHelper).toRule(
|
|
1579
|
+
unref(z).number().min(1).max(
|
|
1580
|
+
r.maxThreshold,
|
|
1581
|
+
`Number cannot be more than ${r.maxThreshold}`
|
|
1582
|
+
)
|
|
1583
|
+
)
|
|
1584
|
+
],
|
|
1585
|
+
"model-value": unref(t).threshold,
|
|
1586
|
+
"onUpdate:modelValue": p[0] || (p[0] = (E) => t.value = {
|
|
1587
|
+
...unref(t),
|
|
1588
|
+
threshold: E
|
|
1589
|
+
})
|
|
1590
|
+
}, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
|
|
1591
|
+
createVNode(k, {
|
|
1592
|
+
label: "Reward Type",
|
|
1593
|
+
items: [
|
|
1594
|
+
{ label: "Voucher", value: "VOUCHER" },
|
|
1595
|
+
{ label: "Loyalty", value: "LOYALTY" }
|
|
1596
|
+
],
|
|
1597
|
+
"model-value": unref(t).type,
|
|
1598
|
+
"onUpdate:modelValue": p[1] || (p[1] = (E) => {
|
|
1599
|
+
var x, $;
|
|
1600
|
+
E === "VOUCHER" ? t.value = {
|
|
1601
|
+
collectible: null,
|
|
1602
|
+
type: "VOUCHER",
|
|
1603
|
+
collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
|
|
1604
|
+
business: unref(useCoreStore)().currentBusiness.value._id
|
|
1605
|
+
}),
|
|
1606
|
+
earningOption: {
|
|
1607
|
+
amount: 1,
|
|
1608
|
+
type: "FIXED"
|
|
1609
|
+
},
|
|
1610
|
+
validityOption: {
|
|
1611
|
+
validForDay: 7
|
|
1612
|
+
},
|
|
1613
|
+
threshold: (x = unref(t)) == null ? void 0 : x.threshold
|
|
1614
|
+
} : t.value = {
|
|
1615
|
+
collectible: unref(n).loyaltyRewards.raw[0]._id,
|
|
1616
|
+
type: "LOYALTY",
|
|
1617
|
+
earningOption: {
|
|
1618
|
+
amount: 1,
|
|
1619
|
+
type: "FIXED"
|
|
1620
|
+
},
|
|
1621
|
+
validityOption: {
|
|
1622
|
+
validForDay: 7
|
|
1623
|
+
},
|
|
1624
|
+
threshold: ($ = unref(t)) == null ? void 0 : $.threshold
|
|
1625
|
+
};
|
|
1626
|
+
})
|
|
1627
|
+
}, null, 8, ["model-value"]),
|
|
1628
|
+
unref(t).type == "LOYALTY" ? (openBlock(), createBlock(k, {
|
|
1629
|
+
key: 1,
|
|
1630
|
+
label: "Loyalty type",
|
|
1631
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(t).type])],
|
|
1632
|
+
items: unref(n).loyaltyRewards.items,
|
|
1633
|
+
"model-value": unref(t).collectible,
|
|
1634
|
+
"onUpdate:modelValue": p[2] || (p[2] = (E) => unref(t).collectible = E)
|
|
1635
|
+
}, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
|
|
1636
|
+
unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
1637
|
+
_hoisted_1$6,
|
|
1638
|
+
createVNode(_sfc_main$e, {
|
|
1639
|
+
class: "mt-[-8px]",
|
|
1640
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(t).type])],
|
|
1641
|
+
"helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
|
|
1642
|
+
"error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
|
|
1643
|
+
"fixed-type": !0,
|
|
1644
|
+
"model-value": unref(t).earningOption,
|
|
1645
|
+
"onUpdate:modelValue": p[3] || (p[3] = (E) => t.value = {
|
|
1646
|
+
...unref(t),
|
|
1647
|
+
earningOption: E
|
|
1648
|
+
})
|
|
1649
|
+
}, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
|
|
1650
|
+
createVNode(_sfc_main$x, {
|
|
1651
|
+
class: "!gap-24",
|
|
1652
|
+
"for-credit": unref(t).type === "LOYALTY" && ((h = unref(n).loyaltyRewards.items.find(
|
|
1653
|
+
(E) => {
|
|
1654
|
+
var x;
|
|
1655
|
+
return E.value === ((x = unref(t)) == null ? void 0 : x.collectible);
|
|
1656
|
+
}
|
|
1657
|
+
)) == null ? void 0 : h.raw.type) === "CREDIT",
|
|
1658
|
+
rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(t).type])],
|
|
1659
|
+
"model-value": unref(t).validityOption,
|
|
1660
|
+
"onUpdate:modelValue": p[4] || (p[4] = (E) => t.value = {
|
|
1661
|
+
...unref(t),
|
|
1662
|
+
validityOption: E
|
|
1663
|
+
})
|
|
1664
|
+
}, null, 8, ["for-credit", "rules", "model-value"])
|
|
1665
|
+
], 64)) : createCommentVNode("", !0),
|
|
1666
|
+
unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
|
|
1667
|
+
key: 3,
|
|
1668
|
+
"reward-image": unref(o),
|
|
1669
|
+
"model-value": ((R = unref(t)) == null ? void 0 : R.collectibleConfig) ?? void 0,
|
|
1670
|
+
"onUpdate:modelValue": p[5] || (p[5] = (E) => t.value = {
|
|
1671
|
+
...unref(t),
|
|
1672
|
+
collectibleConfig: E
|
|
1673
|
+
}),
|
|
1674
|
+
"onUpdate:rewardImage": p[6] || (p[6] = (E) => o.value = E)
|
|
1675
|
+
}, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
|
|
1676
|
+
createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
|
|
1677
|
+
];
|
|
1678
|
+
}),
|
|
1679
|
+
_: 1
|
|
1680
|
+
}, 512)) : createCommentVNode("", !0)
|
|
1681
|
+
]),
|
|
1682
|
+
_: 1
|
|
1683
|
+
}, 8, ["modelValue"]);
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
}), _hoisted_1$5 = {
|
|
1687
|
+
key: 0,
|
|
1688
|
+
class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
|
|
1689
|
+
}, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", null, "🎁", -1), _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
1690
|
+
__name: "MissionProgress",
|
|
1691
|
+
props: {
|
|
1692
|
+
type: {
|
|
1693
|
+
type: String,
|
|
1694
|
+
required: !0
|
|
1695
|
+
},
|
|
1696
|
+
maxRange: {
|
|
1697
|
+
type: Number,
|
|
1698
|
+
required: !0
|
|
1699
|
+
},
|
|
1700
|
+
currentRange: {
|
|
1701
|
+
type: Number,
|
|
1702
|
+
default: 0
|
|
1703
|
+
},
|
|
1704
|
+
markers: {
|
|
1705
|
+
type: Array,
|
|
1706
|
+
default: () => []
|
|
1707
|
+
}
|
|
1708
|
+
},
|
|
1709
|
+
setup(e) {
|
|
1710
|
+
const i = e, { maxRange: a, currentRange: r, markers: n } = toRefs(i), u = computed(
|
|
1711
|
+
() => Math.min(r.value / a.value * 100, 100)
|
|
1712
|
+
), l = (t) => t / a.value * 100;
|
|
1713
|
+
return (t, o) => {
|
|
1714
|
+
const f = resolveComponent("FmIcon");
|
|
1715
|
+
return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
1716
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(f, {
|
|
1717
|
+
class: normalizeClass(
|
|
1718
|
+
unref(r) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
|
|
1719
|
+
),
|
|
1720
|
+
outline: unref(r) < y,
|
|
1721
|
+
key: y,
|
|
1722
|
+
name: unref(n).some((m) => m === y) ? "featured_seasonal_and_gifts" : "check_circle"
|
|
1723
|
+
}, null, 8, ["class", "outline", "name"]))), 128))
|
|
1724
|
+
])) : (openBlock(), createElementBlock("div", {
|
|
1725
|
+
key: 1,
|
|
1726
|
+
class: normalizeClass(["relative w-full h-4 rounded-lg", "bg-fm-color-system-warning-100"])
|
|
1727
|
+
}, [
|
|
1728
|
+
createElementVNode("div", {
|
|
1729
|
+
class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
|
|
1730
|
+
style: normalizeStyle({ width: unref(u) + "%" })
|
|
1731
|
+
}, null, 4),
|
|
1732
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (y, m) => (openBlock(), createElementBlock("div", {
|
|
1733
|
+
key: m,
|
|
1734
|
+
class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
|
|
1735
|
+
style: normalizeStyle({ left: l(y) + "%" })
|
|
1736
|
+
}, [
|
|
1737
|
+
createElementVNode("div", _hoisted_2$4, [
|
|
1738
|
+
createElementVNode("div", {
|
|
1739
|
+
class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
|
|
1740
|
+
}),
|
|
1741
|
+
_hoisted_3$4
|
|
1742
|
+
])
|
|
1743
|
+
], 4))), 128))
|
|
1744
|
+
]));
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
}), isObject = (e) => e !== null && typeof e == "object";
|
|
1748
|
+
function changeKeysFactory(e) {
|
|
1749
|
+
return function i(a, r = 1, n) {
|
|
1750
|
+
if (r === 0 || !isObject(a))
|
|
1751
|
+
return a;
|
|
1752
|
+
if (Array.isArray(a))
|
|
1753
|
+
return a.map((l) => i(l, r - 1, n));
|
|
1754
|
+
const u = Object.create(Object.getPrototypeOf(a));
|
|
1755
|
+
return Object.keys(a).forEach((l) => {
|
|
1756
|
+
const t = a[l], o = e(l, n), f = i(t, r - 1, n);
|
|
1757
|
+
u[o] = f;
|
|
1758
|
+
}), u;
|
|
1759
|
+
};
|
|
1760
|
+
}
|
|
1761
|
+
const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1762
|
+
__name: "MissionPoolInput",
|
|
1763
|
+
props: {
|
|
1764
|
+
modelValue: {
|
|
1765
|
+
type: Array,
|
|
1766
|
+
default: () => []
|
|
1767
|
+
},
|
|
1768
|
+
mission: {
|
|
1769
|
+
type: Object,
|
|
1770
|
+
required: !0
|
|
1771
|
+
}
|
|
1772
|
+
},
|
|
1773
|
+
emits: ["update:model-value"],
|
|
1774
|
+
setup(e, { emit: i }) {
|
|
1775
|
+
const a = e, r = i, n = useMembershipStore(), u = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
|
|
1776
|
+
() => a.modelValue.sort((s, c) => s.threshold - c.threshold) ?? []
|
|
1777
|
+
), t = computed(() => {
|
|
1778
|
+
const s = u.safeParse(l.value);
|
|
1779
|
+
return s.success ? [] : s.error.errors;
|
|
1780
|
+
}), o = ref();
|
|
1781
|
+
function f(s, c) {
|
|
1782
|
+
var b;
|
|
1783
|
+
const p = [...l.value];
|
|
1784
|
+
p[c] = s, (b = o.value) == null || b.showSheet(!1), r("update:model-value", p);
|
|
1785
|
+
}
|
|
1786
|
+
function y(s) {
|
|
1787
|
+
const c = s.type == "VOUCHER" ? s.collectibleConfig : n.collectibles.find(
|
|
1788
|
+
(b) => b._id.toString() == s.collectible
|
|
1789
|
+
), p = CollectionUtils.formattedType((c == null ? void 0 : c.name) || "");
|
|
1790
|
+
return {
|
|
1791
|
+
label: isNullOrEmpty(p) ? "NO REWARD" : p,
|
|
1792
|
+
sublabel: `Reward at ${s.threshold} | Amount: ${s.earningOption.type == "FIXED" ? s.earningOption.amount : `${s.earningOption.amount} for every RM${s.earningOption.every} spent`} `
|
|
1793
|
+
};
|
|
1794
|
+
}
|
|
1795
|
+
function m(s) {
|
|
1796
|
+
var p;
|
|
1797
|
+
const c = [...l.value];
|
|
1798
|
+
(p = o.value) == null || p.showSheet(!0, c[s], s);
|
|
1799
|
+
}
|
|
1800
|
+
function v(s) {
|
|
1801
|
+
const c = [...l.value];
|
|
1802
|
+
c.splice(s, 1), r("update:model-value", c);
|
|
1803
|
+
}
|
|
1804
|
+
function g() {
|
|
1805
|
+
var s;
|
|
1806
|
+
(s = o.value) == null || s.showSheet(
|
|
1807
|
+
!0,
|
|
1808
|
+
{
|
|
1809
|
+
type: "LOYALTY",
|
|
1810
|
+
collectible: n.loyaltyRewards.items[0].value,
|
|
1811
|
+
threshold: null,
|
|
1812
|
+
validityOption: {
|
|
1813
|
+
validForDay: 7
|
|
1814
|
+
},
|
|
1815
|
+
earningOption: {
|
|
1816
|
+
type: "FIXED",
|
|
1817
|
+
amount: 1
|
|
1818
|
+
}
|
|
1819
|
+
},
|
|
1820
|
+
l.value.length
|
|
1821
|
+
);
|
|
1822
|
+
}
|
|
1823
|
+
function d(s) {
|
|
1824
|
+
var c, p;
|
|
1825
|
+
return s.type == "VOUCHER" ? (c = s.collectibleConfig) == null ? void 0 : c.name : sentenceCase(
|
|
1826
|
+
((p = n.loyaltyRewards.items.find(
|
|
1827
|
+
(b) => b.value == s.collectible
|
|
1828
|
+
)) == null ? void 0 : p.label) || ""
|
|
1829
|
+
);
|
|
1830
|
+
}
|
|
1831
|
+
return (s, c) => {
|
|
1832
|
+
const p = resolveComponent("FmButton"), b = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
|
|
1833
|
+
return openBlock(), createElementBlock("div", _hoisted_1$4, [
|
|
1834
|
+
_hoisted_2$3,
|
|
1835
|
+
createVNode(p, {
|
|
1836
|
+
label: "Add Reward",
|
|
1837
|
+
onClick: c[0] || (c[0] = (V) => g()),
|
|
1838
|
+
variant: "plain",
|
|
1839
|
+
icon: "add"
|
|
1840
|
+
}),
|
|
1841
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, B) => (openBlock(), createBlock(b, {
|
|
1842
|
+
key: B,
|
|
1843
|
+
class: "px-16 py-12 flex items-center justify-between cursor-pointer",
|
|
1844
|
+
variant: "outlined",
|
|
1845
|
+
onClick: (C) => m(B)
|
|
1846
|
+
}, {
|
|
1847
|
+
default: withCtx(() => [
|
|
1848
|
+
createElementVNode("div", null, [
|
|
1849
|
+
createElementVNode("div", _hoisted_3$3, toDisplayString(y(V).label), 1),
|
|
1850
|
+
createElementVNode("div", _hoisted_4$3, toDisplayString(y(V).sublabel), 1)
|
|
1851
|
+
]),
|
|
1852
|
+
createVNode(p, {
|
|
1853
|
+
icon: "delete",
|
|
1854
|
+
variant: "tertiary",
|
|
1855
|
+
onClick: (C) => (C.stopPropagation(), v(B))
|
|
1856
|
+
}, null, 8, ["onClick"])
|
|
1857
|
+
]),
|
|
1858
|
+
_: 2
|
|
1859
|
+
}, 1032, ["onClick"]))), 128)),
|
|
1860
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(k, {
|
|
1861
|
+
key: V.message,
|
|
1862
|
+
text: V.message,
|
|
1863
|
+
state: "error"
|
|
1864
|
+
}, null, 8, ["text"]))), 128)),
|
|
1865
|
+
_hoisted_5$2,
|
|
1866
|
+
createVNode(b, {
|
|
1867
|
+
variant: "outlined",
|
|
1868
|
+
class: "p-24 space-y-16 w-fit"
|
|
1869
|
+
}, {
|
|
1870
|
+
default: withCtx(() => [
|
|
1871
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
1872
|
+
createElementVNode("div", null, [
|
|
1873
|
+
createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(d(e.modelValue[e.modelValue.length - 1])), 1),
|
|
1874
|
+
_hoisted_8$2
|
|
1875
|
+
])
|
|
1876
|
+
]),
|
|
1877
|
+
createElementVNode("div", _hoisted_9$2, [
|
|
1878
|
+
createVNode(_sfc_main$5, {
|
|
1879
|
+
type: e.mission.type,
|
|
1880
|
+
"max-range": e.mission.end,
|
|
1881
|
+
currentRange: e.mission.end / 4,
|
|
1882
|
+
markers: e.modelValue.map((V) => V.threshold)
|
|
1883
|
+
}, null, 8, ["type", "max-range", "currentRange", "markers"]),
|
|
1884
|
+
e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
|
|
1885
|
+
])
|
|
1886
|
+
]),
|
|
1887
|
+
_: 1
|
|
1888
|
+
}),
|
|
1889
|
+
createVNode(_sfc_main$6, {
|
|
1890
|
+
ref_key: "sheetRef",
|
|
1891
|
+
ref: o,
|
|
1892
|
+
"onUpdate:modelValue": f,
|
|
1893
|
+
"max-threshold": e.mission.end
|
|
1894
|
+
}, null, 8, ["max-threshold"])
|
|
1895
|
+
]);
|
|
1896
|
+
};
|
|
1897
|
+
}
|
|
1898
|
+
}), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1), _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1), _hoisted_10$1 = /* @__PURE__ */ 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), _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1899
|
+
__name: "MissionInput",
|
|
1900
|
+
props: {
|
|
1901
|
+
modelValue: Object
|
|
1902
|
+
},
|
|
1903
|
+
emits: ["update:model-value"],
|
|
1904
|
+
setup(e, { emit: i }) {
|
|
1905
|
+
const a = e, r = computed(() => {
|
|
1906
|
+
const l = FdoMission.safeParse(a.modelValue);
|
|
1907
|
+
return l.success ? [] : l.error.errors;
|
|
1908
|
+
}), n = computed(() => [
|
|
1909
|
+
{
|
|
1910
|
+
label: "Stamp",
|
|
1911
|
+
description: "Award stamps for purchases, redeemable after reaching set milestones.",
|
|
1912
|
+
value: F_MISSION_TYPE.enum.STAMP
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
label: "Progress",
|
|
1916
|
+
description: "Reward customers when they reach a cumulative spending goal.",
|
|
1917
|
+
value: F_MISSION_TYPE.enum.PROGRESSIVE
|
|
1918
|
+
}
|
|
1919
|
+
]), u = i;
|
|
1920
|
+
return (l, t) => {
|
|
1921
|
+
var y;
|
|
1922
|
+
const o = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
|
|
1923
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [
|
|
1924
|
+
createElementVNode("div", _hoisted_2$2, [
|
|
1925
|
+
_hoisted_3$2,
|
|
1926
|
+
_hoisted_4$2,
|
|
1927
|
+
createElementVNode("div", _hoisted_5$1, [
|
|
1928
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(n), (m) => {
|
|
1929
|
+
var v, g;
|
|
1930
|
+
return openBlock(), createBlock(o, {
|
|
1931
|
+
variant: "outlined",
|
|
1932
|
+
class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
|
|
1933
|
+
"col-span-2": unref(n).length == 1,
|
|
1934
|
+
"border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((v = e.modelValue) == null ? void 0 : v.type) == m.value,
|
|
1935
|
+
"hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.type) != m.value
|
|
1936
|
+
}]),
|
|
1937
|
+
onClick: () => {
|
|
1938
|
+
var d, s;
|
|
1939
|
+
((d = e.modelValue) == null ? void 0 : d.type) != m.value && u("update:model-value", {
|
|
1940
|
+
...e.modelValue,
|
|
1941
|
+
type: m.value,
|
|
1942
|
+
end: ((s = e.modelValue) == null ? void 0 : s.end) || 1
|
|
1943
|
+
});
|
|
1944
|
+
},
|
|
1945
|
+
key: m.value
|
|
1946
|
+
}, {
|
|
1947
|
+
default: withCtx(() => [
|
|
1948
|
+
createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
|
|
1949
|
+
createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
|
|
1950
|
+
]),
|
|
1951
|
+
_: 2
|
|
1952
|
+
}, 1032, ["class", "onClick"]);
|
|
1953
|
+
}), 128))
|
|
1954
|
+
])
|
|
1955
|
+
]),
|
|
1956
|
+
createElementVNode("div", _hoisted_8$1, [
|
|
1957
|
+
_hoisted_9$1,
|
|
1958
|
+
_hoisted_10$1,
|
|
1959
|
+
createVNode(f, {
|
|
1960
|
+
label: "Maximum to collect",
|
|
1961
|
+
"model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
|
|
1962
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => {
|
|
1963
|
+
var v;
|
|
1964
|
+
return u("update:model-value", {
|
|
1965
|
+
...e.modelValue,
|
|
1966
|
+
type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
|
|
1967
|
+
end: m
|
|
1968
|
+
});
|
|
1969
|
+
}),
|
|
1970
|
+
"helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
|
|
1971
|
+
"helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
|
|
1972
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"])
|
|
1973
|
+
])
|
|
1974
|
+
]);
|
|
1975
|
+
};
|
|
1976
|
+
}
|
|
1977
|
+
}), _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1978
|
+
__name: "TemplateInput",
|
|
1979
|
+
props: {
|
|
1980
|
+
field: { type: Object, required: !0 },
|
|
1981
|
+
modelValue: {
|
|
1982
|
+
type: Object
|
|
1983
|
+
},
|
|
1984
|
+
schema: {
|
|
1985
|
+
type: Object
|
|
1986
|
+
},
|
|
1987
|
+
extras: {
|
|
1988
|
+
type: Object
|
|
1989
|
+
},
|
|
1990
|
+
helperText: {
|
|
1991
|
+
type: String
|
|
1992
|
+
},
|
|
1993
|
+
disabled: {
|
|
1994
|
+
type: Boolean,
|
|
1995
|
+
default: !1
|
|
1996
|
+
}
|
|
1997
|
+
},
|
|
1998
|
+
emits: ["update:model-value", "update:file"],
|
|
1999
|
+
setup(e, { emit: i }) {
|
|
2000
|
+
const a = e, r = i;
|
|
2001
|
+
function n(o) {
|
|
2002
|
+
switch (a.field.type) {
|
|
2003
|
+
case "timeframe":
|
|
2004
|
+
const f = o.startDate ? hooks(o.startDate).startOf("day").toISOString() : void 0, y = o.endDate ? hooks(o.endDate).endOf("day").toISOString() : void 0;
|
|
2005
|
+
r("update:model-value", {
|
|
2006
|
+
type: "timeframe",
|
|
2007
|
+
property: "__now",
|
|
2008
|
+
start: f,
|
|
2009
|
+
end: y
|
|
2010
|
+
});
|
|
2011
|
+
break;
|
|
2012
|
+
case "image": {
|
|
2013
|
+
r(
|
|
2014
|
+
"update:file",
|
|
2015
|
+
o,
|
|
2016
|
+
u.value || firebaseStorage.collectibleImagePath(void 0, o)
|
|
2017
|
+
);
|
|
2018
|
+
break;
|
|
2019
|
+
}
|
|
2020
|
+
default:
|
|
2021
|
+
r("update:model-value", o);
|
|
2022
|
+
break;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
const u = computed(() => {
|
|
2026
|
+
switch (a.field.type) {
|
|
2027
|
+
case "timeframe": {
|
|
2028
|
+
const o = a.modelValue;
|
|
2029
|
+
return {
|
|
2030
|
+
startDate: o != null && o.start ? hooks(o == null ? void 0 : o.start).format("YYYY-MM-DD") : null,
|
|
2031
|
+
endDate: o != null && o.end ? hooks(o == null ? void 0 : o.end).format("YYYY-MM-DD") : null
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
default:
|
|
2035
|
+
return a.modelValue;
|
|
2036
|
+
}
|
|
2037
|
+
});
|
|
2038
|
+
function l() {
|
|
2039
|
+
if (!t.value.schema) return [];
|
|
2040
|
+
const o = t.value.schema.safeParse(a.modelValue);
|
|
2041
|
+
return o.success ? [] : o.error.errors;
|
|
2042
|
+
}
|
|
2043
|
+
const t = computed(() => ({
|
|
2044
|
+
schema: a.schema,
|
|
2045
|
+
unwrapped: a.schema ? ZodHelper.unwrap(a.schema) : void 0,
|
|
2046
|
+
rules: a.schema ? [ZodHelper.ruleAtPath(a.schema, "")] : void 0,
|
|
2047
|
+
labelMark: a.schema && ZodHelper.isRequired(a.schema) == !1 ? "optional" : void 0,
|
|
2048
|
+
zodLabel: a.schema ? ZodHelper.toInputLabel(a.schema, a.field.label) : void 0
|
|
2049
|
+
}));
|
|
2050
|
+
return (o, f) => {
|
|
2051
|
+
var s, c, p, b, k;
|
|
2052
|
+
const y = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), v = resolveComponent("FmTextarea"), g = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
|
|
2053
|
+
return e.field.type === "text" ? (openBlock(), createBlock(y, {
|
|
2054
|
+
key: 0,
|
|
2055
|
+
label: e.field.label,
|
|
2056
|
+
"label-mark": unref(t).labelMark,
|
|
2057
|
+
rules: unref(t).rules,
|
|
2058
|
+
"model-value": unref(u),
|
|
2059
|
+
"onUpdate:modelValue": n
|
|
2060
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
2061
|
+
createVNode(JsonViewer, {
|
|
2062
|
+
json: { schema: unref(t).unwrapped, props: a }
|
|
2063
|
+
}, null, 8, ["json"]),
|
|
2064
|
+
createVNode(m, {
|
|
2065
|
+
label: e.field.label,
|
|
2066
|
+
"label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
|
|
2067
|
+
"model-value": unref(u),
|
|
2068
|
+
rules: e.field.isRuleChildren ? [] : unref(t).rules,
|
|
2069
|
+
"onUpdate:modelValue": n,
|
|
2070
|
+
"helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
|
|
2071
|
+
"helper-text": e.field.isRuleChildren ? e.helperText : void 0
|
|
2072
|
+
}, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
|
|
2073
|
+
], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(v, {
|
|
2074
|
+
key: 2,
|
|
2075
|
+
label: e.field.label,
|
|
2076
|
+
"label-mark": unref(t).labelMark,
|
|
2077
|
+
rules: unref(t).rules,
|
|
2078
|
+
"model-value": unref(u),
|
|
2079
|
+
"onUpdate:modelValue": n,
|
|
2080
|
+
"show-word-count": "",
|
|
2081
|
+
"max-length": (k = (b = (p = (c = (s = unref(t)) == null ? void 0 : s.unwrapped) == null ? void 0 : c._def) == null ? void 0 : p.checks) == null ? void 0 : b.find((V) => V.kind == "max")) == null ? void 0 : k.value
|
|
2082
|
+
}, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$i, {
|
|
2083
|
+
key: 3,
|
|
2084
|
+
"campaign-type": e.extras,
|
|
2085
|
+
"model-value": unref(u),
|
|
2086
|
+
disabled: e.disabled,
|
|
2087
|
+
"onUpdate:modelValue": n
|
|
2088
|
+
}, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
|
|
2089
|
+
createVNode(_sfc_main$g, {
|
|
2090
|
+
"model-value": unref(u),
|
|
2091
|
+
"onUpdate:modelValue": n
|
|
2092
|
+
}, null, 8, ["model-value"]),
|
|
2093
|
+
createVNode(g, {
|
|
2094
|
+
class: "!mt-[8px]",
|
|
2095
|
+
text: unref(ZodHelper).helperText(l(), ""),
|
|
2096
|
+
state: unref(ZodHelper).helperState(l(), "")
|
|
2097
|
+
}, null, 8, ["text", "state"])
|
|
2098
|
+
], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$t, {
|
|
2099
|
+
key: 5,
|
|
2100
|
+
thumbnail: unref(u),
|
|
2101
|
+
"aspect-ratio": "16 / 9",
|
|
2102
|
+
class: "w-1/2 xs:w-2/3",
|
|
2103
|
+
"onUpdate:file": n
|
|
2104
|
+
}, {
|
|
2105
|
+
label: withCtx(() => [
|
|
2106
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
|
|
2107
|
+
]),
|
|
2108
|
+
_: 1
|
|
2109
|
+
}, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
|
|
2110
|
+
key: 6,
|
|
2111
|
+
label: e.field.label,
|
|
2112
|
+
"label-placement": "right",
|
|
2113
|
+
sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
|
|
2114
|
+
"label-mark": unref(t).labelMark,
|
|
2115
|
+
rules: unref(t).rules,
|
|
2116
|
+
"model-value": unref(u),
|
|
2117
|
+
"onUpdate:modelValue": n
|
|
2118
|
+
}, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$v, {
|
|
2119
|
+
key: 7,
|
|
2120
|
+
"model-value": unref(u),
|
|
2121
|
+
"onUpdate:modelValue": n,
|
|
2122
|
+
"no-campaign": !1,
|
|
2123
|
+
schema: unref(t).schema,
|
|
2124
|
+
"is-mission": e.extras === "MISSION"
|
|
2125
|
+
}, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$w, {
|
|
2126
|
+
key: 8,
|
|
2127
|
+
"model-value": unref(u),
|
|
2128
|
+
"onUpdate:modelValue": n
|
|
2129
|
+
}, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
|
|
2130
|
+
createVNode(_sfc_main$u, {
|
|
2131
|
+
"model-value": unref(u),
|
|
2132
|
+
"onUpdate:modelValue": n,
|
|
2133
|
+
"can-set-auto-apply": e.field.property == "campaign.effect"
|
|
2134
|
+
}, null, 8, ["model-value", "can-set-auto-apply"]),
|
|
2135
|
+
unref(u) ? createCommentVNode("", !0) : (openBlock(), createBlock(g, {
|
|
2136
|
+
key: 0,
|
|
2137
|
+
class: "!mt-[8px]",
|
|
2138
|
+
text: "Effect is required",
|
|
2139
|
+
state: "error"
|
|
2140
|
+
}))
|
|
2141
|
+
], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2142
|
+
key: 10,
|
|
2143
|
+
"model-value": unref(u),
|
|
2144
|
+
"onUpdate:modelValue": n,
|
|
2145
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2146
|
+
"trigger-type": e.field.extras,
|
|
2147
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2148
|
+
}, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
|
|
2149
|
+
key: 11,
|
|
2150
|
+
"model-value": unref(u),
|
|
2151
|
+
"onUpdate:modelValue": n,
|
|
2152
|
+
extras: e.extras,
|
|
2153
|
+
"error-text": e.helperText
|
|
2154
|
+
}, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$x, {
|
|
2155
|
+
key: 12,
|
|
2156
|
+
type: "custom",
|
|
2157
|
+
"model-value": unref(u),
|
|
2158
|
+
"onUpdate:modelValue": n,
|
|
2159
|
+
"helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
|
|
2160
|
+
}, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
|
|
2161
|
+
key: 13,
|
|
2162
|
+
"model-value": unref(u),
|
|
2163
|
+
"onUpdate:modelValue": n
|
|
2164
|
+
}, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
|
|
2165
|
+
key: 14,
|
|
2166
|
+
"model-value": unref(u),
|
|
2167
|
+
"onUpdate:modelValue": n
|
|
2168
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
|
|
2169
|
+
key: 15,
|
|
2170
|
+
"model-value": unref(u),
|
|
2171
|
+
"onUpdate:modelValue": n
|
|
2172
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
|
|
2173
|
+
key: 16,
|
|
2174
|
+
"model-value": unref(u),
|
|
2175
|
+
"onUpdate:modelValue": n
|
|
2176
|
+
}, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
|
|
2177
|
+
key: 17,
|
|
2178
|
+
"model-value": unref(u),
|
|
2179
|
+
"onUpdate:modelValue": n,
|
|
2180
|
+
"helper-text": unref(ZodHelper).helperText(l(), ""),
|
|
2181
|
+
"helper-state": unref(ZodHelper).helperState(l(), "")
|
|
2182
|
+
}, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
|
|
2183
|
+
key: 18,
|
|
2184
|
+
"model-value": unref(u),
|
|
2185
|
+
"onUpdate:modelValue": n,
|
|
2186
|
+
mission: e.extras.mission
|
|
2187
|
+
}, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
|
|
2188
|
+
createVNode(_sfc_main$f, {
|
|
2189
|
+
"model-value": unref(u),
|
|
2190
|
+
"onUpdate:modelValue": n,
|
|
2191
|
+
"start-date": e.extras.start,
|
|
2192
|
+
"end-date": e.extras.end
|
|
2193
|
+
}, null, 8, ["model-value", "start-date", "end-date"]),
|
|
2194
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2195
|
+
key: 0,
|
|
2196
|
+
class: "!mt-[8px]",
|
|
2197
|
+
text: e.helperText,
|
|
2198
|
+
state: "error"
|
|
2199
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2200
|
+
], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
|
|
2201
|
+
createVNode(_sfc_main$n, {
|
|
2202
|
+
"model-value": unref(u),
|
|
2203
|
+
"onUpdate:modelValue": n
|
|
2204
|
+
}, null, 8, ["model-value"]),
|
|
2205
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2206
|
+
key: 0,
|
|
2207
|
+
class: "!mt-[8px]",
|
|
2208
|
+
text: e.helperText,
|
|
2209
|
+
state: "error"
|
|
2210
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2211
|
+
], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
|
|
2212
|
+
e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(u).rules.g_time).length > 0 ? (openBlock(), createBlock(g, {
|
|
2213
|
+
key: 0,
|
|
2214
|
+
state: "warning",
|
|
2215
|
+
text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
|
|
2216
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0),
|
|
2217
|
+
createVNode(_sfc_main$m, {
|
|
2218
|
+
"model-value": unref(u),
|
|
2219
|
+
"onUpdate:modelValue": n
|
|
2220
|
+
}, null, 8, ["model-value"]),
|
|
2221
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2222
|
+
key: 1,
|
|
2223
|
+
class: "!mt-[8px]",
|
|
2224
|
+
text: e.helperText,
|
|
2225
|
+
state: "error"
|
|
2226
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2227
|
+
], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
|
|
2228
|
+
createVNode(_sfc_main$l, {
|
|
2229
|
+
"model-value": unref(u),
|
|
2230
|
+
"onUpdate:modelValue": n
|
|
2231
|
+
}, null, 8, ["model-value"]),
|
|
2232
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2233
|
+
key: 0,
|
|
2234
|
+
class: "!mt-[8px]",
|
|
2235
|
+
text: e.helperText,
|
|
2236
|
+
state: "error"
|
|
2237
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2238
|
+
], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
|
|
2239
|
+
createVNode(_sfc_main$j, {
|
|
2240
|
+
"model-value": unref(u),
|
|
2241
|
+
"onUpdate:modelValue": n
|
|
2242
|
+
}, null, 8, ["model-value"]),
|
|
2243
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2244
|
+
key: 0,
|
|
2245
|
+
class: "!mt-[8px]",
|
|
2246
|
+
text: e.helperText,
|
|
2247
|
+
state: "error"
|
|
2248
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2249
|
+
], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
|
|
2250
|
+
createVNode(_sfc_main$k, {
|
|
2251
|
+
"model-value": unref(u),
|
|
2252
|
+
"onUpdate:modelValue": n
|
|
2253
|
+
}, null, 8, ["model-value"]),
|
|
2254
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2255
|
+
key: 0,
|
|
2256
|
+
class: "!mt-[8px]",
|
|
2257
|
+
text: e.helperText,
|
|
2258
|
+
state: "error"
|
|
2259
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2260
|
+
], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
|
|
2261
|
+
createVNode(_sfc_main$9, {
|
|
2262
|
+
"model-value": unref(u),
|
|
2263
|
+
"onUpdate:modelValue": n
|
|
2264
|
+
}, null, 8, ["model-value"]),
|
|
2265
|
+
e.helperText ? (openBlock(), createBlock(g, {
|
|
2266
|
+
key: 0,
|
|
2267
|
+
class: "!mt-[8px]",
|
|
2268
|
+
text: e.helperText,
|
|
2269
|
+
state: "error"
|
|
2270
|
+
}, null, 8, ["text"])) : createCommentVNode("", !0)
|
|
2271
|
+
], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(a.field), 1));
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
}), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
2275
|
+
__name: "CampaignSummary",
|
|
2276
|
+
props: {
|
|
2277
|
+
data: {
|
|
2278
|
+
type: Object,
|
|
2279
|
+
required: !0
|
|
2280
|
+
}
|
|
2281
|
+
},
|
|
2282
|
+
setup(e) {
|
|
2283
|
+
return (i, a) => {
|
|
2284
|
+
const r = resolveComponent("FmCard");
|
|
2285
|
+
return openBlock(), createBlock(r, {
|
|
2286
|
+
variant: "outlined",
|
|
2287
|
+
class: "p-16 space-y-8"
|
|
2288
|
+
}, {
|
|
2289
|
+
default: withCtx(() => [
|
|
2290
|
+
_hoisted_1$1,
|
|
2291
|
+
_hoisted_2$1,
|
|
2292
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, u) => (openBlock(), createElementBlock("div", {
|
|
2293
|
+
class: "space-y-4",
|
|
2294
|
+
key: u
|
|
2295
|
+
}, [
|
|
2296
|
+
n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2297
|
+
createElementVNode("div", _hoisted_3$1, toDisplayString(u), 1),
|
|
2298
|
+
createElementVNode("div", _hoisted_4$1, toDisplayString(n), 1)
|
|
2299
|
+
], 64)) : createCommentVNode("", !0)
|
|
2300
|
+
]))), 128))
|
|
2301
|
+
]),
|
|
2302
|
+
_: 1
|
|
2303
|
+
});
|
|
2304
|
+
};
|
|
2305
|
+
}
|
|
2306
|
+
}), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
|
|
2307
|
+
key: 0,
|
|
2308
|
+
class: "max-w-6xl mx-auto"
|
|
2309
|
+
}, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
|
|
2310
|
+
/* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
|
|
2311
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2312
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2313
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2314
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2315
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2316
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2317
|
+
]),
|
|
2318
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2319
|
+
]),
|
|
2320
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
|
|
2321
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
|
|
2322
|
+
/* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
|
|
2323
|
+
/* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
|
|
2324
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
|
|
2325
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2326
|
+
]),
|
|
2327
|
+
/* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
|
|
2328
|
+
])
|
|
2329
|
+
])
|
|
2330
|
+
], -1), _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2331
|
+
__name: "EditCampaignSheet",
|
|
2332
|
+
emits: ["submit:model-value"],
|
|
2333
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
2334
|
+
const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
|
|
2335
|
+
TEMPLATES.VOUCHER
|
|
2336
|
+
), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
|
|
2337
|
+
async function showSheet(visible, type, campaign, selectedTemplate) {
|
|
2338
|
+
var e, i;
|
|
2339
|
+
if (sheetVisible.value = visible, visible == !0) {
|
|
2340
|
+
try {
|
|
2341
|
+
isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
|
|
2342
|
+
} catch {
|
|
2343
|
+
} finally {
|
|
2344
|
+
await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
|
|
2345
|
+
}
|
|
2346
|
+
template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
|
|
2347
|
+
...(i = template.value) == null ? void 0 : i.defaultValue
|
|
2348
|
+
}), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
|
|
2349
|
+
}
|
|
2350
|
+
}
|
|
2351
|
+
async function hideSheet() {
|
|
2352
|
+
Dialog.open({
|
|
2353
|
+
title: "Unsaved Changes",
|
|
2354
|
+
message: "Are you sure you want to discard this changes?",
|
|
2355
|
+
primaryActions: { text: "Discard", close: !0 },
|
|
2356
|
+
secondaryActions: { text: "Cancel", close: !1 }
|
|
2357
|
+
}).onPrimary(() => {
|
|
2358
|
+
sheetVisible.value = !1;
|
|
2359
|
+
}).onSecondary(() => {
|
|
2360
|
+
Dialog.close();
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
const emits = __emit, errors = computed(() => {
|
|
2364
|
+
const e = schema.value.superRefine(campaignRefinement).safeParse(data.value);
|
|
2365
|
+
return e.success ? [] : e.error.errors;
|
|
2366
|
+
});
|
|
2367
|
+
function stepErrors(e = currentStep.value - 1) {
|
|
2368
|
+
const i = template.value.steps[e].groups.flatMap(
|
|
2369
|
+
(a) => a.fields.map((r) => r.property)
|
|
2370
|
+
);
|
|
2371
|
+
return errors.value.filter((a) => i.includes(a.path.join(".")));
|
|
2372
|
+
}
|
|
2373
|
+
__expose({ showSheet });
|
|
2374
|
+
function showSummaryDialog() {
|
|
2375
|
+
Dialog.open({
|
|
2376
|
+
title: "",
|
|
2377
|
+
dialogComponent: _sfc_main$1,
|
|
2378
|
+
dialogComponentProps: {
|
|
2379
|
+
data: data.value
|
|
2380
|
+
}
|
|
2381
|
+
});
|
|
2382
|
+
}
|
|
2383
|
+
function onUpdateProperty(e, i) {
|
|
2384
|
+
if (_.set(data.value, e, i), e == "campaign.event.type") {
|
|
2385
|
+
const a = RuleBuilder.setRuleToGroup(
|
|
2386
|
+
RuleBuilder.scaffoldGroup(),
|
|
2387
|
+
[
|
|
2388
|
+
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2389
|
+
RuleBuilder.scaffoldGroup("g_time"),
|
|
2390
|
+
RuleBuilder.scaffoldGroup("g_user"),
|
|
2391
|
+
RuleBuilder.scaffoldGroup("g_bill")
|
|
2392
|
+
]
|
|
2393
|
+
), r = RuleBuilder.setRuleToGroup(
|
|
2394
|
+
RuleBuilder.scaffoldGroup("g_schedule"),
|
|
2395
|
+
[
|
|
2396
|
+
RuleBuilder.constructEntry(
|
|
2397
|
+
"trigger.date",
|
|
2398
|
+
"_rrule",
|
|
2399
|
+
"RRULE:FREQ=DAILY;INTERVAL=1;BYHOUR=0;BYMINUTE=0;BYSECOND=0;WKST=SU"
|
|
2400
|
+
),
|
|
2401
|
+
RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
|
|
2402
|
+
],
|
|
2403
|
+
"&&"
|
|
2404
|
+
);
|
|
2405
|
+
if (i != "SCHEDULE") {
|
|
2406
|
+
_.set(data.value, "campaign.event.rule", a);
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
_.set(
|
|
2410
|
+
data.value,
|
|
2411
|
+
"campaign.event.rule",
|
|
2412
|
+
RuleBuilder.setRuleToGroup(a, r)
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
|
|
2416
|
+
}
|
|
2417
|
+
async function onUpdateFile(e, i) {
|
|
2418
|
+
return e ? await minor(async () => firebaseStorage.update(i, e), {
|
|
2419
|
+
message: `${e ? "Uploading" : "Removing"} file`,
|
|
2420
|
+
successMessage: `File ${e ? "uploaded" : "removed"} successfully`
|
|
2421
|
+
}) : "";
|
|
2422
|
+
}
|
|
2423
|
+
function isDisable(e) {
|
|
2424
|
+
var i, a;
|
|
2425
|
+
switch (e == null ? void 0 : e.property) {
|
|
2426
|
+
case "campaign.event.type":
|
|
2427
|
+
return ((a = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : a._id) || !1;
|
|
2428
|
+
default:
|
|
2429
|
+
return !1;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
function onSubmit() {
|
|
2433
|
+
const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
|
|
2434
|
+
e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
|
|
2435
|
+
}
|
|
2436
|
+
return (e, i) => {
|
|
2437
|
+
const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), n = resolveComponent("FmStepper"), u = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
|
|
2438
|
+
return openBlock(), createBlock(l, {
|
|
2439
|
+
"fullscreen-size": "lg",
|
|
2440
|
+
modelValue: unref(sheetVisible),
|
|
2441
|
+
"onUpdate:modelValue": [
|
|
2442
|
+
i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
|
|
2443
|
+
i[8] || (i[8] = (t) => sheetVisible.value = t)
|
|
2444
|
+
]
|
|
2445
|
+
}, createSlots({
|
|
2446
|
+
"top-sheet-header": withCtx(() => [
|
|
2447
|
+
createElementVNode("div", _hoisted_1, [
|
|
2448
|
+
createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
|
|
2449
|
+
createElementVNode("div", _hoisted_2, [
|
|
2450
|
+
createVNode(a, {
|
|
2451
|
+
onClick: i[0] || (i[0] = (t) => hideSheet()),
|
|
2452
|
+
label: "Cancel",
|
|
2453
|
+
variant: "tertiary"
|
|
2454
|
+
}),
|
|
2455
|
+
createVNode(a, {
|
|
2456
|
+
onClick: onSubmit,
|
|
2457
|
+
label: "Save",
|
|
2458
|
+
disabled: unref(errors).length > 0
|
|
2459
|
+
}, null, 8, ["disabled"])
|
|
2460
|
+
])
|
|
2461
|
+
])
|
|
2462
|
+
]),
|
|
2463
|
+
_: 2
|
|
2464
|
+
}, [
|
|
2465
|
+
unref(isLoading) ? {
|
|
2466
|
+
name: "default",
|
|
2467
|
+
fn: withCtx(() => [
|
|
2468
|
+
createElementVNode("div", _hoisted_9, [
|
|
2469
|
+
createElementVNode("div", _hoisted_10, [
|
|
2470
|
+
createElementVNode("div", _hoisted_11, [
|
|
2471
|
+
_hoisted_12,
|
|
2472
|
+
createVNode(u, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
|
|
2473
|
+
])
|
|
2474
|
+
])
|
|
2475
|
+
])
|
|
2476
|
+
]),
|
|
2477
|
+
key: "1"
|
|
2478
|
+
} : {
|
|
2479
|
+
name: "default",
|
|
2480
|
+
fn: withCtx(() => [
|
|
2481
|
+
unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
2482
|
+
createVNode(n, {
|
|
2483
|
+
modelValue: unref(currentStep),
|
|
2484
|
+
"onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2485
|
+
orientation: "horizontal",
|
|
2486
|
+
class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
|
|
2487
|
+
}, {
|
|
2488
|
+
default: withCtx(() => [
|
|
2489
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, o) => (openBlock(), createBlock(r, {
|
|
2490
|
+
key: t.name,
|
|
2491
|
+
title: t.name,
|
|
2492
|
+
value: o + 1,
|
|
2493
|
+
error: () => stepErrors(o).length > 0,
|
|
2494
|
+
complete: () => o + 1 <= unref(currentStep)
|
|
2495
|
+
}, null, 8, ["title", "value", "error", "complete"]))), 128))
|
|
2496
|
+
]),
|
|
2497
|
+
_: 1
|
|
2498
|
+
}, 8, ["modelValue"]),
|
|
2499
|
+
createElementVNode("div", _hoisted_4, [
|
|
2500
|
+
createVNode(a, {
|
|
2501
|
+
icon: "close",
|
|
2502
|
+
variant: "tertiary",
|
|
2503
|
+
onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
|
|
2504
|
+
}),
|
|
2505
|
+
createVNode(n, {
|
|
2506
|
+
modelValue: unref(currentStep),
|
|
2507
|
+
"onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
|
|
2508
|
+
orientation: "horizontal",
|
|
2509
|
+
class: "flex-1"
|
|
2510
|
+
}, {
|
|
2511
|
+
default: withCtx(() => [
|
|
2512
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, o) => (openBlock(), createBlock(r, {
|
|
2513
|
+
key: t.name,
|
|
2514
|
+
title: unref(sheetTitle),
|
|
2515
|
+
description: t.name,
|
|
2516
|
+
value: o + 1,
|
|
2517
|
+
error: () => stepErrors(o).length > 0,
|
|
2518
|
+
complete: () => o + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
|
|
2519
|
+
}, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
|
|
2520
|
+
]),
|
|
2521
|
+
_: 1
|
|
2522
|
+
}, 8, ["modelValue"]),
|
|
2523
|
+
createVNode(a, {
|
|
2524
|
+
icon: "info",
|
|
2525
|
+
variant: "tertiary",
|
|
2526
|
+
onClick: i[4] || (i[4] = () => showSummaryDialog())
|
|
2527
|
+
})
|
|
2528
|
+
]),
|
|
2529
|
+
createElementVNode("div", _hoisted_5, [
|
|
2530
|
+
createElementVNode("div", _hoisted_6, [
|
|
2531
|
+
createVNode(JsonViewer, {
|
|
2532
|
+
json: {
|
|
2533
|
+
data: unref(data),
|
|
2534
|
+
errors: unref(errors).map(
|
|
2535
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2536
|
+
),
|
|
2537
|
+
stepErrors: stepErrors().map(
|
|
2538
|
+
(t) => `${t.path.join(".")} - ${t.message}`
|
|
2539
|
+
),
|
|
2540
|
+
schema: unref(schema)
|
|
2541
|
+
}
|
|
2542
|
+
}, null, 8, ["json"]),
|
|
2543
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
|
|
2544
|
+
(t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
|
|
2545
|
+
), (t, o) => (openBlock(), createElementBlock("div", {
|
|
2546
|
+
key: o,
|
|
2547
|
+
class: "space-y-24"
|
|
2548
|
+
}, [
|
|
2549
|
+
createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
|
|
2550
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (f, y) => (openBlock(), createElementBlock("div", { key: y }, [
|
|
2551
|
+
(openBlock(), createBlock(_sfc_main$2, {
|
|
2552
|
+
key: y,
|
|
2553
|
+
field: f,
|
|
2554
|
+
modelValue: unref(_).get(unref(data), f.property),
|
|
2555
|
+
disabled: isDisable(f),
|
|
2556
|
+
"onUpdate:modelValue": (m) => onUpdateProperty(f.property, m),
|
|
2557
|
+
"onUpdate:file": async (m, v) => {
|
|
2558
|
+
const g = await onUpdateFile(m, v);
|
|
2559
|
+
onUpdateProperty(f.property, g || "");
|
|
2560
|
+
},
|
|
2561
|
+
schema: unref(ZodHelper).typeAtPath(
|
|
2562
|
+
unref(schema),
|
|
2563
|
+
f.property,
|
|
2564
|
+
unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
|
|
2565
|
+
),
|
|
2566
|
+
"helper-text": unref(ZodHelper).helperText(unref(errors), f.property),
|
|
2567
|
+
extras: f.extras ? unref(_).get(unref(data), f.extras) : void 0
|
|
2568
|
+
}, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
|
|
2569
|
+
]))), 128))
|
|
2570
|
+
]))), 128)),
|
|
2571
|
+
createElementVNode("div", _hoisted_8, [
|
|
2572
|
+
createVNode(a, {
|
|
2573
|
+
label: "Back",
|
|
2574
|
+
variant: "tertiary",
|
|
2575
|
+
disabled: unref(currentStep) == 1,
|
|
2576
|
+
onClick: i[5] || (i[5] = (t) => currentStep.value--)
|
|
2577
|
+
}, null, 8, ["disabled"]),
|
|
2578
|
+
createVNode(a, {
|
|
2579
|
+
disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
|
|
2580
|
+
label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
|
|
2581
|
+
onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
|
|
2582
|
+
}, null, 8, ["disabled", "label"])
|
|
2583
|
+
])
|
|
2584
|
+
]),
|
|
2585
|
+
createVNode(_sfc_main$1, {
|
|
2586
|
+
data: unref(data),
|
|
2587
|
+
class: "xs:hidden"
|
|
2588
|
+
}, null, 8, ["data"])
|
|
2589
|
+
])
|
|
2590
|
+
])) : createCommentVNode("", !0)
|
|
2591
|
+
]),
|
|
2592
|
+
key: "0"
|
|
2593
|
+
}
|
|
2594
|
+
]), 1032, ["modelValue"]);
|
|
2595
|
+
};
|
|
2596
|
+
}
|
|
2597
|
+
});
|
|
2598
|
+
export {
|
|
2599
|
+
_sfc_main as _
|
|
2600
|
+
};
|