@feedmepos/mf-connect 0.1.70-prod → 0.1.72-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/{Analytic-PyqBxIYV.js → Analytic-CxQKbOnR.js} +163 -163
  2. package/dist/{App-Jvndjs57.js → App-C0HCgYW2.js} +7 -7
  3. package/dist/{Bin-COT0Y0Ho.js → Bin-BFx6j8vs.js} +8 -8
  4. package/dist/{Broadcast-BEXF2mv2.js → Broadcast-CUfwWq6_.js} +8 -8
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-D_2YsnqM.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-2oosZTlv.js} +6 -6
  6. package/dist/{Card-B_PJslck.js → Card-DsMVa01V.js} +16 -16
  7. package/dist/{Collections-BNXcAI8E.js → Collections-DSbNXU78.js} +72 -71
  8. package/dist/{Credit-CbefgVBA.js → Credit-Dp-tSMfE.js} +8 -8
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BWrvk8cN.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BW7V_Nsq.js} +817 -794
  10. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js +348 -0
  11. package/dist/{Experience-D4PlCeQu.js → Experience-DkQbI88m.js} +8 -8
  12. package/dist/{Game-ByPV3v3c.js → Game-BJvtVGC7.js} +9 -9
  13. package/dist/{Index-CTE6GcPE.js → Index-BcHe2Qqe.js} +10 -10
  14. package/dist/{Marketing-CBarYi4e.js → Marketing-BaYjdZpb.js} +6 -6
  15. package/dist/{Member-aiHpHoBw.js → Member-BzrcLN4X.js} +10 -10
  16. package/dist/{MemberList-ZfDDJKU8.js → MemberList-_uD6WR--.js} +25 -25
  17. package/dist/{MemberTransactions-YPSNz6QZ.js → MemberTransactions-DIG5noli.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js → MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js} +7 -7
  19. package/dist/{Mission-CX9m_lVc.js → Mission-B0h7ECrd.js} +9 -9
  20. package/dist/{Overview-93wWO0vg.js → Overview-BfjTYcaf.js} +18 -18
  21. package/dist/{Point-CvBoOpox.js → Point-yBqZgf08.js} +8 -8
  22. package/dist/{Promotion-DzABoX1Q.js → Promotion-Bh8yiwPe.js} +9 -9
  23. package/dist/{Queue-CLsAkssT.js → Queue-CMMyxmWP.js} +10 -10
  24. package/dist/{Record-D7H9PUO9.js → Record-DSLpbGVk.js} +8 -8
  25. package/dist/{Reward-RuXRWNEz.js → Reward-BzAIdcgx.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BhooU8k4.js → RewardGroup.vue_vue_type_script_setup_true_lang-DoGsPRbi.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js → RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js} +595 -591
  28. package/dist/{Segment-DttKqwI6.js → Segment-BVH3YC8I.js} +22 -22
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-Bc52DzKg.js → SelectItems.vue_vue_type_script_setup_true_lang-BkHWRVba.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cs31sJoR.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D-4QjkWh.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DVDJSZ2m.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-CzCSXHge.js} +3 -3
  32. package/dist/{Setting-B-OauIYc.js → Setting-CFLtqHFJ.js} +12 -12
  33. package/dist/{SettingAdvertisements-DgeX4O4l.js → SettingAdvertisements-CvFG5Fun.js} +11 -11
  34. package/dist/{Store-DXolnTox.js → Store-CHcszdPx.js} +19 -19
  35. package/dist/{StoreRewards-AZL1ZRuo.js → StoreRewards-BXrXO3Cg.js} +13 -13
  36. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-EdoXx3OE.js → StoreTransactions.vue_vue_type_script_setup_true_lang-Clou5scZ.js} +19 -19
  37. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js} +1 -1
  38. package/dist/{Tier-C95me-Y-.js → Tier-98o6YCz1.js} +19 -19
  39. package/dist/{Title-Cl3aYevK.js → Title-BmvCMh9F.js} +18 -18
  40. package/dist/{Transaction-DQXVmId0.js → Transaction-D07dnpCB.js} +2 -2
  41. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js} +6 -6
  42. package/dist/{Voucher-C-P0YBPO.js → Voucher-BX5Dy6oL.js} +12 -12
  43. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js +421 -0
  44. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DXArW7Vz.js → ZodTextField.vue_vue_type_script_setup_true_lang-TkZAyKkk.js} +1 -1
  45. package/dist/{app-B6euOjfV.js → app-7Ivt_7kS.js} +1974 -914
  46. package/dist/{app-7__6-fNI.js → app-C98aAmiY.js} +1 -1
  47. package/dist/app.js +1 -1
  48. package/dist/{business-qci70l-A.js → business-B55rTB5S.js} +1 -1
  49. package/dist/{campaign-FPNFOCIx.js → campaign-RS-eYMBW.js} +1 -1
  50. package/dist/campaign-dSphYCws.js +226 -0
  51. package/dist/{campaign.enum-BshKRCYQ.js → campaign.enum-BZRXf9TI.js} +1 -1
  52. package/dist/{campaign.fn-B5brKxfK.js → campaign.fn-D_b763b6.js} +73 -73
  53. package/dist/{collectible.enum-BYIdgjMd.js → collectible.enum-ANnJMtnj.js} +1 -1
  54. package/dist/{collection.fn-Czegj-3i.js → collection.fn-BObHG1bS.js} +2 -2
  55. package/dist/{dto-CoTw6KOu.js → dto-BA2PX6Mi.js} +4 -4
  56. package/dist/{effect-AUk5fAKr.js → effect-DDAGMMzr.js} +1 -1
  57. package/dist/{email-addresses-CzoIsTNA.js → email-addresses-jx17hvtN.js} +1 -1
  58. package/dist/{export-a4tq7KAV.js → export-DI_2PZhY.js} +3 -3
  59. package/dist/{helper-BPAmOP7l.js → helper-ApDLcgT1.js} +1 -1
  60. package/dist/{index-DFrGNKGq.js → index-B5J1HBw3.js} +1 -1
  61. package/dist/{index-DyNcdfkp.js → index-BCOxYH7r.js} +1 -1
  62. package/dist/{index-CPHYlicy.js → index-BbNMr2Lt.js} +3 -3
  63. package/dist/{index-DROE-IrQ.js → index-C1tcqVNm.js} +3 -3
  64. package/dist/{index-BqKYZ98Q.js → index-CEeIezsZ.js} +1 -1
  65. package/dist/{index-CGryjlaX.js → index-CN0ree8J.js} +1 -1
  66. package/dist/{index-CQ4_BfJL.js → index-Cl85lvDM.js} +1 -1
  67. package/dist/{index-ZC8SINKX.js → index-CtpRdZKH.js} +2 -2
  68. package/dist/{index-BioBPRnA.js → index-DUfWM7U3.js} +1023 -1023
  69. package/dist/{index-DD6t-ukB.js → index-D_9bRGRa.js} +1 -1
  70. package/dist/{index-DdTu5PZ4.js → index-Dg6gbVXO.js} +1 -1
  71. package/dist/{index-BicoBDJX.js → index-Dpe36Jv6.js} +4 -4
  72. package/dist/{index-CKd9UEIG.js → index-DtB1XLw6.js} +183 -178
  73. package/dist/{index.esm2017-DBUyLYkl.js → index.esm2017-CcAT1nnu.js} +1 -1
  74. package/dist/{loading-E0yVUdfI.js → loading-Hh5FSOP9.js} +1 -1
  75. package/dist/{membership-yP4z8gbJ.js → membership-DXQf9Mj3.js} +3 -3
  76. package/dist/{money-DhnXYNa2.js → money-OBHKTSCa.js} +1 -1
  77. package/dist/{number-XYUCGxPv.js → number-DTqujv4j.js} +1 -1
  78. package/dist/{objectid-BfQ_M2eI.js → objectid-BkZDKSpn.js} +1 -1
  79. package/dist/{campaign-D_eIup7X.js → plugins-CQqQawn6.js} +784 -776
  80. package/dist/{reward-B3J0dhNd.js → reward-n9uPwsH1.js} +1 -1
  81. package/dist/{rule-BzqUqJYa.js → rule-BgsibUNE.js} +3 -3
  82. package/dist/{rule-builder-BvtsmkMr.js → rule-builder-BkzqGukH.js} +1 -1
  83. package/dist/template-gXT-yGOY.js +188 -0
  84. package/dist/{timezone-BCyUSe2a.js → timezone-X-iXAUqa.js} +1 -1
  85. package/dist/{trigger-DCSJm_qA.js → trigger-DEZuV7Fw.js} +4 -4
  86. package/dist/{user-BwjCcgQT.js → user-DG_FfcGk.js} +1 -1
  87. package/dist/{vue-i18n-BLkfzQts.js → vue-i18n-BB1YkgAs.js} +201 -201
  88. package/dist/{xlsx-D2Uw1Ytp.js → xlsx-CJQa9ako.js} +1 -1
  89. package/package.json +1 -1
  90. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js +0 -348
  91. package/dist/VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js +0 -419
  92. package/dist/plugins-bpWCIR9y.js +0 -208
  93. package/dist/template-BFr8iIV_.js +0 -190
@@ -1,42 +1,42 @@
1
- import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
1
+ import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, toDisplayString, Fragment, renderList, normalizeClass, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-B6euOjfV.js";
3
+ import { z } from "./app-7Ivt_7kS.js";
4
4
  import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-D_eIup7X.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CoTw6KOu.js";
7
- import { u as useMembershipStore } from "./membership-yP4z8gbJ.js";
8
- import { u as useBusinessStore } from "./business-qci70l-A.js";
9
- import "./index-ZC8SINKX.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BvtsmkMr.js";
5
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-BA2PX6Mi.js";
6
+ import { u as useMembershipStore } from "./membership-DXQf9Mj3.js";
7
+ import { u as useBusinessStore } from "./business-B55rTB5S.js";
8
+ import "./index-CtpRdZKH.js";
9
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BkzqGukH.js";
11
10
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
11
  import { h as hooks } from "./moment-D7p2TMB-.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-BshKRCYQ.js";
12
+ import { f as featureVersionMapping } from "./campaign.enum-BZRXf9TI.js";
14
13
  import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-D1KQpDGg.js";
15
- import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-BVdF1Urm.js";
16
- import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-mHmnkhIP.js";
17
- import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-D8Kfo_M8.js";
18
- import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-CX4uEjpm.js";
19
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-bpWCIR9y.js";
20
- import { u as useI18n } from "./vue-i18n-BLkfzQts.js";
21
- import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-DCSJm_qA.js";
22
- import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-DyJKk8W7.js";
23
- import { C as CountryTimezone, m as moment } from "./timezone-BCyUSe2a.js";
24
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BzqUqJYa.js";
14
+ import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-D7QHcodO.js";
15
+ import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-BEpXudTV.js";
16
+ import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DHvItthe.js";
17
+ import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-B7qMLC2M.js";
18
+ import { p as prompt, f as firebaseStorage } from "./plugins-CQqQawn6.js";
19
+ import { u as useI18n } from "./vue-i18n-BB1YkgAs.js";
20
+ import { T as TypeToTriggerOptions, _ as _sfc_main$u, b as _sfc_main$v } from "./trigger-DEZuV7Fw.js";
21
+ import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-Cm4jVJBM.js";
22
+ import { C as CountryTimezone, m as moment } from "./timezone-X-iXAUqa.js";
23
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BgsibUNE.js";
25
24
  import { useCoreStore } from "@feedmepos/mf-common";
26
- import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DRn1HmAb.js";
27
- import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-BicoBDJX.js";
28
- import { T as TEMPLATES } from "./index-CKd9UEIG.js";
29
- import "./index-DD6t-ukB.js";
30
- import "./index-CPHYlicy.js";
31
- import { a as F_GAME_TYPE } from "./collectible.enum-BYIdgjMd.js";
32
- import { u as useLoading } from "./loading-E0yVUdfI.js";
33
- import { i as initCollectibleConfig } from "./helper-BPAmOP7l.js";
34
- import { C as CollectionUtils } from "./collection.fn-Czegj-3i.js";
25
+ import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-BlXCP_IR.js";
26
+ import { t as FdoCreditLoyaltyReward, u as FdtoRandomReward, v as F_MISSION_TYPE, w as FdoThresholdCreditReward, x as FdtoThresholdReward, y as FdoMission } from "./index-Dpe36Jv6.js";
27
+ import { T as TEMPLATES } from "./index-DtB1XLw6.js";
28
+ import "./index-D_9bRGRa.js";
29
+ import "./index-BbNMr2Lt.js";
30
+ import { a as F_GAME_TYPE } from "./collectible.enum-ANnJMtnj.js";
31
+ import { u as useLoading } from "./loading-Hh5FSOP9.js";
32
+ import { i as initCollectibleConfig } from "./helper-ApDLcgT1.js";
33
+ import { C as CollectionUtils } from "./collection.fn-BObHG1bS.js";
35
34
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
36
- import "./index-BioBPRnA.js";
35
+ import { c as getCampaignSummaryObject } from "./campaign-dSphYCws.js";
36
+ import "./index-DUfWM7U3.js";
37
37
  import { useDialog } from "@feedmepos/ui-library";
38
- import { u as useCampaignStore } from "./campaign-FPNFOCIx.js";
39
- import { S as SvcConfig } from "./index-DROE-IrQ.js";
38
+ import { u as useCampaignStore } from "./campaign-RS-eYMBW.js";
39
+ import { S as SvcConfig } from "./index-C1tcqVNm.js";
40
40
  import { a as cleanPF } from "./object-qECH92oz.js";
41
41
  const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
42
42
  __name: "TimeRuleGroup",
@@ -49,82 +49,82 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
49
49
  },
50
50
  emits: ["update:model-value"],
