@feedmepos/mf-connect 0.1.0-beta.9 → 0.1.0-prod

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