@feedmepos/mf-connect 0.1.38-beta.65 → 0.1.38-beta.67

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