@feedmepos/mf-connect 0.1.111-prod → 0.1.113-beta.3

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 (162) hide show
  1. package/README.md +66 -1
  2. package/dist/{App-D3pYl3WL.js → App-YfpYV7C0.js} +738 -689
  3. package/dist/AuditLogs-kD0_HO_p.js +2016 -0
  4. package/dist/{Bin-DOZqpbYH.js → Bin-Dr-Xp3pn.js} +8 -8
  5. package/dist/Broadcast-CEbHu2xA.js +306 -0
  6. package/dist/{CampaignAnalytic-cFKvCgxX.js → CampaignAnalytic-DDiGxPwp.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-B0eVEubS.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js} +49 -32
  8. package/dist/Card-BUnwg0eM.js +1086 -0
  9. package/dist/{Collections-9QK5hbLo.js → Collections-CKyBkKq2.js} +197 -185
  10. package/dist/{Credit-8Ouy4O9a.js → Credit-CJOXWLV1.js} +21 -20
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CJA-yunY.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js} +1 -1
  12. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js +4442 -0
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-Dv0q3B8m.js → EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js} +32 -32
  14. package/dist/{Experience-DMh4hR1S.js → Experience-C_Am5CTY.js} +32 -31
  15. package/dist/{FileSaver.min-Bx9mdUgJ.js → FileSaver.min-CueAGbjq.js} +1 -1
  16. package/dist/{Game-CL0TZvg1.js → Game-B6GO_LVU.js} +19 -18
  17. package/dist/GiftCardSetup-CVLDDpI2.js +748 -0
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Bz5kIfoM.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js} +7 -7
  19. package/dist/{Goals-Dz5Vp-lj.js → Goals-BX-sMV2V.js} +4 -4
  20. package/dist/Grab-Bh335Srh.js +301 -0
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js → ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js} +1 -1
  22. package/dist/{Index-kH8aAegB.js → Index-CyXRbwcm.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-CFrgC3Ka.js → LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-DPIFLdBc.js → LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js} +1 -1
  25. package/dist/{LoyaltyDashboard-BBxEoWol.js → LoyaltyDashboard-DrTq8oiu.js} +15 -15
  26. package/dist/MainLayout-KbKkpX5n.js +4 -0
  27. package/dist/{MainLayout-2BLwDyHQ.js → MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js} +5 -4
  28. package/dist/{Marketing-C4OnSV-c.js → Marketing-DQT1MWQg.js} +4 -4
  29. package/dist/MarketingMaterialEdit-fSqr53-M.js +1037 -0
  30. package/dist/{Member-CT9WwxP0.js → Member-DwDUCzlv.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-C7yznkUn.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js} +43 -49
  32. package/dist/{MemberImportHistory-B__BFID7.js → MemberImportHistory-D4ezvJGZ.js} +7 -7
  33. package/dist/{MemberList-DgLI4wty.js → MemberList-DFieV7Qk.js} +103 -105
  34. package/dist/{MemberTransactions-UFx_DZYe.js → MemberTransactions-BPOXyAuC.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BFjZA8Y6.js → MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js} +4821 -4690
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Df9bxbUl.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js} +1 -1
  37. package/dist/{Mission-CawzGzDu.js → Mission-nErb05Es.js} +22 -21
  38. package/dist/{Overview-D19oSo24.js → Overview-7G31a7B-.js} +58 -56
  39. package/dist/{Overview-CAtTlEVa.js → Overview-DuJr_hAg.js} +145 -144
  40. package/dist/{Point-BPAGmKAj.js → Point-PWDLemD4.js} +22 -21
  41. package/dist/{Promotion-B0Uf9vjL.js → Promotion-N80Tj8M6.js} +137 -131
  42. package/dist/{Queue-CJEAFss_.js → Queue-M7ZpgiMT.js} +49 -47
  43. package/dist/{Record-s6hSQG2P.js → Record-NhxrdvWv.js} +9 -9
  44. package/dist/{Review-DhNCbAOm.js → Review-DiAaAzIG.js} +2 -2
  45. package/dist/ReviewFacebookCallback-JdyxFbNl.js +225 -0
  46. package/dist/{ReviewGoogleCallback-D8ENWii2.js → ReviewGoogleCallback-BXbI3Bsh.js} +5 -5
  47. package/dist/{Reward-BT00QsXL.js → Reward-yTaOqOT8.js} +29 -29
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DaZDGhbm.js → RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js} +26 -24
  49. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js +1923 -0
  50. package/dist/{Segment-BuGhX9zg.js → Segment-DE9Bcd6R.js} +287 -287
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-DB718_4P.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js} +37 -35
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CkgXxy0C.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js} +4 -4
  53. package/dist/Setting-C0JAxIRT.js +574 -0
  54. package/dist/{SettingAdvertisements-aqFErKAr.js → SettingAdvertisements-DxueyKU8.js} +12 -12
  55. package/dist/Settings-Cs46AcxZ.js +286 -0
  56. package/dist/Store-DqQae9nE.js +2629 -0
  57. package/dist/{StoreRewards-D2pTL2oA.js → StoreRewards-JxSUsOzJ.js} +15 -15
  58. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js +1319 -0
  59. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js +7007 -0
  60. package/dist/{Tier-OyE8oH2r.js → Tier-DWhgWush.js} +2576 -686
  61. package/dist/{Title-DAl7CKL_.js → Title-DUNeMdz8.js} +104 -101
  62. package/dist/Transaction-DAv-LVhC.js +45 -0
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-C0yHxQVr.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js} +26 -26
  64. package/dist/{Voucher-D2QGWSxs.js → Voucher-uLTq9RSK.js} +19 -19
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Bt2YB745.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js} +16 -16
  66. package/dist/WhatsappAccount-BpXQ4q0P.js +158 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js +39 -0
  68. package/dist/WhatsappBot-DB4NRZMd.js +589 -0
  69. package/dist/WhatsappBotLogs-DDN4H_bv.js +372 -0
  70. package/dist/WhatsappBotSettings-Bkv1VNwF.js +387 -0
  71. package/dist/WhatsappBotTickets-DAKgnE6T.js +162 -0
  72. package/dist/WhatsappLayout-DSnq84Uo.js +21 -0
  73. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +195 -0
  74. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js → ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js} +2 -2
  75. package/dist/{app-QxosLNkH.js → app-Devzv4gO.js} +12854 -9732
  76. package/dist/app.js +4 -3
  77. package/dist/base.export-CCSMkvAm.js +75 -0
  78. package/dist/browser-BSAOEeIM.js +1478 -0
  79. package/dist/{business-CbqG6NXr.js → business-BjAmUqNA.js} +1 -1
  80. package/dist/campaign-C5c47GqT.js +400 -0
  81. package/dist/{campaign-Rj7oDBnN.js → campaign-CTe-T5Gd.js} +31 -25
  82. package/dist/{campaign.enum-B7vdNYKd.js → campaign.enum-Dx-Zo68Q.js} +3 -2
  83. package/dist/campaign.fn-DxAO8A5b.js +776 -0
  84. package/dist/{collectible.enum-BsQseg7-.js → collectible.enum-Liy2wH3s.js} +1 -1
  85. package/dist/{collection.fn-EbUIyB1X.js → collection.fn-C9l-OtNt.js} +2 -2
  86. package/dist/currency-mwm4AWXK.js +7 -0
  87. package/dist/duplicateCampaign-BbC4AwQ1.js +51 -0
  88. package/dist/{effect-B_91OlcX.js → effect-D8ba9z0K.js} +1 -1
  89. package/dist/{email-addresses-DXnYZG-e.js → email-addresses-BR5J6_Jz.js} +2 -2
  90. package/dist/feature-flag-C-5NdFW8.js +868 -0
  91. package/dist/feature-flag-CNcU4_3r.js +50 -0
  92. package/dist/google-BQK68wbe.js +5 -0
  93. package/dist/{helper-_uhiXya1.js → helper-D9cEaMIv.js} +1 -1
  94. package/dist/index-0H82-X0n.js +80 -0
  95. package/dist/{index-Cp7oHMm3.js → index-B1jP-_Z_.js} +691 -229
  96. package/dist/{index-BZ2b0Pk6.js → index-B7HH6vKF.js} +8 -7
  97. package/dist/{index-tbo0pMIu.js → index-BFaZp6Et.js} +29 -15
  98. package/dist/index-B_gzo75q.js +53 -0
  99. package/dist/{index-DlQJZNwD.js → index-BfoDdVQS.js} +22 -6
  100. package/dist/{index-CDm0BWa3.js → index-BvY2hQac.js} +1 -1
  101. package/dist/index-Byg4ztr-.js +902 -0
  102. package/dist/{index-BWgc2-Qz.js → index-CZfqqrVu.js} +4 -3
  103. package/dist/index-C_H8jFYf.js +2743 -0
  104. package/dist/{index-xuFTeVrb.js → index-CmzjBrHR.js} +11 -9
  105. package/dist/{index-BBihP1s2.js → index-Ct6YjTIW.js} +2 -2
  106. package/dist/{index-Df4l6y-S.js → index-D34iYRdc.js} +1900 -2121
  107. package/dist/{index-DuhRCI0L.js → index-D4k1G2oE.js} +4 -4
  108. package/dist/{index-uuNGb1nv.js → index-DnepoNWn.js} +8028 -10766
  109. package/dist/index-Drmh0FT-.js +14571 -0
  110. package/dist/{index-DlGnYR5y.js → index-DtcUCknS.js} +2700 -2613
  111. package/dist/{index-C_1iqF1Q.js → index-DwTBiVts.js} +1 -1
  112. package/dist/{index-CWUmrVo_.js → index-OvnHt5x5.js} +800 -793
  113. package/dist/index-RwNlbTO8.js +115 -0
  114. package/dist/{index-CzYxnDWP.js → index-VqAbYyHH.js} +11 -6
  115. package/dist/{index-DzBzClHP.js → index-yGSko6Eq.js} +1 -1
  116. package/dist/{index.esm2017-B72iWwk_.js → index.esm2017-DLb2VyCT.js} +156 -156
  117. package/dist/{loading-rIhCiB_S.js → loading-CUNk5u1d.js} +1 -1
  118. package/dist/{lodash-B6fOjfjd.js → lodash-BJXravls.js} +1 -1
  119. package/dist/{member-import-CbHn7zss.js → member-import-DjYoddBi.js} +6 -5
  120. package/dist/{membership-DkJN7jyQ.js → membership-ByJUFP8f.js} +3 -3
  121. package/dist/{money-ChbDx6Nq.js → money-Bf2IEMJJ.js} +1 -1
  122. package/dist/{number-9TEd27Ku.js → number-CRBHrRUL.js} +1 -1
  123. package/dist/objectid-58gyOvdR.js +145 -0
  124. package/dist/{onboarding-BN3MKVRs.js → onboarding-CQ3lw7eY.js} +25 -25
  125. package/dist/{onboardingSetup-D9xhdgS3.js → onboardingSetup-CsdZKGFk.js} +2 -2
  126. package/dist/{plugins-CCibSJZa.js → plugins-iTZLbJGy.js} +3 -3
  127. package/dist/{MarketingMaterialEdit-DFhpsI2-.js → remy-icon-BhUGu2NI.js} +2 -1031
  128. package/dist/{reward-DjasF-NL.js → reward-DTN6JpEd.js} +1 -1
  129. package/dist/{rule-DqeChj0e.js → rule-BYACNQOL.js} +572 -492
  130. package/dist/style.css +1 -1
  131. package/dist/template--Vr0PCjB.js +188 -0
  132. package/dist/{timezone-D0nC1LDx.js → timezone-DwzjOED-.js} +1 -1
  133. package/dist/{transaction.fn-BkF4Ad2z.js → transaction.fn-DapYe3n7.js} +2 -2
  134. package/dist/{trigger-CxpXoQJO.js → trigger-D8r76yb0.js} +18 -18
  135. package/dist/{useMarketingMaterialActions-p0-fyMkm.js → useMarketingMaterialActions-CdMmibPE.js} +3 -3
  136. package/dist/{usePagination-CrC-1v4L.js → usePagination-BRcQJkO1.js} +1 -1
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +62 -0
  138. package/dist/{user-CrylHgF1.js → user-vBZFKqXQ.js} +1 -1
  139. package/dist/vue-i18n-Cw6fF11e.js +2365 -0
  140. package/dist/{xlsx-CJNYF7-l.js → xlsx-Muy_Rjhk.js} +440 -440
  141. package/dist/{zod-Dzn9S95S.js → zod-CCPTOeUz.js} +1 -1
  142. package/package.json +12 -3
  143. package/dist/Broadcast-DZ4SP99P.js +0 -271
  144. package/dist/Card-B5ni027Q.js +0 -911
  145. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-BYxswo-Z.js +0 -2430
  146. package/dist/ReviewFacebookCallback-DeZqcpJo.js +0 -238
  147. package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-BvxbKSkB.js +0 -1882
  148. package/dist/Setting-BOWPp05N.js +0 -2036
  149. package/dist/Settings-DekXvE-R.js +0 -179
  150. package/dist/Store-DpVlMuau.js +0 -1998
  151. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CNDv6eiZ.js +0 -1009
  152. package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-C-C3RSeW.js +0 -142
  153. package/dist/Transaction-mvKzTgLx.js +0 -39
  154. package/dist/campaign-Co4Lq-Wz.js +0 -228
  155. package/dist/campaign.fn-DolD3lYJ.js +0 -776
  156. package/dist/export-D0hWZSfH.js +0 -97
  157. package/dist/google-C3S8u0mT.js +0 -4
  158. package/dist/index-aCuOvuEC.js +0 -45
  159. package/dist/objectid-CGol1NeA.js +0 -145
  160. package/dist/rule-builder-DT854ycI.js +0 -102
  161. package/dist/template-BeCVA0-N.js +0 -236
  162. package/dist/vue-i18n-BjtkXdmG.js +0 -2365
