@feedmepos/mf-connect 0.1.28-prod → 0.1.30-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 (86) hide show
  1. package/dist/{Analytic-2fPCInDE.js → Analytic-C_uRY3I5.js} +11 -11
  2. package/dist/{App-BJlRD4KH.js → App-zOAwWGz6.js} +6 -6
  3. package/dist/{Bin-DWd2_II3.js → Bin-CePm_uVx.js} +8 -8
  4. package/dist/{Broadcast-DTbF5YQn.js → Broadcast-BcRSoknR.js} +9 -9
  5. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-TIRZoc43.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-5StwY5c9.js} +6 -6
  6. package/dist/{Card-BUGQEdCK.js → Card-Dmyxmub5.js} +207 -199
  7. package/dist/{Collections-BjomDHYg.js → Collections-DiV_e9h-.js} +6 -6
  8. package/dist/{Credit-BUK4Aw0m.js → Credit-CkGdHhn2.js} +9 -9
  9. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-gWvjwFiR.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-SulDMna0.js} +458 -458
  10. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DvTrxSnL.js → EffectSheet.vue_vue_type_style_index_0_lang-CSY1HXaL.js} +6 -6
  11. package/dist/{Experience-DsQIdK9t.js → Experience-DjsOWpa9.js} +9 -9
  12. package/dist/{Game-BLbN3Z6v.js → Game-2_J99uIX.js} +10 -10
  13. package/dist/{Index-CzIILYvi.js → Index-a1eFJ8i1.js} +10 -10
  14. package/dist/{Marketing-xoRpWZfv.js → Marketing-Clz0CYrY.js} +6 -6
  15. package/dist/{Member-DInHHwad.js → Member-TNxdgh6i.js} +5 -5
  16. package/dist/{MemberList-DF8tkFDT.js → MemberList-D-5IP783.js} +28 -25
  17. package/dist/{MemberTransactions-C-pbBsve.js → MemberTransactions-B7D_qrLX.js} +1 -1
  18. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CHq9xXiP.js → MessageInput.vue_vue_type_script_setup_true_lang-XhbiT524.js} +3 -3
  19. package/dist/{Mission-BAxHgOAl.js → Mission-B7UVVT1j.js} +10 -10
  20. package/dist/{Overview-BWyUMlCT.js → Overview-BfZuRgE-.js} +17 -17
  21. package/dist/{Point-CGzCftO5.js → Point-MGLwWD4B.js} +9 -9
  22. package/dist/{Promotion-BHB6CTXq.js → Promotion-BrhYslNt.js} +10 -10
  23. package/dist/{Queue-BMqt4siy.js → Queue-Bz160bZx.js} +9 -9
  24. package/dist/{Record-DisW68Yh.js → Record-DrpOYO01.js} +7 -7
  25. package/dist/{Reward-C7XavzIk.js → Reward-ClX3C1Sp.js} +15 -15
  26. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BYknroSK.js → RewardGroup.vue_vue_type_script_setup_true_lang-0L9iBoC4.js} +11 -11
  27. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-D_-qtGyk.js → RuleGroup.vue_vue_type_script_setup_true_lang-BlCyumkR.js} +12 -12
  28. package/dist/{Segment-Cam05pCr.js → Segment-OY9qUZnY.js} +14 -14
  29. package/dist/{SelectItems.vue_vue_type_script_setup_true_lang-b4AoknE_.js → SelectItems.vue_vue_type_script_setup_true_lang-D5eLqSso.js} +2 -2
  30. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-BqssLYLl.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-Cb3yPiSc.js} +11 -11
  31. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Evq0vBoE.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B_RBF59b.js} +3 -3
  32. package/dist/{Setting-DliMpeMz.js → Setting-CgRON4iT.js} +10 -10
  33. package/dist/{Store-Cgkw-xg6.js → Store-BGbO2NeC.js} +18 -18
  34. package/dist/{StoreRewards-Dfo00Fc6.js → StoreRewards-DyCWcVsT.js} +14 -14
  35. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DK4q2v-U.js → StoreTransactions.vue_vue_type_script_setup_true_lang-ePVWe6Kb.js} +17 -17
  36. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-CiApy4Rx.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DLQOZH-k.js} +1 -1
  37. package/dist/{Tier-CkZhMC3f.js → Tier-B7LRmyHJ.js} +19 -19
  38. package/dist/{Title-DXtRRsGh.js → Title-DrQaQ7ew.js} +19 -19
  39. package/dist/{Transaction-BALNjNz6.js → Transaction-B2M_gPhT.js} +2 -2
  40. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DhTilYic.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bc8cnLBQ.js} +6 -6
  41. package/dist/{Voucher-C4AN27lq.js → Voucher-BcVMrpOm.js} +12 -12
  42. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DT-iQjFb.js → VoucherEditor.vue_vue_type_script_setup_true_lang-DIfHJ6Sw.js} +10 -10
  43. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BmtZwFSs.js → ZodTextField.vue_vue_type_script_setup_true_lang-DfinebCV.js} +1 -1
  44. package/dist/{app-CrWyzn6D.js → app-BXGrI0oQ.js} +1 -1
  45. package/dist/{app-Cex8lJkz.js → app-Sjl26OK7.js} +30 -30
  46. package/dist/app.js +1 -1
  47. package/dist/{business-B41gNDWn.js → business-ICKi8JNz.js} +1 -1
  48. package/dist/{campaign-DyRorn8y.js → campaign-AiWYrbax.js} +9 -9
  49. package/dist/{campaign-D8Jb8Mcs.js → campaign-BExdhFR9.js} +2 -2
  50. package/dist/{campaign.enum-D1WvicXa.js → campaign.enum-WEt42FO9.js} +1 -1
  51. package/dist/{campaign.fn-WZL8m77q.js → campaign.fn-CHQ63XNa.js} +135 -135
  52. package/dist/{collectible.enum-2SqtWORg.js → collectible.enum-DFaOnC3D.js} +1 -1
  53. package/dist/{collection.fn-BGBiIa3-.js → collection.fn-B3XEjDdU.js} +2 -2
  54. package/dist/{dto-CziQ3YR8.js → dto-B09V82Pa.js} +4 -4
  55. package/dist/{effect-DOhxTMbD.js → effect-CUcku1wp.js} +1 -1
  56. package/dist/{email-addresses-B2-IyW9d.js → email-addresses-CSpdONTz.js} +1 -1
  57. package/dist/{export-DijV-thU.js → export-DJfDtT62.js} +3 -3
  58. package/dist/{helper-DZ475418.js → helper-CbSsYPpI.js} +1 -1
  59. package/dist/{index-JaOBn64e.js → index-B3HoKsL8.js} +1 -1
  60. package/dist/{index-DqsQDq21.js → index-BSTUrmqB.js} +6 -6
  61. package/dist/{index-DgyH5BiA.js → index-BaR_Lcm6.js} +1 -1
  62. package/dist/{index-BhF5Q6I1.js → index-C1wvmxnj.js} +1 -1
  63. package/dist/{index-D2q6nQsP.js → index-C_bBUep_.js} +5 -5
  64. package/dist/{index-gfPyiFc5.js → index-Clj1WSBs.js} +3 -3
  65. package/dist/{index-CDc5NEE9.js → index-D98bOypJ.js} +1 -1
  66. package/dist/{index-vy13Kvq1.js → index-DLsHC8RI.js} +1 -1
  67. package/dist/{index-mHvARg87.js → index-DeYzI7Ad.js} +2 -2
  68. package/dist/{index-vThFTWos.js → index-DsmYdmgu.js} +1 -1
  69. package/dist/{index-BjzAAlhX.js → index-QyxsXvZB.js} +3 -3
  70. package/dist/{index-BHnFFWRj.js → index-ZQcFToUw.js} +1 -1
  71. package/dist/{index.esm2017-DrOnmEcN.js → index.esm2017-D0ExClUr.js} +1 -1
  72. package/dist/{loading-B090b_ce.js → loading-BPPrnQNO.js} +1 -1
  73. package/dist/{membership-BnjHoHZJ.js → membership-XRsihZq0.js} +3 -3
  74. package/dist/{money-D-ZRd8_2.js → money-hdSAgWNM.js} +1 -1
  75. package/dist/{number-cKAn8ky6.js → number-DYeV4NB_.js} +1 -1
  76. package/dist/{objectid-C5bLDGr_.js → objectid-CC8rUDIT.js} +5 -5
  77. package/dist/{plugins-CyX08GLM.js → plugins-BZn2aS9v.js} +4 -4
  78. package/dist/{reward-Dg-9sn2_.js → reward-6Gs4Tj0g.js} +1 -1
  79. package/dist/{rule-Bnl3DQZ7.js → rule-BRP3Seyh.js} +3 -3
  80. package/dist/{rule-builder-B75aU3HN.js → rule-builder-C7d79jSS.js} +1 -1
  81. package/dist/{template-CMSQsYm3.js → template-B0NSZx7m.js} +4 -4
  82. package/dist/{trigger-BkZU9Cr9.js → trigger-B5-fD0op.js} +4 -4
  83. package/dist/{user-DR35Lmlo.js → user-t4f-8zfV.js} +1 -1
  84. package/dist/{vue-i18n-B4XGvfnw.js → vue-i18n-Byc8euZx.js} +232 -232
  85. package/dist/{xlsx-C15yLkMd.js → xlsx-C_z356In.js} +1 -1
  86. package/package.json +1 -1
@@ -1,40 +1,40 @@
1
1
  import { defineComponent, ref, watch, resolveComponent, openBlock, createElementBlock, createVNode, unref, isRef, withCtx, createBlock, createCommentVNode, computed, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, toRefs, normalizeStyle, resolveDynamicComponent, createSlots } from "vue";
2
2
  import { _ } from "./lodash-B5I3zXaY.js";
3
- import { z } from "./app-Cex8lJkz.js";
3
+ import { z } from "./app-Sjl26OK7.js";
4
4
  import { Z as ZodHelper } from "./zod-Bg2FbC-D.js";
5
- import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-DyRorn8y.js";
6
- import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-CziQ3YR8.js";
7
- import { u as useMembershipStore } from "./membership-BnjHoHZJ.js";
8
- import { u as useBusinessStore } from "./business-B41gNDWn.js";
9
- import "./index-mHvARg87.js";
10
- import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-B75aU3HN.js";
5
+ import { c as getCampaignSummaryObject, C as CampaignOptions } from "./campaign-AiWYrbax.js";
6
+ import { c as campaignRefinement, C as CampaignDtos, a as campaignTransform } from "./dto-B09V82Pa.js";
7
+ import { u as useMembershipStore } from "./membership-XRsihZq0.js";
8
+ import { u as useBusinessStore } from "./business-ICKi8JNz.js";
9
+ import "./index-DeYzI7Ad.js";
10
+ import { R as RuleBuilder, a as isRuleEntry } from "./rule-builder-C7d79jSS.js";
11
11
  import { J as JsonViewer } from "./JsonViewer-v8_C7l5N.js";
12
12
  import { h as hooks } from "./moment-BWErdI6_.js";
13
- import { f as featureVersionMapping } from "./campaign.enum-D1WvicXa.js";
13
+ import { f as featureVersionMapping } from "./campaign.enum-WEt42FO9.js";
14
14
  import { _ as _sfc_main$o } from "./ImageInput.vue_vue_type_script_setup_true_lang-ByhTB9Ie.js";
