@feedmepos/mf-connect 0.0.39-prod → 0.1.0-beta.2

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 (101) hide show
  1. package/dist/Analytic-DSD9TsKr.js +622 -0
  2. package/dist/{App-X3fNEBF3.js → App-D8a5eW51.js} +250 -249
  3. package/dist/Broadcast-C8jgMe6g.js +223 -0
  4. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CRYS_tzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-pG8WvV4I.js} +20 -20
  5. package/dist/Card-C1K7ULPo.js +825 -0
  6. package/dist/Collections-lMrdPUuM.js +453 -0
  7. package/dist/Credit-CJfU5tP4.js +220 -0
  8. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-DoZyevfa.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYoaa_-x.js} +1042 -1011
  9. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js +345 -0
  10. package/dist/Experience-Bp2ki8gU.js +221 -0
  11. package/dist/Game-BpTf6ebE.js +255 -0
  12. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js +144 -0
  13. package/dist/{MainLayout-DpZC6o3R.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CyGJxUol.js} +19 -53
  14. package/dist/MainLayout-B1aJoR95.js +41 -0
  15. package/dist/Marketing-BiKE2gxA.js +316 -0
  16. package/dist/Member-BSWyy32a.js +69 -0
  17. package/dist/MemberList-CHlGREyR.js +1733 -0
  18. package/dist/MemberOverview-wL_ailso.js +58 -0
  19. package/dist/{MemberTransactions-DueaXBCy.js → MemberTransactions-BzHiXCnp.js} +1 -1
  20. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js +432 -0
  21. package/dist/Mission-8IGT3T2C.js +261 -0
  22. package/dist/Point-CbbJ6ohd.js +222 -0
  23. package/dist/Promotion-BYXCJa_S.js +247 -0
  24. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js → RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js} +557 -557
  25. package/dist/Segment-DXDNM0yd.js +437 -0
  26. package/dist/Setting-CLpvvZTv.js +1901 -0
  27. package/dist/Store-C6-P6bwc.js +1511 -0
  28. package/dist/StoreRewards-CUM2irXK.js +401 -0
  29. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CLFiuO5k.js → StoreTransactions.vue_vue_type_script_setup_true_lang-JaRdmqif.js} +10 -10
  30. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js} +1 -1
  31. package/dist/{Tier-CftEoP_R.js → Tier-DZTDxWBo.js} +481 -453
  32. package/dist/{Title-BsavXbYh.js → Title-C2Dr5ceK.js} +314 -295
  33. package/dist/Transaction-BL4mS29d.js +39 -0
  34. package/dist/Voucher-Cx0r2-df.js +490 -0
  35. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js +56 -0
  36. package/dist/{app-BNmAx3zq.js → app-B_xuZ5HB.js} +1 -1
  37. package/dist/app-wE5HTF_Y.js +5762 -0
  38. package/dist/app.js +5 -3
  39. package/dist/{business-DGL4Ayx0.js → business-DSv8zM8C.js} +1 -1
  40. package/dist/{campaign-D94sS1kM.js → campaign-7y5qquHZ.js} +5 -3
  41. package/dist/{collection.fn-BHJ1ISqO.js → collection.fn-BxVZQAx0.js} +2 -2
  42. package/dist/dto-Ew1QwLci.js +2778 -0
  43. package/dist/{effect-CFRICzlM.js → effect-BzPh8fRI.js} +9 -9
  44. package/dist/{export-w2o9NYcy.js → export-C9tDplkA.js} +3 -3
  45. package/dist/{helper-CUDWQ8vq.js → helper-Sz7oQ0F4.js} +1 -1
  46. package/dist/{index-BGuLhEym.js → index-BQm0C3Jm.js} +3 -3
  47. package/dist/{index-BjwyxNSp.js → index-C-SOz7jt.js} +1 -1
  48. package/dist/{index-BcWJcD9f.js → index-C0lpADCo.js} +1 -1
  49. package/dist/{index-DIq2KVis.js → index-C3_4GUiI.js} +1 -1
  50. package/dist/{index-BPEV5Tzg.js → index-D-2nFLsg.js} +59 -47
  51. package/dist/{index-CFMBSL24.js → index-DBMaUGYI.js} +2 -2
  52. package/dist/{index-CpwFQFTV.js → index-DH_1nOJ_.js} +3 -3
  53. package/dist/index-Dy4pmQpt.js +29193 -0
  54. package/dist/{index-BQ6isIeo.js → index-_3qBsogG.js} +1 -1
  55. package/dist/index-gIRszcHf.js +3 -0
  56. package/dist/{index-VjUw31dN.js → index-tv4t0Pnh.js} +1 -1
  57. package/dist/{index-tZ1aqhks.js → index-z0IfdrZk.js} +319 -281
  58. package/dist/{index.esm2017-zciuPty-.js → index.esm2017-BnKJDxUo.js} +55 -55
  59. package/dist/{loading-GuXe5bYG.js → loading-Ds-yFYhc.js} +469 -460
  60. package/dist/{membership-BHWJVI3e.js → membership-DaiVw9qF.js} +3 -3
  61. package/dist/money-BHtBdZoz.js +15 -0
  62. package/dist/number-CZhcB8ef.js +12 -0
  63. package/dist/{rule-MgNa_8FF.js → rule-Cd2M6Ri2.js} +2 -2
  64. package/dist/{rule-builder-BsBCWzq_.js → rule-builder-B6og27Q1.js} +1 -1
  65. package/dist/style.css +1 -1
  66. package/dist/{template-D6k3lusq.js → template-DouRWBpv.js} +63 -63
  67. package/dist/{usePagination-JoYaROkV.js → usePagination-BeF5K3M7.js} +85 -85
  68. package/dist/vue-i18n-BTlOChXs.js +2365 -0
  69. package/dist/{xlsx-ClrA4KOh.js → xlsx-SahfXQ70.js} +517 -517
  70. package/dist/zod-Bg2FbC-D.js +90 -0
  71. package/package.json +7 -4
  72. package/dist/Analytic-DMFueUju.js +0 -620
  73. package/dist/Broadcast-YIfWIXeA.js +0 -216
  74. package/dist/Card-BIxlgQm7.js +0 -824
  75. package/dist/Collections-M6DaHM2W.js +0 -441
  76. package/dist/Credit-BtRy-xoY.js +0 -214
  77. package/dist/EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js +0 -344
  78. package/dist/Experience-DGm1lnqj.js +0 -211
  79. package/dist/Game-B8-lG7qq.js +0 -250
  80. package/dist/ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js +0 -144
  81. package/dist/Marketing-DtG3AIWr.js +0 -309
  82. package/dist/Member-K443-9Vy.js +0 -92
  83. package/dist/MemberList-CYXHXFTL.js +0 -1735
  84. package/dist/MemberOverview-C2n9oJZh.js +0 -58
  85. package/dist/MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js +0 -203
  86. package/dist/Mission-CN5umXXA.js +0 -248
  87. package/dist/Point-XAm6H2p_.js +0 -220
  88. package/dist/Promotion-DsrA4KiE.js +0 -244
  89. package/dist/Segment-CZGGHoAu.js +0 -435
  90. package/dist/Setting-BjfxLKyp.js +0 -1870
  91. package/dist/Store-D_B-vhh3.js +0 -1513
  92. package/dist/StoreRewards-BjHffUKj.js +0 -429
  93. package/dist/Transaction-CdxzoKDG.js +0 -36
  94. package/dist/Voucher-B_9Nv1Mr.js +0 -485
  95. package/dist/ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js +0 -140
  96. package/dist/app--1Ks5Hms.js +0 -2974
  97. package/dist/dto-X0Eeujxx.js +0 -1151
  98. package/dist/index-BPNG8N-w.js +0 -11
  99. package/dist/index-DWM9MWGj.js +0 -28058
  100. package/dist/money-CrttVpCp.js +0 -15
  101. package/dist/number-CIndGU4O.js +0 -12
