@feedmepos/mf-connect 0.1.98-beta.7 → 0.1.98-beta.71

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 (152) hide show
  1. package/dist/{App-BonFFUVJ.js → App-B-Onur9k.js} +812 -666
  2. package/dist/{AuditLogs-CaQisyMC.js → AuditLogs-BnEeKG1C.js} +14 -13
  3. package/dist/{Bin-Mu8gAiHw.js → Bin-BH9_nATR.js} +8 -8
  4. package/dist/Broadcast-Gt2ZLLpZ.js +302 -0
  5. package/dist/CampaignAnalytic-BT6zTgNk.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-BoLZVrCU.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-nNLLEzii.js} +6 -5
  7. package/dist/Card-dD52oor7.js +1084 -0
  8. package/dist/{Collections-CByXxRW_.js → Collections-7bwYNl3M.js} +14 -13
  9. package/dist/Credit-qZdlqXqR.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-DeNn_k19.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C09W9Qja.js +4213 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-BXsAX1Xa.js → EffectSheet.vue_vue_type_style_index_0_lang-Bz1HRBMa.js} +35 -35
  13. package/dist/{Experience-B7J-aqPK.js → Experience-CAaWgWXP.js} +112 -86
  14. package/dist/{FileSaver.min-D_F_MSZt.js → FileSaver.min-BpfY6VnX.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-fhrbFb_5.js +356 -0
  17. package/dist/GiftCardSetup-CTwmNKim.js +736 -0
  18. package/dist/{Grab-C45MmlD9.js → Grab-BnPfb92x.js} +33 -32
  19. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CPPcB3PC.js → ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js} +1 -1
  20. package/dist/{Index-vQ6uP49O.js → Index-DRwvmm_j.js} +10 -10
  21. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cj3hN3tg.js → LocationPicker.vue_vue_type_script_setup_true_lang-Ya4r9NNE.js} +1 -1
  22. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DU9eIein.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CDwtqqLQ.js} +1 -1
  23. package/dist/LoyaltyDashboard-8jn6SIWo.js +2865 -0
  24. package/dist/MainLayout-Bf42AcB1.js +143 -0
  25. package/dist/{Marketing-B6xMdQvW.js → Marketing-DruTMjiR.js} +7 -6
  26. package/dist/{MarketingMaterialEdit-0cZN4bek.js → MarketingMaterialEdit-moEHd_gP.js} +15 -14
  27. package/dist/Member-C9VTQqIm.js +654 -0
  28. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-DEsVSWmv.js +1279 -0
  29. package/dist/MemberImportHistory-DZVwya9v.js +187 -0
  30. package/dist/MemberList-KusIfy1u.js +334 -0
  31. package/dist/{MemberTransactions-Bg-ziZy8.js → MemberTransactions-msyjdzlI.js} +1 -1
  32. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jbDJkbZh.js → MessageInput.vue_vue_type_script_setup_true_lang-DbV-m3cC.js} +5928 -5644
  33. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1DYGpJnD.js +40 -0
  34. package/dist/Mission-CUUxpBUF.js +360 -0
  35. package/dist/{Overview-nsyJGSCq.js → Overview-C9jyKXHX.js} +21 -20
  36. package/dist/Overview-CYKoF8Hp.js +1316 -0
  37. package/dist/Point-CPpQ07yp.js +288 -0
  38. package/dist/Promotion-CJ95m9Qb.js +423 -0
  39. package/dist/{Queue-Dkipt6fw.js → Queue-CX39ILh_.js} +14 -13
  40. package/dist/{Record-BFqx6vM-.js → Record-6I0qyXB5.js} +9 -9
  41. package/dist/Review-DoWu2XNT.js +45 -0
  42. package/dist/ReviewFacebookCallback-Co-5TnI7.js +238 -0
  43. package/dist/ReviewGoogleCallback-Ca7ZuMcF.js +213 -0
  44. package/dist/{Reward-DjFEE7I_.js → Reward-Cx_N6qBJ.js} +35 -35
  45. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BzZ6VH80.js → RewardGroup.vue_vue_type_script_setup_true_lang-Cn5Yp37p.js} +14 -13
  46. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-A9jQX4jt.js → RuleGroup.vue_vue_type_script_setup_true_lang-M0c67Dyl.js} +196 -186
  47. package/dist/{Segment-BAjdUfZ6.js → Segment-Bx0EW966.js} +275 -276
  48. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CAQPFzRH.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-ahvrEUGa.js} +37 -36
  49. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Gkz8jhES.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C7zSfZdl.js} +4 -4
  50. package/dist/{Setting-BK7y0XC-.js → Setting-DzEK3dWj.js} +14 -14
  51. package/dist/{SettingAdvertisements-DfQ645xr.js → SettingAdvertisements-BNALbI88.js} +12 -12
  52. package/dist/Settings-Cw85-xzq.js +230 -0
  53. package/dist/Store-BSqW1gwf.js +2612 -0
  54. package/dist/{StoreRewards-usHKOGmB.js → StoreRewards-CJXnS8Qf.js} +15 -15
  55. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-C6tUwHEj.js +1329 -0
  56. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DrcWUZuR.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-iylphGuV.js} +2 -2
  57. package/dist/{Tier-BF3V430O.js → Tier-DfitNxp2.js} +2580 -754
  58. package/dist/{Title-DwPuqKfJ.js → Title-QCbtOvKB.js} +39 -37
  59. package/dist/Transaction-dOCzlidD.js +45 -0
  60. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DToNRTJS.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Be5X1C-Y.js} +26 -26
  61. package/dist/{Voucher-DnhVIl_o.js → Voucher-BfoCDwjg.js} +156 -133
  62. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Btb3UZCn.js → VoucherEditor.vue_vue_type_script_setup_true_lang-0EIYoZ0F.js} +118 -124
  63. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-EFUW9DMY.js → ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js} +2 -2
  64. package/dist/{app-i3r-6ZVm.js → app-BxTElIm-.js} +45168 -37577
  65. package/dist/app.js +1 -1
  66. package/dist/base.export-BmUK8hMh.js +75 -0
  67. package/dist/{business-i0Gxk7gG.js → business-DjAiT8tR.js} +5 -5
  68. package/dist/campaign-DlR3KF9m.js +368 -0
  69. package/dist/campaign-tAmQNoq7.js +100 -0
  70. package/dist/{campaign.enum-CbUTfxek.js → campaign.enum-BjwEQd11.js} +1 -1
  71. package/dist/{campaign.fn-BjHSIDd1.js → campaign.fn-C6kWWIQx.js} +53 -53
  72. package/dist/{collectible.enum-DN7E_kHg.js → collectible.enum-BrtXpT9S.js} +1 -1
  73. package/dist/collection.fn-CDhfM3Eq.js +26 -0
  74. package/dist/currency-10nX5QnT.js +7 -0
  75. package/dist/{duplicateCampaign-DmdJQEIA.js → duplicateCampaign-6oMZOvfM.js} +11 -11
  76. package/dist/{effect-DM4AzeQl.js → effect-T4YzuTc5.js} +1 -1
  77. package/dist/{email-addresses-BlqVJhwZ.js → email-addresses-BjODnJMM.js} +209 -201
  78. package/dist/google-C3S8u0mT.js +4 -0
  79. package/dist/{helper-CkdISSVP.js → helper-BCl5r5yZ.js} +1 -1
  80. package/dist/{index-DgzNGQgE.js → index-B9ZMIUMa.js} +2083 -2559
  81. package/dist/{index-CB7ytKOE.js → index-BBsK7TUw.js} +1588 -1522
  82. package/dist/index-BQk6zTgf.js +32437 -0
  83. package/dist/index-Bd4clHfr.js +901 -0
  84. package/dist/index-BeVWchv7.js +14550 -0
  85. package/dist/index-Bht1Z11w.js +72 -0
  86. package/dist/{index-FD50UHqf.js → index-BiolIgqR.js} +105 -123
  87. package/dist/{index-Cl8t41Sk.js → index-BxU--5J5.js} +5 -5
  88. package/dist/index-Bz6oSli7.js +151 -0
  89. package/dist/index-C5IfNJUl.js +53 -0
  90. package/dist/{index-BWsj6lCJ.js → index-CRvUvCMA.js} +14 -14
  91. package/dist/{index-B6xi1soU.js → index-CnaQt4Pn.js} +1 -1
  92. package/dist/{index-4EtrCy_K.js → index-Ctja--IE.js} +4 -4
  93. package/dist/{index-D6qeYVNz.js → index-D8rGhchh.js} +1 -1
  94. package/dist/{index-BrboOmPq.js → index-DJdTDF9C.js} +347 -216
  95. package/dist/index-DXiJa8Cw.js +137 -0
  96. package/dist/{index-CxdLExX0.js → index-DeQKLilv.js} +24 -9
  97. package/dist/{index-vI-ndGu_.js → index-DhtKt4OL.js} +5 -5
  98. package/dist/{index.esm2017-BX5CyKoc.js → index.esm2017-CEOegJjn.js} +132 -132
  99. package/dist/{loading-DTKDhqew.js → loading-Dx4SCvZY.js} +1 -1
  100. package/dist/{lodash-CCPBsqhe.js → lodash-Dq8OKCKK.js} +1 -1
  101. package/dist/member-import-DX-jn2uk.js +187 -0
  102. package/dist/membership-CltAa-gH.js +274 -0
  103. package/dist/{money-wMK3QkZ5.js → money-DsaAjJTI.js} +1 -1
  104. package/dist/{number-DjKVlWn0.js → number-DmhHKYgY.js} +1 -1
  105. package/dist/objectid-BdNv-dZX.js +145 -0
  106. package/dist/{plugins-D25PaNJk.js → plugins-BFKVM3uC.js} +13 -12
  107. package/dist/remy-Qz_pNsUS.js +13 -0
  108. package/dist/{reward-E63jqJHm.js → reward--SjvIeyy.js} +1 -1
  109. package/dist/{rule-RVvPtAnk.js → rule-CAKdNobZ.js} +335 -275
  110. package/dist/style.css +1 -1
  111. package/dist/{template-zNxOQaqe.js → template-Cfxc5eM8.js} +6 -6
  112. package/dist/timezone-D2b-V5XD.js +20 -0
  113. package/dist/transaction.fn-B5mLY7bz.js +71 -0
  114. package/dist/{trigger-BXV02FhP.js → trigger-DvYcjRBZ.js} +17 -17
  115. package/dist/useMarketingMaterialActions-DtqnjMSt.js +96 -0
  116. package/dist/{usePagination-BPcPhEnp.js → usePagination-DKX24g31.js} +1 -1
  117. package/dist/{user-Bd8S7R5u.js → user-fWb1NxGO.js} +1 -1
  118. package/dist/vue-i18n-wJReAVJw.js +2365 -0
  119. package/dist/{xlsx-_tQC9Ezf.js → xlsx-Mthhu4JR.js} +440 -440
  120. package/dist/{zod-C1j2GLZP.js → zod-CVpVUgBZ.js} +1 -1
  121. package/package.json +10 -6
  122. package/dist/Broadcast-Cy-i-WOT.js +0 -266
  123. package/dist/Card-f2XOtWxp.js +0 -910
  124. package/dist/Credit-CcZF4aQS.js +0 -260
  125. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  126. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7KZ8GMx.js +0 -3377
  127. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  128. package/dist/Game-CUW7NeVG.js +0 -330
  129. package/dist/LoyaltyDashboard-GqyUwvXz.js +0 -1082
  130. package/dist/MainLayout-R5NxIBR-.js +0 -41
  131. package/dist/Member-CC5F6Bmz.js +0 -280
  132. package/dist/MemberList-Cq4zxopX.js +0 -1601
  133. package/dist/Mission-DcCZ6tAG.js +0 -334
  134. package/dist/Point-D1vLd5hL.js +0 -262
  135. package/dist/Promotion-Cv7MW5RJ.js +0 -397
  136. package/dist/Review-CKhakUMe.js +0 -1123
  137. package/dist/ReviewFacebookCallback-xgRpXQAg.js +0 -243
  138. package/dist/ReviewGoogleCallback-Cqi_43qi.js +0 -208
  139. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-DDqK4kV1.js +0 -181
  140. package/dist/Store-uTRQ6KbC.js +0 -1996
  141. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-Bb2sTsuA.js +0 -1130
  142. package/dist/Transaction-CnTEfMGU.js +0 -39
  143. package/dist/campaign-CbMlARNI.js +0 -219
  144. package/dist/campaign-f7FT91GR.js +0 -277
  145. package/dist/export-DQR-0lmK.js +0 -97
  146. package/dist/index-COrXX9MR.js +0 -52
  147. package/dist/index-CWiaP-aV.js +0 -28900
  148. package/dist/index-jVfDVEtz.js +0 -85
  149. package/dist/membership-rifuatxU.js +0 -255
  150. package/dist/objectid-DjpWkCxH.js +0 -145
  151. package/dist/useMarketingMaterialActions-5TFNqZVo.js +0 -107
  152. package/dist/vue-i18n-CgMK-TaC.js +0 -2365