@@ -1,1998 +0,0 @@
1
- import { defineComponent as te, computed as L, resolveComponent as S, openBlock as x, createBlock as O, withCtx as B, createElementVNode as F, toDisplayString as K, createVNode as r, createCommentVNode as E, createElementBlock as D, unref as e, Fragment as Y, renderList as ce, ref as N, isRef as re, reactive as ze, onMounted as he, watch as Pe, toRaw as Je, createTextVNode as me, h as Ge } from "vue";
2
- import { _ as Xe } from "./tier-BJDhpH6X.js";
3
- import { useDialog as je, useDialogChild as Le, components as Ze } from "@feedmepos/ui-library";
4
- import { c as A, e as _e, S as Qe } from "./index-CWUmrVo_.js";
5
- import { u as Ke } from "./loading-rIhCiB_S.js";
6
- import { u as ke, C as ye } from "./membership-DkJN7jyQ.js";
7
- import { n as et, o as tt, p as nt, q as Ae, r as ot } from "./index-Df4l6y-S.js";
8
- import { a as at, c as Fe } from "./object-BYyQ0PZp.js";
9
- import { _ as ae } from "./lodash-B6fOjfjd.js";
10
- import { c as ue } from "./index-uuNGb1nv.js";
11
- import { u as xe } from "./vue-i18n-BjtkXdmG.js";
12
- import { Z as Q, g as G, a as X } from "./zod-Dzn9S95S.js";
13
- import { z as ee, R as lt } from "./app-QxosLNkH.js";
14
- import { u as Se } from "./app-wDQR6dpb.js";
15
- import { _ as le } from "./ZodTextField.vue_vue_type_script_setup_true_lang-BzCL64Jo.js";
16
- import { c as st, p as pe, n as rt, f as Ve } from "./plugins-CCibSJZa.js";
17
- import { J as Te } from "./JsonViewer-v8_C7l5N.js";
18
- import { _ as it } from "./index-DlGnYR5y.js";
19
- import { _ as dt } from "./ImageInput.vue_vue_type_script_setup_true_lang-CaPDI3vY.js";
20
- import { _ as ut } from "./ChipMenu.vue_vue_type_script_setup_true_lang-BPpZZNkr.js";
21
- import { z as ct, a as mt } from "./money-ChbDx6Nq.js";
22
- import { F as pt } from "./number-9TEd27Ku.js";
23
- import { a as ft, t as yt } from "./helper-_uhiXya1.js";
24
- import "./index-CDm0BWa3.js";
25
- import "./index-Cp7oHMm3.js";
26
- import "./index-BZ2b0Pk6.js";
27
- import "./index-BWgc2-Qz.js";
28
- import { m as bt } from "./index-BBihP1s2.js";
29
- import { m as ge } from "./index-DlQJZNwD.js";
30
- import { useRouter as gt } from "vue-router";
31
- function He(C) {
32
- return ue.DineroFactory(C).toUnit();
33
- }
34
- function qe(C, _, o, b, s = [], v = []) {
35
- const a = it.compact(
36
- _.map((t) => C.find((c) => c.systemCode === t.systemCode && c.taxCode === t.taxCode)).filter((t) => !!t && v.includes(t.systemCode))
37
- ), m = a.reduce(
38
- (t, c) => {
39
- var y;
40
- return Object.assign(t, {
41
- [c.taxCode]: {
42
- inclusive: ((y = s.find((u) => u.systemCode === c.systemCode)) == null ? void 0 : y.inclusive) || !1,
43
- adjustment: {
44
- level: 1,
45
- type: {
46
- type: "BY_MULTIPLIER",
47
- amount: {
48
- amount: c.rate.amount,
49
- precision: c.rate.precision,
50
- currency: "MYR"
51
- }
52
- }
53
- }
54
- }
55
- });
56
- },
57
- {}
58
- ), i = ue.Calculator.calculate({
59
- items: {
60
- 0: {
61
- quantity: 1,
62
- adjustments: {
63
- price: {
64
- level: 0,
65
- type: {
66
- type: "BY_AMOUNT",
67
- amount: ue.DineroFactory(o).subtract(ue.Dinero.fromNumber({ number: b }).toObject()).toObject()
68
- }
69
- }
70
- },
71
- taxes: m
72
- }
73
- },
74
- adjustments: {},
75
- roundToNearest: 0
76
- });
77
- return a.map((t) => ({
78
- setting: t,
79
- systemCode: t.systemCode,
80
- name: t.name,
81
- taxCode: t.taxCode,
82
- rate: t.rate,
83
- total: ue.DineroFactory({
84
- ...i.items[0].taxes[t.taxCode].amount
85
- }).convertPrecision(2).toObject()
86
- }));
87
- }
88
- function We(C, _, o) {
89
- return C ? C.reduce((b, s) => {
90
- var v;
91
- return (v = o.find((a) => a.systemCode === s.systemCode)) != null && v.inclusive || (b = ue.DineroFactory(b.toObject()).add(s.total)), b;
92
- }, ue.DineroFactory(_)).toObject() : ue.DineroFactory(_).toObject();
93
- }
94
- const vt = { class: "flex justify-between items-start gap-4 w-full" }, ht = { class: "fm-typo-en-body-lg-600 text-left pt-4 break-words line-clamp-2" }, xt = { class: "flex-shrink-0 -mr-8 -mt-8" }, Ct = { class: "relative h-[120px] aspect-video flex mx-auto items-center justify-center border rounded-md border-fm-color-neutral-gray-300" }, _t = ["src"], St = {
95
- key: 2,
96
- class: "absolute top-2 left-2"
97
- }, Ft = { class: "flex flex-col gap-8 flex-1 text-left w-full" }, Vt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wt = { class: "flex gap-8 items-center flex-wrap" }, Pt = /* @__PURE__ */ te({
98
- __name: "StoreBundleCard",
99
- props: {
100
- bundle: { type: Object, required: !0 }
101
- },
102
- emits: ["edit", "delete", "send"],
103
- setup(C, { emit: _ }) {
104
- const o = C, b = _, s = L(() => {
105
- const a = [];
106
- return o.bundle.price.amount > 0 && a.push(
107
- `${A.Config.getCountry().currency.symbol}${He(o.bundle.price)}`
108
- ), o.bundle.coinPrice && a.push(`${o.bundle.coinPrice} point(s)`), a.join(" or ");
109
- }), v = L(() => {
110
- var m, i;
111
- const a = [];
112
- if (o.bundle.titles.length > 0 && a.push(`${o.bundle.titles.length} title(s)`), o.bundle.vouchers.length > 0 && a.push(`${o.bundle.vouchers.length} voucher(s)`), o.bundle.credit.normal || (m = o.bundle.credit.free) != null && m.amount) {
113
- const t = o.bundle.credit.normal + (((i = o.bundle.credit.free) == null ? void 0 : i.amount) ?? 0);
114
- a.push(`${t} credit(s)`);
115
- }
116
- return a;
117
- });
118
- return (a, m) => {
119
- const i = S("FmButton"), t = S("FmMenuItem"), c = S("FmMenu"), y = S("FmIcon"), u = S("FmChip"), k = S("FmCard");
120
- return x(), O(k, {
121
- variant: "outlined",
122
- class: "flex flex-col gap-y-8 p-16 min-h-[240px] h-full"
123
- }, {
124
- default: B(() => [
125
- F("div", vt, [
126
- F("div", ht, K(C.bundle.name), 1),
127
- F("div", xt, [
128
- r(c, { placement: "bottom-end" }, {
129
- "menu-button": B(() => [
130
- r(i, {
131
- icon: "more_vert",
132
- variant: "tertiary"
133
- })
134
- ]),
135
- default: B(() => [
136
- r(t, {
137
- onClick: m[0] || (m[0] = (l) => b("edit", C.bundle)),
138
- icon: "edit",
139
- label: "Edit"
140
- }),
141
- C.bundle.stripePriceId ? E("", !0) : (x(), O(t, {
142
- key: 0,
143
- onClick: m[1] || (m[1] = (l) => b("send", C.bundle)),
144
- icon: "send",
145
- label: "Send"
146
- })),
147
- r(t, {
148
- onClick: m[2] || (m[2] = (l) => b("delete", C.bundle)),
149
- icon: "delete"
150
- }, {
151
- label: B(() => [...m[3] || (m[3] = [
152
- F("div", { class: "text-fm-color-typo-error fm-typo-en-body-md-400" }, " Delete ", -1)
153
- ])]),
154
- _: 1
155
- })
156
- ]),
157
- _: 1
158
- })
159
- ])
160
- ]),
161
- F("div", Ct, [
162
- C.bundle.image ? (x(), D("img", {
163
- key: 1,
164
- src: C.bundle.image,
165
- class: "w-full h-full object-contain aspect-video"
166
- }, null, 8, _t)) : (x(), O(y, {
167
- key: 0,
168
- name: "image",
169
- outline: !0,
170
- size: "md",
171
- class: "text-fm-color-neutral-gray-200"
172
- })),
173
- C.bundle.isFeedvibe ? (x(), D("div", St, [
174
- r(u, {
175
- label: "Feedvibe",
176
- class: "text-fm-color-primary bg-fm-color-system-warning-100",
177
- compact: ""
178
- })
179
- ])) : E("", !0)
180
- ]),
181
- F("div", Ft, [
182
- F("div", Vt, K(e(s) || "Free"), 1),
183
- F("div", wt, [
184
- (x(!0), D(Y, null, ce(e(v), (l, w) => (x(), O(u, {
185
- key: w,
186
- label: l
187
- }, null, 8, ["label"]))), 128))
188
- ])
189
- ])
190
- ]),
191
- _: 1
192
- });
193
- };
194
- }
195
- }), kt = /* @__PURE__ */ te({
196
- __name: "AddBundleCard",
197
- emits: ["create"],
198
- setup(C, { emit: _ }) {
199
- const { t: o } = xe(), b = _;
200
- return (s, v) => {
201
- const a = S("FmButton"), m = S("FmCard");
202
- return x(), O(m, {
203
- variant: "outlined",
204
- class: "flex flex-col gap-y-8 p-16 h-full min-h-[240px] items-center justify-center"
205
- }, {
206
- default: B(() => [
207
- r(a, {
208
- onClick: v[0] || (v[0] = (i) => b("create")),
209
- label: e(o)("connect.store.actions.addBundle"),
210
- icon: "add",
211
- variant: "secondary"
212
- }, null, 8, ["label"])
213
- ]),
214
- _: 1
215
- });
216
- };
217
- }
218
- }), Tt = { class: "space-y-16" }, $t = { class: "flex w-full justify-between pb-16" }, Ut = { class: "flex items-center justify-end gap-8" }, Rt = /* @__PURE__ */ te({
219
- __name: "CategoryDialog",
220
- props: {
221
- action: {
222
- type: String,
223
- default: () => "add"
224
- },
225
- initialValue: {
226
- type: String,
227
- default: () => ""
228
- }
229
- },
230
- setup(C) {
231
- const { t: _ } = xe(), o = C, b = je(), { emitData: s, emitAction: v } = Le(), a = N(o.initialValue), m = ee.string().min(1);
232
- function i() {
233
- s(a.value), v("primary"), b.close();
234
- }
235
- function t() {
236
- s(null), v("primary"), b.close();
237
- }
238
- return (c, y) => {
239
- const u = S("FmTextField"), k = S("FmButton");
240
- return x(), D("div", Tt, [
241
- r(u, {
242
- modelValue: e(a),
243
- "onUpdate:modelValue": y[0] || (y[0] = (l) => re(a) ? a.value = l : null),
244
- label: e(_)("connect.store.category.label"),
245
- rules: [e(Q).toRule(e(m))]
246
- }, null, 8, ["modelValue", "label", "rules"]),
247
- F("div", $t, [
248
- F("div", null, [
249
- C.action == "edit" ? (x(), O(k, {
250
- key: 0,
251
- onClick: t,
252
- label: e(_)("connect.common.delete"),
253
- variant: "destructive"
254
- }, null, 8, ["label"])) : E("", !0)
255
- ]),
256
- F("div", Ut, [
257
- r(k, {
258
- label: e(_)("connect.common.cancel"),
259
- variant: "tertiary",
260
- onClick: y[1] || (y[1] = (l) => e(b).close())
261
- }, null, 8, ["label"]),
262
- r(k, {
263
- label: C.action == "edit" ? e(_)("connect.common.edit") : e(_)("connect.common.add"),
264
- disabled: !e(a),
265
- onClick: i
266
- }, null, 8, ["label", "disabled"])
267
- ])
268
- ])
269
- ]);
270
- };
271
- }
272
- }), It = { class: "space-y-16" }, Bt = { class: "flex items-center justify-end gap-8 pb-16" }, Nt = /* @__PURE__ */ te({
273
- __name: "SelectCategoryDialog",
274
- setup(C) {
275
- const { emitData: _, emitAction: o } = Le(), b = ke(), s = N(), v = L(
276
- () => b.sortedStoreCategories.map((a, m) => ({
277
- label: a.name,
278
- value: m
279
- }))
280
- );
281
- return (a, m) => {
282
- const i = S("FmSelect"), t = S("FmButton");
283
- return x(), D("div", It, [
284
- m[4] || (m[4] = F("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Select a category to create FeedMe CNY 2025 bundle ", -1)),
285
- r(i, {
286
- placeholder: "Select a category",
287
- items: e(v),
288
- modelValue: e(s),
289
- "onUpdate:modelValue": [
290
- m[0] || (m[0] = (c) => re(s) ? s.value = c : null),
291
- m[1] || (m[1] = (c) => e(_)(c))
292
- ],
293
- label: "Category"
294
- }, null, 8, ["items", "modelValue"]),
295
- F("div", Bt, [
296
- r(t, {
297
- variant: "tertiary",
298
- label: "Cancel",
299
- onClick: m[2] || (m[2] = (c) => e(o)("tertiary"))
300
- }),
301
- r(t, {
302
- label: "Select",
303
- onClick: m[3] || (m[3] = (c) => e(o)("primary")),
304
- disabled: e(s) == null
305
- }, null, 8, ["disabled"])
306
- ])
307
- ]);
308
- };
309
- }
310
- });
311
- function se(C) {
312
- return C.states.map((_) => ({ label: _, value: _ }));
313
- }
314
- const Dt = {
315
- [_e.F_COUNTRY.enum.MY]: {
316
- states: [
317
- "Johor",
318
- "Kedah",
319
- "Kelantan",
320
- "Kuala Lumpur",
321
- "Labuan",
322
- "Melaka",
323
- "Negeri Sembilan",
324
- "Pahang",
325
- "Perak",
326
- "Perlis",
327
- "Pulau Pinang",
328
- "Putrajaya",
329
- "Sabah",
330
- "Sarawak",
331
- "Selangor",
332
- "Terengganu"
333
- ],
334
- get stateItems() {
335
- return se(this);
336
- }
337
- },
338
- [_e.F_COUNTRY.enum.SG]: {
339
- states: [],
340
- get stateItems() {
341
- return se(this);
342
- }
343
- },
344
- JP: {
345
- states: [],
346
- get stateItems() {
347
- return se(this);
348
- }
349
- },
350
- AE: {
351
- states: [],
352
- get stateItems() {
353
- return se(this);
354
- }
355
- },
356
- AU: {
357
- states: [],
358
- get stateItems() {
359
- return se(this);
360
- }
361
- },
362
- MO: {
363
- states: [],
364
- get stateItems() {
365
- return se(this);
366
- }
367
- },
368
- VN: {
369
- states: [],
370
- get stateItems() {
371
- return se(this);
372
- }
373
- },
374
- [_e.F_COUNTRY.enum.ID]: {
375
- states: [
376
- "Aceh",
377
- "Bali",
378
- "Bangka-Belitung",
379
- "Banten",
380
- "Bengkulu",
381
- "Central Java",
382
- "Central Sulawesi",
383
- "Daerah Istimewa Yogyakarta",
384
- "East Java",
385
- "East Kalimantan",
386
- "East Nusa Tenggara",
387
- "Gorontalo",
388
- "Jakarta Raya",
389
- "Jambi",
390
- "Kalimantan Tengah",
391
- "Lampung",
392
- "Maluku",
393
- "Maluku Utara",
394
- "North Sulawesi",
395
- "North Sumatra",
396
- "Nusa Tenggara Barat",
397
- "Papua",
398
- "Riau",
399
- "Riau Islands",
400
- "South Kalimantan",
401
- "South Sulawesi",
402
- "South Sumatra",
403
- "Sulawesi Barat",
404
- "Sulawesi Tenggara",
405
- "West Java",
406
- "West Kalimantan",
407
- "West Papua",
408
- "West Sumatra"
409
- ],
410
- get stateItems() {
411
- return se(this);
412
- }
413
- },
414
- [_e.F_COUNTRY.enum.TH]: {
415
- states: [
416
- "Bangkok",
417
- "Amnat Charoen",
418
- "Ang Thong",
419
- "Bueng Kan",
420
- "Buri Ram",
421
- "Chachoengsao",
422
- "Chai Nat",
423
- "Chaiyaphum",
424
- "Chanthaburi",
425
- "Chiang Mai",
426
- "Chiang Rai",
427
- "Chonburi",
428
- "Chumphon",
429
- "Kalasin",
430
- "Kamphaeng Phet",
431
- "Kanchanaburi",
432
- "Khon Kaen",
433
- "Krabi",
434
- "Lampang",
435
- "Lamphun",
436
- "Loei",
437
- "Lopburi",
438
- "Mae Hong Son",
439
- "Maha Sarakham",
440
- "Mukdahan",
441
- "Nakhon Nayok",
442
- "Nakhon Pathom",
443
- "Nakhon Phanom",
444
- "Nakhon Ratchasima",
445
- "Nakhon Sawan",
446
- "Nakhon Si Thammarat",
447
- "Nan",
448
- "Narathiwat",
449
- "Nong Bua Lamphu",
450
- "Nong Khai",
451
- "Nonthaburi",
452
- "Pathum Thani",
453
- "Pattani",
454
- "Phang Nga",
455
- "Phatthalung",
456
- "Phayao",
457
- "Phetchabun",
458
- "Phetchaburi",
459
- "Phichit",
460
- "Phitsanulok",
461
- "Phra Nakhon Si Ayutthaya",
462
- "Phrae",
463
- "Phuket",
464
- "Prachinburi",
465
- "Prachuap Khiri Khan",
466
- "Ranong",
467
- "Ratchaburi",
468
- "Rayong",
469
- "Roi Et",
470
- "Sa Kaeo",
471
- "Sakon Nakhon",
472
- "Samut Prakan",
473
- "Samut Sakhon",
474
- "Samut Songkhram",
475
- "Saraburi",
476
- "Satun",
477
- "Sing Buri",
478
- "Sisaket",
479
- "Songkhla",
480
- "Sukhothai",
481
- "Suphan Buri",
482
- "Surat Thani",
483
- "Surin",
484
- "Tak",
485
- "Trang",
486
- "Trat",
487
- "Ubon Ratchathani",
488
- "Udon Thani",
489
- "Uthai Thani",
490
- "Uttaradit",
491
- "Yala",
492
- "Yasothon"
493
- ],
494
- get stateItems() {
495
- return se(this);
496
- }
497
- }
498
- }, be = () => A.Config.getCountry(), ve = {
499
- get fullCurrency() {
500
- return be().currency;
501
- },
502
- get currency() {
503
- return be().currency.code;
504
- },
505
- get fullTax() {
506
- return A.Country.getCountryFlattenTaxes(be().code);
507
- },
508
- get taxSystem() {
509
- return be().taxSystems;
510
- },
511
- taxInclusion(C) {
512
- return ve.taxSystem.map((_) => ({
513
- systemCode: _.code,
514
- inclusive: C !== void 0 ? C : !1
515
- }));
516
- },
517
- groupedTaxOptions() {
518
- const C = A.Country.getCountryFlattenTaxes(be().code);
519
- return ve.taxSystem.map((_) => ({
520
- code: _.code,
521
- options: C.map((o) => ({ ...o, feedmeTaxCode: ve.generateCode(o) })).filter((o) => o.systemCode === _.code)
522
- }));
523
- },
524
- systemDefaultCode(C) {
525
- const _ = ve.groupedTaxOptions().find((o) => o.code === C);
526
- return _ == null ? void 0 : _.options.find((o) => o.default);
527
- },
528
- generateCode(C) {
529
- return `${C.systemCode}/${C.taxCode}`;
530
- }
531
- }, W = ve, Ot = /* @__PURE__ */ te({
532
- __name: "TaxInclusiveSetting",
533
- props: {
534
- modelValue: {
535
- type: Array,
536
- required: !0,
537
- default: () => []
538
- }
539
- },
540
- emits: ["update:model-value"],
541
- setup(C, { emit: _ }) {
542
- const o = C, b = W.taxSystem, s = _, v = N(o.modelValue);
543
- function a(c, y) {
544
- const u = ae.clone(o.modelValue), k = u.findIndex((l) => l.systemCode === c);
545
- k >= 0 ? u[k].inclusive = y : u.push({
546
- systemCode: c,
547
- inclusive: y
548
- }), v.value = u, s("update:model-value", u);
549
- }
550
- function m() {
551
- return b.map((c) => {
552
- const y = o.modelValue ? o.modelValue.find((u) => u.systemCode === c.code) : !1;
553
- return {
554
- label: c.name,
555
- config: {
556
- value: y ? y.inclusive : !1
557
- },
558
- input: (u) => {
559
- a(c.code, u);
560
- }
561
- };
562
- });
563
- }
564
- const i = ze(m());
565
- function t(c, y) {
566
- return `${c} ${y ? "Inclusive" : "Exclusive"}`;
567
- }
568
- return he(() => {
569
- o.modelValue.length || a(b[0].code, !1);
570
- }), Pe(
571
- () => o.modelValue,
572
- (c, y) => {
573
- c != y && !c.length && a(b[0].code, !1);
574
- }
575
- ), (c, y) => {
576
- const u = S("FmSwitch");
577
- return x(!0), D(Y, null, ce(e(i), (k, l) => {
578
- var w;
579
- return x(), D("div", { key: l }, [
580
- r(u, {
581
- "model-value": ((w = e(v)[l]) == null ? void 0 : w.inclusive) || !1,
582
- "label-placement": "left",
583
- "onUpdate:modelValue": (U) => k.input(U)
584
- }, {
585
- label: B(() => {
586
- var U;
587
- return [
588
- F("div", null, K(t(k.label, ((U = e(v)[l]) == null ? void 0 : U.inclusive) || !1)), 1)
589
- ];
590
- }),
591
- _: 2
592
- }, 1032, ["model-value", "onUpdate:modelValue"])
593
- ]);
594
- }), 128);
595
- };
596
- }
597
- });
598
- var Mt = { mode: "production", appMode: "mf" };
599
- const At = { class: "space-y-8" }, Et = {
600
- key: 0,
601
- class: "space-y-16"
602
- }, jt = /* @__PURE__ */ te({
603
- __name: "StripeSetting",
604
- props: {
605
- modelValue: {}
606
- },
607
- emits: ["update:modelValue"],
608
- setup(C, { emit: _ }) {
609
- const o = C, b = _, s = N(!1);
610
- Pe(s, (a, m) => {
611
- m != a && (!o.modelValue && a ? b("update:modelValue", {
612
- apiKey: "",
613
- webhookSecret: ""
614
- }) : a || b("update:modelValue", void 0));
615
- });
616
- const v = L(() => {
617
- const a = Mt.mode === "development", m = A.Config.getCountry().code.toLowerCase(), i = m != "my" ? `.${m}` : "";
618
- return `https://marketing${a ? "-dev" : ""}${i}.feedmeapi.com/stripe/${Qe.getBusinessId()}/webhook`;
619
- });
620
- return he(() => {
621
- s.value = !!o.modelValue;
622
- }), (a, m) => {
623
- const i = S("FmSwitch"), t = S("FmTextField"), c = S("FmButton");
624
- return x(), D("div", At, [
625
- r(i, {
626
- modelValue: e(s),
627
- "onUpdate:modelValue": m[0] || (m[0] = (y) => re(s) ? s.value = y : null),
628
- value: "true",
629
- label: "Enable Stripe"
630
- }, null, 8, ["modelValue"]),
631
- o.modelValue ? (x(), D("div", Et, [
632
- r(t, {
633
- label: "API Key",
634
- modelValue: o.modelValue.apiKey,
635
- "onUpdate:modelValue": m[1] || (m[1] = (y) => o.modelValue.apiKey = y),
636
- "helper-text": "Go to Stripe Dashboard get your API Key and paste here."
637
- }, null, 8, ["modelValue"]),
638
- r(t, {
639
- label: "Webhook URL",
640
- "model-value": e(v),
641
- readonly: "",
642
- "helper-text": "Copy this URL to your Stripe dashboard"
643
- }, {
644
- append: B(() => [
645
- r(c, {
646
- icon: "content_copy",
647
- variant: "tertiary",
648
- onClick: m[2] || (m[2] = (y) => e(st)(e(v)))
649
- })
650
- ]),
651
- _: 1
652
- }, 8, ["model-value"]),
653
- r(t, {
654
- modelValue: o.modelValue.webhookSecret,
655
- "onUpdate:modelValue": m[3] || (m[3] = (y) => o.modelValue.webhookSecret = y),
656
- label: "Webhook Secret",
657
- "helper-text": `Copy the webhook signing secret from your Stripe account and paste
658
- here.`
659
- }, null, 8, ["modelValue"])
660
- ])) : E("", !0)
661
- ]);
662
- };
663
- }
664
- }), Lt = {
665
- key: 0,
666
- class: "space-y-16 pr-12"
667
- }, Kt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Ht = {
668
- key: 1,
669
- class: "space-y-16"
670
- }, qt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Wt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Yt = { class: "grid grid-cols-2 gap-x-16 gap-y-16" }, zt = { class: "space-y-4" }, Jt = { class: "fm-typo-en-body-lg-400" }, Gt = { class: "space-y-16" }, Xt = { class: "fm-typo-en-title-sm-800 !mb-[-12px]" }, Zt = { class: "flex items-center gap-8" }, Qt = /* @__PURE__ */ te({
671
- __name: "StoreSettingSheet",
672
- emits: ["update"],
673
- setup(C, { expose: _, emit: o }) {
674
- const { t: b } = xe(), s = o, v = N(!1), a = N(), m = N(!1), i = et.extend({
675
- company: tt.extend({
676
- name: ee.string().min(1, "Company name is required"),
677
- regNo: ee.string().min(1, "Registration number is required"),
678
- address: nt.extend({
679
- line1: ee.string().min(1, "Line 1 is required"),
680
- line2: ee.string().optional(),
681
- state: ee.string().min(1, "State is required"),
682
- city: ee.string().min(1, "City is required"),
683
- postcode: ee.string().min(1, "Postcode is required"),
684
- country: ee.string().min(1, "Country is required")
685
- }),
686
- phoneNo: ee.string().min(1, "Phone number is required"),
687
- sstRegNo: ee.string().optional()
688
- })
689
- }), t = L(() => i.safeParse(a.value).success);
690
- function c() {
691
- const k = i.safeParse(a.value);
692
- k.success && s("update", k.data);
693
- }
694
- function y() {
695
- return {
696
- company: {
697
- name: "",
698
- address: {
699
- line1: "",
700
- line2: "",
701
- city: "",
702
- postcode: "",
703
- state: "",
704
- country: A.Config.getCountry().name
705
- },
706
- phoneNo: "",
707
- regNo: "",
708
- sstRegNo: ""
709
- },
710
- inclusiveTaxes: []
711
- };
712
- }
713
- function u(k, l) {
714
- v.value = k, k && (a.value = l != null && l.company ? ae.cloneDeep(l) : y());
715
- }
716
- return _({
717
- showSheet: u,
718
- data: a
719
- }), (k, l) => {
720
- const w = S("FmIcon"), U = S("FmMenuItem"), j = S("FmMenu"), ne = S("FmSelect"), Z = S("FmButton"), H = S("FmSideSheet");
721
- return x(), O(H, {
722
- "max-width": 560,
723
- modelValue: e(v),
724
- "onUpdate:modelValue": l[15] || (l[15] = (z) => re(v) ? v.value = z : null),
725
- header: e(b)("connect.store.setting.title")
726
- }, {
727
- "side-sheet-footer": B(() => [
728
- F("div", Zt, [
729
- r(Z, {
730
- label: e(b)("connect.common.save"),
731
- onClick: c,
732
- disabled: !e(t) || e(Se)().isLoading,
733
- loading: e(Se)().isLoading
734
- }, null, 8, ["label", "disabled", "loading"]),
735
- r(Z, {
736
- label: e(b)("connect.common.cancel"),
737
- onClick: l[14] || (l[14] = (z) => u(!1)),
738
- variant: "tertiary"
739
- }, null, 8, ["label"])
740
- ])
741
- ]),
742
- default: B(() => {
743
- var z, oe;
744
- return [
745
- r(Te, { json: e(a) }, null, 8, ["json"]),
746
- e(a) && e(a).company ? (x(), D("div", Lt, [
747
- F("div", Kt, K(e(b)("connect.store.setting.company.legal_info")), 1),
748
- r(le, {
749
- modelValue: e(a).company.name,
750
- "onUpdate:modelValue": l[0] || (l[0] = (V) => e(a).company.name = V),
751
- label: e(b)("connect.store.setting.company.name"),
752
- schema: e(Q).typeAtPath(e(i), "company.name")
753
- }, null, 8, ["modelValue", "label", "schema"]),
754
- r(le, {
755
- modelValue: e(a).company.regNo,
756
- "onUpdate:modelValue": l[1] || (l[1] = (V) => e(a).company.regNo = V),
757
- label: e(b)("connect.store.setting.company.reg_no"),
758
- schema: e(Q).typeAtPath(e(i), "company.regNo")
759
- }, null, 8, ["modelValue", "label", "schema"]),
760
- e(A.Config).getCountry().taxSystems.length ? (x(), O(le, {
761
- key: 0,
762
- modelValue: e(a).company.sstRegNo,
763
- "onUpdate:modelValue": [
764
- l[2] || (l[2] = (V) => e(a).company.sstRegNo = V),
765
- l[3] || (l[3] = (V) => V ? null : e(a).inclusiveTaxes = [])
766
- ],
767
- label: e(b)("connect.store.setting.company.tax_reg_no"),
768
- schema: e(Q).typeAtPath(e(i), "company.sstRegNo")
769
- }, null, 8, ["modelValue", "label", "schema"])) : E("", !0),
770
- (z = e(a).company) != null && z.sstRegNo && e(a).inclusiveTaxes ? (x(), D("div", Ht, [
771
- F("div", qt, K(e(b)("connect.store.setting.company.tax")), 1),
772
- r(Ot, {
773
- modelValue: e(a).inclusiveTaxes,
774
- "onUpdate:modelValue": l[4] || (l[4] = (V) => e(a).inclusiveTaxes = V)
775
- }, null, 8, ["modelValue"])
776
- ])) : E("", !0),
777
- r(le, {
778
- modelValue: e(a).company.phoneNo,
779
- "onUpdate:modelValue": l[5] || (l[5] = (V) => e(a).company.phoneNo = V),
780
- label: e(b)("connect.store.setting.company.phone"),
781
- schema: e(Q).typeAtPath(e(i), "company.phoneNo")
782
- }, null, 8, ["modelValue", "label", "schema"]),
783
- F("div", Wt, K(e(b)("connect.store.setting.company.address.title")), 1),
784
- r(le, {
785
- modelValue: e(a).company.address.line1,
786
- "onUpdate:modelValue": l[6] || (l[6] = (V) => e(a).company.address.line1 = V),
787
- label: e(b)("connect.store.setting.company.address.line1"),
788
- schema: e(Q).typeAtPath(e(i), "company.address.line1")
789
- }, null, 8, ["modelValue", "label", "schema"]),
790
- r(le, {
791
- modelValue: e(a).company.address.line2,
792
- "onUpdate:modelValue": l[7] || (l[7] = (V) => e(a).company.address.line2 = V),
793
- label: e(b)("connect.store.setting.company.address.line2"),
794
- schema: e(Q).typeAtPath(e(i), "company.address.line2")
795
- }, null, 8, ["modelValue", "label", "schema"]),
796
- F("div", Yt, [
797
- r(le, {
798
- modelValue: e(a).company.address.city,
799
- "onUpdate:modelValue": l[8] || (l[8] = (V) => e(a).company.address.city = V),
800
- label: e(b)("connect.store.setting.company.address.city"),
801
- schema: e(Q).typeAtPath(e(i), "company.address.city")
802
- }, null, 8, ["modelValue", "label", "schema"]),
803
- r(le, {
804
- modelValue: e(a).company.address.postcode,
805
- "onUpdate:modelValue": l[9] || (l[9] = (V) => e(a).company.address.postcode = V),
806
- label: e(b)("connect.store.setting.company.address.postcode"),
807
- schema: e(Q).typeAtPath(e(i), "company.address.postcode")
808
- }, null, 8, ["modelValue", "label", "schema"]),
809
- F("div", zt, [
810
- F("div", Jt, K(e(b)("connect.store.setting.company.address.state")), 1),
811
- r(j, {
812
- placement: "top-end",
813
- "model-value": e(m)
814
- }, {
815
- "menu-button": B(() => [
816
- r(le, {
817
- modelValue: e(a).company.address.state,
818
- "onUpdate:modelValue": l[10] || (l[10] = (V) => e(a).company.address.state = V),
819
- schema: e(Q).typeAtPath(e(i), "company.address.state"),
820
- onFocusChanged: l[11] || (l[11] = (V) => m.value = V)
821
- }, {
822
- append: B(() => [
823
- r(w, {
824
- name: e(m) ? "keyboard_arrow_up" : "keyboard_arrow_down"
825
- }, null, 8, ["name"])
826
- ]),
827
- _: 1
828
- }, 8, ["modelValue", "schema"])
829
- ]),
830
- default: B(() => [
831
- (x(!0), D(Y, null, ce(e(Dt)[e(A.Config).getCountry().code].stateItems.filter(
832
- (V) => {
833
- var ie, g;
834
- return V.label.toLowerCase().includes(((g = (ie = e(a)) == null ? void 0 : ie.company) == null ? void 0 : g.address.state.toLowerCase()) ?? "");
835
- }
836
- ) || [], (V) => (x(), O(U, {
837
- key: V.value,
838
- "model-value": e(a).company.address.state === V.value,
839
- label: V.label,
840
- onClick: () => {
841
- e(a).company.address.state = V.value, m.value = !1;
842
- }
843
- }, null, 8, ["model-value", "label", "onClick"]))), 128))
844
- ]),
845
- _: 1
846
- }, 8, ["model-value"])
847
- ]),
848
- r(ne, {
849
- label: e(b)("connect.store.setting.company.address.country"),
850
- modelValue: e(a).company.address.country,
851
- "onUpdate:modelValue": l[12] || (l[12] = (V) => e(a).company.address.country = V),
852
- items: [
853
- {
854
- label: e(A.Config).getCountry().name,
855
- value: e(A.Config).getCountry().name
856
- }
857
- ],
858
- rules: [e(Q).ruleAtPath(e(i), "company.address.country")]
859
- }, null, 8, ["label", "modelValue", "items", "rules"])
860
- ]),
861
- F("div", Gt, [
862
- F("div", Xt, K(e(b)("connect.store.setting.stripe.title")), 1),
863
- r(jt, {
864
- "model-value": (oe = e(a)) == null ? void 0 : oe.stripe,
865
- "onUpdate:modelValue": l[13] || (l[13] = (V) => e(a).stripe = V)
866
- }, null, 8, ["model-value"])
867
- ])
868
- ])) : E("", !0)
869
- ];
870
- }),
871
- _: 1
872
- }, 8, ["modelValue", "header"]);
873
- };
874
- }
875
- });
876
- function en(C, _ = !0) {
877
- return A.DineroFactory(C).toFormat(_);
878
- }
879
- const tn = /* @__PURE__ */ te({
880
- __name: "TaxVariantSetting",
881
- props: {
882
- modelValue: {
883
- type: Array,
884
- required: !0,
885
- default: () => []
886
- }
887
- },
888
- emits: ["update:modelValue"],
889
- setup(C, { emit: _ }) {
890
- const o = C, b = _;
891
- he(() => {
892
- if (a.value.length !== v.value.length) {
893
- const t = v.value.reduce((c, y) => {
894
- const u = W.systemDefaultCode(y.name);
895
- if (!u) return c;
896
- const { systemCode: k, taxCode: l } = u;
897
- return y.value || c.push({ systemCode: k, taxCode: l }), c;
898
- }, []);
899
- i(t);
900
- }
901
- });
902
- function s() {
903
- return W.groupedTaxOptions();
904
- }
905
- const v = L(() => s().map((t) => ({
906
- name: t.code,
907
- value: (a.value || []).find(
908
- (c) => t.options.some((y) => y.feedmeTaxCode === c)
909
- ),
910
- options: t.options.map((c) => ({
911
- label: `${c.name} (${pt(c.rate)}%)`,
912
- value: c.feedmeTaxCode
913
- }))
914
- }))), a = L(() => o.modelValue.map((t) => W.generateCode(t)));
915
- function m(t) {
916
- const c = s().find(
917
- (l) => l.options.some((w) => w.feedmeTaxCode === t)
918
- ), y = c == null ? void 0 : c.options.find((l) => l.feedmeTaxCode === t);
919
- if (!y) return;
920
- const { systemCode: u, taxCode: k } = y;
921
- i([{ systemCode: u, taxCode: k }]);
922
- }
923
- function i(t) {
924
- const c = ae.clone(o.modelValue);
925
- t.forEach((y) => {
926
- const u = s().find(
927
- (w) => w.options.some((U) => U.feedmeTaxCode === W.generateCode(y))
928
- ), k = (u == null ? void 0 : u.options) || [], l = c.findIndex(
929
- (w) => k.some((U) => W.generateCode(U) === W.generateCode(w))
930
- );
931
- l >= 0 ? c.splice(l, 1, y) : c.push(y);
932
- }), b("update:modelValue", c);
933
- }
934
- return (t, c) => {
935
- const y = S("FmRadio"), u = S("FmRadioGroup");
936
- return x(!0), D(Y, null, ce(e(v), (k) => (x(), D("div", {
937
- key: k.name,
938
- class: "flex items-start"
939
- }, [
940
- r(u, {
941
- modelValue: k.value,
942
- "onUpdate:modelValue": [
943
- (l) => k.value = l,
944
- c[0] || (c[0] = (l) => {
945
- m(l);
946
- })
947
- ]
948
- }, {
949
- default: B(() => [
950
- (x(!0), D(Y, null, ce(k.options, (l, w) => (x(), O(y, {
951
- key: w,
952
- value: l.value,
953
- label: l.label
954
- }, null, 8, ["value", "label"]))), 128))
955
- ]),
956
- _: 2
957
- }, 1032, ["modelValue", "onUpdate:modelValue"])
958
- ]))), 128);
959
- };
960
- }
961
- }), we = {
962
- get _id() {
963
- return (/* @__PURE__ */ new Date()).toISOString();
964
- },
965
- name: "",
966
- price: A.Dinero.zero().toObject(),
967
- originalPrice: A.Dinero.zero().toObject(),
968
- vouchers: [],
969
- credit: {
970
- normal: 0,
971
- free: {
972
- amount: 0,
973
- day: 0
974
- }
975
- },
976
- config: {
977
- options: {}
978
- },
979
- titles: [],
980
- taxes: [],
981
- taxTotals: [],
982
- internal: !1,
983
- priceWithTaxes: ct()
984
- }, nn = {
985
- key: 0,
986
- class: "space-y-24 pr-12"
987
- }, on = { class: "space-y-8" }, an = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, ln = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, sn = { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, rn = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, dn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary !mb-[-16px]" }, un = { class: "space-y-8" }, cn = { class: "flex items-center justify-between" }, mn = { class: "fm-typo-en-title-sm-800 !mb-[-20px]" }, pn = { class: "space-y-8" }, fn = { class: "flex items-center gap-8" }, yn = /* @__PURE__ */ te({
988
- __name: "EditBundleSheet",
989
- emits: ["update"],
990
- setup(C, { expose: _, emit: o }) {
991
- const b = o, { t: s } = xe(), v = ke(), a = N(!1), m = N([]), i = N({
992
- category: 0,
993
- index: -1,
994
- originalCategoryIndex: void 0
995
- }), t = N(ae.cloneDeep(we)), c = N(), y = Ae, u = L(() => {
996
- const d = y.safeParse(t.value);
997
- return d.success ? [] : d.error.errors;
998
- }), k = [
999
- {
1000
- header: "Reward title",
1001
- accessorFn: (d) => d.collectible.name,
1002
- enableSorting: !0
1003
- },
1004
- {
1005
- id: "type",
1006
- header: "Reward type",
1007
- accessorFn: (d) => d.collectible.type,
1008
- cell(d) {
1009
- return ye[d.row.original.collectible.type].chip();
1010
- }
1011
- },
1012
- {
1013
- header: "Description",
1014
- accessorFn: (d) => d.description,
1015
- cell(d) {
1016
- var p;
1017
- const n = d.row.original;
1018
- return n.collectible.type == "VOUCHER" || n.selectedReward == null ? n.description : Ge(Ze.FmStepperField, {
1019
- "onUpdate:modelValue": (f) => {
1020
- t.value.titles = t.value.titles.map(
1021
- (I) => I.id == n.collectible._id ? { ...I, dayToExpire: f } : I
1022
- );
1023
- },
1024
- modelValue: ((p = n.selectedReward) == null ? void 0 : p.extra) ?? 0,
1025
- appendText: "day(s)",
1026
- helperState: G(u.value, "titles"),
1027
- helperText: X(u.value, "titles"),
1028
- max: 9999,
1029
- rules: [(f) => f <= 9999 || "Maximum 9999 days allowed"],
1030
- showSteppers: !1,
1031
- disabled: !!t.value.stripePriceId
1032
- });
1033
- }
1034
- }
1035
- ], l = N([]), w = L(() => {
1036
- var n;
1037
- const d = (n = t.value) != null && n.isFeedvibe ? "STORE_BUNDLE:FEEDVIBE" : "STORE_BUNDLE:DEFAULT";
1038
- return v.bundleRewards.filter((p) => {
1039
- var f;
1040
- return (f = t.value) != null && f.isFeedvibe && p.type !== "VOUCHER" ? !1 : ft(p.capabilities, d);
1041
- }).map((p) => {
1042
- const f = U.value.find((M) => M.id == p._id), I = p.type === "VOUCHER" ? `${p.options.maxUse} use(s), ${yt(
1043
- p.options.validityOption || {}
1044
- )}` : "No expiry";
1045
- return {
1046
- collectible: p,
1047
- description: I,
1048
- selectedReward: f
1049
- };
1050
- });
1051
- }), U = L(() => {
1052
- var d, n;
1053
- return [
1054
- ...((d = t.value) == null ? void 0 : d.titles.map((p) => ({
1055
- id: p.id,
1056
- extra: p.dayToExpire
1057
- }))) ?? [],
1058
- ...((n = t.value) == null ? void 0 : n.vouchers.map((p) => ({
1059
- id: p,
1060
- extra: void 0
1061
- }))) ?? []
1062
- ];
1063
- }), j = L(
1064
- () => t.value.stripePriceId && t.value.subscriptionValidity ? t.value.subscriptionValidity : 0
1065
- );
1066
- function ne(d) {
1067
- t.value.subscriptionValidity = d;
1068
- for (const n of t.value.titles)
1069
- n.dayToExpire = d;
1070
- t.value.credit.free && (t.value.credit.free.day = d);
1071
- }
1072
- function Z() {
1073
- const d = w.value, n = t.value;
1074
- if (!(!n || !d))
1075
- for (let p = 0; p < d.length; p++) {
1076
- const f = d[p];
1077
- H.value[p] ? f.collectible.type == "TITLE" ? n.titles.findIndex(
1078
- (R) => R.id == f.collectible._id
1079
- ) < 0 && n.titles.push({
1080
- id: f.collectible._id,
1081
- dayToExpire: j.value
1082
- }) : n.vouchers.findIndex(
1083
- (R) => R == f.collectible._id
1084
- ) < 0 && n.vouchers.push(f.collectible._id) : (n.titles = n.titles.filter((M) => M.id != f.collectible._id), n.vouchers = n.vouchers.filter(
1085
- (M) => M != f.collectible._id
1086
- ));
1087
- }
1088
- }
1089
- const H = N({});
1090
- Pe(H, Z, { deep: !0 });
1091
- const z = L(() => {
1092
- var d, n;
1093
- return (n = (d = v.storeOption) == null ? void 0 : d.company) == null ? void 0 : n.sstRegNo;
1094
- }), oe = L(() => {
1095
- var d, n, p;
1096
- return (p = (n = (d = v.storeOption) == null ? void 0 : d.inclusiveTaxes) == null ? void 0 : n[0]) != null && p.inclusive ? "Inclusive" : "Exclusive";
1097
- }), V = L(() => {
1098
- var d, n, p;
1099
- return qe(
1100
- W.fullTax,
1101
- Je(t.value.taxes),
1102
- t.value.price,
1103
- Number(t.value.credit.normal),
1104
- ((d = v.storeOption) == null ? void 0 : d.inclusiveTaxes) ?? [],
1105
- (p = (n = v.storeOption) == null ? void 0 : n.company) != null && p.sstRegNo ? W.taxSystem.map((f) => f.code) : []
1106
- );
1107
- }), ie = L(() => V.value.reduce(
1108
- (n, p) => n.add(p.total),
1109
- mt()
1110
- ).toFormat()), g = L(() => {
1111
- var f;
1112
- const d = We(
1113
- V.value,
1114
- t.value.price,
1115
- ((f = v.storeOption) == null ? void 0 : f.inclusiveTaxes) ?? []
1116
- );
1117
- t.value.priceWithTaxes = d;
1118
- const n = en(d, !1), p = Number(n.replace(/[^\d.-]/g, ""));
1119
- return Number.isNaN(p) ? 0 : p;
1120
- });
1121
- function T() {
1122
- t.value.taxTotals = V.value, b("update", Ae.parse(at(t.value)));
1123
- }
1124
- function h() {
1125
- return ae.cloneDeep(we);
1126
- }
1127
- function $(d, n) {
1128
- a.value = d, d && n && (c.value = void 0, m.value = n.categories, t.value = n.bundle || h(), i.value.category = n.category, i.value.index = n.index, i.value.originalCategoryIndex = n.category, H.value = w.value.reduce((p, f, I) => (p[I] = !!f.selectedReward, p), {}));
1129
- }
1130
- return _({
1131
- showSheet: $,
1132
- bundleImage: c,
1133
- target: i,
1134
- data: t
1135
- }), (d, n) => {
1136
- const p = S("FmSwitch"), f = S("FmHelperText"), I = S("FmTextField"), M = S("FmSelect"), R = S("FmStepperField"), q = S("FmMenuItem"), J = S("FmTable"), fe = S("FmButton"), Ce = S("FmSideSheet");
1137
- return x(), O(Ce, {
1138
- "max-width": 768,
1139
- modelValue: e(a),
1140
- "onUpdate:modelValue": n[21] || (n[21] = (de) => re(a) ? a.value = de : null),
1141
- header: e(i).index != -1 ? e(s)("connect.store.bundle.edit.title") : e(s)("connect.store.bundle.edit.create")
1142
- }, {
1143
- "side-sheet-footer": B(() => [
1144
- F("div", fn, [
1145
- r(fe, {
1146
- label: e(i).index != -1 ? "Save" : "Add",
1147
- onClick: T,
1148
- disabled: e(u).length > 0,
1149
- loading: e(Se)().isLoading
1150
- }, null, 8, ["label", "disabled", "loading"]),
1151
- r(fe, {
1152
- label: "Cancel",
1153
- onClick: n[20] || (n[20] = (de) => $(!1)),
1154
- variant: "tertiary"
1155
- })
1156
- ])
1157
- ]),
1158
- default: B(() => {
1159
- var de, $e, Ue, Re, Ie, Be, Ne, De, Oe, Me;
1160
- return [
1161
- r(Te, { json: e(t) }, null, 8, ["json"]),
1162
- e(t) ? (x(), D("div", nn, [
1163
- F("div", on, [
1164
- e(A.Config).getCountry().code == "MY" && ((de = e(v).payoutAccount) == null ? void 0 : de.status) == "APPROVED" && (($e = e(v).payoutAccount) != null && $e.enable) ? (x(), O(p, {
1165
- key: 0,
1166
- "onUpdate:modelValue": n[0] || (n[0] = (P) => {
1167
- e(t).isFeedvibe = P, e(t).isFeedvibe && (e(t).credit.normal = 0, e(t).coinPrice = 0, e(t).titles = [], H.value = {}, e(t).hideInPos = !0, e(t).internal = !0);
1168
- }),
1169
- "label-placement": "right",
1170
- "model-value": e(t).isFeedvibe || !1,
1171
- label: "Feedvibe Campaign",
1172
- sublabel: "Bundle will be appear for Feedvibe campaign use"
1173
- }, null, 8, ["model-value"])) : E("", !0),
1174
- e(t).isFeedvibe ? (x(), O(f, {
1175
- key: 1,
1176
- 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.",
1177
- state: "warning"
1178
- })) : E("", !0)
1179
- ]),
1180
- F("div", an, K(e(s)("connect.store.bundle.edit.basicInformation")), 1),
1181
- r(I, {
1182
- label: e(s)("connect.store.bundle.edit.bundleName"),
1183
- modelValue: e(t).name,
1184
- "onUpdate:modelValue": n[1] || (n[1] = (P) => e(t).name = P),
1185
- "helper-state": e(G)(e(u), "name"),
1186
- "helper-text": e(X)(e(u), "name")
1187
- }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1188
- r(M, {
1189
- modelValue: e(i).category,
1190
- "onUpdate:modelValue": n[2] || (n[2] = (P) => e(i).category = P),
1191
- label: "Store Category",
1192
- items: e(m).map((P, Ye) => ({ label: P, value: Ye }))
1193
- }, null, 8, ["modelValue", "items"]),
1194
- r(dt, {
1195
- label: e(s)("connect.store.bundle.edit.bundleImage"),
1196
- class: "w-1/2 xs:w-2/3",
1197
- "aspect-ratio": "16/9",
1198
- thumbnail: e(t).image ?? void 0,
1199
- file: e(c) ?? void 0,
1200
- "onUpdate:file": n[3] || (n[3] = (P) => {
1201
- c.value = P;
1202
- }),
1203
- "helper-state": e(G)(e(u), "image"),
1204
- "helper-text": e(X)(e(u), "image")
1205
- }, null, 8, ["label", "thumbnail", "file", "helper-state", "helper-text"]),
1206
- r(R, {
1207
- "model-value": e(A.Dinero).fromFdoDinero(e(t).price).toUnit(),
1208
- label: e(s)("connect.store.bundle.edit.bundlePrice"),
1209
- min: 0,
1210
- "max-fraction-digits": 2,
1211
- "onUpdate:modelValue": n[4] || (n[4] = (P) => {
1212
- e(t).price.amount = P * 10 ** e(t).price.precision;
1213
- }),
1214
- "is-currency": !0,
1215
- "show-steppers": !1,
1216
- "helper-text": e(X)(e(u), "price") || `${e(A.Dinero).fromNumber({ number: 1 }).toFormat(
1217
- !0
1218
- )} = ${e(A.Dinero).fromNumber({ number: 1 }).toUnit()} credit`,
1219
- "helper-state": e(G)(e(u), "price")
1220
- }, {
1221
- prepend: B(() => [
1222
- me(K(e(A.Dinero).defaultCurrency()), 1)
1223
- ]),
1224
- _: 1
1225
- }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1226
- r(R, {
1227
- "model-value": e(A.Dinero).fromFdoDinero(e(t).originalPrice).toUnit(),
1228
- label: e(s)("connect.store.bundle.edit.bundleValue"),
1229
- min: 0,
1230
- "max-fraction-digits": 2,
1231
- "onUpdate:modelValue": n[5] || (n[5] = (P) => {
1232
- e(t).originalPrice || (e(t).originalPrice = e(A.Dinero).zero().toObject()), e(t).originalPrice.amount = P * 10 ** e(t).originalPrice.precision;
1233
- }),
1234
- "is-currency": !0,
1235
- "show-steppers": !1,
1236
- "helper-text": e(X)(e(u), "originalPrice") || e(s)("connect.store.bundle.edit.originalPriceHelper"),
1237
- "helper-state": e(G)(e(u), "originalPrice")
1238
- }, {
1239
- prepend: B(() => [
1240
- me(K(e(A.Dinero).defaultCurrency()), 1)
1241
- ]),
1242
- _: 1
1243
- }, 8, ["model-value", "label", "helper-text", "helper-state"]),
1244
- e(t).isFeedvibe ? E("", !0) : (x(), O(R, {
1245
- key: 0,
1246
- "model-value": e(t).coinPrice ?? null,
1247
- label: e(s)("connect.store.bundle.edit.pointNeeded"),
1248
- min: 0,
1249
- "onUpdate:modelValue": n[6] || (n[6] = (P) => {
1250
- P > 0 && e(t).credit.normal > 0 && (e(t).credit.normal = 0), e(t).coinPrice = P;
1251
- }),
1252
- "show-steppers": !1,
1253
- "helper-state": e(G)(e(u), "coinPrice"),
1254
- "helper-text": e(X)(e(u), "coinPrice")
1255
- }, {
1256
- append: B(() => [...n[22] || (n[22] = [
1257
- me(" point(s) ", -1)
1258
- ])]),
1259
- _: 1
1260
- }, 8, ["model-value", "label", "helper-state", "helper-text"])),
1261
- (Ue = e(v).storeOption) != null && Ue.stripe && !e(t).isFeedvibe ? (x(), D(Y, { key: 1 }, [
1262
- F("div", ln, K(e(s)("connect.store.bundle.edit.subscriptionSettings")), 1),
1263
- r(I, {
1264
- label: e(s)("connect.store.bundle.edit.stripePriceId"),
1265
- modelValue: e(t).stripePriceId,
1266
- "onUpdate:modelValue": n[7] || (n[7] = (P) => e(t).stripePriceId = P),
1267
- "helper-state": e(G)(e(u), "stripePriceId"),
1268
- "helper-text": e(X)(e(u), "stripePriceId")
1269
- }, null, 8, ["label", "modelValue", "helper-state", "helper-text"]),
1270
- e(t).stripePriceId ? (x(), O(R, {
1271
- key: 0,
1272
- "model-value": e(t).subscriptionValidity ?? null,
1273
- min: 1,
1274
- "onUpdate:modelValue": ne,
1275
- label: e(s)("connect.store.bundle.edit.subscriptionValidity"),
1276
- "show-steppers": !1,
1277
- "helper-state": e(G)(e(u), "subscriptionValidity"),
1278
- "helper-text": e(X)(e(u), "subscriptionValidity")
1279
- }, null, 8, ["model-value", "label", "helper-state", "helper-text"])) : E("", !0)
1280
- ], 64)) : E("", !0),
1281
- e(t).isFeedvibe ? E("", !0) : (x(), D(Y, { key: 2 }, [
1282
- F("div", sn, K(e(s)("connect.store.bundle.edit.credit")), 1),
1283
- r(R, {
1284
- modelValue: e(t).credit.normal,
1285
- "onUpdate:modelValue": n[8] || (n[8] = (P) => e(t).credit.normal = P),
1286
- label: e(s)("connect.store.bundle.edit.normalCredit"),
1287
- "show-steppers": !1,
1288
- "helper-state": e(G)(e(u), "credit.normal"),
1289
- "helper-text": e(X)(e(u), "credit.normal")
1290
- }, {
1291
- append: B(() => [...n[23] || (n[23] = [
1292
- me(" credit ", -1)
1293
- ])]),
1294
- _: 1
1295
- }, 8, ["modelValue", "label", "helper-state", "helper-text"]),
1296
- r(R, {
1297
- "model-value": ((Re = e(t).credit.free) == null ? void 0 : Re.amount) ?? null,
1298
- min: 0,
1299
- "onUpdate:modelValue": n[9] || (n[9] = (P) => {
1300
- e(t).credit.free || (e(t).credit.free = {
1301
- amount: 0,
1302
- day: 1
1303
- }), e(t).credit.free.amount = P;
1304
- }),
1305
- label: e(s)("connect.store.bundle.edit.freeCredit"),
1306
- "show-steppers": !1,
1307
- "helper-state": e(G)(e(u), "credit.free.amount"),
1308
- "helper-text": e(X)(e(u), "credit.free.amount")
1309
- }, {
1310
- append: B(() => [...n[24] || (n[24] = [
1311
- me(" credit ", -1)
1312
- ])]),
1313
- _: 1
1314
- }, 8, ["model-value", "label", "helper-state", "helper-text"]),
1315
- (Ie = e(t).credit.free) != null && Ie.amount ? (x(), O(R, {
1316
- key: 0,
1317
- disabled: !!e(t).stripePriceId,
1318
- "model-value": ((Be = e(t).credit.free) == null ? void 0 : Be.day) ?? null,
1319
- min: 0,
1320
- max: 9999,
1321
- "onUpdate:modelValue": n[10] || (n[10] = (P) => {
1322
- e(t).credit.free || (e(t).credit.free = {
1323
- amount: 0,
1324
- day: 1
1325
- }), e(t).credit.free.day = e(j) || P;
1326
- }),
1327
- label: "Free credit valid for",
1328
- "show-steppers": !1,
1329
- "helper-state": e(G)(e(u), "credit.free.day"),
1330
- "helper-text": e(X)(e(u), "credit.free.day")
1331
- }, {
1332
- append: B(() => [...n[25] || (n[25] = [
1333
- me(" day(s) ", -1)
1334
- ])]),
1335
- _: 1
1336
- }, 8, ["disabled", "model-value", "helper-state", "helper-text"])) : E("", !0)
1337
- ], 64)),
1338
- e(z) ? (x(), D(Y, { key: 3 }, [
1339
- n[26] || (n[26] = F("div", { class: "fm-typo-en-title-sm-800 !mb-[-16px]" }, "Taxes", -1)),
1340
- r(tn, {
1341
- modelValue: e(t).taxes,
1342
- "onUpdate:modelValue": n[11] || (n[11] = (P) => e(t).taxes = P)
1343
- }, null, 8, ["modelValue"]),
1344
- r(I, {
1345
- label: `Tax Charged (${e(oe)})`,
1346
- "model-value": e(ie),
1347
- disabled: ""
1348
- }, null, 8, ["label", "model-value"])
1349
- ], 64)) : E("", !0),
1350
- r(R, {
1351
- label: "Total Price",
1352
- "model-value": e(g),
1353
- disabled: !0
1354
- }, null, 8, ["model-value"]),
1355
- F("div", rn, K(e(s)("connect.store.bundle.edit.bundleReward.title")), 1),
1356
- F("div", dn, K(e(s)("connect.store.bundle.edit.bundleReward.description")), 1),
1357
- F("div", un, [
1358
- F("div", cn, [
1359
- r(ut, {
1360
- label: `Reward type: ${e(l).length == 0 ? "All" : e(l)[0].name}`
1361
- }, {
1362
- default: B(() => [
1363
- r(q, {
1364
- onClick: n[12] || (n[12] = (P) => l.value = []),
1365
- label: "All"
1366
- }),
1367
- r(q, {
1368
- onClick: n[13] || (n[13] = (P) => l.value = [
1369
- {
1370
- id: "type",
1371
- value: "VOUCHER",
1372
- name: e(ye).VOUCHER.name
1373
- }
1374
- ]),
1375
- label: e(ye).VOUCHER.name
1376
- }, null, 8, ["label"]),
1377
- r(q, {
1378
- onClick: n[14] || (n[14] = (P) => l.value = [
1379
- {
1380
- id: "type",
1381
- value: "TITLE",
1382
- name: e(ye).TITLE.name
1383
- }
1384
- ]),
1385
- label: e(ye).TITLE.name
1386
- }, null, 8, ["label"])
1387
- ]),
1388
- _: 1
1389
- }, 8, ["label"])
1390
- ]),
1391
- r(J, {
1392
- modelValue: e(H),
1393
- "onUpdate:modelValue": n[15] || (n[15] = (P) => re(H) ? H.value = P : null),
1394
- selection: "multiple",
1395
- "column-filter": e(l),
1396
- "column-defs": k,
1397
- "row-data": e(w),
1398
- "hide-footer": e(w).length <= 10
1399
- }, null, 8, ["modelValue", "column-filter", "row-data", "hide-footer"]),
1400
- r(f, {
1401
- text: e(X)(e(u), "titles"),
1402
- state: e(G)(e(u), "titles")
1403
- }, null, 8, ["text", "state"])
1404
- ]),
1405
- F("div", mn, K(e(s)("connect.store.bundle.edit.advanceSetting")), 1),
1406
- F("div", pn, [
1407
- e(t).isFeedvibe ? E("", !0) : (x(), D(Y, { key: 0 }, [
1408
- r(p, {
1409
- "model-value": e(t).internal ?? !1,
1410
- "onUpdate:modelValue": n[16] || (n[16] = (P) => e(t).internal = P),
1411
- "label-placement": "right",
1412
- label: e(s)("connect.store.bundle.edit.internalBundle"),
1413
- sublabel: e(s)("connect.store.bundle.edit.internalBundleDescription")
1414
- }, null, 8, ["model-value", "label", "sublabel"]),
1415
- r(p, {
1416
- "model-value": e(t).hideInPos ?? !1,
1417
- "onUpdate:modelValue": n[17] || (n[17] = (P) => e(t).hideInPos = P),
1418
- "label-placement": "right",
1419
- label: e(s)("connect.store.bundle.edit.hideInPos"),
1420
- sublabel: e(s)("connect.store.bundle.edit.hideInPosDescription")
1421
- }, null, 8, ["model-value", "label", "sublabel"])
1422
- ], 64)),
1423
- r(R, {
1424
- "model-value": ((De = (Ne = e(t).config) == null ? void 0 : Ne.options) == null ? void 0 : De.maxPerUser) || null,
1425
- "onUpdate:modelValue": n[18] || (n[18] = (P) => e(ae).set(e(t), "config.options.maxPerUser", P)),
1426
- label: e(s)("connect.store.bundle.edit.maxPerUser"),
1427
- "show-steppers": !1,
1428
- placeholder: e(s)("connect.store.bundle.edit.unlimited")
1429
- }, null, 8, ["model-value", "label", "placeholder"]),
1430
- r(R, {
1431
- "model-value": ((Me = (Oe = e(t).config) == null ? void 0 : Oe.options) == null ? void 0 : Me.maxReceive) || null,
1432
- "onUpdate:modelValue": n[19] || (n[19] = (P) => e(ae).set(e(t), "config.options.maxReceive", P)),
1433
- label: e(s)("connect.store.bundle.edit.maxReceive"),
1434
- "show-steppers": !1,
1435
- placeholder: e(s)("connect.store.bundle.edit.unlimited")
1436
- }, null, 8, ["model-value", "label", "placeholder"])
1437
- ])
1438
- ])) : E("", !0)
1439
- ];
1440
- }),
1441
- _: 1
1442
- }, 8, ["modelValue", "header"]);
1443
- };
1444
- }
1445
- }), bn = { class: "flex gap-8 items-center flex-wrap" }, gn = { class: "flex items-center gap-8" }, vn = /* @__PURE__ */ te({
1446
- __name: "SendBundleSheet",
1447
- emits: ["success"],
1448
- setup(C, { expose: _, emit: o }) {
1449
- const { minor: b } = Ke, s = N(), v = N(""), a = N(""), m = N([]), i = N(!1), t = N();
1450
- N(!0);
1451
- function c(w) {
1452
- i.value = !0, v.value = null, a.value = "", s.value = w.bundle;
1453
- }
1454
- function y() {
1455
- i.value = !1;
1456
- }
1457
- async function u(w) {
1458
- const U = await bt.read({
1459
- limit: 25,
1460
- skip: 0,
1461
- sortBy: "_id",
1462
- search: w,
1463
- descending: !1
1464
- });
1465
- m.value = U.resources.map((j) => ({
1466
- label: `${j.name} (${j.phoneNumber})`,
1467
- value: j._id
1468
- })), await new Promise((j) => setTimeout(j, 100));
1469
- }
1470
- async function k() {
1471
- if (!s.value || !v.value) return;
1472
- const w = m.value.find(
1473
- (j) => j.value === v.value
1474
- );
1475
- await pe.confirm(
1476
- `Are you sure you want to send bundle ${s.value.name} to ${w == null ? void 0 : w.label}?`,
1477
- "Confirm",
1478
- "Confirm",
1479
- "Cancel"
1480
- ) && await b(
1481
- async () => {
1482
- const j = {
1483
- bundle: s.value._id,
1484
- member: v.value,
1485
- source: ot.enum.ADMIN,
1486
- ref: `ADMIN:${(/* @__PURE__ */ new Date()).toISOString()}:${a.value}`,
1487
- withCoin: !1
1488
- };
1489
- await ge.sendBundle(j), y();
1490
- },
1491
- {
1492
- message: "Sending bundle",
1493
- successMessage: "Bundle sent"
1494
- }
1495
- );
1496
- }
1497
- const l = L(() => {
1498
- var U, j, ne;
1499
- const w = [];
1500
- return ((U = s.value) == null ? void 0 : U.price.amount) > 0 && w.push(
1501
- `${A.Config.getCountry().currency.symbol}${He((j = s.value) == null ? void 0 : j.price)}`
1502
- ), (ne = s.value) != null && ne.coinPrice && w.push(`${s.value.coinPrice} point(s)`), w.join(" or ");
1503
- });
1504
- return _({
1505
- showSheet: c,
1506
- hideSheet: y
1507
- }), he(async () => {
1508
- await u("");
1509
- }), (w, U) => {
1510
- const j = S("FmCardMedia"), ne = S("FmCardHeader"), Z = S("FmChip"), H = S("FmCardSection"), z = S("FmCard"), oe = S("FmSelect"), V = S("FmTextField"), ie = S("FmForm"), g = S("FmButton"), T = S("FmSideSheet");
1511
- return x(), O(T, {
1512
- "max-width": 560,
1513
- "dismiss-away": !0,
1514
- header: "Send bundle to member",
1515
- modelValue: e(i),
1516
- "onUpdate:modelValue": [
1517
- U[4] || (U[4] = (h) => re(i) ? i.value = h : null),
1518
- U[5] || (U[5] = (h) => i.value = h)
1519
- ]
1520
- }, {
1521
- "side-sheet-footer": B(() => [
1522
- F("div", gn, [
1523
- r(g, {
1524
- label: "Send",
1525
- loading: e(Se)().isLoading,
1526
- onClick: U[2] || (U[2] = async () => {
1527
- var h;
1528
- return (h = e(t)) == null ? void 0 : h.validateInputs();
1529
- })
1530
- }, null, 8, ["loading"]),
1531
- r(g, {
1532
- label: "Cancel",
1533
- type: "button",
1534
- variant: "tertiary",
1535
- onClick: U[3] || (U[3] = (h) => i.value = !1)
1536
- })
1537
- ])
1538
- ]),
1539
- default: B(() => [
1540
- r(ie, {
1541
- class: "space-y-16",
1542
- ref_key: "form",
1543
- ref: t,
1544
- onValidationSuccess: k,
1545
- blameFormChildOnValidationFailed: ""
1546
- }, {
1547
- default: B(() => [
1548
- r(z, {
1549
- class: "max-w-[700px]",
1550
- horizontal: "",
1551
- variant: "outlined"
1552
- }, {
1553
- default: B(() => {
1554
- var h, $;
1555
- return [
1556
- (h = e(s)) != null && h.image ? (x(), O(j, {
1557
- key: 0,
1558
- width: "100",
1559
- src: ($ = e(s)) == null ? void 0 : $.image
1560
- }, null, 8, ["src"])) : E("", !0),
1561
- r(H, { class: "flex flex-col gap-16 justify-between" }, {
1562
- default: B(() => {
1563
- var d;
1564
- return [
1565
- r(ne, {
1566
- class: "p-0",
1567
- title: (d = e(s)) == null ? void 0 : d.name,
1568
- subtitle: e(l)
1569
- }, null, 8, ["title", "subtitle"]),
1570
- r(H, { class: "p-0" }, {
1571
- default: B(() => {
1572
- var n, p, f, I, M, R, q, J, fe, Ce, de;
1573
- return [
1574
- F("div", bn, [
1575
- (n = e(s)) != null && n.isFeedvibe ? (x(), O(Z, {
1576
- key: 0,
1577
- label: "Feedvibe"
1578
- })) : E("", !0),
1579
- (f = (p = e(s)) == null ? void 0 : p.titles) != null && f.length ? (x(), O(Z, {
1580
- key: 1,
1581
- label: `${e(s).titles.length} title(s)`
1582
- }, null, 8, ["label"])) : E("", !0),
1583
- (M = (I = e(s)) == null ? void 0 : I.vouchers) != null && M.length ? (x(), O(Z, {
1584
- key: 2,
1585
- label: `${e(s).vouchers.length} voucher(s)`
1586
- }, null, 8, ["label"])) : E("", !0),
1587
- (q = (R = e(s)) == null ? void 0 : R.credit) != null && q.normal || (Ce = (fe = (J = e(s)) == null ? void 0 : J.credit) == null ? void 0 : fe.free) != null && Ce.amount ? (x(), O(Z, {
1588
- key: 3,
1589
- label: `${(e(s).credit.normal || 0) + (((de = e(s).credit.free) == null ? void 0 : de.amount) || 0)} credit(s)`
1590
- }, null, 8, ["label"])) : E("", !0)
1591
- ])
1592
- ];
1593
- }),
1594
- _: 1
1595
- })
1596
- ];
1597
- }),
1598
- _: 1
1599
- })
1600
- ];
1601
- }),
1602
- _: 1
1603
- }),
1604
- r(oe, {
1605
- modelValue: e(v),
1606
- "onUpdate:modelValue": U[0] || (U[0] = (h) => re(v) ? v.value = h : null),
1607
- label: "Select member",
1608
- searchable: "",
1609
- items: e(m),
1610
- onSearch: u,
1611
- rules: [(h) => !!h > 0 || "Member is required"],
1612
- "helper-text": "Type to search member"
1613
- }, null, 8, ["modelValue", "items", "rules"]),
1614
- r(V, {
1615
- modelValue: e(a),
1616
- "onUpdate:modelValue": U[1] || (U[1] = (h) => re(a) ? a.value = h : null),
1617
- label: "Reference (optional)",
1618
- rules: [
1619
- (h) => h.length < 50 || "Reference must be less than 50 characters"
1620
- ]
1621
- }, null, 8, ["modelValue", "rules"])
1622
- ]),
1623
- _: 1
1624
- }, 512)
1625
- ]),
1626
- _: 1
1627
- }, 8, ["modelValue"]);
1628
- };
1629
- }
1630
- });
1631
- async function Ee({
1632
- hasStoreCompany: C,
1633
- confirm: _,
1634
- showSettingSheet: o
1635
- }) {
1636
- return C ? !0 : (await _() && o(!0), !1);
1637
- }
1638
- var hn = { authUrl: "https://portal-v2.feedmeapi.com/", slackWebhookUrl: "https://hooks.slack.com/services/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", appUrl: "member.feedme.cc", crmUrl: "crm.feedme.cc", paymentPortalUrl: "https://portal.feedme.cc/payment/payout-account", licensePortalUrl: "https://license.feedme.cc/", marketingV1Portal: "https://marketing-v1.feedme.cc", voucherAppUrl: "https://voucher.feedme.cc/" };
1639
- const xn = { class: "px-24 flex flex-col gap-y-16" }, Cn = { class: "flex gap-8 items-center" }, _n = { class: "fm-typo-en-body-lg-600" }, Sn = { class: "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-24" }, Fn = { class: "flex flex-col gap-16 text-center" }, Vn = { class: "fm-typo-en-title-sm-800" }, wn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, oo = /* @__PURE__ */ te({
1640
- __name: "Store",
1641
- setup(C) {
1642
- const _ = {
1643
- label: "Setup payout account",
1644
- value: "payout",
1645
- isPrimary: !1
1646
- }, { t: o } = xe(), b = {
1647
- label: o("connect.store.actions.setting"),
1648
- value: "setting",
1649
- isPrimary: !1
1650
- }, s = {
1651
- label: o("connect.store.actions.manageReward"),
1652
- value: "create_reward"
1653
- }, v = {
1654
- label: o("connect.store.actions.addCategory"),
1655
- value: "create_category",
1656
- isPrimary: !0,
1657
- prependIcon: "add"
1658
- }, a = N(), m = gt(), i = ke(), { global: t, minor: c } = Ke, y = je(), u = L(() => i.sortedStoreCategories), k = L(() => i.sortedStoreCategories.map((g) => g.name)), l = N(), w = N();
1659
- async function U(g) {
1660
- var T;
1661
- g === "setting" ? (T = l.value) == null || T.showSheet(!0, i.storeOption) : g === "create_category" ? H(-1) : g === "create_reward" ? await m.push({ name: lt["$connect-STORE_REWARDS"] }) : g == "payout" && window.open(hn.paymentPortalUrl, "_blank");
1662
- }
1663
- function j(g, T) {
1664
- var p;
1665
- const h = !!((p = T.company) != null && p.sstRegNo), $ = T.inclusiveTaxes ?? [], d = W.taxSystem.map((f) => f.code), n = h ? $.flatMap((f) => {
1666
- console.log(f, "inclusive tax");
1667
- const I = W.systemDefaultCode(f.systemCode);
1668
- return I ? [{ systemCode: f.systemCode, taxCode: I.taxCode }] : [];
1669
- }) : [];
1670
- return console.log([
1671
- ["hasSstRegNo", h],
1672
- ["defaultTaxCodes", n],
1673
- ["inclusiveTaxes", $],
1674
- ["taxSystemCodes", d]
1675
- ]), g.map((f) => ({
1676
- ...f,
1677
- bundles: f.bundles.map((I) => {
1678
- const { pf_vouchers: M, ...R } = I;
1679
- if (!h)
1680
- return {
1681
- ...R,
1682
- taxes: [],
1683
- taxTotals: [],
1684
- priceWithTaxes: { ...R.price }
1685
- };
1686
- const q = n, J = qe(
1687
- W.fullTax,
1688
- q,
1689
- R.price,
1690
- Number(R.credit.normal),
1691
- $,
1692
- d
1693
- );
1694
- return {
1695
- ...R,
1696
- taxes: q,
1697
- taxTotals: J,
1698
- priceWithTaxes: We(
1699
- J,
1700
- R.price,
1701
- $
1702
- )
1703
- };
1704
- })
1705
- }));
1706
- }
1707
- async function ne(g, T, h) {
1708
- const $ = !h && !!T, d = !!h && !T;
1709
- let n;
1710
- if ($) {
1711
- const f = W.taxSystem[0] ? W.systemDefaultCode(W.taxSystem[0].code) : void 0, I = f ? `${f.name} (${f.taxCode})` : o("connect.store.taxPropagation.defaultTax");
1712
- n = o("connect.store.taxPropagation.addConfirm", {
1713
- taxCode: I
1714
- });
1715
- } else d ? n = o("connect.store.taxPropagation.removeConfirm") : n = o("connect.store.taxPropagation.updateConfirm");
1716
- await pe.confirm(
1717
- n,
1718
- o("connect.store.taxPropagation.title"),
1719
- o("connect.store.taxPropagation.confirm"),
1720
- o("connect.common.cancel")
1721
- ) && await c(
1722
- async () => {
1723
- const f = Fe(i.sortedStoreCategories), I = j(f, g);
1724
- await ge.updateStoreBundle({ categories: I }), await i.readMemberStore(), await i.readMembership(), await i.readRewards();
1725
- },
1726
- {
1727
- message: o("connect.store.taxPropagation.updating"),
1728
- successMessage: o("connect.store.taxPropagation.success")
1729
- }
1730
- );
1731
- }
1732
- async function Z(g) {
1733
- var I, M, R, q;
1734
- const T = ((M = (I = i.storeOption) == null ? void 0 : I.company) == null ? void 0 : M.sstRegNo) ?? "", h = ae.cloneDeep(
1735
- ((R = i.storeOption) == null ? void 0 : R.inclusiveTaxes) ?? []
1736
- ), $ = ((q = g.company) == null ? void 0 : q.sstRegNo) ?? "";
1737
- await c(
1738
- async () => {
1739
- var J;
1740
- await ge.updateStore(g), await i.readMemberStore(), (J = l.value) == null || J.showSheet(!1);
1741
- },
1742
- {
1743
- message: o("connect.store.setting.update.message"),
1744
- successMessage: o("connect.store.setting.update.success")
1745
- }
1746
- );
1747
- const d = T !== $, n = !ae.isEqual(
1748
- h,
1749
- g.inclusiveTaxes ?? []
1750
- );
1751
- !(d || n) || i.sortedStoreCategories.flatMap(
1752
- (J) => J.bundles
1753
- ).length === 0 || await ne(g, $, T);
1754
- }
1755
- async function H(g = -1) {
1756
- var h, $;
1757
- await Ee({
1758
- hasStoreCompany: !!((h = i.storeOption) != null && h.company),
1759
- confirm: () => pe.confirm(
1760
- o("connect.store.category.setup.title"),
1761
- o("connect.store.category.setup.button"),
1762
- o("connect.store.category.setup.action"),
1763
- o("connect.common.cancel")
1764
- ),
1765
- showSettingSheet: (d) => {
1766
- var n;
1767
- return (n = l.value) == null ? void 0 : n.showSheet(d);
1768
- }
1769
- }) && y.open({
1770
- title: g == -1 ? o("connect.store.category.add") : o("connect.store.category.edit"),
1771
- contentComponent: Rt,
1772
- contentComponentProps: {
1773
- initialValue: (($ = u.value[g]) == null ? void 0 : $.name) ?? "",
1774
- action: g == -1 ? "add" : "edit"
1775
- }
1776
- }).onPrimary(async (d) => {
1777
- d === null && !await pe.remove(
1778
- o("connect.store.category.remove.confirm"),
1779
- o("connect.store.category.remove.title")
1780
- ) || await c(
1781
- async () => {
1782
- const n = g == -1 ? [...u.value, { name: d, bundles: [] }] : [...u.value].map((p, f) => f == g ? { ...p, name: d } : p).filter((p) => p.name !== null);
1783
- await ge.updateStoreBundle({
1784
- categories: n
1785
- }), await i.readMemberStore();
1786
- },
1787
- {
1788
- message: d === null ? o("connect.store.category.update.deleting") : g == -1 ? o("connect.store.category.update.creating") : o("connect.store.category.update.updating"),
1789
- successMessage: d === null ? o("connect.store.category.update.success.deleted") : g == -1 ? o("connect.store.category.update.success.created") : o("connect.store.category.update.success.updated")
1790
- }
1791
- );
1792
- });
1793
- }
1794
- async function z(g, T, h, $) {
1795
- var p, f, I;
1796
- T ?? (T = (p = w.value) == null ? void 0 : p.target.category), h ?? (h = (f = w.value) == null ? void 0 : f.target.index), $ ?? ($ = (I = w.value) == null ? void 0 : I.target.originalCategoryIndex);
1797
- const d = Fe(u.value);
1798
- for (const M of d)
1799
- for (const R of M.bundles)
1800
- console.log(R, "bundle in payload"), "pf_vouchers" in R && delete R.pf_vouchers;
1801
- T != $ && $ != null && (d[$].bundles.splice(h, 1), h = d[T].bundles.length);
1802
- const n = d[T];
1803
- if (!n) {
1804
- rt.error("Unexpected error", 2e3);
1805
- return;
1806
- }
1807
- if (g == null) {
1808
- if (await pe.remove(
1809
- o("connect.store.bundle.delete.confirm"),
1810
- o("connect.store.bundle.delete.title")
1811
- ) == !1)
1812
- return;
1813
- n.bundles.splice(h, 1);
1814
- } else
1815
- h == -1 ? n.bundles.push(g) : n.bundles[h] = g;
1816
- await c(
1817
- async () => {
1818
- var M, R;
1819
- if (g != null) {
1820
- const q = (M = w.value) == null ? void 0 : M.bundleImage;
1821
- q === null && g.image ? (await Ve.delete(g.image), g.image = null) : q && (g.image = await Ve.update(
1822
- Ve.bundleImagePath(void 0, q),
1823
- q
1824
- ));
1825
- }
1826
- await ge.updateStoreBundle({
1827
- categories: d
1828
- }), await i.readMemberStore(), await i.readMembership(), await i.readRewards(), (R = w.value) == null || R.showSheet(!1);
1829
- },
1830
- {
1831
- message: `${g == null ? "Deleting" : h == -1 ? "Creating" : "Updating"} bundle`,
1832
- successMessage: `Bundle ${g == null ? "deleted" : h == -1 ? "created" : "updated"} successfully`
1833
- }
1834
- );
1835
- }
1836
- function oe(g) {
1837
- var T;
1838
- Ee({
1839
- hasStoreCompany: !!((T = i.storeOption) != null && T.company),
1840
- confirm: () => pe.confirm(
1841
- o("connect.store.category.setup.title"),
1842
- o("connect.store.category.setup.button"),
1843
- o("connect.store.category.setup.action"),
1844
- o("connect.common.cancel")
1845
- ),
1846
- showSettingSheet: (h) => {
1847
- var $;
1848
- return ($ = l.value) == null ? void 0 : $.showSheet(h);
1849
- }
1850
- }).then((h) => {
1851
- var $;
1852
- h && (($ = w.value) == null || $.showSheet(!0, {
1853
- ...g,
1854
- bundle: g.bundle ? Fe(g.bundle) : void 0
1855
- }));
1856
- });
1857
- }
1858
- const V = N([]);
1859
- function ie(g) {
1860
- var T;
1861
- (T = a.value) == null || T.showSheet({
1862
- bundle: g
1863
- });
1864
- }
1865
- return he(async () => {
1866
- var T, h;
1867
- await t(async () => {
1868
- var $, d;
1869
- if (await i.readMemberStore(), await i.readMembership(), await i.readRewards(), await i.readPayoutAccount(), ($ = m.currentRoute.value.query) != null && $.action) {
1870
- switch ((d = m.currentRoute.value.query) == null ? void 0 : d.action) {
1871
- case "update_setting":
1872
- U("setting");
1873
- break;
1874
- case "create_category":
1875
- H(-1);
1876
- break;
1877
- case "create_feedvibe_bundle":
1878
- y.open({
1879
- title: "Select category",
1880
- contentComponent: Nt
1881
- }).onPrimary((n) => {
1882
- y.close(), oe({
1883
- categories: k.value,
1884
- category: n,
1885
- index: -1,
1886
- bundle: {
1887
- ...ae.cloneDeep(we),
1888
- isFeedvibe: !0,
1889
- price: A.Dinero.fromNumber({
1890
- number: 10,
1891
- precision: 2
1892
- }).toObject()
1893
- }
1894
- });
1895
- }).onTertiary(() => y.close());
1896
- break;
1897
- }
1898
- m.replace({ query: {} });
1899
- }
1900
- });
1901
- const g = ((T = i.payoutAccount) == null ? void 0 : T.status) === "APPROVED" && ((h = i.payoutAccount) == null ? void 0 : h.enable) === !0;
1902
- V.value = [
1903
- ...g ? [] : [_],
1904
- b,
1905
- s,
1906
- v
1907
- ];
1908
- }), (g, T) => {
1909
- const h = S("FmPageHead"), $ = S("FmButton"), d = S("FmCard");
1910
- return x(), D(Y, null, [
1911
- r(h, {
1912
- title: e(o)("connect.store.title"),
1913
- actions: e(V),
1914
- "onClick:action": U
1915
- }, null, 8, ["title", "actions"]),
1916
- F("div", xn, [
1917
- e(u) && e(u).length > 0 ? (x(), D(Y, { key: 0 }, [
1918
- (x(!0), D(Y, null, ce(e(u), (n, p) => (x(), D("div", {
1919
- key: n.name,
1920
- class: "space-y-8 py-12"
1921
- }, [
1922
- F("div", Cn, [
1923
- F("div", _n, K(n.name), 1),
1924
- r(Te, { json: n }, null, 8, ["json"]),
1925
- r($, {
1926
- icon: "edit",
1927
- size: "md",
1928
- variant: "tertiary",
1929
- onClick: (f) => H(p)
1930
- }, null, 8, ["onClick"])
1931
- ]),
1932
- F("div", Sn, [
1933
- (x(!0), D(Y, null, ce(n.bundles, (f, I) => (x(), O(Pt, {
1934
- bundle: f,
1935
- key: f._id,
1936
- onEdit: (M) => oe({
1937
- bundle: f,
1938
- category: p,
1939
- index: I,
1940
- categories: e(k)
1941
- }),
1942
- onDelete: (M) => z(null, p, I),
1943
- onSend: ie
1944
- }, null, 8, ["bundle", "onEdit", "onDelete"]))), 128)),
1945
- r(kt, {
1946
- onCreate: (f) => oe({
1947
- category: p,
1948
- index: -1,
1949
- categories: e(k)
1950
- })
1951
- }, null, 8, ["onCreate"])
1952
- ])
1953
- ]))), 128)),
1954
- r(yn, {
1955
- ref_key: "bundleSheetRef",
1956
- ref: w,
1957
- onUpdate: z
1958
- }, null, 512)
1959
- ], 64)) : (x(), O(d, {
1960
- key: 1,
1961
- variant: "outlined",
1962
- class: "w-full flex flex-col items-center justify-center gap-y-24 p-24"
1963
- }, {
1964
- default: B(() => [
1965
- T[1] || (T[1] = F("img", {
1966
- src: Xe,
1967
- class: "aspect-square w-[150px]"
1968
- }, null, -1)),
1969
- F("div", Fn, [
1970
- F("div", Vn, K(e(o)("connect.store.bundle.title")), 1),
1971
- F("div", wn, K(e(o)("connect.store.bundle.description")), 1)
1972
- ]),
1973
- r($, {
1974
- variant: "primary",
1975
- label: e(o)("connect.store.actions.addCategory"),
1976
- icon: "add",
1977
- onClick: T[0] || (T[0] = (n) => H(-1))
1978
- }, null, 8, ["label"])
1979
- ]),
1980
- _: 1
1981
- })),
1982
- r(Qt, {
1983
- ref_key: "settingSheetRef",
1984
- ref: l,
1985
- onUpdate: Z
1986
- }, null, 512),
1987
- r(vn, {
1988
- ref_key: "sendBundleSheetRef",
1989
- ref: a
1990
- }, null, 512)
1991
- ])
1992
- ], 64);
1993
- };
1994
- }
1995
- });
1996
- export {
1997
- oo as default
1998
- };