51
51
  setup(e, { emit: m }) {
52
- const { t: a } = useI18n(), i = e, u = m, d = ref(
53
- !i.modelValue || !i.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(i.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
52
+ const { t: o } = useI18n(), c = e, s = m, p = ref(
53
+ !c.modelValue || !c.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(c.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
54
54
  );
55
- watch(d, async (o, n) => {
56
- var s;
57
- if (n == "custom" && o == "all_time" && RuleBuilder.getRules((s = i.modelValue) == null ? void 0 : s.rules.g_time).length > 0) {
58
- const y = await prompt.confirm(
59
- a("connect.template.rule.time.confirm_remove"),
60
- a("connect.common.confirm"),
61
- a("connect.common.confirm"),
62
- a("connect.common.cancel")
55
+ watch(p, async (l, i) => {
56
+ var a;
57
+ if (i == "custom" && l == "all_time" && RuleBuilder.getRules((a = c.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
58
+ const f = await prompt.confirm(
59
+ o("connect.template.rule.time.confirm_remove"),
60
+ o("connect.common.confirm"),
61
+ o("connect.common.confirm"),
62
+ o("connect.common.cancel")
63
63
  );
64
- y && u(
64
+ f && s(
65
65
  "update:model-value",
66
66
  RuleBuilder.setRuleToGroup(
67
- i.modelValue ?? RuleBuilder.scaffoldGroup(),
67
+ c.modelValue ?? RuleBuilder.scaffoldGroup(),
68
68
  RuleBuilder.scaffoldGroup("g_time")
69
69
  )
70
- ), d.value = y ? o : n;
70
+ ), p.value = f ? l : i;
71
71
  }
72
72
  });
73
- async function l(o) {
74
- var n;
75
- if (o == "custom" && RuleBuilder.getRules((n = i.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
73
+ async function n(l) {
74
+ var i;
75
+ if (l == "custom" && RuleBuilder.getRules((i = c.modelValue) == null ? void 0 : i.rules.g_time).length > 0) {
76
76
  if (!await prompt.confirm(
77
- a("connect.template.rule.time.confirm_remove"),
78
- a("connect.common.confirm"),
79
- a("connect.common.confirm"),
80
- a("connect.common.cancel")
77
+ o("connect.template.rule.time.confirm_remove"),
78
+ o("connect.common.confirm"),
79
+ o("connect.common.confirm"),
80
+ o("connect.common.cancel")
81
81
  )) {
82
- d.value = "all_time";
82
+ p.value = "all_time";
83
83
  return;
84
84
  }
85
- u(
85
+ s(
86
86
  "update:model-value",
87
87
  RuleBuilder.setRuleToGroup(
88
- i.modelValue ?? RuleBuilder.scaffoldGroup(),
88
+ c.modelValue ?? RuleBuilder.scaffoldGroup(),
89
89
  RuleBuilder.scaffoldGroup("g_time")
90
90
  )
91
91
  );
92
92
  }
93
93
  }
94
- return (o, n) => {
95
- var v;
96
- const s = resolveComponent("FmRadio"), y = resolveComponent("FmRadioGroup");
94
+ return (l, i) => {
95
+ var y;
96
+ const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
97
97
  return openBlock(), createElementBlock("div", _hoisted_1$g, [
98
- createVNode(y, {
99
- modelValue: unref(d),
98
+ createVNode(f, {
99
+ modelValue: unref(p),
100
100
  "onUpdate:modelValue": [
101
- n[0] || (n[0] = (h) => isRef(d) ? d.value = h : null),
102
- n[1] || (n[1] = (h) => l(h))
101
+ i[0] || (i[0] = (v) => isRef(p) ? p.value = v : null),
102
+ i[1] || (i[1] = (v) => n(v))
103
103
  ]
104
104
  }, {
105
105
  default: withCtx(() => [
106
- createVNode(s, {
107
- label: unref(a)("connect.template.rule.time.all_time"),
106
+ createVNode(a, {
107
+ label: unref(o)("connect.template.rule.time.all_time"),
108
108
  value: "all_time"
109
109
  }, null, 8, ["label"]),
110
- createVNode(s, {
111
- label: unref(a)("connect.template.rule.time.custom"),
110
+ createVNode(a, {
111
+ label: unref(o)("connect.template.rule.time.custom"),
112
112
  value: "custom"
113
113
  }, null, 8, ["label"])
114
114
  ]),
115
115
  _: 1
116
116
  }, 8, ["modelValue"]),
117
- unref(d) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
117
+ unref(p) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
118
118
  key: 0,
119
119
  class: "!mt-[0px]",
120
120
  "include-only": "trigger",
121
121
  "trigger-type": "SCHEDULE",
122
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
123
- "onUpdate:modelValue": n[2] || (n[2] = (h) => u(
122
+ "model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
123
+ "onUpdate:modelValue": i[2] || (i[2] = (v) => s(
124
124
  "update:model-value",
125
125
  unref(RuleBuilder).setRuleToGroup(
126
126
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
127
- h,
127
+ v,
128
128
  "&&"
129
129
  )
130
130
  ))
@@ -141,28 +141,28 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
141
141
  },
142
142
  emits: ["update:model-value"],
143
143
  setup(e, { emit: m }) {
144
- const a = e, i = m, u = computed(() => {
145
- const { property: d, operator: l, equator: o } = RuleBuilder.simplify(
146
- a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
144
+ const { t: o } = useI18n(), c = e, s = m, p = computed(() => {
145
+ const { property: n, operator: l, equator: i } = RuleBuilder.simplify(
146
+ c.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
147
147
  op: "before",
148
148
  x: 1
149
149
  })
150
150
  );
151
151
  return {
152
- property: d,
152
+ property: n,
153
153
  operator: l,
154
- equator: o
154
+ equator: i
155
155
  };
156
156
  });
157
- return (d, l) => {
158
- const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
157
+ return (n, l) => {
158
+ const i = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
159
159
  return openBlock(), createElementBlock("div", null, [
160
- createVNode(o, {
161
- label: "On birthday",
160
+ createVNode(i, {
161
+ label: unref(o)("connect.template.rule.birthday.on_birthday"),
162
162
  value: "_isRange-day",
163
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
163
+ "model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
164
164
  "onUpdate:modelValue": l[0] || (l[0] = () => {
165
- i(
165
+ s(
166
166
  "update:model-value",
167
167
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
168
168
  op: "this",
@@ -171,13 +171,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
171
171
  })
172
172
  );
173
173
  })
174
- }, null, 8, ["model-value"]),
175
- createVNode(o, {
176
- label: "N days before birthday",
174
+ }, null, 8, ["label", "model-value"]),
175
+ createVNode(i, {
176
+ label: unref(o)("connect.template.rule.birthday.days_before"),
177
177
  value: "_isDay",
178
- "model-value": unref(u).operator,
178
+ "model-value": unref(p).operator,
179
179
  "onUpdate:modelValue": l[1] || (l[1] = () => {
180
- i(
180
+ s(
181
181
  "update:model-value",
182
182
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
183
183
  op: "after",
@@ -186,27 +186,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
186
186
  })
187
187
  );
188
188
  })
189
- }, null, 8, ["model-value"]),
190
- unref(u).operator == "_isDay" ? (openBlock(), createBlock(n, {
189
+ }, null, 8, ["label", "model-value"]),
190
+ unref(p).operator == "_isDay" ? (openBlock(), createBlock(a, {
191
191
  key: 0,
192
- label: "Days before birthday",
192
+ label: unref(o)("connect.template.rule.birthday.days_before_label"),
193
193
  "show-steppers": !1,
194
- "model-value": unref(u).equator.x,
195
- "onUpdate:modelValue": l[2] || (l[2] = (s) => i(
194
+ "model-value": unref(p).equator.x,
195
+ "onUpdate:modelValue": l[2] || (l[2] = (f) => s(
196
196
  "update:model-value",
197
197
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
198
198
  op: "after",
199
- x: s,
199
+ x: f,
200
200
  ignoreYear: !0
201
201
  })
202
202
  ))
203
- }, null, 8, ["model-value"])) : createCommentVNode("", !0),
204
- createVNode(o, {
205
- label: "In birthday week",
203
+ }, null, 8, ["label", "model-value"])) : createCommentVNode("", !0),
204
+ createVNode(i, {
205
+ label: unref(o)("connect.template.rule.birthday.in_birthday_week"),
206
206
  value: "_isRange-week",
207
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
207
+ "model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
208
208
  "onUpdate:modelValue": l[3] || (l[3] = () => {
209
- i(
209
+ s(
210
210
  "update:model-value",
211
211
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
212
212
  op: "this",
@@ -215,13 +215,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
215
215
  })
216
216
  );
217
217
  })
218
- }, null, 8, ["model-value"]),
219
- createVNode(o, {
220
- label: "In birthday month",
218
+ }, null, 8, ["label", "model-value"]),
219
+ createVNode(i, {
220
+ label: unref(o)("connect.template.rule.birthday.in_birthday_month"),
221
221
  value: "_isRange-month",
222
- "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
222
+ "model-value": `${unref(p).operator}-${unref(p).equator.unit}`,
223
223
  "onUpdate:modelValue": l[4] || (l[4] = () => {
224
- i(
224
+ s(
225
225
  "update:model-value",
226
226
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
227
227
  op: "this",
@@ -230,11 +230,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
230
230
  })
231
231
  );
232
232
  })
233
- }, null, 8, ["model-value"])
233
+ }, null, 8, ["label", "model-value"])
234
234
  ]);
235
235
  };
236
236
  }
237
- }), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$c = { class: "grid grid-cols-3 gap-16" }, _hoisted_3$a = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
237
+ }), _hoisted_1$f = { class: "space-y-16" }, _hoisted_2$c = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$a = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
238
238
  __name: "CampaignTriggerInput",
239
239
  props: {
240
240
  campaignType: {
@@ -251,30 +251,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
251
251
  },
252
252
  emits: ["update:model-value"],
253
253
  setup(e, { emit: m }) {
254
- const a = e, i = m, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
255
- (d) => d.value == a.modelValue
256
- ) : TypeToTriggerOptions[a.campaignType]);
257
- return (d, l) => {
258
- const o = resolveComponent("FmCard");
254
+ const { t: o } = useI18n(), c = e, s = m, p = computed(() => c.disabled ? TypeToTriggerOptions[c.campaignType].filter(
255
+ (n) => n.value == c.modelValue
256
+ ) : TypeToTriggerOptions[c.campaignType]);
257
+ return (n, l) => {
258
+ const i = resolveComponent("FmCard");
259
259
  return openBlock(), createElementBlock("div", _hoisted_1$f, [
260
- l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1)),
261
- createElementVNode("div", _hoisted_2$c, [
262
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
260
+ createElementVNode("div", _hoisted_2$c, toDisplayString(unref(o)("connect.campaign.trigger.description")), 1),
261
+ createElementVNode("div", _hoisted_3$a, [
262
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
263
263
  variant: "outlined",
264
- disabled: a.disabled,
264
+ disabled: c.disabled,
265
265
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
266
- "col-span-3": unref(u).length == 1,
267
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
268
- "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
266
+ "col-span-3": unref(p).length == 1,
267
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
268
+ "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
269
269
  }]),
270
270
  onClick: () => {
271
- a.modelValue != n.value && !a.disabled && i("update:model-value", n.value);
271
+ c.modelValue != a.value && !c.disabled && s("update:model-value", a.value);
272
272
  },
273
- key: n.name
273
+ key: a.name
274
274
  }, {
275
275
  default: withCtx(() => [
276
- createElementVNode("div", _hoisted_3$a, toDisplayString(n.name), 1),
277
- createElementVNode("div", _hoisted_4$7, toDisplayString(n.description), 1)
276
+ createElementVNode("div", _hoisted_4$9, toDisplayString(a.name), 1),
277
+ createElementVNode("div", _hoisted_5$6, toDisplayString(a.description), 1)
278
278
  ]),
279
279
  _: 2
280
280
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -296,26 +296,26 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
296
296
  },
297
297
  emits: ["update:model-value"],
298
298
  setup(e, { emit: m }) {
299
- const a = m;
300
- return (i, u) => {
301
- const d = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
302
- return openBlock(), createBlock(o, {
299
+ const o = m;
300
+ return (c, s) => {
301
+ const p = resolveComponent("FmButton"), n = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
302
+ return openBlock(), createBlock(l, {
303
303
  label: e.label,
304
304
  "model-value": e.modelValue || "",
305
- "onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
305
+ "onUpdate:modelValue": s[1] || (s[1] = (i) => o("update:model-value", i))
306
306
  }, {
307
- "trigger-button": withCtx(({ opened: n }) => [
308
- createVNode(l, {
307
+ "trigger-button": withCtx(({ opened: i }) => [
308
+ createVNode(n, {
309
309
  class: "flex items-center",
310
310
  "prepend-icon": "calendar_month",
311
- "icon-outlined": !n
311
+ "icon-outlined": !i
312
312
  }, {
313
313
  append: withCtx(() => [
314
- e.modelValue ? (openBlock(), createBlock(d, {
314
+ e.modelValue ? (openBlock(), createBlock(p, {
315
315
  key: 0,
316
316
  variant: "tertiary",
317
317
  icon: "clear",
318
- onClick: u[0] || (u[0] = (s) => (s.stopPropagation(), a("update:model-value", null)))
318
+ onClick: s[0] || (s[0] = (a) => (a.stopPropagation(), o("update:model-value", null)))
319
319
  })) : createCommentVNode("", !0)
320
320
  ]),
321
321
  default: withCtx(() => [
@@ -330,7 +330,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
330
330
  }, 8, ["label", "model-value"]);
331
331
  };
332
332
  }
333
- }), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$b = { class: "flex-1 xs:w-full" }, _hoisted_3$9 = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
333
+ }), _hoisted_1$e = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$b = { class: "flex-1 xs:w-full" }, _hoisted_3$9 = { class: "mt-5 xs:hidden" }, _hoisted_4$8 = { class: "flex-1 xs:w-full" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
334
334
  __name: "DateRangeInput",
335
335
  props: {
336
336
  modelValue: {
@@ -340,36 +340,36 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
340
340
  },
341
341
  emits: ["update:model-value"],
342
342
  setup(e, { emit: m }) {
343
- const a = m;
344
- return (i, u) => {
345
- var d, l;
343
+ const { t: o } = useI18n(), c = m;
344
+ return (s, p) => {
345
+ var n, l;
346
346
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
347
347
  createElementVNode("div", _hoisted_2$b, [
348
348
  createVNode(_sfc_main$f, {
349
- "model-value": ((d = e.modelValue) == null ? void 0 : d.startDate) ?? null,
350
- label: "Start date",
351
- "onUpdate:modelValue": u[0] || (u[0] = (o) => {
352
- var n;
353
- return a("update:model-value", {
354
- startDate: o,
355
- endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
349
+ "model-value": ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
350
+ label: unref(o)("connect.common.startDate"),
351
+ "onUpdate:modelValue": p[0] || (p[0] = (i) => {
352
+ var a;
353
+ return c("update:model-value", {
354
+ startDate: i,
355
+ endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
356
356
  });
357
357
  })
358
- }, null, 8, ["model-value"])
358
+ }, null, 8, ["model-value", "label"])
359
359
  ]),
360
- u[2] || (u[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
361
- createElementVNode("div", _hoisted_3$9, [
360
+ createElementVNode("div", _hoisted_3$9, toDisplayString(unref(o)("connect.common.to")), 1),
361
+ createElementVNode("div", _hoisted_4$8, [
362
362
  createVNode(_sfc_main$f, {
363
363
  "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
364
- label: "End date",
365
- "onUpdate:modelValue": u[1] || (u[1] = (o) => {
366
- var n;
367
- return a("update:model-value", {
368
- startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
369
- endDate: o
364
+ label: unref(o)("connect.common.endDate"),
365
+ "onUpdate:modelValue": p[1] || (p[1] = (i) => {
366
+ var a;
367
+ return c("update:model-value", {
368
+ startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
369
+ endDate: i
370
370
  });
371
371
  })
372
- }, null, 8, ["model-value"])
372
+ }, null, 8, ["model-value", "label"])
373
373
  ])
374
374
  ]);
375
375
  };
@@ -377,7 +377,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
377
377
  }), _hoisted_1$d = { class: "space-y-8" }, _hoisted_2$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = {
378
378
  key: 0,
379
379
  class: "space-y-4"
380
- }, _hoisted_4$6 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$3 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
380
+ }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$5 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
381
381
  __name: "ScheduleRuleInput",
382
382
  props: {
383
383
  modelValue: {
@@ -393,35 +393,38 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
393
393
  },
394
394
  emits: ["update:model-value"],
395
395
  setup(e, { emit: m }) {
396
- const a = e, i = m, u = useCoreStore(), d = computed(
397
- () => CountryTimezone[u.currentCountry.value || "MY"]
396
+ const { t: o } = useI18n(), c = e, s = m, p = useCoreStore(), n = computed(
397
+ () => CountryTimezone[p.currentCountry.value || "MY"]
398
398
  );
399
399
  function l() {
400
- const g = RuleBuilder.getRules(a.modelValue);
401
- return g.length == 0 ? "fixed" : g.some(
402
- (c) => isRuleEntry(c) && RuleBuilder.simplify(c).operator == "_rrule"
400
+ const u = RuleBuilder.getRules(c.modelValue);
401
+ return u.length == 0 ? "fixed" : u.some(
402
+ (r) => isRuleEntry(r) && RuleBuilder.simplify(r).operator == "_rrule"
403
403
  ) ? "repeating" : "fixed";
404
404
  }
405
- const o = ref(l()), n = ref(!1), s = computed(() => {
406
- const g = RuleBuilder.getRules(a.modelValue), c = g.find(
407
- (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
408
- ), r = g.find(
409
- (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.time"
405
+ const i = ref(l()), a = ref(!1), f = computed(() => [
406
+ { label: o("connect.template.rule.schedule.fixed"), value: "fixed" },
407
+ { label: o("connect.template.rule.schedule.repeating"), value: "repeating" }
408
+ ]), y = computed(() => {
409
+ const u = RuleBuilder.getRules(c.modelValue), r = u.find(
410
+ (g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.date"
411
+ ), d = u.find(
412
+ (g) => isRuleEntry(g) && RuleBuilder.simplify(g).property == "trigger.time"
410
413
  );
411
414
  return {
412
- date: c ? RuleBuilder.simplify(c).equator : null,
413
- time: r ? RuleBuilder.simplify(r).equator : null
415
+ date: r ? RuleBuilder.simplify(r).equator : null,
416
+ time: d ? RuleBuilder.simplify(d).equator : null
414
417
  };
415
- }), y = computed(
418
+ }), v = computed(
416
419
  () => calculateNextScheduleAt(
417
- a.modelValue,
420
+ c.modelValue,
418
421
  /* @__PURE__ */ new Date(),
419
- a.startDate ? new Date(a.startDate) : void 0,
420
- a.endDate ? new Date(a.endDate) : void 0
422
+ c.startDate ? new Date(c.startDate) : void 0,
423
+ c.endDate ? new Date(c.endDate) : void 0
421
424
  )
422
425
  );
423
- function v(g) {
424
- const c = g.label.toLowerCase(), r = c == "fixed" ? [
426
+ function C(u) {
427
+ const r = u.value, d = r == "fixed" ? [
425
428
  RuleBuilder.constructEntry(
426
429
  "trigger.date",
427
430
  "_isOnDate",
@@ -436,73 +439,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
436
439
  ),
437
440
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
438
441
  ];
439
- i(
442
+ s(
440
443
  "update:model-value",
441
444
  RuleBuilder.setRuleToGroup(
442
445
  RuleBuilder.scaffoldGroup("g_schedule"),
443
- r
446
+ d
444
447
  )
445
- ), o.value = c;
448
+ ), i.value = r;
446
449
  }
447
- function h(g) {
448
- o.value == "fixed" ? i(
450
+ function b(u) {
451
+ i.value == "fixed" ? s(
449
452
  "update:model-value",
450
453
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
451
454
  RuleBuilder.constructEntry(
452
455
  "trigger.date",
453
456
  "_isOnDate",
454
- g.date
457
+ u.date
455
458
  ),
456
459
  RuleBuilder.constructEntry(
457
460
  "trigger.time",
458
461
  "_isOnTime",
459
- g.time
462
+ u.time
460
463
  )
461
464
  ])
462
- ) : i(
465
+ ) : s(
463
466
  "update:model-value",
464
467
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
465
468
  RuleBuilder.constructEntry(
466
469
  "trigger.date",
467
470
  "_rrule",
468
- g.date
471
+ u.date
469
472
  ),
470
473
  RuleBuilder.constructEntry(
471
474
  "trigger.time",
472
475
  "_isOnTime",
473
- g.time
476
+ u.time
474
477
  )
475
478
  ])
476
479
  );
477
480
  }
478
- return (g, c) => {
479
- const r = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), f = resolveComponent("FmIcon"), b = resolveComponent("FmTooltip"), C = resolveComponent("FmField"), V = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), k = resolveComponent("FmHelperText");
481
+ return (u, r) => {
482
+ const d = resolveComponent("FmButtonGroup"), g = resolveComponent("FmTimePicker"), k = resolveComponent("FmIcon"), V = resolveComponent("FmTooltip"), x = resolveComponent("FmField"), B = resolveComponent("FmCard"), h = resolveComponent("FmPopover"), R = resolveComponent("FmDatePicker"), S = resolveComponent("FmHelperText");
480
483
  return openBlock(), createElementBlock(Fragment, null, [
481
- createVNode(r, {
482
- items: [{ label: "Fixed" }, { label: "Repeating" }],
483
- "model-value": { label: unref(cases).title(unref(o)) },
484
- "onUpdate:modelValue": v,
484
+ createVNode(d, {
485
+ items: unref(f),
486
+ "model-value": unref(f).find((E) => E.value === unref(i)) ?? null,
487
+ "onUpdate:modelValue": C,
485
488
  class: "mb-8"
486
- }, null, 8, ["model-value"]),
489
+ }, null, 8, ["items", "model-value"]),
487
490
  createElementVNode("div", _hoisted_1$d, [
488
491
  createElementVNode("div", _hoisted_2$a, [
489
- createVNode(p, {
490
- label: "Notify time",
491
- "model-value": unref(s).time,
492
- "onUpdate:modelValue": c[0] || (c[0] = (B) => h({ date: unref(s).date, time: B })),
493
- "helper-text": unref(s).time ? void 0 : "Time is required",
494
- "helper-state": unref(s).time ? void 0 : "error"
495
- }, null, 8, ["model-value", "helper-text", "helper-state"]),
496
- unref(o) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
497
- createElementVNode("div", _hoisted_4$6, [
498
- c[5] || (c[5] = createElementVNode("div", null, "Notify date", -1)),
499
- unref(s).date ? (openBlock(), createBlock(b, {
492
+ createVNode(g, {
493
+ label: unref(o)("connect.template.rule.schedule.notify_time"),
494
+ "model-value": unref(y).time,
495
+ "onUpdate:modelValue": r[0] || (r[0] = (E) => b({ date: unref(y).date, time: E })),
496
+ "helper-text": unref(y).time ? void 0 : unref(o)("connect.template.rule.schedule.time_required"),
497
+ "helper-state": unref(y).time ? void 0 : "error"
498
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"]),
499
+ unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$8, [
500
+ createElementVNode("div", _hoisted_4$7, [
501
+ createElementVNode("div", null, toDisplayString(unref(o)("connect.template.rule.schedule.notify_date")), 1),
502
+ unref(y).date ? (openBlock(), createBlock(V, {
500
503
  key: 0,
501
504
  "z-index": 9999,
502
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options)
505
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options)
503
506
  }, {
504
507
  default: withCtx(() => [
505
- createVNode(f, {
508
+ createVNode(k, {
506
509
  name: "info",
507
510
  size: "sm",
508
511
  outline: !0
@@ -511,30 +514,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
511
514
  _: 1
512
515
  }, 8, ["content"])) : createCommentVNode("", !0)
513
516
  ]),
514
- createVNode(x, {
515
- "show-popover": unref(n),
516
- onPopoverChanged: c[3] || (c[3] = (B) => n.value = B)
517
+ createVNode(h, {
518
+ "show-popover": unref(a),
519
+ onPopoverChanged: r[3] || (r[3] = (E) => a.value = E)
517
520
  }, {
518
521
  "popover-button": withCtx(() => [
519
- createVNode(C, {
522
+ createVNode(x, {
520
523
  class: "cursor-pointer",
521
- "helper-text": unref(s).date ? void 0 : "Date is required",
522
- "helper-state": unref(s).date ? void 0 : "error"
524
+ "helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
525
+ "helper-state": unref(y).date ? void 0 : "error"
523
526
  }, {
524
527
  default: withCtx(() => [
525
- createElementVNode("div", _hoisted_5$3, toDisplayString(unref(s).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(s).date).options) : "Set a repeating date"), 1)
528
+ createElementVNode("div", _hoisted_5$5, toDisplayString(unref(y).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(y).date).options) : unref(o)("connect.template.rule.schedule.set_repeating_date")), 1)
526
529
  ]),
527
530
  _: 1
528
531
  }, 8, ["helper-text", "helper-state"])
529
532
  ]),
530
533
  default: withCtx(() => [
531
- createVNode(V, { class: "elevated p-8 w-[450px]" }, {
534
+ createVNode(B, { class: "elevated p-8 w-[450px]" }, {
532
535
  default: withCtx(() => [
533
536
  createVNode(_sfc_main$k, {
534
537
  "apply-button": !0,
535
- "model-value": unref(s).date || "",
536
- onCancel: c[1] || (c[1] = (B) => n.value = !1),
537
- "onUpdate:modelValue": c[2] || (c[2] = (B) => (h({ date: B, time: unref(s).time }), n.value = !1))
538
+ "model-value": unref(y).date || "",
539
+ onCancel: r[1] || (r[1] = (E) => a.value = !1),
540
+ "onUpdate:modelValue": r[2] || (r[2] = (E) => (b({ date: E, time: unref(y).time }), a.value = !1))
538
541
  }, null, 8, ["model-value"])
539
542
  ]),
540
543
  _: 1
@@ -544,23 +547,23 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
544
547
  }, 8, ["show-popover"])
545
548
  ])) : (openBlock(), createBlock(R, {
546
549
  key: 1,
547
- label: "Notify date",
548
- "model-value": unref(s).date || "",
549
- "onUpdate:modelValue": c[4] || (c[4] = (B) => h({ date: B, time: unref(s).time })),
550
- "helper-text": unref(s).date ? void 0 : "Date is required",
551
- "helper-state": unref(s).date ? void 0 : "error"
552
- }, null, 8, ["model-value", "helper-text", "helper-state"]))
550
+ label: unref(o)("connect.template.rule.schedule.notify_date"),
551
+ "model-value": unref(y).date || "",
552
+ "onUpdate:modelValue": r[4] || (r[4] = (E) => b({ date: E, time: unref(y).time })),
553
+ "helper-text": unref(y).date ? void 0 : unref(o)("connect.template.rule.schedule.date_required"),
554
+ "helper-state": unref(y).date ? void 0 : "error"
555
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"]))
553
556
  ]),
554
- unref(s).date && unref(s).time && unref(y) ? (openBlock(), createBlock(k, {
557
+ unref(y).date && unref(y).time && unref(v) ? (openBlock(), createBlock(S, {
555
558
  key: 0,
556
- text: `${unref(moment)(unref(y)).isAfter(unref(moment)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(moment)(unref(y)).format("dddd, DD MMM YYYY")} at
557
- ${unref(moment)(unref(y)).format("hh:mmA")}(UTC${unref(moment).tz(unref(d)).format("Z")}) (${unref(moment)(unref(y)).fromNow()})`
559
+ text: `${unref(moment)(unref(v)).isAfter(unref(moment)()) ? unref(o)("connect.template.rule.schedule.next_notification") : unref(o)("connect.template.rule.schedule.last_trigger_on")} ${unref(moment)(unref(v)).format("dddd, DD MMM YYYY")} at
560
+ ${unref(moment)(unref(v)).format("hh:mmA")}(UTC${unref(moment).tz(unref(n)).format("Z")}) (${unref(moment)(unref(v)).fromNow()})`
558
561
  }, null, 8, ["text"])) : createCommentVNode("", !0)
559
562
  ])
560
563
  ], 64);
561
564
  };
562
565
  }
563
- }), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$7 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
566
+ }), _hoisted_1$c = { class: "space-y-16" }, _hoisted_2$9 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$7 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
564
567
  __name: "GameTypeInput",
565
568
  props: {
566
569
  modelValue: {
@@ -569,42 +572,42 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
569
572
  },
570
573
  emits: ["update:model-value"],
571
574
  setup(e, { emit: m }) {
572
- const a = e, i = m, u = computed(
575
+ const { t: o } = useI18n(), c = e, s = m, p = computed(
573
576
  () => [
574
577
  {
575
- label: "Fortune Wheel",
576
- description: "Allow customers to spin the Fortune Wheel to win various rewards.",
578
+ label: o("connect.campaign.gameType.option.FORTUNE_WHEEL.label"),
579
+ description: o("connect.campaign.gameType.option.FORTUNE_WHEEL.description"),
577
580
  value: F_GAME_TYPE.enum.FORTUNE_WHEEL,
578
581
  hidden: !1
579
582
  },
580
583
  {
581
- label: "Rock paper scissor",
582
- description: "Customers play a game of Rock Paper Scissors against the cashier.",
584
+ label: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.label"),
585
+ description: o("connect.campaign.gameType.option.ROCK_PAPER_SCISSORS.description"),
583
586
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
584
587
  hidden: !0
585
588
  }
586
- ].filter((d) => !d.hidden)
589
+ ].filter((n) => !n.hidden)
587
590
  );
588
- return (d, l) => {
589
- const o = resolveComponent("FmCard");
591
+ return (n, l) => {
592
+ const i = resolveComponent("FmCard");
590
593
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
591
- l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
592
- createElementVNode("div", _hoisted_2$9, [
593
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
594
+ createElementVNode("div", _hoisted_2$9, toDisplayString(unref(o)("connect.template.select_game")), 1),
595
+ createElementVNode("div", _hoisted_3$7, [
596
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
594
597
  variant: "outlined",
595
598
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
596
- "col-span-2": unref(u).length == 1,
597
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
598
- "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
599
+ "col-span-2": unref(p).length == 1,
600
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
601
+ "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
599
602
  }]),
600
603
  onClick: () => {
601
- a.modelValue != n.value && i("update:model-value", n.value);
604
+ c.modelValue != a.value && s("update:model-value", a.value);
602
605
  },
603
- key: n.value
606
+ key: a.value
604
607
  }, {
605
608
  default: withCtx(() => [
606
- createElementVNode("div", _hoisted_3$7, toDisplayString(n.label), 1),
607
- createElementVNode("div", _hoisted_4$5, toDisplayString(n.description), 1)
609
+ createElementVNode("div", _hoisted_4$6, toDisplayString(a.label), 1),
610
+ createElementVNode("div", _hoisted_5$4, toDisplayString(a.description), 1)
608
611
  ]),
609
612
  _: 2
610
613
  }, 1032, ["class", "onClick"]))), 128))
@@ -618,87 +621,87 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
618
621
  }, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
619
622
  __name: "EditRewardPoolSheet",
620
623
  emits: ["update:model-value"],
621
- setup(e, { expose: m, emit: a }) {
622
- const i = useMembershipStore(), { minor: u } = useLoading, d = ref(!1), l = ref(), o = ref(), n = ref(0), s = computed(() => {
623
- var r;
624
- return ((r = i.loyaltyRewards.items.find(
625
- (p) => {
626
- var f;
627
- return p.value === ((f = l.value) == null ? void 0 : f.collectible);
624
+ setup(e, { expose: m, emit: o }) {
625
+ const c = useMembershipStore(), { minor: s } = useLoading, p = ref(!1), n = ref(), l = ref(), i = ref(0), a = computed(() => {
626
+ var u;
627
+ return ((u = c.loyaltyRewards.items.find(
628
+ (r) => {
629
+ var d;
630
+ return r.value === ((d = n.value) == null ? void 0 : d.collectible);
628
631
  }
629
- )) == null ? void 0 : r.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
630
- }), y = computed(() => {
631
- const c = s.value.safeParse(l.value);
632
- return c.success ? [] : c.error.errors;
632
+ )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
633
+ }), f = computed(() => {
634
+ const b = a.value.safeParse(n.value);
635
+ return b.success ? [] : b.error.errors;
633
636
  });
634
- function v(c, r, p) {
635
- c && (l.value = r, n.value = p), d.value = c;
637
+ function y(b, u, r) {
638
+ b && (n.value = u, i.value = r), p.value = b;
636
639
  }
637
- const h = a;
638
- async function g() {
639
- const c = s.value.safeParse(l.value);
640
- c.success && (await u(
640
+ const v = o;
641
+ async function C() {
642
+ const b = a.value.safeParse(n.value);
643
+ b.success && (await s(
641
644
  async () => {
642
- c.data.type === "VOUCHER" && o.value && (c.data.collectibleConfig.image = await firebaseStorage.update(
643
- c.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
644
- o.value
645
+ b.data.type === "VOUCHER" && l.value && (b.data.collectibleConfig.image = await firebaseStorage.update(
646
+ b.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
647
+ l.value
645
648
  ));
646
649
  },
647
650
  {
648
651
  message: "Uploading reward image",
649
652
  successMessage: "Reward image updated"
650
653
  }
651
- ), h("update:model-value", c.data, n.value));
654
+ ), v("update:model-value", b.data, i.value));
652
655
  }
653
656
  return m({
654
- showSheet: v
655
- }), (c, r) => {
656
- const p = resolveComponent("FmSelect"), f = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
657
- return openBlock(), createBlock(C, {
657
+ showSheet: y
658
+ }), (b, u) => {
659
+ const r = resolveComponent("FmSelect"), d = resolveComponent("FmStepperField"), g = resolveComponent("FmButton"), k = resolveComponent("FmSideSheet");
660
+ return openBlock(), createBlock(k, {
658
661
  "max-width": 560,
659
- modelValue: unref(d),
662
+ modelValue: unref(p),
660
663
  "onUpdate:modelValue": [
661
- r[9] || (r[9] = (V) => isRef(d) ? d.value = V : null),
662
- r[10] || (r[10] = (V) => d.value = V)
664
+ u[9] || (u[9] = (V) => isRef(p) ? p.value = V : null),
665
+ u[10] || (u[10] = (V) => p.value = V)
663
666
  ],
664
667
  header: "Edit reward",
665
668
  "dismiss-away": ""
666
669
  }, {
667
670
  "side-sheet-footer": withCtx(() => [
668
671
  createElementVNode("div", _hoisted_2$8, [
669
- createVNode(b, {
672
+ createVNode(g, {
670
673
  variant: "primary",
671
674
  type: "button",
672
- disabled: unref(y).length > 0,
675
+ disabled: unref(f).length > 0,
673
676
  label: "Confirm",
674
- onClick: r[7] || (r[7] = (V) => g())
677
+ onClick: u[7] || (u[7] = (V) => C())
675
678
  }, null, 8, ["disabled"]),
676
- createVNode(b, {
679
+ createVNode(g, {
677
680
  variant: "secondary",
678
681
  type: "button",
679
682
  label: "Cancel",
680
- onClick: r[8] || (r[8] = (V) => d.value = !1)
683
+ onClick: u[8] || (u[8] = (V) => p.value = !1)
681
684
  })
682
685
  ])
683
686
  ]),
684
687
  default: withCtx(() => {
685
- var V, x, R;
688
+ var V, x, B;
686
689
  return [
687
- unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
688
- createVNode(p, {
690
+ unref(n) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
691
+ createVNode(r, {
689
692
  label: "Reward Type",
690
693
  items: [
691
694
  { label: "No Reward", value: "NO_REWARD" },
692
695
  { label: "Voucher", value: "VOUCHER" },
693
696
  { label: "Loyalty", value: "LOYALTY" }
694
697
  ],
695
- "model-value": unref(l).type,
696
- "onUpdate:modelValue": r[0] || (r[0] = (k) => {
697
- k == "NO_REWARD" ? l.value = {
698
+ "model-value": unref(n).type,
699
+ "onUpdate:modelValue": u[0] || (u[0] = (h) => {
700
+ h == "NO_REWARD" ? n.value = {
698
701
  type: "NO_REWARD",
699
702
  collectible: null,
700
703
  weight: 1
701
- } : k === "VOUCHER" ? l.value = {
704
+ } : h === "VOUCHER" ? n.value = {
702
705
  collectible: null,
703
706
  type: "VOUCHER",
704
707
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -712,8 +715,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
712
715
  validForDay: 7
713
716
  },
714
717
  weight: 1
715
- } : l.value = {
716
- collectible: unref(i).loyaltyRewards.raw[0]._id,
718
+ } : n.value = {
719
+ collectible: unref(c).loyaltyRewards.raw[0]._id,
717
720
  type: "LOYALTY",
718
721
  earningOption: {
719
722
  amount: 1,
@@ -726,75 +729,75 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
726
729
  };
727
730
  })
728
731
  }, null, 8, ["model-value"]),
729
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
732
+ unref(n).type == "LOYALTY" ? (openBlock(), createBlock(r, {
730
733
  key: 0,
731
734
  label: "Loyalty type",
732
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "collectible", [unref(l).type])],
733
- items: unref(i).loyaltyRewards.items,
734
- "model-value": unref(l).collectible,
735
- "onUpdate:modelValue": r[1] || (r[1] = (k) => unref(l).collectible = k)
735
+ rules: [unref(ZodHelper).ruleAtPath(unref(a), "collectible", [unref(n).type])],
736
+ items: unref(c).loyaltyRewards.items,
737
+ "model-value": unref(n).collectible,
738
+ "onUpdate:modelValue": u[1] || (u[1] = (h) => unref(n).collectible = h)
736
739
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
737
- createVNode(f, {
740
+ createVNode(d, {
738
741
  label: "Weight",
739
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "weight", [unref(l).type])],
740
- "model-value": unref(l).weight,
741
- "onUpdate:modelValue": r[2] || (r[2] = (k) => l.value = {
742
- ...unref(l),
743
- weight: k
742
+ rules: [unref(ZodHelper).ruleAtPath(unref(a), "weight", [unref(n).type])],
743
+ "model-value": unref(n).weight,
744
+ "onUpdate:modelValue": u[2] || (u[2] = (h) => n.value = {
745
+ ...unref(n),
746
+ weight: h
744
747
  })
745
748
  }, null, 8, ["rules", "model-value"]),
746
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
747
- ((V = unref(i).loyaltyRewards.items.find(
748
- (k) => {
749
- var B;
750
- return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
749
+ unref(n).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
750
+ ((V = unref(c).loyaltyRewards.items.find(
751
+ (h) => {
752
+ var R;
753
+ return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
751
754
  }
752
755
  )) == null ? void 0 : V.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
753
- r[11] || (r[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
756
+ u[11] || (u[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
754
757
  createVNode(_sfc_main$l, {
755
758
  class: "mt-[-8px]",
756
759
  rules: [
757
- unref(ZodHelper).ruleAtPath(unref(s), "earningOption", [unref(l).type])
760
+ unref(ZodHelper).ruleAtPath(unref(a), "earningOption", [unref(n).type])
758
761
  ],
759
- "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
760
- "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
762
+ "helper-state": unref(ZodHelper).helperState(unref(f), "earningOption"),
763
+ "error-text": unref(ZodHelper).helperText(unref(f), "earningOption"),
761
764
  "fixed-type": !0,
762
- "model-value": unref(l).earningOption,
763
- "onUpdate:modelValue": r[3] || (r[3] = (k) => l.value = {
764
- ...unref(l),
765
- earningOption: k
765
+ "model-value": unref(n).earningOption,
766
+ "onUpdate:modelValue": u[3] || (u[3] = (h) => n.value = {
767
+ ...unref(n),
768
+ earningOption: h
766
769
  })
767
770
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
768
771
  ], 64)) : createCommentVNode("", !0),
769
- r[12] || (r[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
772
+ u[12] || (u[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
770
773
  createVNode(_sfc_main$m, {
771
- type: unref(l).type === "LOYALTY" ? "custom" : "range",
772
- "for-credit": unref(l).type === "LOYALTY" && ((x = unref(i).loyaltyRewards.items.find(
773
- (k) => {
774
- var B;
775
- return k.value === ((B = unref(l)) == null ? void 0 : B.collectible);
774
+ type: unref(n).type === "LOYALTY" ? "custom" : "range",
775
+ "for-credit": unref(n).type === "LOYALTY" && ((x = unref(c).loyaltyRewards.items.find(
776
+ (h) => {
777
+ var R;
778
+ return h.value === ((R = unref(n)) == null ? void 0 : R.collectible);
776
779
  }
777
780
  )) == null ? void 0 : x.raw.type) === "CREDIT",
778
781
  class: "!gap-24",
779
- rules: [unref(ZodHelper).ruleAtPath(unref(s), "validityOption", [unref(l).type])],
780
- "model-value": unref(l).validityOption,
781
- "onUpdate:modelValue": r[4] || (r[4] = (k) => l.value = {
782
- ...unref(l),
783
- validityOption: k
782
+ rules: [unref(ZodHelper).ruleAtPath(unref(a), "validityOption", [unref(n).type])],
783
+ "model-value": unref(n).validityOption,
784
+ "onUpdate:modelValue": u[4] || (u[4] = (h) => n.value = {
785
+ ...unref(n),
786
+ validityOption: h
784
787
  })
785
788
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
786
789
  ], 64)) : createCommentVNode("", !0),
787
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
790
+ unref(n).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
788
791
  key: 2,
789
- "reward-image": unref(o),
790
- "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
791
- "onUpdate:modelValue": r[5] || (r[5] = (k) => l.value = {
792
- ...unref(l),
793
- collectibleConfig: k
792
+ "reward-image": unref(l),
793
+ "model-value": ((B = unref(n)) == null ? void 0 : B.collectibleConfig) ?? void 0,
794
+ "onUpdate:modelValue": u[5] || (u[5] = (h) => n.value = {
795
+ ...unref(n),
796
+ collectibleConfig: h
794
797
  }),
795
- "onUpdate:rewardImage": r[6] || (r[6] = (k) => o.value = k)
798
+ "onUpdate:rewardImage": u[6] || (u[6] = (h) => l.value = h)
796
799
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
797
- createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
800
+ createVNode(JsonViewer, { json: unref(f) }, null, 8, ["json"])
798
801
  ])) : createCommentVNode("", !0)
799
802
  ];
800
803
  }),
@@ -806,7 +809,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
806
809
  function isNullOrEmpty(e) {
807
810
  return e == null || e === "";
808
811
  }
809
- const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
812
+ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$6 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$5 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
810
813
  __name: "RewardPoolInput",
811
814
  props: {
812
815
  modelValue: {
@@ -822,36 +825,36 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
822
825
  },
823
826
  emits: ["update:model-value"],
824
827
  setup(e, { emit: m }) {
825
- const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
826
- const c = d.safeParse(l.value);
827
- return c.success ? [] : c.error.errors;
828
- }), n = ref();
829
- function s(c, r) {
830
- var f;
831
- const p = [...l.value];
832
- p[r] = c, (f = n.value) == null || f.showSheet(!1), i("update:model-value", p);
828
+ const o = e, c = m, s = useMembershipStore(), { t: p } = useI18n(), n = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => o.modelValue ?? []), i = computed(() => {
829
+ const u = n.safeParse(l.value);
830
+ return u.success ? [] : u.error.errors;
831
+ }), a = ref();
832
+ function f(u, r) {
833
+ var g;
834
+ const d = [...l.value];
835
+ d[r] = u, (g = a.value) == null || g.showSheet(!1), c("update:model-value", d);
833
836
  }
834
- function y(c) {
835
- const r = c.type == "VOUCHER" ? c.collectibleConfig : u.collectibles.find(
836
- (b) => b._id.toString() == c.collectible
837
- ), p = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), f = c.weight;
837
+ function y(u) {
838
+ const r = u.type == "VOUCHER" ? u.collectibleConfig : s.collectibles.find(
839
+ (k) => k._id.toString() == u.collectible
840
+ ), d = CollectionUtils.formattedType((r == null ? void 0 : r.name) || ""), g = u.weight;
838
841
  return {
839
- label: isNullOrEmpty(p) ? "NO REWARD" : p,
840
- sublabel: `${f} (${(f / l.value.reduce((b, C) => b + C.weight, 0) * 100).toFixed(2)}%)`
842
+ label: isNullOrEmpty(d) ? "NO REWARD" : d,
843
+ sublabel: `${g} (${(g / l.value.reduce((k, V) => k + V.weight, 0) * 100).toFixed(2)}%)`
841
844
  };
842
845
  }
843
- function v(c) {
844
- var p;
846
+ function v(u) {
847
+ var d;
845
848
  const r = [...l.value];
846
- (p = n.value) == null || p.showSheet(!0, r[c], c);
849
+ (d = a.value) == null || d.showSheet(!0, r[u], u);
847
850
  }
848
- function h(c) {
851
+ function C(u) {
849
852
  const r = [...l.value];
850
- r.splice(c, 1), i("update:model-value", r);
853
+ r.splice(u, 1), c("update:model-value", r);
851
854
  }
852
- function g() {
853
- var c;
854
- (c = n.value) == null || c.showSheet(
855
+ function b() {
856
+ var u;
857
+ (u = a.value) == null || u.showSheet(
855
858
  !0,
856
859
  {
857
860
  type: "NO_REWARD",
@@ -861,47 +864,47 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
861
864
  l.value.length
862
865
  );
863
866
  }
864
- return (c, r) => {
865
- const p = resolveComponent("FmButton"), f = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
867
+ return (u, r) => {
868
+ const d = resolveComponent("FmButton"), g = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
866
869
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
867
- r[1] || (r[1] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1)),
868
- createVNode(p, {
869
- label: "Add Reward",
870
- onClick: r[0] || (r[0] = (C) => g()),
870
+ createElementVNode("div", _hoisted_2$7, toDisplayString(unref(p)("connect.template.configure_reward_type")), 1),
871
+ createVNode(d, {
872
+ label: unref(p)("connect.campaign.rewardPool.addReward"),
873
+ onClick: r[0] || (r[0] = (V) => b()),
871
874
  variant: "plain",
872
875
  icon: "add"
873
- }),
874
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, V) => (openBlock(), createBlock(f, {
875
- key: V,
876
+ }, null, 8, ["label"]),
877
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, x) => (openBlock(), createBlock(g, {
878
+ key: x,
876
879
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
877
880
  variant: "outlined",
878
- onClick: (x) => v(V)
881
+ onClick: (B) => v(x)
879
882
  }, {
880
883
  default: withCtx(() => {
881
- var x;
884
+ var B;
882
885
  return [
883
886
  createElementVNode("div", null, [
884
- createElementVNode("div", _hoisted_2$7, toDisplayString(C.type == "LOYALTY" ? (x = C == null ? void 0 : C.earningOption) == null ? void 0 : x.amount : "") + " " + toDisplayString(y(C).label), 1),
885
- createElementVNode("div", _hoisted_3$6, toDisplayString(y(C).sublabel), 1)
887
+ createElementVNode("div", _hoisted_3$6, toDisplayString(V.type == "LOYALTY" ? (B = V == null ? void 0 : V.earningOption) == null ? void 0 : B.amount : "") + " " + toDisplayString(y(V).label), 1),
888
+ createElementVNode("div", _hoisted_4$5, toDisplayString(y(V).sublabel), 1)
886
889
  ]),
887
- createVNode(p, {
890
+ createVNode(d, {
888
891
  icon: "delete",
889
892
  variant: "tertiary",
890
- onClick: (R) => (R.stopPropagation(), h(V))
893
+ onClick: (h) => (h.stopPropagation(), C(x))
891
894
  }, null, 8, ["onClick"])
892
895
  ];
893
896
  }),
894
897
  _: 2
895
898
  }, 1032, ["onClick"]))), 128)),
896
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(b, {
897
- key: C.message,
898
- text: C.message,
899
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(k, {
900
+ key: V.message,
901
+ text: V.message,
899
902
  state: "error"
900
903
  }, null, 8, ["text"]))), 128)),
901
904
  createVNode(_sfc_main$b, {
902
905
  ref_key: "sheetRef",
903
- ref: n,
904
- "onUpdate:modelValue": s
906
+ ref: a,
907
+ "onUpdate:modelValue": f
905
908
  }, null, 512)
906
909
  ]);
907
910
  };
@@ -918,55 +921,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
918
921
  },
919
922
  emits: ["update:model-value"],
920
923
  setup(e, { emit: m }) {
921
- const a = e, i = m, u = computed(() => [
924
+ const { t: o } = useI18n(), c = e, s = m, p = computed(() => [
922
925
  {
923
- label: "Rock paper scissor",
924
- description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
926
+ label: o("connect.template.promotion_game.rock_paper_scissors.label"),
927
+ description: o("connect.template.promotion_game.rock_paper_scissors.description"),
925
928
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
926
929
  }
927
930
  ]);
928
- return (d, l) => {
929
- var y, v, h;
930
- const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), s = resolveComponent("FmHelperText");
931
+ return (n, l) => {
932
+ var y, v, C;
933
+ const i = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
931
934
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
932
- createVNode(o, {
933
- label: "Enable game",
935
+ createVNode(i, {
936
+ label: unref(o)("connect.template.promotion_game.enable"),
934
937
  "model-value": !!((y = e.modelValue) != null && y.gameType),
935
- "onUpdate:modelValue": l[0] || (l[0] = (g) => g ? i("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : i("update:model-value", null))
936
- }, null, 8, ["model-value"]),
938
+ "onUpdate:modelValue": l[0] || (l[0] = (b) => b ? s("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : s("update:model-value", null))
939
+ }, null, 8, ["label", "model-value"]),
937
940
  ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
938
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g) => {
939
- var c, r;
940
- return openBlock(), createBlock(n, {
941
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (b) => {
942
+ var u, r;
943
+ return openBlock(), createBlock(a, {
941
944
  variant: "outlined",
942
945
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
943
- "col-span-2": unref(u).length == 1,
944
- "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.gameType) == g.value,
945
- "hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != g.value
946
+ "col-span-2": unref(p).length == 1,
947
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((u = e.modelValue) == null ? void 0 : u.gameType) == b.value,
948
+ "hover:bg-fm-color-opacity-sm": ((r = e.modelValue) == null ? void 0 : r.gameType) != b.value
946
949
  }]),
947
950
  onClick: () => {
948
- var p;
949
- ((p = a.modelValue) == null ? void 0 : p.gameType) != g.value && i("update:model-value", { gameType: g.value });
951
+ var d;
952
+ ((d = c.modelValue) == null ? void 0 : d.gameType) != b.value && s("update:model-value", { gameType: b.value });
950
953
  },
951
- key: g.value
954
+ key: b.value
952
955
  }, {
953
956
  default: withCtx(() => [
954
- createElementVNode("div", _hoisted_3$5, toDisplayString(g.label), 1),
955
- createElementVNode("div", _hoisted_4$4, toDisplayString(g.description), 1)
957
+ createElementVNode("div", _hoisted_3$5, toDisplayString(b.label), 1),
958
+ createElementVNode("div", _hoisted_4$4, toDisplayString(b.description), 1)
956
959
  ]),
957
960
  _: 2
958
961
  }, 1032, ["class", "onClick"]);
959
962
  }), 128))
960
963
  ])) : createCommentVNode("", !0),
961
- ((h = e.modelValue) == null ? void 0 : h.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(s, {
964
+ ((C = e.modelValue) == null ? void 0 : C.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
962
965
  key: 1,
963
- text: "Rock paper scissors is only available for POS >= 7.7.4 with dual screen on android devices (Sunmi D3 Pro and Sunmi T3 Pro)",
966
+ text: unref(o)("connect.template.promotion_game.rock_paper_scissors.warning"),
964
967
  state: "warning"
965
- })) : createCommentVNode("", !0)
968
+ }, null, 8, ["text"])) : createCommentVNode("", !0)
966
969
  ]);
967
970
  };
968
971
  }
969
- }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
972
+ }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$4 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$3 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
970
973
  __name: "MissionTypeInput",
971
974
  props: {
972
975
  modelValue: {
@@ -975,38 +978,38 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
975
978
  },
976
979
  emits: ["update:model-value"],
977
980
  setup(e, { emit: m }) {
978
- const a = e, i = m, u = computed(() => [
981
+ const { t: o } = useI18n(), c = e, s = m, p = computed(() => [
979
982
  {
980
- label: "Stamp",
981
- description: "Award stamps for purchases, redeemable after reaching set milestones.",
983
+ label: o("connect.campaign.mission.typeOption.STAMP.label"),
984
+ description: o("connect.campaign.mission.typeOption.STAMP.description"),
982
985
  value: F_MISSION_TYPE.enum.STAMP
983
986
  },
984
987
  {
985
- label: "Progress",
986
- description: "Reward customers when they reach a cumulative spending goal.",
988
+ label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
989
+ description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
987
990
  value: F_MISSION_TYPE.enum.PROGRESSIVE
988
991
  }
989
992
  ]);
990
- return (d, l) => {
991
- const o = resolveComponent("FmCard");
993
+ return (n, l) => {
994
+ const i = resolveComponent("FmCard");
992
995
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
993
- l[0] || (l[0] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
994
- createElementVNode("div", _hoisted_2$5, [
995
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
996
+ createElementVNode("div", _hoisted_2$5, toDisplayString(unref(o)("connect.template.select_game")), 1),
997
+ createElementVNode("div", _hoisted_3$4, [
998
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (a) => (openBlock(), createBlock(i, {
996
999
  variant: "outlined",
997
1000
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
998
- "col-span-2": unref(u).length == 1,
999
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1000
- "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1001
+ "col-span-2": unref(p).length == 1,
1002
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1003
+ "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1001
1004
  }]),
1002
1005
  onClick: () => {
1003
- a.modelValue != n.value && i("update:model-value", n.value);
1006
+ c.modelValue != a.value && s("update:model-value", a.value);
1004
1007
  },
1005
- key: n.value
1008
+ key: a.value
1006
1009
  }, {
1007
1010
  default: withCtx(() => [
1008
- createElementVNode("div", _hoisted_3$4, toDisplayString(n.label), 1),
1009
- createElementVNode("div", _hoisted_4$3, toDisplayString(n.description), 1)
1011
+ createElementVNode("div", _hoisted_4$3, toDisplayString(a.label), 1),
1012
+ createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
1010
1013
  ]),
1011
1014
  _: 2
1012
1015
  }, 1032, ["class", "onClick"]))), 128))
@@ -1029,15 +1032,15 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1029
1032
  },
1030
1033
  emits: ["update:model-value"],
1031
1034
  setup(e, { emit: m }) {
1032
- const a = m;
1033
- return (i, u) => {
1034
- const d = resolveComponent("FmStepperField");
1035
+ const o = m;
1036
+ return (c, s) => {
1037
+ const p = resolveComponent("FmStepperField");
1035
1038
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1036
- 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)),
1037
- createVNode(d, {
1039
+ s[1] || (s[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)),
1040
+ createVNode(p, {
1038
1041
  label: "Maximum to collect",
1039
1042
  "model-value": e.modelValue || null,
1040
- "onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
1043
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => o("update:model-value", n)),
1041
1044
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1042
1045
  "helper-state": e.helperState || "none"
1043
1046
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1053,49 +1056,49 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1053
1056
  }
1054
1057
  },
1055
1058
  emits: ["update:model-value"],
1056
- setup(e, { expose: m, emit: a }) {
1057
- const i = e, u = useMembershipStore(), { minor: d } = useLoading, l = ref(!1), o = ref(), n = ref(), s = ref(0), y = computed(() => {
1058
- var f;
1059
- return ((f = u.loyaltyRewards.items.find(
1060
- (b) => {
1061
- var C;
1062
- return b.value === ((C = o.value) == null ? void 0 : C.collectible);
1059
+ setup(e, { expose: m, emit: o }) {
1060
+ const c = e, s = useMembershipStore(), { minor: p } = useLoading, n = ref(!1), l = ref(), i = ref(), a = ref(0), f = computed(() => {
1061
+ var d;
1062
+ return ((d = s.loyaltyRewards.items.find(
1063
+ (g) => {
1064
+ var k;
1065
+ return g.value === ((k = l.value) == null ? void 0 : k.collectible);
1063
1066
  }
1064
- )) == null ? void 0 : f.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1065
- }), v = computed(() => {
1066
- const p = y.value.safeParse(o.value);
1067
- return p.success ? [] : p.error.errors;
1067
+ )) == null ? void 0 : d.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1068
+ }), y = computed(() => {
1069
+ const r = f.value.safeParse(l.value);
1070
+ return r.success ? [] : r.error.errors;
1068
1071
  });
1069
- function h(p, f, b) {
1070
- p && (o.value = f, s.value = b), l.value = p;
1072
+ function v(r, d, g) {
1073
+ r && (l.value = d, a.value = g), n.value = r;
1071
1074
  }
1072
- const g = a;
1073
- async function c() {
1074
- const p = y.value.safeParse(o.value);
1075
- p.success && (await d(
1075
+ const C = o;
1076
+ async function b() {
1077
+ const r = f.value.safeParse(l.value);
1078
+ r.success && (await p(
1076
1079
  async () => {
1077
- p.data.type === "VOUCHER" && n.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
1078
- p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1079
- n.value
1080
+ r.data.type === "VOUCHER" && i.value && (r.data.collectibleConfig.image = await firebaseStorage.update(
1081
+ r.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, i.value),
1082
+ i.value
1080
1083
  ));
1081
1084
  },
1082
1085
  {
1083
1086
  message: "Uploading reward image",
1084
1087
  successMessage: "Reward image updated"
1085
1088
  }
1086
- ), g("update:model-value", p.data, s.value));
1089
+ ), C("update:model-value", r.data, a.value));
1087
1090
  }
1088
- const r = ref();
1091
+ const u = ref();
1089
1092
  return m({
1090
- showSheet: h
1091
- }), (p, f) => {
1092
- const b = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), x = resolveComponent("FmButton"), R = resolveComponent("FmSideSheet");
1093
- return openBlock(), createBlock(R, {
1093
+ showSheet: v
1094
+ }), (r, d) => {
1095
+ const g = resolveComponent("FmStepperField"), k = resolveComponent("FmSelect"), V = resolveComponent("FmForm"), x = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1096
+ return openBlock(), createBlock(B, {
1094
1097
  "max-width": 560,
1095
- modelValue: unref(l),
1098
+ modelValue: unref(n),
1096
1099
  "onUpdate:modelValue": [
1097
- f[10] || (f[10] = (k) => isRef(l) ? l.value = k : null),
1098
- f[11] || (f[11] = (k) => l.value = k)
1100
+ d[10] || (d[10] = (h) => isRef(n) ? n.value = h : null),
1101
+ d[11] || (d[11] = (h) => n.value = h)
1099
1102
  ],
1100
1103
  header: "Edit reward",
1101
1104
  "dismiss-away": ""
@@ -1106,59 +1109,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1106
1109
  variant: "primary",
1107
1110
  type: "button",
1108
1111
  label: "Confirm",
1109
- disabled: unref(v).length > 0,
1110
- onClick: f[8] || (f[8] = async () => {
1111
- var k;
1112
- return (k = unref(r)) == null ? void 0 : k.validateInputs();
1112
+ disabled: unref(y).length > 0,
1113
+ onClick: d[8] || (d[8] = async () => {
1114
+ var h;
1115
+ return (h = unref(u)) == null ? void 0 : h.validateInputs();
1113
1116
  })
1114
1117
  }, null, 8, ["disabled"]),
1115
1118
  createVNode(x, {
1116
1119
  variant: "secondary",
1117
1120
  type: "button",
1118
1121
  label: "Cancel",
1119
- onClick: f[9] || (f[9] = (k) => l.value = !1)
1122
+ onClick: d[9] || (d[9] = (h) => n.value = !1)
1120
1123
  })
1121
1124
  ])
1122
1125
  ]),
1123
1126
  default: withCtx(() => [
1124
- createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
1125
- unref(o) ? (openBlock(), createBlock(V, {
1127
+ createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
1128
+ unref(l) ? (openBlock(), createBlock(V, {
1126
1129
  key: 0,
1127
1130
  class: "flex flex-col gap-y-24",
1128
1131
  ref_key: "formRef",
1129
- ref: r,
1130
- onValidationSuccess: f[7] || (f[7] = (k) => c())
1132
+ ref: u,
1133
+ onValidationSuccess: d[7] || (d[7] = (h) => b())
1131
1134
  }, {
1132
1135
  default: withCtx(() => {
1133
- var k, B;
1136
+ var h, R;
1134
1137
  return [
1135
- unref(o).type ? (openBlock(), createBlock(b, {
1138
+ unref(l).type ? (openBlock(), createBlock(g, {
1136
1139
  key: 0,
1137
1140
  label: "Threshold",
1138
1141
  rules: [
1139
1142
  unref(ZodHelper).toRule(
1140
1143
  unref(z).number().min(1).max(
1141
- i.maxThreshold,
1142
- `Number cannot be more than ${i.maxThreshold}`
1144
+ c.maxThreshold,
1145
+ `Number cannot be more than ${c.maxThreshold}`
1143
1146
  )
1144
1147
  )
1145
1148
  ],
1146
- "model-value": unref(o).threshold,
1147
- "onUpdate:modelValue": f[0] || (f[0] = (E) => o.value = {
1148
- ...unref(o),
1149
- threshold: E
1149
+ "model-value": unref(l).threshold,
1150
+ "onUpdate:modelValue": d[0] || (d[0] = (S) => l.value = {
1151
+ ...unref(l),
1152
+ threshold: S
1150
1153
  })
1151
1154
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1152
- createVNode(C, {
1155
+ createVNode(k, {
1153
1156
  label: "Reward Type",
1154
1157
  items: [
1155
1158
  { label: "Voucher", value: "VOUCHER" },
1156
1159
  { label: "Loyalty", value: "LOYALTY" }
1157
1160
  ],
1158
- "model-value": unref(o).type,
1159
- "onUpdate:modelValue": f[1] || (f[1] = (E) => {
1160
- var S, w;
1161
- E === "VOUCHER" ? o.value = {
1161
+ "model-value": unref(l).type,
1162
+ "onUpdate:modelValue": d[1] || (d[1] = (S) => {
1163
+ var E, $;
1164
+ S === "VOUCHER" ? l.value = {
1162
1165
  collectible: null,
1163
1166
  type: "VOUCHER",
1164
1167
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1171,9 +1174,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1171
1174
  validityOption: {
1172
1175
  validForDay: 7
1173
1176
  },
1174
- threshold: (S = unref(o)) == null ? void 0 : S.threshold
1175
- } : o.value = {
1176
- collectible: unref(u).loyaltyRewards.raw[0]._id,
1177
+ threshold: (E = unref(l)) == null ? void 0 : E.threshold
1178
+ } : l.value = {
1179
+ collectible: unref(s).loyaltyRewards.raw[0]._id,
1177
1180
  type: "LOYALTY",
1178
1181
  earningOption: {
1179
1182
  amount: 1,
@@ -1182,60 +1185,60 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1182
1185
  validityOption: {
1183
1186
  validForDay: 7
1184
1187
  },
1185
- threshold: (w = unref(o)) == null ? void 0 : w.threshold
1188
+ threshold: ($ = unref(l)) == null ? void 0 : $.threshold
1186
1189
  };
1187
1190
  })
1188
1191
  }, null, 8, ["model-value"]),
1189
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(C, {
1192
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(k, {
1190
1193
  key: 1,
1191
1194
  label: "Loyalty type",
1192
- rules: [unref(ZodHelper).ruleAtPath(unref(y), "collectible", [unref(o).type])],
1193
- items: unref(u).loyaltyRewards.items,
1194
- "model-value": unref(o).collectible,
1195
- "onUpdate:modelValue": f[2] || (f[2] = (E) => unref(o).collectible = E)
1195
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
1196
+ items: unref(s).loyaltyRewards.items,
1197
+ "model-value": unref(l).collectible,
1198
+ "onUpdate:modelValue": d[2] || (d[2] = (S) => unref(l).collectible = S)
1196
1199
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1197
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1198
- f[12] || (f[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1200
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1201
+ d[12] || (d[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1199
1202
  createVNode(_sfc_main$l, {
1200
1203
  class: "mt-[-8px]",
1201
- rules: [unref(ZodHelper).ruleAtPath(unref(y), "earningOption", [unref(o).type])],
1202
- "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1203
- "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1204
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])],
1205
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1206
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1204
1207
  "fixed-type": !0,
1205
- "model-value": unref(o).earningOption,
1206
- "onUpdate:modelValue": f[3] || (f[3] = (E) => o.value = {
1207
- ...unref(o),
1208
- earningOption: E
1208
+ "model-value": unref(l).earningOption,
1209
+ "onUpdate:modelValue": d[3] || (d[3] = (S) => l.value = {
1210
+ ...unref(l),
1211
+ earningOption: S
1209
1212
  })
1210
1213
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1211
1214
  createVNode(_sfc_main$m, {
1212
1215
  class: "!gap-24",
1213
- type: unref(o).type === "LOYALTY" ? "custom" : "range",
1214
- "for-credit": unref(o).type === "LOYALTY" && ((k = unref(u).loyaltyRewards.items.find(
1215
- (E) => {
1216
- var S;
1217
- return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1216
+ type: unref(l).type === "LOYALTY" ? "custom" : "range",
1217
+ "for-credit": unref(l).type === "LOYALTY" && ((h = unref(s).loyaltyRewards.items.find(
1218
+ (S) => {
1219
+ var E;
1220
+ return S.value === ((E = unref(l)) == null ? void 0 : E.collectible);
1218
1221
  }
1219
- )) == null ? void 0 : k.raw.type) === "CREDIT",
1220
- rules: [unref(ZodHelper).ruleAtPath(unref(y), "validityOption", [unref(o).type])],
1221
- "model-value": unref(o).validityOption,
1222
- "onUpdate:modelValue": f[4] || (f[4] = (E) => o.value = {
1223
- ...unref(o),
1224
- validityOption: E
1222
+ )) == null ? void 0 : h.raw.type) === "CREDIT",
1223
+ rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
1224
+ "model-value": unref(l).validityOption,
1225
+ "onUpdate:modelValue": d[4] || (d[4] = (S) => l.value = {
1226
+ ...unref(l),
1227
+ validityOption: S
1225
1228
  })
1226
1229
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
1227
1230
  ], 64)) : createCommentVNode("", !0),
1228
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1231
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1229
1232
  key: 3,
1230
- "reward-image": unref(n),
1231
- "model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
1232
- "onUpdate:modelValue": f[5] || (f[5] = (E) => o.value = {
1233
- ...unref(o),
1234
- collectibleConfig: E
1233
+ "reward-image": unref(i),
1234
+ "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
1235
+ "onUpdate:modelValue": d[5] || (d[5] = (S) => l.value = {
1236
+ ...unref(l),
1237
+ collectibleConfig: S
1235
1238
  }),
1236
- "onUpdate:rewardImage": f[6] || (f[6] = (E) => n.value = E)
1239
+ "onUpdate:rewardImage": d[6] || (d[6] = (S) => i.value = S)
1237
1240
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1238
- createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1241
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
1239
1242
  ];
1240
1243
  }),
1241
1244
  _: 1
@@ -1269,19 +1272,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1269
1272
  }
1270
1273
  },
1271
1274
  setup(e) {
1272
- const m = e, { maxRange: a, currentRange: i, markers: u } = toRefs(m), d = computed(
1273
- () => Math.min(i.value / a.value * 100, 100)
1274
- ), l = (o) => o / a.value * 100;
1275
- return (o, n) => {
1276
- const s = resolveComponent("FmIcon");
1275
+ const m = e, { maxRange: o, currentRange: c, markers: s } = toRefs(m), p = computed(
1276
+ () => Math.min(c.value / o.value * 100, 100)
1277
+ ), n = (l) => l / o.value * 100;
1278
+ return (l, i) => {
1279
+ const a = resolveComponent("FmIcon");
1277
1280
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1278
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (y) => (openBlock(), createBlock(s, {
1281
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(o), 40), (f) => (openBlock(), createBlock(a, {
1279
1282
  class: normalizeClass(
1280
- unref(i) >= y ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1283
+ unref(c) >= f ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1281
1284
  ),
1282
- outline: unref(i) < y,
1283
- key: y,
1284
- name: unref(u).some((v) => v === y) ? "featured_seasonal_and_gifts" : "check_circle"
1285
+ outline: unref(c) < f,
1286
+ key: f,
1287
+ name: unref(s).some((y) => y === f) ? "featured_seasonal_and_gifts" : "check_circle"
1285
1288
  }, null, 8, ["class", "outline", "name"]))), 128))
1286
1289
  ])) : (openBlock(), createElementBlock("div", {
1287
1290
  key: 1,
@@ -1289,18 +1292,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1289
1292
  }, [
1290
1293
  createElementVNode("div", {
1291
1294
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1292
- style: normalizeStyle({ width: unref(d) + "%" })
1295
+ style: normalizeStyle({ width: unref(p) + "%" })
1293
1296
  }, null, 4),
1294
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (y, v) => (openBlock(), createElementBlock("div", {
1295
- key: v,
1297
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (f, y) => (openBlock(), createElementBlock("div", {
1298
+ key: y,
1296
1299
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1297
- style: normalizeStyle({ left: l(y) + "%" })
1300
+ style: normalizeStyle({ left: n(f) + "%" })
1298
1301
  }, [
1299
1302
  createElementVNode("div", _hoisted_2$4, [
1300
1303
  createElementVNode("div", {
1301
1304
  class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
1302
1305
  }),
1303
- n[0] || (n[0] = createElementVNode("div", null, "🎁", -1))
1306
+ i[0] || (i[0] = createElementVNode("div", null, "🎁", -1))
1304
1307
  ])
1305
1308
  ], 4))), 128))
1306
1309
  ]));
@@ -1308,19 +1311,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$7 = { class: "fm-typo-e
1308
1311
  }
1309
1312
  }), isObject = (e) => e !== null && typeof e == "object";
1310
1313
  function changeKeysFactory(e) {
1311
- return function m(a, i = 1, u) {
1312
- if (i === 0 || !isObject(a))
1313
- return a;
1314
- if (Array.isArray(a))
1315
- return a.map((l) => m(l, i - 1, u));
1316
- const d = Object.create(Object.getPrototypeOf(a));
1317
- return Object.keys(a).forEach((l) => {
1318
- const o = a[l], n = e(l, u), s = m(o, i - 1, u);
1319
- d[n] = s;
1320
- }), d;
1314
+ return function m(o, c = 1, s) {
1315
+ if (c === 0 || !isObject(o))
1316
+ return o;
1317
+ if (Array.isArray(o))
1318
+ return o.map((n) => m(n, c - 1, s));
1319
+ const p = Object.create(Object.getPrototypeOf(o));
1320
+ return Object.keys(o).forEach((n) => {
1321
+ const l = o[n], i = e(n, s), a = m(l, c - 1, s);
1322
+ p[i] = a;
1323
+ }), p;
1321
1324
  };
1322
1325
  }
1323
- const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_3$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_4$2 = { class: "flex items-center gap-4" }, _hoisted_5$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_6$2 = { class: "flex items-center gap-16" }, _hoisted_7$1 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1326
+ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$2 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1324
1327
  __name: "MissionPoolInput",
1325
1328
  props: {
1326
1329
  modelValue: {
@@ -1334,42 +1337,49 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1334
1337
  },
1335
1338
  emits: ["update:model-value"],
1336
1339
  setup(e, { emit: m }) {
1337
- const a = e, i = m, u = useMembershipStore(), d = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1338
- () => a.modelValue.sort((r, p) => r.threshold - p.threshold) ?? []
1339
- ), o = computed(() => {
1340
- const r = d.safeParse(l.value);
1340
+ const { t: o } = useI18n(), c = e, s = m, p = useMembershipStore(), n = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1341
+ () => c.modelValue.sort((r, d) => r.threshold - d.threshold) ?? []
1342
+ ), i = computed(() => {
1343
+ const r = n.safeParse(l.value);
1341
1344
  return r.success ? [] : r.error.errors;
1342
- }), n = ref();
1343
- function s(r, p) {
1344
- var b;
1345
- const f = [...l.value];
1346
- f[p] = r, (b = n.value) == null || b.showSheet(!1), i("update:model-value", f);
1345
+ }), a = ref();
1346
+ function f(r, d) {
1347
+ var k;
1348
+ const g = [...l.value];
1349
+ g[d] = r, (k = a.value) == null || k.showSheet(!1), s("update:model-value", g);
1347
1350
  }
1348
1351
  function y(r) {
1349
- const p = r.type == "VOUCHER" ? r.collectibleConfig : u.collectibles.find(
1350
- (b) => b._id.toString() == r.collectible
1351
- ), f = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
1352
+ const d = r.type == "VOUCHER" ? r.collectibleConfig : p.collectibles.find(
1353
+ (V) => V._id.toString() == r.collectible
1354
+ ), g = CollectionUtils.formattedType((d == null ? void 0 : d.name) || ""), k = r.earningOption.type == "FIXED" ? o("connect.template.mission_pool.reward_sublabel_fixed", {
1355
+ threshold: r.threshold,
1356
+ amount: r.earningOption.amount
1357
+ }) : o("connect.template.mission_pool.reward_sublabel_per_spend", {
1358
+ threshold: r.threshold,
1359
+ amount: r.earningOption.amount,
1360
+ every: r.earningOption.every
1361
+ });
1352
1362
  return {
1353
- label: isNullOrEmpty(f) ? "NO REWARD" : f,
1354
- sublabel: `Reward at ${r.threshold} | Amount: ${r.earningOption.type == "FIXED" ? r.earningOption.amount : `${r.earningOption.amount} for every RM${r.earningOption.every} spent`} `
1363
+ label: isNullOrEmpty(g) ? o("connect.template.mission_pool.no_reward") : g,
1364
+ sublabel: k
1355
1365
  };
1356
1366
  }
1357
1367
  function v(r) {
1358
- var f;
1359
- const p = [...l.value];
1360
- (f = n.value) == null || f.showSheet(!0, p[r], r);
1368
+ var g;
1369
+ const d = [...l.value];
1370
+ (g = a.value) == null || g.showSheet(!0, d[r], r);
1361
1371
  }
1362
- function h(r) {
1363
- const p = [...l.value];
1364
- p.splice(r, 1), i("update:model-value", p);
1372
+ function C(r) {
1373
+ const d = [...l.value];
1374
+ d.splice(r, 1), s("update:model-value", d);
1365
1375
  }
1366
- function g() {
1376
+ function b() {
1367
1377
  var r;
1368
- (r = n.value) == null || r.showSheet(
1378
+ (r = a.value) == null || r.showSheet(
1369
1379
  !0,
1370
1380
  {
1371
1381
  type: "LOYALTY",
1372
- collectible: u.loyaltyRewards.items[0].value,
1382
+ collectible: p.loyaltyRewards.items[0].value,
1373
1383
  threshold: null,
1374
1384
  validityOption: {
1375
1385
  validForDay: 7
@@ -1382,71 +1392,71 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1382
1392
  l.value.length
1383
1393
  );
1384
1394
  }
1385
- function c(r) {
1386
- var p, f;
1387
- return r.type == "VOUCHER" ? (p = r.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
1388
- ((f = u.loyaltyRewards.items.find(
1389
- (b) => b.value == r.collectible
1390
- )) == null ? void 0 : f.label) || ""
1395
+ function u(r) {
1396
+ var d, g;
1397
+ return r.type == "VOUCHER" ? (d = r.collectibleConfig) == null ? void 0 : d.name : sentenceCase(
1398
+ ((g = p.loyaltyRewards.items.find(
1399
+ (k) => k.value == r.collectible
1400
+ )) == null ? void 0 : g.label) || ""
1391
1401
  );
1392
1402
  }
1393
- return (r, p) => {
1394
- const f = resolveComponent("FmButton"), b = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
1403
+ return (r, d) => {
1404
+ const g = resolveComponent("FmButton"), k = resolveComponent("FmCard"), V = resolveComponent("FmHelperText");
1395
1405
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
1396
- p[2] || (p[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
1397
- createVNode(f, {
1398
- label: "Add Reward",
1399
- onClick: p[0] || (p[0] = (V) => g()),
1406
+ createElementVNode("div", _hoisted_2$3, toDisplayString(unref(o)("connect.template.configure_reward_customer")), 1),
1407
+ createVNode(g, {
1408
+ label: unref(o)("connect.template.mission_pool.add_reward"),
1409
+ onClick: d[0] || (d[0] = (x) => b()),
1400
1410
  variant: "plain",
1401
1411
  icon: "add"
1402
- }),
1403
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (V, x) => (openBlock(), createBlock(b, {
1404
- key: x,
1412
+ }, null, 8, ["label"]),
1413
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, B) => (openBlock(), createBlock(k, {
1414
+ key: B,
1405
1415
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1406
1416
  variant: "outlined",
1407
- onClick: (R) => v(x)
1417
+ onClick: (h) => v(B)
1408
1418
  }, {
1409
1419
  default: withCtx(() => [
1410
1420
  createElementVNode("div", null, [
1411
- createElementVNode("div", _hoisted_2$3, toDisplayString(y(V).label), 1),
1412
- createElementVNode("div", _hoisted_3$3, toDisplayString(y(V).sublabel), 1)
1421
+ createElementVNode("div", _hoisted_3$3, toDisplayString(y(x).label), 1),
1422
+ createElementVNode("div", _hoisted_4$2, toDisplayString(y(x).sublabel), 1)
1413
1423
  ]),
1414
- createVNode(f, {
1424
+ createVNode(g, {
1415
1425
  icon: "delete",
1416
1426
  variant: "tertiary",
1417
- onClick: (R) => (R.stopPropagation(), h(x))
1427
+ onClick: (h) => (h.stopPropagation(), C(B))
1418
1428
  }, null, 8, ["onClick"])
1419
1429
  ]),
1420
1430
  _: 2
1421
1431
  }, 1032, ["onClick"]))), 128)),
1422
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((V) => V.path.join(".") == ""), (V) => (openBlock(), createBlock(C, {
1423
- key: V.message,
1424
- text: V.message,
1432
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(V, {
1433
+ key: x.message,
1434
+ text: x.message,
1425
1435
  state: "error"
1426
1436
  }, null, 8, ["text"]))), 128)),
1427
- p[3] || (p[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
1428
- (openBlock(), createBlock(b, {
1437
+ createElementVNode("div", _hoisted_5$2, toDisplayString(unref(o)("connect.template.mission_pool.preview")), 1),
1438
+ (openBlock(), createBlock(k, {
1429
1439
  key: 0,
1430
1440
  variant: "outlined",
1431
1441
  class: "p-24 space-y-16 w-fit"
1432
1442
  }, {
1433
1443
  default: withCtx(() => {
1434
- var V, x;
1444
+ var x, B;
1435
1445
  return [
1436
- createElementVNode("div", _hoisted_4$2, [
1446
+ createElementVNode("div", _hoisted_6$2, [
1437
1447
  createElementVNode("div", null, [
1438
- createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(((V = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : V.earningOption.amount) > 1 ? (x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? c(e.modelValue[e.modelValue.length - 1]) : ""), 1),
1439
- p[1] || (p[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
1448
+ createElementVNode("div", _hoisted_7$2, toDisplayString(unref(o)("connect.template.mission_pool.collect_stamps", { end: e.mission.end })) + " " + toDisplayString(((x = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : x.earningOption.amount) > 1 ? (B = e.modelValue[e.modelValue.length - 1]) == null ? void 0 : B.earningOption.amount : "") + " " + toDisplayString(e.modelValue[e.modelValue.length - 1] ? u(e.modelValue[e.modelValue.length - 1]) : ""), 1),
1449
+ createElementVNode("div", _hoisted_8$2, toDisplayString(unref(o)("connect.template.mission_pool.earn_stamp")), 1)
1440
1450
  ])
1441
1451
  ]),
1442
- createElementVNode("div", _hoisted_6$2, [
1452
+ createElementVNode("div", _hoisted_9$2, [
1443
1453
  createVNode(_sfc_main$5, {
1444
1454
  type: e.mission.type,
1445
1455
  "max-range": e.mission.end,
1446
1456
  currentRange: e.mission.end / 4,
1447
- markers: e.modelValue.map((R) => R.threshold)
1457
+ markers: e.modelValue.map((h) => h.threshold)
1448
1458
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
1449
- e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
1459
+ e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
1450
1460
  ])
1451
1461
  ];
1452
1462
  }),
@@ -1454,55 +1464,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1454
1464
  })),
1455
1465
  createVNode(_sfc_main$6, {
1456
1466
  ref_key: "sheetRef",
1457
- ref: n,
1458
- "onUpdate:modelValue": s,
1467
+ ref: a,
1468
+ "onUpdate:modelValue": f,
1459
1469
  "max-threshold": e.mission.end
1460
1470
  }, null, 8, ["max-threshold"])
1461
1471
  ]);
1462
1472
  };
1463
1473
  }
1464
- }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_6$1 = { class: "space-y-8" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1474
+ }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_10$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$3 = /* @__PURE__ */ defineComponent({
1465
1475
  __name: "MissionInput",
1466
1476
  props: {
1467
1477
  modelValue: Object
1468
1478
  },
1469
1479
  emits: ["update:model-value"],
1470
1480
  setup(e, { emit: m }) {
1471
- const a = e, i = computed(() => {
1472
- const l = FdoMission.safeParse(a.modelValue);
1481
+ const { t: o } = useI18n(), c = e, s = computed(() => {
1482
+ const l = FdoMission.safeParse(c.modelValue);
1473
1483
  return l.success ? [] : l.error.errors;
1474
- }), u = computed(() => [
1484
+ }), p = computed(() => [
1475
1485
  {
1476
- label: "Stamp",
1477
- description: "Award stamps for purchases, redeemable after reaching set milestones.",
1486
+ label: o("connect.campaign.mission.typeOption.STAMP.label"),
1487
+ description: o("connect.campaign.mission.typeOption.STAMP.description"),
1478
1488
  value: F_MISSION_TYPE.enum.STAMP
1479
1489
  },
1480
1490
  {
1481
- label: "Progress",
1482
- description: "Reward customers when they reach a cumulative spending goal.",
1491
+ label: o("connect.campaign.mission.typeOption.PROGRESSIVE.label"),
1492
+ description: o("connect.campaign.mission.typeOption.PROGRESSIVE.description"),
1483
1493
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1484
1494
  }
1485
- ]), d = m;
1486
- return (l, o) => {
1495
+ ]), n = m;
1496
+ return (l, i) => {
1487
1497
  var y;
1488
- const n = resolveComponent("FmCard"), s = resolveComponent("FmStepperField");
1498
+ const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
1489
1499
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
1490
1500
  createElementVNode("div", _hoisted_2$2, [
1491
- o[1] || (o[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
1492
- o[2] || (o[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1)),
1493
- createElementVNode("div", _hoisted_3$2, [
1494
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (v) => {
1495
- var h, g;
1496
- return openBlock(), createBlock(n, {
1501
+ createElementVNode("div", _hoisted_3$2, toDisplayString(unref(o)("connect.campaign.mission.missionType")), 1),
1502
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(o)("connect.template.select_game")), 1),
1503
+ createElementVNode("div", _hoisted_5$1, [
1504
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(p), (v) => {
1505
+ var C, b;
1506
+ return openBlock(), createBlock(a, {
1497
1507
  variant: "outlined",
1498
1508
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1499
- "col-span-2": unref(u).length == 1,
1500
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((h = e.modelValue) == null ? void 0 : h.type) == v.value,
1501
- "hover:bg-fm-color-opacity-sm": ((g = e.modelValue) == null ? void 0 : g.type) != v.value
1509
+ "col-span-2": unref(p).length == 1,
1510
+ "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) == v.value,
1511
+ "hover:bg-fm-color-opacity-sm": ((b = e.modelValue) == null ? void 0 : b.type) != v.value
1502
1512
  }]),
1503
1513
  onClick: () => {
1504
- var c, r;
1505
- ((c = e.modelValue) == null ? void 0 : c.type) != v.value && d("update:model-value", {
1514
+ var u, r;
1515
+ ((u = e.modelValue) == null ? void 0 : u.type) != v.value && n("update:model-value", {
1506
1516
  ...e.modelValue,
1507
1517
  type: v.value,
1508
1518
  end: ((r = e.modelValue) == null ? void 0 : r.end) || 1
@@ -1511,36 +1521,44 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1511
1521
  key: v.value
1512
1522
  }, {
1513
1523
  default: withCtx(() => [
1514
- createElementVNode("div", _hoisted_4$1, toDisplayString(v.label), 1),
1515
- createElementVNode("div", _hoisted_5$1, toDisplayString(v.description), 1)
1524
+ createElementVNode("div", _hoisted_6$1, toDisplayString(v.label), 1),
1525
+ createElementVNode("div", _hoisted_7$1, toDisplayString(v.description), 1)
1516
1526
  ]),
1517
1527
  _: 2
1518
1528
  }, 1032, ["class", "onClick"]);
1519
1529
  }), 128))
1520
1530
  ])
1521
1531
  ]),
1522
- createElementVNode("div", _hoisted_6$1, [
1523
- o[3] || (o[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
1524
- o[4] || (o[4] = 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)),
1525
- createVNode(s, {
1526
- label: "Maximum to collect",
1532
+ createElementVNode("div", _hoisted_8$1, [
1533
+ createElementVNode("div", _hoisted_9$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequired")), 1),
1534
+ createElementVNode("div", _hoisted_10$1, toDisplayString(unref(o)("connect.campaign.mission.collectionsRequiredDescription")), 1),
1535
+ createVNode(f, {
1536
+ label: unref(o)("connect.campaign.mission.maximumToCollect"),
1527
1537
  "model-value": ((y = e.modelValue) == null ? void 0 : y.end) || null,
1528
- "onUpdate:modelValue": o[0] || (o[0] = (v) => {
1529
- var h;
1530
- return d("update:model-value", {
1538
+ "onUpdate:modelValue": i[0] || (i[0] = (v) => {
1539
+ var C;
1540
+ return n("update:model-value", {
1531
1541
  ...e.modelValue,
1532
- type: ((h = e.modelValue) == null ? void 0 : h.type) || "STAMP",
1542
+ type: ((C = e.modelValue) == null ? void 0 : C.type) || "STAMP",
1533
1543
  end: v
1534
1544
  });
1535
1545
  }),
1536
- "helper-text": unref(ZodHelper).helperText(unref(i), "end") || "Set the threshold required for reward eligibility",
1537
- "helper-state": unref(ZodHelper).helperState(unref(i), "end") || "none"
1538
- }, null, 8, ["model-value", "helper-text", "helper-state"])
1546
+ "helper-text": unref(ZodHelper).helperText(unref(s), "end") || unref(o)("connect.campaign.mission.thresholdHelperText"),
1547
+ "helper-state": unref(ZodHelper).helperState(unref(s), "end") || "none"
1548
+ }, null, 8, ["label", "model-value", "helper-text", "helper-state"])
1539
1549
  ])
1540
1550
  ]);
1541
1551
  };
1542
1552
  }
1543
- }), _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
1553
+ });
1554
+ function useLocaleText() {
1555
+ const { locale: e, t: m } = useI18n();
1556
+ function o(c, s) {
1557
+ return c ? c[e.value] ?? c["en-US"] ?? m(s) : m(s);
1558
+ }
1559
+ return { getLocaleText: o };
1560
+ }
1561
+ const _hoisted_1$2 = { key: 26 }, _sfc_main$2 = /* @__PURE__ */ defineComponent({
1544
1562
  __name: "TemplateInput",
1545
1563
  props: {
1546
1564
  field: { type: Object, required: !0 },
@@ -1567,12 +1585,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1567
1585
  },
1568
1586
  emits: ["update:model-value", "update:file"],
1569
1587
  setup(e, { emit: m }) {
1570
- const { t: a } = useI18n(), i = e, u = m;
1571
- function d(s) {
1572
- switch (i.field.type) {
1588
+ const { t: o } = useI18n(), { getLocaleText: c } = useLocaleText(), s = e, p = m;
1589
+ function n(f) {
1590
+ switch (s.field.type) {
1573
1591
  case "timeframe":
1574
- const y = s.startDate ? hooks(s.startDate).startOf("day").toISOString() : void 0, v = s.endDate ? hooks(s.endDate).endOf("day").toISOString() : void 0;
1575
- u("update:model-value", {
1592
+ const y = f.startDate ? hooks(f.startDate).startOf("day").toISOString() : void 0, v = f.endDate ? hooks(f.endDate).endOf("day").toISOString() : void 0;
1593
+ p("update:model-value", {
1576
1594
  type: "timeframe",
1577
1595
  property: "__now",
1578
1596
  start: y,
@@ -1580,134 +1598,134 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1580
1598
  });
1581
1599
  break;
1582
1600
  case "image": {
1583
- u(
1601
+ p(
1584
1602
  "update:file",
1585
- s,
1586
- l.value || firebaseStorage.collectibleImagePath(void 0, s)
1603
+ f,
1604
+ l.value || firebaseStorage.collectibleImagePath(void 0, f)
1587
1605
  );
1588
1606
  break;
1589
1607
  }
1590
1608
  default:
1591
- u("update:model-value", s);
1609
+ p("update:model-value", f);
1592
1610
  break;
1593
1611
  }
1594
1612
  }
1595
1613
  const l = computed(() => {
1596
- switch (i.field.type) {
1614
+ switch (s.field.type) {
1597
1615
  case "timeframe": {
1598
- const s = i.modelValue;
1616
+ const f = s.modelValue;
1599
1617
  return {
1600
- startDate: s != null && s.start ? hooks(s == null ? void 0 : s.start).format("YYYY-MM-DD") : null,
1601
- endDate: s != null && s.end ? hooks(s == null ? void 0 : s.end).format("YYYY-MM-DD") : null
1618
+ startDate: f != null && f.start ? hooks(f == null ? void 0 : f.start).format("YYYY-MM-DD") : null,
1619
+ endDate: f != null && f.end ? hooks(f == null ? void 0 : f.end).format("YYYY-MM-DD") : null
1602
1620
  };
1603
1621
  }
1604
1622
  default:
1605
- return i.modelValue;
1623
+ return s.modelValue;
1606
1624
  }
1607
1625
  });
1608
- function o() {
1609
- if (!n.value.schema) return [];
1610
- const s = n.value.schema.safeParse(i.modelValue);
1611
- return s.success ? [] : s.error.errors;
1626
+ function i() {
1627
+ if (!a.value.schema) return [];
1628
+ const f = a.value.schema.safeParse(s.modelValue);
1629
+ return f.success ? [] : f.error.errors;
1612
1630
  }
1613
- const n = computed(() => ({
1614
- schema: i.schema,
1615
- unwrapped: i.schema ? ZodHelper.unwrap(i.schema) : void 0,
1616
- rules: i.schema ? [ZodHelper.ruleAtPath(i.schema, "")] : void 0,
1617
- labelMark: i.schema && ZodHelper.isRequired(i.schema) == !1 ? "optional" : void 0,
1618
- zodLabel: i.schema ? ZodHelper.toInputLabel(i.schema, i.field.label) : void 0
1631
+ const a = computed(() => ({
1632
+ schema: s.schema,
1633
+ unwrapped: s.schema ? ZodHelper.unwrap(s.schema) : void 0,
1634
+ rules: s.schema ? [ZodHelper.ruleAtPath(s.schema, "")] : void 0,
1635
+ labelMark: s.schema && ZodHelper.isRequired(s.schema) == !1 ? "optional" : void 0,
1636
+ zodLabel: s.schema ? ZodHelper.toInputLabel(s.schema, s.field.label) : void 0
1619
1637
  }));
1620
- return (s, y) => {
1621
- var p, f, b, C, V;
1622
- const v = resolveComponent("FmTextField"), h = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
1638
+ return (f, y) => {
1639
+ var d, g, k, V, x;
1640
+ const v = resolveComponent("FmTextField"), C = resolveComponent("FmStepperField"), b = resolveComponent("FmTextarea"), u = resolveComponent("FmHelperText"), r = resolveComponent("FmSwitch");
1623
1641
  return e.field.type === "text" ? (openBlock(), createBlock(v, {
1624
1642
  key: 0,
1625
- label: unref(a)(e.field.label),
1626
- "label-mark": unref(n).labelMark,
1627
- rules: unref(n).rules,
1643
+ label: unref(c)(e.field.label_locale, e.field.label ?? ""),
1644
+ "label-mark": unref(a).labelMark,
1645
+ rules: unref(a).rules,
1628
1646
  "model-value": unref(l),
1629
- "onUpdate:modelValue": d,
1647
+ "onUpdate:modelValue": n,
1630
1648
  "helper-state": e.helperText ? "error" : void 0,
1631
1649
  "helper-text": e.helperText
1632
1650
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1633
1651
  createVNode(JsonViewer, {
1634
- json: { schema: unref(n).unwrapped, props: i }
1652
+ json: { schema: unref(a).unwrapped, props: s }
1635
1653
  }, null, 8, ["json"]),
1636
- createVNode(h, {
1637
- label: unref(a)(e.field.label),
1638
- "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
1654
+ createVNode(C, {
1655
+ label: unref(c)(e.field.label_locale, e.field.label ?? ""),
1656
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(a).labelMark,
1639
1657
  "model-value": unref(l),
1640
- rules: e.field.isRuleChildren ? [] : unref(n).rules,
1641
- "onUpdate:modelValue": d,
1658
+ rules: e.field.isRuleChildren ? [] : unref(a).rules,
1659
+ "onUpdate:modelValue": n,
1642
1660
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
1643
1661
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
1644
1662
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
1645
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
1663
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(b, {
1646
1664
  key: 2,
1647
- label: unref(a)(e.field.label),
1648
- "label-mark": unref(n).labelMark,
1649
- rules: unref(n).rules,
1665
+ label: unref(c)(e.field.label_locale, e.field.label ?? ""),
1666
+ "label-mark": unref(a).labelMark,
1667
+ rules: unref(a).rules,
1650
1668
  "model-value": unref(l),
1651
- "onUpdate:modelValue": d,
1669
+ "onUpdate:modelValue": n,
1652
1670
  "show-word-count": "",
1653
- "max-length": (V = (C = (b = (f = (p = unref(n)) == null ? void 0 : p.unwrapped) == null ? void 0 : f._def) == null ? void 0 : b.checks) == null ? void 0 : C.find((x) => x.kind == "max")) == null ? void 0 : V.value
1671
+ "max-length": (x = (V = (k = (g = (d = unref(a)) == null ? void 0 : d.unwrapped) == null ? void 0 : g._def) == null ? void 0 : k.checks) == null ? void 0 : V.find((B) => B.kind == "max")) == null ? void 0 : x.value
1654
1672
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
1655
1673
  key: 3,
1656
1674
  "campaign-type": e.extras,
1657
1675
  "model-value": unref(l),
1658
1676
  disabled: e.disabled,
1659
- "onUpdate:modelValue": d
1677
+ "onUpdate:modelValue": n
1660
1678
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1661
1679
  createVNode(_sfc_main$e, {
1662
1680
  "model-value": unref(l),
1663
- "onUpdate:modelValue": d
1681
+ "onUpdate:modelValue": n
1664
1682
  }, null, 8, ["model-value"]),
1665
- createVNode(c, {
1683
+ createVNode(u, {
1666
1684
  class: "!mt-[8px]",
1667
- text: unref(ZodHelper).helperText(o(), ""),
1668
- state: unref(ZodHelper).helperState(o(), "")
1685
+ text: unref(ZodHelper).helperText(i(), ""),
1686
+ state: unref(ZodHelper).helperState(i(), "")
1669
1687
  }, null, 8, ["text", "state"])
1670
1688
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
1671
1689
  key: 5,
1672
1690
  thumbnail: unref(l),
1673
1691
  "aspect-ratio": "16 / 9",
1674
1692
  class: "w-1/2 xs:w-2/3",
1675
- "onUpdate:file": d
1693
+ "onUpdate:file": n
1676
1694
  }, {
1677
1695
  label: withCtx(() => [
1678
- (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
1696
+ (openBlock(), createBlock(resolveDynamicComponent(unref(a).zodLabel)))
1679
1697
  ]),
1680
1698
  _: 1
1681
1699
  }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(r, {
1682
1700
  key: 6,
1683
- label: unref(a)(e.field.label),
1701
+ label: unref(c)(e.field.label_locale, e.field.label ?? ""),
1684
1702
  "label-placement": "right",
1685
1703
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
1686
- "label-mark": unref(n).labelMark,
1687
- rules: unref(n).rules,
1704
+ "label-mark": unref(a).labelMark,
1705
+ rules: unref(a).rules,
1688
1706
  "model-value": unref(l),
1689
- "onUpdate:modelValue": d
1707
+ "onUpdate:modelValue": n
1690
1708
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
1691
1709
  key: 7,
1692
1710
  "model-value": unref(l),
1693
- "onUpdate:modelValue": d,
1711
+ "onUpdate:modelValue": n,
1694
1712
  "no-campaign": !1,
1695
- schema: unref(n).schema,
1713
+ schema: unref(a).schema,
1696
1714
  "is-mission": e.extras === "MISSION"
1697
1715
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
1698
1716
  key: 8,
1699
1717
  "model-value": unref(l),
1700
- "onUpdate:modelValue": d
1718
+ "onUpdate:modelValue": n
1701
1719
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
1702
1720
  createVNode(_sfc_main$r, {
1703
1721
  "model-value": unref(l),
1704
- "onUpdate:modelValue": d,
1722
+ "onUpdate:modelValue": n,
1705
1723
  "can-set-auto-apply": e.field.property == "campaign.effect"
1706
1724
  }, null, 8, ["model-value", "can-set-auto-apply"]),
1707
- unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
1725
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(u, {
1708
1726
  key: 0,
1709
1727
  class: "!mt-[8px]",
1710
- text: unref(a)("connect.campaign.common.effect_required"),
1728
+ text: unref(o)("connect.campaign.common.effect_required"),
1711
1729
  state: "error"
1712
1730
  }, null, 8, ["text"]))
1713
1731
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
@@ -1715,58 +1733,58 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1715
1733
  "allow-email": !0,
1716
1734
  "allow-whatsapp": !0,
1717
1735
  "model-value": unref(l),
1718
- "onUpdate:modelValue": d,
1719
- "helper-text": unref(ZodHelper).helperText(o(), ""),
1736
+ "onUpdate:modelValue": n,
1737
+ "helper-text": unref(ZodHelper).helperText(i(), ""),
1720
1738
  "trigger-type": e.field.extras,
1721
- "helper-state": unref(ZodHelper).helperState(o(), "")
1739
+ "helper-state": unref(ZodHelper).helperState(i(), "")
1722
1740
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
1723
1741
  key: 11,
1724
1742
  "model-value": unref(l),
1725
- "onUpdate:modelValue": d,
1743
+ "onUpdate:modelValue": n,
1726
1744
  extras: e.extras,
1727
1745
  "error-text": e.helperText
1728
1746
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
1729
1747
  key: 12,
1730
1748
  type: "custom",
1731
1749
  "model-value": unref(l),
1732
- "onUpdate:modelValue": d,
1733
- "helper-text": e.helperText || unref(ZodHelper).helperText(o(), ""),
1734
- "for-credit": i.campaignType === "CREDIT"
1750
+ "onUpdate:modelValue": n,
1751
+ "helper-text": e.helperText || unref(ZodHelper).helperText(i(), ""),
1752
+ "for-credit": s.campaignType === "CREDIT"
1735
1753
  }, null, 8, ["model-value", "helper-text", "for-credit"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
1736
1754
  key: 13,
1737
1755
  "model-value": unref(l),
1738
- "onUpdate:modelValue": d
1756
+ "onUpdate:modelValue": n
1739
1757
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
1740
1758
  key: 14,
1741
1759
  "model-value": unref(l),
1742
- "onUpdate:modelValue": d
1760
+ "onUpdate:modelValue": n
1743
1761
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
1744
1762
  key: 15,
1745
1763
  "model-value": unref(l),
1746
- "onUpdate:modelValue": d
1764
+ "onUpdate:modelValue": n
1747
1765
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
1748
1766
  key: 16,
1749
1767
  "model-value": unref(l),
1750
- "onUpdate:modelValue": d
1768
+ "onUpdate:modelValue": n
1751
1769
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
1752
1770
  key: 17,
1753
1771
  "model-value": unref(l),
1754
- "onUpdate:modelValue": d,
1755
- "helper-text": unref(ZodHelper).helperText(o(), ""),
1756
- "helper-state": unref(ZodHelper).helperState(o(), "")
1772
+ "onUpdate:modelValue": n,
1773
+ "helper-text": unref(ZodHelper).helperText(i(), ""),
1774
+ "helper-state": unref(ZodHelper).helperState(i(), "")
1757
1775
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
1758
1776
  key: 18,
1759
1777
  "model-value": unref(l),
1760
- "onUpdate:modelValue": d,
1778
+ "onUpdate:modelValue": n,
1761
1779
  mission: e.extras.mission
1762
1780
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
1763
1781
  createVNode(_sfc_main$d, {
1764
1782
  "model-value": unref(l),
1765
- "onUpdate:modelValue": d,
1783
+ "onUpdate:modelValue": n,
1766
1784
  "start-date": e.extras.start,
1767
1785
  "end-date": e.extras.end
1768
1786
  }, null, 8, ["model-value", "start-date", "end-date"]),
1769
- e.helperText ? (openBlock(), createBlock(c, {
1787
+ e.helperText ? (openBlock(), createBlock(u, {
1770
1788
  key: 0,
1771
1789
  class: "!mt-[8px]",
1772
1790
  text: e.helperText,
@@ -1775,25 +1793,25 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1775
1793
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
1776
1794
  createVNode(_sfc_main$t, {
1777
1795
  "model-value": unref(l),
1778
- "onUpdate:modelValue": d
1796
+ "onUpdate:modelValue": n
1779
1797
  }, null, 8, ["model-value"]),
1780
- e.helperText ? (openBlock(), createBlock(c, {
1798
+ e.helperText ? (openBlock(), createBlock(u, {
1781
1799
  key: 0,
1782
1800
  class: "!mt-[8px]",
1783
1801
  text: e.helperText,
1784
1802
  state: "error"
1785
1803
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1786
1804
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
1787
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
1805
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(u, {
1788
1806
  key: 0,
1789
1807
  state: "warning",
1790
1808
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
1791
1809
  }, null, 8, ["text"])) : createCommentVNode("", !0),
1792
1810
  createVNode(_sfc_main$i, {
1793
1811
  "model-value": unref(l),
1794
- "onUpdate:modelValue": d
1812
+ "onUpdate:modelValue": n
1795
1813
  }, null, 8, ["model-value"]),
1796
- e.helperText ? (openBlock(), createBlock(c, {
1814
+ e.helperText ? (openBlock(), createBlock(u, {
1797
1815
  key: 1,
1798
1816
  class: "!mt-[8px]",
1799
1817
  text: e.helperText,
@@ -1802,9 +1820,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1802
1820
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
1803
1821
  createVNode(_sfc_main$u, {
1804
1822
  "model-value": unref(l),
1805
- "onUpdate:modelValue": d
1823
+ "onUpdate:modelValue": n
1806
1824
  }, null, 8, ["model-value"]),
1807
- e.helperText ? (openBlock(), createBlock(c, {
1825
+ e.helperText ? (openBlock(), createBlock(u, {
1808
1826
  key: 0,
1809
1827
  class: "!mt-[8px]",
1810
1828
  text: e.helperText,
@@ -1813,9 +1831,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1813
1831
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
1814
1832
  createVNode(_sfc_main$v, {
1815
1833
  "model-value": unref(l),
1816
- "onUpdate:modelValue": d
1834
+ "onUpdate:modelValue": n
1817
1835
  }, null, 8, ["model-value"]),
1818
- e.helperText ? (openBlock(), createBlock(c, {
1836
+ e.helperText ? (openBlock(), createBlock(u, {
1819
1837
  key: 0,
1820
1838
  class: "!mt-[8px]",
1821
1839
  text: e.helperText,
@@ -1824,9 +1842,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1824
1842
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
1825
1843
  createVNode(_sfc_main$h, {
1826
1844
  "model-value": unref(l),
1827
- "onUpdate:modelValue": d
1845
+ "onUpdate:modelValue": n
1828
1846
  }, null, 8, ["model-value"]),
1829
- e.helperText ? (openBlock(), createBlock(c, {
1847
+ e.helperText ? (openBlock(), createBlock(u, {
1830
1848
  key: 0,
1831
1849
  class: "!mt-[8px]",
1832
1850
  text: e.helperText,
@@ -1835,15 +1853,15 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1835
1853
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
1836
1854
  createVNode(_sfc_main$9, {
1837
1855
  "model-value": unref(l),
1838
- "onUpdate:modelValue": d
1856
+ "onUpdate:modelValue": n
1839
1857
  }, null, 8, ["model-value"]),
1840
- e.helperText ? (openBlock(), createBlock(c, {
1858
+ e.helperText ? (openBlock(), createBlock(u, {
1841
1859
  key: 0,
1842
1860
  class: "!mt-[8px]",
1843
1861
  text: e.helperText,
1844
1862
  state: "error"
1845
1863
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1846
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(i.field), 1));
1864
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(s.field), 1));
1847
1865
  };
1848
1866
  }
1849
1867
  }), _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({
@@ -1855,23 +1873,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1855
1873
  }
1856
1874
  },
1857
1875
  setup(e) {
1858
- const { t: m, te: a } = useI18n();
1859
- return (i, u) => {
1860
- const d = resolveComponent("FmCard");
1861
- return openBlock(), createBlock(d, {
1876
+ const { t: m, te: o } = useI18n();
1877
+ return (c, s) => {
1878
+ const p = resolveComponent("FmCard");
1879
+ return openBlock(), createBlock(p, {
1862
1880
  variant: "outlined",
1863
1881
  class: "p-16 space-y-8"
1864
1882
  }, {
1865
1883
  default: withCtx(() => [
1866
1884
  createElementVNode("div", _hoisted_1$1, toDisplayString(unref(m)("connect.campaign.common.summary")), 1),
1867
- u[0] || (u[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
1868
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
1885
+ s[0] || (s[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
1886
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (n, l) => (openBlock(), createElementBlock("div", {
1869
1887
  class: "space-y-4",
1870
- key: o
1888
+ key: l
1871
1889
  }, [
1872
- l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1873
- createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${o}`)), 1),
1874
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(a)(`${l}`) ? unref(m)(`${l}`) : l), 1)
1890
+ n ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1891
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(m)(`${l}`)), 1),
1892
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(o)(`${n}`) ? unref(m)(`${n}`) : n), 1)
1875
1893
  ], 64)) : createCommentVNode("", !0)
1876
1894
  ]))), 128))
1877
1895
  ]),
@@ -1886,7 +1904,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1886
1904
  __name: "EditCampaignSheet",
1887
1905
  emits: ["submit:model-value"],
1888
1906
  setup(__props, { expose: __expose, emit: __emit }) {
1889
- const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
1907
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), { getLocaleText } = useLocaleText(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
1890
1908
  TEMPLATES.VOUCHER
1891
1909
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign"), campaignType = ref("VOUCHER");
1892
1910
  async function showSheet(visible, type, campaign, selectedTemplate) {
@@ -1896,19 +1914,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1896
1914
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
1897
1915
  } catch {
1898
1916
  } finally {
1899
- await new Promise((a) => setTimeout(a, 120)), isLoading.value = !1;
1917
+ await new Promise((o) => setTimeout(o, 120)), isLoading.value = !1;
1900
1918
  }
1901
- template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((a, i) => {
1902
- a.campaign.type === "VOUCHER" && a.campaign.code && useCampaignStore().campaigns.voucher.some(
1903
- (u) => u.code === a.campaign.code && u._id.toString() !== a.campaign._id.toString()
1904
- ) && i.addIssue({
1919
+ template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((o, c) => {
1920
+ o.campaign.type === "VOUCHER" && o.campaign.code && useCampaignStore().campaigns.voucher.some(
1921
+ (s) => s.code === o.campaign.code && s._id.toString() !== o.campaign._id.toString()
1922
+ ) && c.addIssue({
1905
1923
  code: "custom",
1906
1924
  message: "Code already exists, please use another code",
1907
1925
  path: ["campaign", "code"]
1908
1926
  });
1909
1927
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
1910
1928
  ...(m = template.value) == null ? void 0 : m.defaultValue
1911
- }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? `Edit ${CampaignOptions[type].name} Campaign` : `Create ${CampaignOptions[type].name} Campaign`;
1929
+ }), "configs" in data.value && typeof data.value.configs == "string" && (data.value.configs = eval(data.value.configs)), data.value = cleanPF(data.value), data.value.templateId = SvcConfig.getBusinessId(), data.value.campaign.business = SvcConfig.getBusinessId(), data.value.campaign.templateId = SvcConfig.getBusinessId(), "configs" in data.value && (data.value.configs.business = SvcConfig.getBusinessId()), currentStep.value = 1, sheetTitle.value = campaign ? t("connect.campaign.common.edit_campaign_title", {
1930
+ typeName: t(`connect.campaign.common.typeName.${type}`)
1931
+ }) : t("connect.campaign.common.create_campaign_title", {
1932
+ typeName: t(`connect.campaign.common.typeName.${type}`)
1933
+ });
1912
1934
  }
1913
1935
  }
1914
1936
  async function hideSheet() {
@@ -1935,10 +1957,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1935
1957
  });
1936
1958
  function stepErrors(e = currentStep.value - 1) {
1937
1959
  const m = template.value.steps[e].groups.flatMap(
1938
- (a) => a.fields.map((i) => i.property)
1960
+ (o) => o.fields.map((c) => c.property)
1939
1961
  );
1940
1962
  return errors.value.filter(
1941
- (a) => m.some((i) => a.path.join(".").includes(i))
1963
+ (o) => m.some((c) => o.path.join(".").includes(c))
1942
1964
  );
1943
1965
  }
1944
1966
  __expose({ showSheet });
@@ -1952,16 +1974,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1952
1974
  });
1953
1975
  }
1954
1976
  function onUpdateProperty(e, m) {
1955
- var a, i, u, d, l, o, n, s;
1977
+ var o, c, s, p, n, l, i, a;
1956
1978
  if (_.set(data.value, e, m), e == "campaign.event.type") {
1957
- const v = ((d = (u = (i = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : i.campaign) == null ? void 0 : u.event) == null ? void 0 : d.rule) ? _.cloneDeep({
1958
- ...(s = (n = (o = (l = template.value) == null ? void 0 : l.defaultValue) == null ? void 0 : o.campaign) == null ? void 0 : n.event) == null ? void 0 : s.rule
1979
+ const y = ((p = (s = (c = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : c.campaign) == null ? void 0 : s.event) == null ? void 0 : p.rule) ? _.cloneDeep({
1980
+ ...(a = (i = (l = (n = template.value) == null ? void 0 : n.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : i.event) == null ? void 0 : a.rule
1959
1981
  }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
1960
1982
  RuleBuilder.scaffoldGroup("g_schedule"),
1961
1983
  RuleBuilder.scaffoldGroup("g_time"),
1962
1984
  RuleBuilder.scaffoldGroup("g_user"),
1963
1985
  RuleBuilder.scaffoldGroup("g_bill")
1964
- ]), h = RuleBuilder.setRuleToGroup(
1986
+ ]), v = RuleBuilder.setRuleToGroup(
1965
1987
  RuleBuilder.scaffoldGroup("g_schedule"),
1966
1988
  [
1967
1989
  RuleBuilder.constructEntry(
@@ -1974,13 +1996,13 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1974
1996
  "&&"
1975
1997
  );
1976
1998
  if (m != "SCHEDULE") {
1977
- _.set(data.value, "campaign.event.rule", v);
1999
+ _.set(data.value, "campaign.event.rule", y);
1978
2000
  return;
1979
2001
  }
1980
2002
  _.set(
1981
2003
  data.value,
1982
2004
  "campaign.event.rule",
1983
- RuleBuilder.setRuleToGroup(v, h)
2005
+ RuleBuilder.setRuleToGroup(y, v)
1984
2006
  );
1985
2007
  }
1986
2008
  e == "campaign.notify" && m == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
@@ -1992,10 +2014,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1992
2014
  }) : "";
1993
2015
  }
1994
2016
  function isDisable(e) {
1995
- var m, a;
2017
+ var m, o;
1996
2018
  switch (e == null ? void 0 : e.property) {
1997
2019
  case "campaign.event.type":
1998
- return ((a = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : a._id) || !1;
2020
+ return ((o = (m = data.value) == null ? void 0 : m.campaign) == null ? void 0 : o._id) || !1;
1999
2021
  default:
2000
2022
  return !1;
2001
2023
  }
@@ -2005,25 +2027,25 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2005
2027
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2006
2028
  }
2007
2029
  return (e, m) => {
2008
- const a = resolveComponent("FmButton"), i = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), d = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2009
- return openBlock(), createBlock(l, {
2030
+ const o = resolveComponent("FmButton"), c = resolveComponent("FmStep"), s = resolveComponent("FmStepper"), p = resolveComponent("FmCard"), n = resolveComponent("FmTopSheet");
2031
+ return openBlock(), createBlock(n, {
2010
2032
  "fullscreen-size": "lg",
2011
2033
  modelValue: unref(sheetVisible),
2012
2034
  "onUpdate:modelValue": [
2013
- m[7] || (m[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2014
- m[8] || (m[8] = (o) => sheetVisible.value = o)
2035
+ m[7] || (m[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2036
+ m[8] || (m[8] = (l) => sheetVisible.value = l)
2015
2037
  ]
2016
2038
  }, createSlots({
2017
2039
  "top-sheet-header": withCtx(() => [
2018
2040
  createElementVNode("div", _hoisted_1, [
2019
2041
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2020
2042
  createElementVNode("div", _hoisted_2, [
2021
- createVNode(a, {
2022
- onClick: m[0] || (m[0] = (o) => hideSheet()),
2043
+ createVNode(o, {
2044
+ onClick: m[0] || (m[0] = (l) => hideSheet()),
2023
2045
  label: unref(t)("connect.campaign.common.cancel"),
2024
2046
  variant: "tertiary"
2025
2047
  }, null, 8, ["label"]),
2026
- createVNode(a, {
2048
+ createVNode(o, {
2027
2049
  onClick: onSubmit,
2028
2050
  label: unref(t)("connect.campaign.common.save"),
2029
2051
  disabled: unref(errors).length > 0
@@ -2061,7 +2083,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2061
2083
  ])
2062
2084
  ])
2063
2085
  ], -1)),
2064
- createVNode(d, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2086
+ createVNode(p, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2065
2087
  ])
2066
2088
  ])
2067
2089
  ])
@@ -2071,48 +2093,48 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2071
2093
  name: "default",
2072
2094
  fn: withCtx(() => [
2073
2095
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2074
- createVNode(u, {
2096
+ createVNode(s, {
2075
2097
  modelValue: unref(currentStep),
2076
- "onUpdate:modelValue": m[1] || (m[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2098
+ "onUpdate:modelValue": m[1] || (m[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2077
2099
  orientation: "horizontal",
2078
2100
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2079
2101
  }, {
2080
2102
  default: withCtx(() => [
2081
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
2082
- key: o.name,
2083
- title: unref(t)(o.name),
2084
- value: n + 1,
2085
- error: () => stepErrors(n).length > 0,
2086
- complete: () => n + 1 <= unref(currentStep)
2103
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, i) => (openBlock(), createBlock(c, {
2104
+ key: l.name,
2105
+ title: unref(getLocaleText)(l.name_locale, l.name),
2106
+ value: i + 1,
2107
+ error: () => stepErrors(i).length > 0,
2108
+ complete: () => i + 1 <= unref(currentStep)
2087
2109
  }, null, 8, ["title", "value", "error", "complete"]))), 128))
2088
2110
  ]),
2089
2111
  _: 1
2090
2112
  }, 8, ["modelValue"]),
2091
2113
  createElementVNode("div", _hoisted_4, [
2092
- createVNode(a, {
2114
+ createVNode(o, {
2093
2115
  icon: "close",
2094
2116
  variant: "tertiary",
2095
- onClick: m[2] || (m[2] = (o) => sheetVisible.value = !1)
2117
+ onClick: m[2] || (m[2] = (l) => sheetVisible.value = !1)
2096
2118
  }),
2097
- createVNode(u, {
2119
+ createVNode(s, {
2098
2120
  modelValue: unref(currentStep),
2099
- "onUpdate:modelValue": m[3] || (m[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2121
+ "onUpdate:modelValue": m[3] || (m[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2100
2122
  orientation: "horizontal",
2101
2123
  class: "flex-1"
2102
2124
  }, {
2103
2125
  default: withCtx(() => [
2104
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(i, {
2105
- key: o.name,
2126
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, i) => (openBlock(), createBlock(c, {
2127
+ key: l.name,
2106
2128
  title: unref(sheetTitle),
2107
- description: unref(t)(o.name),
2108
- value: n + 1,
2109
- error: () => stepErrors(n).length > 0,
2110
- complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2129
+ description: unref(getLocaleText)(l.name_locale, l.name),
2130
+ value: i + 1,
2131
+ error: () => stepErrors(i).length > 0,
2132
+ complete: () => i + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2111
2133
  }, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
2112
2134
  ]),
2113
2135
  _: 1
2114
2136
  }, 8, ["modelValue"]),
2115
- createVNode(a, {
2137
+ createVNode(o, {
2116
2138
  icon: "info",
2117
2139
  variant: "tertiary",
2118
2140
  onClick: m[4] || (m[4] = () => showSummaryDialog())
@@ -2124,55 +2146,55 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2124
2146
  json: {
2125
2147
  data: unref(data),
2126
2148
  errors: unref(errors).map(
2127
- (o) => `${o.path.join(".")} - ${o.message}`
2149
+ (l) => `${l.path.join(".")} - ${l.message}`
2128
2150
  ),
2129
2151
  stepErrors: stepErrors().map(
2130
- (o) => `${o.path.join(".")} - ${o.message}`
2152
+ (l) => `${l.path.join(".")} - ${l.message}`
2131
2153
  ),
2132
2154
  schema: unref(schema)
2133
2155
  }
2134
2156
  }, null, 8, ["json"]),
2135
2157
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2136
- (o) => o.fields.length && (!o.condition || (Array.isArray(o.condition) ? o.condition.every((n) => unref(_).get(unref(data), n.property) == n.value == (n.not != !0)) : unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0)))
2137
- ), (o, n) => (openBlock(), createElementBlock("div", {
2138
- key: n,
2158
+ (l) => l.fields.length && (!l.condition || (Array.isArray(l.condition) ? l.condition.every((i) => unref(_).get(unref(data), i.property) == i.value == (i.not != !0)) : unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0)))
2159
+ ), (l, i) => (openBlock(), createElementBlock("div", {
2160
+ key: i,
2139
2161
  class: "space-y-24"
2140
2162
  }, [
2141
- createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
2142
- (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (s, y) => (openBlock(), createElementBlock("div", { key: y }, [
2163
+ createElementVNode("div", _hoisted_7, toDisplayString(unref(getLocaleText)(l.name_locale, l.name ?? "")), 1),
2164
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (a, f) => (openBlock(), createElementBlock("div", { key: f }, [
2143
2165
  (openBlock(), createBlock(_sfc_main$2, {
2144
- key: y,
2145
- field: s,
2146
- modelValue: unref(_).get(unref(data), s.property),
2147
- disabled: isDisable(s),
2166
+ key: f,
2167
+ field: a,
2168
+ modelValue: unref(_).get(unref(data), a.property),
2169
+ disabled: isDisable(a),
2148
2170
  "campaign-type": unref(campaignType),
2149
- "onUpdate:modelValue": (v) => onUpdateProperty(s.property, v),
2150
- "onUpdate:file": async (v, h) => {
2151
- const g = await onUpdateFile(v, h);
2152
- onUpdateProperty(s.property, g || "");
2171
+ "onUpdate:modelValue": (y) => onUpdateProperty(a.property, y),
2172
+ "onUpdate:file": async (y, v) => {
2173
+ const C = await onUpdateFile(y, v);
2174
+ onUpdateProperty(a.property, C || "");
2153
2175
  },
2154
2176
  schema: unref(ZodHelper).typeAtPath(
2155
2177
  unref(schema),
2156
- s.property,
2178
+ a.property,
2157
2179
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2158
2180
  ),
2159
- "helper-state": unref(ZodHelper).helperState(unref(errors), s.property),
2160
- "helper-text": unref(ZodHelper).helperText(unref(errors), s.property),
2161
- extras: s.extras != null ? s.extras == "" ? unref(data) : unref(_).get(unref(data), s.extras) : void 0
2181
+ "helper-state": unref(ZodHelper).helperState(unref(errors), a.property),
2182
+ "helper-text": unref(ZodHelper).helperText(unref(errors), a.property),
2183
+ extras: a.extras != null ? a.extras == "" ? unref(data) : unref(_).get(unref(data), a.extras) : void 0
2162
2184
  }, null, 8, ["field", "modelValue", "disabled", "campaign-type", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
2163
2185
  ]))), 128))
2164
2186
  ]))), 128)),
2165
2187
  createElementVNode("div", _hoisted_8, [
2166
- createVNode(a, {
2167
- label: "Back",
2188
+ createVNode(o, {
2189
+ label: unref(t)("connect.common.back"),
2168
2190
  variant: "tertiary",
2169
2191
  disabled: unref(currentStep) == 1,
2170
- onClick: m[5] || (m[5] = (o) => currentStep.value--)
2171
- }, null, 8, ["disabled"]),
2172
- createVNode(a, {
2192
+ onClick: m[5] || (m[5] = (l) => currentStep.value--)
2193
+ }, null, 8, ["label", "disabled"]),
2194
+ createVNode(o, {
2173
2195
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2174
- label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2175
- onClick: m[6] || (m[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2196
+ label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? unref(t)("connect.common.next") : unref(t)("connect.common.submit"),
2197
+ onClick: m[6] || (m[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2176
2198
  }, null, 8, ["disabled", "label"])
2177
2199
  ])
2178
2200
  ]),
@@ -2190,5 +2212,6 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2190
2212
  }
2191
2213
  });
2192
2214
  export {
2193
- _sfc_main as _
2215
+ _sfc_main as _,
2216
+ useLocaleText as u
2194
2217
  };