@@ -1,33 +1,36 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, ref, watch, resolveComponent, createElementBlock, createElementVNode, Fragment, renderList, createVNode, isRef, createCommentVNode, withCtx, normalizeClass, toDisplayString, renderSlot, createTextVNode, resolveDynamicComponent, toRefs, normalizeStyle, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app--1Ks5Hms.js";
4
- import { Z as ZodHelper, _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-3LlSDiq0.js";
5
- import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-X0Eeujxx.js";
6
- import { u as useMembershipStore, C as CollectibleOptions } from "./membership-BHWJVI3e.js";
7
- import { u as useBusinessStore } from "./business-DGL4Ayx0.js";
8
- import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-BQ6isIeo.js";
9
- import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-BsBCWzq_.js";
3
+ import { z } from "./app-wE5HTF_Y.js";
4
+ import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
+ import { c as getCampaignSummaryObject, d as campaignRefinement, e as CampaignDtos, C as CampaignOptions, f as campaignTransform } from "./dto-Ew1QwLci.js";
6
+ import { u as useMembershipStore, C as CollectibleOptions } from "./membership-DaiVw9qF.js";
7
+ import { u as useBusinessStore } from "./business-DSv8zM8C.js";
8
+ import { a as FdoEarningOption, b as F_GAME_TYPE, F as FdtoCollectibleConfig } from "./index-_3qBsogG.js";
9
+ import { i as isRuleGroup, R as RuleBuilder, a as isRuleEntry } from "./rule-builder-B6og27Q1.js";
10
10
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
11
11
  import { h as hooks } from "./moment-BWErdI6_.js";
12
- import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-BPEV5Tzg.js";
13
- import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
14
- import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-D5DNTBSQ.js";
15
- import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CoMQBL4P.js";
16
- import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-_RX1J0Br.js";
17
- import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-GuXe5bYG.js";
18
- import { _ as _sfc_main$q, T as TEMPLATES } from "./index-tZ1aqhks.js";
19
- import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-Bk2HLVmt.js";
20
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-MgNa_8FF.js";
21
- import { c as core, S as SvcConfig } from "./index-DWM9MWGj.js";
22
- import "./index-CFMBSL24.js";
23
- import "./index-CpwFQFTV.js";
24
- import "./index-BGuLhEym.js";
25
- import "./index-BcWJcD9f.js";
12
+ import { b as F_CAMPAIGN_TRIGGER_TYPE, C as CAMPAIGN_TRIGGER, c as FdoCreditLoyaltyReward, d as FdtoRandomReward, e as F_MISSION_TYPE, f as FdtoThresholdReward, g as FdoMission, h as featureVersionMapping } from "./index-D-2nFLsg.js";
13
+ import { _ as _sfc_main$v } from "./ImageInput.vue_vue_type_script_setup_true_lang-rWUkV9gn.js";
14
+ import { _ as _sfc_main$w, a as _sfc_main$x, b as _sfc_main$z } from "./EffectSheet.vue_vue_type_style_index_0_lang-CzEtOmp0.js";
15
+ import { _ as _sfc_main$y } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DEb4OBcX.js";
16
+ import { _ as _sfc_main$r, a as _sfc_main$s, b as _sfc_main$t } from "./RuleGroup.vue_vue_type_script_setup_true_lang-Bruh-umZ.js";
17
+ import { p as prompt, c as cases, f as firebaseStorage, u as useLoading } from "./loading-Ds-yFYhc.js";
18
+ import { _ as _sfc_main$q, T as TEMPLATES } from "./index-z0IfdrZk.js";
19
+ import { u as useI18n } from "./vue-i18n-BTlOChXs.js";
20
+ import { _ as _sfc_main$A } from "./MessageInput.vue_vue_type_script_setup_true_lang-e-zWg08J.js";
21
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Cd2M6Ri2.js";
22
+ import { r, S as SvcConfig } from "./index-Dy4pmQpt.js";
23
+ import "./index-DBMaUGYI.js";
24
+ import "./index-DH_1nOJ_.js";
25
+ import "./index-BQm0C3Jm.js";
26
+ import "./index-C0lpADCo.js";
26
27
  import { useCoreStore } from "@feedmepos/mf-common";
27
- import { i as initCollectibleConfig } from "./helper-CUDWQ8vq.js";
28
- import { C as CollectionUtils } from "./collection.fn-BHJ1ISqO.js";
28
+ import { _ as _sfc_main$u } from "./ZodTextField.vue_vue_type_script_setup_true_lang-DWuAODUF.js";
29
+ import { i as initCollectibleConfig } from "./helper-Sz7oQ0F4.js";
30
+ import { C as CollectionUtils } from "./collection.fn-BxVZQAx0.js";
29
31
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
30
32
  import { useDialog } from "@feedmepos/ui-library";
33
+ import { u as useCampaignStore } from "./campaign-7y5qquHZ.js";
31
34
  import { a as cleanPF } from "./object-qECH92oz.js";
32
35
  const _sfc_main$p = /* @__PURE__ */ defineComponent({
33
36
  __name: "SegmentConfigurator",
@@ -38,27 +41,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
38
41
  }
39
42
  },
40
43
  emits: ["update:model-value"],
41
- setup(e, { emit: i }) {
42
- const n = e, r = computed(() => {
43
- var t;
44
- const [s] = isRuleGroup(n.modelValue) ? Object.values(((t = n.modelValue) == null ? void 0 : t.rules) ?? {}) : [null];
45
- return (s ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
46
- }), o = i;
47
- return (s, l) => (openBlock(), createBlock(_sfc_main$q, {
44
+ setup(e, { emit: c }) {
45
+ const s = e, u = computed(() => {
46
+ var o;
47
+ const [i] = isRuleGroup(s.modelValue) ? Object.values(((o = s.modelValue) == null ? void 0 : o.rules) ?? {}) : [null];
48
+ return (i ?? RuleBuilder.constructEntry("user.segment", "_hasAny", [])).conditions._hasAny;
49
+ }), a = c;
50
+ return (i, l) => (openBlock(), createBlock(_sfc_main$q, {
48
51
  multiselect: !0,
49
52
  items: unref(useMembershipStore)().segmentOptions,
50
- "model-value": unref(r),
51
- "onUpdate:modelValue": l[0] || (l[0] = (t) => o(
53
+ "model-value": unref(u),
54
+ "onUpdate:modelValue": l[0] || (l[0] = (o) => a(
52
55
  "update:model-value",
53
56
  unref(RuleBuilder).setRuleToGroup(
54
57
  unref(RuleBuilder).scaffoldGroup("g_segment"),
55
- unref(RuleBuilder).constructEntry("user.segment", "_hasAny", t)
58
+ unref(RuleBuilder).constructEntry("user.segment", "_hasAny", o)
56
59
  )
57
60
  )),
58
61
  label: "Select segment(s) to match"
59
62
  }, null, 8, ["items", "model-value"]));
60
63
  }
61
- }), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$h = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
64
+ }), _hoisted_1$k = { class: "space-y-16" }, _hoisted_2$e = { key: 0 }, _sfc_main$o = /* @__PURE__ */ defineComponent({
62
65
  __name: "UserRuleGroup",
63
66
  props: {
64
67
  modelValue: {
@@ -68,75 +71,78 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
68
71
  }
69
72
  },
70
73
  emits: ["update:model-value"],
71
- setup(e, { emit: i }) {
72
- const n = e, r = i, o = ref(
73
- n.modelValue ? RuleBuilder.getRules(n.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(n.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
74
- ), s = [
74
+ setup(e, { emit: c }) {
75
+ const { t: s } = useI18n(), u = e, a = c, i = ref(
76
+ u.modelValue ? RuleBuilder.getRules(u.modelValue.rules.g_user).length > 0 ? "custom" : RuleBuilder.getRules(u.modelValue.rules.g_segment).length > 0 ? "segment" : "all_users" : "all_users"
77
+ ), l = [
75
78
  {
76
79
  value: "all_users",
77
- label: "All audience"
80
+ label: s("connect.template.rule.audience.all")
78
81
  },
79
82
  {
80
83
  value: "segment",
81
- label: "Member segment"
84
+ label: s("connect.template.rule.audience.member_segment")
82
85
  },
83
86
  {
84
87
  value: "custom",
85
- label: "Custom audience"
88
+ label: s("connect.template.rule.audience.custom_audience")
86
89
  }
87
90
  ];
88
- return watch(o, async (l, t) => {
89
- var a;
90
- if (t != "all_users" && t != l && RuleBuilder.getRules(
91
- (a = n.modelValue) == null ? void 0 : a.rules[t == "custom" ? "g_user" : "g_segment"]
91
+ return watch(i, async (o, n) => {
92
+ var p;
93
+ if (n != "all_users" && n != o && RuleBuilder.getRules(
94
+ (p = u.modelValue) == null ? void 0 : p.rules[n == "custom" ? "g_user" : "g_segment"]
92
95
  ).length > 0) {
93
- const f = await prompt.confirm(
94
- "Are you sure you want to change the audience type? This will remove all the rules you have set."
96
+ const h = await prompt.confirm(
97
+ s("connect.template.rule.audience.confirm_remove"),
98
+ s("connect.common.confirm"),
99
+ s("connect.common.confirm"),
100
+ s("connect.common.cancel")
95
101
  );
96
- f && r(
102
+ h && a(
97
103
  "update:model-value",
98
104
  RuleBuilder.setRuleToGroup(
99
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
100
- RuleBuilder.scaffoldGroup(t == "custom" ? "g_user" : "g_segment")
105
+ u.modelValue ?? RuleBuilder.scaffoldGroup(),
106
+ RuleBuilder.scaffoldGroup(n == "custom" ? "g_user" : "g_segment")
101
107
  )
102
- ), o.value = f ? l : t;
108
+ ), i.value = h ? o : n;
103
109
  }
104
- }), (l, t) => {
105
- var f, v;
106
- const a = resolveComponent("FmRadio");
110
+ }), (o, n) => {
111
+ var h, y;
112
+ const p = resolveComponent("FmRadio");
107
113
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
108
114
  createElementVNode("div", null, [
109
- (openBlock(), createElementBlock(Fragment, null, renderList(s, (m) => createVNode(a, {
110
- key: m.value,
111
- value: m.value,
112
- label: m.label,
113
- modelValue: unref(o),
114
- "onUpdate:modelValue": t[0] || (t[0] = (g) => isRef(o) ? o.value = g : null)
115
+ (openBlock(), createElementBlock(Fragment, null, renderList(l, (g) => createVNode(p, {
116
+ key: g.value,
117
+ value: g.value,
118
+ label: g.label,
119
+ modelValue: unref(i),
120
+ "onUpdate:modelValue": n[0] || (n[0] = (V) => isRef(i) ? i.value = V : null)
115
121
  }, null, 8, ["value", "label", "modelValue"])), 64))
116
122
  ]),
117
- unref(o) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$h, [
123
+ unref(i) == "segment" ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
118
124
  createVNode(_sfc_main$p, {
119
- modelValue: ((f = e.modelValue) == null ? void 0 : f.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
120
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r(
125
+ modelValue: ((h = e.modelValue) == null ? void 0 : h.rules.g_segment) ?? unref(RuleBuilder).scaffoldGroup("g_segment"),
126
+ "onUpdate:modelValue": n[1] || (n[1] = (g) => a(
121
127
  "update:model-value",
122
128
  unref(RuleBuilder).setRuleToGroup(
123
129
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
124
- m,
130
+ g,
125
131
  "&&"
126
132
  )
127
133
  ))
128
134
  }, null, 8, ["modelValue"])
129
135
  ])) : createCommentVNode("", !0),
130
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
136
+ unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
131
137
  key: 1,
132
138
  "include-only": "user",
133
139
  "trigger-type": "MEMBERSHIP_JOINED",
134
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
135
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
140
+ "model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_user) ?? unref(RuleBuilder).scaffoldGroup("g_user"),
141
+ "onUpdate:modelValue": n[2] || (n[2] = (g) => a(
136
142
  "update:model-value",
137
143
  unref(RuleBuilder).setRuleToGroup(
138
144
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
139
- m,
145
+ g,
140
146
  "&&"
141
147
  )
142
148
  ))
@@ -154,77 +160,83 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
154
160
  }
155
161
  },
156
162
  emits: ["update:model-value"],
157
- setup(e, { emit: i }) {
158
- const n = e, r = i, o = ref(
159
- !n.modelValue || !n.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(n.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
163
+ setup(e, { emit: c }) {
164
+ const { t: s } = useI18n(), u = e, a = c, i = ref(
165
+ !u.modelValue || !u.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(u.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
160
166
  );
161
- watch(o, async (l, t) => {
162
- var a;
163
- if (t == "custom" && l == "all_time" && RuleBuilder.getRules((a = n.modelValue) == null ? void 0 : a.rules.g_time).length > 0) {
164
- const f = await prompt.confirm(
165
- "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
167
+ watch(i, async (o, n) => {
168
+ var p;
169
+ if (n == "custom" && o == "all_time" && RuleBuilder.getRules((p = u.modelValue) == null ? void 0 : p.rules.g_time).length > 0) {
170
+ const h = await prompt.confirm(
171
+ s("connect.template.rule.time.confirm_remove"),
172
+ s("connect.common.confirm"),
173
+ s("connect.common.confirm"),
174
+ s("connect.common.cancel")
166
175
  );
167
- f && r(
176
+ h && a(
168
177
  "update:model-value",
169
178
  RuleBuilder.setRuleToGroup(
170
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
179
+ u.modelValue ?? RuleBuilder.scaffoldGroup(),
171
180
  RuleBuilder.scaffoldGroup("g_time")
172
181
  )
173
- ), o.value = f ? l : t;
182
+ ), i.value = h ? o : n;
174
183
  }
175
184
  });
176
- async function s(l) {
177
- var t;
178
- if (l == "custom" && RuleBuilder.getRules((t = n.modelValue) == null ? void 0 : t.rules.g_time).length > 0) {
185
+ async function l(o) {
186
+ var n;
187
+ if (o == "custom" && RuleBuilder.getRules((n = u.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
179
188
  if (!await prompt.confirm(
180
- "Are you sure you want to turn off custom conditons? This will remove all the rules you have set."
189
+ s("connect.template.rule.time.confirm_remove"),
190
+ s("connect.common.confirm"),
191
+ s("connect.common.confirm"),
192
+ s("connect.common.cancel")
181
193
  )) {
182
- o.value = "all_time";
194
+ i.value = "all_time";
183
195
  return;
184
196
  }
185
- r(
197
+ a(
186
198
  "update:model-value",
187
199
  RuleBuilder.setRuleToGroup(
188
- n.modelValue ?? RuleBuilder.scaffoldGroup(),
200
+ u.modelValue ?? RuleBuilder.scaffoldGroup(),
189
201
  RuleBuilder.scaffoldGroup("g_time")
190
202
  )
191
203
  );
192
204
  }
193
205
  }
194
- return (l, t) => {
195
- var v;
196
- const a = resolveComponent("FmRadio"), f = resolveComponent("FmRadioGroup");
206
+ return (o, n) => {
207
+ var y;
208
+ const p = resolveComponent("FmRadio"), h = resolveComponent("FmRadioGroup");
197
209
  return openBlock(), createElementBlock("div", _hoisted_1$j, [
198
- createVNode(f, {
199
- modelValue: unref(o),
210
+ createVNode(h, {
211
+ modelValue: unref(i),
200
212
  "onUpdate:modelValue": [
201
- t[0] || (t[0] = (m) => isRef(o) ? o.value = m : null),
202
- t[1] || (t[1] = (m) => s(m))
213
+ n[0] || (n[0] = (g) => isRef(i) ? i.value = g : null),
214
+ n[1] || (n[1] = (g) => l(g))
203
215
  ]
204
216
  }, {
205
217
  default: withCtx(() => [
206
- createVNode(a, {
207
- label: "All time",
218
+ createVNode(p, {
219
+ label: unref(s)("connect.template.rule.time.all_time"),
208
220
  value: "all_time"
209
- }),
210
- createVNode(a, {
211
- label: "Custom date/time",
221
+ }, null, 8, ["label"]),
222
+ createVNode(p, {
223
+ label: unref(s)("connect.template.rule.time.custom"),
212
224
  value: "custom"
213
- })
225
+ }, null, 8, ["label"])
214
226
  ]),
215
227
  _: 1
216
228
  }, 8, ["modelValue"]),
217
- unref(o) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
229
+ unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$r, {
218
230
  key: 0,
219
231
  class: "!mt-[0px]",
220
232
  "include-only": "trigger",
221
233
  "trigger-type": "SCHEDULE",
222
- "model-value": ((v = e.modelValue) == null ? void 0 : v.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
223
- "onUpdate:modelValue": t[2] || (t[2] = (m) => r(
234
+ "model-value": ((y = e.modelValue) == null ? void 0 : y.rules.g_time) ?? unref(RuleBuilder).scaffoldGroup("g_time"),
235
+ "onUpdate:modelValue": n[2] || (n[2] = (g) => a(
224
236
  "update:model-value",
225
237
  unref(RuleBuilder).setRuleToGroup(
226
238
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
227
- m,
239
+ g,
228
240
  "&&"
229
241
  )
230
242
  ))
@@ -242,15 +254,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
242
254
  }
243
255
  },
244
256
  emits: ["update:model-value"],
245
- setup(e, { emit: i }) {
246
- const n = i;
247
- return (r, o) => {
248
- var s;
257
+ setup(e, { emit: c }) {
258
+ const s = c;
259
+ return (u, a) => {
260
+ var i;
249
261
  return openBlock(), createBlock(_sfc_main$r, {
250
262
  "include-only": "bill",
251
263
  "trigger-type": "BILL_COMPLETED",
252
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
253
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
264
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.rules.g_bill) ?? unref(RuleBuilder).scaffoldGroup("g_bill"),
265
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => s(
254
266
  "update:model-value",
255
267
  unref(RuleBuilder).setRuleToGroup(
256
268
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -269,29 +281,29 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
269
281
  }
270
282
  },
271
283
  emits: ["update:model-value"],
272
- setup(e, { emit: i }) {
273
- const n = e, r = i, o = computed(() => {
274
- const { property: s, operator: l, equator: t } = RuleBuilder.simplify(
275
- n.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
284
+ setup(e, { emit: c }) {
285
+ const s = e, u = c, a = computed(() => {
286
+ const { property: i, operator: l, equator: o } = RuleBuilder.simplify(
287
+ s.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
276
288
  op: "before",
277
289
  x: 1
278
290
  })
279
291
  );
280
292
  return {
281
- property: s,
293
+ property: i,
282
294
  operator: l,
283
- equator: t
295
+ equator: o
284
296
  };
285
297
  });
286
- return (s, l) => {
287
- const t = resolveComponent("FmRadio"), a = resolveComponent("FmStepperField");
298
+ return (i, l) => {
299
+ const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
288
300
  return openBlock(), createElementBlock("div", null, [
289
- createVNode(t, {
301
+ createVNode(o, {
290
302
  label: "On birthday",
291
303
  value: "_isRange-day",
292
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
304
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
293
305
  "onUpdate:modelValue": l[0] || (l[0] = () => {
294
- r(
306
+ u(
295
307
  "update:model-value",
296
308
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
297
309
  op: "this",
@@ -301,12 +313,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
301
313
  );
302
314
  })
303
315
  }, null, 8, ["model-value"]),
304
- createVNode(t, {
316
+ createVNode(o, {
305
317
  label: "N days before birthday",
306
318
  value: "_isDay",
307
- "model-value": unref(o).operator,
319
+ "model-value": unref(a).operator,
308
320
  "onUpdate:modelValue": l[1] || (l[1] = () => {
309
- r(
321
+ u(
310
322
  "update:model-value",
311
323
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
312
324
  op: "after",
@@ -316,26 +328,26 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
316
328
  );
317
329
  })
318
330
  }, null, 8, ["model-value"]),
319
- unref(o).operator == "_isDay" ? (openBlock(), createBlock(a, {
331
+ unref(a).operator == "_isDay" ? (openBlock(), createBlock(n, {
320
332
  key: 0,
321
333
  label: "Days before birthday",
322
334
  "show-steppers": !1,
323
- "model-value": unref(o).equator.x,
324
- "onUpdate:modelValue": l[2] || (l[2] = (f) => r(
335
+ "model-value": unref(a).equator.x,
336
+ "onUpdate:modelValue": l[2] || (l[2] = (p) => u(
325
337
  "update:model-value",
326
338
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
327
339
  op: "after",
328
- x: f,
340
+ x: p,
329
341
  ignoreYear: !0
330
342
  })
331
343
  ))
332
344
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
333
- createVNode(t, {
345
+ createVNode(o, {
334
346
  label: "In birthday week",
335
347
  value: "_isRange-week",
336
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
348
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
337
349
  "onUpdate:modelValue": l[3] || (l[3] = () => {
338
- r(
350
+ u(
339
351
  "update:model-value",
340
352
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
341
353
  op: "this",
@@ -345,12 +357,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
345
357
  );
346
358
  })
347
359
  }, null, 8, ["model-value"]),
348
- createVNode(t, {
360
+ createVNode(o, {
349
361
  label: "In birthday month",
350
362
  value: "_isRange-month",
351
- "model-value": `${unref(o).operator}-${unref(o).equator.unit}`,
363
+ "model-value": `${unref(a).operator}-${unref(a).equator.unit}`,
352
364
  "onUpdate:modelValue": l[4] || (l[4] = () => {
353
- r(
365
+ u(
354
366
  "update:model-value",
355
367
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
356
368
  op: "this",
@@ -373,15 +385,15 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
373
385
  }
374
386
  },
375
387
  emits: ["update:model-value"],
376
- setup(e, { emit: i }) {
377
- const n = i;
378
- return (r, o) => {
379
- var s;
388
+ setup(e, { emit: c }) {
389
+ const s = c;
390
+ return (u, a) => {
391
+ var i;
380
392
  return openBlock(), createBlock(_sfc_main$r, {
381
393
  "include-only": "feedback",
382
394
  "trigger-type": "FEEDBACK",
383
- "model-value": ((s = e.modelValue) == null ? void 0 : s.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
384
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n(
395
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.rules.g_feedback) ?? unref(RuleBuilder).scaffoldGroup("g_feedback"),
396
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => s(
385
397
  "update:model-value",
386
398
  unref(RuleBuilder).setRuleToGroup(
387
399
  e.modelValue ?? unref(RuleBuilder).scaffoldGroup(),
@@ -460,13 +472,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
460
472
  "GAME",
461
473
  "MISSION"
462
474
  ].map((e) => {
463
- const i = CAMPAIGN_TRIGGER[e];
475
+ const c = CAMPAIGN_TRIGGER[e];
464
476
  return [
465
477
  e,
466
- (i == null ? void 0 : i.map((n) => TriggerOptions[n]).filter((n) => !n.hidden)) ?? []
478
+ (c == null ? void 0 : c.map((s) => TriggerOptions[s]).filter((s) => !s.hidden)) ?? []
467
479
  ];
468
480
  })
469
- ), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$g = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Define the conditions that must be met to activate a reward. ", -1), _hoisted_3$e = { class: "grid grid-cols-3 gap-16" }, _hoisted_4$d = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
481
+ ), _hoisted_1$i = { class: "space-y-16" }, _hoisted_2$d = { class: "grid grid-cols-3 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$8 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$j = /* @__PURE__ */ defineComponent({
470
482
  __name: "CampaignTriggerInput",
471
483
  props: {
472
484
  campaignType: {
@@ -482,31 +494,31 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
482
494
  }
483
495
  },
484
496
  emits: ["update:model-value"],
485
- setup(e, { emit: i }) {
486
- const n = e, r = i, o = computed(() => n.disabled ? TypeToTriggerOptions[n.campaignType].filter(
487
- (s) => s.value == n.modelValue
488
- ) : TypeToTriggerOptions[n.campaignType]);
489
- return (s, l) => {
490
- const t = resolveComponent("FmCard");
497
+ setup(e, { emit: c }) {
498
+ const s = e, u = c, a = computed(() => s.disabled ? TypeToTriggerOptions[s.campaignType].filter(
499
+ (i) => i.value == s.modelValue
500
+ ) : TypeToTriggerOptions[s.campaignType]);
501
+ return (i, l) => {
502
+ const o = resolveComponent("FmCard");
491
503
  return openBlock(), createElementBlock("div", _hoisted_1$i, [
492
- _hoisted_2$g,
493
- createElementVNode("div", _hoisted_3$e, [
494
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
504
+ 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)),
505
+ createElementVNode("div", _hoisted_2$d, [
506
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(o, {
495
507
  variant: "outlined",
496
- disabled: n.disabled,
508
+ disabled: s.disabled,
497
509
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
498
- "col-span-3": unref(o).length == 1,
499
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
500
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
510
+ "col-span-3": unref(a).length == 1,
511
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
512
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
501
513
  }]),
502
514
  onClick: () => {
503
- n.modelValue != a.value && !n.disabled && r("update:model-value", a.value);
515
+ s.modelValue != n.value && !s.disabled && u("update:model-value", n.value);
504
516
  },
505
- key: a.name
517
+ key: n.name
506
518
  }, {
507
519
  default: withCtx(() => [
508
- createElementVNode("div", _hoisted_4$d, toDisplayString(a.name), 1),
509
- createElementVNode("div", _hoisted_5$8, toDisplayString(a.description), 1)
520
+ createElementVNode("div", _hoisted_3$b, toDisplayString(n.name), 1),
521
+ createElementVNode("div", _hoisted_4$8, toDisplayString(n.description), 1)
510
522
  ]),
511
523
  _: 2
512
524
  }, 1032, ["disabled", "class", "onClick"]))), 128))
@@ -527,27 +539,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
527
539
  }
528
540
  },
529
541
  emits: ["update:model-value"],
530
- setup(e, { emit: i }) {
531
- const n = i;
532
- return (r, o) => {
533
- const s = resolveComponent("FmButton"), l = resolveComponent("FmField"), t = resolveComponent("FmDatePicker");
534
- return openBlock(), createBlock(t, {
542
+ setup(e, { emit: c }) {
543
+ const s = c;
544
+ return (u, a) => {
545
+ const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
546
+ return openBlock(), createBlock(o, {
535
547
  label: e.label,
536
548
  "model-value": e.modelValue || "",
537
- "onUpdate:modelValue": o[1] || (o[1] = (a) => n("update:model-value", a))
549
+ "onUpdate:modelValue": a[1] || (a[1] = (n) => s("update:model-value", n))
538
550
  }, {
539
- "trigger-button": withCtx(({ opened: a }) => [
551
+ "trigger-button": withCtx(({ opened: n }) => [
540
552
  createVNode(l, {
541
553
  class: "flex items-center",
542
554
  "prepend-icon": "calendar_month",
543
- "icon-outlined": !a
555
+ "icon-outlined": !n
544
556
  }, {
545
557
  append: withCtx(() => [
546
- e.modelValue ? (openBlock(), createBlock(s, {
558
+ e.modelValue ? (openBlock(), createBlock(i, {
547
559
  key: 0,
548
560
  variant: "tertiary",
549
561
  icon: "clear",
550
- onClick: o[0] || (o[0] = (f) => (f.stopPropagation(), n("update:model-value", null)))
562
+ onClick: a[0] || (a[0] = (p) => (p.stopPropagation(), s("update:model-value", null)))
551
563
  })) : createCommentVNode("", !0)
552
564
  ]),
553
565
  default: withCtx(() => [
@@ -562,7 +574,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
562
574
  }, 8, ["label", "model-value"]);
563
575
  };
564
576
  }
565
- }), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$f = { class: "flex-1 xs:w-full" }, _hoisted_3$d = /* @__PURE__ */ createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1), _hoisted_4$c = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
577
+ }), _hoisted_1$h = { class: "flex items-center gap-8 w-full xs:flex-col" }, _hoisted_2$c = { class: "flex-1 xs:w-full" }, _hoisted_3$a = { class: "flex-1 xs:w-full" }, _sfc_main$h = /* @__PURE__ */ defineComponent({
566
578
  __name: "DateRangeInput",
567
579
  props: {
568
580
  modelValue: {
@@ -571,34 +583,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
571
583
  }
572
584
  },
573
585
  emits: ["update:model-value"],
574
- setup(e, { emit: i }) {
575
- const n = i;
576
- return (r, o) => {
577
- var s, l;
586
+ setup(e, { emit: c }) {
587
+ const s = c;
588
+ return (u, a) => {
589
+ var i, l;
578
590
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
579
- createElementVNode("div", _hoisted_2$f, [
591
+ createElementVNode("div", _hoisted_2$c, [
580
592
  createVNode(_sfc_main$i, {
581
- "model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
593
+ "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
582
594
  label: "Start date",
583
- "onUpdate:modelValue": o[0] || (o[0] = (t) => {
584
- var a;
585
- return n("update:model-value", {
586
- startDate: t,
587
- endDate: ((a = e.modelValue) == null ? void 0 : a.endDate) ?? null
595
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => {
596
+ var n;
597
+ return s("update:model-value", {
598
+ startDate: o,
599
+ endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
588
600
  });
589
601
  })
590
602
  }, null, 8, ["model-value"])
591
603
  ]),
592
- _hoisted_3$d,
593
- createElementVNode("div", _hoisted_4$c, [
604
+ a[2] || (a[2] = createElementVNode("div", { class: "mt-5 xs:hidden" }, "to", -1)),
605
+ createElementVNode("div", _hoisted_3$a, [
594
606
  createVNode(_sfc_main$i, {
595
607
  "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
596
608
  label: "End date",
597
- "onUpdate:modelValue": o[1] || (o[1] = (t) => {
598
- var a;
599
- return n("update:model-value", {
600
- startDate: ((a = e.modelValue) == null ? void 0 : a.startDate) ?? null,
601
- endDate: t
609
+ "onUpdate:modelValue": a[1] || (a[1] = (o) => {
610
+ var n;
611
+ return s("update:model-value", {
612
+ startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
613
+ endDate: o
602
614
  });
603
615
  })
604
616
  }, null, 8, ["model-value"])
@@ -606,10 +618,10 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
606
618
  ]);
607
619
  };
608
620
  }
609
- }), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$e = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$c = {
621
+ }), _hoisted_1$g = { class: "space-y-8" }, _hoisted_2$b = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$9 = {
610
622
  key: 0,
611
623
  class: "space-y-4"
612
- }, _hoisted_4$b = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$7 = /* @__PURE__ */ createElementVNode("div", null, "Notify date", -1), _hoisted_6$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
624
+ }, _hoisted_4$7 = { class: "fm-typo-en-body-lg-400 class flex items-center justify-between" }, _hoisted_5$4 = { class: "text-ellipsis line-clamp-1" }, _sfc_main$g = /* @__PURE__ */ defineComponent({
613
625
  __name: "ScheduleRuleInput",
614
626
  props: {
615
627
  modelValue: {
@@ -624,34 +636,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
624
636
  }
625
637
  },
626
638
  emits: ["update:model-value"],
627
- setup(e, { emit: i }) {
628
- const n = e, r = i;
629
- function o() {
630
- const m = RuleBuilder.getRules(n.modelValue);
631
- return m.length == 0 ? "fixed" : m.some(
639
+ setup(e, { emit: c }) {
640
+ const s = e, u = c;
641
+ function a() {
642
+ const y = RuleBuilder.getRules(s.modelValue);
643
+ return y.length == 0 ? "fixed" : y.some(
632
644
  (g) => isRuleEntry(g) && RuleBuilder.simplify(g).operator == "_rrule"
633
645
  ) ? "repeating" : "fixed";
634
646
  }
635
- const s = ref(o()), l = ref(!1), t = computed(() => {
636
- const m = RuleBuilder.getRules(n.modelValue), g = m.find(
647
+ const i = ref(a()), l = ref(!1), o = computed(() => {
648
+ const y = RuleBuilder.getRules(s.modelValue), g = y.find(
637
649
  (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.date"
638
- ), c = m.find(
650
+ ), V = y.find(
639
651
  (d) => isRuleEntry(d) && RuleBuilder.simplify(d).property == "trigger.time"
640
652
  );
641
653
  return {
642
654
  date: g ? RuleBuilder.simplify(g).equator : null,
643
- time: c ? RuleBuilder.simplify(c).equator : null
655
+ time: V ? RuleBuilder.simplify(V).equator : null
644
656
  };
645
- }), a = computed(
657
+ }), n = computed(
646
658
  () => calculateNextScheduleAt(
647
- n.modelValue,
659
+ s.modelValue,
648
660
  /* @__PURE__ */ new Date(),
649
- n.startDate ? new Date(n.startDate) : void 0,
650
- n.endDate ? new Date(n.endDate) : void 0
661
+ s.startDate ? new Date(s.startDate) : void 0,
662
+ s.endDate ? new Date(s.endDate) : void 0
651
663
  )
652
664
  );
653
- function f(m) {
654
- const g = m.label.toLowerCase(), c = g == "fixed" ? [
665
+ function p(y) {
666
+ const g = y.label.toLowerCase(), V = g == "fixed" ? [
655
667
  RuleBuilder.constructEntry(
656
668
  "trigger.date",
657
669
  "_isOnDate",
@@ -666,73 +678,73 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
666
678
  ),
667
679
  RuleBuilder.constructEntry("trigger.time", "_isOnTime", "00:00")
668
680
  ];
669
- r(
681
+ u(
670
682
  "update:model-value",
671
683
  RuleBuilder.setRuleToGroup(
672
684
  RuleBuilder.scaffoldGroup("g_schedule"),
673
- c
685
+ V
674
686
  )
675
- ), s.value = g;
687
+ ), i.value = g;
676
688
  }
677
- function v(m) {
678
- s.value == "fixed" ? r(
689
+ function h(y) {
690
+ i.value == "fixed" ? u(
679
691
  "update:model-value",
680
692
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
681
693
  RuleBuilder.constructEntry(
682
694
  "trigger.date",
683
695
  "_isOnDate",
684
- m.date
696
+ y.date
685
697
  ),
686
698
  RuleBuilder.constructEntry(
687
699
  "trigger.time",
688
700
  "_isOnTime",
689
- m.time
701
+ y.time
690
702
  )
691
703
  ])
692
- ) : r(
704
+ ) : u(
693
705
  "update:model-value",
694
706
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
695
707
  RuleBuilder.constructEntry(
696
708
  "trigger.date",
697
709
  "_rrule",
698
- m.date
710
+ y.date
699
711
  ),
700
712
  RuleBuilder.constructEntry(
701
713
  "trigger.time",
702
714
  "_isOnTime",
703
- m.time
715
+ y.time
704
716
  )
705
717
  ])
706
718
  );
707
719
  }
708
- return (m, g) => {
709
- const c = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), u = resolveComponent("FmIcon"), p = resolveComponent("FmTooltip"), y = resolveComponent("FmField"), k = resolveComponent("FmCard"), C = resolveComponent("FmPopover"), b = resolveComponent("FmDatePicker"), x = resolveComponent("FmHelperText");
720
+ return (y, g) => {
721
+ const V = resolveComponent("FmButtonGroup"), d = resolveComponent("FmTimePicker"), m = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), v = resolveComponent("FmField"), E = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), C = resolveComponent("FmDatePicker"), R = resolveComponent("FmHelperText");
710
722
  return openBlock(), createElementBlock(Fragment, null, [
711
- createVNode(c, {
723
+ createVNode(V, {
712
724
  items: [{ label: "Fixed" }, { label: "Repeating" }],
713
- "model-value": { label: unref(cases).title(unref(s)) },
714
- "onUpdate:modelValue": f,
725
+ "model-value": { label: unref(cases).title(unref(i)) },
726
+ "onUpdate:modelValue": p,
715
727
  class: "mb-8"
716
728
  }, null, 8, ["model-value"]),
717
729
  createElementVNode("div", _hoisted_1$g, [
718
- createElementVNode("div", _hoisted_2$e, [
730
+ createElementVNode("div", _hoisted_2$b, [
719
731
  createVNode(d, {
720
732
  label: "Notify time",
721
- "model-value": unref(t).time,
722
- "onUpdate:modelValue": g[0] || (g[0] = (E) => v({ date: unref(t).date, time: E })),
723
- "helper-text": unref(t).time ? void 0 : "Time is required",
724
- "helper-state": unref(t).time ? void 0 : "error"
733
+ "model-value": unref(o).time,
734
+ "onUpdate:modelValue": g[0] || (g[0] = (B) => h({ date: unref(o).date, time: B })),
735
+ "helper-text": unref(o).time ? void 0 : "Time is required",
736
+ "helper-state": unref(o).time ? void 0 : "error"
725
737
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
726
- unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$c, [
727
- createElementVNode("div", _hoisted_4$b, [
728
- _hoisted_5$7,
729
- unref(t).date ? (openBlock(), createBlock(p, {
738
+ unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$9, [
739
+ createElementVNode("div", _hoisted_4$7, [
740
+ g[5] || (g[5] = createElementVNode("div", null, "Notify date", -1)),
741
+ unref(o).date ? (openBlock(), createBlock(f, {
730
742
  key: 0,
731
743
  "z-index": 9999,
732
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options)
744
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options)
733
745
  }, {
734
746
  default: withCtx(() => [
735
- createVNode(u, {
747
+ createVNode(m, {
736
748
  name: "info",
737
749
  size: "sm",
738
750
  outline: !0
@@ -741,30 +753,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
741
753
  _: 1
742
754
  }, 8, ["content"])) : createCommentVNode("", !0)
743
755
  ]),
744
- createVNode(C, {
756
+ createVNode(x, {
745
757
  "show-popover": unref(l),
746
- onPopoverChanged: g[3] || (g[3] = (E) => l.value = E)
758
+ onPopoverChanged: g[3] || (g[3] = (B) => l.value = B)
747
759
  }, {
748
760
  "popover-button": withCtx(() => [
749
- createVNode(y, {
761
+ createVNode(v, {
750
762
  class: "cursor-pointer",
751
- "helper-text": unref(t).date ? void 0 : "Date is required",
752
- "helper-state": unref(t).date ? void 0 : "error"
763
+ "helper-text": unref(o).date ? void 0 : "Date is required",
764
+ "helper-state": unref(o).date ? void 0 : "error"
753
765
  }, {
754
766
  default: withCtx(() => [
755
- createElementVNode("div", _hoisted_6$4, toDisplayString(unref(t).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(t).date).options) : "Set a repeating date"), 1)
767
+ createElementVNode("div", _hoisted_5$4, toDisplayString(unref(o).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options) : "Set a repeating date"), 1)
756
768
  ]),
757
769
  _: 1
758
770
  }, 8, ["helper-text", "helper-state"])
759
771
  ]),
760
772
  default: withCtx(() => [
761
- createVNode(k, { class: "elevated p-8 w-[450px]" }, {
773
+ createVNode(E, { class: "elevated p-8 w-[450px]" }, {
762
774
  default: withCtx(() => [
763
775
  createVNode(_sfc_main$s, {
764
776
  "apply-button": !0,
765
- "model-value": unref(t).date || "",
766
- onCancel: g[1] || (g[1] = (E) => l.value = !1),
767
- "onUpdate:modelValue": g[2] || (g[2] = (E) => (v({ date: E, time: unref(t).time }), l.value = !1))
777
+ "model-value": unref(o).date || "",
778
+ onCancel: g[1] || (g[1] = (B) => l.value = !1),
779
+ "onUpdate:modelValue": g[2] || (g[2] = (B) => (h({ date: B, time: unref(o).time }), l.value = !1))
768
780
  }, null, 8, ["model-value"])
769
781
  ]),
770
782
  _: 1
@@ -772,19 +784,19 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
772
784
  ]),
773
785
  _: 1
774
786
  }, 8, ["show-popover"])
775
- ])) : (openBlock(), createBlock(b, {
787
+ ])) : (openBlock(), createBlock(C, {
776
788
  key: 1,
777
789
  label: "Notify date",
778
- "model-value": unref(t).date || "",
779
- "onUpdate:modelValue": g[4] || (g[4] = (E) => v({ date: E, time: unref(t).time })),
780
- "helper-text": unref(t).date ? void 0 : "Date is required",
781
- "helper-state": unref(t).date ? void 0 : "error"
790
+ "model-value": unref(o).date || "",
791
+ "onUpdate:modelValue": g[4] || (g[4] = (B) => h({ date: B, time: unref(o).time })),
792
+ "helper-text": unref(o).date ? void 0 : "Date is required",
793
+ "helper-state": unref(o).date ? void 0 : "error"
782
794
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
783
795
  ]),
784
- unref(t).date && unref(t).time && unref(a) ? (openBlock(), createBlock(x, {
796
+ unref(o).date && unref(o).time && unref(n) ? (openBlock(), createBlock(R, {
785
797
  key: 0,
786
- text: `${unref(hooks)(unref(a)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(a)).format("dddd, DD MMM YYYY")} at
787
- ${unref(hooks)(unref(a)).format("hh:mmA")} (${unref(hooks)(unref(a)).fromNow()})`
798
+ text: `${unref(hooks)(unref(n)).isAfter(unref(hooks)()) ? "The next notification will be sent on " : "Last trigger is on "} ${unref(hooks)(unref(n)).format("dddd, DD MMM YYYY")} at
799
+ ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
788
800
  }, null, 8, ["text"])) : createCommentVNode("", !0)
789
801
  ])
790
802
  ], 64);
@@ -797,18 +809,18 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
797
809
  filterItems: { type: Function }
798
810
  },
799
811
  emits: ["confirm"],
800
- setup(e, { emit: i }) {
801
- const n = ref(), r = ref(!1);
802
- function o() {
812
+ setup(e, { emit: c }) {
813
+ const s = ref(), u = ref(!1);
814
+ function a() {
803
815
  var l;
804
- (l = n.value) == null || l.onConfirm();
816
+ (l = s.value) == null || l.onConfirm();
805
817
  }
806
- const s = i;
807
- return (l, t) => {
808
- const a = resolveComponent("FmField"), f = resolveComponent("FmButton"), v = resolveComponent("FmSideSheet");
809
- return openBlock(), createBlock(v, {
810
- modelValue: r.value,
811
- "onUpdate:modelValue": t[1] || (t[1] = (m) => r.value = m),
818
+ const i = c;
819
+ return (l, o) => {
820
+ const n = resolveComponent("FmField"), p = resolveComponent("FmButton"), h = resolveComponent("FmSideSheet");
821
+ return openBlock(), createBlock(h, {
822
+ modelValue: u.value,
823
+ "onUpdate:modelValue": o[1] || (o[1] = (y) => u.value = y),
812
824
  title: "Select Items",
813
825
  "close-button": !1,
814
826
  "dismiss-away": !0,
@@ -816,7 +828,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
816
828
  }, {
817
829
  "side-sheet-button": withCtx(() => [
818
830
  renderSlot(l.$slots, "side-sheet-button", {}, () => [
819
- createVNode(a, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
831
+ createVNode(n, { class: "text-fm-color-typo-tertiary cursor-pointer" }, {
820
832
  default: withCtx(() => [
821
833
  createTextVNode(toDisplayString(l.modelValue.length) + " item(s) selected ", 1)
822
834
  ]),
@@ -826,14 +838,14 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
826
838
  ]),
827
839
  "side-sheet-footer": withCtx(() => [
828
840
  createElementVNode("div", _hoisted_1$f, [
829
- createVNode(f, {
841
+ createVNode(p, {
830
842
  variant: "tertiary",
831
- onClick: t[0] || (t[0] = (m) => r.value = !1),
843
+ onClick: o[0] || (o[0] = (y) => u.value = !1),
832
844
  label: "Cancel"
833
845
  }),
834
- createVNode(f, {
846
+ createVNode(p, {
835
847
  variant: "primary",
836
- onClick: o,
848
+ onClick: a,
837
849
  label: "Confirm"
838
850
  })
839
851
  ])
@@ -843,11 +855,11 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
843
855
  class: "h-full",
844
856
  "max-height": 0,
845
857
  ref_key: "selectItemRef",
846
- ref: n,
858
+ ref: s,
847
859
  "initial-value": l.modelValue,
848
860
  "filter-items": l.filterItems,
849
- "on-complete": (m) => {
850
- s("confirm", m), r.value = !1;
861
+ "on-complete": (y) => {
862
+ i("confirm", y), u.value = !1;
851
863
  }
852
864
  }, null, 8, ["initial-value", "filter-items", "on-complete"])
853
865
  ]),
@@ -855,13 +867,13 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
855
867
  }, 8, ["modelValue"]);
856
868
  };
857
869
  }
858
- }), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$d = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$b = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$a = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$6 = { class: "space-y-16" }, _hoisted_6$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1), _hoisted_7$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1), _hoisted_8$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_9$3 = {
870
+ }), _hoisted_1$e = { class: "space-y-24" }, _hoisted_2$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_3$8 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$6 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_5$3 = { class: "space-y-16" }, _hoisted_6$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_7$2 = {
859
871
  key: 0,
860
872
  class: "xs:!block flex gap-16 items-center pt-8"
861
- }, _hoisted_10$3 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _hoisted_11$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_12$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_13 = {
873
+ }, _hoisted_8$1 = { class: "fm-typo-en-body-lg-400" }, _hoisted_9$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_10$1 = {
862
874
  key: 0,
863
875
  class: "pt-8 space-y-8"
864
- }, _hoisted_14 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_15 = { class: "xs:!block flex gap-16 items-center" }, _hoisted_16 = /* @__PURE__ */ createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1), _sfc_main$e = /* @__PURE__ */ defineComponent({
876
+ }, _hoisted_11$1 = { class: "flex items-center gap-16 xs:block xs:space-y-8 w-fit" }, _hoisted_12 = { class: "xs:!block flex gap-16 items-center" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
865
877
  __name: "EarningOptionInput",
866
878
  props: {
867
879
  modelValue: {
@@ -878,9 +890,9 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
878
890
  }
879
891
  },
880
892
  emits: ["update:model-value"],
881
- setup(e, { emit: i }) {
882
- var v, m, g;
883
- const n = useBusinessStore(), r = e, o = i, s = [
893
+ setup(e, { emit: c }) {
894
+ var h, y, g;
895
+ const s = useBusinessStore(), u = e, a = c, i = [
884
896
  {
885
897
  label: "Based on spending",
886
898
  sublabel: "Customers earn rewards based on how much they spend.",
@@ -891,22 +903,22 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
891
903
  sublabel: "Customers earn a set amount of rewards for specific actions.",
892
904
  value: "FIXED"
893
905
  }
894
- ].filter((c) => {
895
- var d, u;
896
- return r.fixedType || ((u = (d = r.extras) == null ? void 0 : d.campaign) == null ? void 0 : u.event.type) != "BILL_COMPLETED" ? c.value == "FIXED" : !0;
906
+ ].filter((V) => {
907
+ var d, m;
908
+ return u.fixedType || ((m = (d = u.extras) == null ? void 0 : d.campaign) == null ? void 0 : m.event.type) != "BILL_COMPLETED" ? V.value == "FIXED" : !0;
897
909
  }), l = computed(() => {
898
- var d, u;
899
- const c = r.extras && "configs" in r.extras ? r.extras.configs.type : (d = r.extras) == null ? void 0 : d.campaign.type;
900
- return (((u = CollectibleOptions[c]) == null ? void 0 : u.name) || "reward").toLowerCase();
901
- }), t = computed(() => {
902
- const c = FdoEarningOption.safeParse(r.modelValue);
903
- return c.success ? [] : c.error.errors;
910
+ var d, m;
911
+ const V = u.extras && "configs" in u.extras ? u.extras.configs.type : (d = u.extras) == null ? void 0 : d.campaign.type;
912
+ return (((m = CollectibleOptions[V]) == null ? void 0 : m.name) || "reward").toLowerCase();
913
+ }), o = computed(() => {
914
+ const V = FdoEarningOption.safeParse(u.modelValue);
915
+ return V.success ? [] : V.error.errors;
904
916
  });
905
- function a(c) {
917
+ function n(V) {
906
918
  var d;
907
- c != ((d = r.modelValue) == null ? void 0 : d.type) && o(
919
+ V != ((d = u.modelValue) == null ? void 0 : d.type) && a(
908
920
  "update:model-value",
909
- c === "FIXED" ? {
921
+ V === "FIXED" ? {
910
922
  type: "FIXED",
911
923
  amount: 1
912
924
  } : {
@@ -916,95 +928,95 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
916
928
  }
917
929
  );
918
930
  }
919
- const f = ref(
920
- ((v = r.modelValue) == null ? void 0 : v.type) === "PROPORTIONAL" && !!((g = (m = r.modelValue) == null ? void 0 : m.property) != null && g.length) || !1
931
+ const p = ref(
932
+ ((h = u.modelValue) == null ? void 0 : h.type) === "PROPORTIONAL" && !!((g = (y = u.modelValue) == null ? void 0 : y.property) != null && g.length) || !1
921
933
  );
922
- return (c, d) => {
923
- var E, V, N;
924
- const u = resolveComponent("FmCard"), p = resolveComponent("FmStepperField"), y = resolveComponent("FmRadio"), k = resolveComponent("FmPill"), C = resolveComponent("FmButton"), b = resolveComponent("FmRadioGroup"), x = resolveComponent("FmHelperText");
934
+ return (V, d) => {
935
+ var B, k, w;
936
+ const m = resolveComponent("FmCard"), f = resolveComponent("FmStepperField"), v = resolveComponent("FmRadio"), E = resolveComponent("FmPill"), x = resolveComponent("FmButton"), C = resolveComponent("FmRadioGroup"), R = resolveComponent("FmHelperText");
925
937
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
926
- createElementVNode("div", _hoisted_2$d, [
927
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(s), (h) => {
928
- var R, B;
929
- return openBlock(), createBlock(u, {
938
+ createElementVNode("div", _hoisted_2$a, [
939
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(i), (b) => {
940
+ var S, N;
941
+ return openBlock(), createBlock(m, {
930
942
  variant: "outlined",
931
943
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-2", {
932
- "col-span-2": unref(s).length == 1,
933
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((R = e.modelValue) == null ? void 0 : R.type) === h.value,
934
- "hover:bg-fm-color-opacity-sm": ((B = e.modelValue) == null ? void 0 : B.type) != h.value
944
+ "col-span-2": unref(i).length == 1,
945
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((S = e.modelValue) == null ? void 0 : S.type) === b.value,
946
+ "hover:bg-fm-color-opacity-sm": ((N = e.modelValue) == null ? void 0 : N.type) != b.value
935
947
  }]),
936
- onClick: ($) => a(h.value),
937
- key: h.value
948
+ onClick: (F) => n(b.value),
949
+ key: b.value
938
950
  }, {
939
951
  default: withCtx(() => [
940
- createElementVNode("div", _hoisted_3$b, toDisplayString(h.label), 1),
941
- createElementVNode("div", _hoisted_4$a, toDisplayString(h.sublabel), 1)
952
+ createElementVNode("div", _hoisted_3$8, toDisplayString(b.label), 1),
953
+ createElementVNode("div", _hoisted_4$6, toDisplayString(b.sublabel), 1)
942
954
  ]),
943
955
  _: 2
944
956
  }, 1032, ["class", "onClick"]);
945
957
  }), 128))
946
958
  ]),
947
- createElementVNode("div", _hoisted_5$6, [
948
- ((E = e.modelValue) == null ? void 0 : E.type) === "FIXED" ? (openBlock(), createBlock(p, {
959
+ createElementVNode("div", _hoisted_5$3, [
960
+ ((B = e.modelValue) == null ? void 0 : B.type) === "FIXED" ? (openBlock(), createBlock(f, {
949
961
  key: 0,
950
962
  label: `Receive ${unref(l)}(s)`,
951
963
  class: "flex-1",
952
- "model-value": ((V = e.modelValue) == null ? void 0 : V.amount) ?? null,
953
- "onUpdate:modelValue": d[0] || (d[0] = (h) => o("update:model-value", {
964
+ "model-value": ((k = e.modelValue) == null ? void 0 : k.amount) ?? null,
965
+ "onUpdate:modelValue": d[0] || (d[0] = (b) => a("update:model-value", {
954
966
  ...e.modelValue ?? { type: "FIXED" },
955
- amount: h
967
+ amount: b
956
968
  }))
957
- }, null, 8, ["label", "model-value"])) : ((N = e.modelValue) == null ? void 0 : N.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
958
- _hoisted_6$3,
959
- createVNode(b, {
960
- "model-value": unref(f),
961
- "onUpdate:modelValue": d[6] || (d[6] = (h) => {
962
- unref(f) != h && (o("update:model-value", {
969
+ }, null, 8, ["label", "model-value"])) : ((w = e.modelValue) == null ? void 0 : w.type) === "PROPORTIONAL" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
970
+ d[11] || (d[11] = createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Spending type", -1)),
971
+ createVNode(C, {
972
+ "model-value": unref(p),
973
+ "onUpdate:modelValue": d[6] || (d[6] = (b) => {
974
+ unref(p) != b && (a("update:model-value", {
963
975
  ...e.modelValue ?? {
964
976
  type: "PROPORTIONAL",
965
977
  amount: 1,
966
978
  every: 1
967
979
  },
968
- property: h ? [] : void 0,
980
+ property: b ? [] : void 0,
969
981
  every: 1
970
- }), f.value = h);
982
+ }), p.value = b);
971
983
  })
972
984
  }, {
973
985
  default: withCtx(() => [
974
- createVNode(y, {
986
+ createVNode(v, {
975
987
  label: "Amount spent",
976
988
  sublabel: `Receive ${unref(l)} by amount spent`,
977
989
  value: !1
978
990
  }, {
979
991
  label: withCtx(() => {
980
- var h, R;
992
+ var b, S;
981
993
  return [
982
- _hoisted_7$3,
983
- createElementVNode("div", _hoisted_8$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
984
- unref(f) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_9$3, [
985
- createVNode(p, {
994
+ d[8] || (d[8] = createElementVNode("div", { class: "fm-typo-en-body-lg-400" }, "Amount spent", -1)),
995
+ createElementVNode("div", _hoisted_6$3, " Receive " + toDisplayString(unref(l)) + " by amount spent ", 1),
996
+ unref(p) ? createCommentVNode("", !0) : (openBlock(), createElementBlock("div", _hoisted_7$2, [
997
+ createVNode(f, {
986
998
  label: `Receive ${unref(l)}(s)`,
987
999
  inputmode: "decimal",
988
1000
  class: "flex-1",
989
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
990
- "onUpdate:modelValue": d[1] || (d[1] = (B) => o("update:model-value", {
1001
+ "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
1002
+ "onUpdate:modelValue": d[1] || (d[1] = (N) => a("update:model-value", {
991
1003
  ...e.modelValue ?? { type: "FIXED" },
992
- amount: B
1004
+ amount: N
993
1005
  }))
994
1006
  }, null, 8, ["label", "model-value"]),
995
- _hoisted_10$3,
996
- createVNode(p, {
997
- label: `Amount spend (${unref(core.Config).getCountry().currency.symbol})`,
1007
+ d[7] || (d[7] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
1008
+ createVNode(f, {
1009
+ label: `Amount spend (${unref(r).getCountry().currency.symbol})`,
998
1010
  class: "flex-1",
999
1011
  inputmode: "decimal",
1000
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1001
- "onUpdate:modelValue": d[2] || (d[2] = (B) => o("update:model-value", {
1012
+ "model-value": ((S = e.modelValue) == null ? void 0 : S.every) ?? null,
1013
+ "onUpdate:modelValue": d[2] || (d[2] = (N) => a("update:model-value", {
1002
1014
  ...e.modelValue,
1003
- every: B
1015
+ every: N
1004
1016
  }))
1005
1017
  }, {
1006
1018
  prepend: withCtx(() => [
1007
- createTextVNode(toDisplayString(unref(core.Config).getCountry().currency.symbol), 1)
1019
+ createTextVNode(toDisplayString(unref(r).getCountry().currency.symbol), 1)
1008
1020
  ]),
1009
1021
  _: 1
1010
1022
  }, 8, ["label", "model-value"])
@@ -1013,34 +1025,34 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1013
1025
  }),
1014
1026
  _: 1
1015
1027
  }, 8, ["sublabel"]),
1016
- createVNode(y, {
1028
+ createVNode(v, {
1017
1029
  label: "Product bought",
1018
1030
  sublabel: `Receive ${unref(l)} by product bought`,
1019
1031
  value: !0,
1020
- disabled: !unref(n).isPremium
1032
+ disabled: !unref(s).isPremium
1021
1033
  }, {
1022
1034
  label: withCtx(() => {
1023
- var h, R;
1035
+ var b, S;
1024
1036
  return [
1025
- createElementVNode("div", _hoisted_11$1, [
1026
- createTextVNode(" Product bought "),
1027
- createVNode(k, { variant: "premium" })
1037
+ createElementVNode("div", _hoisted_8$1, [
1038
+ d[9] || (d[9] = createTextVNode(" Product bought ")),
1039
+ createVNode(E, { variant: "premium" })
1028
1040
  ]),
1029
- createElementVNode("div", _hoisted_12$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
1030
- unref(f) ? (openBlock(), createElementBlock("div", _hoisted_13, [
1031
- createElementVNode("div", _hoisted_14, [
1041
+ createElementVNode("div", _hoisted_9$1, " Receive " + toDisplayString(unref(l)) + " by product bought ", 1),
1042
+ unref(p) ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
1043
+ createElementVNode("div", _hoisted_11$1, [
1032
1044
  createVNode(_sfc_main$f, {
1033
- "model-value": r.modelValue.property || [],
1034
- onConfirm: d[3] || (d[3] = (B) => o("update:model-value", {
1045
+ "model-value": u.modelValue.property || [],
1046
+ onConfirm: d[3] || (d[3] = (N) => a("update:model-value", {
1035
1047
  ...e.modelValue,
1036
- property: B
1048
+ property: N
1037
1049
  }))
1038
1050
  }, {
1039
1051
  "side-sheet-button": withCtx(() => {
1040
- var B, $;
1052
+ var N, F;
1041
1053
  return [
1042
- createVNode(C, {
1043
- label: (B = r.modelValue.property) != null && B.length ? `${($ = r.modelValue.property) == null ? void 0 : $.length} product(s) selected` : "Select product",
1054
+ createVNode(x, {
1055
+ label: (N = u.modelValue.property) != null && N.length ? `${(F = u.modelValue.property) == null ? void 0 : F.length} product(s) selected` : "Select product",
1044
1056
  icon: "link",
1045
1057
  variant: "secondary"
1046
1058
  }, null, 8, ["label"])
@@ -1049,27 +1061,27 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1049
1061
  _: 1
1050
1062
  }, 8, ["model-value"])
1051
1063
  ]),
1052
- createElementVNode("div", _hoisted_15, [
1053
- createVNode(p, {
1064
+ createElementVNode("div", _hoisted_12, [
1065
+ createVNode(f, {
1054
1066
  inputmode: "decimal",
1055
1067
  label: `Receive ${unref(l)}(s)`,
1056
1068
  class: "flex-1",
1057
- "model-value": ((h = e.modelValue) == null ? void 0 : h.amount) ?? null,
1058
- "onUpdate:modelValue": d[4] || (d[4] = (B) => o("update:model-value", {
1069
+ "model-value": ((b = e.modelValue) == null ? void 0 : b.amount) ?? null,
1070
+ "onUpdate:modelValue": d[4] || (d[4] = (N) => a("update:model-value", {
1059
1071
  ...e.modelValue ?? { type: "FIXED" },
1060
- amount: B
1072
+ amount: N
1061
1073
  }))
1062
1074
  }, null, 8, ["label", "model-value"]),
1063
- _hoisted_16,
1064
- createVNode(p, {
1075
+ d[10] || (d[10] = createElementVNode("div", { class: "xs:py-4 text-center" }, "for every", -1)),
1076
+ createVNode(f, {
1065
1077
  label: "Item purchased",
1066
1078
  class: "flex-1",
1067
- "model-value": ((R = e.modelValue) == null ? void 0 : R.every) ?? null,
1079
+ "model-value": ((S = e.modelValue) == null ? void 0 : S.every) ?? null,
1068
1080
  inputmode: "numeric",
1069
1081
  "max-fraction-digits": 0,
1070
- "onUpdate:modelValue": d[5] || (d[5] = (B) => o("update:model-value", {
1082
+ "onUpdate:modelValue": d[5] || (d[5] = (N) => a("update:model-value", {
1071
1083
  ...e.modelValue,
1072
- every: B
1084
+ every: N
1073
1085
  }))
1074
1086
  }, null, 8, ["model-value"])
1075
1087
  ])
@@ -1083,16 +1095,16 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1083
1095
  }, 8, ["model-value"])
1084
1096
  ], 64)) : createCommentVNode("", !0)
1085
1097
  ]),
1086
- e.errorText || unref(t).length > 0 ? (openBlock(), createBlock(x, {
1098
+ e.errorText || unref(o).length > 0 ? (openBlock(), createBlock(R, {
1087
1099
  key: 0,
1088
1100
  class: "!mt-4",
1089
- text: e.errorText || unref(ZodHelper).helperText(unref(t), ""),
1101
+ text: e.errorText || unref(ZodHelper).helperText(unref(o), ""),
1090
1102
  state: "error"
1091
1103
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1092
1104
  ]);
1093
1105
  };
1094
1106
  }
1095
- }), _hoisted_1$d = { class: "space-y-16" }, _hoisted_2$c = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$a = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$9 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$d = /* @__PURE__ */ defineComponent({
1107
+ }), _hoisted_1$d = { 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$d = /* @__PURE__ */ defineComponent({
1096
1108
  __name: "GameTypeInput",
1097
1109
  props: {
1098
1110
  modelValue: {
@@ -1100,8 +1112,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1100
1112
  }
1101
1113
  },
1102
1114
  emits: ["update:model-value"],
1103
- setup(e, { emit: i }) {
1104
- const n = e, r = i, o = computed(
1115
+ setup(e, { emit: c }) {
1116
+ const s = e, u = c, a = computed(
1105
1117
  () => [
1106
1118
  {
1107
1119
  label: "Fortune Wheel",
@@ -1115,28 +1127,28 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1115
1127
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
1116
1128
  hidden: !0
1117
1129
  }
1118
- ].filter((s) => !s.hidden)
1130
+ ].filter((i) => !i.hidden)
1119
1131
  );
1120
- return (s, l) => {
1121
- const t = resolveComponent("FmCard");
1132
+ return (i, l) => {
1133
+ const o = resolveComponent("FmCard");
1122
1134
  return openBlock(), createElementBlock("div", _hoisted_1$d, [
1123
- _hoisted_2$c,
1124
- createElementVNode("div", _hoisted_3$a, [
1125
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1135
+ 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)),
1136
+ createElementVNode("div", _hoisted_2$9, [
1137
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(o, {
1126
1138
  variant: "outlined",
1127
1139
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1128
- "col-span-2": unref(o).length == 1,
1129
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1130
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1140
+ "col-span-2": unref(a).length == 1,
1141
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1142
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1131
1143
  }]),
1132
1144
  onClick: () => {
1133
- n.modelValue != a.value && r("update:model-value", a.value);
1145
+ s.modelValue != n.value && u("update:model-value", n.value);
1134
1146
  },
1135
- key: a.value
1147
+ key: n.value
1136
1148
  }, {
1137
1149
  default: withCtx(() => [
1138
- createElementVNode("div", _hoisted_4$9, toDisplayString(a.label), 1),
1139
- createElementVNode("div", _hoisted_5$5, toDisplayString(a.description), 1)
1150
+ createElementVNode("div", _hoisted_3$7, toDisplayString(n.label), 1),
1151
+ createElementVNode("div", _hoisted_4$5, toDisplayString(n.description), 1)
1140
1152
  ]),
1141
1153
  _: 2
1142
1154
  }, 1032, ["class", "onClick"]))), 128))
@@ -1144,7 +1156,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1144
1156
  ]);
1145
1157
  };
1146
1158
  }
1147
- }), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _hoisted_2$b = /* @__PURE__ */ createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1), _hoisted_3$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1), _hoisted_4$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1), _hoisted_5$4 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1), _sfc_main$c = /* @__PURE__ */ defineComponent({
1159
+ }), _hoisted_1$c = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center justify-between" }, _sfc_main$c = /* @__PURE__ */ defineComponent({
1148
1160
  __name: "VoucherEditor",
1149
1161
  props: {
1150
1162
  modelValue: {
@@ -1155,33 +1167,33 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1155
1167
  }
1156
1168
  },
1157
1169
  emits: ["update:model-value", "update:reward-image"],
1158
- setup(e, { emit: i }) {
1159
- const r = ref(
1170
+ setup(e, { emit: c }) {
1171
+ const { t: s } = useI18n(), a = ref(
1160
1172
  e.modelValue ?? initCollectibleConfig("VOUCHER", {
1161
1173
  business: useCoreStore().currentBusiness.value._id,
1162
1174
  name: ""
1163
1175
  })
1164
- ), o = FdtoCollectibleConfig, s = i;
1165
- return (l, t) => {
1166
- var v, m, g;
1167
- const a = resolveComponent("FmTextarea"), f = resolveComponent("FmHelperText");
1176
+ ), i = FdtoCollectibleConfig, l = c;
1177
+ return (o, n) => {
1178
+ var y, g, V;
1179
+ const p = resolveComponent("FmTextarea"), h = resolveComponent("FmHelperText");
1168
1180
  return openBlock(), createElementBlock(Fragment, null, [
1169
1181
  createVNode(_sfc_main$u, {
1170
- modelValue: unref(r).name,
1171
- "onUpdate:modelValue": t[0] || (t[0] = (c) => unref(r).name = c),
1182
+ modelValue: unref(a).name,
1183
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => unref(a).name = d),
1172
1184
  label: "Voucher name",
1173
- schema: unref(ZodHelper).typeAtPath(unref(o), "name", [unref(r).type])
1185
+ schema: unref(ZodHelper).typeAtPath(unref(i), "name", [unref(a).type])
1174
1186
  }, null, 8, ["modelValue", "schema"]),
1175
- createVNode(a, {
1187
+ createVNode(p, {
1176
1188
  class: "!mb-[-16px]",
1177
- modelValue: unref(r).description,
1178
- "onUpdate:modelValue": t[1] || (t[1] = (c) => unref(r).description = c),
1179
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "description", [unref(r).type])]
1189
+ modelValue: unref(a).description,
1190
+ "onUpdate:modelValue": n[1] || (n[1] = (d) => unref(a).description = d),
1191
+ rules: [unref(ZodHelper).ruleAtPath(unref(i), "description", [unref(a).type])]
1180
1192
  }, {
1181
1193
  label: withCtx(() => [
1182
1194
  (openBlock(), createBlock(resolveDynamicComponent(
1183
1195
  unref(ZodHelper).toInputLabel(
1184
- unref(ZodHelper).typeAtPath(unref(o), "description", [unref(r).type]),
1196
+ unref(ZodHelper).typeAtPath(unref(i), "description", [unref(a).type]),
1185
1197
  "Voucher description"
1186
1198
  )
1187
1199
  )))
@@ -1189,55 +1201,55 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1189
1201
  _: 1
1190
1202
  }, 8, ["modelValue", "rules"]),
1191
1203
  createElementVNode("div", _hoisted_1$c, [
1192
- _hoisted_2$b,
1193
- createElementVNode("div", null, toDisplayString(((v = unref(r).description) == null ? void 0 : v.length) ?? 0) + "/200", 1)
1204
+ n[6] || (n[6] = createElementVNode("div", null, "Voucher description should not exceed 200 characters.", -1)),
1205
+ createElementVNode("div", null, toDisplayString(((y = unref(a).description) == null ? void 0 : y.length) ?? 0) + "/200", 1)
1194
1206
  ]),
1195
1207
  createVNode(_sfc_main$v, {
1196
1208
  class: "w-1/2 xs:w-2/3",
1197
1209
  "aspect-ratio": "16/9",
1198
1210
  file: e.rewardImage ?? void 0,
1199
- thumbnail: unref(r).image ?? void 0,
1200
- "onUpdate:file": t[2] || (t[2] = async (c) => {
1201
- s("update:reward-image", c), c || (unref(r).image = null);
1211
+ thumbnail: unref(a).image ?? void 0,
1212
+ "onUpdate:file": n[2] || (n[2] = async (d) => {
1213
+ l("update:reward-image", d), d || (unref(a).image = null);
1202
1214
  })
1203
1215
  }, {
1204
1216
  label: withCtx(() => [
1205
1217
  (openBlock(), createBlock(resolveDynamicComponent(
1206
1218
  unref(ZodHelper).toInputLabel(
1207
- unref(ZodHelper).typeAtPath(unref(o), "image", [unref(r).type]),
1219
+ unref(ZodHelper).typeAtPath(unref(i), "image", [unref(a).type]),
1208
1220
  "Voucher image"
1209
1221
  )
1210
1222
  )))
1211
1223
  ]),
1212
1224
  _: 1
1213
1225
  }, 8, ["file", "thumbnail"]),
1214
- _hoisted_3$9,
1226
+ n[7] || (n[7] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Discount", -1)),
1215
1227
  createVNode(_sfc_main$w, {
1216
- "model-value": unref(r).extras.effect,
1217
- "onUpdate:modelValue": t[3] || (t[3] = (c) => unref(r).extras.effect = c)
1228
+ "model-value": unref(a).extras.effect,
1229
+ "onUpdate:modelValue": n[3] || (n[3] = (d) => unref(a).extras.effect = d)
1218
1230
  }, null, 8, ["model-value"]),
1219
- unref(r).extras.effect == null ? (openBlock(), createBlock(f, {
1231
+ unref(a).extras.effect == null ? (openBlock(), createBlock(h, {
1220
1232
  key: 0,
1221
1233
  class: "!mt-8",
1222
- text: "Effect is required",
1234
+ text: unref(s)("connect.campaign.common.effect_required"),
1223
1235
  state: "error"
1224
- })) : createCommentVNode("", !0),
1225
- _hoisted_4$8,
1236
+ }, null, 8, ["text"])) : createCommentVNode("", !0),
1237
+ n[8] || (n[8] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Usage configuration", -1)),
1226
1238
  createVNode(_sfc_main$x, {
1227
- "model-value": unref(r).options,
1228
- "no-campaign": unref(r).noCampaign,
1229
- "onUpdate:modelValue": t[4] || (t[4] = (c) => unref(r).options = c),
1230
- schema: unref(ZodHelper).typeAtPath(unref(o), "options", ["VOUCHER"])
1239
+ "model-value": unref(a).options,
1240
+ "no-campaign": unref(a).noCampaign,
1241
+ "onUpdate:modelValue": n[4] || (n[4] = (d) => unref(a).options = d),
1242
+ schema: unref(ZodHelper).typeAtPath(unref(i), "options", ["VOUCHER"])
1231
1243
  }, null, 8, ["model-value", "no-campaign", "schema"]),
1232
- _hoisted_5$4,
1233
- unref(r).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1244
+ n[9] || (n[9] = createElementVNode("div", { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, "Availability", -1)),
1245
+ unref(a).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$y, {
1234
1246
  key: 1,
1235
- "model-value": ((g = (m = unref(r).extras) == null ? void 0 : m.targetLocation) == null ? void 0 : g.map(String)) ?? null,
1247
+ "model-value": ((V = (g = unref(a).extras) == null ? void 0 : g.targetLocation) == null ? void 0 : V.map(String)) ?? null,
1236
1248
  type: "select",
1237
- "onUpdate:modelValue": t[5] || (t[5] = (c) => {
1238
- unref(r).extras.targetLocation = c;
1249
+ "onUpdate:modelValue": n[5] || (n[5] = (d) => {
1250
+ unref(a).extras.targetLocation = d;
1239
1251
  }),
1240
- rules: [unref(ZodHelper).ruleAtPath(unref(o), "extras.targetLocation")]
1252
+ rules: [unref(ZodHelper).ruleAtPath(unref(i), "extras.targetLocation")]
1241
1253
  }, null, 8, ["model-value", "rules"])) : createCommentVNode("", !0)
1242
1254
  ], 64);
1243
1255
  };
@@ -1245,77 +1257,77 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1245
1257
  }), _hoisted_1$b = {
1246
1258
  key: 0,
1247
1259
  class: "flex flex-col gap-y-24"
1248
- }, _hoisted_2$a = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_3$8 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1), _hoisted_4$7 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
1260
+ }, _hoisted_2$8 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$b = /* @__PURE__ */ defineComponent({
1249
1261
  __name: "EditRewardPoolSheet",
1250
1262
  emits: ["update:model-value"],
1251
- setup(e, { expose: i, emit: n }) {
1252
- const r = useMembershipStore(), { minor: o } = useLoading, s = ref(!1), l = ref(), t = ref(), a = ref(0), f = computed(() => {
1253
- var u;
1254
- return ((u = r.loyaltyRewards.items.find(
1255
- (p) => {
1256
- var y;
1257
- return p.value === ((y = l.value) == null ? void 0 : y.collectible);
1263
+ setup(e, { expose: c, emit: s }) {
1264
+ const u = useMembershipStore(), { minor: a } = useLoading, i = ref(!1), l = ref(), o = ref(), n = ref(0), p = computed(() => {
1265
+ var m;
1266
+ return ((m = u.loyaltyRewards.items.find(
1267
+ (f) => {
1268
+ var v;
1269
+ return f.value === ((v = l.value) == null ? void 0 : v.collectible);
1258
1270
  }
1259
- )) == null ? void 0 : u.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1260
- }), v = computed(() => {
1261
- const d = f.value.safeParse(l.value);
1271
+ )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
1272
+ }), h = computed(() => {
1273
+ const d = p.value.safeParse(l.value);
1262
1274
  return d.success ? [] : d.error.errors;
1263
1275
  });
1264
- function m(d, u, p) {
1265
- d && (l.value = u, a.value = p), s.value = d;
1276
+ function y(d, m, f) {
1277
+ d && (l.value = m, n.value = f), i.value = d;
1266
1278
  }
1267
- const g = n;
1268
- async function c() {
1269
- const d = f.value.safeParse(l.value);
1270
- d.success && (await o(
1279
+ const g = s;
1280
+ async function V() {
1281
+ const d = p.value.safeParse(l.value);
1282
+ d.success && (await a(
1271
1283
  async () => {
1272
- d.data.type === "VOUCHER" && t.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
1273
- d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, t.value),
1274
- t.value
1284
+ d.data.type === "VOUCHER" && o.value && (d.data.collectibleConfig.image = await firebaseStorage.update(
1285
+ d.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
1286
+ o.value
1275
1287
  ));
1276
1288
  },
1277
1289
  {
1278
1290
  message: "Uploading reward image",
1279
1291
  successMessage: "Reward image updated"
1280
1292
  }
1281
- ), g("update:model-value", d.data, a.value));
1293
+ ), g("update:model-value", d.data, n.value));
1282
1294
  }
1283
- return i({
1284
- showSheet: m
1285
- }), (d, u) => {
1286
- const p = resolveComponent("FmSelect"), y = resolveComponent("FmStepperField"), k = resolveComponent("FmButton"), C = resolveComponent("FmSideSheet");
1287
- return openBlock(), createBlock(C, {
1295
+ return c({
1296
+ showSheet: y
1297
+ }), (d, m) => {
1298
+ const f = resolveComponent("FmSelect"), v = resolveComponent("FmStepperField"), E = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
1299
+ return openBlock(), createBlock(x, {
1288
1300
  "max-width": 560,
1289
- modelValue: unref(s),
1301
+ modelValue: unref(i),
1290
1302
  "onUpdate:modelValue": [
1291
- u[9] || (u[9] = (b) => isRef(s) ? s.value = b : null),
1292
- u[10] || (u[10] = (b) => s.value = b)
1303
+ m[9] || (m[9] = (C) => isRef(i) ? i.value = C : null),
1304
+ m[10] || (m[10] = (C) => i.value = C)
1293
1305
  ],
1294
1306
  header: "Edit reward",
1295
1307
  "dismiss-away": ""
1296
1308
  }, {
1297
1309
  "side-sheet-footer": withCtx(() => [
1298
- createElementVNode("div", _hoisted_4$7, [
1299
- createVNode(k, {
1310
+ createElementVNode("div", _hoisted_2$8, [
1311
+ createVNode(E, {
1300
1312
  variant: "primary",
1301
1313
  type: "button",
1302
- disabled: unref(v).length > 0,
1314
+ disabled: unref(h).length > 0,
1303
1315
  label: "Confirm",
1304
- onClick: u[7] || (u[7] = (b) => c())
1316
+ onClick: m[7] || (m[7] = (C) => V())
1305
1317
  }, null, 8, ["disabled"]),
1306
- createVNode(k, {
1318
+ createVNode(E, {
1307
1319
  variant: "secondary",
1308
1320
  type: "button",
1309
1321
  label: "Cancel",
1310
- onClick: u[8] || (u[8] = (b) => s.value = !1)
1322
+ onClick: m[8] || (m[8] = (C) => i.value = !1)
1311
1323
  })
1312
1324
  ])
1313
1325
  ]),
1314
1326
  default: withCtx(() => {
1315
- var b, x, E;
1327
+ var C, R, B;
1316
1328
  return [
1317
1329
  unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
1318
- createVNode(p, {
1330
+ createVNode(f, {
1319
1331
  label: "Reward Type",
1320
1332
  items: [
1321
1333
  { label: "No Reward", value: "NO_REWARD" },
@@ -1323,12 +1335,12 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1323
1335
  { label: "Loyalty", value: "LOYALTY" }
1324
1336
  ],
1325
1337
  "model-value": unref(l).type,
1326
- "onUpdate:modelValue": u[0] || (u[0] = (V) => {
1327
- V == "NO_REWARD" ? l.value = {
1338
+ "onUpdate:modelValue": m[0] || (m[0] = (k) => {
1339
+ k == "NO_REWARD" ? l.value = {
1328
1340
  type: "NO_REWARD",
1329
1341
  collectible: null,
1330
1342
  weight: 1
1331
- } : V === "VOUCHER" ? l.value = {
1343
+ } : k === "VOUCHER" ? l.value = {
1332
1344
  collectible: null,
1333
1345
  type: "VOUCHER",
1334
1346
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1343,7 +1355,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1343
1355
  },
1344
1356
  weight: 1
1345
1357
  } : l.value = {
1346
- collectible: unref(r).loyaltyRewards.raw[0]._id,
1358
+ collectible: unref(u).loyaltyRewards.raw[0]._id,
1347
1359
  type: "LOYALTY",
1348
1360
  earningOption: {
1349
1361
  amount: 1,
@@ -1356,74 +1368,74 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1356
1368
  };
1357
1369
  })
1358
1370
  }, null, 8, ["model-value"]),
1359
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(p, {
1371
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
1360
1372
  key: 0,
1361
1373
  label: "Loyalty type",
1362
- rules: [unref(ZodHelper).ruleAtPath(unref(f), "collectible", [unref(l).type])],
1363
- items: unref(r).loyaltyRewards.items,
1374
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "collectible", [unref(l).type])],
1375
+ items: unref(u).loyaltyRewards.items,
1364
1376
  "model-value": unref(l).collectible,
1365
- "onUpdate:modelValue": u[1] || (u[1] = (V) => unref(l).collectible = V)
1377
+ "onUpdate:modelValue": m[1] || (m[1] = (k) => unref(l).collectible = k)
1366
1378
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1367
- createVNode(y, {
1379
+ createVNode(v, {
1368
1380
  label: "Weight",
1369
- rules: [unref(ZodHelper).ruleAtPath(unref(f), "weight", [unref(l).type])],
1381
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "weight", [unref(l).type])],
1370
1382
  "model-value": unref(l).weight,
1371
- "onUpdate:modelValue": u[2] || (u[2] = (V) => l.value = {
1383
+ "onUpdate:modelValue": m[2] || (m[2] = (k) => l.value = {
1372
1384
  ...unref(l),
1373
- weight: V
1385
+ weight: k
1374
1386
  })
1375
1387
  }, null, 8, ["rules", "model-value"]),
1376
1388
  unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
1377
- ((b = unref(r).loyaltyRewards.items.find(
1378
- (V) => {
1379
- var N;
1380
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1389
+ ((C = unref(u).loyaltyRewards.items.find(
1390
+ (k) => {
1391
+ var w;
1392
+ return k.value === ((w = unref(l)) == null ? void 0 : w.collectible);
1381
1393
  }
1382
- )) == null ? void 0 : b.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1383
- _hoisted_2$a,
1394
+ )) == null ? void 0 : C.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1395
+ m[11] || (m[11] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1384
1396
  createVNode(_sfc_main$e, {
1385
1397
  class: "mt-[-8px]",
1386
1398
  rules: [
1387
- unref(ZodHelper).ruleAtPath(unref(f), "earningOption", [unref(l).type])
1399
+ unref(ZodHelper).ruleAtPath(unref(p), "earningOption", [unref(l).type])
1388
1400
  ],
1389
- "helper-state": unref(ZodHelper).helperState(unref(v), "earningOption"),
1390
- "error-text": unref(ZodHelper).helperText(unref(v), "earningOption"),
1401
+ "helper-state": unref(ZodHelper).helperState(unref(h), "earningOption"),
1402
+ "error-text": unref(ZodHelper).helperText(unref(h), "earningOption"),
1391
1403
  "fixed-type": !0,
1392
1404
  "model-value": unref(l).earningOption,
1393
- "onUpdate:modelValue": u[3] || (u[3] = (V) => l.value = {
1405
+ "onUpdate:modelValue": m[3] || (m[3] = (k) => l.value = {
1394
1406
  ...unref(l),
1395
- earningOption: V
1407
+ earningOption: k
1396
1408
  })
1397
1409
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
1398
1410
  ], 64)) : createCommentVNode("", !0),
1399
- _hoisted_3$8,
1411
+ m[12] || (m[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Validity option", -1)),
1400
1412
  createVNode(_sfc_main$z, {
1401
- "for-credit": unref(l).type === "LOYALTY" && ((x = unref(r).loyaltyRewards.items.find(
1402
- (V) => {
1403
- var N;
1404
- return V.value === ((N = unref(l)) == null ? void 0 : N.collectible);
1413
+ "for-credit": unref(l).type === "LOYALTY" && ((R = unref(u).loyaltyRewards.items.find(
1414
+ (k) => {
1415
+ var w;
1416
+ return k.value === ((w = unref(l)) == null ? void 0 : w.collectible);
1405
1417
  }
1406
- )) == null ? void 0 : x.raw.type) === "CREDIT",
1418
+ )) == null ? void 0 : R.raw.type) === "CREDIT",
1407
1419
  class: "!gap-24",
1408
- rules: [unref(ZodHelper).ruleAtPath(unref(f), "validityOption", [unref(l).type])],
1420
+ rules: [unref(ZodHelper).ruleAtPath(unref(p), "validityOption", [unref(l).type])],
1409
1421
  "model-value": unref(l).validityOption,
1410
- "onUpdate:modelValue": u[4] || (u[4] = (V) => l.value = {
1422
+ "onUpdate:modelValue": m[4] || (m[4] = (k) => l.value = {
1411
1423
  ...unref(l),
1412
- validityOption: V
1424
+ validityOption: k
1413
1425
  })
1414
1426
  }, null, 8, ["for-credit", "rules", "model-value"])
1415
1427
  ], 64)) : createCommentVNode("", !0),
1416
1428
  unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1417
1429
  key: 2,
1418
- "reward-image": unref(t),
1419
- "model-value": ((E = unref(l)) == null ? void 0 : E.collectibleConfig) ?? void 0,
1420
- "onUpdate:modelValue": u[5] || (u[5] = (V) => l.value = {
1430
+ "reward-image": unref(o),
1431
+ "model-value": ((B = unref(l)) == null ? void 0 : B.collectibleConfig) ?? void 0,
1432
+ "onUpdate:modelValue": m[5] || (m[5] = (k) => l.value = {
1421
1433
  ...unref(l),
1422
- collectibleConfig: V
1434
+ collectibleConfig: k
1423
1435
  }),
1424
- "onUpdate:rewardImage": u[6] || (u[6] = (V) => t.value = V)
1436
+ "onUpdate:rewardImage": m[6] || (m[6] = (k) => o.value = k)
1425
1437
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1426
- createVNode(JsonViewer, { json: unref(v) }, null, 8, ["json"])
1438
+ createVNode(JsonViewer, { json: unref(h) }, null, 8, ["json"])
1427
1439
  ])) : createCommentVNode("", !0)
1428
1440
  ];
1429
1441
  }),
@@ -1435,7 +1447,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
1435
1447
  function isNullOrEmpty(e) {
1436
1448
  return e == null || e === "";
1437
1449
  }
1438
- const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type and weightage given to your customer. ", -1), _hoisted_3$7 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$6 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _sfc_main$a = /* @__PURE__ */ defineComponent({
1450
+ 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({
1439
1451
  __name: "RewardPoolInput",
1440
1452
  props: {
1441
1453
  modelValue: {
@@ -1450,37 +1462,37 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1450
1462
  }
1451
1463
  },
1452
1464
  emits: ["update:model-value"],
1453
- setup(e, { emit: i }) {
1454
- const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => n.modelValue ?? []), t = computed(() => {
1455
- const d = s.safeParse(l.value);
1465
+ setup(e, { emit: c }) {
1466
+ const s = e, u = c, a = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => s.modelValue ?? []), o = computed(() => {
1467
+ const d = i.safeParse(l.value);
1456
1468
  return d.success ? [] : d.error.errors;
1457
- }), a = ref();
1458
- function f(d, u) {
1459
- var y;
1460
- const p = [...l.value];
1461
- p[u] = d, (y = a.value) == null || y.showSheet(!1), r("update:model-value", p);
1469
+ }), n = ref();
1470
+ function p(d, m) {
1471
+ var v;
1472
+ const f = [...l.value];
1473
+ f[m] = d, (v = n.value) == null || v.showSheet(!1), u("update:model-value", f);
1462
1474
  }
1463
- function v(d) {
1464
- const u = d.type == "VOUCHER" ? d.collectibleConfig : o.collectibles.find(
1465
- (k) => k._id.toString() == d.collectible
1466
- ), p = CollectionUtils.formattedType((u == null ? void 0 : u.name) || ""), y = d.weight;
1475
+ function h(d) {
1476
+ const m = d.type == "VOUCHER" ? d.collectibleConfig : a.collectibles.find(
1477
+ (E) => E._id.toString() == d.collectible
1478
+ ), f = CollectionUtils.formattedType((m == null ? void 0 : m.name) || ""), v = d.weight;
1467
1479
  return {
1468
- label: isNullOrEmpty(p) ? "NO REWARD" : p,
1469
- sublabel: `${y} (${(y / l.value.reduce((k, C) => k + C.weight, 0) * 100).toFixed(2)}%)`
1480
+ label: isNullOrEmpty(f) ? "NO REWARD" : f,
1481
+ sublabel: `${v} (${(v / l.value.reduce((E, x) => E + x.weight, 0) * 100).toFixed(2)}%)`
1470
1482
  };
1471
1483
  }
1472
- function m(d) {
1473
- var p;
1474
- const u = [...l.value];
1475
- (p = a.value) == null || p.showSheet(!0, u[d], d);
1484
+ function y(d) {
1485
+ var f;
1486
+ const m = [...l.value];
1487
+ (f = n.value) == null || f.showSheet(!0, m[d], d);
1476
1488
  }
1477
1489
  function g(d) {
1478
- const u = [...l.value];
1479
- u.splice(d, 1), r("update:model-value", u);
1490
+ const m = [...l.value];
1491
+ m.splice(d, 1), u("update:model-value", m);
1480
1492
  }
1481
- function c() {
1493
+ function V() {
1482
1494
  var d;
1483
- (d = a.value) == null || d.showSheet(
1495
+ (d = n.value) == null || d.showSheet(
1484
1496
  !0,
1485
1497
  {
1486
1498
  type: "NO_REWARD",
@@ -1490,52 +1502,52 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1490
1502
  l.value.length
1491
1503
  );
1492
1504
  }
1493
- return (d, u) => {
1494
- const p = resolveComponent("FmButton"), y = resolveComponent("FmCard"), k = resolveComponent("FmHelperText");
1505
+ return (d, m) => {
1506
+ const f = resolveComponent("FmButton"), v = resolveComponent("FmCard"), E = resolveComponent("FmHelperText");
1495
1507
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
1496
- _hoisted_2$9,
1497
- createVNode(p, {
1508
+ m[1] || (m[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)),
1509
+ createVNode(f, {
1498
1510
  label: "Add Reward",
1499
- onClick: u[0] || (u[0] = (C) => c()),
1511
+ onClick: m[0] || (m[0] = (x) => V()),
1500
1512
  variant: "plain",
1501
1513
  icon: "add"
1502
1514
  }),
1503
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, b) => (openBlock(), createBlock(y, {
1504
- key: b,
1515
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, C) => (openBlock(), createBlock(v, {
1516
+ key: C,
1505
1517
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1506
1518
  variant: "outlined",
1507
- onClick: (x) => m(b)
1519
+ onClick: (R) => y(C)
1508
1520
  }, {
1509
1521
  default: withCtx(() => [
1510
1522
  createElementVNode("div", null, [
1511
- createElementVNode("div", _hoisted_3$7, toDisplayString(v(C).label), 1),
1512
- createElementVNode("div", _hoisted_4$6, toDisplayString(v(C).sublabel), 1)
1523
+ createElementVNode("div", _hoisted_2$7, toDisplayString(h(x).label), 1),
1524
+ createElementVNode("div", _hoisted_3$6, toDisplayString(h(x).sublabel), 1)
1513
1525
  ]),
1514
- createVNode(p, {
1526
+ createVNode(f, {
1515
1527
  icon: "delete",
1516
1528
  variant: "tertiary",
1517
- onClick: (x) => (x.stopPropagation(), g(b))
1529
+ onClick: (R) => (R.stopPropagation(), g(C))
1518
1530
  }, null, 8, ["onClick"])
1519
1531
  ]),
1520
1532
  _: 2
1521
1533
  }, 1032, ["onClick"]))), 128)),
1522
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(k, {
1523
- key: C.message,
1524
- text: C.message,
1534
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(E, {
1535
+ key: x.message,
1536
+ text: x.message,
1525
1537
  state: "error"
1526
1538
  }, null, 8, ["text"]))), 128)),
1527
1539
  createVNode(_sfc_main$b, {
1528
1540
  ref_key: "sheetRef",
1529
- ref: a,
1530
- "onUpdate:modelValue": f
1541
+ ref: n,
1542
+ "onUpdate:modelValue": p
1531
1543
  }, null, 512)
1532
1544
  ]);
1533
1545
  };
1534
1546
  }
1535
- }), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$8 = {
1547
+ }), _hoisted_1$9 = { class: "space-y-16" }, _hoisted_2$6 = {
1536
1548
  key: 0,
1537
1549
  class: "grid grid-cols-2 gap-16"
1538
- }, _hoisted_3$6 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$5 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
1550
+ }, _hoisted_3$5 = { class: "fm-typo-en-title-sm-800" }, _hoisted_4$4 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$9 = /* @__PURE__ */ defineComponent({
1539
1551
  __name: "PromotionGameTypeInput",
1540
1552
  props: {
1541
1553
  modelValue: {
@@ -1543,48 +1555,48 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1543
1555
  }
1544
1556
  },
1545
1557
  emits: ["update:model-value"],
1546
- setup(e, { emit: i }) {
1547
- const n = e, r = i, o = computed(() => [
1558
+ setup(e, { emit: c }) {
1559
+ const s = e, u = c, a = computed(() => [
1548
1560
  {
1549
1561
  label: "Rock paper scissor",
1550
1562
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
1551
1563
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
1552
1564
  }
1553
1565
  ]);
1554
- return (s, l) => {
1555
- var v, m, g;
1556
- const t = resolveComponent("FmSwitch"), a = resolveComponent("FmCard"), f = resolveComponent("FmHelperText");
1566
+ return (i, l) => {
1567
+ var h, y, g;
1568
+ const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), p = resolveComponent("FmHelperText");
1557
1569
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
1558
- createVNode(t, {
1570
+ createVNode(o, {
1559
1571
  label: "Enable game",
1560
- "model-value": !!((v = e.modelValue) != null && v.gameType),
1561
- "onUpdate:modelValue": l[0] || (l[0] = (c) => c ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
1572
+ "model-value": !!((h = e.modelValue) != null && h.gameType),
1573
+ "onUpdate:modelValue": l[0] || (l[0] = (V) => V ? u("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : u("update:model-value", null))
1562
1574
  }, null, 8, ["model-value"]),
1563
- ((m = e.modelValue) == null ? void 0 : m.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
1564
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (c) => {
1565
- var d, u;
1566
- return openBlock(), createBlock(a, {
1575
+ ((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$6, [
1576
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (V) => {
1577
+ var d, m;
1578
+ return openBlock(), createBlock(n, {
1567
1579
  variant: "outlined",
1568
1580
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1569
- "col-span-2": unref(o).length == 1,
1570
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == c.value,
1571
- "hover:bg-fm-color-opacity-sm": ((u = e.modelValue) == null ? void 0 : u.gameType) != c.value
1581
+ "col-span-2": unref(a).length == 1,
1582
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((d = e.modelValue) == null ? void 0 : d.gameType) == V.value,
1583
+ "hover:bg-fm-color-opacity-sm": ((m = e.modelValue) == null ? void 0 : m.gameType) != V.value
1572
1584
  }]),
1573
1585
  onClick: () => {
1574
- var p;
1575
- ((p = n.modelValue) == null ? void 0 : p.gameType) != c.value && r("update:model-value", { gameType: c.value });
1586
+ var f;
1587
+ ((f = s.modelValue) == null ? void 0 : f.gameType) != V.value && u("update:model-value", { gameType: V.value });
1576
1588
  },
1577
- key: c.value
1589
+ key: V.value
1578
1590
  }, {
1579
1591
  default: withCtx(() => [
1580
- createElementVNode("div", _hoisted_3$6, toDisplayString(c.label), 1),
1581
- createElementVNode("div", _hoisted_4$5, toDisplayString(c.description), 1)
1592
+ createElementVNode("div", _hoisted_3$5, toDisplayString(V.label), 1),
1593
+ createElementVNode("div", _hoisted_4$4, toDisplayString(V.description), 1)
1582
1594
  ]),
1583
1595
  _: 2
1584
1596
  }, 1032, ["class", "onClick"]);
1585
1597
  }), 128))
1586
1598
  ])) : createCommentVNode("", !0),
1587
- ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(f, {
1599
+ ((g = e.modelValue) == null ? void 0 : g.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(p, {
1588
1600
  key: 1,
1589
1601
  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)",
1590
1602
  state: "warning"
@@ -1592,7 +1604,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1592
1604
  ]);
1593
1605
  };
1594
1606
  }
1595
- }), _hoisted_1$8 = { class: "space-y-16" }, _hoisted_2$7 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_3$5 = { class: "grid grid-cols-2 gap-16" }, _hoisted_4$4 = { class: "fm-typo-en-title-sm-800" }, _hoisted_5$3 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _sfc_main$8 = /* @__PURE__ */ defineComponent({
1607
+ }), _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({
1596
1608
  __name: "MissionTypeInput",
1597
1609
  props: {
1598
1610
  modelValue: {
@@ -1600,8 +1612,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1600
1612
  }
1601
1613
  },
1602
1614
  emits: ["update:model-value"],
1603
- setup(e, { emit: i }) {
1604
- const n = e, r = i, o = computed(() => [
1615
+ setup(e, { emit: c }) {
1616
+ const s = e, u = c, a = computed(() => [
1605
1617
  {
1606
1618
  label: "Stamp",
1607
1619
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -1613,26 +1625,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1613
1625
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1614
1626
  }
1615
1627
  ]);
1616
- return (s, l) => {
1617
- const t = resolveComponent("FmCard");
1628
+ return (i, l) => {
1629
+ const o = resolveComponent("FmCard");
1618
1630
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
1619
- _hoisted_2$7,
1620
- createElementVNode("div", _hoisted_3$5, [
1621
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (a) => (openBlock(), createBlock(t, {
1631
+ 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)),
1632
+ createElementVNode("div", _hoisted_2$5, [
1633
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (n) => (openBlock(), createBlock(o, {
1622
1634
  variant: "outlined",
1623
1635
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
1624
- "col-span-2": unref(o).length == 1,
1625
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == a.value,
1626
- "hover:bg-fm-color-opacity-sm": e.modelValue != a.value
1636
+ "col-span-2": unref(a).length == 1,
1637
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": e.modelValue == n.value,
1638
+ "hover:bg-fm-color-opacity-sm": e.modelValue != n.value
1627
1639
  }]),
1628
1640
  onClick: () => {
1629
- n.modelValue != a.value && r("update:model-value", a.value);
1641
+ s.modelValue != n.value && u("update:model-value", n.value);
1630
1642
  },
1631
- key: a.value
1643
+ key: n.value
1632
1644
  }, {
1633
1645
  default: withCtx(() => [
1634
- createElementVNode("div", _hoisted_4$4, toDisplayString(a.label), 1),
1635
- createElementVNode("div", _hoisted_5$3, toDisplayString(a.description), 1)
1646
+ createElementVNode("div", _hoisted_3$4, toDisplayString(n.label), 1),
1647
+ createElementVNode("div", _hoisted_4$3, toDisplayString(n.description), 1)
1636
1648
  ]),
1637
1649
  _: 2
1638
1650
  }, 1032, ["class", "onClick"]))), 128))
@@ -1640,7 +1652,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1640
1652
  ]);
1641
1653
  };
1642
1654
  }
1643
- }), _hoisted_1$7 = { class: "space-y-16" }, _hoisted_2$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$7 = /* @__PURE__ */ defineComponent({
1655
+ }), _hoisted_1$7 = { class: "space-y-16" }, _sfc_main$7 = /* @__PURE__ */ defineComponent({
1644
1656
  __name: "MissionEndInput",
1645
1657
  props: {
1646
1658
  modelValue: {
@@ -1654,23 +1666,23 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1654
1666
  }
1655
1667
  },
1656
1668
  emits: ["update:model-value"],
1657
- setup(e, { emit: i }) {
1658
- const n = i;
1659
- return (r, o) => {
1660
- const s = resolveComponent("FmStepperField");
1669
+ setup(e, { emit: c }) {
1670
+ const s = c;
1671
+ return (u, a) => {
1672
+ const i = resolveComponent("FmStepperField");
1661
1673
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1662
- _hoisted_2$6,
1663
- createVNode(s, {
1674
+ a[1] || (a[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)),
1675
+ createVNode(i, {
1664
1676
  label: "Maximum to collect",
1665
1677
  "model-value": e.modelValue || null,
1666
- "onUpdate:modelValue": o[0] || (o[0] = (l) => n("update:model-value", l)),
1678
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => s("update:model-value", l)),
1667
1679
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1668
1680
  "helper-state": e.helperState || "none"
1669
1681
  }, null, 8, ["model-value", "helper-text", "helper-state"])
1670
1682
  ]);
1671
1683
  };
1672
1684
  }
1673
- }), _hoisted_1$6 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1), _hoisted_2$5 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
1685
+ }), _hoisted_1$6 = { class: "flex gap-8 items-center justify-start" }, _sfc_main$6 = /* @__PURE__ */ defineComponent({
1674
1686
  __name: "EditMissionPoolSheet",
1675
1687
  props: {
1676
1688
  maxThreshold: {
@@ -1679,103 +1691,103 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1679
1691
  }
1680
1692
  },
1681
1693
  emits: ["update:model-value"],
1682
- setup(e, { expose: i, emit: n }) {
1683
- const r = e, o = useMembershipStore(), { minor: s } = useLoading, l = ref(!1), t = ref(), a = ref(), f = ref(0), v = FdtoThresholdReward, m = computed(() => {
1684
- const p = v.safeParse(t.value);
1685
- return p.success ? [] : p.error.errors;
1694
+ setup(e, { expose: c, emit: s }) {
1695
+ const u = e, a = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), o = ref(), n = ref(), p = ref(0), h = FdtoThresholdReward, y = computed(() => {
1696
+ const f = h.safeParse(o.value);
1697
+ return f.success ? [] : f.error.errors;
1686
1698
  });
1687
- function g(p, y, k) {
1688
- p && (t.value = y, f.value = k), l.value = p;
1699
+ function g(f, v, E) {
1700
+ f && (o.value = v, p.value = E), l.value = f;
1689
1701
  }
1690
- const c = n;
1702
+ const V = s;
1691
1703
  async function d() {
1692
- console.log(t.value);
1693
- const p = v.safeParse(t.value);
1694
- p.success && (await s(
1704
+ console.log(o.value);
1705
+ const f = h.safeParse(o.value);
1706
+ f.success && (await i(
1695
1707
  async () => {
1696
- p.data.type === "VOUCHER" && a.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
1697
- p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, a.value),
1698
- a.value
1708
+ f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1709
+ f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
1710
+ n.value
1699
1711
  ));
1700
1712
  },
1701
1713
  {
1702
1714
  message: "Uploading reward image",
1703
1715
  successMessage: "Reward image updated"
1704
1716
  }
1705
- ), c("update:model-value", p.data, f.value));
1717
+ ), V("update:model-value", f.data, p.value));
1706
1718
  }
1707
- const u = ref();
1708
- return i({
1719
+ const m = ref();
1720
+ return c({
1709
1721
  showSheet: g
1710
- }), (p, y) => {
1711
- const k = resolveComponent("FmStepperField"), C = resolveComponent("FmSelect"), b = resolveComponent("FmForm"), x = resolveComponent("FmButton"), E = resolveComponent("FmSideSheet");
1712
- return openBlock(), createBlock(E, {
1722
+ }), (f, v) => {
1723
+ const E = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), C = resolveComponent("FmForm"), R = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1724
+ return openBlock(), createBlock(B, {
1713
1725
  "max-width": 560,
1714
1726
  modelValue: unref(l),
1715
1727
  "onUpdate:modelValue": [
1716
- y[10] || (y[10] = (V) => isRef(l) ? l.value = V : null),
1717
- y[11] || (y[11] = (V) => l.value = V)
1728
+ v[10] || (v[10] = (k) => isRef(l) ? l.value = k : null),
1729
+ v[11] || (v[11] = (k) => l.value = k)
1718
1730
  ],
1719
1731
  header: "Edit reward",
1720
1732
  "dismiss-away": ""
1721
1733
  }, {
1722
1734
  "side-sheet-footer": withCtx(() => [
1723
- createElementVNode("div", _hoisted_2$5, [
1724
- createVNode(x, {
1735
+ createElementVNode("div", _hoisted_1$6, [
1736
+ createVNode(R, {
1725
1737
  variant: "primary",
1726
1738
  type: "button",
1727
1739
  label: "Confirm",
1728
- onClick: y[8] || (y[8] = async () => {
1729
- var V;
1730
- return (V = unref(u)) == null ? void 0 : V.validateInputs();
1740
+ onClick: v[8] || (v[8] = async () => {
1741
+ var k;
1742
+ return (k = unref(m)) == null ? void 0 : k.validateInputs();
1731
1743
  })
1732
1744
  }),
1733
- createVNode(x, {
1745
+ createVNode(R, {
1734
1746
  variant: "secondary",
1735
1747
  type: "button",
1736
1748
  label: "Cancel",
1737
- onClick: y[9] || (y[9] = (V) => l.value = !1)
1749
+ onClick: v[9] || (v[9] = (k) => l.value = !1)
1738
1750
  })
1739
1751
  ])
1740
1752
  ]),
1741
1753
  default: withCtx(() => [
1742
- unref(t) ? (openBlock(), createBlock(b, {
1754
+ unref(o) ? (openBlock(), createBlock(C, {
1743
1755
  key: 0,
1744
1756
  class: "flex flex-col gap-y-24",
1745
1757
  ref_key: "formRef",
1746
- ref: u,
1747
- onValidationSuccess: y[7] || (y[7] = (V) => d())
1758
+ ref: m,
1759
+ onValidationSuccess: v[7] || (v[7] = (k) => d())
1748
1760
  }, {
1749
1761
  default: withCtx(() => {
1750
- var V, N;
1762
+ var k, w;
1751
1763
  return [
1752
- unref(t).type ? (openBlock(), createBlock(k, {
1764
+ unref(o).type ? (openBlock(), createBlock(E, {
1753
1765
  key: 0,
1754
1766
  label: "Threshold",
1755
1767
  rules: [
1756
1768
  unref(ZodHelper).toRule(
1757
1769
  unref(z).number().min(1).max(
1758
- r.maxThreshold,
1759
- `Number cannot be more than ${r.maxThreshold}`
1770
+ u.maxThreshold,
1771
+ `Number cannot be more than ${u.maxThreshold}`
1760
1772
  )
1761
1773
  )
1762
1774
  ],
1763
- "model-value": unref(t).threshold,
1764
- "onUpdate:modelValue": y[0] || (y[0] = (h) => t.value = {
1765
- ...unref(t),
1766
- threshold: h
1775
+ "model-value": unref(o).threshold,
1776
+ "onUpdate:modelValue": v[0] || (v[0] = (b) => o.value = {
1777
+ ...unref(o),
1778
+ threshold: b
1767
1779
  })
1768
1780
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
1769
- createVNode(C, {
1781
+ createVNode(x, {
1770
1782
  label: "Reward Type",
1771
1783
  items: [
1772
1784
  { label: "Voucher", value: "VOUCHER" },
1773
1785
  { label: "Loyalty", value: "LOYALTY" }
1774
1786
  ],
1775
- "model-value": unref(t).type,
1776
- "onUpdate:modelValue": y[1] || (y[1] = (h) => {
1777
- var R, B;
1778
- h === "VOUCHER" ? t.value = {
1787
+ "model-value": unref(o).type,
1788
+ "onUpdate:modelValue": v[1] || (v[1] = (b) => {
1789
+ var S, N;
1790
+ b === "VOUCHER" ? o.value = {
1779
1791
  collectible: null,
1780
1792
  type: "VOUCHER",
1781
1793
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1788,9 +1800,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1788
1800
  validityOption: {
1789
1801
  validForDay: 7
1790
1802
  },
1791
- threshold: (R = unref(t)) == null ? void 0 : R.threshold
1792
- } : t.value = {
1793
- collectible: unref(o).loyaltyRewards.raw[0]._id,
1803
+ threshold: (S = unref(o)) == null ? void 0 : S.threshold
1804
+ } : o.value = {
1805
+ collectible: unref(a).loyaltyRewards.raw[0]._id,
1794
1806
  type: "LOYALTY",
1795
1807
  earningOption: {
1796
1808
  amount: 1,
@@ -1799,59 +1811,59 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1799
1811
  validityOption: {
1800
1812
  validForDay: 7
1801
1813
  },
1802
- threshold: (B = unref(t)) == null ? void 0 : B.threshold
1814
+ threshold: (N = unref(o)) == null ? void 0 : N.threshold
1803
1815
  };
1804
1816
  })
1805
1817
  }, null, 8, ["model-value"]),
1806
- unref(t).type == "LOYALTY" ? (openBlock(), createBlock(C, {
1818
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1807
1819
  key: 1,
1808
1820
  label: "Loyalty type",
1809
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "collectible", [unref(t).type])],
1810
- items: unref(o).loyaltyRewards.items,
1811
- "model-value": unref(t).collectible,
1812
- "onUpdate:modelValue": y[2] || (y[2] = (h) => unref(t).collectible = h)
1821
+ rules: [unref(ZodHelper).ruleAtPath(unref(h), "collectible", [unref(o).type])],
1822
+ items: unref(a).loyaltyRewards.items,
1823
+ "model-value": unref(o).collectible,
1824
+ "onUpdate:modelValue": v[2] || (v[2] = (b) => unref(o).collectible = b)
1813
1825
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1814
- unref(t).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1815
- _hoisted_1$6,
1826
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1827
+ v[12] || (v[12] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Earning option", -1)),
1816
1828
  createVNode(_sfc_main$e, {
1817
1829
  class: "mt-[-8px]",
1818
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "earningOption", [unref(t).type])],
1819
- "helper-state": unref(ZodHelper).helperState(unref(m), "earningOption"),
1820
- "error-text": unref(ZodHelper).helperText(unref(m), "earningOption"),
1830
+ rules: [unref(ZodHelper).ruleAtPath(unref(h), "earningOption", [unref(o).type])],
1831
+ "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1832
+ "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1821
1833
  "fixed-type": !0,
1822
- "model-value": unref(t).earningOption,
1823
- "onUpdate:modelValue": y[3] || (y[3] = (h) => t.value = {
1824
- ...unref(t),
1825
- earningOption: h
1834
+ "model-value": unref(o).earningOption,
1835
+ "onUpdate:modelValue": v[3] || (v[3] = (b) => o.value = {
1836
+ ...unref(o),
1837
+ earningOption: b
1826
1838
  })
1827
1839
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1828
1840
  createVNode(_sfc_main$z, {
1829
1841
  class: "!gap-24",
1830
- "for-credit": unref(t).type === "LOYALTY" && ((V = unref(o).loyaltyRewards.items.find(
1831
- (h) => {
1832
- var R;
1833
- return h.value === ((R = unref(t)) == null ? void 0 : R.collectible);
1842
+ "for-credit": unref(o).type === "LOYALTY" && ((k = unref(a).loyaltyRewards.items.find(
1843
+ (b) => {
1844
+ var S;
1845
+ return b.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1834
1846
  }
1835
- )) == null ? void 0 : V.raw.type) === "CREDIT",
1836
- rules: [unref(ZodHelper).ruleAtPath(unref(v), "validityOption", [unref(t).type])],
1837
- "model-value": unref(t).validityOption,
1838
- "onUpdate:modelValue": y[4] || (y[4] = (h) => t.value = {
1839
- ...unref(t),
1840
- validityOption: h
1847
+ )) == null ? void 0 : k.raw.type) === "CREDIT",
1848
+ rules: [unref(ZodHelper).ruleAtPath(unref(h), "validityOption", [unref(o).type])],
1849
+ "model-value": unref(o).validityOption,
1850
+ "onUpdate:modelValue": v[4] || (v[4] = (b) => o.value = {
1851
+ ...unref(o),
1852
+ validityOption: b
1841
1853
  })
1842
1854
  }, null, 8, ["for-credit", "rules", "model-value"])
1843
1855
  ], 64)) : createCommentVNode("", !0),
1844
- unref(t).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1856
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$c, {
1845
1857
  key: 3,
1846
- "reward-image": unref(a),
1847
- "model-value": ((N = unref(t)) == null ? void 0 : N.collectibleConfig) ?? void 0,
1848
- "onUpdate:modelValue": y[5] || (y[5] = (h) => t.value = {
1849
- ...unref(t),
1850
- collectibleConfig: h
1858
+ "reward-image": unref(n),
1859
+ "model-value": ((w = unref(o)) == null ? void 0 : w.collectibleConfig) ?? void 0,
1860
+ "onUpdate:modelValue": v[5] || (v[5] = (b) => o.value = {
1861
+ ...unref(o),
1862
+ collectibleConfig: b
1851
1863
  }),
1852
- "onUpdate:rewardImage": y[6] || (y[6] = (h) => a.value = h)
1864
+ "onUpdate:rewardImage": v[6] || (v[6] = (b) => n.value = b)
1853
1865
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
1854
- createVNode(JsonViewer, { json: unref(m) }, null, 8, ["json"])
1866
+ createVNode(JsonViewer, { json: unref(y) }, null, 8, ["json"])
1855
1867
  ];
1856
1868
  }),
1857
1869
  _: 1
@@ -1864,7 +1876,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1864
1876
  }), _hoisted_1$5 = {
1865
1877
  key: 0,
1866
1878
  class: "grid grid-cols-5 text-center gap-8 justify-between items-center w-full"
1867
- }, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _hoisted_3$4 = /* @__PURE__ */ createElementVNode("div", null, "🎁", -1), _sfc_main$5 = /* @__PURE__ */ defineComponent({
1879
+ }, _hoisted_2$4 = { class: "flex flex-col gap-0 items-center justify-center" }, _sfc_main$5 = /* @__PURE__ */ defineComponent({
1868
1880
  __name: "MissionProgress",
1869
1881
  props: {
1870
1882
  type: {
@@ -1885,19 +1897,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1885
1897
  }
1886
1898
  },
1887
1899
  setup(e) {
1888
- const i = e, { maxRange: n, currentRange: r, markers: o } = toRefs(i), s = computed(
1889
- () => Math.min(r.value / n.value * 100, 100)
1890
- ), l = (t) => t / n.value * 100;
1891
- return (t, a) => {
1892
- const f = resolveComponent("FmIcon");
1900
+ const c = e, { maxRange: s, currentRange: u, markers: a } = toRefs(c), i = computed(
1901
+ () => Math.min(u.value / s.value * 100, 100)
1902
+ ), l = (o) => o / s.value * 100;
1903
+ return (o, n) => {
1904
+ const p = resolveComponent("FmIcon");
1893
1905
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1894
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(n), 40), (v) => (openBlock(), createBlock(f, {
1906
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(s), 40), (h) => (openBlock(), createBlock(p, {
1895
1907
  class: normalizeClass(
1896
- unref(r) >= v ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1908
+ unref(u) >= h ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1897
1909
  ),
1898
- outline: unref(r) < v,
1899
- key: v,
1900
- name: unref(o).some((m) => m === v) ? "featured_seasonal_and_gifts" : "check_circle"
1910
+ outline: unref(u) < h,
1911
+ key: h,
1912
+ name: unref(a).some((y) => y === h) ? "featured_seasonal_and_gifts" : "check_circle"
1901
1913
  }, null, 8, ["class", "outline", "name"]))), 128))
1902
1914
  ])) : (openBlock(), createElementBlock("div", {
1903
1915
  key: 1,
@@ -1905,18 +1917,18 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1905
1917
  }, [
1906
1918
  createElementVNode("div", {
1907
1919
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1908
- style: normalizeStyle({ width: unref(s) + "%" })
1920
+ style: normalizeStyle({ width: unref(i) + "%" })
1909
1921
  }, null, 4),
1910
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (v, m) => (openBlock(), createElementBlock("div", {
1911
- key: m,
1922
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (h, y) => (openBlock(), createElementBlock("div", {
1923
+ key: y,
1912
1924
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1913
- style: normalizeStyle({ left: l(v) + "%" })
1925
+ style: normalizeStyle({ left: l(h) + "%" })
1914
1926
  }, [
1915
1927
  createElementVNode("div", _hoisted_2$4, [
1916
1928
  createElementVNode("div", {
1917
1929
  class: normalizeClass(["h-16 w-[2px]", "bg-fm-color-system-warning-300"])
1918
1930
  }),
1919
- _hoisted_3$4
1931
+ n[0] || (n[0] = createElementVNode("div", null, "🎁", -1))
1920
1932
  ])
1921
1933
  ], 4))), 128))
1922
1934
  ]));
@@ -1924,19 +1936,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1924
1936
  }
1925
1937
  }), isObject = (e) => e !== null && typeof e == "object";
1926
1938
  function changeKeysFactory(e) {
1927
- return function i(n, r = 1, o) {
1928
- if (r === 0 || !isObject(n))
1929
- return n;
1930
- if (Array.isArray(n))
1931
- return n.map((l) => i(l, r - 1, o));
1932
- const s = Object.create(Object.getPrototypeOf(n));
1933
- return Object.keys(n).forEach((l) => {
1934
- const t = n[l], a = e(l, o), f = i(t, r - 1, o);
1935
- s[a] = f;
1936
- }), s;
1939
+ return function c(s, u = 1, a) {
1940
+ if (u === 0 || !isObject(s))
1941
+ return s;
1942
+ if (Array.isArray(s))
1943
+ return s.map((l) => c(l, u - 1, a));
1944
+ const i = Object.create(Object.getPrototypeOf(s));
1945
+ return Object.keys(s).forEach((l) => {
1946
+ const o = s[l], n = e(l, a), p = c(o, u - 1, a);
1947
+ i[n] = p;
1948
+ }), i;
1937
1949
  };
1938
1950
  }
1939
- const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class: "space-y-16" }, _hoisted_2$3 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1), _hoisted_3$3 = { class: "fm-typo-en-body-lg-400" }, _hoisted_4$3 = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _hoisted_5$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1), _hoisted_6$2 = { class: "flex items-center gap-4" }, _hoisted_7$2 = { class: "fm-typo-en-body-lg-600" }, _hoisted_8$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1), _hoisted_9$2 = { class: "flex items-center gap-16" }, _hoisted_10$2 = { key: 0 }, _sfc_main$4 = /* @__PURE__ */ defineComponent({
1951
+ 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({
1940
1952
  __name: "MissionPoolInput",
1941
1953
  props: {
1942
1954
  modelValue: {
@@ -1949,43 +1961,43 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1949
1961
  }
1950
1962
  },
1951
1963
  emits: ["update:model-value"],
1952
- setup(e, { emit: i }) {
1953
- const n = e, r = i, o = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1954
- () => n.modelValue.sort((u, p) => u.threshold - p.threshold) ?? []
1955
- ), t = computed(() => {
1956
- const u = s.safeParse(l.value);
1957
- return u.success ? [] : u.error.errors;
1958
- }), a = ref();
1959
- function f(u, p) {
1960
- var k;
1961
- const y = [...l.value];
1962
- y[p] = u, (k = a.value) == null || k.showSheet(!1), r("update:model-value", y);
1964
+ setup(e, { emit: c }) {
1965
+ const s = e, u = c, a = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1966
+ () => s.modelValue.sort((m, f) => m.threshold - f.threshold) ?? []
1967
+ ), o = computed(() => {
1968
+ const m = i.safeParse(l.value);
1969
+ return m.success ? [] : m.error.errors;
1970
+ }), n = ref();
1971
+ function p(m, f) {
1972
+ var E;
1973
+ const v = [...l.value];
1974
+ v[f] = m, (E = n.value) == null || E.showSheet(!1), u("update:model-value", v);
1963
1975
  }
1964
- function v(u) {
1965
- const p = u.type == "VOUCHER" ? u.collectibleConfig : o.collectibles.find(
1966
- (k) => k._id.toString() == u.collectible
1967
- ), y = CollectionUtils.formattedType((p == null ? void 0 : p.name) || "");
1976
+ function h(m) {
1977
+ const f = m.type == "VOUCHER" ? m.collectibleConfig : a.collectibles.find(
1978
+ (E) => E._id.toString() == m.collectible
1979
+ ), v = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1968
1980
  return {
1969
- label: isNullOrEmpty(y) ? "NO REWARD" : y,
1970
- sublabel: `Reward at ${u.threshold} | Amount: ${u.earningOption.type == "FIXED" ? u.earningOption.amount : `${u.earningOption.amount} for every RM${u.earningOption.every} spent`} `
1981
+ label: isNullOrEmpty(v) ? "NO REWARD" : v,
1982
+ sublabel: `Reward at ${m.threshold} | Amount: ${m.earningOption.type == "FIXED" ? m.earningOption.amount : `${m.earningOption.amount} for every RM${m.earningOption.every} spent`} `
1971
1983
  };
1972
1984
  }
1973
- function m(u) {
1974
- var y;
1975
- const p = [...l.value];
1976
- (y = a.value) == null || y.showSheet(!0, p[u], u);
1985
+ function y(m) {
1986
+ var v;
1987
+ const f = [...l.value];
1988
+ (v = n.value) == null || v.showSheet(!0, f[m], m);
1977
1989
  }
1978
- function g(u) {
1979
- const p = [...l.value];
1980
- p.splice(u, 1), r("update:model-value", p);
1990
+ function g(m) {
1991
+ const f = [...l.value];
1992
+ f.splice(m, 1), u("update:model-value", f);
1981
1993
  }
1982
- function c() {
1983
- var u;
1984
- (u = a.value) == null || u.showSheet(
1994
+ function V() {
1995
+ var m;
1996
+ (m = n.value) == null || m.showSheet(
1985
1997
  !0,
1986
1998
  {
1987
1999
  type: "LOYALTY",
1988
- collectible: o.loyaltyRewards.items[0].value,
2000
+ collectible: a.loyaltyRewards.items[0].value,
1989
2001
  threshold: null,
1990
2002
  validityOption: {
1991
2003
  validForDay: 7
@@ -1998,92 +2010,92 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1998
2010
  l.value.length
1999
2011
  );
2000
2012
  }
2001
- function d(u) {
2002
- var p, y;
2003
- return u.type == "VOUCHER" ? (p = u.collectibleConfig) == null ? void 0 : p.name : sentenceCase(
2004
- ((y = o.loyaltyRewards.items.find(
2005
- (k) => k.value == u.collectible
2006
- )) == null ? void 0 : y.label) || ""
2013
+ function d(m) {
2014
+ var f, v;
2015
+ return m.type == "VOUCHER" ? (f = m.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
2016
+ ((v = a.loyaltyRewards.items.find(
2017
+ (E) => E.value == m.collectible
2018
+ )) == null ? void 0 : v.label) || ""
2007
2019
  );
2008
2020
  }
2009
- return (u, p) => {
2010
- const y = resolveComponent("FmButton"), k = resolveComponent("FmCard"), C = resolveComponent("FmHelperText");
2021
+ return (m, f) => {
2022
+ const v = resolveComponent("FmButton"), E = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
2011
2023
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
2012
- _hoisted_2$3,
2013
- createVNode(y, {
2024
+ f[2] || (f[2] = createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Configure the reward type given to your customer. ", -1)),
2025
+ createVNode(v, {
2014
2026
  label: "Add Reward",
2015
- onClick: p[0] || (p[0] = (b) => c()),
2027
+ onClick: f[0] || (f[0] = (C) => V()),
2016
2028
  variant: "plain",
2017
2029
  icon: "add"
2018
2030
  }),
2019
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (b, x) => (openBlock(), createBlock(k, {
2020
- key: x,
2031
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (C, R) => (openBlock(), createBlock(E, {
2032
+ key: R,
2021
2033
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
2022
2034
  variant: "outlined",
2023
- onClick: (E) => m(x)
2035
+ onClick: (B) => y(R)
2024
2036
  }, {
2025
2037
  default: withCtx(() => [
2026
2038
  createElementVNode("div", null, [
2027
- createElementVNode("div", _hoisted_3$3, toDisplayString(v(b).label), 1),
2028
- createElementVNode("div", _hoisted_4$3, toDisplayString(v(b).sublabel), 1)
2039
+ createElementVNode("div", _hoisted_2$3, toDisplayString(h(C).label), 1),
2040
+ createElementVNode("div", _hoisted_3$3, toDisplayString(h(C).sublabel), 1)
2029
2041
  ]),
2030
- createVNode(y, {
2042
+ createVNode(v, {
2031
2043
  icon: "delete",
2032
2044
  variant: "tertiary",
2033
- onClick: (E) => (E.stopPropagation(), g(x))
2045
+ onClick: (B) => (B.stopPropagation(), g(R))
2034
2046
  }, null, 8, ["onClick"])
2035
2047
  ]),
2036
2048
  _: 2
2037
2049
  }, 1032, ["onClick"]))), 128)),
2038
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(t).filter((b) => b.path.join(".") == ""), (b) => (openBlock(), createBlock(C, {
2039
- key: b.message,
2040
- text: b.message,
2050
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((C) => C.path.join(".") == ""), (C) => (openBlock(), createBlock(x, {
2051
+ key: C.message,
2052
+ text: C.message,
2041
2053
  state: "error"
2042
2054
  }, null, 8, ["text"]))), 128)),
2043
- _hoisted_5$2,
2044
- createVNode(k, {
2055
+ f[3] || (f[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Preview", -1)),
2056
+ createVNode(E, {
2045
2057
  variant: "outlined",
2046
2058
  class: "p-24 space-y-16 w-fit"
2047
2059
  }, {
2048
2060
  default: withCtx(() => [
2049
- createElementVNode("div", _hoisted_6$2, [
2061
+ createElementVNode("div", _hoisted_4$2, [
2050
2062
  createElementVNode("div", null, [
2051
- createElementVNode("div", _hoisted_7$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(d(e.modelValue[e.modelValue.length - 1])), 1),
2052
- _hoisted_8$2
2063
+ createElementVNode("div", _hoisted_5$2, " Collect " + toDisplayString(e.mission.end) + " stamps to get " + toDisplayString(e.modelValue[e.modelValue.length - 1].earningOption.amount > 1 ? e.modelValue[e.modelValue.length - 1].earningOption.amount : "") + " " + toDisplayString(d(e.modelValue[e.modelValue.length - 1])), 1),
2064
+ f[1] || (f[1] = createElementVNode("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Earn a stamp! ", -1))
2053
2065
  ])
2054
2066
  ]),
2055
- createElementVNode("div", _hoisted_9$2, [
2067
+ createElementVNode("div", _hoisted_6$2, [
2056
2068
  createVNode(_sfc_main$5, {
2057
2069
  type: e.mission.type,
2058
2070
  "max-range": e.mission.end,
2059
2071
  currentRange: e.mission.end / 4,
2060
- markers: e.modelValue.map((b) => b.threshold)
2072
+ markers: e.modelValue.map((C) => C.threshold)
2061
2073
  }, null, 8, ["type", "max-range", "currentRange", "markers"]),
2062
- e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_10$2, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2074
+ e.mission.type == "PROGRESSIVE" ? (openBlock(), createElementBlock("div", _hoisted_7$1, " 0/" + toDisplayString(e.mission.end.toLocaleString()), 1)) : createCommentVNode("", !0)
2063
2075
  ])
2064
2076
  ]),
2065
2077
  _: 1
2066
2078
  }),
2067
2079
  createVNode(_sfc_main$6, {
2068
2080
  ref_key: "sheetRef",
2069
- ref: a,
2070
- "onUpdate:modelValue": f,
2081
+ ref: n,
2082
+ "onUpdate:modelValue": p,
2071
2083
  "max-threshold": e.mission.end
2072
2084
  }, null, 8, ["max-threshold"])
2073
2085
  ]);
2074
2086
  };
2075
2087
  }
2076
- }), _hoisted_1$3 = { class: "space-y-16" }, _hoisted_2$2 = { class: "space-y-8" }, _hoisted_3$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1), _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Select a game where you want your customer to play. ", -1), _hoisted_5$1 = { class: "grid grid-cols-2 gap-16" }, _hoisted_6$1 = { class: "fm-typo-en-title-sm-800" }, _hoisted_7$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_8$1 = { class: "space-y-8" }, _hoisted_9$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1), _hoisted_10$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Input the total number of stamps needed to complete the mission ", -1), _sfc_main$3 = /* @__PURE__ */ defineComponent({
2088
+ }), _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({
2077
2089
  __name: "MissionInput",
2078
2090
  props: {
2079
2091
  modelValue: Object
2080
2092
  },
2081
2093
  emits: ["update:model-value"],
2082
- setup(e, { emit: i }) {
2083
- const n = e, r = computed(() => {
2084
- const l = FdoMission.safeParse(n.modelValue);
2094
+ setup(e, { emit: c }) {
2095
+ const s = e, u = computed(() => {
2096
+ const l = FdoMission.safeParse(s.modelValue);
2085
2097
  return l.success ? [] : l.error.errors;
2086
- }), o = computed(() => [
2098
+ }), a = computed(() => [
2087
2099
  {
2088
2100
  label: "Stamp",
2089
2101
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -2094,59 +2106,59 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2094
2106
  description: "Reward customers when they reach a cumulative spending goal.",
2095
2107
  value: F_MISSION_TYPE.enum.PROGRESSIVE
2096
2108
  }
2097
- ]), s = i;
2098
- return (l, t) => {
2099
- var v;
2100
- const a = resolveComponent("FmCard"), f = resolveComponent("FmStepperField");
2109
+ ]), i = c;
2110
+ return (l, o) => {
2111
+ var h;
2112
+ const n = resolveComponent("FmCard"), p = resolveComponent("FmStepperField");
2101
2113
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
2102
2114
  createElementVNode("div", _hoisted_2$2, [
2103
- _hoisted_3$2,
2104
- _hoisted_4$2,
2105
- createElementVNode("div", _hoisted_5$1, [
2106
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (m) => {
2107
- var g, c;
2108
- return openBlock(), createBlock(a, {
2115
+ o[1] || (o[1] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Mission Type", -1)),
2116
+ 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)),
2117
+ createElementVNode("div", _hoisted_3$2, [
2118
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(a), (y) => {
2119
+ var g, V;
2120
+ return openBlock(), createBlock(n, {
2109
2121
  variant: "outlined",
2110
2122
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
2111
- "col-span-2": unref(o).length == 1,
2112
- "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == m.value,
2113
- "hover:bg-fm-color-opacity-sm": ((c = e.modelValue) == null ? void 0 : c.type) != m.value
2123
+ "col-span-2": unref(a).length == 1,
2124
+ "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((g = e.modelValue) == null ? void 0 : g.type) == y.value,
2125
+ "hover:bg-fm-color-opacity-sm": ((V = e.modelValue) == null ? void 0 : V.type) != y.value
2114
2126
  }]),
2115
2127
  onClick: () => {
2116
- var d, u;
2117
- ((d = e.modelValue) == null ? void 0 : d.type) != m.value && s("update:model-value", {
2128
+ var d, m;
2129
+ ((d = e.modelValue) == null ? void 0 : d.type) != y.value && i("update:model-value", {
2118
2130
  ...e.modelValue,
2119
- type: m.value,
2120
- end: ((u = e.modelValue) == null ? void 0 : u.end) || 1
2131
+ type: y.value,
2132
+ end: ((m = e.modelValue) == null ? void 0 : m.end) || 1
2121
2133
  });
2122
2134
  },
2123
- key: m.value
2135
+ key: y.value
2124
2136
  }, {
2125
2137
  default: withCtx(() => [
2126
- createElementVNode("div", _hoisted_6$1, toDisplayString(m.label), 1),
2127
- createElementVNode("div", _hoisted_7$1, toDisplayString(m.description), 1)
2138
+ createElementVNode("div", _hoisted_4$1, toDisplayString(y.label), 1),
2139
+ createElementVNode("div", _hoisted_5$1, toDisplayString(y.description), 1)
2128
2140
  ]),
2129
2141
  _: 2
2130
2142
  }, 1032, ["class", "onClick"]);
2131
2143
  }), 128))
2132
2144
  ])
2133
2145
  ]),
2134
- createElementVNode("div", _hoisted_8$1, [
2135
- _hoisted_9$1,
2136
- _hoisted_10$1,
2137
- createVNode(f, {
2146
+ createElementVNode("div", _hoisted_6$1, [
2147
+ o[3] || (o[3] = createElementVNode("div", { class: "fm-typo-en-title-sm-800" }, "Collections required", -1)),
2148
+ 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)),
2149
+ createVNode(p, {
2138
2150
  label: "Maximum to collect",
2139
- "model-value": ((v = e.modelValue) == null ? void 0 : v.end) || null,
2140
- "onUpdate:modelValue": t[0] || (t[0] = (m) => {
2151
+ "model-value": ((h = e.modelValue) == null ? void 0 : h.end) || null,
2152
+ "onUpdate:modelValue": o[0] || (o[0] = (y) => {
2141
2153
  var g;
2142
- return s("update:model-value", {
2154
+ return i("update:model-value", {
2143
2155
  ...e.modelValue,
2144
2156
  type: ((g = e.modelValue) == null ? void 0 : g.type) || "STAMP",
2145
- end: m
2157
+ end: y
2146
2158
  });
2147
2159
  }),
2148
- "helper-text": unref(ZodHelper).helperText(unref(r), "end") || "Set the threshold required for reward eligibility",
2149
- "helper-state": unref(ZodHelper).helperState(unref(r), "end") || "none"
2160
+ "helper-text": unref(ZodHelper).helperText(unref(u), "end") || "Set the threshold required for reward eligibility",
2161
+ "helper-state": unref(ZodHelper).helperState(unref(u), "end") || "none"
2150
2162
  }, null, 8, ["model-value", "helper-text", "helper-state"])
2151
2163
  ])
2152
2164
  ]);
@@ -2174,202 +2186,205 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2174
2186
  }
2175
2187
  },
2176
2188
  emits: ["update:model-value", "update:file"],
2177
- setup(e, { emit: i }) {
2178
- const n = e, r = i;
2179
- function o(a) {
2180
- switch (n.field.type) {
2189
+ setup(e, { emit: c }) {
2190
+ const { t: s } = useI18n(), u = e, a = c;
2191
+ function i(p) {
2192
+ switch (u.field.type) {
2181
2193
  case "timeframe":
2182
- const f = a.startDate ? hooks(a.startDate).startOf("day").toISOString() : void 0, v = a.endDate ? hooks(a.endDate).endOf("day").toISOString() : void 0;
2183
- r("update:model-value", {
2194
+ const h = p.startDate ? hooks(p.startDate).startOf("day").toISOString() : void 0, y = p.endDate ? hooks(p.endDate).endOf("day").toISOString() : void 0;
2195
+ a("update:model-value", {
2184
2196
  type: "timeframe",
2185
2197
  property: "__now",
2186
- start: f,
2187
- end: v
2198
+ start: h,
2199
+ end: y
2188
2200
  });
2189
2201
  break;
2190
2202
  case "image": {
2191
- r(
2203
+ a(
2192
2204
  "update:file",
2193
- a,
2194
- s.value || firebaseStorage.collectibleImagePath(void 0, a)
2205
+ p,
2206
+ l.value || firebaseStorage.collectibleImagePath(void 0, p)
2195
2207
  );
2196
2208
  break;
2197
2209
  }
2198
2210
  default:
2199
- r("update:model-value", a);
2211
+ a("update:model-value", p);
2200
2212
  break;
2201
2213
  }
2202
2214
  }
2203
- const s = computed(() => {
2204
- switch (n.field.type) {
2215
+ const l = computed(() => {
2216
+ switch (u.field.type) {
2205
2217
  case "timeframe": {
2206
- const a = n.modelValue;
2218
+ const p = u.modelValue;
2207
2219
  return {
2208
- startDate: a != null && a.start ? hooks(a == null ? void 0 : a.start).format("YYYY-MM-DD") : null,
2209
- endDate: a != null && a.end ? hooks(a == null ? void 0 : a.end).format("YYYY-MM-DD") : null
2220
+ startDate: p != null && p.start ? hooks(p == null ? void 0 : p.start).format("YYYY-MM-DD") : null,
2221
+ endDate: p != null && p.end ? hooks(p == null ? void 0 : p.end).format("YYYY-MM-DD") : null
2210
2222
  };
2211
2223
  }
2212
2224
  default:
2213
- return n.modelValue;
2225
+ return u.modelValue;
2214
2226
  }
2215
2227
  });
2216
- function l() {
2217
- if (!t.value.schema) return [];
2218
- const a = t.value.schema.safeParse(n.modelValue);
2219
- return a.success ? [] : a.error.errors;
2228
+ function o() {
2229
+ if (!n.value.schema) return [];
2230
+ const p = n.value.schema.safeParse(u.modelValue);
2231
+ return p.success ? [] : p.error.errors;
2220
2232
  }
2221
- const t = computed(() => ({
2222
- schema: n.schema,
2223
- unwrapped: n.schema ? ZodHelper.unwrap(n.schema) : void 0,
2224
- rules: n.schema ? [ZodHelper.ruleAtPath(n.schema, "")] : void 0,
2225
- labelMark: n.schema && ZodHelper.isRequired(n.schema) == !1 ? "optional" : void 0,
2226
- zodLabel: n.schema ? ZodHelper.toInputLabel(n.schema, n.field.label) : void 0
2233
+ const n = computed(() => ({
2234
+ schema: u.schema,
2235
+ unwrapped: u.schema ? ZodHelper.unwrap(u.schema) : void 0,
2236
+ rules: u.schema ? [ZodHelper.ruleAtPath(u.schema, "")] : void 0,
2237
+ labelMark: u.schema && ZodHelper.isRequired(u.schema) == !1 ? "optional" : void 0,
2238
+ zodLabel: u.schema ? ZodHelper.toInputLabel(u.schema, u.field.label) : void 0
2227
2239
  }));
2228
- return (a, f) => {
2229
- var u, p, y, k, C;
2230
- const v = resolveComponent("FmTextField"), m = resolveComponent("FmStepperField"), g = resolveComponent("FmTextarea"), c = resolveComponent("FmHelperText"), d = resolveComponent("FmSwitch");
2231
- return e.field.type === "text" ? (openBlock(), createBlock(v, {
2240
+ return (p, h) => {
2241
+ var f, v, E, x, C;
2242
+ const y = resolveComponent("FmTextField"), g = resolveComponent("FmStepperField"), V = resolveComponent("FmTextarea"), d = resolveComponent("FmHelperText"), m = resolveComponent("FmSwitch");
2243
+ return e.field.type === "text" ? (openBlock(), createBlock(y, {
2232
2244
  key: 0,
2233
- label: e.field.label,
2234
- "label-mark": unref(t).labelMark,
2235
- rules: unref(t).rules,
2236
- "model-value": unref(s),
2237
- "onUpdate:modelValue": o
2238
- }, null, 8, ["label", "label-mark", "rules", "model-value"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2245
+ label: unref(s)(e.field.label),
2246
+ "label-mark": unref(n).labelMark,
2247
+ rules: unref(n).rules,
2248
+ "model-value": unref(l),
2249
+ "onUpdate:modelValue": i,
2250
+ "helper-state": e.helperText ? "error" : void 0,
2251
+ "helper-text": e.helperText
2252
+ }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
2239
2253
  createVNode(JsonViewer, {
2240
- json: { schema: unref(t).unwrapped, props: n }
2254
+ json: { schema: unref(n).unwrapped, props: u }
2241
2255
  }, null, 8, ["json"]),
2242
- createVNode(m, {
2243
- label: e.field.label,
2244
- "label-mark": e.field.isRuleChildren ? void 0 : unref(t).labelMark,
2245
- "model-value": unref(s),
2246
- rules: e.field.isRuleChildren ? [] : unref(t).rules,
2247
- "onUpdate:modelValue": o,
2256
+ createVNode(g, {
2257
+ label: unref(s)(e.field.label),
2258
+ "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
2259
+ "model-value": unref(l),
2260
+ rules: e.field.isRuleChildren ? [] : unref(n).rules,
2261
+ "onUpdate:modelValue": i,
2248
2262
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
2249
2263
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
2250
2264
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
2251
- ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(g, {
2265
+ ], 64)) : e.field.type === "textarea" ? (openBlock(), createBlock(V, {
2252
2266
  key: 2,
2253
- label: e.field.label,
2254
- "label-mark": unref(t).labelMark,
2255
- rules: unref(t).rules,
2256
- "model-value": unref(s),
2257
- "onUpdate:modelValue": o,
2267
+ label: unref(s)(e.field.label),
2268
+ "label-mark": unref(n).labelMark,
2269
+ rules: unref(n).rules,
2270
+ "model-value": unref(l),
2271
+ "onUpdate:modelValue": i,
2258
2272
  "show-word-count": "",
2259
- "max-length": (C = (k = (y = (p = (u = unref(t)) == null ? void 0 : u.unwrapped) == null ? void 0 : p._def) == null ? void 0 : y.checks) == null ? void 0 : k.find((b) => b.kind == "max")) == null ? void 0 : C.value
2273
+ "max-length": (C = (x = (E = (v = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : v._def) == null ? void 0 : E.checks) == null ? void 0 : x.find((R) => R.kind == "max")) == null ? void 0 : C.value
2260
2274
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$j, {
2261
2275
  key: 3,
2262
2276
  "campaign-type": e.extras,
2263
- "model-value": unref(s),
2277
+ "model-value": unref(l),
2264
2278
  disabled: e.disabled,
2265
- "onUpdate:modelValue": o
2279
+ "onUpdate:modelValue": i
2266
2280
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
2267
2281
  createVNode(_sfc_main$h, {
2268
- "model-value": unref(s),
2269
- "onUpdate:modelValue": o
2282
+ "model-value": unref(l),
2283
+ "onUpdate:modelValue": i
2270
2284
  }, null, 8, ["model-value"]),
2271
- createVNode(c, {
2285
+ createVNode(d, {
2272
2286
  class: "!mt-[8px]",
2273
- text: unref(ZodHelper).helperText(l(), ""),
2274
- state: unref(ZodHelper).helperState(l(), "")
2287
+ text: unref(ZodHelper).helperText(o(), ""),
2288
+ state: unref(ZodHelper).helperState(o(), "")
2275
2289
  }, null, 8, ["text", "state"])
2276
2290
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$v, {
2277
2291
  key: 5,
2278
- thumbnail: unref(s),
2292
+ thumbnail: unref(l),
2279
2293
  "aspect-ratio": "16 / 9",
2280
2294
  class: "w-1/2 xs:w-2/3",
2281
- "onUpdate:file": o
2295
+ "onUpdate:file": i
2282
2296
  }, {
2283
2297
  label: withCtx(() => [
2284
- (openBlock(), createBlock(resolveDynamicComponent(unref(t).zodLabel)))
2298
+ (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
2285
2299
  ]),
2286
2300
  _: 1
2287
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(d, {
2301
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(m, {
2288
2302
  key: 6,
2289
- label: e.field.label,
2303
+ label: unref(s)(e.field.label),
2290
2304
  "label-placement": "right",
2291
2305
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
2292
- "label-mark": unref(t).labelMark,
2293
- rules: unref(t).rules,
2294
- "model-value": unref(s),
2295
- "onUpdate:modelValue": o
2306
+ "label-mark": unref(n).labelMark,
2307
+ rules: unref(n).rules,
2308
+ "model-value": unref(l),
2309
+ "onUpdate:modelValue": i
2296
2310
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$x, {
2297
2311
  key: 7,
2298
- "model-value": unref(s),
2299
- "onUpdate:modelValue": o,
2312
+ "model-value": unref(l),
2313
+ "onUpdate:modelValue": i,
2300
2314
  "no-campaign": !1,
2301
- schema: unref(t).schema,
2315
+ schema: unref(n).schema,
2302
2316
  "is-mission": e.extras === "MISSION"
2303
2317
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$y, {
2304
2318
  key: 8,
2305
- "model-value": unref(s),
2306
- "onUpdate:modelValue": o
2319
+ "model-value": unref(l),
2320
+ "onUpdate:modelValue": i
2307
2321
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
2308
2322
  createVNode(_sfc_main$w, {
2309
- "model-value": unref(s),
2310
- "onUpdate:modelValue": o,
2323
+ "model-value": unref(l),
2324
+ "onUpdate:modelValue": i,
2311
2325
  "can-set-auto-apply": e.field.property == "campaign.effect"
2312
2326
  }, null, 8, ["model-value", "can-set-auto-apply"]),
2313
- unref(s) ? createCommentVNode("", !0) : (openBlock(), createBlock(c, {
2327
+ unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(d, {
2314
2328
  key: 0,
2315
2329
  class: "!mt-[8px]",
2316
- text: "Effect is required",
2330
+ text: unref(s)("connect.campaign.common.effect_required"),
2317
2331
  state: "error"
2318
- }))
2332
+ }, null, 8, ["text"]))
2319
2333
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$A, {
2320
2334
  key: 10,
2321
- "model-value": unref(s),
2322
- "onUpdate:modelValue": o,
2323
- "helper-text": unref(ZodHelper).helperText(l(), ""),
2335
+ "allow-email": !0,
2336
+ "model-value": unref(l),
2337
+ "onUpdate:modelValue": i,
2338
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
2324
2339
  "trigger-type": e.field.extras,
2325
- "helper-state": unref(ZodHelper).helperState(l(), "")
2340
+ "helper-state": unref(ZodHelper).helperState(o(), "")
2326
2341
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$e, {
2327
2342
  key: 11,
2328
- "model-value": unref(s),
2329
- "onUpdate:modelValue": o,
2343
+ "model-value": unref(l),
2344
+ "onUpdate:modelValue": i,
2330
2345
  extras: e.extras,
2331
2346
  "error-text": e.helperText
2332
2347
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$z, {
2333
2348
  key: 12,
2334
2349
  type: "custom",
2335
- "model-value": unref(s),
2336
- "onUpdate:modelValue": o,
2337
- "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
2350
+ "model-value": unref(l),
2351
+ "onUpdate:modelValue": i,
2352
+ "helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
2338
2353
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$d, {
2339
2354
  key: 13,
2340
- "model-value": unref(s),
2341
- "onUpdate:modelValue": o
2355
+ "model-value": unref(l),
2356
+ "onUpdate:modelValue": i
2342
2357
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
2343
2358
  key: 14,
2344
- "model-value": unref(s),
2345
- "onUpdate:modelValue": o
2359
+ "model-value": unref(l),
2360
+ "onUpdate:modelValue": i
2346
2361
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
2347
2362
  key: 15,
2348
- "model-value": unref(s),
2349
- "onUpdate:modelValue": o
2363
+ "model-value": unref(l),
2364
+ "onUpdate:modelValue": i
2350
2365
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
2351
2366
  key: 16,
2352
- "model-value": unref(s),
2353
- "onUpdate:modelValue": o
2367
+ "model-value": unref(l),
2368
+ "onUpdate:modelValue": i
2354
2369
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
2355
2370
  key: 17,
2356
- "model-value": unref(s),
2357
- "onUpdate:modelValue": o,
2358
- "helper-text": unref(ZodHelper).helperText(l(), ""),
2359
- "helper-state": unref(ZodHelper).helperState(l(), "")
2371
+ "model-value": unref(l),
2372
+ "onUpdate:modelValue": i,
2373
+ "helper-text": unref(ZodHelper).helperText(o(), ""),
2374
+ "helper-state": unref(ZodHelper).helperState(o(), "")
2360
2375
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
2361
2376
  key: 18,
2362
- "model-value": unref(s),
2363
- "onUpdate:modelValue": o,
2377
+ "model-value": unref(l),
2378
+ "onUpdate:modelValue": i,
2364
2379
  mission: e.extras.mission
2365
2380
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
2366
2381
  createVNode(_sfc_main$g, {
2367
- "model-value": unref(s),
2368
- "onUpdate:modelValue": o,
2382
+ "model-value": unref(l),
2383
+ "onUpdate:modelValue": i,
2369
2384
  "start-date": e.extras.start,
2370
2385
  "end-date": e.extras.end
2371
2386
  }, null, 8, ["model-value", "start-date", "end-date"]),
2372
- e.helperText ? (openBlock(), createBlock(c, {
2387
+ e.helperText ? (openBlock(), createBlock(d, {
2373
2388
  key: 0,
2374
2389
  class: "!mt-[8px]",
2375
2390
  text: e.helperText,
@@ -2377,26 +2392,26 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2377
2392
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2378
2393
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
2379
2394
  createVNode(_sfc_main$o, {
2380
- "model-value": unref(s),
2381
- "onUpdate:modelValue": o
2395
+ "model-value": unref(l),
2396
+ "onUpdate:modelValue": i
2382
2397
  }, null, 8, ["model-value"]),
2383
- e.helperText ? (openBlock(), createBlock(c, {
2398
+ e.helperText ? (openBlock(), createBlock(d, {
2384
2399
  key: 0,
2385
2400
  class: "!mt-[8px]",
2386
2401
  text: e.helperText,
2387
2402
  state: "error"
2388
2403
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2389
2404
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
2390
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(s).rules.g_time).length > 0 ? (openBlock(), createBlock(c, {
2405
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(d, {
2391
2406
  key: 0,
2392
2407
  state: "warning",
2393
2408
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
2394
2409
  }, null, 8, ["text"])) : createCommentVNode("", !0),
2395
2410
  createVNode(_sfc_main$n, {
2396
- "model-value": unref(s),
2397
- "onUpdate:modelValue": o
2411
+ "model-value": unref(l),
2412
+ "onUpdate:modelValue": i
2398
2413
  }, null, 8, ["model-value"]),
2399
- e.helperText ? (openBlock(), createBlock(c, {
2414
+ e.helperText ? (openBlock(), createBlock(d, {
2400
2415
  key: 1,
2401
2416
  class: "!mt-[8px]",
2402
2417
  text: e.helperText,
@@ -2404,10 +2419,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2404
2419
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2405
2420
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
2406
2421
  createVNode(_sfc_main$m, {
2407
- "model-value": unref(s),
2408
- "onUpdate:modelValue": o
2422
+ "model-value": unref(l),
2423
+ "onUpdate:modelValue": i
2409
2424
  }, null, 8, ["model-value"]),
2410
- e.helperText ? (openBlock(), createBlock(c, {
2425
+ e.helperText ? (openBlock(), createBlock(d, {
2411
2426
  key: 0,
2412
2427
  class: "!mt-[8px]",
2413
2428
  text: e.helperText,
@@ -2415,10 +2430,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2415
2430
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2416
2431
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
2417
2432
  createVNode(_sfc_main$k, {
2418
- "model-value": unref(s),
2419
- "onUpdate:modelValue": o
2433
+ "model-value": unref(l),
2434
+ "onUpdate:modelValue": i
2420
2435
  }, null, 8, ["model-value"]),
2421
- e.helperText ? (openBlock(), createBlock(c, {
2436
+ e.helperText ? (openBlock(), createBlock(d, {
2422
2437
  key: 0,
2423
2438
  class: "!mt-[8px]",
2424
2439
  text: e.helperText,
@@ -2426,10 +2441,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2426
2441
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2427
2442
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
2428
2443
  createVNode(_sfc_main$l, {
2429
- "model-value": unref(s),
2430
- "onUpdate:modelValue": o
2444
+ "model-value": unref(l),
2445
+ "onUpdate:modelValue": i
2431
2446
  }, null, 8, ["model-value"]),
2432
- e.helperText ? (openBlock(), createBlock(c, {
2447
+ e.helperText ? (openBlock(), createBlock(d, {
2433
2448
  key: 0,
2434
2449
  class: "!mt-[8px]",
2435
2450
  text: e.helperText,
@@ -2437,19 +2452,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2437
2452
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2438
2453
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
2439
2454
  createVNode(_sfc_main$9, {
2440
- "model-value": unref(s),
2441
- "onUpdate:modelValue": o
2455
+ "model-value": unref(l),
2456
+ "onUpdate:modelValue": i
2442
2457
  }, null, 8, ["model-value"]),
2443
- e.helperText ? (openBlock(), createBlock(c, {
2458
+ e.helperText ? (openBlock(), createBlock(d, {
2444
2459
  key: 0,
2445
2460
  class: "!mt-[8px]",
2446
2461
  text: e.helperText,
2447
2462
  state: "error"
2448
2463
  }, null, 8, ["text"])) : createCommentVNode("", !0)
2449
- ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(n.field), 1));
2464
+ ], 64)) : (openBlock(), createElementBlock("pre", _hoisted_1$2, toDisplayString(u.field), 1));
2450
2465
  };
2451
2466
  }
2452
- }), _hoisted_1$1 = /* @__PURE__ */ createElementVNode("div", { class: "fm-typo-en-body-lg-600" }, "Campaign summary", -1), _hoisted_2$1 = /* @__PURE__ */ createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1), _hoisted_3$1 = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, _hoisted_4$1 = { class: "fm-typo-en-body-lg-600" }, _sfc_main$1 = /* @__PURE__ */ defineComponent({
2467
+ }), _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({
2453
2468
  __name: "CampaignSummary",
2454
2469
  props: {
2455
2470
  data: {
@@ -2458,22 +2473,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2458
2473
  }
2459
2474
  },
2460
2475
  setup(e) {
2461
- return (i, n) => {
2462
- const r = resolveComponent("FmCard");
2463
- return openBlock(), createBlock(r, {
2476
+ const { t: c, te: s } = useI18n();
2477
+ return (u, a) => {
2478
+ const i = resolveComponent("FmCard");
2479
+ return openBlock(), createBlock(i, {
2464
2480
  variant: "outlined",
2465
2481
  class: "p-16 space-y-8"
2466
2482
  }, {
2467
2483
  default: withCtx(() => [
2468
- _hoisted_1$1,
2469
- _hoisted_2$1,
2470
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, s) => (openBlock(), createElementBlock("div", {
2484
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(c)("connect.campaign.common.summary")), 1),
2485
+ a[0] || (a[0] = createElementVNode("div", { class: "h-[1px] bg-fm-color-neutral-gray-100 w-full" }, null, -1)),
2486
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
2471
2487
  class: "space-y-4",
2472
- key: s
2488
+ key: o
2473
2489
  }, [
2474
- o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2475
- createElementVNode("div", _hoisted_3$1, toDisplayString(s), 1),
2476
- createElementVNode("div", _hoisted_4$1, toDisplayString(o), 1)
2490
+ l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
2491
+ createElementVNode("div", _hoisted_2$1, toDisplayString(unref(c)(`${o}`)), 1),
2492
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(s)(`${l}`) ? unref(c)(`${l}`) : l), 1)
2477
2493
  ], 64)) : createCommentVNode("", !0)
2478
2494
  ]))), 128))
2479
2495
  ]),
@@ -2484,54 +2500,47 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2484
2500
  }), _hoisted_1 = { class: "xs:hidden px-24 pb-[14px] pt-[22px] flex items-center justify-between w-full border-b" }, _hoisted_2 = { class: "flex items-center gap-8" }, _hoisted_3 = {
2485
2501
  key: 0,
2486
2502
  class: "max-w-6xl mx-auto"
2487
- }, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _hoisted_12 = /* @__PURE__ */ createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2488
- /* @__PURE__ */ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2489
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2490
- /* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2491
- /* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
2492
- /* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2493
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2494
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2495
- ]),
2496
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2497
- ]),
2498
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2499
- /* @__PURE__ */ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2500
- /* @__PURE__ */ createElementVNode("div", { class: "space-y-3" }, [
2501
- /* @__PURE__ */ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2502
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2503
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2504
- ]),
2505
- /* @__PURE__ */ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2506
- ])
2507
- ])
2508
- ], -1), _sfc_main = /* @__PURE__ */ defineComponent({
2503
+ }, _hoisted_4 = { class: "hidden xs:flex gap-8 items-center w-full px-16 py-8 border-b border-fm-color-neutral-gray-100" }, _hoisted_5 = { class: "grid grid-cols-3 gap-40" }, _hoisted_6 = { class: "col-span-2 space-y-40 xs:col-span-3 xs:px-16 xs:pt-16" }, _hoisted_7 = { class: "fm-typo-en-title-sm-800 !mb-[-8px]" }, _hoisted_8 = { class: "w-full flex items-center justify-end gap-8 pb-24" }, _hoisted_9 = { class: "max-w-6xl mx-auto rounded-md p-4 w-full" }, _hoisted_10 = { class: "animate-pulse flex space-x-4 pt-16" }, _hoisted_11 = { class: "grid grid-cols-3 w-full gap-40" }, _sfc_main = /* @__PURE__ */ defineComponent({
2509
2504
  __name: "EditCampaignSheet",
2510
2505
  emits: ["submit:model-value"],
2511
2506
  setup(__props, { expose: __expose, emit: __emit }) {
2512
- const Dialog = useDialog(), sheetVisible = ref(!1), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2507
+ const Dialog = useDialog(), sheetVisible = ref(!1), { t } = useI18n(), currentStep = ref(1), data = ref(), schema = ref(z.any()), template = ref(
2513
2508
  TEMPLATES.VOUCHER
2514
2509
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
2515
2510
  async function showSheet(visible, type, campaign, selectedTemplate) {
2516
- var e, i;
2511
+ var e, c;
2517
2512
  if (sheetVisible.value = visible, visible == !0) {
2518
2513
  try {
2519
2514
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
2520
2515
  } catch {
2521
2516
  } finally {
2522
- await new Promise((n) => setTimeout(n, 120)), isLoading.value = !1;
2517
+ await new Promise((s) => setTimeout(s, 120)), isLoading.value = !1;
2523
2518
  }
2524
- template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2525
- ...(i = template.value) == null ? void 0 : i.defaultValue
2519
+ template.value = selectedTemplate ?? TEMPLATES[type], schema.value = CampaignDtos[type], type === "VOUCHER" && (await useCampaignStore().read(), schema.value = schema.value.superRefine((s, u) => {
2520
+ s.campaign.type === "VOUCHER" && s.campaign.code && useCampaignStore().campaigns.voucher.some(
2521
+ (a) => a.code === s.campaign.code
2522
+ ) && u.addIssue({
2523
+ code: "custom",
2524
+ message: "Code already exists, please use another code",
2525
+ path: ["campaign", "code"]
2526
+ });
2527
+ })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
2528
+ ...(c = template.value) == null ? void 0 : c.defaultValue
2526
2529
  }), "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`;
2527
2530
  }
2528
2531
  }
2529
2532
  async function hideSheet() {
2530
2533
  Dialog.open({
2531
- title: "Unsaved Changes",
2532
- message: "Are you sure you want to discard this changes?",
2533
- primaryActions: { text: "Discard", close: !0 },
2534
- secondaryActions: { text: "Cancel", close: !1 }
2534
+ title: t("connect.campaign.common.unsaved_changes"),
2535
+ message: t("connect.campaign.common.unsaved_changes"),
2536
+ primaryActions: {
2537
+ text: t("connect.campaign.common.unsaved_changes_confirm"),
2538
+ close: !0
2539
+ },
2540
+ secondaryActions: {
2541
+ text: t("connect.campaign.common.unsaved_changes_cancel"),
2542
+ close: !1
2543
+ }
2535
2544
  }).onPrimary(() => {
2536
2545
  sheetVisible.value = !1;
2537
2546
  }).onSecondary(() => {
@@ -2543,10 +2552,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2543
2552
  return e.success ? [] : e.error.errors;
2544
2553
  });
2545
2554
  function stepErrors(e = currentStep.value - 1) {
2546
- const i = template.value.steps[e].groups.flatMap(
2547
- (n) => n.fields.map((r) => r.property)
2555
+ const c = template.value.steps[e].groups.flatMap(
2556
+ (s) => s.fields.map((u) => u.property)
2548
2557
  );
2549
- return errors.value.filter((n) => i.includes(n.path.join(".")));
2558
+ return errors.value.filter((s) => c.includes(s.path.join(".")));
2550
2559
  }
2551
2560
  __expose({ showSheet });
2552
2561
  function showSummaryDialog() {
@@ -2558,9 +2567,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2558
2567
  }
2559
2568
  });
2560
2569
  }
2561
- function onUpdateProperty(e, i) {
2562
- if (_.set(data.value, e, i), e == "campaign.event.type") {
2563
- const n = RuleBuilder.setRuleToGroup(
2570
+ function onUpdateProperty(e, c) {
2571
+ if (_.set(data.value, e, c), e == "campaign.event.type") {
2572
+ const s = RuleBuilder.setRuleToGroup(
2564
2573
  RuleBuilder.scaffoldGroup(),
2565
2574
  [
2566
2575
  RuleBuilder.scaffoldGroup("g_schedule"),
@@ -2568,7 +2577,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2568
2577
  RuleBuilder.scaffoldGroup("g_user"),
2569
2578
  RuleBuilder.scaffoldGroup("g_bill")
2570
2579
  ]
2571
- ), r = RuleBuilder.setRuleToGroup(
2580
+ ), u = RuleBuilder.setRuleToGroup(
2572
2581
  RuleBuilder.scaffoldGroup("g_schedule"),
2573
2582
  [
2574
2583
  RuleBuilder.constructEntry(
@@ -2580,29 +2589,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2580
2589
  ],
2581
2590
  "&&"
2582
2591
  );
2583
- if (i != "SCHEDULE") {
2584
- _.set(data.value, "campaign.event.rule", n);
2592
+ if (c != "SCHEDULE") {
2593
+ _.set(data.value, "campaign.event.rule", s);
2585
2594
  return;
2586
2595
  }
2587
2596
  _.set(
2588
2597
  data.value,
2589
2598
  "campaign.event.rule",
2590
- RuleBuilder.setRuleToGroup(n, r)
2599
+ RuleBuilder.setRuleToGroup(s, u)
2591
2600
  );
2592
2601
  }
2593
- e == "campaign.notify" && i == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2602
+ e == "campaign.notify" && c == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
2594
2603
  }
2595
- async function onUpdateFile(e, i) {
2596
- return e ? await minor(async () => firebaseStorage.update(i, e), {
2604
+ async function onUpdateFile(e, c) {
2605
+ return e ? await minor(async () => firebaseStorage.update(c, e), {
2597
2606
  message: `${e ? "Uploading" : "Removing"} file`,
2598
2607
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2599
2608
  }) : "";
2600
2609
  }
2601
2610
  function isDisable(e) {
2602
- var i, n;
2611
+ var c, s;
2603
2612
  switch (e == null ? void 0 : e.property) {
2604
2613
  case "campaign.event.type":
2605
- return ((n = (i = data.value) == null ? void 0 : i.campaign) == null ? void 0 : n._id) || !1;
2614
+ return ((s = (c = data.value) == null ? void 0 : c.campaign) == null ? void 0 : s._id) || !1;
2606
2615
  default:
2607
2616
  return !1;
2608
2617
  }
@@ -2611,30 +2620,30 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2611
2620
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2612
2621
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2613
2622
  }
2614
- return (e, i) => {
2615
- const n = resolveComponent("FmButton"), r = resolveComponent("FmStep"), o = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2623
+ return (e, c) => {
2624
+ const s = resolveComponent("FmButton"), u = resolveComponent("FmStep"), a = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2616
2625
  return openBlock(), createBlock(l, {
2617
2626
  "fullscreen-size": "lg",
2618
2627
  modelValue: unref(sheetVisible),
2619
2628
  "onUpdate:modelValue": [
2620
- i[7] || (i[7] = (t) => isRef(sheetVisible) ? sheetVisible.value = t : null),
2621
- i[8] || (i[8] = (t) => sheetVisible.value = t)
2629
+ c[7] || (c[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2630
+ c[8] || (c[8] = (o) => sheetVisible.value = o)
2622
2631
  ]
2623
2632
  }, createSlots({
2624
2633
  "top-sheet-header": withCtx(() => [
2625
2634
  createElementVNode("div", _hoisted_1, [
2626
2635
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2627
2636
  createElementVNode("div", _hoisted_2, [
2628
- createVNode(n, {
2629
- onClick: i[0] || (i[0] = (t) => hideSheet()),
2630
- label: "Cancel",
2637
+ createVNode(s, {
2638
+ onClick: c[0] || (c[0] = (o) => hideSheet()),
2639
+ label: unref(t)("connect.campaign.common.cancel"),
2631
2640
  variant: "tertiary"
2632
- }),
2633
- createVNode(n, {
2641
+ }, null, 8, ["label"]),
2642
+ createVNode(s, {
2634
2643
  onClick: onSubmit,
2635
- label: "Save",
2644
+ label: unref(t)("connect.campaign.common.save"),
2636
2645
  disabled: unref(errors).length > 0
2637
- }, null, 8, ["disabled"])
2646
+ }, null, 8, ["label", "disabled"])
2638
2647
  ])
2639
2648
  ])
2640
2649
  ]),
@@ -2646,8 +2655,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2646
2655
  createElementVNode("div", _hoisted_9, [
2647
2656
  createElementVNode("div", _hoisted_10, [
2648
2657
  createElementVNode("div", _hoisted_11, [
2649
- _hoisted_12,
2650
- createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2658
+ c[9] || (c[9] = createElementVNode("div", { class: "col-span-2 space-y-80 xs:col-span-3 xs:px-16 xs:pt-16" }, [
2659
+ createElementVNode("div", { class: "flex-1 space-y-6 py-1" }, [
2660
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2661
+ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2662
+ createElementVNode("div", { class: "space-y-3" }, [
2663
+ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2664
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2665
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2666
+ ]),
2667
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2668
+ ]),
2669
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100 rounded" }),
2670
+ createElementVNode("div", { class: "h-[80px] bg-fm-color-neutral-gray-100 rounded" }),
2671
+ createElementVNode("div", { class: "space-y-3" }, [
2672
+ createElementVNode("div", { class: "grid grid-cols-2 gap-4" }, [
2673
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" }),
2674
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2675
+ ]),
2676
+ createElementVNode("div", { class: "h-32 bg-fm-color-neutral-gray-100" })
2677
+ ])
2678
+ ])
2679
+ ], -1)),
2680
+ createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2651
2681
  ])
2652
2682
  ])
2653
2683
  ])
@@ -2657,51 +2687,51 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2657
2687
  name: "default",
2658
2688
  fn: withCtx(() => [
2659
2689
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2660
- createVNode(o, {
2690
+ createVNode(a, {
2661
2691
  modelValue: unref(currentStep),
2662
- "onUpdate:modelValue": i[1] || (i[1] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2692
+ "onUpdate:modelValue": c[1] || (c[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2663
2693
  orientation: "horizontal",
2664
2694
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2665
2695
  }, {
2666
2696
  default: withCtx(() => [
2667
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2668
- key: t.name,
2669
- title: t.name,
2670
- value: a + 1,
2671
- error: () => stepErrors(a).length > 0,
2672
- complete: () => a + 1 <= unref(currentStep)
2697
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
2698
+ key: o.name,
2699
+ title: unref(t)(o.name),
2700
+ value: n + 1,
2701
+ error: () => stepErrors(n).length > 0,
2702
+ complete: () => n + 1 <= unref(currentStep)
2673
2703
  }, null, 8, ["title", "value", "error", "complete"]))), 128))
2674
2704
  ]),
2675
2705
  _: 1
2676
2706
  }, 8, ["modelValue"]),
2677
2707
  createElementVNode("div", _hoisted_4, [
2678
- createVNode(n, {
2708
+ createVNode(s, {
2679
2709
  icon: "close",
2680
2710
  variant: "tertiary",
2681
- onClick: i[2] || (i[2] = (t) => sheetVisible.value = !1)
2711
+ onClick: c[2] || (c[2] = (o) => sheetVisible.value = !1)
2682
2712
  }),
2683
- createVNode(o, {
2713
+ createVNode(a, {
2684
2714
  modelValue: unref(currentStep),
2685
- "onUpdate:modelValue": i[3] || (i[3] = (t) => isRef(currentStep) ? currentStep.value = t : null),
2715
+ "onUpdate:modelValue": c[3] || (c[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2686
2716
  orientation: "horizontal",
2687
2717
  class: "flex-1"
2688
2718
  }, {
2689
2719
  default: withCtx(() => [
2690
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (t, a) => (openBlock(), createBlock(r, {
2691
- key: t.name,
2720
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(u, {
2721
+ key: o.name,
2692
2722
  title: unref(sheetTitle),
2693
- description: t.name,
2694
- value: a + 1,
2695
- error: () => stepErrors(a).length > 0,
2696
- complete: () => a + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2723
+ description: o.name,
2724
+ value: n + 1,
2725
+ error: () => stepErrors(n).length > 0,
2726
+ complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
2697
2727
  }, null, 8, ["title", "description", "value", "error", "complete"]))), 128))
2698
2728
  ]),
2699
2729
  _: 1
2700
2730
  }, 8, ["modelValue"]),
2701
- createVNode(n, {
2731
+ createVNode(s, {
2702
2732
  icon: "info",
2703
2733
  variant: "tertiary",
2704
- onClick: i[4] || (i[4] = () => showSummaryDialog())
2734
+ onClick: c[4] || (c[4] = () => showSummaryDialog())
2705
2735
  })
2706
2736
  ]),
2707
2737
  createElementVNode("div", _hoisted_5, [
@@ -2710,53 +2740,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2710
2740
  json: {
2711
2741
  data: unref(data),
2712
2742
  errors: unref(errors).map(
2713
- (t) => `${t.path.join(".")} - ${t.message}`
2743
+ (o) => `${o.path.join(".")} - ${o.message}`
2714
2744
  ),
2715
2745
  stepErrors: stepErrors().map(
2716
- (t) => `${t.path.join(".")} - ${t.message}`
2746
+ (o) => `${o.path.join(".")} - ${o.message}`
2717
2747
  ),
2718
2748
  schema: unref(schema)
2719
2749
  }
2720
2750
  }, null, 8, ["json"]),
2721
2751
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2722
- (t) => t.fields.length && (!t.condition || unref(_).get(unref(data), t.condition.property) == t.condition.value == (t.condition.not != !0))
2723
- ), (t, a) => (openBlock(), createElementBlock("div", {
2724
- key: a,
2752
+ (o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
2753
+ ), (o, n) => (openBlock(), createElementBlock("div", {
2754
+ key: n,
2725
2755
  class: "space-y-24"
2726
2756
  }, [
2727
- createElementVNode("div", _hoisted_7, toDisplayString(t.name), 1),
2728
- (openBlock(!0), createElementBlock(Fragment, null, renderList(t.fields, (f, v) => (openBlock(), createElementBlock("div", { key: v }, [
2757
+ createElementVNode("div", _hoisted_7, toDisplayString(unref(t)(o.name)), 1),
2758
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (p, h) => (openBlock(), createElementBlock("div", { key: h }, [
2729
2759
  (openBlock(), createBlock(_sfc_main$2, {
2730
- key: v,
2731
- field: f,
2732
- modelValue: unref(_).get(unref(data), f.property),
2733
- disabled: isDisable(f),
2734
- "onUpdate:modelValue": (m) => onUpdateProperty(f.property, m),
2735
- "onUpdate:file": async (m, g) => {
2736
- const c = await onUpdateFile(m, g);
2737
- onUpdateProperty(f.property, c || "");
2760
+ key: h,
2761
+ field: p,
2762
+ modelValue: unref(_).get(unref(data), p.property),
2763
+ disabled: isDisable(p),
2764
+ "onUpdate:modelValue": (y) => onUpdateProperty(p.property, y),
2765
+ "onUpdate:file": async (y, g) => {
2766
+ const V = await onUpdateFile(y, g);
2767
+ onUpdateProperty(p.property, V || "");
2738
2768
  },
2739
2769
  schema: unref(ZodHelper).typeAtPath(
2740
2770
  unref(schema),
2741
- f.property,
2771
+ p.property,
2742
2772
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2743
2773
  ),
2744
- "helper-text": unref(ZodHelper).helperText(unref(errors), f.property),
2745
- extras: f.extras != null ? f.extras == "" ? unref(data) : unref(_).get(unref(data), f.extras) : void 0
2746
- }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-text", "extras"]))
2774
+ "helper-state": unref(ZodHelper).helperState(unref(errors), p.property),
2775
+ "helper-text": unref(ZodHelper).helperText(unref(errors), p.property),
2776
+ extras: p.extras != null ? p.extras == "" ? unref(data) : unref(_).get(unref(data), p.extras) : void 0
2777
+ }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
2747
2778
  ]))), 128))
2748
2779
  ]))), 128)),
2749
2780
  createElementVNode("div", _hoisted_8, [
2750
- createVNode(n, {
2781
+ createVNode(s, {
2751
2782
  label: "Back",
2752
2783
  variant: "tertiary",
2753
2784
  disabled: unref(currentStep) == 1,
2754
- onClick: i[5] || (i[5] = (t) => currentStep.value--)
2785
+ onClick: c[5] || (c[5] = (o) => currentStep.value--)
2755
2786
  }, null, 8, ["disabled"]),
2756
- createVNode(n, {
2787
+ createVNode(s, {
2757
2788
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2758
2789
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2759
- onClick: i[6] || (i[6] = (t) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2790
+ onClick: c[6] || (c[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2760
2791
  }, null, 8, ["disabled", "label"])
2761
2792
  ])
2762
2793
  ]),