15
- import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-DvTrxSnL.js";
16
- import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-CiApy4Rx.js";
17
- import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-DhTilYic.js";
18
- import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-D_-qtGyk.js";
19
- import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-CyX08GLM.js";
20
- import { u as useI18n } from "./vue-i18n-B4XGvfnw.js";
21
- import { b as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-BkZU9Cr9.js";
22
- import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-CHq9xXiP.js";
23
- import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-Bnl3DQZ7.js";
24
- import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DT-iQjFb.js";
25
- import { s as FdoCreditLoyaltyReward, t as FdtoRandomReward, u as F_MISSION_TYPE, v as FdoThresholdCreditReward, w as FdtoThresholdReward, x as FdoMission } from "./index-D2q6nQsP.js";
26
- import { T as TEMPLATES } from "./index-DqsQDq21.js";
27
- import "./index-vy13Kvq1.js";
28
- import "./index-BjzAAlhX.js";
29
- import { a as F_GAME_TYPE } from "./collectible.enum-2SqtWORg.js";
15
+ import { b as _sfc_main$m, a as _sfc_main$p, _ as _sfc_main$r } from "./EffectSheet.vue_vue_type_style_index_0_lang-CSY1HXaL.js";
16
+ import { _ as _sfc_main$q } from "./TargetLocationInput.vue_vue_type_script_setup_true_lang-DLQOZH-k.js";
17
+ import { _ as _sfc_main$t } from "./UserRuleGroup.vue_vue_type_script_setup_true_lang-Bc8cnLBQ.js";
18
+ import { _ as _sfc_main$j, a as _sfc_main$k } from "./RuleGroup.vue_vue_type_script_setup_true_lang-BlCyumkR.js";
19
+ import { p as prompt, c as cases, f as firebaseStorage } from "./plugins-BZn2aS9v.js";
20
+ import { u as useI18n } from "./vue-i18n-Byc8euZx.js";
21
+ import { b as TypeToTriggerOptions, _ as _sfc_main$u, a as _sfc_main$v } from "./trigger-B5-fD0op.js";
22
+ import { _ as _sfc_main$s } from "./MessageInput.vue_vue_type_script_setup_true_lang-XhbiT524.js";
23
+ import { c as calculateNextScheduleAt, S as SummarizeRrule, R as RRule } from "./rule-BRP3Seyh.js";
24
+ import { _ as _sfc_main$l, a as _sfc_main$n } from "./VoucherEditor.vue_vue_type_script_setup_true_lang-DIfHJ6Sw.js";
25
+ import { s as FdoCreditLoyaltyReward, t as FdtoRandomReward, u as F_MISSION_TYPE, v as FdoThresholdCreditReward, w as FdtoThresholdReward, x as FdoMission } from "./index-C_bBUep_.js";
26
+ import { T as TEMPLATES } from "./index-BSTUrmqB.js";
27
+ import "./index-DLsHC8RI.js";
28
+ import "./index-QyxsXvZB.js";
29
+ import { a as F_GAME_TYPE } from "./collectible.enum-DFaOnC3D.js";
30
30
  import { useCoreStore } from "@feedmepos/mf-common";
31
- import { u as useLoading } from "./loading-B090b_ce.js";
32
- import { i as initCollectibleConfig } from "./helper-DZ475418.js";
33
- import { C as CollectionUtils } from "./collection.fn-BGBiIa3-.js";
31
+ import { u as useLoading } from "./loading-BPPrnQNO.js";
32
+ import { i as initCollectibleConfig } from "./helper-CbSsYPpI.js";
33
+ import { C as CollectionUtils } from "./collection.fn-B3XEjDdU.js";
34
34
  import { s as sentenceCase$1 } from "./index-CuvNtC_M.js";
35
35
  import { useDialog } from "@feedmepos/ui-library";
36
- import { u as useCampaignStore } from "./campaign-D8Jb8Mcs.js";
37
- import { S as SvcConfig } from "./index-gfPyiFc5.js";
36
+ import { u as useCampaignStore } from "./campaign-BExdhFR9.js";
37
+ import { S as SvcConfig } from "./index-Clj1WSBs.js";
38
38
  import { a as cleanPF } from "./object-qECH92oz.js";
39
39
  const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defineComponent({
40
40
  __name: "TimeRuleGroup",
@@ -46,13 +46,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
46
46
  }
47
47
  },
48
48
  emits: ["update:model-value"],
49
- setup(e, { emit: d }) {
50
- const { t: a } = useI18n(), r = e, u = d, i = ref(
49
+ setup(e, { emit: c }) {
50
+ const { t: a } = useI18n(), r = e, u = c, s = ref(
51
51
  !r.modelValue || !r.modelValue.rules.g_time ? "all_time" : RuleBuilder.getRules(r.modelValue.rules.g_time).length > 0 ? "custom" : "all_time"
52
52
  );
53
- watch(i, async (o, n) => {
54
- var c;
55
- if (n == "custom" && o == "all_time" && RuleBuilder.getRules((c = r.modelValue) == null ? void 0 : c.rules.g_time).length > 0) {
53
+ watch(s, async (l, n) => {
54
+ var d;
55
+ if (n == "custom" && l == "all_time" && RuleBuilder.getRules((d = r.modelValue) == null ? void 0 : d.rules.g_time).length > 0) {
56
56
  const g = await prompt.confirm(
57
57
  a("connect.template.rule.time.confirm_remove"),
58
58
  a("connect.common.confirm"),
@@ -65,19 +65,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
65
65
  r.modelValue ?? RuleBuilder.scaffoldGroup(),
66
66
  RuleBuilder.scaffoldGroup("g_time")
67
67
  )
68
- ), i.value = g ? o : n;
68
+ ), s.value = g ? l : n;
69
69
  }
70
70
  });
71
- async function l(o) {
71
+ async function o(l) {
72
72
  var n;
73
- if (o == "custom" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
73
+ if (l == "custom" && RuleBuilder.getRules((n = r.modelValue) == null ? void 0 : n.rules.g_time).length > 0) {
74
74
  if (!await prompt.confirm(
75
75
  a("connect.template.rule.time.confirm_remove"),
76
76
  a("connect.common.confirm"),
77
77
  a("connect.common.confirm"),
78
78
  a("connect.common.cancel")
79
79
  )) {
80
- i.value = "all_time";
80
+ s.value = "all_time";
81
81
  return;
82
82
  }
83
83
  u(
@@ -89,30 +89,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
89
89
  );
90
90
  }
91
91
  }
92
- return (o, n) => {
92
+ return (l, n) => {
93
93
  var y;
94
- const c = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
94
+ const d = resolveComponent("FmRadio"), g = resolveComponent("FmRadioGroup");
95
95
  return openBlock(), createElementBlock("div", _hoisted_1$g, [
96
96
  createVNode(g, {
97
- modelValue: unref(i),
97
+ modelValue: unref(s),
98
98
  "onUpdate:modelValue": [
99
- n[0] || (n[0] = (v) => isRef(i) ? i.value = v : null),
100
- n[1] || (n[1] = (v) => l(v))
99
+ n[0] || (n[0] = (v) => isRef(s) ? s.value = v : null),
100
+ n[1] || (n[1] = (v) => o(v))
101
101
  ]
102
102
  }, {
103
103
  default: withCtx(() => [
104
- createVNode(c, {
104
+ createVNode(d, {
105
105
  label: unref(a)("connect.template.rule.time.all_time"),
106
106
  value: "all_time"
107
107
  }, null, 8, ["label"]),
108
- createVNode(c, {
108
+ createVNode(d, {
109
109
  label: unref(a)("connect.template.rule.time.custom"),
110
110
  value: "custom"
111
111
  }, null, 8, ["label"])
112
112
  ]),
113
113
  _: 1
114
114
  }, 8, ["modelValue"]),
115
- unref(i) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
115
+ unref(s) == "custom" ? (openBlock(), createBlock(_sfc_main$j, {
116
116
  key: 0,
117
117
  class: "!mt-[0px]",
118
118
  "include-only": "trigger",
@@ -138,28 +138,28 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
138
138
  }
139
139
  },
140
140
  emits: ["update:model-value"],
141
- setup(e, { emit: d }) {
142
- const a = e, r = d, u = computed(() => {
143
- const { property: i, operator: l, equator: o } = RuleBuilder.simplify(
141
+ setup(e, { emit: c }) {
142
+ const a = e, r = c, u = computed(() => {
143
+ const { property: s, operator: o, equator: l } = RuleBuilder.simplify(
144
144
  a.modelValue ?? RuleBuilder.constructEntry("user.birthday", "_isDay", {
145
145
  op: "before",
146
146
  x: 1
147
147
  })
148
148
  );
149
149
  return {
150
- property: i,
151
- operator: l,
152
- equator: o
150
+ property: s,
151
+ operator: o,
152
+ equator: l
153
153
  };
154
154
  });
155
- return (i, l) => {
156
- const o = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
155
+ return (s, o) => {
156
+ const l = resolveComponent("FmRadio"), n = resolveComponent("FmStepperField");
157
157
  return openBlock(), createElementBlock("div", null, [
158
- createVNode(o, {
158
+ createVNode(l, {
159
159
  label: "On birthday",
160
160
  value: "_isRange-day",
161
161
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
162
- "onUpdate:modelValue": l[0] || (l[0] = () => {
162
+ "onUpdate:modelValue": o[0] || (o[0] = () => {
163
163
  r(
164
164
  "update:model-value",
165
165
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
@@ -170,11 +170,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
170
170
  );
171
171
  })
172
172
  }, null, 8, ["model-value"]),
173
- createVNode(o, {
173
+ createVNode(l, {
174
174
  label: "N days before birthday",
175
175
  value: "_isDay",
176
176
  "model-value": unref(u).operator,
177
- "onUpdate:modelValue": l[1] || (l[1] = () => {
177
+ "onUpdate:modelValue": o[1] || (o[1] = () => {
178
178
  r(
179
179
  "update:model-value",
180
180
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
@@ -190,20 +190,20 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
190
190
  label: "Days before birthday",
191
191
  "show-steppers": !1,
192
192
  "model-value": unref(u).equator.x,
193
- "onUpdate:modelValue": l[2] || (l[2] = (c) => r(
193
+ "onUpdate:modelValue": o[2] || (o[2] = (d) => r(
194
194
  "update:model-value",
195
195
  unref(RuleBuilder).constructEntry("user.birthday", "_isDay", {
196
196
  op: "after",
197
- x: c,
197
+ x: d,
198
198
  ignoreYear: !0
199
199
  })
200
200
  ))
201
201
  }, null, 8, ["model-value"])) : createCommentVNode("", !0),
202
- createVNode(o, {
202
+ createVNode(l, {
203
203
  label: "In birthday week",
204
204
  value: "_isRange-week",
205
205
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
206
- "onUpdate:modelValue": l[3] || (l[3] = () => {
206
+ "onUpdate:modelValue": o[3] || (o[3] = () => {
207
207
  r(
208
208
  "update:model-value",
209
209
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
@@ -214,11 +214,11 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
214
214
  );
215
215
  })
216
216
  }, null, 8, ["model-value"]),
217
- createVNode(o, {
217
+ createVNode(l, {
218
218
  label: "In birthday month",
219
219
  value: "_isRange-month",
220
220
  "model-value": `${unref(u).operator}-${unref(u).equator.unit}`,
221
- "onUpdate:modelValue": l[4] || (l[4] = () => {
221
+ "onUpdate:modelValue": o[4] || (o[4] = () => {
222
222
  r(
223
223
  "update:model-value",
224
224
  unref(RuleBuilder).constructEntry("user.birthday", "_isRange", {
@@ -248,16 +248,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
248
248
  }
249
249
  },
250
250
  emits: ["update:model-value"],
251
- setup(e, { emit: d }) {
252
- const a = e, r = d, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
253
- (i) => i.value == a.modelValue
251
+ setup(e, { emit: c }) {
252
+ const a = e, r = c, u = computed(() => a.disabled ? TypeToTriggerOptions[a.campaignType].filter(
253
+ (s) => s.value == a.modelValue
254
254
  ) : TypeToTriggerOptions[a.campaignType]);
255
- return (i, l) => {
256
- const o = resolveComponent("FmCard");
255
+ return (s, o) => {
256
+ const l = resolveComponent("FmCard");
257
257
  return openBlock(), createElementBlock("div", _hoisted_1$f, [
258
258
  _hoisted_2$e,
259
259
  createElementVNode("div", _hoisted_3$c, [
260
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
260
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
261
261
  variant: "outlined",
262
262
  disabled: a.disabled,
263
263
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
@@ -293,27 +293,27 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
293
293
  }
294
294
  },
295
295
  emits: ["update:model-value"],
296
- setup(e, { emit: d }) {
297
- const a = d;
296
+ setup(e, { emit: c }) {
297
+ const a = c;
298
298
  return (r, u) => {
299
- const i = resolveComponent("FmButton"), l = resolveComponent("FmField"), o = resolveComponent("FmDatePicker");
300
- return openBlock(), createBlock(o, {
299
+ const s = resolveComponent("FmButton"), o = resolveComponent("FmField"), l = resolveComponent("FmDatePicker");
300
+ return openBlock(), createBlock(l, {
301
301
  label: e.label,
302
302
  "model-value": e.modelValue || "",
303
303
  "onUpdate:modelValue": u[1] || (u[1] = (n) => a("update:model-value", n))
304
304
  }, {
305
305
  "trigger-button": withCtx(({ opened: n }) => [
306
- createVNode(l, {
306
+ createVNode(o, {
307
307
  class: "flex items-center",
308
308
  "prepend-icon": "calendar_month",
309
309
  "icon-outlined": !n
310
310
  }, {
311
311
  append: withCtx(() => [
312
- e.modelValue ? (openBlock(), createBlock(i, {
312
+ e.modelValue ? (openBlock(), createBlock(s, {
313
313
  key: 0,
314
314
  variant: "tertiary",
315
315
  icon: "clear",
316
- onClick: u[0] || (u[0] = (c) => (c.stopPropagation(), a("update:model-value", null)))
316
+ onClick: u[0] || (u[0] = (d) => (d.stopPropagation(), a("update:model-value", null)))
317
317
  })) : createCommentVNode("", !0)
318
318
  ]),
319
319
  default: withCtx(() => [
@@ -337,19 +337,19 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
337
337
  }
338
338
  },
339
339
  emits: ["update:model-value"],
340
- setup(e, { emit: d }) {
341
- const a = d;
340
+ setup(e, { emit: c }) {
341
+ const a = c;
342
342
  return (r, u) => {
343
- var i, l;
343
+ var s, o;
344
344
  return openBlock(), createElementBlock("div", _hoisted_1$e, [
345
345
  createElementVNode("div", _hoisted_2$d, [
346
346
  createVNode(_sfc_main$f, {
347
- "model-value": ((i = e.modelValue) == null ? void 0 : i.startDate) ?? null,
347
+ "model-value": ((s = e.modelValue) == null ? void 0 : s.startDate) ?? null,
348
348
  label: "Start date",
349
- "onUpdate:modelValue": u[0] || (u[0] = (o) => {
349
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => {
350
350
  var n;
351
351
  return a("update:model-value", {
352
- startDate: o,
352
+ startDate: l,
353
353
  endDate: ((n = e.modelValue) == null ? void 0 : n.endDate) ?? null
354
354
  });
355
355
  })
@@ -358,13 +358,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
358
358
  _hoisted_3$b,
359
359
  createElementVNode("div", _hoisted_4$a, [
360
360
  createVNode(_sfc_main$f, {
361
- "model-value": ((l = e.modelValue) == null ? void 0 : l.endDate) ?? null,
361
+ "model-value": ((o = e.modelValue) == null ? void 0 : o.endDate) ?? null,
362
362
  label: "End date",
363
- "onUpdate:modelValue": u[1] || (u[1] = (o) => {
363
+ "onUpdate:modelValue": u[1] || (u[1] = (l) => {
364
364
  var n;
365
365
  return a("update:model-value", {
366
366
  startDate: ((n = e.modelValue) == null ? void 0 : n.startDate) ?? null,
367
- endDate: o
367
+ endDate: l
368
368
  });
369
369
  })
370
370
  }, null, 8, ["model-value"])
@@ -390,15 +390,15 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
390
390
  }
391
391
  },
392
392
  emits: ["update:model-value"],
393
- setup(e, { emit: d }) {
394
- const a = e, r = d;
393
+ setup(e, { emit: c }) {
394
+ const a = e, r = c;
395
395
  function u() {
396
396
  const y = RuleBuilder.getRules(a.modelValue);
397
397
  return y.length == 0 ? "fixed" : y.some(
398
398
  (v) => isRuleEntry(v) && RuleBuilder.simplify(v).operator == "_rrule"
399
399
  ) ? "repeating" : "fixed";
400
400
  }
401
- const i = ref(u()), l = ref(!1), o = computed(() => {
401
+ const s = ref(u()), o = ref(!1), l = computed(() => {
402
402
  const y = RuleBuilder.getRules(a.modelValue), v = y.find(
403
403
  (p) => isRuleEntry(p) && RuleBuilder.simplify(p).property == "trigger.date"
404
404
  ), h = y.find(
@@ -416,7 +416,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
416
416
  a.endDate ? new Date(a.endDate) : void 0
417
417
  )
418
418
  );
419
- function c(y) {
419
+ function d(y) {
420
420
  const v = y.label.toLowerCase(), h = v == "fixed" ? [
421
421
  RuleBuilder.constructEntry(
422
422
  "trigger.date",
@@ -438,10 +438,10 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
438
438
  RuleBuilder.scaffoldGroup("g_schedule"),
439
439
  h
440
440
  )
441
- ), i.value = v;
441
+ ), s.value = v;
442
442
  }
443
443
  function g(y) {
444
- i.value == "fixed" ? r(
444
+ s.value == "fixed" ? r(
445
445
  "update:model-value",
446
446
  RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup("g_schedule"), [
447
447
  RuleBuilder.constructEntry(
@@ -472,33 +472,33 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
472
472
  );
473
473
  }
474
474
  return (y, v) => {
475
- const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), s = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), m = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
475
+ const h = resolveComponent("FmButtonGroup"), p = resolveComponent("FmTimePicker"), i = resolveComponent("FmIcon"), f = resolveComponent("FmTooltip"), m = resolveComponent("FmField"), b = resolveComponent("FmCard"), x = resolveComponent("FmPopover"), k = resolveComponent("FmDatePicker"), C = resolveComponent("FmHelperText");
476
476
  return openBlock(), createElementBlock(Fragment, null, [
477
477
  createVNode(h, {
478
478
  items: [{ label: "Fixed" }, { label: "Repeating" }],
479
- "model-value": { label: unref(cases).title(unref(i)) },
480
- "onUpdate:modelValue": c,
479
+ "model-value": { label: unref(cases).title(unref(s)) },
480
+ "onUpdate:modelValue": d,
481
481
  class: "mb-8"
482
482
  }, null, 8, ["model-value"]),
483
483
  createElementVNode("div", _hoisted_1$d, [
484
484
  createElementVNode("div", _hoisted_2$c, [
485
485
  createVNode(p, {
486
486
  label: "Notify time",
487
- "model-value": unref(o).time,
488
- "onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(o).date, time: B })),
489
- "helper-text": unref(o).time ? void 0 : "Time is required",
490
- "helper-state": unref(o).time ? void 0 : "error"
487
+ "model-value": unref(l).time,
488
+ "onUpdate:modelValue": v[0] || (v[0] = (B) => g({ date: unref(l).date, time: B })),
489
+ "helper-text": unref(l).time ? void 0 : "Time is required",
490
+ "helper-state": unref(l).time ? void 0 : "error"
491
491
  }, null, 8, ["model-value", "helper-text", "helper-state"]),
492
- unref(i) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
492
+ unref(s) == "repeating" ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
493
493
  createElementVNode("div", _hoisted_4$9, [
494
494
  _hoisted_5$5,
495
- unref(o).date ? (openBlock(), createBlock(f, {
495
+ unref(l).date ? (openBlock(), createBlock(f, {
496
496
  key: 0,
497
497
  "z-index": 9999,
498
- content: unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options)
498
+ content: unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options)
499
499
  }, {
500
500
  default: withCtx(() => [
501
- createVNode(s, {
501
+ createVNode(i, {
502
502
  name: "info",
503
503
  size: "sm",
504
504
  outline: !0
@@ -508,17 +508,17 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
508
508
  }, 8, ["content"])) : createCommentVNode("", !0)
509
509
  ]),
510
510
  createVNode(x, {
511
- "show-popover": unref(l),
512
- onPopoverChanged: v[3] || (v[3] = (B) => l.value = B)
511
+ "show-popover": unref(o),
512
+ onPopoverChanged: v[3] || (v[3] = (B) => o.value = B)
513
513
  }, {
514
514
  "popover-button": withCtx(() => [
515
515
  createVNode(m, {
516
516
  class: "cursor-pointer",
517
- "helper-text": unref(o).date ? void 0 : "Date is required",
518
- "helper-state": unref(o).date ? void 0 : "error"
517
+ "helper-text": unref(l).date ? void 0 : "Date is required",
518
+ "helper-state": unref(l).date ? void 0 : "error"
519
519
  }, {
520
520
  default: withCtx(() => [
521
- createElementVNode("div", _hoisted_6$3, toDisplayString(unref(o).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(o).date).options) : "Set a repeating date"), 1)
521
+ createElementVNode("div", _hoisted_6$3, toDisplayString(unref(l).date ? unref(SummarizeRrule)(unref(RRule).fromString(unref(l).date).options) : "Set a repeating date"), 1)
522
522
  ]),
523
523
  _: 1
524
524
  }, 8, ["helper-text", "helper-state"])
@@ -528,9 +528,9 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
528
528
  default: withCtx(() => [
529
529
  createVNode(_sfc_main$k, {
530
530
  "apply-button": !0,
531
- "model-value": unref(o).date || "",
532
- onCancel: v[1] || (v[1] = (B) => l.value = !1),
533
- "onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(o).time }), l.value = !1))
531
+ "model-value": unref(l).date || "",
532
+ onCancel: v[1] || (v[1] = (B) => o.value = !1),
533
+ "onUpdate:modelValue": v[2] || (v[2] = (B) => (g({ date: B, time: unref(l).time }), o.value = !1))
534
534
  }, null, 8, ["model-value"])
535
535
  ]),
536
536
  _: 1
@@ -541,13 +541,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
541
541
  ])) : (openBlock(), createBlock(k, {
542
542
  key: 1,
543
543
  label: "Notify date",
544
- "model-value": unref(o).date || "",
545
- "onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(o).time })),
546
- "helper-text": unref(o).date ? void 0 : "Date is required",
547
- "helper-state": unref(o).date ? void 0 : "error"
544
+ "model-value": unref(l).date || "",
545
+ "onUpdate:modelValue": v[4] || (v[4] = (B) => g({ date: B, time: unref(l).time })),
546
+ "helper-text": unref(l).date ? void 0 : "Date is required",
547
+ "helper-state": unref(l).date ? void 0 : "error"
548
548
  }, null, 8, ["model-value", "helper-text", "helper-state"]))
549
549
  ]),
550
- unref(o).date && unref(o).time && unref(n) ? (openBlock(), createBlock(C, {
550
+ unref(l).date && unref(l).time && unref(n) ? (openBlock(), createBlock(C, {
551
551
  key: 0,
552
552
  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
553
553
  ${unref(hooks)(unref(n)).format("hh:mmA")} (${unref(hooks)(unref(n)).fromNow()})`
@@ -564,8 +564,8 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
564
564
  }
565
565
  },
566
566
  emits: ["update:model-value"],
567
- setup(e, { emit: d }) {
568
- const a = e, r = d, u = computed(
567
+ setup(e, { emit: c }) {
568
+ const a = e, r = c, u = computed(
569
569
  () => [
570
570
  {
571
571
  label: "Fortune Wheel",
@@ -579,14 +579,14 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
579
579
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS,
580
580
  hidden: !0
581
581
  }
582
- ].filter((i) => !i.hidden)
582
+ ].filter((s) => !s.hidden)
583
583
  );
584
- return (i, l) => {
585
- const o = resolveComponent("FmCard");
584
+ return (s, o) => {
585
+ const l = resolveComponent("FmCard");
586
586
  return openBlock(), createElementBlock("div", _hoisted_1$c, [
587
587
  _hoisted_2$b,
588
588
  createElementVNode("div", _hoisted_3$9, [
589
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
589
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
590
590
  variant: "outlined",
591
591
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
592
592
  "col-span-2": unref(u).length == 1,
@@ -614,30 +614,30 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
614
614
  }, _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({
615
615
  __name: "EditRewardPoolSheet",
616
616
  emits: ["update:model-value"],
617
- setup(e, { expose: d, emit: a }) {
618
- const r = useMembershipStore(), { minor: u } = useLoading, i = ref(!1), l = ref(), o = ref(), n = ref(0), c = computed(() => {
619
- var s;
620
- return ((s = r.loyaltyRewards.items.find(
617
+ setup(e, { expose: c, emit: a }) {
618
+ const r = useMembershipStore(), { minor: u } = useLoading, s = ref(!1), o = ref(), l = ref(), n = ref(0), d = computed(() => {
619
+ var i;
620
+ return ((i = r.loyaltyRewards.items.find(
621
621
  (f) => {
622
622
  var m;
623
- return f.value === ((m = l.value) == null ? void 0 : m.collectible);
623
+ return f.value === ((m = o.value) == null ? void 0 : m.collectible);
624
624
  }
625
- )) == null ? void 0 : s.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
625
+ )) == null ? void 0 : i.raw.type) === "CREDIT" ? FdoCreditLoyaltyReward : FdtoRandomReward;
626
626
  }), g = computed(() => {
627
- const p = c.value.safeParse(l.value);
627
+ const p = d.value.safeParse(o.value);
628
628
  return p.success ? [] : p.error.errors;
629
629
  });
630
- function y(p, s, f) {
631
- p && (l.value = s, n.value = f), i.value = p;
630
+ function y(p, i, f) {
631
+ p && (o.value = i, n.value = f), s.value = p;
632
632
  }
633
633
  const v = a;
634
634
  async function h() {
635
- const p = c.value.safeParse(l.value);
635
+ const p = d.value.safeParse(o.value);
636
636
  p.success && (await u(
637
637
  async () => {
638
- p.data.type === "VOUCHER" && o.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
639
- p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, o.value),
640
- o.value
638
+ p.data.type === "VOUCHER" && l.value && (p.data.collectibleConfig.image = await firebaseStorage.update(
639
+ p.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, l.value),
640
+ l.value
641
641
  ));
642
642
  },
643
643
  {
@@ -646,16 +646,16 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
646
646
  }
647
647
  ), v("update:model-value", p.data, n.value));
648
648
  }
649
- return d({
649
+ return c({
650
650
  showSheet: y
651
- }), (p, s) => {
651
+ }), (p, i) => {
652
652
  const f = resolveComponent("FmSelect"), m = resolveComponent("FmStepperField"), b = resolveComponent("FmButton"), x = resolveComponent("FmSideSheet");
653
653
  return openBlock(), createBlock(x, {
654
654
  "max-width": 560,
655
- modelValue: unref(i),
655
+ modelValue: unref(s),
656
656
  "onUpdate:modelValue": [
657
- s[9] || (s[9] = (k) => isRef(i) ? i.value = k : null),
658
- s[10] || (s[10] = (k) => i.value = k)
657
+ i[9] || (i[9] = (k) => isRef(s) ? s.value = k : null),
658
+ i[10] || (i[10] = (k) => s.value = k)
659
659
  ],
660
660
  header: "Edit reward",
661
661
  "dismiss-away": ""
@@ -667,20 +667,20 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
667
667
  type: "button",
668
668
  disabled: unref(g).length > 0,
669
669
  label: "Confirm",
670
- onClick: s[7] || (s[7] = (k) => h())
670
+ onClick: i[7] || (i[7] = (k) => h())
671
671
  }, null, 8, ["disabled"]),
672
672
  createVNode(b, {
673
673
  variant: "secondary",
674
674
  type: "button",
675
675
  label: "Cancel",
676
- onClick: s[8] || (s[8] = (k) => i.value = !1)
676
+ onClick: i[8] || (i[8] = (k) => s.value = !1)
677
677
  })
678
678
  ])
679
679
  ]),
680
680
  default: withCtx(() => {
681
681
  var k, C, B;
682
682
  return [
683
- unref(l) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
683
+ unref(o) ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
684
684
  createVNode(f, {
685
685
  label: "Reward Type",
686
686
  items: [
@@ -688,13 +688,13 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
688
688
  { label: "Voucher", value: "VOUCHER" },
689
689
  { label: "Loyalty", value: "LOYALTY" }
690
690
  ],
691
- "model-value": unref(l).type,
692
- "onUpdate:modelValue": s[0] || (s[0] = (V) => {
693
- V == "NO_REWARD" ? l.value = {
691
+ "model-value": unref(o).type,
692
+ "onUpdate:modelValue": i[0] || (i[0] = (V) => {
693
+ V == "NO_REWARD" ? o.value = {
694
694
  type: "NO_REWARD",
695
695
  collectible: null,
696
696
  weight: 1
697
- } : V === "VOUCHER" ? l.value = {
697
+ } : V === "VOUCHER" ? o.value = {
698
698
  collectible: null,
699
699
  type: "VOUCHER",
700
700
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -708,7 +708,7 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
708
708
  validForDay: 7
709
709
  },
710
710
  weight: 1
711
- } : l.value = {
711
+ } : o.value = {
712
712
  collectible: unref(r).loyaltyRewards.raw[0]._id,
713
713
  type: "LOYALTY",
714
714
  earningOption: {
@@ -722,73 +722,73 @@ const _hoisted_1$g = { class: "space-y-24" }, _sfc_main$i = /* @__PURE__ */ defi
722
722
  };
723
723
  })
724
724
  }, null, 8, ["model-value"]),
725
- unref(l).type == "LOYALTY" ? (openBlock(), createBlock(f, {
725
+ unref(o).type == "LOYALTY" ? (openBlock(), createBlock(f, {
726
726
  key: 0,
727
727
  label: "Loyalty type",
728
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "collectible", [unref(l).type])],
728
+ rules: [unref(ZodHelper).ruleAtPath(unref(d), "collectible", [unref(o).type])],
729
729
  items: unref(r).loyaltyRewards.items,
730
- "model-value": unref(l).collectible,
731
- "onUpdate:modelValue": s[1] || (s[1] = (V) => unref(l).collectible = V)
730
+ "model-value": unref(o).collectible,
731
+ "onUpdate:modelValue": i[1] || (i[1] = (V) => unref(o).collectible = V)
732
732
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
733
733
  createVNode(m, {
734
734
  label: "Weight",
735
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "weight", [unref(l).type])],
736
- "model-value": unref(l).weight,
737
- "onUpdate:modelValue": s[2] || (s[2] = (V) => l.value = {
738
- ...unref(l),
735
+ rules: [unref(ZodHelper).ruleAtPath(unref(d), "weight", [unref(o).type])],
736
+ "model-value": unref(o).weight,
737
+ "onUpdate:modelValue": i[2] || (i[2] = (V) => o.value = {
738
+ ...unref(o),
739
739
  weight: V
740
740
  })
741
741
  }, null, 8, ["rules", "model-value"]),
742
- unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
742
+ unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
743
743
  ((k = unref(r).loyaltyRewards.items.find(
744
744
  (V) => {
745
745
  var R;
746
- return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
746
+ return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
747
747
  }
748
748
  )) == null ? void 0 : k.raw.type) !== "TITLE" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
749
749
  _hoisted_2$a,
750
750
  createVNode(_sfc_main$l, {
751
751
  class: "mt-[-8px]",
752
752
  rules: [
753
- unref(ZodHelper).ruleAtPath(unref(c), "earningOption", [unref(l).type])
753
+ unref(ZodHelper).ruleAtPath(unref(d), "earningOption", [unref(o).type])
754
754
  ],
755
755
  "helper-state": unref(ZodHelper).helperState(unref(g), "earningOption"),
756
756
  "error-text": unref(ZodHelper).helperText(unref(g), "earningOption"),
757
757
  "fixed-type": !0,
758
- "model-value": unref(l).earningOption,
759
- "onUpdate:modelValue": s[3] || (s[3] = (V) => l.value = {
760
- ...unref(l),
758
+ "model-value": unref(o).earningOption,
759
+ "onUpdate:modelValue": i[3] || (i[3] = (V) => o.value = {
760
+ ...unref(o),
761
761
  earningOption: V
762
762
  })
763
763
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"])
764
764
  ], 64)) : createCommentVNode("", !0),
765
765
  _hoisted_3$8,
766
766
  createVNode(_sfc_main$m, {
767
- type: unref(l).type === "LOYALTY" ? "custom" : "range",
768
- "for-credit": unref(l).type === "LOYALTY" && ((C = unref(r).loyaltyRewards.items.find(
767
+ type: unref(o).type === "LOYALTY" ? "custom" : "range",
768
+ "for-credit": unref(o).type === "LOYALTY" && ((C = unref(r).loyaltyRewards.items.find(
769
769
  (V) => {
770
770
  var R;
771
- return V.value === ((R = unref(l)) == null ? void 0 : R.collectible);
771
+ return V.value === ((R = unref(o)) == null ? void 0 : R.collectible);
772
772
  }
773
773
  )) == null ? void 0 : C.raw.type) === "CREDIT",
774
774
  class: "!gap-24",
775
- rules: [unref(ZodHelper).ruleAtPath(unref(c), "validityOption", [unref(l).type])],
776
- "model-value": unref(l).validityOption,
777
- "onUpdate:modelValue": s[4] || (s[4] = (V) => l.value = {
778
- ...unref(l),
775
+ rules: [unref(ZodHelper).ruleAtPath(unref(d), "validityOption", [unref(o).type])],
776
+ "model-value": unref(o).validityOption,
777
+ "onUpdate:modelValue": i[4] || (i[4] = (V) => o.value = {
778
+ ...unref(o),
779
779
  validityOption: V
780
780
  })
781
781
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
782
782
  ], 64)) : createCommentVNode("", !0),
783
- unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
783
+ unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
784
784
  key: 2,
785
- "reward-image": unref(o),
786
- "model-value": ((B = unref(l)) == null ? void 0 : B.collectibleConfig) ?? void 0,
787
- "onUpdate:modelValue": s[5] || (s[5] = (V) => l.value = {
788
- ...unref(l),
785
+ "reward-image": unref(l),
786
+ "model-value": ((B = unref(o)) == null ? void 0 : B.collectibleConfig) ?? void 0,
787
+ "onUpdate:modelValue": i[5] || (i[5] = (V) => o.value = {
788
+ ...unref(o),
789
789
  collectibleConfig: V
790
790
  }),
791
- "onUpdate:rewardImage": s[6] || (s[6] = (V) => o.value = V)
791
+ "onUpdate:rewardImage": i[6] || (i[6] = (V) => l.value = V)
792
792
  }, null, 8, ["reward-image", "model-value"])) : createCommentVNode("", !0),
793
793
  createVNode(JsonViewer, { json: unref(g) }, null, 8, ["json"])
794
794
  ])) : createCommentVNode("", !0)
@@ -817,33 +817,33 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
817
817
  }
818
818
  },
819
819
  emits: ["update:model-value"],
820
- setup(e, { emit: d }) {
821
- const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), l = computed(() => a.modelValue ?? []), o = computed(() => {
822
- const p = i.safeParse(l.value);
820
+ setup(e, { emit: c }) {
821
+ const a = e, r = c, u = useMembershipStore(), s = z.array(z.lazy(() => FdtoRandomReward)).min(1, "Requires at least 1 reward"), o = computed(() => a.modelValue ?? []), l = computed(() => {
822
+ const p = s.safeParse(o.value);
823
823
  return p.success ? [] : p.error.errors;
824
824
  }), n = ref();
825
- function c(p, s) {
825
+ function d(p, i) {
826
826
  var m;
827
- const f = [...l.value];
828
- f[s] = p, (m = n.value) == null || m.showSheet(!1), r("update:model-value", f);
827
+ const f = [...o.value];
828
+ f[i] = p, (m = n.value) == null || m.showSheet(!1), r("update:model-value", f);
829
829
  }
830
830
  function g(p) {
831
- const s = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
831
+ const i = p.type == "VOUCHER" ? p.collectibleConfig : u.collectibles.find(
832
832
  (b) => b._id.toString() == p.collectible
833
- ), f = CollectionUtils.formattedType((s == null ? void 0 : s.name) || ""), m = p.weight;
833
+ ), f = CollectionUtils.formattedType((i == null ? void 0 : i.name) || ""), m = p.weight;
834
834
  return {
835
835
  label: isNullOrEmpty(f) ? "NO REWARD" : f,
836
- sublabel: `${m} (${(m / l.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
836
+ sublabel: `${m} (${(m / o.value.reduce((b, x) => b + x.weight, 0) * 100).toFixed(2)}%)`
837
837
  };
838
838
  }
839
839
  function y(p) {
840
840
  var f;
841
- const s = [...l.value];
842
- (f = n.value) == null || f.showSheet(!0, s[p], p);
841
+ const i = [...o.value];
842
+ (f = n.value) == null || f.showSheet(!0, i[p], p);
843
843
  }
844
844
  function v(p) {
845
- const s = [...l.value];
846
- s.splice(p, 1), r("update:model-value", s);
845
+ const i = [...o.value];
846
+ i.splice(p, 1), r("update:model-value", i);
847
847
  }
848
848
  function h() {
849
849
  var p;
@@ -854,20 +854,20 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
854
854
  collectible: null,
855
855
  weight: 1
856
856
  },
857
- l.value.length
857
+ o.value.length
858
858
  );
859
859
  }
860
- return (p, s) => {
860
+ return (p, i) => {
861
861
  const f = resolveComponent("FmButton"), m = resolveComponent("FmCard"), b = resolveComponent("FmHelperText");
862
862
  return openBlock(), createElementBlock("div", _hoisted_1$a, [
863
863
  _hoisted_2$9,
864
864
  createVNode(f, {
865
865
  label: "Add Reward",
866
- onClick: s[0] || (s[0] = (x) => h()),
866
+ onClick: i[0] || (i[0] = (x) => h()),
867
867
  variant: "plain",
868
868
  icon: "add"
869
869
  }),
870
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (x, k) => (openBlock(), createBlock(m, {
870
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (x, k) => (openBlock(), createBlock(m, {
871
871
  key: k,
872
872
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
873
873
  variant: "outlined",
@@ -889,7 +889,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
889
889
  }),
890
890
  _: 2
891
891
  }, 1032, ["onClick"]))), 128)),
892
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
892
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((x) => x.path.join(".") == ""), (x) => (openBlock(), createBlock(b, {
893
893
  key: x.message,
894
894
  text: x.message,
895
895
  state: "error"
@@ -897,7 +897,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
897
897
  createVNode(_sfc_main$b, {
898
898
  ref_key: "sheetRef",
899
899
  ref: n,
900
- "onUpdate:modelValue": c
900
+ "onUpdate:modelValue": d
901
901
  }, null, 512)
902
902
  ]);
903
903
  };
@@ -913,32 +913,32 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
913
913
  }
914
914
  },
915
915
  emits: ["update:model-value"],
916
- setup(e, { emit: d }) {
917
- const a = e, r = d, u = computed(() => [
916
+ setup(e, { emit: c }) {
917
+ const a = e, r = c, u = computed(() => [
918
918
  {
919
919
  label: "Rock paper scissor",
920
920
  description: "Customers play 3 rounds of Rock Paper Scissors against the cashier. If customer won 2 rounds, they will get a discount.",
921
921
  value: F_GAME_TYPE.enum.ROCK_PAPER_SCISSORS
922
922
  }
923
923
  ]);
924
- return (i, l) => {
924
+ return (s, o) => {
925
925
  var g, y, v;
926
- const o = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), c = resolveComponent("FmHelperText");
926
+ const l = resolveComponent("FmSwitch"), n = resolveComponent("FmCard"), d = resolveComponent("FmHelperText");
927
927
  return openBlock(), createElementBlock("div", _hoisted_1$9, [
928
- createVNode(o, {
928
+ createVNode(l, {
929
929
  label: "Enable game",
930
930
  "model-value": !!((g = e.modelValue) != null && g.gameType),
931
- "onUpdate:modelValue": l[0] || (l[0] = (h) => h ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
931
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => h ? r("update:model-value", { gameType: "ROCK_PAPER_SCISSORS" }) : r("update:model-value", null))
932
932
  }, null, 8, ["model-value"]),
933
933
  ((y = e.modelValue) == null ? void 0 : y.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createElementBlock("div", _hoisted_2$8, [
934
934
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (h) => {
935
- var p, s;
935
+ var p, i;
936
936
  return openBlock(), createBlock(n, {
937
937
  variant: "outlined",
938
938
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
939
939
  "col-span-2": unref(u).length == 1,
940
940
  "border-fm-color-primary bg-fm-color-system-warning-100 hover:border-[var(--fm-color-system-orange-300)]": ((p = e.modelValue) == null ? void 0 : p.gameType) == h.value,
941
- "hover:bg-fm-color-opacity-sm": ((s = e.modelValue) == null ? void 0 : s.gameType) != h.value
941
+ "hover:bg-fm-color-opacity-sm": ((i = e.modelValue) == null ? void 0 : i.gameType) != h.value
942
942
  }]),
943
943
  onClick: () => {
944
944
  var f;
@@ -954,7 +954,7 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
954
954
  }, 1032, ["class", "onClick"]);
955
955
  }), 128))
956
956
  ])) : createCommentVNode("", !0),
957
- ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(c, {
957
+ ((v = e.modelValue) == null ? void 0 : v.gameType) == "ROCK_PAPER_SCISSORS" ? (openBlock(), createBlock(d, {
958
958
  key: 1,
959
959
  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)",
960
960
  state: "warning"
@@ -970,8 +970,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
970
970
  }
971
971
  },
972
972
  emits: ["update:model-value"],
973
- setup(e, { emit: d }) {
974
- const a = e, r = d, u = computed(() => [
973
+ setup(e, { emit: c }) {
974
+ const a = e, r = c, u = computed(() => [
975
975
  {
976
976
  label: "Stamp",
977
977
  description: "Award stamps for purchases, redeemable after reaching set milestones.",
@@ -983,12 +983,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
983
983
  value: F_MISSION_TYPE.enum.PROGRESSIVE
984
984
  }
985
985
  ]);
986
- return (i, l) => {
987
- const o = resolveComponent("FmCard");
986
+ return (s, o) => {
987
+ const l = resolveComponent("FmCard");
988
988
  return openBlock(), createElementBlock("div", _hoisted_1$8, [
989
989
  _hoisted_2$7,
990
990
  createElementVNode("div", _hoisted_3$5, [
991
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(o, {
991
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (n) => (openBlock(), createBlock(l, {
992
992
  variant: "outlined",
993
993
  class: normalizeClass(["p-16 space-y-8 h-full cursor-pointer select-none xs:col-span-3", {
994
994
  "col-span-2": unref(u).length == 1,
@@ -1024,16 +1024,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1024
1024
  }
1025
1025
  },
1026
1026
  emits: ["update:model-value"],
1027
- setup(e, { emit: d }) {
1028
- const a = d;
1027
+ setup(e, { emit: c }) {
1028
+ const a = c;
1029
1029
  return (r, u) => {
1030
- const i = resolveComponent("FmStepperField");
1030
+ const s = resolveComponent("FmStepperField");
1031
1031
  return openBlock(), createElementBlock("div", _hoisted_1$7, [
1032
1032
  _hoisted_2$6,
1033
- createVNode(i, {
1033
+ createVNode(s, {
1034
1034
  label: "Maximum to collect",
1035
1035
  "model-value": e.modelValue || null,
1036
- "onUpdate:modelValue": u[0] || (u[0] = (l) => a("update:model-value", l)),
1036
+ "onUpdate:modelValue": u[0] || (u[0] = (o) => a("update:model-value", o)),
1037
1037
  "helper-text": e.helperText || "Set the threshold required for reward eligibility",
1038
1038
  "helper-state": e.helperState || "none"
1039
1039
  }, null, 8, ["model-value", "helper-text", "helper-state"])
@@ -1049,26 +1049,26 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1049
1049
  }
1050
1050
  },
1051
1051
  emits: ["update:model-value"],
1052
- setup(e, { expose: d, emit: a }) {
1053
- const r = e, u = useMembershipStore(), { minor: i } = useLoading, l = ref(!1), o = ref(), n = ref(), c = ref(0), g = computed(() => {
1052
+ setup(e, { expose: c, emit: a }) {
1053
+ const r = e, u = useMembershipStore(), { minor: s } = useLoading, o = ref(!1), l = ref(), n = ref(), d = ref(0), g = computed(() => {
1054
1054
  var m;
1055
1055
  return ((m = u.loyaltyRewards.items.find(
1056
1056
  (b) => {
1057
1057
  var x;
1058
- return b.value === ((x = o.value) == null ? void 0 : x.collectible);
1058
+ return b.value === ((x = l.value) == null ? void 0 : x.collectible);
1059
1059
  }
1060
1060
  )) == null ? void 0 : m.raw.type) === "CREDIT" ? FdoThresholdCreditReward : FdtoThresholdReward;
1061
1061
  }), y = computed(() => {
1062
- const f = g.value.safeParse(o.value);
1062
+ const f = g.value.safeParse(l.value);
1063
1063
  return f.success ? [] : f.error.errors;
1064
1064
  });
1065
1065
  function v(f, m, b) {
1066
- f && (o.value = m, c.value = b), l.value = f;
1066
+ f && (l.value = m, d.value = b), o.value = f;
1067
1067
  }
1068
1068
  const h = a;
1069
1069
  async function p() {
1070
- const f = g.value.safeParse(o.value);
1071
- f.success && (await i(
1070
+ const f = g.value.safeParse(l.value);
1071
+ f.success && (await s(
1072
1072
  async () => {
1073
1073
  f.data.type === "VOUCHER" && n.value && (f.data.collectibleConfig.image = await firebaseStorage.update(
1074
1074
  f.data.collectibleConfig.image || firebaseStorage.collectibleImagePath(void 0, n.value),
@@ -1079,19 +1079,19 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1079
1079
  message: "Uploading reward image",
1080
1080
  successMessage: "Reward image updated"
1081
1081
  }
1082
- ), h("update:model-value", f.data, c.value));
1082
+ ), h("update:model-value", f.data, d.value));
1083
1083
  }
1084
- const s = ref();
1085
- return d({
1084
+ const i = ref();
1085
+ return c({
1086
1086
  showSheet: v
1087
1087
  }), (f, m) => {
1088
1088
  const b = resolveComponent("FmStepperField"), x = resolveComponent("FmSelect"), k = resolveComponent("FmForm"), C = resolveComponent("FmButton"), B = resolveComponent("FmSideSheet");
1089
1089
  return openBlock(), createBlock(B, {
1090
1090
  "max-width": 560,
1091
- modelValue: unref(l),
1091
+ modelValue: unref(o),
1092
1092
  "onUpdate:modelValue": [
1093
- m[10] || (m[10] = (V) => isRef(l) ? l.value = V : null),
1094
- m[11] || (m[11] = (V) => l.value = V)
1093
+ m[10] || (m[10] = (V) => isRef(o) ? o.value = V : null),
1094
+ m[11] || (m[11] = (V) => o.value = V)
1095
1095
  ],
1096
1096
  header: "Edit reward",
1097
1097
  "dismiss-away": ""
@@ -1105,30 +1105,30 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1105
1105
  disabled: unref(y).length > 0,
1106
1106
  onClick: m[8] || (m[8] = async () => {
1107
1107
  var V;
1108
- return (V = unref(s)) == null ? void 0 : V.validateInputs();
1108
+ return (V = unref(i)) == null ? void 0 : V.validateInputs();
1109
1109
  })
1110
1110
  }, null, 8, ["disabled"]),
1111
1111
  createVNode(C, {
1112
1112
  variant: "secondary",
1113
1113
  type: "button",
1114
1114
  label: "Cancel",
1115
- onClick: m[9] || (m[9] = (V) => l.value = !1)
1115
+ onClick: m[9] || (m[9] = (V) => o.value = !1)
1116
1116
  })
1117
1117
  ])
1118
1118
  ]),
1119
1119
  default: withCtx(() => [
1120
- createVNode(JsonViewer, { json: unref(o) }, null, 8, ["json"]),
1121
- unref(o) ? (openBlock(), createBlock(k, {
1120
+ createVNode(JsonViewer, { json: unref(l) }, null, 8, ["json"]),
1121
+ unref(l) ? (openBlock(), createBlock(k, {
1122
1122
  key: 0,
1123
1123
  class: "flex flex-col gap-y-24",
1124
1124
  ref_key: "formRef",
1125
- ref: s,
1125
+ ref: i,
1126
1126
  onValidationSuccess: m[7] || (m[7] = (V) => p())
1127
1127
  }, {
1128
1128
  default: withCtx(() => {
1129
1129
  var V, R;
1130
1130
  return [
1131
- unref(o).type ? (openBlock(), createBlock(b, {
1131
+ unref(l).type ? (openBlock(), createBlock(b, {
1132
1132
  key: 0,
1133
1133
  label: "Threshold",
1134
1134
  rules: [
@@ -1139,9 +1139,9 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1139
1139
  )
1140
1140
  )
1141
1141
  ],
1142
- "model-value": unref(o).threshold,
1143
- "onUpdate:modelValue": m[0] || (m[0] = (E) => o.value = {
1144
- ...unref(o),
1142
+ "model-value": unref(l).threshold,
1143
+ "onUpdate:modelValue": m[0] || (m[0] = (E) => l.value = {
1144
+ ...unref(l),
1145
1145
  threshold: E
1146
1146
  })
1147
1147
  }, null, 8, ["rules", "model-value"])) : createCommentVNode("", !0),
@@ -1151,10 +1151,10 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1151
1151
  { label: "Voucher", value: "VOUCHER" },
1152
1152
  { label: "Loyalty", value: "LOYALTY" }
1153
1153
  ],
1154
- "model-value": unref(o).type,
1154
+ "model-value": unref(l).type,
1155
1155
  "onUpdate:modelValue": m[1] || (m[1] = (E) => {
1156
1156
  var S, $;
1157
- E === "VOUCHER" ? o.value = {
1157
+ E === "VOUCHER" ? l.value = {
1158
1158
  collectible: null,
1159
1159
  type: "VOUCHER",
1160
1160
  collectibleConfig: unref(initCollectibleConfig)("VOUCHER", {
@@ -1167,8 +1167,8 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1167
1167
  validityOption: {
1168
1168
  validForDay: 7
1169
1169
  },
1170
- threshold: (S = unref(o)) == null ? void 0 : S.threshold
1171
- } : o.value = {
1170
+ threshold: (S = unref(l)) == null ? void 0 : S.threshold
1171
+ } : l.value = {
1172
1172
  collectible: unref(u).loyaltyRewards.raw[0]._id,
1173
1173
  type: "LOYALTY",
1174
1174
  earningOption: {
@@ -1178,55 +1178,55 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1178
1178
  validityOption: {
1179
1179
  validForDay: 7
1180
1180
  },
1181
- threshold: ($ = unref(o)) == null ? void 0 : $.threshold
1181
+ threshold: ($ = unref(l)) == null ? void 0 : $.threshold
1182
1182
  };
1183
1183
  })
1184
1184
  }, null, 8, ["model-value"]),
1185
- unref(o).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1185
+ unref(l).type == "LOYALTY" ? (openBlock(), createBlock(x, {
1186
1186
  key: 1,
1187
1187
  label: "Loyalty type",
1188
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(o).type])],
1188
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "collectible", [unref(l).type])],
1189
1189
  items: unref(u).loyaltyRewards.items,
1190
- "model-value": unref(o).collectible,
1191
- "onUpdate:modelValue": m[2] || (m[2] = (E) => unref(o).collectible = E)
1190
+ "model-value": unref(l).collectible,
1191
+ "onUpdate:modelValue": m[2] || (m[2] = (E) => unref(l).collectible = E)
1192
1192
  }, null, 8, ["rules", "items", "model-value"])) : createCommentVNode("", !0),
1193
- unref(o).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1193
+ unref(l).type === "LOYALTY" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
1194
1194
  _hoisted_1$6,
1195
1195
  createVNode(_sfc_main$l, {
1196
1196
  class: "mt-[-8px]",
1197
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(o).type])],
1197
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "earningOption", [unref(l).type])],
1198
1198
  "helper-state": unref(ZodHelper).helperState(unref(y), "earningOption"),
1199
1199
  "error-text": unref(ZodHelper).helperText(unref(y), "earningOption"),
1200
1200
  "fixed-type": !0,
1201
- "model-value": unref(o).earningOption,
1202
- "onUpdate:modelValue": m[3] || (m[3] = (E) => o.value = {
1203
- ...unref(o),
1201
+ "model-value": unref(l).earningOption,
1202
+ "onUpdate:modelValue": m[3] || (m[3] = (E) => l.value = {
1203
+ ...unref(l),
1204
1204
  earningOption: E
1205
1205
  })
1206
1206
  }, null, 8, ["rules", "helper-state", "error-text", "model-value"]),
1207
1207
  createVNode(_sfc_main$m, {
1208
1208
  class: "!gap-24",
1209
- type: unref(o).type === "LOYALTY" ? "custom" : "range",
1210
- "for-credit": unref(o).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
1209
+ type: unref(l).type === "LOYALTY" ? "custom" : "range",
1210
+ "for-credit": unref(l).type === "LOYALTY" && ((V = unref(u).loyaltyRewards.items.find(
1211
1211
  (E) => {
1212
1212
  var S;
1213
- return E.value === ((S = unref(o)) == null ? void 0 : S.collectible);
1213
+ return E.value === ((S = unref(l)) == null ? void 0 : S.collectible);
1214
1214
  }
1215
1215
  )) == null ? void 0 : V.raw.type) === "CREDIT",
1216
- rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(o).type])],
1217
- "model-value": unref(o).validityOption,
1218
- "onUpdate:modelValue": m[4] || (m[4] = (E) => o.value = {
1219
- ...unref(o),
1216
+ rules: [unref(ZodHelper).ruleAtPath(unref(g), "validityOption", [unref(l).type])],
1217
+ "model-value": unref(l).validityOption,
1218
+ "onUpdate:modelValue": m[4] || (m[4] = (E) => l.value = {
1219
+ ...unref(l),
1220
1220
  validityOption: E
1221
1221
  })
1222
1222
  }, null, 8, ["type", "for-credit", "rules", "model-value"])
1223
1223
  ], 64)) : createCommentVNode("", !0),
1224
- unref(o).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1224
+ unref(l).type === "VOUCHER" ? (openBlock(), createBlock(_sfc_main$n, {
1225
1225
  key: 3,
1226
1226
  "reward-image": unref(n),
1227
- "model-value": ((R = unref(o)) == null ? void 0 : R.collectibleConfig) ?? void 0,
1228
- "onUpdate:modelValue": m[5] || (m[5] = (E) => o.value = {
1229
- ...unref(o),
1227
+ "model-value": ((R = unref(l)) == null ? void 0 : R.collectibleConfig) ?? void 0,
1228
+ "onUpdate:modelValue": m[5] || (m[5] = (E) => l.value = {
1229
+ ...unref(l),
1230
1230
  collectibleConfig: E
1231
1231
  }),
1232
1232
  "onUpdate:rewardImage": m[6] || (m[6] = (E) => n.value = E)
@@ -1265,13 +1265,13 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1265
1265
  }
1266
1266
  },
1267
1267
  setup(e) {
1268
- const d = e, { maxRange: a, currentRange: r, markers: u } = toRefs(d), i = computed(
1268
+ const c = e, { maxRange: a, currentRange: r, markers: u } = toRefs(c), s = computed(
1269
1269
  () => Math.min(r.value / a.value * 100, 100)
1270
- ), l = (o) => o / a.value * 100;
1271
- return (o, n) => {
1272
- const c = resolveComponent("FmIcon");
1270
+ ), o = (l) => l / a.value * 100;
1271
+ return (l, n) => {
1272
+ const d = resolveComponent("FmIcon");
1273
1273
  return e.type === "STAMP" ? (openBlock(), createElementBlock("div", _hoisted_1$5, [
1274
- (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(c, {
1274
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(Math.min(unref(a), 40), (g) => (openBlock(), createBlock(d, {
1275
1275
  class: normalizeClass(
1276
1276
  unref(r) >= g ? "text-fm-color-primary" : "text-fm-color-neutral-gray-200"
1277
1277
  ),
@@ -1285,12 +1285,12 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1285
1285
  }, [
1286
1286
  createElementVNode("div", {
1287
1287
  class: normalizeClass(["bg-fm-color-primary", "absolute top-0 left-0 h-full rounded-lg"]),
1288
- style: normalizeStyle({ width: unref(i) + "%" })
1288
+ style: normalizeStyle({ width: unref(s) + "%" })
1289
1289
  }, null, 4),
1290
1290
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(u), (g, y) => (openBlock(), createElementBlock("div", {
1291
1291
  key: y,
1292
1292
  class: "absolute -top-1.5 flex flex-col items-center -translate-x-1/2",
1293
- style: normalizeStyle({ left: l(g) + "%" })
1293
+ style: normalizeStyle({ left: o(g) + "%" })
1294
1294
  }, [
1295
1295
  createElementVNode("div", _hoisted_2$4, [
1296
1296
  createElementVNode("div", {
@@ -1304,16 +1304,16 @@ const _hoisted_1$a = { class: "space-y-16" }, _hoisted_2$9 = /* @__PURE__ */ cre
1304
1304
  }
1305
1305
  }), isObject = (e) => e !== null && typeof e == "object";
1306
1306
  function changeKeysFactory(e) {
1307
- return function d(a, r = 1, u) {
1307
+ return function c(a, r = 1, u) {
1308
1308
  if (r === 0 || !isObject(a))
1309
1309
  return a;
1310
1310
  if (Array.isArray(a))
1311
- return a.map((l) => d(l, r - 1, u));
1312
- const i = Object.create(Object.getPrototypeOf(a));
1313
- return Object.keys(a).forEach((l) => {
1314
- const o = a[l], n = e(l, u), c = d(o, r - 1, u);
1315
- i[n] = c;
1316
- }), i;
1311
+ return a.map((o) => c(o, r - 1, u));
1312
+ const s = Object.create(Object.getPrototypeOf(a));
1313
+ return Object.keys(a).forEach((o) => {
1314
+ const l = a[o], n = e(o, u), d = c(l, r - 1, u);
1315
+ s[n] = d;
1316
+ }), s;
1317
1317
  };
1318
1318
  }
1319
1319
  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({
@@ -1329,39 +1329,39 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1329
1329
  }
1330
1330
  },
1331
1331
  emits: ["update:model-value"],
1332
- setup(e, { emit: d }) {
1333
- const a = e, r = d, u = useMembershipStore(), i = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), l = computed(
1334
- () => a.modelValue.sort((s, f) => s.threshold - f.threshold) ?? []
1335
- ), o = computed(() => {
1336
- const s = i.safeParse(l.value);
1337
- return s.success ? [] : s.error.errors;
1332
+ setup(e, { emit: c }) {
1333
+ const a = e, r = c, u = useMembershipStore(), s = z.array(z.lazy(() => FdtoThresholdReward)).min(1, "Requires at least 1 reward"), o = computed(
1334
+ () => a.modelValue.sort((i, f) => i.threshold - f.threshold) ?? []
1335
+ ), l = computed(() => {
1336
+ const i = s.safeParse(o.value);
1337
+ return i.success ? [] : i.error.errors;
1338
1338
  }), n = ref();
1339
- function c(s, f) {
1339
+ function d(i, f) {
1340
1340
  var b;
1341
- const m = [...l.value];
1342
- m[f] = s, (b = n.value) == null || b.showSheet(!1), r("update:model-value", m);
1341
+ const m = [...o.value];
1342
+ m[f] = i, (b = n.value) == null || b.showSheet(!1), r("update:model-value", m);
1343
1343
  }
1344
- function g(s) {
1345
- const f = s.type == "VOUCHER" ? s.collectibleConfig : u.collectibles.find(
1346
- (b) => b._id.toString() == s.collectible
1344
+ function g(i) {
1345
+ const f = i.type == "VOUCHER" ? i.collectibleConfig : u.collectibles.find(
1346
+ (b) => b._id.toString() == i.collectible
1347
1347
  ), m = CollectionUtils.formattedType((f == null ? void 0 : f.name) || "");
1348
1348
  return {
1349
1349
  label: isNullOrEmpty(m) ? "NO REWARD" : m,
1350
- sublabel: `Reward at ${s.threshold} | Amount: ${s.earningOption.type == "FIXED" ? s.earningOption.amount : `${s.earningOption.amount} for every RM${s.earningOption.every} spent`} `
1350
+ sublabel: `Reward at ${i.threshold} | Amount: ${i.earningOption.type == "FIXED" ? i.earningOption.amount : `${i.earningOption.amount} for every RM${i.earningOption.every} spent`} `
1351
1351
  };
1352
1352
  }
1353
- function y(s) {
1353
+ function y(i) {
1354
1354
  var m;
1355
- const f = [...l.value];
1356
- (m = n.value) == null || m.showSheet(!0, f[s], s);
1355
+ const f = [...o.value];
1356
+ (m = n.value) == null || m.showSheet(!0, f[i], i);
1357
1357
  }
1358
- function v(s) {
1359
- const f = [...l.value];
1360
- f.splice(s, 1), r("update:model-value", f);
1358
+ function v(i) {
1359
+ const f = [...o.value];
1360
+ f.splice(i, 1), r("update:model-value", f);
1361
1361
  }
1362
1362
  function h() {
1363
- var s;
1364
- (s = n.value) == null || s.showSheet(
1363
+ var i;
1364
+ (i = n.value) == null || i.showSheet(
1365
1365
  !0,
1366
1366
  {
1367
1367
  type: "LOYALTY",
@@ -1375,18 +1375,18 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1375
1375
  amount: 1
1376
1376
  }
1377
1377
  },
1378
- l.value.length
1378
+ o.value.length
1379
1379
  );
1380
1380
  }
1381
- function p(s) {
1381
+ function p(i) {
1382
1382
  var f, m;
1383
- return s.type == "VOUCHER" ? (f = s.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
1383
+ return i.type == "VOUCHER" ? (f = i.collectibleConfig) == null ? void 0 : f.name : sentenceCase(
1384
1384
  ((m = u.loyaltyRewards.items.find(
1385
- (b) => b.value == s.collectible
1385
+ (b) => b.value == i.collectible
1386
1386
  )) == null ? void 0 : m.label) || ""
1387
1387
  );
1388
1388
  }
1389
- return (s, f) => {
1389
+ return (i, f) => {
1390
1390
  const m = resolveComponent("FmButton"), b = resolveComponent("FmCard"), x = resolveComponent("FmHelperText");
1391
1391
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
1392
1392
  _hoisted_2$3,
@@ -1396,7 +1396,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1396
1396
  variant: "plain",
1397
1397
  icon: "add"
1398
1398
  }),
1399
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l), (k, C) => (openBlock(), createBlock(b, {
1399
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o), (k, C) => (openBlock(), createBlock(b, {
1400
1400
  key: C,
1401
1401
  class: "px-16 py-12 flex items-center justify-between cursor-pointer",
1402
1402
  variant: "outlined",
@@ -1415,7 +1415,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1415
1415
  ]),
1416
1416
  _: 2
1417
1417
  }, 1032, ["onClick"]))), 128)),
1418
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(o).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
1418
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(l).filter((k) => k.path.join(".") == ""), (k) => (openBlock(), createBlock(x, {
1419
1419
  key: k.message,
1420
1420
  text: k.message,
1421
1421
  state: "error"
@@ -1451,7 +1451,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1451
1451
  createVNode(_sfc_main$6, {
1452
1452
  ref_key: "sheetRef",
1453
1453
  ref: n,
1454
- "onUpdate:modelValue": c,
1454
+ "onUpdate:modelValue": d,
1455
1455
  "max-threshold": e.mission.end
1456
1456
  }, null, 8, ["max-threshold"])
1457
1457
  ]);
@@ -1463,10 +1463,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1463
1463
  modelValue: Object
1464
1464
  },
1465
1465
  emits: ["update:model-value"],
1466
- setup(e, { emit: d }) {
1466
+ setup(e, { emit: c }) {
1467
1467
  const a = e, r = computed(() => {
1468
- const l = FdoMission.safeParse(a.modelValue);
1469
- return l.success ? [] : l.error.errors;
1468
+ const o = FdoMission.safeParse(a.modelValue);
1469
+ return o.success ? [] : o.error.errors;
1470
1470
  }), u = computed(() => [
1471
1471
  {
1472
1472
  label: "Stamp",
@@ -1478,10 +1478,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1478
1478
  description: "Reward customers when they reach a cumulative spending goal.",
1479
1479
  value: F_MISSION_TYPE.enum.PROGRESSIVE
1480
1480
  }
1481
- ]), i = d;
1482
- return (l, o) => {
1481
+ ]), s = c;
1482
+ return (o, l) => {
1483
1483
  var g;
1484
- const n = resolveComponent("FmCard"), c = resolveComponent("FmStepperField");
1484
+ const n = resolveComponent("FmCard"), d = resolveComponent("FmStepperField");
1485
1485
  return openBlock(), createElementBlock("div", _hoisted_1$3, [
1486
1486
  createElementVNode("div", _hoisted_2$2, [
1487
1487
  _hoisted_3$2,
@@ -1497,11 +1497,11 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1497
1497
  "hover:bg-fm-color-opacity-sm": ((h = e.modelValue) == null ? void 0 : h.type) != y.value
1498
1498
  }]),
1499
1499
  onClick: () => {
1500
- var p, s;
1501
- ((p = e.modelValue) == null ? void 0 : p.type) != y.value && i("update:model-value", {
1500
+ var p, i;
1501
+ ((p = e.modelValue) == null ? void 0 : p.type) != y.value && s("update:model-value", {
1502
1502
  ...e.modelValue,
1503
1503
  type: y.value,
1504
- end: ((s = e.modelValue) == null ? void 0 : s.end) || 1
1504
+ end: ((i = e.modelValue) == null ? void 0 : i.end) || 1
1505
1505
  });
1506
1506
  },
1507
1507
  key: y.value
@@ -1518,12 +1518,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1518
1518
  createElementVNode("div", _hoisted_8$1, [
1519
1519
  _hoisted_9$1,
1520
1520
  _hoisted_10$1,
1521
- createVNode(c, {
1521
+ createVNode(d, {
1522
1522
  label: "Maximum to collect",
1523
1523
  "model-value": ((g = e.modelValue) == null ? void 0 : g.end) || null,
1524
- "onUpdate:modelValue": o[0] || (o[0] = (y) => {
1524
+ "onUpdate:modelValue": l[0] || (l[0] = (y) => {
1525
1525
  var v;
1526
- return i("update:model-value", {
1526
+ return s("update:model-value", {
1527
1527
  ...e.modelValue,
1528
1528
  type: ((v = e.modelValue) == null ? void 0 : v.type) || "STAMP",
1529
1529
  end: y
@@ -1558,12 +1558,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1558
1558
  }
1559
1559
  },
1560
1560
  emits: ["update:model-value", "update:file"],
1561
- setup(e, { emit: d }) {
1562
- const { t: a } = useI18n(), r = e, u = d;
1563
- function i(c) {
1561
+ setup(e, { emit: c }) {
1562
+ const { t: a } = useI18n(), r = e, u = c;
1563
+ function s(d) {
1564
1564
  switch (r.field.type) {
1565
1565
  case "timeframe":
1566
- const g = c.startDate ? hooks(c.startDate).startOf("day").toISOString() : void 0, y = c.endDate ? hooks(c.endDate).endOf("day").toISOString() : void 0;
1566
+ const g = d.startDate ? hooks(d.startDate).startOf("day").toISOString() : void 0, y = d.endDate ? hooks(d.endDate).endOf("day").toISOString() : void 0;
1567
1567
  u("update:model-value", {
1568
1568
  type: "timeframe",
1569
1569
  property: "__now",
@@ -1574,33 +1574,33 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1574
1574
  case "image": {
1575
1575
  u(
1576
1576
  "update:file",
1577
- c,
1578
- l.value || firebaseStorage.collectibleImagePath(void 0, c)
1577
+ d,
1578
+ o.value || firebaseStorage.collectibleImagePath(void 0, d)
1579
1579
  );
1580
1580
  break;
1581
1581
  }
1582
1582
  default:
1583
- u("update:model-value", c);
1583
+ u("update:model-value", d);
1584
1584
  break;
1585
1585
  }
1586
1586
  }
1587
- const l = computed(() => {
1587
+ const o = computed(() => {
1588
1588
  switch (r.field.type) {
1589
1589
  case "timeframe": {
1590
- const c = r.modelValue;
1590
+ const d = r.modelValue;
1591
1591
  return {
1592
- startDate: c != null && c.start ? hooks(c == null ? void 0 : c.start).format("YYYY-MM-DD") : null,
1593
- endDate: c != null && c.end ? hooks(c == null ? void 0 : c.end).format("YYYY-MM-DD") : null
1592
+ startDate: d != null && d.start ? hooks(d == null ? void 0 : d.start).format("YYYY-MM-DD") : null,
1593
+ endDate: d != null && d.end ? hooks(d == null ? void 0 : d.end).format("YYYY-MM-DD") : null
1594
1594
  };
1595
1595
  }
1596
1596
  default:
1597
1597
  return r.modelValue;
1598
1598
  }
1599
1599
  });
1600
- function o() {
1600
+ function l() {
1601
1601
  if (!n.value.schema) return [];
1602
- const c = n.value.schema.safeParse(r.modelValue);
1603
- return c.success ? [] : c.error.errors;
1602
+ const d = n.value.schema.safeParse(r.modelValue);
1603
+ return d.success ? [] : d.error.errors;
1604
1604
  }
1605
1605
  const n = computed(() => ({
1606
1606
  schema: r.schema,
@@ -1609,16 +1609,16 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1609
1609
  labelMark: r.schema && ZodHelper.isRequired(r.schema) == !1 ? "optional" : void 0,
1610
1610
  zodLabel: r.schema ? ZodHelper.toInputLabel(r.schema, r.field.label) : void 0
1611
1611
  }));
1612
- return (c, g) => {
1612
+ return (d, g) => {
1613
1613
  var f, m, b, x, k;
1614
- const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), s = resolveComponent("FmSwitch");
1614
+ const y = resolveComponent("FmTextField"), v = resolveComponent("FmStepperField"), h = resolveComponent("FmTextarea"), p = resolveComponent("FmHelperText"), i = resolveComponent("FmSwitch");
1615
1615
  return e.field.type === "text" ? (openBlock(), createBlock(y, {
1616
1616
  key: 0,
1617
1617
  label: unref(a)(e.field.label),
1618
1618
  "label-mark": unref(n).labelMark,
1619
1619
  rules: unref(n).rules,
1620
- "model-value": unref(l),
1621
- "onUpdate:modelValue": i,
1620
+ "model-value": unref(o),
1621
+ "onUpdate:modelValue": s,
1622
1622
  "helper-state": e.helperText ? "error" : void 0,
1623
1623
  "helper-text": e.helperText
1624
1624
  }, null, 8, ["label", "label-mark", "rules", "model-value", "helper-state", "helper-text"])) : e.field.type === "number" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
@@ -1628,9 +1628,9 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1628
1628
  createVNode(v, {
1629
1629
  label: unref(a)(e.field.label),
1630
1630
  "label-mark": e.field.isRuleChildren ? void 0 : unref(n).labelMark,
1631
- "model-value": unref(l),
1631
+ "model-value": unref(o),
1632
1632
  rules: e.field.isRuleChildren ? [] : unref(n).rules,
1633
- "onUpdate:modelValue": i,
1633
+ "onUpdate:modelValue": s,
1634
1634
  "helper-state": e.field.isRuleChildren && e.helperText ? "error" : void 0,
1635
1635
  "helper-text": e.field.isRuleChildren ? e.helperText : void 0
1636
1636
  }, null, 8, ["label", "label-mark", "model-value", "rules", "helper-state", "helper-text"])
@@ -1639,64 +1639,64 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1639
1639
  label: unref(a)(e.field.label),
1640
1640
  "label-mark": unref(n).labelMark,
1641
1641
  rules: unref(n).rules,
1642
- "model-value": unref(l),
1643
- "onUpdate:modelValue": i,
1642
+ "model-value": unref(o),
1643
+ "onUpdate:modelValue": s,
1644
1644
  "show-word-count": "",
1645
1645
  "max-length": (k = (x = (b = (m = (f = unref(n)) == null ? void 0 : f.unwrapped) == null ? void 0 : m._def) == null ? void 0 : b.checks) == null ? void 0 : x.find((C) => C.kind == "max")) == null ? void 0 : k.value
1646
1646
  }, null, 8, ["label", "label-mark", "rules", "model-value", "max-length"])) : e.field.type === "trigger" ? (openBlock(), createBlock(_sfc_main$g, {
1647
1647
  key: 3,
1648
1648
  "campaign-type": e.extras,
1649
- "model-value": unref(l),
1649
+ "model-value": unref(o),
1650
1650
  disabled: e.disabled,
1651
- "onUpdate:modelValue": i
1651
+ "onUpdate:modelValue": s
1652
1652
  }, null, 8, ["campaign-type", "model-value", "disabled"])) : e.field.type === "timeframe" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [
1653
1653
  createVNode(_sfc_main$e, {
1654
- "model-value": unref(l),
1655
- "onUpdate:modelValue": i
1654
+ "model-value": unref(o),
1655
+ "onUpdate:modelValue": s
1656
1656
  }, null, 8, ["model-value"]),
1657
1657
  createVNode(p, {
1658
1658
  class: "!mt-[8px]",
1659
- text: unref(ZodHelper).helperText(o(), ""),
1660
- state: unref(ZodHelper).helperState(o(), "")
1659
+ text: unref(ZodHelper).helperText(l(), ""),
1660
+ state: unref(ZodHelper).helperState(l(), "")
1661
1661
  }, null, 8, ["text", "state"])
1662
1662
  ], 64)) : e.field.type === "image" ? (openBlock(), createBlock(_sfc_main$o, {
1663
1663
  key: 5,
1664
- thumbnail: unref(l),
1664
+ thumbnail: unref(o),
1665
1665
  "aspect-ratio": "16 / 9",
1666
1666
  class: "w-1/2 xs:w-2/3",
1667
- "onUpdate:file": i
1667
+ "onUpdate:file": s
1668
1668
  }, {
1669
1669
  label: withCtx(() => [
1670
1670
  (openBlock(), createBlock(resolveDynamicComponent(unref(n).zodLabel)))
1671
1671
  ]),
1672
1672
  _: 1
1673
- }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(s, {
1673
+ }, 8, ["thumbnail"])) : e.field.type === "switch" ? (openBlock(), createBlock(i, {
1674
1674
  key: 6,
1675
1675
  label: unref(a)(e.field.label),
1676
1676
  "label-placement": "right",
1677
1677
  sublabel: e.field.property == "campaign.notify" ? "Notify customer when customer receives the reward" : void 0,
1678
1678
  "label-mark": unref(n).labelMark,
1679
1679
  rules: unref(n).rules,
1680
- "model-value": unref(l),
1681
- "onUpdate:modelValue": i
1680
+ "model-value": unref(o),
1681
+ "onUpdate:modelValue": s
1682
1682
  }, null, 8, ["label", "sublabel", "label-mark", "rules", "model-value"])) : e.field.type === "collectible_options" ? (openBlock(), createBlock(_sfc_main$p, {
1683
1683
  key: 7,
1684
- "model-value": unref(l),
1685
- "onUpdate:modelValue": i,
1684
+ "model-value": unref(o),
1685
+ "onUpdate:modelValue": s,
1686
1686
  "no-campaign": !1,
1687
1687
  schema: unref(n).schema,
1688
1688
  "is-mission": e.extras === "MISSION"
1689
1689
  }, null, 8, ["model-value", "schema", "is-mission"])) : e.field.type === "target_location" ? (openBlock(), createBlock(_sfc_main$q, {
1690
1690
  key: 8,
1691
- "model-value": unref(l),
1692
- "onUpdate:modelValue": i
1691
+ "model-value": unref(o),
1692
+ "onUpdate:modelValue": s
1693
1693
  }, null, 8, ["model-value"])) : e.field.type == "effect" ? (openBlock(), createElementBlock(Fragment, { key: 9 }, [
1694
1694
  createVNode(_sfc_main$r, {
1695
- "model-value": unref(l),
1696
- "onUpdate:modelValue": i,
1695
+ "model-value": unref(o),
1696
+ "onUpdate:modelValue": s,
1697
1697
  "can-set-auto-apply": e.field.property == "campaign.effect"
1698
1698
  }, null, 8, ["model-value", "can-set-auto-apply"]),
1699
- unref(l) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
1699
+ unref(o) ? createCommentVNode("", !0) : (openBlock(), createBlock(p, {
1700
1700
  key: 0,
1701
1701
  class: "!mt-[8px]",
1702
1702
  text: unref(a)("connect.campaign.common.effect_required"),
@@ -1705,54 +1705,54 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1705
1705
  ], 64)) : e.field.type === "message" ? (openBlock(), createBlock(_sfc_main$s, {
1706
1706
  key: 10,
1707
1707
  "allow-email": !0,
1708
- "model-value": unref(l),
1709
- "onUpdate:modelValue": i,
1710
- "helper-text": unref(ZodHelper).helperText(o(), ""),
1708
+ "model-value": unref(o),
1709
+ "onUpdate:modelValue": s,
1710
+ "helper-text": unref(ZodHelper).helperText(l(), ""),
1711
1711
  "trigger-type": e.field.extras,
1712
- "helper-state": unref(ZodHelper).helperState(o(), "")
1712
+ "helper-state": unref(ZodHelper).helperState(l(), "")
1713
1713
  }, null, 8, ["model-value", "helper-text", "trigger-type", "helper-state"])) : e.field.type === "earning_option" ? (openBlock(), createBlock(_sfc_main$l, {
1714
1714
  key: 11,
1715
- "model-value": unref(l),
1716
- "onUpdate:modelValue": i,
1715
+ "model-value": unref(o),
1716
+ "onUpdate:modelValue": s,
1717
1717
  extras: e.extras,
1718
1718
  "error-text": e.helperText
1719
1719
  }, null, 8, ["model-value", "extras", "error-text"])) : e.field.type === "validity_option" ? (openBlock(), createBlock(_sfc_main$m, {
1720
1720
  key: 12,
1721
1721
  type: "custom",
1722
- "model-value": unref(l),
1723
- "onUpdate:modelValue": i,
1724
- "helper-text": e.helperText || unref(ZodHelper).helperText(o(), "")
1722
+ "model-value": unref(o),
1723
+ "onUpdate:modelValue": s,
1724
+ "helper-text": e.helperText || unref(ZodHelper).helperText(l(), "")
1725
1725
  }, null, 8, ["model-value", "helper-text"])) : e.field.type === "game_type" ? (openBlock(), createBlock(_sfc_main$c, {
1726
1726
  key: 13,
1727
- "model-value": unref(l),
1728
- "onUpdate:modelValue": i
1727
+ "model-value": unref(o),
1728
+ "onUpdate:modelValue": s
1729
1729
  }, null, 8, ["model-value"])) : e.field.type === "reward_pool" ? (openBlock(), createBlock(_sfc_main$a, {
1730
1730
  key: 14,
1731
- "model-value": unref(l),
1732
- "onUpdate:modelValue": i
1731
+ "model-value": unref(o),
1732
+ "onUpdate:modelValue": s
1733
1733
  }, null, 8, ["model-value"])) : e.field.type === "mission" ? (openBlock(), createBlock(_sfc_main$3, {
1734
1734
  key: 15,
1735
- "model-value": unref(l),
1736
- "onUpdate:modelValue": i
1735
+ "model-value": unref(o),
1736
+ "onUpdate:modelValue": s
1737
1737
  }, null, 8, ["model-value"])) : e.field.type === "mission_type" ? (openBlock(), createBlock(_sfc_main$8, {
1738
1738
  key: 16,
1739
- "model-value": unref(l),
1740
- "onUpdate:modelValue": i
1739
+ "model-value": unref(o),
1740
+ "onUpdate:modelValue": s
1741
1741
  }, null, 8, ["model-value"])) : e.field.type === "mission_end" ? (openBlock(), createBlock(_sfc_main$7, {
1742
1742
  key: 17,
1743
- "model-value": unref(l),
1744
- "onUpdate:modelValue": i,
1745
- "helper-text": unref(ZodHelper).helperText(o(), ""),
1746
- "helper-state": unref(ZodHelper).helperState(o(), "")
1743
+ "model-value": unref(o),
1744
+ "onUpdate:modelValue": s,
1745
+ "helper-text": unref(ZodHelper).helperText(l(), ""),
1746
+ "helper-state": unref(ZodHelper).helperState(l(), "")
1747
1747
  }, null, 8, ["model-value", "helper-text", "helper-state"])) : e.field.type === "mission_pool" ? (openBlock(), createBlock(_sfc_main$4, {
1748
1748
  key: 18,
1749
- "model-value": unref(l),
1750
- "onUpdate:modelValue": i,
1749
+ "model-value": unref(o),
1750
+ "onUpdate:modelValue": s,
1751
1751
  mission: e.extras.mission
1752
1752
  }, null, 8, ["model-value", "mission"])) : e.field.type === "rule_schedule" ? (openBlock(), createElementBlock(Fragment, { key: 19 }, [
1753
1753
  createVNode(_sfc_main$d, {
1754
- "model-value": unref(l),
1755
- "onUpdate:modelValue": i,
1754
+ "model-value": unref(o),
1755
+ "onUpdate:modelValue": s,
1756
1756
  "start-date": e.extras.start,
1757
1757
  "end-date": e.extras.end
1758
1758
  }, null, 8, ["model-value", "start-date", "end-date"]),
@@ -1764,8 +1764,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1764
1764
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1765
1765
  ], 64)) : e.field.type === "rule_user" ? (openBlock(), createElementBlock(Fragment, { key: 20 }, [
1766
1766
  createVNode(_sfc_main$t, {
1767
- "model-value": unref(l),
1768
- "onUpdate:modelValue": i
1767
+ "model-value": unref(o),
1768
+ "onUpdate:modelValue": s
1769
1769
  }, null, 8, ["model-value"]),
1770
1770
  e.helperText ? (openBlock(), createBlock(p, {
1771
1771
  key: 0,
@@ -1774,14 +1774,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1774
1774
  state: "error"
1775
1775
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1776
1776
  ], 64)) : e.field.type === "rule_time" ? (openBlock(), createElementBlock(Fragment, { key: 21 }, [
1777
- e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(l).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
1777
+ e.extras == "PROMOTION" && unref(RuleBuilder).getRules(unref(o).rules.g_time).length > 0 ? (openBlock(), createBlock(p, {
1778
1778
  key: 0,
1779
1779
  state: "warning",
1780
1780
  text: `Time based rule only work for POS >= v${unref(featureVersionMapping).TIME_BASED_PROMOTION}`
1781
1781
  }, null, 8, ["text"])) : createCommentVNode("", !0),
1782
1782
  createVNode(_sfc_main$i, {
1783
- "model-value": unref(l),
1784
- "onUpdate:modelValue": i
1783
+ "model-value": unref(o),
1784
+ "onUpdate:modelValue": s
1785
1785
  }, null, 8, ["model-value"]),
1786
1786
  e.helperText ? (openBlock(), createBlock(p, {
1787
1787
  key: 1,
@@ -1791,8 +1791,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1791
1791
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1792
1792
  ], 64)) : e.field.type === "rule_bill" ? (openBlock(), createElementBlock(Fragment, { key: 22 }, [
1793
1793
  createVNode(_sfc_main$u, {
1794
- "model-value": unref(l),
1795
- "onUpdate:modelValue": i
1794
+ "model-value": unref(o),
1795
+ "onUpdate:modelValue": s
1796
1796
  }, null, 8, ["model-value"]),
1797
1797
  e.helperText ? (openBlock(), createBlock(p, {
1798
1798
  key: 0,
@@ -1802,8 +1802,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1802
1802
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1803
1803
  ], 64)) : e.field.type === "rule_feedback" ? (openBlock(), createElementBlock(Fragment, { key: 23 }, [
1804
1804
  createVNode(_sfc_main$v, {
1805
- "model-value": unref(l),
1806
- "onUpdate:modelValue": i
1805
+ "model-value": unref(o),
1806
+ "onUpdate:modelValue": s
1807
1807
  }, null, 8, ["model-value"]),
1808
1808
  e.helperText ? (openBlock(), createBlock(p, {
1809
1809
  key: 0,
@@ -1813,8 +1813,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1813
1813
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1814
1814
  ], 64)) : e.field.type === "rule_birthday" ? (openBlock(), createElementBlock(Fragment, { key: 24 }, [
1815
1815
  createVNode(_sfc_main$h, {
1816
- "model-value": unref(l),
1817
- "onUpdate:modelValue": i
1816
+ "model-value": unref(o),
1817
+ "onUpdate:modelValue": s
1818
1818
  }, null, 8, ["model-value"]),
1819
1819
  e.helperText ? (openBlock(), createBlock(p, {
1820
1820
  key: 0,
@@ -1824,8 +1824,8 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1824
1824
  }, null, 8, ["text"])) : createCommentVNode("", !0)
1825
1825
  ], 64)) : e.field.type === "promotion_game_type" ? (openBlock(), createElementBlock(Fragment, { key: 25 }, [
1826
1826
  createVNode(_sfc_main$9, {
1827
- "model-value": unref(l),
1828
- "onUpdate:modelValue": i
1827
+ "model-value": unref(o),
1828
+ "onUpdate:modelValue": s
1829
1829
  }, null, 8, ["model-value"]),
1830
1830
  e.helperText ? (openBlock(), createBlock(p, {
1831
1831
  key: 0,
@@ -1845,23 +1845,23 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1845
1845
  }
1846
1846
  },
1847
1847
  setup(e) {
1848
- const { t: d, te: a } = useI18n();
1848
+ const { t: c, te: a } = useI18n();
1849
1849
  return (r, u) => {
1850
- const i = resolveComponent("FmCard");
1851
- return openBlock(), createBlock(i, {
1850
+ const s = resolveComponent("FmCard");
1851
+ return openBlock(), createBlock(s, {
1852
1852
  variant: "outlined",
1853
1853
  class: "p-16 space-y-8"
1854
1854
  }, {
1855
1855
  default: withCtx(() => [
1856
- createElementVNode("div", _hoisted_1$1, toDisplayString(unref(d)("connect.campaign.common.summary")), 1),
1856
+ createElementVNode("div", _hoisted_1$1, toDisplayString(unref(c)("connect.campaign.common.summary")), 1),
1857
1857
  _hoisted_2$1,
1858
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (l, o) => (openBlock(), createElementBlock("div", {
1858
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(getCampaignSummaryObject)(e.data), (o, l) => (openBlock(), createElementBlock("div", {
1859
1859
  class: "space-y-4",
1860
- key: o
1860
+ key: l
1861
1861
  }, [
1862
- l ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1863
- createElementVNode("div", _hoisted_3$1, toDisplayString(unref(d)(`${o}`)), 1),
1864
- createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${l}`) ? unref(d)(`${l}`) : l), 1)
1862
+ o ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1863
+ createElementVNode("div", _hoisted_3$1, toDisplayString(unref(c)(`${l}`)), 1),
1864
+ createElementVNode("div", _hoisted_4$1, toDisplayString(unref(a)(`${o}`) ? unref(c)(`${o}`) : o), 1)
1865
1865
  ], 64)) : createCommentVNode("", !0)
1866
1866
  ]))), 128))
1867
1867
  ]),
@@ -1901,7 +1901,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1901
1901
  TEMPLATES.VOUCHER
1902
1902
  ), { minor } = useLoading, isLoading = ref(!1), sheetTitle = ref("Create Campaign");
1903
1903
  async function showSheet(visible, type, campaign, selectedTemplate) {
1904
- var e, d;
1904
+ var e, c;
1905
1905
  if (sheetVisible.value = visible, visible == !0) {
1906
1906
  try {
1907
1907
  isLoading.value = visible, await useMembershipStore().readRewards(), await useBusinessStore().readLocations(), await useMembershipStore().readSegments(), await useMembershipStore().readMembership();
@@ -1918,7 +1918,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1918
1918
  path: ["campaign", "code"]
1919
1919
  });
1920
1920
  })), data.value = campaign != null ? { ...campaign, templateId: (e = campaign.template) == null ? void 0 : e._id } : _.cloneDeep({
1921
- ...(d = template.value) == null ? void 0 : d.defaultValue
1921
+ ...(c = template.value) == null ? void 0 : c.defaultValue
1922
1922
  }), "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`;
1923
1923
  }
1924
1924
  }
@@ -1945,10 +1945,10 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1945
1945
  return e.success ? [] : e.error.errors;
1946
1946
  });
1947
1947
  function stepErrors(e = currentStep.value - 1) {
1948
- const d = template.value.steps[e].groups.flatMap(
1948
+ const c = template.value.steps[e].groups.flatMap(
1949
1949
  (a) => a.fields.map((r) => r.property)
1950
1950
  );
1951
- return errors.value.filter((a) => d.includes(a.path.join(".")));
1951
+ return errors.value.filter((a) => c.includes(a.path.join(".")));
1952
1952
  }
1953
1953
  __expose({ showSheet });
1954
1954
  function showSummaryDialog() {
@@ -1960,17 +1960,17 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1960
1960
  }
1961
1961
  });
1962
1962
  }
1963
- function onUpdateProperty(e, d) {
1964
- if (_.set(data.value, e, d), e == "campaign.event.type") {
1965
- const a = RuleBuilder.setRuleToGroup(
1966
- RuleBuilder.scaffoldGroup(),
1967
- [
1968
- RuleBuilder.scaffoldGroup("g_schedule"),
1969
- RuleBuilder.scaffoldGroup("g_time"),
1970
- RuleBuilder.scaffoldGroup("g_user"),
1971
- RuleBuilder.scaffoldGroup("g_bill")
1972
- ]
1973
- ), r = RuleBuilder.setRuleToGroup(
1963
+ function onUpdateProperty(e, c) {
1964
+ var a, r, u, s, o, l, n, d;
1965
+ if (_.set(data.value, e, c), e == "campaign.event.type") {
1966
+ const y = ((s = (u = (r = (a = template.value) == null ? void 0 : a.defaultValue) == null ? void 0 : r.campaign) == null ? void 0 : u.event) == null ? void 0 : s.rule) ? _.cloneDeep({
1967
+ ...(d = (n = (l = (o = template.value) == null ? void 0 : o.defaultValue) == null ? void 0 : l.campaign) == null ? void 0 : n.event) == null ? void 0 : d.rule
1968
+ }) : RuleBuilder.setRuleToGroup(RuleBuilder.scaffoldGroup(), [
1969
+ RuleBuilder.scaffoldGroup("g_schedule"),
1970
+ RuleBuilder.scaffoldGroup("g_time"),
1971
+ RuleBuilder.scaffoldGroup("g_user"),
1972
+ RuleBuilder.scaffoldGroup("g_bill")
1973
+ ]), v = RuleBuilder.setRuleToGroup(
1974
1974
  RuleBuilder.scaffoldGroup("g_schedule"),
1975
1975
  [
1976
1976
  RuleBuilder.constructEntry(
@@ -1982,29 +1982,29 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
1982
1982
  ],
1983
1983
  "&&"
1984
1984
  );
1985
- if (d != "SCHEDULE") {
1986
- _.set(data.value, "campaign.event.rule", a);
1985
+ if (c != "SCHEDULE") {
1986
+ _.set(data.value, "campaign.event.rule", y);
1987
1987
  return;
1988
1988
  }
1989
1989
  _.set(
1990
1990
  data.value,
1991
1991
  "campaign.event.rule",
1992
- RuleBuilder.setRuleToGroup(a, r)
1992
+ RuleBuilder.setRuleToGroup(y, v)
1993
1993
  );
1994
1994
  }
1995
- e == "campaign.notify" && d == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
1995
+ e == "campaign.notify" && c == !1 && _.set(data.value, "campaign.notifyMessage", void 0);
1996
1996
  }
1997
- async function onUpdateFile(e, d) {
1998
- return e ? await minor(async () => firebaseStorage.update(d, e), {
1997
+ async function onUpdateFile(e, c) {
1998
+ return e ? await minor(async () => firebaseStorage.update(c, e), {
1999
1999
  message: `${e ? "Uploading" : "Removing"} file`,
2000
2000
  successMessage: `File ${e ? "uploaded" : "removed"} successfully`
2001
2001
  }) : "";
2002
2002
  }
2003
2003
  function isDisable(e) {
2004
- var d, a;
2004
+ var c, a;
2005
2005
  switch (e == null ? void 0 : e.property) {
2006
2006
  case "campaign.event.type":
2007
- return ((a = (d = data.value) == null ? void 0 : d.campaign) == null ? void 0 : a._id) || !1;
2007
+ return ((a = (c = data.value) == null ? void 0 : c.campaign) == null ? void 0 : a._id) || !1;
2008
2008
  default:
2009
2009
  return !1;
2010
2010
  }
@@ -2013,14 +2013,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2013
2013
  const e = schema.value.superRefine(campaignRefinement).transform(campaignTransform).safeParse(data.value);
2014
2014
  e.success && (emits("submit:model-value", cleanPF(JSON.parse(JSON.stringify(e.data)))), sheetVisible.value = !1);
2015
2015
  }
2016
- return (e, d) => {
2017
- const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), i = resolveComponent("FmCard"), l = resolveComponent("FmTopSheet");
2018
- return openBlock(), createBlock(l, {
2016
+ return (e, c) => {
2017
+ const a = resolveComponent("FmButton"), r = resolveComponent("FmStep"), u = resolveComponent("FmStepper"), s = resolveComponent("FmCard"), o = resolveComponent("FmTopSheet");
2018
+ return openBlock(), createBlock(o, {
2019
2019
  "fullscreen-size": "lg",
2020
2020
  modelValue: unref(sheetVisible),
2021
2021
  "onUpdate:modelValue": [
2022
- d[7] || (d[7] = (o) => isRef(sheetVisible) ? sheetVisible.value = o : null),
2023
- d[8] || (d[8] = (o) => sheetVisible.value = o)
2022
+ c[7] || (c[7] = (l) => isRef(sheetVisible) ? sheetVisible.value = l : null),
2023
+ c[8] || (c[8] = (l) => sheetVisible.value = l)
2024
2024
  ]
2025
2025
  }, createSlots({
2026
2026
  "top-sheet-header": withCtx(() => [
@@ -2028,7 +2028,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2028
2028
  createElementVNode("div", null, toDisplayString(unref(sheetTitle)), 1),
2029
2029
  createElementVNode("div", _hoisted_2, [
2030
2030
  createVNode(a, {
2031
- onClick: d[0] || (d[0] = (o) => hideSheet()),
2031
+ onClick: c[0] || (c[0] = (l) => hideSheet()),
2032
2032
  label: unref(t)("connect.campaign.common.cancel"),
2033
2033
  variant: "tertiary"
2034
2034
  }, null, 8, ["label"]),
@@ -2049,7 +2049,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2049
2049
  createElementVNode("div", _hoisted_10, [
2050
2050
  createElementVNode("div", _hoisted_11, [
2051
2051
  _hoisted_12,
2052
- createVNode(i, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2052
+ createVNode(s, { class: "h-[150px] bg-fm-color-neutral-gray-100" })
2053
2053
  ])
2054
2054
  ])
2055
2055
  ])
@@ -2061,14 +2061,14 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2061
2061
  unref(data) ? (openBlock(), createElementBlock("div", _hoisted_3, [
2062
2062
  createVNode(u, {
2063
2063
  modelValue: unref(currentStep),
2064
- "onUpdate:modelValue": d[1] || (d[1] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2064
+ "onUpdate:modelValue": c[1] || (c[1] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2065
2065
  orientation: "horizontal",
2066
2066
  class: "xs:hidden mx-[-24px] mt-16 mb-24 flex-1"
2067
2067
  }, {
2068
2068
  default: withCtx(() => [
2069
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
2070
- key: o.name,
2071
- title: unref(t)(o.name),
2069
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(r, {
2070
+ key: l.name,
2071
+ title: unref(t)(l.name),
2072
2072
  value: n + 1,
2073
2073
  error: () => stepErrors(n).length > 0,
2074
2074
  complete: () => n + 1 <= unref(currentStep)
@@ -2080,19 +2080,19 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2080
2080
  createVNode(a, {
2081
2081
  icon: "close",
2082
2082
  variant: "tertiary",
2083
- onClick: d[2] || (d[2] = (o) => sheetVisible.value = !1)
2083
+ onClick: c[2] || (c[2] = (l) => sheetVisible.value = !1)
2084
2084
  }),
2085
2085
  createVNode(u, {
2086
2086
  modelValue: unref(currentStep),
2087
- "onUpdate:modelValue": d[3] || (d[3] = (o) => isRef(currentStep) ? currentStep.value = o : null),
2087
+ "onUpdate:modelValue": c[3] || (c[3] = (l) => isRef(currentStep) ? currentStep.value = l : null),
2088
2088
  orientation: "horizontal",
2089
2089
  class: "flex-1"
2090
2090
  }, {
2091
2091
  default: withCtx(() => [
2092
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (o, n) => (openBlock(), createBlock(r, {
2093
- key: o.name,
2092
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps, (l, n) => (openBlock(), createBlock(r, {
2093
+ key: l.name,
2094
2094
  title: unref(sheetTitle),
2095
- description: unref(t)(o.name),
2095
+ description: unref(t)(l.name),
2096
2096
  value: n + 1,
2097
2097
  error: () => stepErrors(n).length > 0,
2098
2098
  complete: () => n + 1 <= unref(currentStep) && stepErrors(unref(currentStep) - 1).length == 0
@@ -2103,7 +2103,7 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2103
2103
  createVNode(a, {
2104
2104
  icon: "info",
2105
2105
  variant: "tertiary",
2106
- onClick: d[4] || (d[4] = () => showSummaryDialog())
2106
+ onClick: c[4] || (c[4] = () => showSummaryDialog())
2107
2107
  })
2108
2108
  ]),
2109
2109
  createElementVNode("div", _hoisted_5, [
@@ -2112,40 +2112,40 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2112
2112
  json: {
2113
2113
  data: unref(data),
2114
2114
  errors: unref(errors).map(
2115
- (o) => `${o.path.join(".")} - ${o.message}`
2115
+ (l) => `${l.path.join(".")} - ${l.message}`
2116
2116
  ),
2117
2117
  stepErrors: stepErrors().map(
2118
- (o) => `${o.path.join(".")} - ${o.message}`
2118
+ (l) => `${l.path.join(".")} - ${l.message}`
2119
2119
  ),
2120
2120
  schema: unref(schema)
2121
2121
  }
2122
2122
  }, null, 8, ["json"]),
2123
2123
  (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(template).steps[unref(currentStep) - 1].groups.filter(
2124
- (o) => o.fields.length && (!o.condition || unref(_).get(unref(data), o.condition.property) == o.condition.value == (o.condition.not != !0))
2125
- ), (o, n) => (openBlock(), createElementBlock("div", {
2124
+ (l) => l.fields.length && (!l.condition || unref(_).get(unref(data), l.condition.property) == l.condition.value == (l.condition.not != !0))
2125
+ ), (l, n) => (openBlock(), createElementBlock("div", {
2126
2126
  key: n,
2127
2127
  class: "space-y-24"
2128
2128
  }, [
2129
- createElementVNode("div", _hoisted_7, toDisplayString(o.name ? unref(t)(o.name) : ""), 1),
2130
- (openBlock(!0), createElementBlock(Fragment, null, renderList(o.fields, (c, g) => (openBlock(), createElementBlock("div", { key: g }, [
2129
+ createElementVNode("div", _hoisted_7, toDisplayString(l.name ? unref(t)(l.name) : ""), 1),
2130
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(l.fields, (d, g) => (openBlock(), createElementBlock("div", { key: g }, [
2131
2131
  (openBlock(), createBlock(_sfc_main$2, {
2132
2132
  key: g,
2133
- field: c,
2134
- modelValue: unref(_).get(unref(data), c.property),
2135
- disabled: isDisable(c),
2136
- "onUpdate:modelValue": (y) => onUpdateProperty(c.property, y),
2133
+ field: d,
2134
+ modelValue: unref(_).get(unref(data), d.property),
2135
+ disabled: isDisable(d),
2136
+ "onUpdate:modelValue": (y) => onUpdateProperty(d.property, y),
2137
2137
  "onUpdate:file": async (y, v) => {
2138
2138
  const h = await onUpdateFile(y, v);
2139
- onUpdateProperty(c.property, h || "");
2139
+ onUpdateProperty(d.property, h || "");
2140
2140
  },
2141
2141
  schema: unref(ZodHelper).typeAtPath(
2142
2142
  unref(schema),
2143
- c.property,
2143
+ d.property,
2144
2144
  unref(data).campaign.type != "MISSION" ? [unref(data).campaign.type] : ["STAMP", "MISSION"]
2145
2145
  ),
2146
- "helper-state": unref(ZodHelper).helperState(unref(errors), c.property),
2147
- "helper-text": unref(ZodHelper).helperText(unref(errors), c.property),
2148
- extras: c.extras != null ? c.extras == "" ? unref(data) : unref(_).get(unref(data), c.extras) : void 0
2146
+ "helper-state": unref(ZodHelper).helperState(unref(errors), d.property),
2147
+ "helper-text": unref(ZodHelper).helperText(unref(errors), d.property),
2148
+ extras: d.extras != null ? d.extras == "" ? unref(data) : unref(_).get(unref(data), d.extras) : void 0
2149
2149
  }, null, 8, ["field", "modelValue", "disabled", "onUpdate:modelValue", "onUpdate:file", "schema", "helper-state", "helper-text", "extras"]))
2150
2150
  ]))), 128))
2151
2151
  ]))), 128)),
@@ -2154,12 +2154,12 @@ const sentenceCase = changeKeysFactory(sentenceCase$1), _hoisted_1$4 = { class:
2154
2154
  label: "Back",
2155
2155
  variant: "tertiary",
2156
2156
  disabled: unref(currentStep) == 1,
2157
- onClick: d[5] || (d[5] = (o) => currentStep.value--)
2157
+ onClick: c[5] || (c[5] = (l) => currentStep.value--)
2158
2158
  }, null, 8, ["disabled"]),
2159
2159
  createVNode(a, {
2160
2160
  disabled: unref(currentStep) - 1 < unref(template).steps.length - 1 ? stepErrors().length > 0 : unref(errors).length > 0,
2161
2161
  label: unref(currentStep) - 1 < unref(template).steps.length - 1 ? "Next" : "Submit",
2162
- onClick: d[6] || (d[6] = (o) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2162
+ onClick: c[6] || (c[6] = (l) => unref(currentStep) - 1 < unref(template).steps.length - 1 ? currentStep.value++ : onSubmit())
2163
2163
  }, null, 8, ["disabled", "label"])
2164
2164
  ])
2165
2165
  ]),