@@ -0,0 +1,2612 @@
1
+ import { defineComponent as X, computed as E, resolveComponent as v, openBlock as m, createBlock as R, withCtx as I, createElementVNode as n, toDisplayString as F, createVNode as i, createCommentVNode as M, createElementBlock as T, unref as e, Fragment as W, renderList as de, ref as O, isRef as ve, reactive as at, onMounted as De, watch as He, toRaw as st, createTextVNode as le, h as lt, normalizeStyle as Qe, normalizeClass as $e } from "vue";
2
+ import { _ as it } from "./tier-BJDhpH6X.js";
3
+ import { useDialog as ze, useDialogChild as We, components as rt } from "@feedmepos/ui-library";
4
+ import { c as K, e as Me, S as Ge } from "./index-BQk6zTgf.js";
5
+ import { u as et } from "./loading-Dx4SCvZY.js";
6
+ import { u as Ye, C as Te } from "./membership-CltAa-gH.js";
7
+ import { l as ct, m as dt, n as ut, o as Xe, p as mt, q as pt } from "./index-B9ZMIUMa.js";
8
+ import { a as ft, c as Ae } from "./object-BYyQ0PZp.js";
9
+ import { _ as pe } from "./lodash-Dq8OKCKK.js";
10
+ import { c as Ce } from "./index-BxU--5J5.js";
11
+ import { u as he } from "./vue-i18n-wJReAVJw.js";
12
+ import { Z as re, g as ae, a as se } from "./zod-CVpVUgBZ.js";
13
+ import { z as ce, R as Oe } from "./app-BxTElIm-.js";
14
+ import { u as Le } from "./app-wDQR6dpb.js";
15
+ import { _ as ge } from "./ZodTextField.vue_vue_type_script_setup_true_lang-UdStgKbX.js";
16
+ import { c as yt, p as Ie, n as gt, f as je } from "./plugins-BFKVM3uC.js";
17
+ import { J as Je } from "./JsonViewer-v8_C7l5N.js";
18
+ import { _ as bt } from "./index-BBsK7TUw.js";
19
+ import { _ as vt } from "./ImageInput.vue_vue_type_script_setup_true_lang-BySju1oT.js";
20
+ import { _ as ht } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
21
+ import { z as xt, a as _t } from "./money-DsaAjJTI.js";
22
+ import { f as Ct } from "./currency-10nX5QnT.js";
23
+ import { F as St } from "./number-DmhHKYgY.js";
24
+ import { a as Ft, t as wt } from "./helper-BCl5r5yZ.js";
25
+ import "./index-D8rGhchh.js";
26
+ import "./index-DJdTDF9C.js";
27
+ import "./index-Bd4clHfr.js";
28
+ import "./index-DhtKt4OL.js";
29
+ import { m as $t } from "./index-DXiJa8Cw.js";
30
+ import { m as Ue } from "./index-DeQKLilv.js";
31
+ import { g as qe } from "./index-C5IfNJUl.js";
32
+ import { u as kt } from "./business-DjAiT8tR.js";
33
+ import { useRouter as Pt } from "vue-router";
34
+ function tt(b) {
35
+ return Ce.DineroFactory(b).toUnit();
36
+ }
37
+ function ot(b, a, c, g, d = [], h = []) {
38
+ const o = bt.compact(
39
+ a.map((t) => b.find((r) => r.systemCode === t.systemCode && r.taxCode === t.taxCode)).filter((t) => !!t && h.includes(t.systemCode))
40
+ ), l = o.reduce(
41
+ (t, r) => {
42
+ var p;
43
+ return Object.assign(t, {
44
+ [r.taxCode]: {
45
+ inclusive: ((p = d.find((y) => y.systemCode === r.systemCode)) == null ? void 0 : p.inclusive) || !1,
46
+ adjustment: {
47
+ level: 1,
48
+ type: {
49
+ type: "BY_MULTIPLIER",
50
+ amount: {
51
+ amount: r.rate.amount,
52
+ precision: r.rate.precision,
53
+ currency: "MYR"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ });
59
+ },
60
+ {}
61
+ ), f = Ce.Calculator.calculate({
62
+ items: {
63
+ 0: {
64
+ quantity: 1,
65
+ adjustments: {
66
+ price: {
67
+ level: 0,
68
+ type: {
69
+ type: "BY_AMOUNT",
70
+ amount: Ce.DineroFactory(c).subtract(Ce.Dinero.fromNumber({ number: g }).toObject()).toObject()
71
+ }
72
+ }
73
+ },
74
+ taxes: l
75
+ }
76
+ },
77
+ adjustments: {},
78
+ roundToNearest: 0
79
+ });
80
+ return o.map((t) => ({
81
+ setting: t,
82
+ systemCode: t.systemCode,
83
+ name: t.name,
84
+ taxCode: t.taxCode,
85
+ rate: t.rate,
86
+ total: Ce.DineroFactory({
87
+ ...f.items[0].taxes[t.taxCode].amount
88
+ }).convertPrecision(2).toObject()
89
+ }));
90
+ }
91
+ function nt(b, a, c) {
92
+ return b ? b.reduce((g, d) => {
93
+ var h;
94
+ return (h = c.find((o) => o.systemCode === d.systemCode)) != null && h.inclusive || (g = Ce.DineroFactory(g.toObject()).add(d.total)), g;
95
+ }, Ce.DineroFactory(a)).toObject() : Ce.DineroFactory(a).toObject();
96
+ }
97
+ const Vt = { class: "flex justify-between items-start gap-4 w-full" }, Tt = { class: "fm-typo-en-body-lg-600 text-left pt-4 break-words line-clamp-2" }, Rt = { class: "flex-shrink-0 -mr-8 -mt-8" }, It = { class: "relative h-[120px] aspect-video flex mx-auto items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, Ut = ["src"], Et = {
98
+ key: 2,
99
+ class: "absolute top-2 left-2"
100
+ }, Dt = { class: "flex flex-col gap-8 flex-1 text-left w-full" }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Nt = { class: "flex gap-8 items-center flex-wrap" }, Mt = /* @__PURE__ */ X({
101
+ __name: "StoreBundleCard",
102
+ props: {
103
+ bundle: { type: Object, required: !0 }
104
+ },
105
+ emits: ["edit", "delete", "send"],
106
+ setup(b, { emit: a }) {
107
+ const c = b, g = a, d = E(() => {
108
+ const o = [];
109
+ return c.bundle.price.amount > 0 && o.push(
110
+ `${K.Config.getCountry().currency.symbol}${tt(c.bundle.price)}`
111
+ ), c.bundle.coinPrice && o.push(`${c.bundle.coinPrice} point(s)`), o.join(" or ");
112
+ }), h = E(() => {
113
+ var l, f;
114
+ const o = [];
115
+ if (c.bundle.titles.length > 0 && o.push(`${c.bundle.titles.length} title(s)`), c.bundle.vouchers.length > 0 && o.push(`${c.bundle.vouchers.length} voucher(s)`), c.bundle.credit.normal || (l = c.bundle.credit.free) != null && l.amount) {
116
+ const t = c.bundle.credit.normal + (((f = c.bundle.credit.free) == null ? void 0 : f.amount) ?? 0);
117
+ o.push(`${t} credit(s)`);
118
+ }
119
+ return o;
120
+ });
121
+ return (o, l) => {
122
+ const f = v("FmButton"), t = v("FmMenuItem"), r = v("FmMenu"), p = v("FmIcon"), y = v("FmChip"), w = v("FmCard");
123
+ return m(), R(w, {
124
+ variant: "outlined",
125
+ class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full"
126
+ }, {
127
+ default: I(() => [
128
+ n("div", Vt, [
129
+ n("div", Tt, F(b.bundle.name), 1),
130
+ n("div", Rt, [
131
+ i(r, { placement: "bottom-end" }, {
132
+ "menu-button": I(() => [
133
+ i(f, {
134
+ icon: "more_vert",
135
+ variant: "tertiary"
136
+ })
137
+ ]),
138
+ default: I(() => [
139
+ i(t, {
140
+ onClick: l[0] || (l[0] = (u) => g("edit", b.bundle)),
141
+ icon: "edit",
142
+ label: "Edit"
143
+ }),
144
+ b.bundle.stripePriceId ? M("", !0) : (m(), R(t, {
145
+ key: 0,
146
+ onClick: l[1] || (l[1] = (u) => g("send", b.bundle)),
147
+ icon: "send",
148
+ label: "Send"
149
+ })),
150
+ i(t, {
151
+ onClick: l[2] || (l[2] = (u) => g("delete", b.bundle)),
152
+ icon: "delete"
153
+ }, {
154
+ label: I(() => [...l[3] || (l[3] = [
155
+ n("div", { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, " Delete ", -1)
156
+ ])]),
157
+ _: 1
158
+ })
159
+ ]),
160
+ _: 1
161
+ })
162
+ ])
163
+ ]),
164
+ n("div", It, [
165
+ b.bundle.image ? (m(), T("img", {
166
+ key: 1,
167
+ src: b.bundle.image,
168
+ class: "w-full h-full object-contain aspect-video"
169
+ }, null, 8, Ut)) : (m(), R(p, {
170
+ key: 0,
171
+ name: "image",
172
+ outline: !0,
173
+ size: "md",
174
+ class: "text-fm-color-neutral-gray-200"
175
+ })),
176
+ b.bundle.isFeedvibe ? (m(), T("div", Et, [
177
+ i(y, {
178
+ label: "Feedvibe",
179
+ class: "text-fm-color-primary bg-fm-color-system-warning-100",
180
+ compact: ""
181
+ })
182
+ ])) : M("", !0)
183
+ ]),
184
+ n("div", Dt, [
185
+ n("div", Bt, F(e(d) || "Free"), 1),
186
+ n("div", Nt, [
187
+ (m(!0), T(W, null, de(e(h), (u, S) => (m(), R(y, {
188
+ key: S,
189
+ label: u
190
+ }, null, 8, ["label"]))), 128))
191
+ ])
192
+ ])
193
+ ]),
194
+ _: 1
195
+ });
196
+ };
197
+ }
198
+ }), Ot = /* @__PURE__ */ X({
199
+ __name: "AddBundleCard",
200
+ emits: ["create"],
201
+ setup(b, { emit: a }) {
202
+ const { t: c } = he(), g = a;
203
+ return (d, h) => {
204
+ const o = v("FmButton"), l = v("FmCard");
205
+ return m(), R(l, {
206
+ variant: "outlined",
207
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
208
+ }, {
209
+ default: I(() => [
210
+ i(o, {
211
+ onClick: h[0] || (h[0] = (f) => g("create")),
212
+ label: e(c)("connect.store.actions.addBundle"),
213
+ icon: "add",
214
+ variant: "secondary"
215
+ }, null, 8, ["label"])
216
+ ]),
217
+ _: 1
218
+ });
219
+ };
220
+ }
221
+ }), Lt = { class: "space-y-16" }, At = { class: "flex w-full justify-between pb-16" }, jt = { class: "flex items-center justify-end gap-8" }, qt = /* @__PURE__ */ X({
222
+ __name: "CategoryDialog",
223
+ props: {
224
+ action: {
225
+ type: String,
226
+ default: () => "add"
227
+ },
228
+ initialValue: {
229
+ type: String,
230
+ default: () => ""
231
+ }
232
+ },
233
+ setup(b) {
234
+ const { t: a } = he(), c = b, g = ze(), { emitData: d, emitAction: h } = We(), o = O(c.initialValue), l = ce.string().min(1);
235
+ function f() {
236
+ d(o.value), h("primary"), g.close();
237
+ }
238
+ function t() {
239
+ d(null), h("primary"), g.close();
240
+ }
241
+ return (r, p) => {
242
+ const y = v("FmTextField"), w = v("FmButton");
243
+ return m(), T("div", Lt, [
244
+ i(y, {
245
+ modelValue: e(o),
246
+ "onUpdate:modelValue": p[0] || (p[0] = (u) => ve(o) ? o.value = u : null),
247
+ label: e(a)("connect.store.category.label"),
248
+ rules: [e(re).toRule(e(l))]
249
+ }, null, 8, ["modelValue", "label", "rules"]),
250
+ n("div", At, [
251
+ n("div", null, [
252
+ b.action == "edit" ? (m(), R(w, {
253
+ key: 0,
254
+ onClick: t,
255
+ label: e(a)("connect.common.delete"),
256
+ variant: "destructive"
257
+ }, null, 8, ["label"])) : M("", !0)
258
+ ]),
259
+ n("div", jt, [
260
+ i(w, {
261
+ label: e(a)("connect.common.cancel"),
262
+ variant: "tertiary",
263
+ onClick: p[1] || (p[1] = (u) => e(g).close())
264
+ }, null, 8, ["label"]),
265
+ i(w, {
266
+ label: b.action == "edit" ? e(a)("connect.common.edit") : e(a)("connect.common.add"),
267
+ disabled: !e(o),
268
+ onClick: f
269
+ }, null, 8, ["label", "disabled"])
270
+ ])
271
+ ])
272
+ ]);
273
+ };
274
+ }
275
+ }), Gt = { class: "space-y-16" }, Kt = { class: "flex items-center justify-end gap-8 pb-16" }, Ht = /* @__PURE__ */ X({
276
+ __name: "SelectCategoryDialog",
277
+ setup(b) {
278
+ const { emitData: a, emitAction: c } = We(), g = Ye(), d = O(), h = E(
279
+ () => g.sortedStoreCategories.map((o, l) => ({
280
+ label: o.name,
281
+ value: l
282
+ }))
283
+ );
284
+ return (o, l) => {
285
+ const f = v("FmSelect"), t = v("FmButton");
286
+ return m(), T("div", Gt, [
287
+ l[4] || (l[4] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
288
+ i(f, {
289
+ placeholder: "Select a category",
290
+ items: e(h),
291
+ modelValue: e(d),
292
+ "onUpdate:modelValue": [
293
+ l[0] || (l[0] = (r) => ve(d) ? d.value = r : null),
294
+ l[1] || (l[1] = (r) => e(a)(r))
295
+ ],
296
+ label: "Category"
297
+ }, null, 8, ["items", "modelValue"]),
298
+ n("div", Kt, [
299
+ i(t, {
300
+ variant: "tertiary",
301
+ label: "Cancel",
302
+ onClick: l[2] || (l[2] = (r) => e(c)("tertiary"))
303
+ }),
304
+ i(t, {
305
+ label: "Select",
306
+ onClick: l[3] || (l[3] = (r) => e(c)("primary")),
307
+ disabled: e(d) == null
308
+ }, null, 8, ["disabled"])
309
+ ])
310
+ ]);
311
+ };
312
+ }
313
+ });
314
+ function be(b) {
315
+ return b.states.map((a) => ({ label: a, value: a }));
316
+ }
317
+ const zt = {
318
+ [Me.F_COUNTRY.enum.MY]: {
319
+ states: [
320
+ "Johor",
321
+ "Kedah",
322
+ "Kelantan",
323
+ "Kuala Lumpur",
324
+ "Labuan",
325
+ "Melaka",
326
+ "Negeri Sembilan",
327
+ "Pahang",
328
+ "Perak",
329
+ "Perlis",
330
+ "Pulau Pinang",
331
+ "Putrajaya",
332
+ "Sabah",
333
+ "Sarawak",
334
+ "Selangor",
335
+ "Terengganu"
336
+ ],
337
+ get stateItems() {
338
+ return be(this);
339
+ }
340
+ },
341
+ [Me.F_COUNTRY.enum.SG]: {
342
+ states: [],
343
+ get stateItems() {
344
+ return be(this);
345
+ }
346
+ },
347
+ JP: {
348
+ states: [],
349
+ get stateItems() {
350
+ return be(this);
351
+ }
352
+ },
353
+ AE: {
354
+ states: [],
355
+ get stateItems() {
356
+ return be(this);
357
+ }
358
+ },
359
+ AU: {
360
+ states: [],
361
+ get stateItems() {
362
+ return be(this);
363
+ }
364
+ },
365
+ MO: {
366
+ states: [],
367
+ get stateItems() {
368
+ return be(this);
369
+ }
370
+ },
371
+ VN: {
372
+ states: [],
373
+ get stateItems() {
374
+ return be(this);
375
+ }
376
+ },
377
+ [Me.F_COUNTRY.enum.ID]: {
378
+ states: [
379
+ "Aceh",
380
+ "Bali",
381
+ "Bangka-Belitung",
382
+ "Banten",
383
+ "Bengkulu",
384
+ "Central Java",
385
+ "Central Sulawesi",
386
+ "Daerah Istimewa Yogyakarta",
387
+ "East Java",
388
+ "East Kalimantan",
389
+ "East Nusa Tenggara",
390
+ "Gorontalo",
391
+ "Jakarta Raya",
392
+ "Jambi",
393
+ "Kalimantan Tengah",
394
+ "Lampung",
395
+ "Maluku",
396
+ "Maluku Utara",
397
+ "North Sulawesi",
398
+ "North Sumatra",
399
+ "Nusa Tenggara Barat",
400
+ "Papua",
401
+ "Riau",
402
+ "Riau Islands",
403
+ "South Kalimantan",
404
+ "South Sulawesi",
405
+ "South Sumatra",
406
+ "Sulawesi Barat",
407
+ "Sulawesi Tenggara",
408
+ "West Java",
409
+ "West Kalimantan",
410
+ "West Papua",
411
+ "West Sumatra"
412
+ ],
413
+ get stateItems() {
414
+ return be(this);
415
+ }
416
+ },
417
+ [Me.F_COUNTRY.enum.TH]: {
418
+ states: [
419
+ "Bangkok",
420
+ "Amnat Charoen",
421
+ "Ang Thong",
422
+ "Bueng Kan",
423
+ "Buri Ram",
424
+ "Chachoengsao",
425
+ "Chai Nat",
426
+ "Chaiyaphum",
427
+ "Chanthaburi",
428
+ "Chiang Mai",
429
+ "Chiang Rai",
430
+ "Chonburi",
431
+ "Chumphon",
432
+ "Kalasin",
433
+ "Kamphaeng Phet",
434
+ "Kanchanaburi",
435
+ "Khon Kaen",
436
+ "Krabi",
437
+ "Lampang",
438
+ "Lamphun",
439
+ "Loei",
440
+ "Lopburi",
441
+ "Mae Hong Son",
442
+ "Maha Sarakham",
443
+ "Mukdahan",
444
+ "Nakhon Nayok",
445
+ "Nakhon Pathom",
446
+ "Nakhon Phanom",
447
+ "Nakhon Ratchasima",
448
+ "Nakhon Sawan",
449
+ "Nakhon Si Thammarat",
450
+ "Nan",
451
+ "Narathiwat",
452
+ "Nong Bua Lamphu",
453
+ "Nong Khai",
454
+ "Nonthaburi",
455
+ "Pathum Thani",
456
+ "Pattani",
457
+ "Phang Nga",
458
+ "Phatthalung",
459
+ "Phayao",
460
+ "Phetchabun",
461
+ "Phetchaburi",
462
+ "Phichit",
463
+ "Phitsanulok",
464
+ "Phra Nakhon Si Ayutthaya",
465
+ "Phrae",
466
+ "Phuket",
467
+ "Prachinburi",
468
+ "Prachuap Khiri Khan",
469
+ "Ranong",
470
+ "Ratchaburi",
471
+ "Rayong",
472
+ "Roi Et",
473
+ "Sa Kaeo",
474
+ "Sakon Nakhon",
475
+ "Samut Prakan",
476
+ "Samut Sakhon",
477
+ "Samut Songkhram",
478
+ "Saraburi",
479
+ "Satun",
480
+ "Sing Buri",
481
+ "Sisaket",
482
+ "Songkhla",
483
+ "Sukhothai",
484
+ "Suphan Buri",
485
+ "Surat Thani",
486
+ "Surin",
487
+ "Tak",
488
+ "Trang",
489
+ "Trat",
490
+ "Ubon Ratchathani",
491
+ "Udon Thani",
492
+ "Uthai Thani",
493
+ "Uttaradit",
494
+ "Yala",
495
+ "Yasothon"
496
+ ],
497
+ get stateItems() {
498
+ return be(this);
499
+ }
500
+ }
501
+ }, Re = () => K.Config.getCountry(), Ee = {
502
+ get fullCurrency() {
503
+ return Re().currency;
504
+ },
505
+ get currency() {
506
+ return Re().currency.code;
507
+ },
508
+ get fullTax() {
509
+ return K.Country.getCountryFlattenTaxes(Re().code);
510
+ },
511
+ get taxSystem() {
512
+ return Re().taxSystems;
513
+ },
514
+ taxInclusion(b) {
515
+ return Ee.taxSystem.map((a) => ({
516
+ systemCode: a.code,
517
+ inclusive: b !== void 0 ? b : !1
518
+ }));
519
+ },
520
+ groupedTaxOptions() {
521
+ const b = K.Country.getCountryFlattenTaxes(Re().code);
522
+ return Ee.taxSystem.map((a) => ({
523
+ code: a.code,
524
+ options: b.map((c) => ({ ...c, feedmeTaxCode: Ee.generateCode(c) })).filter((c) => c.systemCode === a.code)
525
+ }));
526
+ },
527
+ systemDefaultCode(b) {
528
+ const a = Ee.groupedTaxOptions().find((c) => c.code === b);
529
+ return a == null ? void 0 : a.options.find((c) => c.default);
530
+ },
531
+ generateCode(b) {
532
+ return `${b.systemCode}/${b.taxCode}`;
533
+ }
534
+ }, Q = Ee, Wt = /* @__PURE__ */ X({
535
+ __name: "TaxInclusiveSetting",
536
+ props: {
537
+ modelValue: {
538
+ type: Array,
539
+ required: !0,
540
+ default: () => []
541
+ }
542
+ },
543
+ emits: ["update:model-value"],
544
+ setup(b, { emit: a }) {
545
+ const c = b, g = Q.taxSystem, d = a, h = O(c.modelValue);
546
+ function o(r, p) {
547
+ const y = pe.clone(c.modelValue), w = y.findIndex((u) => u.systemCode === r);
548
+ w >= 0 ? y[w].inclusive = p : y.push({
549
+ systemCode: r,
550
+ inclusive: p
551
+ }), h.value = y, d("update:model-value", y);
552
+ }
553
+ function l() {
554
+ return g.map((r) => {
555
+ const p = c.modelValue ? c.modelValue.find((y) => y.systemCode === r.code) : !1;
556
+ return {
557
+ label: r.name,
558
+ config: {
559
+ value: p ? p.inclusive : !1
560
+ },
561
+ input: (y) => {
562
+ o(r.code, y);
563
+ }
564
+ };
565
+ });
566
+ }
567
+ const f = at(l());
568
+ function t(r, p) {
569
+ return `${r} ${p ? "Inclusive" : "Exclusive"}`;
570
+ }
571
+ return De(() => {
572
+ c.modelValue.length || o(g[0].code, !1);
573
+ }), He(
574
+ () => c.modelValue,
575
+ (r, p) => {
576
+ r != p && !r.length && o(g[0].code, !1);
577
+ }
578
+ ), (r, p) => {
579
+ const y = v("FmSwitch");
580
+ return m(!0), T(W, null, de(e(f), (w, u) => {
581
+ var S;
582
+ return m(), T("div", { key: u }, [
583
+ i(y, {
584
+ "model-value": ((S = e(h)[u]) == null ? void 0 : S.inclusive) || !1,
585
+ "label-placement": "left",
586
+ "onUpdate:modelValue": ($) => w.input($)
587
+ }, {
588
+ label: I(() => {
589
+ var $;
590
+ return [
591
+ n("div", null, F(t(w.label, (($ = e(h)[u]) == null ? void 0 : $.inclusive) || !1)), 1)
592
+ ];
593
+ }),
594
+ _: 2
595
+ }, 1032, ["model-value", "onUpdate:modelValue"])
596
+ ]);
597
+ }), 128);
598
+ };
599
+ }
600
+ });
601
+ var Yt = { mode: "development", appMode: "mf" };
602
+ const Jt = { class: "space-y-8" }, Xt = {
603
+ key: 0,
604
+ class: "space-y-16"
605
+ }, Zt = /* @__PURE__ */ X({
606
+ __name: "StripeSetting",
607
+ props: {
608
+ modelValue: {}
609
+ },
610
+ emits: ["update:modelValue"],
611
+ setup(b, { emit: a }) {
612
+ const c = b, g = a, d = O(!1);
613
+ He(d, (o, l) => {
614
+ l != o && (!c.modelValue && o ? g("update:modelValue", {
615
+ apiKey: "",
616
+ webhookSecret: ""
617
+ }) : o || g("update:modelValue", void 0));
618
+ });
619
+ const h = E(() => {
620
+ const o = Yt.mode === "development", l = K.Config.getCountry().code.toLowerCase(), f = l != "my" ? `.${l}` : "";
621
+ return `https://marketing${o ? "-dev" : ""}${f}.feedmeapi.com/stripe/${Ge.getBusinessId()}/webhook`;
622
+ });
623
+ return De(() => {
624
+ d.value = !!c.modelValue;
625
+ }), (o, l) => {
626
+ const f = v("FmSwitch"), t = v("FmTextField"), r = v("FmButton");
627
+ return m(), T("div", Jt, [
628
+ i(f, {
629
+ modelValue: e(d),
630
+ "onUpdate:modelValue": l[0] || (l[0] = (p) => ve(d) ? d.value = p : null),
631
+ value: "true",
632
+ label: "Enable Stripe"
633
+ }, null, 8, ["modelValue"]),
634
+ c.modelValue ? (m(), T("div", Xt, [
635
+ i(t, {
636
+ label: "API Key",
637
+ modelValue: c.modelValue.apiKey,
638
+ "onUpdate:modelValue": l[1] || (l[1] = (p) => c.modelValue.apiKey = p),
639
+ "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
640
+ }, null, 8, ["modelValue"]),
641
+ i(t, {
642
+ label: "Webhook URL",
643
+ "model-value": e(h),
644
+ readonly: "",
645
+ "helper-text": "Copy this URL to your Stripe dashboard"
646
+ }, {
647
+ append: I(() => [
648
+ i(r, {
649
+ icon: "content_copy",
650
+ variant: "tertiary",
651
+ onClick: l[2] || (l[2] = (p) => e(yt)(e(h)))
652
+ })
653
+ ]),
654
+ _: 1
655
+ }, 8, ["model-value"]),
656
+ i(t, {
657
+ modelValue: c.modelValue.webhookSecret,
658
+ "onUpdate:modelValue": l[3] || (l[3] = (p) => c.modelValue.webhookSecret = p),
659
+ label: "Webhook Secret",
660
+ "helper-text": `Copy the webhook signing secret from your Stripe account and paste
661
+ here.`
662
+ }, null, 8, ["modelValue"])
663
+ ])) : M("", !0)
664
+ ]);
665
+ };
666
+ }
667
+ }), Qt = {
668
+ key: 0,
669
+ class: "space-y-16 pr-12"
670
+ }, eo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, to = {
671
+ key: 1,
672
+ class: "space-y-16"
673
+ }, oo = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, no = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, ao = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, so = { class: "space-y-4" }, lo = { class: "fm-typo-en-body-lg-400" }, io = { class: "space-y-16" }, ro = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, co = { class: "flex items-center gap-8" }, uo = /* @__PURE__ */ X({
674
+ __name: "StoreSettingSheet",
675
+ emits: ["update"],
676
+ setup(b, { expose: a, emit: c }) {
677
+ const { t: g } = he(), d = c, h = O(!1), o = O(), l = O(!1), f = ct.extend({
678
+ company: dt.extend({
679
+ name: ce.string().min(1, "Company name is required"),
680
+ regNo: ce.string().min(1, "Registration number is required"),
681
+ address: ut.extend({
682
+ line1: ce.string().min(1, "Line 1 is required"),
683
+ line2: ce.string().optional(),
684
+ state: ce.string().min(1, "State is required"),
685
+ city: ce.string().min(1, "City is required"),
686
+ postcode: ce.string().min(1, "Postcode is required"),
687
+ country: ce.string().min(1, "Country is required")
688
+ }),
689
+ phoneNo: ce.string().min(1, "Phone number is required"),
690
+ sstRegNo: ce.string().optional()
691
+ })
692
+ }), t = E(() => f.safeParse(o.value).success);
693
+ function r() {
694
+ const w = f.safeParse(o.value);
695
+ w.success && d("update", w.data);
696
+ }
697
+ function p() {
698
+ return {
699
+ company: {
700
+ name: "",
701
+ address: {
702
+ line1: "",
703
+ line2: "",
704
+ city: "",
705
+ postcode: "",
706
+ state: "",
707
+ country: K.Config.getCountry().name
708
+ },
709
+ phoneNo: "",
710
+ regNo: "",
711
+ sstRegNo: ""
712
+ },
713
+ inclusiveTaxes: []
714
+ };
715
+ }
716
+ function y(w, u) {
717
+ h.value = w, w && (o.value = u != null && u.company ? pe.cloneDeep(u) : p());
718
+ }
719
+ return a({
720
+ showSheet: y,
721
+ data: o
722
+ }), (w, u) => {
723
+ const S = v("FmIcon"), $ = v("FmMenuItem"), N = v("FmMenu"), ue = v("FmSelect"), oe = v("FmButton"), z = v("FmSideSheet");
724
+ return m(), R(z, {
725
+ "max-width": 560,
726
+ modelValue: e(h),
727
+ "onUpdate:modelValue": u[15] || (u[15] = (te) => ve(h) ? h.value = te : null),
728
+ header: e(g)("connect.store.setting.title")
729
+ }, {
730
+ "side-sheet-footer": I(() => [
731
+ n("div", co, [
732
+ i(oe, {
733
+ label: e(g)("connect.common.save"),
734
+ onClick: r,
735
+ disabled: !e(t) || e(Le)().isLoading,
736
+ loading: e(Le)().isLoading
737
+ }, null, 8, ["label", "disabled", "loading"]),
738
+ i(oe, {
739
+ label: e(g)("connect.common.cancel"),
740
+ onClick: u[14] || (u[14] = (te) => y(!1)),
741
+ variant: "tertiary"
742
+ }, null, 8, ["label"])
743
+ ])
744
+ ]),
745
+ default: I(() => {
746
+ var te, me;
747
+ return [
748
+ i(Je, { json: e(o) }, null, 8, ["json"]),
749
+ e(o) && e(o).company ? (m(), T("div", Qt, [
750
+ n("div", eo, F(e(g)("connect.store.setting.company.legal_info")), 1),
751
+ i(ge, {
752
+ modelValue: e(o).company.name,
753
+ "onUpdate:modelValue": u[0] || (u[0] = (V) => e(o).company.name = V),
754
+ label: e(g)("connect.store.setting.company.name"),
755
+ schema: e(re).typeAtPath(e(f), "company.name")
756
+ }, null, 8, ["modelValue", "label", "schema"]),
757
+ i(ge, {
758
+ modelValue: e(o).company.regNo,
759
+ "onUpdate:modelValue": u[1] || (u[1] = (V) => e(o).company.regNo = V),
760
+ label: e(g)("connect.store.setting.company.reg_no"),
761
+ schema: e(re).typeAtPath(e(f), "company.regNo")
762
+ }, null, 8, ["modelValue", "label", "schema"]),
763
+ e(K.Config).getCountry().taxSystems.length ? (m(), R(ge, {
764
+ key: 0,
765
+ modelValue: e(o).company.sstRegNo,
766
+ "onUpdate:modelValue": [
767
+ u[2] || (u[2] = (V) => e(o).company.sstRegNo = V),
768
+ u[3] || (u[3] = (V) => V ? null : e(o).inclusiveTaxes = [])
769
+ ],
770
+ label: e(g)("connect.store.setting.company.tax_reg_no"),
771
+ schema: e(re).typeAtPath(e(f), "company.sstRegNo")
772
+ }, null, 8, ["modelValue", "label", "schema"])) : M("", !0),
773
+ (te = e(o).company) != null && te.sstRegNo && e(o).inclusiveTaxes ? (m(), T("div", to, [
774
+ n("div", oo, F(e(g)("connect.store.setting.company.tax")), 1),
775
+ i(Wt, {
776
+ modelValue: e(o).inclusiveTaxes,
777
+ "onUpdate:modelValue": u[4] || (u[4] = (V) => e(o).inclusiveTaxes = V)
778
+ }, null, 8, ["modelValue"])
779
+ ])) : M("", !0),
780
+ i(ge, {
781
+ modelValue: e(o).company.phoneNo,
782
+ "onUpdate:modelValue": u[5] || (u[5] = (V) => e(o).company.phoneNo = V),
783
+ label: e(g)("connect.store.setting.company.phone"),
784
+ schema: e(re).typeAtPath(e(f), "company.phoneNo")
785
+ }, null, 8, ["modelValue", "label", "schema"]),
786
+ n("div", no, F(e(g)("connect.store.setting.company.address.title")), 1),
787
+ i(ge, {
788
+ modelValue: e(o).company.address.line1,
789
+ "onUpdate:modelValue": u[6] || (u[6] = (V) => e(o).company.address.line1 = V),
790
+ label: e(g)("connect.store.setting.company.address.line1"),
791
+ schema: e(re).typeAtPath(e(f), "company.address.line1")
792
+ }, null, 8, ["modelValue", "label", "schema"]),
793
+ i(ge, {
794
+ modelValue: e(o).company.address.line2,
795
+ "onUpdate:modelValue": u[7] || (u[7] = (V) => e(o).company.address.line2 = V),
796
+ label: e(g)("connect.store.setting.company.address.line2"),
797
+ schema: e(re).typeAtPath(e(f), "company.address.line2")
798
+ }, null, 8, ["modelValue", "label", "schema"]),
799
+ n("div", ao, [
800
+ i(ge, {
801
+ modelValue: e(o).company.address.city,
802
+ "onUpdate:modelValue": u[8] || (u[8] = (V) => e(o).company.address.city = V),
803
+ label: e(g)("connect.store.setting.company.address.city"),
804
+ schema: e(re).typeAtPath(e(f), "company.address.city")
805
+ }, null, 8, ["modelValue", "label", "schema"]),
806
+ i(ge, {
807
+ modelValue: e(o).company.address.postcode,
808
+ "onUpdate:modelValue": u[9] || (u[9] = (V) => e(o).company.address.postcode = V),
809
+ label: e(g)("connect.store.setting.company.address.postcode"),
810
+ schema: e(re).typeAtPath(e(f), "company.address.postcode")
811
+ }, null, 8, ["modelValue", "label", "schema"]),
812
+ n("div", so, [
813
+ n("div", lo, F(e(g)("connect.store.setting.company.address.state")), 1),
814
+ i(N, {
815
+ placement: "top-end",
816
+ "model-value": e(l)
817
+ }, {
818
+ "menu-button": I(() => [
819
+ i(ge, {
820
+ modelValue: e(o).company.address.state,
821
+ "onUpdate:modelValue": u[10] || (u[10] = (V) => e(o).company.address.state = V),
822
+ schema: e(re).typeAtPath(e(f), "company.address.state"),
823
+ onFocusChanged: u[11] || (u[11] = (V) => l.value = V)
824
+ }, {
825
+ append: I(() => [
826
+ i(S, {
827
+ name: e(l) ? "keyboard_arrow_up" : "keyboard_arrow_down"
828
+ }, null, 8, ["name"])
829
+ ]),
830
+ _: 1
831
+ }, 8, ["modelValue", "schema"])
832
+ ]),
833
+ default: I(() => [
834
+ (m(!0), T(W, null, de(e(zt)[e(K.Config).getCountry().code].stateItems.filter(
835
+ (V) => {
836
+ var xe, fe;
837
+ return V.label.toLowerCase().includes(((fe = (xe = e(o)) == null ? void 0 : xe.company) == null ? void 0 : fe.address.state.toLowerCase()) ?? "");
838
+ }
839
+ ) || [], (V) => (m(), R($, {
840
+ key: V.value,
841
+ "model-value": e(o).company.address.state === V.value,
842
+ label: V.label,
843
+ onClick: () => {
844
+ e(o).company.address.state = V.value, l.value = !1;
845
+ }
846
+ }, null, 8, ["model-value", "label", "onClick"]))), 128))
847
+ ]),
848
+ _: 1
849
+ }, 8, ["model-value"])
850
+ ]),
851
+ i(ue, {
852
+ label: e(g)("connect.store.setting.company.address.country"),
853
+ modelValue: e(o).company.address.country,
854
+ "onUpdate:modelValue": u[12] || (u[12] = (V) => e(o).company.address.country = V),
855
+ items: [
856
+ {
857
+ label: e(K.Config).getCountry().name,
858
+ value: e(K.Config).getCountry().name
859
+ }
860
+ ],
861
+ rules: [e(re).ruleAtPath(e(f), "company.address.country")]
862
+ }, null, 8, ["label", "modelValue", "items", "rules"])
863
+ ]),
864
+ n("div", io, [
865
+ n("div", ro, F(e(g)("connect.store.setting.stripe.title")), 1),
866
+ i(Zt, {
867
+ "model-value": (me = e(o)) == null ? void 0 : me.stripe,
868
+ "onUpdate:modelValue": u[13] || (u[13] = (V) => e(o).stripe = V)
869
+ }, null, 8, ["model-value"])
870
+ ])
871
+ ])) : M("", !0)
872
+ ];
873
+ }),
874
+ _: 1
875
+ }, 8, ["modelValue", "header"]);
876
+ };
877
+ }
878
+ }), mo = /* @__PURE__ */ X({
879
+ __name: "TaxVariantSetting",
880
+ props: {
881
+ modelValue: {
882
+ type: Array,
883
+ required: !0,
884
+ default: () => []
885
+ }
886
+ },
887
+ emits: ["update:modelValue"],
888
+ setup(b, { emit: a }) {
889
+ const c = b, g = a;
890
+ De(() => {
891
+ if (o.value.length !== h.value.length) {
892
+ const t = h.value.reduce((r, p) => {
893
+ const y = Q.systemDefaultCode(p.name);
894
+ if (!y) return r;
895
+ const { systemCode: w, taxCode: u } = y;
896
+ return p.value || r.push({ systemCode: w, taxCode: u }), r;
897
+ }, []);
898
+ f(t);
899
+ }
900
+ });
901
+ function d() {
902
+ return Q.groupedTaxOptions();
903
+ }
904
+ const h = E(() => d().map((t) => ({
905
+ name: t.code,
906
+ value: (o.value || []).find(
907
+ (r) => t.options.some((p) => p.feedmeTaxCode === r)
908
+ ),
909
+ options: t.options.map((r) => ({
910
+ label: `${r.name} (${St(r.rate)}%)`,
911
+ value: r.feedmeTaxCode
912
+ }))
913
+ }))), o = E(() => c.modelValue.map((t) => Q.generateCode(t)));
914
+ function l(t) {
915
+ const r = d().find(
916
+ (u) => u.options.some((S) => S.feedmeTaxCode === t)
917
+ ), p = r == null ? void 0 : r.options.find((u) => u.feedmeTaxCode === t);
918
+ if (!p) return;
919
+ const { systemCode: y, taxCode: w } = p;
920
+ f([{ systemCode: y, taxCode: w }]);
921
+ }
922
+ function f(t) {
923
+ const r = pe.clone(c.modelValue);
924
+ t.forEach((p) => {
925
+ const y = d().find(
926
+ (S) => S.options.some(($) => $.feedmeTaxCode === Q.generateCode(p))
927
+ ), w = (y == null ? void 0 : y.options) || [], u = r.findIndex(
928
+ (S) => w.some(($) => Q.generateCode($) === Q.generateCode(S))
929
+ );
930
+ u >= 0 ? r.splice(u, 1, p) : r.push(p);
931
+ }), g("update:modelValue", r);
932
+ }
933
+ return (t, r) => {
934
+ const p = v("FmRadio"), y = v("FmRadioGroup");
935
+ return m(!0), T(W, null, de(e(h), (w) => (m(), T("div", {
936
+ key: w.name,
937
+ class: "flex items-start"
938
+ }, [
939
+ i(y, {
940
+ modelValue: w.value,
941
+ "onUpdate:modelValue": [
942
+ (u) => w.value = u,
943
+ r[0] || (r[0] = (u) => {
944
+ l(u);
945
+ })
946
+ ]
947
+ }, {
948
+ default: I(() => [
949
+ (m(!0), T(W, null, de(w.options, (u, S) => (m(), R(p, {
950
+ key: S,
951
+ value: u.value,
952
+ label: u.label
953
+ }, null, 8, ["value", "label"]))), 128))
954
+ ]),
955
+ _: 2
956
+ }, 1032, ["modelValue", "onUpdate:modelValue"])
957
+ ]))), 128);
958
+ };
959
+ }
960
+ }), Ke = {
961
+ get _id() {
962
+ return (/* @__PURE__ */ new Date()).toISOString();
963
+ },
964
+ name: "",
965
+ price: K.Dinero.zero().toObject(),
966
+ originalPrice: K.Dinero.zero().toObject(),
967
+ vouchers: [],
968
+ credit: {
969
+ normal: 0,
970
+ free: {
971
+ amount: 0,
972
+ day: 0
973
+ }
974
+ },
975
+ config: {
976
+ options: {}
977
+ },
978
+ titles: [],
979
+ taxes: [],
980
+ taxTotals: [],
981
+ internal: !1,
982
+ priceWithTaxes: xt()
983
+ }, po = {
984
+ key: 0,
985
+ class: "space-y-24 pr-12"
986
+ }, fo = { class: "space-y-8" }, yo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, go = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, bo = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, vo = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, ho = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, xo = { class: "space-y-8" }, _o = { class: "flex items-center justify-between" }, Co = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, So = { class: "space-y-8" }, Fo = { class: "flex items-center gap-8" }, wo = /* @__PURE__ */ X({
987
+ __name: "EditBundleSheet",
988
+ emits: ["update"],
989
+ setup(b, { expose: a, emit: c }) {
990
+ const g = c, { t: d } = he(), h = Ye(), o = O(!1), l = O([]), f = O({
991
+ category: 0,
992
+ index: -1,
993
+ originalCategoryIndex: void 0
994
+ }), t = O(pe.cloneDeep(Ke)), r = O(), p = Xe, y = E(() => {
995
+ const C = p.safeParse(t.value);
996
+ return C.success ? [] : C.error.errors;
997
+ }), w = [
998
+ {
999
+ header: "Reward title",
1000
+ accessorFn: (C) => C.collectible.name,
1001
+ enableSorting: !0
1002
+ },
1003
+ {
1004
+ id: "type",
1005
+ header: "Reward type",
1006
+ accessorFn: (C) => C.collectible.type,
1007
+ cell(C) {
1008
+ return Te[C.row.original.collectible.type].chip();
1009
+ }
1010
+ },
1011
+ {
1012
+ header: "Description",
1013
+ accessorFn: (C) => C.description,
1014
+ cell(C) {
1015
+ var k;
1016
+ const s = C.row.original;
1017
+ return s.collectible.type == "VOUCHER" || s.selectedReward == null ? s.description : lt(rt.FmStepperField, {
1018
+ "onUpdate:modelValue": (D) => {
1019
+ t.value.titles = t.value.titles.map(
1020
+ (J) => J.id == s.collectible._id ? { ...J, dayToExpire: D } : J
1021
+ );
1022
+ },
1023
+ modelValue: ((k = s.selectedReward) == null ? void 0 : k.extra) ?? 0,
1024
+ appendText: "day(s)",
1025
+ helperState: ae(y.value, "titles"),
1026
+ helperText: se(y.value, "titles"),
1027
+ max: 9999,
1028
+ rules: [(D) => D <= 9999 || "Maximum 9999 days allowed"],
1029
+ showSteppers: !1,
1030
+ disabled: !!t.value.stripePriceId
1031
+ });
1032
+ }
1033
+ }
1034
+ ], u = O([]), S = E(() => {
1035
+ var s;
1036
+ const C = (s = t.value) != null && s.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
1037
+ return h.bundleRewards.filter((k) => {
1038
+ var D;
1039
+ return (D = t.value) != null && D.isFeedvibe && k.type !== "VOUCHER" ? !1 : Ft(k.capabilities, C);
1040
+ }).map((k) => {
1041
+ const D = $.value.find((Z) => Z.id == k._id), J = k.type === "VOUCHER" ? `${k.options.maxUse} use(s), ${wt(
1042
+ k.options.validityOption || {}
1043
+ )}` : "No expiry";
1044
+ return {
1045
+ collectible: k,
1046
+ description: J,
1047
+ selectedReward: D
1048
+ };
1049
+ });
1050
+ }), $ = E(() => {
1051
+ var C, s;
1052
+ return [
1053
+ ...((C = t.value) == null ? void 0 : C.titles.map((k) => ({
1054
+ id: k.id,
1055
+ extra: k.dayToExpire
1056
+ }))) ?? [],
1057
+ ...((s = t.value) == null ? void 0 : s.vouchers.map((k) => ({
1058
+ id: k,
1059
+ extra: void 0
1060
+ }))) ?? []
1061
+ ];
1062
+ }), N = E(
1063
+ () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
1064
+ );
1065
+ function ue(C) {
1066
+ t.value.subscriptionValidity = C;
1067
+ for (const s of t.value.titles)
1068
+ s.dayToExpire = C;
1069
+ t.value.credit.free && (t.value.credit.free.day = C);
1070
+ }
1071
+ function oe() {
1072
+ const C = S.value, s = t.value;
1073
+ if (!(!s || !C))
1074
+ for (let k = 0; k < C.length; k++) {
1075
+ const D = C[k];
1076
+ z.value[k] ? D.collectible.type == "TITLE" ? s.titles.findIndex(
1077
+ (A) => A.id == D.collectible._id
1078
+ ) < 0 && s.titles.push({
1079
+ id: D.collectible._id,
1080
+ dayToExpire: N.value
1081
+ }) : s.vouchers.findIndex(
1082
+ (A) => A == D.collectible._id
1083
+ ) < 0 && s.vouchers.push(D.collectible._id) : (s.titles = s.titles.filter((Z) => Z.id != D.collectible._id), s.vouchers = s.vouchers.filter(
1084
+ (Z) => Z != D.collectible._id
1085
+ ));
1086
+ }
1087
+ }
1088
+ const z = O({});
1089
+ He(z, oe, { deep: !0 });
1090
+ const te = E(() => {
1091
+ var C, s;
1092
+ return (s = (C = h.storeOption) == null ? void 0 : C.company) == null ? void 0 : s.sstRegNo;
1093
+ }), me = E(() => {
1094
+ var C, s, k;
1095
+ return (k = (s = (C = h.storeOption) == null ? void 0 : C.inclusiveTaxes) == null ? void 0 : s[0]) != null && k.inclusive ? "Inclusive" : "Exclusive";
1096
+ }), V = E(() => {
1097
+ var C, s, k;
1098
+ return ot(
1099
+ Q.fullTax,
1100
+ st(t.value.taxes),
1101
+ t.value.price,
1102
+ Number(t.value.credit.normal),
1103
+ ((C = h.storeOption) == null ? void 0 : C.inclusiveTaxes) ?? [],
1104
+ (k = (s = h.storeOption) == null ? void 0 : s.company) != null && k.sstRegNo ? Q.taxSystem.map((D) => D.code) : []
1105
+ );
1106
+ }), xe = E(() => V.value.reduce(
1107
+ (s, k) => s.add(k.total),
1108
+ _t()
1109
+ ).toFormat()), fe = E(() => {
1110
+ var D;
1111
+ const C = nt(
1112
+ V.value,
1113
+ t.value.price,
1114
+ ((D = h.storeOption) == null ? void 0 : D.inclusiveTaxes) ?? []
1115
+ );
1116
+ t.value.priceWithTaxes = C;
1117
+ const s = Ct(C, !1), k = Number(s.replace(/[^\d.-]/g, ""));
1118
+ return Number.isNaN(k) ? 0 : k;
1119
+ });
1120
+ function Ve() {
1121
+ t.value.taxTotals = V.value, g("update", Xe.parse(ft(t.value)));
1122
+ }
1123
+ function j() {
1124
+ return pe.cloneDeep(Ke);
1125
+ }
1126
+ function Se(C, s) {
1127
+ o.value = C, C && s && (r.value = void 0, l.value = s.categories, t.value = s.bundle || j(), f.value.category = s.category, f.value.index = s.index, f.value.originalCategoryIndex = s.category, z.value = S.value.reduce((k, D, J) => (k[J] = !!D.selectedReward, k), {}));
1128
+ }
1129
+ return a({
1130
+ showSheet: Se,
1131
+ bundleImage: r,
1132
+ target: f,
1133
+ data: t
1134
+ }), (C, s) => {
1135
+ const k = v("FmSwitch"), D = v("FmHelperText"), J = v("FmTextField"), Z = v("FmSelect"), A = v("FmStepperField"), _e = v("FmMenuItem"), ke = v("FmTable"), Fe = v("FmButton"), ye = v("FmSideSheet");
1136
+ return m(), R(ye, {
1137
+ "max-width": 768,
1138
+ modelValue: e(o),
1139
+ "onUpdate:modelValue": s[21] || (s[21] = (ie) => ve(o) ? o.value = ie : null),
1140
+ header: e(f).index != -1 ? e(d)("connect.store.bundle.edit.title") : e(d)("connect.store.bundle.edit.create")
1141
+ }, {
1142
+ "side-sheet-footer": I(() => [
1143
+ n("div", Fo, [
1144
+ i(Fe, {
1145
+ label: e(f).index != -1 ? "Save" : "Add",
1146
+ onClick: Ve,
1147
+ disabled: e(y).length > 0,
1148
+ loading: e(Le)().isLoading
1149
+ }, null, 8, ["label", "disabled", "loading"]),
1150
+ i(Fe, {
1151
+ label: "Cancel",
1152
+ onClick: s[20] || (s[20] = (ie) => Se(!1)),
1153
+ variant: "tertiary"
1154
+ })
1155
+ ])
1156
+ ]),
1157
+ default: I(() => {
1158
+ var ie, Pe, Be, Ne, x, P, B, H, q, L;
1159
+ return [
1160
+ i(Je, { json: e(t) }, null, 8, ["json"]),
1161
+ e(t) ? (m(), T("div", po, [
1162
+ n("div", fo, [
1163
+ e(K.Config).getCountry().code == "MY" && ((ie = e(h).payoutAccount) == null ? void 0 : ie.status) == "APPROVED" && ((Pe = e(h).payoutAccount) != null && Pe.enable) ? (m(), R(k, {
1164
+ key: 0,
1165
+ "onUpdate:modelValue": s[0] || (s[0] = (_) => {
1166
+ e(t).isFeedvibe = _, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], z.value = {}, e(t).hideInPos = !0, e(t).internal = !0);
1167
+ }),
1168
+ "label-placement": "right",
1169
+ "model-value": e(t).isFeedvibe || !1,
1170
+ label: "Feedvibe Campaign",
1171
+ sublabel: "Bundle will be appear for Feedvibe campaign use"
1172
+ }, null, 8, ["model-value"])) : M("", !0),
1173
+ e(t).isFeedvibe ? (m(), R(D, {
1174
+ key: 1,
1175
+ text: "There will be a 15% charge for FeedVibe bundles sold in the FeedVibe app. FeedVibe bundles only show up in the FeedVibe app and cannot be sold in the POS and mini program. For more information, please contact support.",
1176
+ state: "warning"
1177
+ })) : M("", !0)
1178
+ ]),
1179
+ n("div", yo, F(e(d)("connect.store.bundle.edit.basicInformation")), 1),
1180
+ i(J, {
1181
+ label: e(d)("connect.store.bundle.edit.bundleName"),
1182
+ modelValue: e(t).name,
1183
+ "onUpdate:modelValue": s[1] || (s[1] = (_) => e(t).name = _),
1184
+ "helper-state": e(ae)(e(y), "name"),
1185
+ "helper-text": e(se)(e(y), "name")
1186
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1187
+ i(Z, {
1188
+ modelValue: e(f).category,
1189
+ "onUpdate:modelValue": s[2] || (s[2] = (_) => e(f).category = _),
1190
+ label: "Store Category",
1191
+ items: e(l).map((_, U) => ({ label: _, value: U }))
1192
+ }, null, 8, ["modelValue", "items"]),
1193
+ i(vt, {
1194
+ label: e(d)("connect.store.bundle.edit.bundleImage"),
1195
+ class: "w-1/2 xs:w-2/3",
1196
+ "aspect-ratio": "16/9",
1197
+ thumbnail: e(t).image ?? void 0,
1198
+ file: e(r) ?? void 0,
1199
+ "onUpdate:file": s[3] || (s[3] = (_) => {
1200
+ r.value = _;
1201
+ }),
1202
+ "helper-state": e(ae)(e(y), "image"),
1203
+ "helper-text": e(se)(e(y), "image")
1204
+ }, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
1205
+ i(A, {
1206
+ "model-value": e(K.Dinero).fromFdoDinero(e(t).price).toUnit(),
1207
+ label: e(d)("connect.store.bundle.edit.bundlePrice"),
1208
+ min: 0,
1209
+ "max-fraction-digits": 2,
1210
+ "onUpdate:modelValue": s[4] || (s[4] = (_) => {
1211
+ e(t).price.amount = _ * 10 ** e(t).price.precision;
1212
+ }),
1213
+ "is-currency": !0,
1214
+ "show-steppers": !1,
1215
+ "helper-text": e(se)(e(y), "price") || `${e(K.Dinero).fromNumber({ number: 1 }).toFormat(
1216
+ !0
1217
+ )} = ${e(K.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1218
+ "helper-state": e(ae)(e(y), "price")
1219
+ }, {
1220
+ prepend: I(() => [
1221
+ le(F(e(K.Dinero).defaultCurrency()), 1)
1222
+ ]),
1223
+ _: 1
1224
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1225
+ i(A, {
1226
+ "model-value": e(K.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1227
+ label: e(d)("connect.store.bundle.edit.bundleValue"),
1228
+ min: 0,
1229
+ "max-fraction-digits": 2,
1230
+ "onUpdate:modelValue": s[5] || (s[5] = (_) => {
1231
+ e(t).originalPrice || (e(t).originalPrice = e(K.Dinero).zero().toObject()), e(t).originalPrice.amount = _ * 10 ** e(t).originalPrice.precision;
1232
+ }),
1233
+ "is-currency": !0,
1234
+ "show-steppers": !1,
1235
+ "helper-text": e(se)(e(y), "originalPrice") || e(d)("connect.store.bundle.edit.originalPriceHelper"),
1236
+ "helper-state": e(ae)(e(y), "originalPrice")
1237
+ }, {
1238
+ prepend: I(() => [
1239
+ le(F(e(K.Dinero).defaultCurrency()), 1)
1240
+ ]),
1241
+ _: 1
1242
+ }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1243
+ e(t).isFeedvibe ? M("", !0) : (m(), R(A, {
1244
+ key: 0,
1245
+ "model-value": e(t).coinPrice ?? null,
1246
+ label: e(d)("connect.store.bundle.edit.pointNeeded"),
1247
+ min: 0,
1248
+ "onUpdate:modelValue": s[6] || (s[6] = (_) => {
1249
+ _ > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = _;
1250
+ }),
1251
+ "show-steppers": !1,
1252
+ "helper-state": e(ae)(e(y), "coinPrice"),
1253
+ "helper-text": e(se)(e(y), "coinPrice")
1254
+ }, {
1255
+ append: I(() => [...s[22] || (s[22] = [
1256
+ le(" point(s) ", -1)
1257
+ ])]),
1258
+ _: 1
1259
+ }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1260
+ (Be = e(h).storeOption) != null && Be.stripe && !e(t).isFeedvibe ? (m(), T(W, { key: 1 }, [
1261
+ n("div", go, F(e(d)("connect.store.bundle.edit.subscriptionSettings")), 1),
1262
+ i(J, {
1263
+ label: e(d)("connect.store.bundle.edit.stripePriceId"),
1264
+ modelValue: e(t).stripePriceId,
1265
+ "onUpdate:modelValue": s[7] || (s[7] = (_) => e(t).stripePriceId = _),
1266
+ "helper-state": e(ae)(e(y), "stripePriceId"),
1267
+ "helper-text": e(se)(e(y), "stripePriceId")
1268
+ }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1269
+ e(t).stripePriceId ? (m(), R(A, {
1270
+ key: 0,
1271
+ "model-value": e(t).subscriptionValidity ?? null,
1272
+ min: 1,
1273
+ "onUpdate:modelValue": ue,
1274
+ label: e(d)("connect.store.bundle.edit.subscriptionValidity"),
1275
+ "show-steppers": !1,
1276
+ "helper-state": e(ae)(e(y), "subscriptionValidity"),
1277
+ "helper-text": e(se)(e(y), "subscriptionValidity")
1278
+ }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : M("", !0)
1279
+ ], 64)) : M("", !0),
1280
+ e(t).isFeedvibe ? M("", !0) : (m(), T(W, { key: 2 }, [
1281
+ n("div", bo, F(e(d)("connect.store.bundle.edit.credit")), 1),
1282
+ i(A, {
1283
+ modelValue: e(t).credit.normal,
1284
+ "onUpdate:modelValue": s[8] || (s[8] = (_) => e(t).credit.normal = _),
1285
+ label: e(d)("connect.store.bundle.edit.normalCredit"),
1286
+ "show-steppers": !1,
1287
+ "helper-state": e(ae)(e(y), "credit.normal"),
1288
+ "helper-text": e(se)(e(y), "credit.normal")
1289
+ }, {
1290
+ append: I(() => [...s[23] || (s[23] = [
1291
+ le(" credit ", -1)
1292
+ ])]),
1293
+ _: 1
1294
+ }, 8, ["modelValue", "label", "helper-state", "helper-text"]),
1295
+ i(A, {
1296
+ "model-value": ((Ne = e(t).credit.free) == null ? void 0 : Ne.amount) ?? null,
1297
+ min: 0,
1298
+ "onUpdate:modelValue": s[9] || (s[9] = (_) => {
1299
+ e(t).credit.free || (e(t).credit.free = {
1300
+ amount: 0,
1301
+ day: 1
1302
+ }), e(t).credit.free.amount = _;
1303
+ }),
1304
+ label: e(d)("connect.store.bundle.edit.freeCredit"),
1305
+ "show-steppers": !1,
1306
+ "helper-state": e(ae)(e(y), "credit.free.amount"),
1307
+ "helper-text": e(se)(e(y), "credit.free.amount")
1308
+ }, {
1309
+ append: I(() => [...s[24] || (s[24] = [
1310
+ le(" credit ", -1)
1311
+ ])]),
1312
+ _: 1
1313
+ }, 8, ["model-value", "label", "helper-state", "helper-text"]),
1314
+ (x = e(t).credit.free) != null && x.amount ? (m(), R(A, {
1315
+ key: 0,
1316
+ disabled: !!e(t).stripePriceId,
1317
+ "model-value": ((P = e(t).credit.free) == null ? void 0 : P.day) ?? null,
1318
+ min: 0,
1319
+ "onUpdate:modelValue": s[10] || (s[10] = (_) => {
1320
+ e(t).credit.free || (e(t).credit.free = {
1321
+ amount: 0,
1322
+ day: 1
1323
+ }), e(t).credit.free.day = e(N) || _;
1324
+ }),
1325
+ label: "Free credit valid for",
1326
+ "show-steppers": !1,
1327
+ "helper-state": e(ae)(e(y), "credit.free.day"),
1328
+ "helper-text": e(se)(e(y), "credit.free.day")
1329
+ }, {
1330
+ append: I(() => [...s[25] || (s[25] = [
1331
+ le(" day(s) ", -1)
1332
+ ])]),
1333
+ _: 1
1334
+ }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : M("", !0)
1335
+ ], 64)),
1336
+ e(te) ? (m(), T(W, { key: 3 }, [
1337
+ s[26] || (s[26] = n("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
1338
+ i(mo, {
1339
+ modelValue: e(t).taxes,
1340
+ "onUpdate:modelValue": s[11] || (s[11] = (_) => e(t).taxes = _)
1341
+ }, null, 8, ["modelValue"]),
1342
+ i(J, {
1343
+ label: `Tax Charged (${e(me)})`,
1344
+ "model-value": e(xe),
1345
+ disabled: ""
1346
+ }, null, 8, ["label", "model-value"])
1347
+ ], 64)) : M("", !0),
1348
+ i(A, {
1349
+ label: "Total Price",
1350
+ "model-value": e(fe),
1351
+ disabled: !0
1352
+ }, null, 8, ["model-value"]),
1353
+ n("div", vo, F(e(d)("connect.store.bundle.edit.bundleReward.title")), 1),
1354
+ n("div", ho, F(e(d)("connect.store.bundle.edit.bundleReward.description")), 1),
1355
+ n("div", xo, [
1356
+ n("div", _o, [
1357
+ i(ht, {
1358
+ label: `Reward type: ${e(u).length == 0 ? "All" : e(u)[0].name}`
1359
+ }, {
1360
+ default: I(() => [
1361
+ i(_e, {
1362
+ onClick: s[12] || (s[12] = (_) => u.value = []),
1363
+ label: "All"
1364
+ }),
1365
+ i(_e, {
1366
+ onClick: s[13] || (s[13] = (_) => u.value = [
1367
+ {
1368
+ id: "type",
1369
+ value: "VOUCHER",
1370
+ name: e(Te).VOUCHER.name
1371
+ }
1372
+ ]),
1373
+ label: e(Te).VOUCHER.name
1374
+ }, null, 8, ["label"]),
1375
+ i(_e, {
1376
+ onClick: s[14] || (s[14] = (_) => u.value = [
1377
+ {
1378
+ id: "type",
1379
+ value: "TITLE",
1380
+ name: e(Te).TITLE.name
1381
+ }
1382
+ ]),
1383
+ label: e(Te).TITLE.name
1384
+ }, null, 8, ["label"])
1385
+ ]),
1386
+ _: 1
1387
+ }, 8, ["label"])
1388
+ ]),
1389
+ i(ke, {
1390
+ modelValue: e(z),
1391
+ "onUpdate:modelValue": s[15] || (s[15] = (_) => ve(z) ? z.value = _ : null),
1392
+ selection: "multiple",
1393
+ "column-filter": e(u),
1394
+ "column-defs": w,
1395
+ "row-data": e(S),
1396
+ "hide-footer": e(S).length <= 10
1397
+ }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1398
+ i(D, {
1399
+ text: e(se)(e(y), "titles"),
1400
+ state: e(ae)(e(y), "titles")
1401
+ }, null, 8, ["text", "state"])
1402
+ ]),
1403
+ n("div", Co, F(e(d)("connect.store.bundle.edit.advanceSetting")), 1),
1404
+ n("div", So, [
1405
+ e(t).isFeedvibe ? M("", !0) : (m(), T(W, { key: 0 }, [
1406
+ i(k, {
1407
+ "model-value": e(t).internal ?? !1,
1408
+ "onUpdate:modelValue": s[16] || (s[16] = (_) => e(t).internal = _),
1409
+ "label-placement": "right",
1410
+ label: e(d)("connect.store.bundle.edit.internalBundle"),
1411
+ sublabel: e(d)("connect.store.bundle.edit.internalBundleDescription")
1412
+ }, null, 8, ["model-value", "label", "sublabel"]),
1413
+ i(k, {
1414
+ "model-value": e(t).hideInPos ?? !1,
1415
+ "onUpdate:modelValue": s[17] || (s[17] = (_) => e(t).hideInPos = _),
1416
+ "label-placement": "right",
1417
+ label: e(d)("connect.store.bundle.edit.hideInPos"),
1418
+ sublabel: e(d)("connect.store.bundle.edit.hideInPosDescription")
1419
+ }, null, 8, ["model-value", "label", "sublabel"])
1420
+ ], 64)),
1421
+ i(A, {
1422
+ "model-value": ((H = (B = e(t).config) == null ? void 0 : B.options) == null ? void 0 : H.maxPerUser) || null,
1423
+ "onUpdate:modelValue": s[18] || (s[18] = (_) => e(pe).set(e(t), "config.options.maxPerUser", _)),
1424
+ label: e(d)("connect.store.bundle.edit.maxPerUser"),
1425
+ "show-steppers": !1,
1426
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1427
+ }, null, 8, ["model-value", "label", "placeholder"]),
1428
+ i(A, {
1429
+ "model-value": ((L = (q = e(t).config) == null ? void 0 : q.options) == null ? void 0 : L.maxReceive) || null,
1430
+ "onUpdate:modelValue": s[19] || (s[19] = (_) => e(pe).set(e(t), "config.options.maxReceive", _)),
1431
+ label: e(d)("connect.store.bundle.edit.maxReceive"),
1432
+ "show-steppers": !1,
1433
+ placeholder: e(d)("connect.store.bundle.edit.unlimited")
1434
+ }, null, 8, ["model-value", "label", "placeholder"])
1435
+ ])
1436
+ ])) : M("", !0)
1437
+ ];
1438
+ }),
1439
+ _: 1
1440
+ }, 8, ["modelValue", "header"]);
1441
+ };
1442
+ }
1443
+ }), $o = { class: "flex gap-8 items-center flex-wrap" }, ko = { class: "flex items-center gap-8" }, Po = /* @__PURE__ */ X({
1444
+ __name: "SendBundleSheet",
1445
+ emits: ["success"],
1446
+ setup(b, { expose: a, emit: c }) {
1447
+ const { minor: g } = et, d = O(), h = O(""), o = O(""), l = O([]), f = O(!1), t = O();
1448
+ O(!0);
1449
+ function r(S) {
1450
+ f.value = !0, h.value = null, o.value = "", d.value = S.bundle;
1451
+ }
1452
+ function p() {
1453
+ f.value = !1;
1454
+ }
1455
+ async function y(S) {
1456
+ const $ = await $t.read({
1457
+ limit: 25,
1458
+ skip: 0,
1459
+ sortBy: "_id",
1460
+ search: S,
1461
+ descending: !1
1462
+ });
1463
+ l.value = $.resources.map((N) => ({
1464
+ label: `${N.name} (${N.phoneNumber})`,
1465
+ value: N._id
1466
+ })), await new Promise((N) => setTimeout(N, 100));
1467
+ }
1468
+ async function w() {
1469
+ if (!d.value || !h.value) return;
1470
+ const S = l.value.find(
1471
+ (N) => N.value === h.value
1472
+ );
1473
+ await Ie.confirm(
1474
+ `Are you sure you want to send bundle ${d.value.name} to ${S == null ? void 0 : S.label}?`,
1475
+ "Confirm",
1476
+ "Confirm",
1477
+ "Cancel"
1478
+ ) && await g(
1479
+ async () => {
1480
+ const N = {
1481
+ bundle: d.value._id,
1482
+ member: h.value,
1483
+ source: mt.enum.ADMIN,
1484
+ ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${o.value}`,
1485
+ withCoin: !1
1486
+ };
1487
+ await Ue.sendBundle(N), p();
1488
+ },
1489
+ {
1490
+ message: "Sending bundle",
1491
+ successMessage: "Bundle sent"
1492
+ }
1493
+ );
1494
+ }
1495
+ const u = E(() => {
1496
+ var $, N, ue;
1497
+ const S = [];
1498
+ return (($ = d.value) == null ? void 0 : $.price.amount) > 0 && S.push(
1499
+ `${K.Config.getCountry().currency.symbol}${tt((N = d.value) == null ? void 0 : N.price)}`
1500
+ ), (ue = d.value) != null && ue.coinPrice && S.push(`${d.value.coinPrice} point(s)`), S.join(" or ");
1501
+ });
1502
+ return a({
1503
+ showSheet: r,
1504
+ hideSheet: p
1505
+ }), De(async () => {
1506
+ await y("");
1507
+ }), (S, $) => {
1508
+ const N = v("FmCardMedia"), ue = v("FmCardHeader"), oe = v("FmChip"), z = v("FmCardSection"), te = v("FmCard"), me = v("FmSelect"), V = v("FmTextField"), xe = v("FmForm"), fe = v("FmButton"), Ve = v("FmSideSheet");
1509
+ return m(), R(Ve, {
1510
+ "max-width": 560,
1511
+ "dismiss-away": !0,
1512
+ header: "Send bundle to member",
1513
+ modelValue: e(f),
1514
+ "onUpdate:modelValue": [
1515
+ $[4] || ($[4] = (j) => ve(f) ? f.value = j : null),
1516
+ $[5] || ($[5] = (j) => f.value = j)
1517
+ ]
1518
+ }, {
1519
+ "side-sheet-footer": I(() => [
1520
+ n("div", ko, [
1521
+ i(fe, {
1522
+ label: "Send",
1523
+ loading: e(Le)().isLoading,
1524
+ onClick: $[2] || ($[2] = async () => {
1525
+ var j;
1526
+ return (j = e(t)) == null ? void 0 : j.validateInputs();
1527
+ })
1528
+ }, null, 8, ["loading"]),
1529
+ i(fe, {
1530
+ label: "Cancel",
1531
+ type: "button",
1532
+ variant: "tertiary",
1533
+ onClick: $[3] || ($[3] = (j) => f.value = !1)
1534
+ })
1535
+ ])
1536
+ ]),
1537
+ default: I(() => [
1538
+ i(xe, {
1539
+ class: "space-y-16",
1540
+ ref_key: "form",
1541
+ ref: t,
1542
+ onValidationSuccess: w,
1543
+ blameFormChildOnValidationFailed: ""
1544
+ }, {
1545
+ default: I(() => [
1546
+ i(te, {
1547
+ class: "max-w-[700px]",
1548
+ horizontal: "",
1549
+ variant: "outlined"
1550
+ }, {
1551
+ default: I(() => {
1552
+ var j, Se;
1553
+ return [
1554
+ (j = e(d)) != null && j.image ? (m(), R(N, {
1555
+ key: 0,
1556
+ width: "100",
1557
+ src: (Se = e(d)) == null ? void 0 : Se.image
1558
+ }, null, 8, ["src"])) : M("", !0),
1559
+ i(z, { class: "flex flex-col gap-16 justify-between" }, {
1560
+ default: I(() => {
1561
+ var C;
1562
+ return [
1563
+ i(ue, {
1564
+ class: "p-0",
1565
+ title: (C = e(d)) == null ? void 0 : C.name,
1566
+ subtitle: e(u)
1567
+ }, null, 8, ["title", "subtitle"]),
1568
+ i(z, { class: "p-0" }, {
1569
+ default: I(() => {
1570
+ var s, k, D, J, Z, A, _e, ke, Fe, ye, ie;
1571
+ return [
1572
+ n("div", $o, [
1573
+ (s = e(d)) != null && s.isFeedvibe ? (m(), R(oe, {
1574
+ key: 0,
1575
+ label: "Feedvibe"
1576
+ })) : M("", !0),
1577
+ (D = (k = e(d)) == null ? void 0 : k.titles) != null && D.length ? (m(), R(oe, {
1578
+ key: 1,
1579
+ label: `${e(d).titles.length} title(s)`
1580
+ }, null, 8, ["label"])) : M("", !0),
1581
+ (Z = (J = e(d)) == null ? void 0 : J.vouchers) != null && Z.length ? (m(), R(oe, {
1582
+ key: 2,
1583
+ label: `${e(d).vouchers.length} voucher(s)`
1584
+ }, null, 8, ["label"])) : M("", !0),
1585
+ (_e = (A = e(d)) == null ? void 0 : A.credit) != null && _e.normal || (ye = (Fe = (ke = e(d)) == null ? void 0 : ke.credit) == null ? void 0 : Fe.free) != null && ye.amount ? (m(), R(oe, {
1586
+ key: 3,
1587
+ label: `${(e(d).credit.normal || 0) + (((ie = e(d).credit.free) == null ? void 0 : ie.amount) || 0)} credit(s)`
1588
+ }, null, 8, ["label"])) : M("", !0)
1589
+ ])
1590
+ ];
1591
+ }),
1592
+ _: 1
1593
+ })
1594
+ ];
1595
+ }),
1596
+ _: 1
1597
+ })
1598
+ ];
1599
+ }),
1600
+ _: 1
1601
+ }),
1602
+ i(me, {
1603
+ modelValue: e(h),
1604
+ "onUpdate:modelValue": $[0] || ($[0] = (j) => ve(h) ? h.value = j : null),
1605
+ label: "Select member",
1606
+ searchable: "",
1607
+ items: e(l),
1608
+ onSearch: y,
1609
+ rules: [(j) => !!j > 0 || "Member is required"],
1610
+ "helper-text": "Type to search member"
1611
+ }, null, 8, ["modelValue", "items", "rules"]),
1612
+ i(V, {
1613
+ modelValue: e(o),
1614
+ "onUpdate:modelValue": $[1] || ($[1] = (j) => ve(o) ? o.value = j : null),
1615
+ label: "Reference (optional)",
1616
+ rules: [
1617
+ (j) => j.length < 50 || "Reference must be less than 50 characters"
1618
+ ]
1619
+ }, null, 8, ["modelValue", "rules"])
1620
+ ]),
1621
+ _: 1
1622
+ }, 512)
1623
+ ]),
1624
+ _: 1
1625
+ }, 8, ["modelValue"]);
1626
+ };
1627
+ }
1628
+ }), Vo = { class: "flex items-center gap-8" }, To = { class: "flex-shrink-0 -mr-8 -mt-8" }, Ro = ["title"], Io = ["src"], Uo = { class: "relative flex items-center gap-6 min-w-0" }, Eo = { class: "fm-typo-en-body-sm-600 tracking-[0.08em] truncate" }, Do = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Bo = {
1629
+ key: 0,
1630
+ class: "flex items-center gap-6"
1631
+ }, No = "linear-gradient(135deg,#FF9455,#B25300)", Mo = /* @__PURE__ */ X({
1632
+ __name: "GiftCardProgramCard",
1633
+ props: {
1634
+ program: {},
1635
+ disabled: { type: Boolean }
1636
+ },
1637
+ emits: ["edit", "setLive", "deactivate"],
1638
+ setup(b, { emit: a }) {
1639
+ const c = b, g = a, d = E(() => pt(c.program)), h = E(() => {
1640
+ const { denominations: f, anyAmount: t } = d.value, r = [], p = [
1641
+ ...f,
1642
+ ...t ? [t.min, t.max] : []
1643
+ ];
1644
+ if (p.length) {
1645
+ const y = Math.min(...p), w = Math.max(...p);
1646
+ r.push(y === w ? `RM${y}` : `RM${y}–RM${w}`);
1647
+ }
1648
+ return t && r.push("Any amount"), r.join(" · ");
1649
+ }), o = E(() => {
1650
+ var f;
1651
+ return ((f = c.program.designs) == null ? void 0 : f[0]) ?? null;
1652
+ }), l = E(() => {
1653
+ const f = c.program.numberFormat, t = (f == null ? void 0 : f.prefix) ?? "GC", r = Math.max(4, Math.min(Number((f == null ? void 0 : f.length) ?? 12), 16));
1654
+ return `${t}${"•".repeat(r)}`;
1655
+ });
1656
+ return (f, t) => {
1657
+ const r = v("FmChip"), p = v("FmButton"), y = v("FmMenuItem"), w = v("FmMenu"), u = v("FmIcon"), S = v("FmCard");
1658
+ return m(), R(S, {
1659
+ variant: "outlined",
1660
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px]"
1661
+ }, {
1662
+ default: I(() => [
1663
+ n("div", Vo, [
1664
+ i(r, {
1665
+ label: "Gift card",
1666
+ variant: "neutral",
1667
+ compact: ""
1668
+ }),
1669
+ i(r, {
1670
+ label: b.program.active ? "Live" : "Inactive",
1671
+ variant: b.program.active ? "success" : "neutral",
1672
+ compact: ""
1673
+ }, null, 8, ["label", "variant"]),
1674
+ t[4] || (t[4] = n("div", { class: "flex-1" }, null, -1)),
1675
+ n("div", To, [
1676
+ i(w, { placement: "bottom-end" }, {
1677
+ "menu-button": I(() => [
1678
+ i(p, {
1679
+ icon: "more_vert",
1680
+ variant: "tertiary"
1681
+ })
1682
+ ]),
1683
+ default: I(() => [
1684
+ i(y, {
1685
+ onClick: t[0] || (t[0] = ($) => g("edit")),
1686
+ icon: "edit",
1687
+ label: "Edit"
1688
+ }),
1689
+ b.program.active ? (m(), R(y, {
1690
+ key: 1,
1691
+ onClick: t[2] || (t[2] = ($) => g("deactivate")),
1692
+ icon: "pause_circle",
1693
+ label: "Set inactive"
1694
+ })) : (m(), R(y, {
1695
+ key: 0,
1696
+ onClick: t[1] || (t[1] = ($) => g("setLive")),
1697
+ icon: "check_circle",
1698
+ label: "Set live"
1699
+ }))
1700
+ ]),
1701
+ _: 1
1702
+ })
1703
+ ])
1704
+ ]),
1705
+ n("div", {
1706
+ class: "fm-typo-en-body-lg-600 truncate",
1707
+ title: b.program.name
1708
+ }, F(b.program.name), 9, Ro),
1709
+ n("div", {
1710
+ class: "relative h-[120px] aspect-[1.586/1] mx-auto rounded-md overflow-hidden flex flex-col p-8 text-fm-color-typo-white",
1711
+ style: Qe({ background: No })
1712
+ }, [
1713
+ e(o) ? (m(), T("img", {
1714
+ key: 0,
1715
+ src: e(o),
1716
+ alt: "",
1717
+ class: "absolute inset-0 w-full h-full object-cover"
1718
+ }, null, 8, Io)) : M("", !0),
1719
+ t[6] || (t[6] = n("div", { class: "relative flex items-start justify-between gap-4" }, [
1720
+ n("span", { class: "fm-typo-en-body-sm-600" }, "FeedMe"),
1721
+ n("span", { class: "fm-typo-en-body-sm-600 uppercase tracking-[0.1em] opacity-90 whitespace-nowrap" }, " Gift Card ")
1722
+ ], -1)),
1723
+ t[7] || (t[7] = n("div", { class: "flex-1" }, null, -1)),
1724
+ n("div", Uo, [
1725
+ t[5] || (t[5] = n("span", { class: "w-[20px] h-[14px] rounded-sm flex-none bg-gradient-to-br from-[#F4D479] to-[#C99B3B]" }, null, -1)),
1726
+ n("span", Eo, F(e(l)), 1)
1727
+ ])
1728
+ ], 4),
1729
+ n("div", Do, F(e(h)), 1),
1730
+ t[9] || (t[9] = n("div", { class: "flex-1" }, null, -1)),
1731
+ b.program.active ? (m(), T("div", Bo, [
1732
+ i(u, {
1733
+ name: "check",
1734
+ size: "sm",
1735
+ class: "text-fm-color-system-success-400"
1736
+ }),
1737
+ t[8] || (t[8] = n("span", { class: "fm-typo-en-body-sm-600 text-fm-color-system-success-400" }, " Live to customers ", -1))
1738
+ ])) : (m(), R(p, {
1739
+ key: 1,
1740
+ label: "Set live",
1741
+ variant: "secondary",
1742
+ size: "md",
1743
+ disabled: b.disabled,
1744
+ onClick: t[3] || (t[3] = ($) => g("setLive"))
1745
+ }, null, 8, ["disabled"]))
1746
+ ]),
1747
+ _: 1
1748
+ });
1749
+ };
1750
+ }
1751
+ }), Oo = { class: "rounded-lg border-1 border-fm-color-primary p-24 flex flex-col gap-16" }, Lo = { class: "flex items-start gap-16" }, Ao = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary" }, jo = { class: "flex flex-col gap-4" }, qo = { class: "fm-typo-en-body-lg-600" }, Go = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ko = { class: "rounded-md border-1 border-fm-color-neutral-gray-200" }, Ho = { class: "flex-1 min-w-0" }, zo = { class: "fm-typo-en-body-md-600" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Yo = /* @__PURE__ */ X({
1752
+ __name: "StoreOnboarding",
1753
+ props: {
1754
+ settingStatus: {},
1755
+ payoutStatus: {},
1756
+ requiresPayout: { type: Boolean, default: !0 }
1757
+ },
1758
+ emits: ["setupStoreSetting", "setupPayout"],
1759
+ setup(b, { emit: a }) {
1760
+ const { t: c } = he(), g = b, d = a, h = E(() => [
1761
+ {
1762
+ key: "payout",
1763
+ title: c("connect.store.onboarding.payoutTitle"),
1764
+ description: c("connect.store.onboarding.payoutDescription"),
1765
+ status: g.payoutStatus,
1766
+ action: "setupPayout"
1767
+ },
1768
+ {
1769
+ key: "setting",
1770
+ title: c("connect.store.onboarding.settingTitle"),
1771
+ description: c("connect.store.onboarding.settingDescription"),
1772
+ status: g.settingStatus,
1773
+ action: "setupStoreSetting"
1774
+ }
1775
+ ].filter((l) => l.key !== "payout" || g.requiresPayout));
1776
+ return (o, l) => {
1777
+ const f = v("FmIcon"), t = v("FmChip"), r = v("FmButton");
1778
+ return m(), T("div", Oo, [
1779
+ n("div", Lo, [
1780
+ n("span", Ao, [
1781
+ i(f, {
1782
+ name: "warning",
1783
+ class: "text-fm-color-typo-white"
1784
+ })
1785
+ ]),
1786
+ n("div", jo, [
1787
+ n("div", qo, F(e(c)("connect.store.onboarding.title")), 1),
1788
+ n("div", Go, F(e(c)("connect.store.onboarding.description")), 1)
1789
+ ])
1790
+ ]),
1791
+ n("div", Ko, [
1792
+ (m(!0), T(W, null, de(e(h), (p, y) => (m(), T("div", {
1793
+ key: p.key,
1794
+ class: $e(["flex items-center gap-16 p-16", y > 0 ? "border-t-1 border-fm-color-neutral-gray-200" : ""])
1795
+ }, [
1796
+ n("span", {
1797
+ class: $e([
1798
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1799
+ p.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1800
+ ])
1801
+ }, [
1802
+ p.status === "COMPLETE" ? (m(), R(f, {
1803
+ key: 0,
1804
+ name: "check",
1805
+ size: "sm"
1806
+ })) : (m(), T(W, { key: 1 }, [
1807
+ le(F(y + 1), 1)
1808
+ ], 64))
1809
+ ], 2),
1810
+ n("div", Ho, [
1811
+ n("div", zo, F(p.title), 1),
1812
+ n("div", Wo, F(p.description), 1)
1813
+ ]),
1814
+ i(t, {
1815
+ label: e(c)(
1816
+ p.status === "COMPLETE" ? "connect.store.onboarding.complete" : p.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1817
+ ),
1818
+ variant: "plain",
1819
+ class: $e(
1820
+ p.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1821
+ ),
1822
+ compact: ""
1823
+ }, null, 8, ["label", "class"]),
1824
+ p.status !== "COMPLETE" ? (m(), R(r, {
1825
+ key: 0,
1826
+ class: "flex-none",
1827
+ label: e(c)(
1828
+ p.status === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.setupNow"
1829
+ ),
1830
+ variant: "primary",
1831
+ onClick: (w) => p.action === "setupPayout" ? d("setupPayout") : d("setupStoreSetting")
1832
+ }, null, 8, ["label", "onClick"])) : M("", !0)
1833
+ ], 2))), 128))
1834
+ ])
1835
+ ]);
1836
+ };
1837
+ }
1838
+ }), Jo = { class: "rounded-lg bg-fm-color-system-success-100 p-16 flex items-start gap-16" }, Xo = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-system-success-400" }, Zo = { class: "flex-1 flex flex-col gap-4" }, Qo = { class: "fm-typo-en-body-lg-600" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tn = /* @__PURE__ */ X({
1839
+ __name: "StoreAllSet",
1840
+ emits: ["dismiss"],
1841
+ setup(b, { emit: a }) {
1842
+ const { t: c } = he(), g = a;
1843
+ return (d, h) => {
1844
+ const o = v("FmIcon"), l = v("FmButton");
1845
+ return m(), T("div", Jo, [
1846
+ n("span", Xo, [
1847
+ i(o, {
1848
+ name: "check_circle",
1849
+ class: "text-fm-color-typo-white"
1850
+ })
1851
+ ]),
1852
+ n("div", Zo, [
1853
+ n("div", Qo, F(e(c)("connect.store.allSet.title")), 1),
1854
+ n("div", en, F(e(c)("connect.store.allSet.description")), 1)
1855
+ ]),
1856
+ i(l, {
1857
+ class: "flex-none",
1858
+ icon: "close",
1859
+ size: "md",
1860
+ variant: "tertiary",
1861
+ onClick: h[0] || (h[0] = (f) => g("dismiss"))
1862
+ })
1863
+ ]);
1864
+ };
1865
+ }
1866
+ }), on = { class: "space-y-16" }, nn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, an = { class: "space-y-8" }, sn = { class: "h-8 rounded-full bg-fm-color-neutral-gray-200 overflow-hidden" }, ln = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rn = { class: "space-y-8" }, cn = { class: "flex-1 min-w-0" }, dn = { class: "fm-typo-en-body-md-600" }, un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, mn = { class: "flex items-center justify-end gap-8 pb-16" }, pn = /* @__PURE__ */ X({
1867
+ __name: "StoreSetupDialog",
1868
+ props: {
1869
+ settingStatus: {},
1870
+ payoutStatus: {},
1871
+ requiresPayout: { type: Boolean, default: !0 }
1872
+ },
1873
+ setup(b) {
1874
+ const { t: a } = he(), c = b, g = ze(), { emitData: d, emitAction: h } = We(), o = E(() => [
1875
+ {
1876
+ key: "payout",
1877
+ title: a("connect.store.onboarding.payoutTitle"),
1878
+ description: a("connect.store.onboarding.payoutDescription"),
1879
+ status: c.payoutStatus,
1880
+ action: "setupPayout",
1881
+ actionLabel: a(
1882
+ c.payoutStatus === "PENDING" ? "connect.store.onboarding.editDetails" : "connect.store.onboarding.payoutAction"
1883
+ )
1884
+ },
1885
+ {
1886
+ key: "setting",
1887
+ title: a("connect.store.onboarding.settingTitle"),
1888
+ description: a("connect.store.onboarding.settingDescription"),
1889
+ status: c.settingStatus,
1890
+ action: "setupStoreSetting",
1891
+ actionLabel: a("connect.store.onboarding.settingTitle")
1892
+ }
1893
+ ].filter((p) => p.key !== "payout" || c.requiresPayout)), l = E(
1894
+ () => o.value.filter((r) => r.status === "COMPLETE").length
1895
+ ), f = E(
1896
+ () => o.value.find((r) => r.status !== "COMPLETE")
1897
+ );
1898
+ function t() {
1899
+ f.value && (d(f.value.action), h("primary"), g.close());
1900
+ }
1901
+ return (r, p) => {
1902
+ const y = v("FmIcon"), w = v("FmChip"), u = v("FmButton");
1903
+ return m(), T("div", on, [
1904
+ n("div", nn, F(e(a)("connect.store.setupDialog.description")), 1),
1905
+ n("div", an, [
1906
+ n("div", sn, [
1907
+ n("div", {
1908
+ class: "h-full rounded-full bg-fm-color-primary transition-all",
1909
+ style: Qe({ width: `${e(l) / e(o).length * 100}%` })
1910
+ }, null, 4)
1911
+ ]),
1912
+ n("div", ln, F(e(a)("connect.store.setupDialog.progress", {
1913
+ done: e(l),
1914
+ total: e(o).length
1915
+ })), 1)
1916
+ ]),
1917
+ n("div", rn, [
1918
+ (m(!0), T(W, null, de(e(o), (S, $) => {
1919
+ var N;
1920
+ return m(), T("div", {
1921
+ key: S.key,
1922
+ class: $e([
1923
+ "rounded-md border-1 p-16 flex items-center gap-16",
1924
+ S.key === ((N = e(f)) == null ? void 0 : N.key) ? "border-fm-color-primary" : "border-fm-color-neutral-gray-200"
1925
+ ])
1926
+ }, [
1927
+ n("span", {
1928
+ class: $e([
1929
+ "w-24 h-24 rounded-sm flex-none grid place-items-center fm-typo-en-body-sm-600",
1930
+ S.status === "COMPLETE" ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-primary-oats text-fm-color-primary"
1931
+ ])
1932
+ }, [
1933
+ S.status === "COMPLETE" ? (m(), R(y, {
1934
+ key: 0,
1935
+ name: "check",
1936
+ size: "sm"
1937
+ })) : (m(), T(W, { key: 1 }, [
1938
+ le(F($ + 1), 1)
1939
+ ], 64))
1940
+ ], 2),
1941
+ n("div", cn, [
1942
+ n("div", dn, F(S.title), 1),
1943
+ n("div", un, F(S.description), 1)
1944
+ ]),
1945
+ i(w, {
1946
+ label: e(a)(
1947
+ S.status === "COMPLETE" ? "connect.store.onboarding.complete" : S.status === "PENDING" ? "connect.store.onboarding.pendingApproval" : "connect.store.onboarding.incomplete"
1948
+ ),
1949
+ variant: "plain",
1950
+ class: $e(
1951
+ S.status === "COMPLETE" ? "text-fm-color-typo-success bg-fm-color-system-success-100" : "text-fm-color-typo-warning bg-fm-color-system-warning-100"
1952
+ ),
1953
+ compact: ""
1954
+ }, null, 8, ["label", "class"])
1955
+ ], 2);
1956
+ }), 128))
1957
+ ]),
1958
+ n("div", mn, [
1959
+ i(u, {
1960
+ label: e(a)("connect.common.cancel"),
1961
+ variant: "tertiary",
1962
+ onClick: p[0] || (p[0] = (S) => e(g).close())
1963
+ }, null, 8, ["label"]),
1964
+ e(f) ? (m(), R(u, {
1965
+ key: 0,
1966
+ label: e(f).actionLabel,
1967
+ variant: "primary",
1968
+ onClick: t
1969
+ }, null, 8, ["label"])) : M("", !0)
1970
+ ])
1971
+ ]);
1972
+ };
1973
+ }
1974
+ });
1975
+ function fn(b, a, c = !0) {
1976
+ const g = (a == null ? void 0 : a.status) === "APPROVED" && a.enable ? "COMPLETE" : (a == null ? void 0 : a.status) === "PENDING" ? "PENDING" : "INCOMPLETE", d = c;
1977
+ return {
1978
+ settingStatus: b ? "COMPLETE" : "INCOMPLETE",
1979
+ payoutStatus: g,
1980
+ requiresPayout: d,
1981
+ complete: b && (!d || g === "COMPLETE")
1982
+ };
1983
+ }
1984
+ const yn = { class: "grid lg:grid-cols-2 gap-32 items-center" }, gn = { class: "flex flex-col gap-16" }, bn = { class: "flex flex-col gap-8" }, vn = { class: "fm-typo-en-title-md-800" }, hn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[460px]" }, xn = { class: "flex flex-col gap-16" }, _n = { class: "w-40 h-40 rounded-md flex-none grid place-items-center bg-fm-color-primary-oats text-fm-color-primary" }, Cn = { class: "flex flex-col gap-2" }, Sn = { class: "fm-typo-en-body-md-600" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wn = { class: "flex items-center gap-16 pt-8" }, $n = { class: "relative rounded-lg overflow-hidden aspect-[4/3] flex items-end justify-center bg-gradient-to-br from-[#FFF3E6] to-[#FDE6D0]" }, kn = { class: "absolute inset-0 grid place-items-center" }, Pn = { class: "relative w-[68%] max-w-[320px]" }, Vn = { class: "relative w-full aspect-[1.586/1] rounded-lg p-16 flex flex-col justify-between text-fm-color-typo-white bg-gradient-to-br from-[#C98A4B] to-[#A96A2E] rotate-[-3deg]" }, Tn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-sm-400 uppercase tracking-[0.12em] opacity-90" }, In = /* @__PURE__ */ X({
1985
+ __name: "GiftCardUpsell",
1986
+ props: {
1987
+ premium: { type: Boolean }
1988
+ },
1989
+ emits: ["upgrade", "comparePlans", "create"],
1990
+ setup(b, { emit: a }) {
1991
+ const { t: c } = he(), g = a, d = [
1992
+ {
1993
+ icon: "send",
1994
+ title: "connect.store.giftCard.benefitGiftTitle",
1995
+ description: "connect.store.giftCard.benefitGiftDescription"
1996
+ },
1997
+ {
1998
+ icon: "bar_chart",
1999
+ title: "connect.store.giftCard.benefitSalesTitle",
2000
+ description: "connect.store.giftCard.benefitSalesDescription"
2001
+ },
2002
+ {
2003
+ icon: "favorite",
2004
+ title: "connect.store.giftCard.benefitLoyaltyTitle",
2005
+ description: "connect.store.giftCard.benefitLoyaltyDescription"
2006
+ }
2007
+ ];
2008
+ return (h, o) => {
2009
+ const l = v("FmIcon"), f = v("FmButton"), t = v("FmCard");
2010
+ return m(), R(t, {
2011
+ variant: "outlined",
2012
+ class: "p-24"
2013
+ }, {
2014
+ default: I(() => [
2015
+ n("div", yn, [
2016
+ n("div", gn, [
2017
+ n("span", {
2018
+ class: $e([
2019
+ "self-start inline-flex items-center gap-4 px-8 py-4 rounded-sm fm-typo-en-body-sm-600 tracking-[0.05em]",
2020
+ b.premium ? "bg-fm-color-system-success-100 text-fm-color-typo-success" : "bg-fm-color-secondary-blueberry text-fm-color-typo-white uppercase"
2021
+ ])
2022
+ }, [
2023
+ i(l, {
2024
+ name: b.premium ? "check" : "stars",
2025
+ size: "sm"
2026
+ }, null, 8, ["name"]),
2027
+ le(" " + F(b.premium ? e(c)("connect.store.giftCard.includedInPlan") : e(c)("connect.store.giftCard.premium")), 1)
2028
+ ], 2),
2029
+ n("div", bn, [
2030
+ n("div", vn, F(e(c)("connect.store.giftCard.upsellTitle")), 1),
2031
+ n("div", hn, F(e(c)("connect.store.giftCard.upsellDescription")), 1)
2032
+ ]),
2033
+ n("div", xn, [
2034
+ (m(), T(W, null, de(d, (r) => n("div", {
2035
+ key: r.icon,
2036
+ class: "flex items-start gap-12"
2037
+ }, [
2038
+ n("span", _n, [
2039
+ i(l, {
2040
+ name: r.icon
2041
+ }, null, 8, ["name"])
2042
+ ]),
2043
+ n("div", Cn, [
2044
+ n("div", Sn, F(e(c)(r.title)), 1),
2045
+ n("div", Fn, F(e(c)(r.description)), 1)
2046
+ ])
2047
+ ])), 64))
2048
+ ]),
2049
+ n("div", wn, [
2050
+ b.premium ? (m(), R(f, {
2051
+ key: 0,
2052
+ label: e(c)("connect.store.giftCard.createGiftCard"),
2053
+ variant: "primary",
2054
+ icon: "add",
2055
+ onClick: o[0] || (o[0] = (r) => g("create"))
2056
+ }, null, 8, ["label"])) : (m(), T(W, { key: 1 }, [
2057
+ i(f, {
2058
+ label: e(c)("connect.store.giftCard.upgrade"),
2059
+ variant: "primary",
2060
+ onClick: o[1] || (o[1] = (r) => g("upgrade"))
2061
+ }, null, 8, ["label"]),
2062
+ n("button", {
2063
+ type: "button",
2064
+ class: "inline-flex items-center gap-4 fm-typo-en-body-md-600 text-fm-color-typo-primary",
2065
+ onClick: o[2] || (o[2] = (r) => g("comparePlans"))
2066
+ }, [
2067
+ le(F(e(c)("connect.store.giftCard.comparePlans")) + " ", 1),
2068
+ i(l, {
2069
+ name: "chevron_right",
2070
+ size: "sm"
2071
+ })
2072
+ ])
2073
+ ], 64))
2074
+ ])
2075
+ ]),
2076
+ n("div", $n, [
2077
+ n("div", kn, [
2078
+ n("div", Pn, [
2079
+ o[6] || (o[6] = n("div", { class: "absolute -left-[14%] top-[6%] w-full aspect-[1.586/1] rounded-lg bg-gradient-to-br from-[#3A3A3C] to-[#1C1C1E] rotate-[-8deg]" }, null, -1)),
2080
+ n("div", Vn, [
2081
+ o[5] || (o[5] = n("span", { class: "fm-typo-en-body-md-600" }, "FeedMe", -1)),
2082
+ n("div", Tn, [
2083
+ n("span", Rn, F(e(c)("connect.store.giftCard.giftCardLabel")), 1),
2084
+ o[4] || (o[4] = n("span", { class: "fm-typo-en-title-md-800" }, "RM100", -1))
2085
+ ])
2086
+ ])
2087
+ ])
2088
+ ]),
2089
+ b.premium ? M("", !0) : (m(), T("button", {
2090
+ key: 0,
2091
+ type: "button",
2092
+ class: "relative mb-24 inline-flex items-center gap-8 px-16 py-8 rounded-full bg-fm-color-neutral-black text-fm-color-typo-white fm-typo-en-body-sm-600",
2093
+ onClick: o[3] || (o[3] = (r) => g("upgrade"))
2094
+ }, [
2095
+ i(l, {
2096
+ name: "lock",
2097
+ size: "sm"
2098
+ }),
2099
+ le(" " + F(e(c)("connect.store.giftCard.unlockNow")), 1)
2100
+ ]))
2101
+ ])
2102
+ ])
2103
+ ]),
2104
+ _: 1
2105
+ });
2106
+ };
2107
+ }
2108
+ });
2109
+ var Ze = { authUrl: "https://portal-v2-dev.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "feedmedev.vip", crmUrl: "crm.feedmedev.cc", paymentPortalUrl: "https://portal.feedmedev.cc/payment/payout-account", licensePortalUrl: "https://license.feedmedev.cc/", marketingV1Portal: "https://marketing-v1.feedmedev.cc", voucherAppUrl: "https://voucher.feedmedev.cc/" };
2110
+ const Un = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary max-w-[640px]" }, En = { class: "px-24 flex flex-col gap-y-16" }, Dn = { class: "space-y-8 py-12" }, Bn = { class: "flex gap-8 items-center" }, Nn = { class: "fm-typo-en-body-lg-600" }, Mn = {
2111
+ key: 1,
2112
+ class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
2113
+ }, On = {
2114
+ key: 1,
2115
+ class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24"
2116
+ }, Ln = { class: "flex gap-8 items-center" }, An = { class: "fm-typo-en-body-lg-600" }, jn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, qn = { class: "flex flex-col gap-16 text-center" }, Gn = { class: "fm-typo-en-title-sm-800" }, Kn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wa = /* @__PURE__ */ X({
2117
+ __name: "Store",
2118
+ setup(b) {
2119
+ const { t: a } = he(), c = {
2120
+ label: a("connect.store.actions.setting"),
2121
+ value: "setting",
2122
+ isPrimary: !1
2123
+ }, g = {
2124
+ label: a("connect.store.actions.manageReward"),
2125
+ value: "create_reward"
2126
+ }, d = {
2127
+ label: a("connect.store.actions.addCategory"),
2128
+ value: "create_category",
2129
+ isPrimary: !0,
2130
+ prependIcon: "add"
2131
+ }, h = O(), o = Pt(), l = Ye(), { global: f, minor: t } = et, r = ze(), p = E(() => l.sortedStoreCategories), y = E(() => l.sortedStoreCategories.map((x) => x.name)), w = O(), u = O(), S = kt(), $ = O([]), N = E(() => S.isPremium), ue = E(() => {
2132
+ var x;
2133
+ return !!((x = l.storeOption) != null && x.company);
2134
+ }), oe = O(!1), z = E(
2135
+ () => fn(
2136
+ ue.value,
2137
+ l.payoutAccount,
2138
+ !oe.value || N.value
2139
+ )
2140
+ ), te = E(() => !z.value.complete), me = O(!1);
2141
+ function V() {
2142
+ return `connect.store.allSetDismissed.${Ge.getBusinessId()}`;
2143
+ }
2144
+ function xe() {
2145
+ try {
2146
+ return localStorage.getItem(V()) === "1";
2147
+ } catch {
2148
+ return !1;
2149
+ }
2150
+ }
2151
+ function fe() {
2152
+ me.value = !0;
2153
+ try {
2154
+ localStorage.setItem(V(), "1");
2155
+ } catch {
2156
+ }
2157
+ }
2158
+ const Ve = {
2159
+ name: Oe["$connect-TRANSACTION"],
2160
+ query: { tab: "store" }
2161
+ };
2162
+ function j() {
2163
+ window.open(
2164
+ `${Ze.licensePortalUrl}business/${Ge.businessId}/settings`,
2165
+ "_blank"
2166
+ );
2167
+ }
2168
+ function Se() {
2169
+ window.open("https://feedme.ai/pricing", "_blank", "noopener");
2170
+ }
2171
+ async function C() {
2172
+ if (N.value)
2173
+ try {
2174
+ $.value = await qe.readPrograms();
2175
+ } catch {
2176
+ $.value = [];
2177
+ }
2178
+ }
2179
+ function s() {
2180
+ o.push({ name: Oe["$connect-STORE_GIFT_CARD_SETUP"] });
2181
+ }
2182
+ function k(x) {
2183
+ o.push({
2184
+ name: Oe["$connect-STORE_GIFT_CARD_SETUP"],
2185
+ params: { id: String(x._id) }
2186
+ });
2187
+ }
2188
+ async function D(x) {
2189
+ await Ie.confirm(
2190
+ `Set "${x.name}" live? Only one gift card can be live at a time, so any other will be set inactive.`,
2191
+ "Set live",
2192
+ "Set live",
2193
+ "Cancel"
2194
+ ) && await t(
2195
+ async () => {
2196
+ await qe.activateProgram(String(x._id)), await C();
2197
+ },
2198
+ { message: "Setting live", successMessage: "Gift card is live" }
2199
+ );
2200
+ }
2201
+ async function J(x) {
2202
+ await t(
2203
+ async () => {
2204
+ await qe.deactivateProgram(String(x._id)), await C();
2205
+ },
2206
+ { message: "Updating gift card", successMessage: "Gift card set inactive" }
2207
+ );
2208
+ }
2209
+ function Z() {
2210
+ r.open({
2211
+ title: a("connect.store.setupDialog.title"),
2212
+ contentComponent: pn,
2213
+ contentComponentProps: {
2214
+ settingStatus: z.value.settingStatus,
2215
+ payoutStatus: z.value.payoutStatus,
2216
+ requiresPayout: z.value.requiresPayout
2217
+ }
2218
+ }).onPrimary((x) => {
2219
+ A(x === "setupPayout" ? "payout" : "setting");
2220
+ });
2221
+ }
2222
+ async function A(x) {
2223
+ var P;
2224
+ x === "setting" ? (P = w.value) == null || P.showSheet(!0, l.storeOption) : x === "create_category" ? ye(-1) : x === "create_reward" ? await o.push({ name: Oe["$connect-STORE_REWARDS"] }) : x == "payout" && window.open(Ze.paymentPortalUrl, "_blank");
2225
+ }
2226
+ function _e(x, P) {
2227
+ var _;
2228
+ const B = !!((_ = P.company) != null && _.sstRegNo), H = P.inclusiveTaxes ?? [], q = Q.taxSystem.map((U) => U.code), L = B ? H.flatMap((U) => {
2229
+ console.log(U, "inclusive tax");
2230
+ const G = Q.systemDefaultCode(U.systemCode);
2231
+ return G ? [{ systemCode: U.systemCode, taxCode: G.taxCode }] : [];
2232
+ }) : [];
2233
+ return console.log([
2234
+ ["hasSstRegNo", B],
2235
+ ["defaultTaxCodes", L],
2236
+ ["inclusiveTaxes", H],
2237
+ ["taxSystemCodes", q]
2238
+ ]), x.map((U) => ({
2239
+ ...U,
2240
+ bundles: U.bundles.map((G) => {
2241
+ const { pf_vouchers: ee, ...Y } = G;
2242
+ if (!B)
2243
+ return {
2244
+ ...Y,
2245
+ taxes: [],
2246
+ taxTotals: [],
2247
+ priceWithTaxes: { ...Y.price }
2248
+ };
2249
+ const ne = L, we = ot(
2250
+ Q.fullTax,
2251
+ ne,
2252
+ Y.price,
2253
+ Number(Y.credit.normal),
2254
+ H,
2255
+ q
2256
+ );
2257
+ return {
2258
+ ...Y,
2259
+ taxes: ne,
2260
+ taxTotals: we,
2261
+ priceWithTaxes: nt(
2262
+ we,
2263
+ Y.price,
2264
+ H
2265
+ )
2266
+ };
2267
+ })
2268
+ }));
2269
+ }
2270
+ async function ke(x, P, B) {
2271
+ const H = !B && !!P, q = !!B && !P;
2272
+ let L;
2273
+ if (H) {
2274
+ const U = Q.taxSystem[0] ? Q.systemDefaultCode(Q.taxSystem[0].code) : void 0, G = U ? `${U.name} (${U.taxCode})` : a("connect.store.taxPropagation.defaultTax");
2275
+ L = a("connect.store.taxPropagation.addConfirm", {
2276
+ taxCode: G
2277
+ });
2278
+ } else q ? L = a("connect.store.taxPropagation.removeConfirm") : L = a("connect.store.taxPropagation.updateConfirm");
2279
+ await Ie.confirm(
2280
+ L,
2281
+ a("connect.store.taxPropagation.title"),
2282
+ a("connect.store.taxPropagation.confirm"),
2283
+ a("connect.common.cancel")
2284
+ ) && await t(
2285
+ async () => {
2286
+ const U = Ae(l.sortedStoreCategories), G = _e(U, x);
2287
+ await Ue.updateStoreBundle({ categories: G }), await l.readMemberStore(), await l.readMembership(), await l.readRewards();
2288
+ },
2289
+ {
2290
+ message: a("connect.store.taxPropagation.updating"),
2291
+ successMessage: a("connect.store.taxPropagation.success")
2292
+ }
2293
+ );
2294
+ }
2295
+ async function Fe(x) {
2296
+ var G, ee, Y, ne;
2297
+ const P = ((ee = (G = l.storeOption) == null ? void 0 : G.company) == null ? void 0 : ee.sstRegNo) ?? "", B = pe.cloneDeep(
2298
+ ((Y = l.storeOption) == null ? void 0 : Y.inclusiveTaxes) ?? []
2299
+ ), H = ((ne = x.company) == null ? void 0 : ne.sstRegNo) ?? "";
2300
+ await t(
2301
+ async () => {
2302
+ var we;
2303
+ await Ue.updateStore(x), await l.readMemberStore(), (we = w.value) == null || we.showSheet(!1);
2304
+ },
2305
+ {
2306
+ message: a("connect.store.setting.update.message"),
2307
+ successMessage: a("connect.store.setting.update.success")
2308
+ }
2309
+ );
2310
+ const q = P !== H, L = !pe.isEqual(
2311
+ B,
2312
+ x.inclusiveTaxes ?? []
2313
+ );
2314
+ !(q || L) || l.sortedStoreCategories.flatMap(
2315
+ (we) => we.bundles
2316
+ ).length === 0 || await ke(x, H, P);
2317
+ }
2318
+ async function ye(x = -1) {
2319
+ var P;
2320
+ if (te.value) {
2321
+ Z();
2322
+ return;
2323
+ }
2324
+ r.open({
2325
+ title: x == -1 ? a("connect.store.category.add") : a("connect.store.category.edit"),
2326
+ contentComponent: qt,
2327
+ contentComponentProps: {
2328
+ initialValue: ((P = p.value[x]) == null ? void 0 : P.name) ?? "",
2329
+ action: x == -1 ? "add" : "edit"
2330
+ }
2331
+ }).onPrimary(async (B) => {
2332
+ B === null && !await Ie.remove(
2333
+ a("connect.store.category.remove.confirm"),
2334
+ a("connect.store.category.remove.title")
2335
+ ) || await t(
2336
+ async () => {
2337
+ const H = x == -1 ? [...p.value, { name: B, bundles: [] }] : [...p.value].map((q, L) => L == x ? { ...q, name: B } : q).filter((q) => q.name !== null);
2338
+ await Ue.updateStoreBundle({
2339
+ categories: H
2340
+ }), await l.readMemberStore();
2341
+ },
2342
+ {
2343
+ message: B === null ? a("connect.store.category.update.deleting") : x == -1 ? a("connect.store.category.update.creating") : a("connect.store.category.update.updating"),
2344
+ successMessage: B === null ? a("connect.store.category.update.success.deleted") : x == -1 ? a("connect.store.category.update.success.created") : a("connect.store.category.update.success.updated")
2345
+ }
2346
+ );
2347
+ });
2348
+ }
2349
+ async function ie(x, P, B, H) {
2350
+ var _, U, G;
2351
+ P ?? (P = (_ = u.value) == null ? void 0 : _.target.category), B ?? (B = (U = u.value) == null ? void 0 : U.target.index), H ?? (H = (G = u.value) == null ? void 0 : G.target.originalCategoryIndex);
2352
+ const q = Ae(p.value);
2353
+ for (const ee of q)
2354
+ for (const Y of ee.bundles)
2355
+ console.log(Y, "bundle in payload"), "pf_vouchers" in Y && delete Y.pf_vouchers;
2356
+ P != H && H != null && (q[H].bundles.splice(B, 1), B = q[P].bundles.length);
2357
+ const L = q[P];
2358
+ if (!L) {
2359
+ gt.error("Unexpected error", 2e3);
2360
+ return;
2361
+ }
2362
+ if (x == null) {
2363
+ if (await Ie.remove(
2364
+ a("connect.store.bundle.delete.confirm"),
2365
+ a("connect.store.bundle.delete.title")
2366
+ ) == !1)
2367
+ return;
2368
+ L.bundles.splice(B, 1);
2369
+ } else
2370
+ B == -1 ? L.bundles.push(x) : L.bundles[B] = x;
2371
+ await t(
2372
+ async () => {
2373
+ var ee, Y;
2374
+ if (x != null) {
2375
+ const ne = (ee = u.value) == null ? void 0 : ee.bundleImage;
2376
+ ne === null && x.image ? (await je.delete(x.image), x.image = null) : ne && (x.image = await je.update(
2377
+ je.bundleImagePath(void 0, ne),
2378
+ ne
2379
+ ));
2380
+ }
2381
+ await Ue.updateStoreBundle({
2382
+ categories: q
2383
+ }), await l.readMemberStore(), await l.readMembership(), await l.readRewards(), (Y = u.value) == null || Y.showSheet(!1);
2384
+ },
2385
+ {
2386
+ message: `${x == null ? "Deleting" : B == -1 ? "Creating" : "Updating"} bundle`,
2387
+ successMessage: `Bundle ${x == null ? "deleted" : B == -1 ? "created" : "updated"} successfully`
2388
+ }
2389
+ );
2390
+ }
2391
+ function Pe(x) {
2392
+ var P;
2393
+ if (te.value) {
2394
+ Z();
2395
+ return;
2396
+ }
2397
+ (P = u.value) == null || P.showSheet(!0, {
2398
+ ...x,
2399
+ bundle: x.bundle ? Ae(x.bundle) : void 0
2400
+ });
2401
+ }
2402
+ const Be = E(() => [
2403
+ c,
2404
+ g,
2405
+ d
2406
+ ]);
2407
+ function Ne(x) {
2408
+ var P;
2409
+ (P = h.value) == null || P.showSheet({
2410
+ bundle: x
2411
+ });
2412
+ }
2413
+ return De(async () => {
2414
+ await f(async () => {
2415
+ var x, P;
2416
+ if (await l.readMemberStore(), await l.readMembership(), await l.readRewards(), await l.readPayoutAccount(), await S.readPremium(), oe.value = !0, me.value = xe(), await C(), (x = o.currentRoute.value.query) != null && x.action) {
2417
+ switch ((P = o.currentRoute.value.query) == null ? void 0 : P.action) {
2418
+ case "update_setting":
2419
+ A("setting");
2420
+ break;
2421
+ case "create_category":
2422
+ ye(-1);
2423
+ break;
2424
+ case "create_feedvibe_bundle":
2425
+ r.open({
2426
+ title: "Select category",
2427
+ contentComponent: Ht
2428
+ }).onPrimary((B) => {
2429
+ r.close(), Pe({
2430
+ categories: y.value,
2431
+ category: B,
2432
+ index: -1,
2433
+ bundle: {
2434
+ ...pe.cloneDeep(Ke),
2435
+ isFeedvibe: !0,
2436
+ price: K.Dinero.fromNumber({
2437
+ number: 10,
2438
+ precision: 2
2439
+ }).toObject()
2440
+ }
2441
+ });
2442
+ }).onTertiary(() => r.close());
2443
+ break;
2444
+ }
2445
+ o.replace({ query: {} });
2446
+ }
2447
+ });
2448
+ }), (x, P) => {
2449
+ const B = v("RouterLink"), H = v("FmPageHead"), q = v("FmPill"), L = v("FmButton"), _ = v("FmCard");
2450
+ return m(), T(W, null, [
2451
+ i(H, {
2452
+ title: e(a)("connect.store.title"),
2453
+ actions: e(Be),
2454
+ "onClick:action": A
2455
+ }, {
2456
+ description: I(() => [
2457
+ n("span", Un, F(e(a)("connect.store.description")), 1),
2458
+ i(B, {
2459
+ to: Ve,
2460
+ class: "ml-8 fm-typo-en-link-md-600 text-fm-color-primary"
2461
+ }, {
2462
+ default: I(() => [
2463
+ le(F(e(a)("connect.store.viewTransactions")), 1)
2464
+ ]),
2465
+ _: 1
2466
+ })
2467
+ ]),
2468
+ _: 1
2469
+ }, 8, ["title", "actions"]),
2470
+ n("div", En, [
2471
+ e(te) ? (m(), R(Yo, {
2472
+ key: 0,
2473
+ class: "mt-12",
2474
+ "setting-status": e(z).settingStatus,
2475
+ "payout-status": e(z).payoutStatus,
2476
+ "requires-payout": e(z).requiresPayout,
2477
+ onSetupStoreSetting: P[0] || (P[0] = (U) => A("setting")),
2478
+ onSetupPayout: P[1] || (P[1] = (U) => A("payout"))
2479
+ }, null, 8, ["setting-status", "payout-status", "requires-payout"])) : e(me) ? M("", !0) : (m(), R(tn, {
2480
+ key: 1,
2481
+ class: "mt-12",
2482
+ onDismiss: fe
2483
+ })),
2484
+ n("div", Dn, [
2485
+ n("div", Bn, [
2486
+ n("div", Nn, F(e(a)("connect.store.giftCard.title")), 1),
2487
+ i(q, {
2488
+ variant: "premium",
2489
+ label: e(a)("connect.store.giftCard.new")
2490
+ }, null, 8, ["label"]),
2491
+ e(N) && e($).length ? (m(), R(L, {
2492
+ key: 0,
2493
+ icon: "edit",
2494
+ size: "md",
2495
+ variant: "tertiary",
2496
+ onClick: P[2] || (P[2] = (U) => k(e($)[0]))
2497
+ })) : M("", !0),
2498
+ P[4] || (P[4] = n("div", { class: "flex-1" }, null, -1)),
2499
+ e(N) && e($).length ? (m(), T("div", Mn, F(e(a)("connect.store.giftCard.oneLiveHint")), 1)) : M("", !0)
2500
+ ]),
2501
+ !e(N) || !e($).length ? (m(), R(In, {
2502
+ key: 0,
2503
+ premium: e(N),
2504
+ onUpgrade: j,
2505
+ onComparePlans: Se,
2506
+ onCreate: s
2507
+ }, null, 8, ["premium"])) : (m(), T("div", On, [
2508
+ (m(!0), T(W, null, de(e($), (U) => (m(), R(Mo, {
2509
+ key: String(U._id),
2510
+ program: U,
2511
+ onEdit: (G) => k(U),
2512
+ onSetLive: (G) => D(U),
2513
+ onDeactivate: (G) => J(U)
2514
+ }, null, 8, ["program", "onEdit", "onSetLive", "onDeactivate"]))), 128)),
2515
+ i(_, {
2516
+ variant: "outlined",
2517
+ class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
2518
+ }, {
2519
+ default: I(() => [
2520
+ i(L, {
2521
+ label: e(a)("connect.store.giftCard.addGiftCard"),
2522
+ icon: "add",
2523
+ variant: "secondary",
2524
+ onClick: s
2525
+ }, null, 8, ["label"])
2526
+ ]),
2527
+ _: 1
2528
+ })
2529
+ ]))
2530
+ ]),
2531
+ e(p) && e(p).length > 0 ? (m(), T(W, { key: 2 }, [
2532
+ (m(!0), T(W, null, de(e(p), (U, G) => (m(), T("div", {
2533
+ key: U.name,
2534
+ class: "space-y-8 py-12"
2535
+ }, [
2536
+ n("div", Ln, [
2537
+ n("div", An, F(U.name), 1),
2538
+ i(Je, { json: U }, null, 8, ["json"]),
2539
+ i(L, {
2540
+ icon: "edit",
2541
+ size: "md",
2542
+ variant: "tertiary",
2543
+ onClick: (ee) => ye(G)
2544
+ }, null, 8, ["onClick"])
2545
+ ]),
2546
+ n("div", jn, [
2547
+ (m(!0), T(W, null, de(U.bundles, (ee, Y) => (m(), R(Mt, {
2548
+ bundle: ee,
2549
+ key: ee._id,
2550
+ onEdit: (ne) => Pe({
2551
+ bundle: ee,
2552
+ category: G,
2553
+ index: Y,
2554
+ categories: e(y)
2555
+ }),
2556
+ onDelete: (ne) => ie(null, G, Y),
2557
+ onSend: Ne
2558
+ }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
2559
+ i(Ot, {
2560
+ onCreate: (ee) => Pe({
2561
+ category: G,
2562
+ index: -1,
2563
+ categories: e(y)
2564
+ })
2565
+ }, null, 8, ["onCreate"])
2566
+ ])
2567
+ ]))), 128)),
2568
+ i(wo, {
2569
+ ref_key: "bundleSheetRef",
2570
+ ref: u,
2571
+ onUpdate: ie
2572
+ }, null, 512)
2573
+ ], 64)) : (m(), R(_, {
2574
+ key: 3,
2575
+ variant: "outlined",
2576
+ class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
2577
+ }, {
2578
+ default: I(() => [
2579
+ P[5] || (P[5] = n("img", {
2580
+ src: it,
2581
+ class: "aspect-square w-[150px]"
2582
+ }, null, -1)),
2583
+ n("div", qn, [
2584
+ n("div", Gn, F(e(a)("connect.store.bundle.title")), 1),
2585
+ n("div", Kn, F(e(a)("connect.store.bundle.description")), 1)
2586
+ ]),
2587
+ i(L, {
2588
+ variant: "primary",
2589
+ label: e(a)("connect.store.actions.addCategory"),
2590
+ icon: "add",
2591
+ onClick: P[3] || (P[3] = (U) => ye(-1))
2592
+ }, null, 8, ["label"])
2593
+ ]),
2594
+ _: 1
2595
+ })),
2596
+ i(uo, {
2597
+ ref_key: "settingSheetRef",
2598
+ ref: w,
2599
+ onUpdate: Fe
2600
+ }, null, 512),
2601
+ i(Po, {
2602
+ ref_key: "sendBundleSheetRef",
2603
+ ref: h
2604
+ }, null, 512)
2605
+ ])
2606
+ ], 64);
2607
+ };
2608
+ }
2609
+ });
2610
+ export {
2611
+ wa as default
2612
+ };