@feedmepos/mf-connect 0.1.98-beta.81 → 0.1.98-beta.82

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 (133) hide show
  1. package/dist/{App-CKdnfhUE.js → App-DIWPN6WH.js} +9 -9
  2. package/dist/{AuditLogs-vN-szmrB.js → AuditLogs-BTZKJs5f.js} +13 -13
  3. package/dist/{Bin-FIyWozvZ.js → Bin-DJXuzg5t.js} +8 -8
  4. package/dist/{Broadcast-CV_euppF.js → Broadcast-DtG0edQa.js} +12 -12
  5. package/dist/{CampaignAnalytic-Dlovlsh3.js → CampaignAnalytic-DbLBzibb.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Fd_0aPzZ.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-C1yg2-DE.js} +8 -8
  7. package/dist/{Card-ZgfOZ7sV.js → Card-bcNLznin.js} +23 -23
  8. package/dist/{Collections-DZmHKbZn.js → Collections-DCq-oxmB.js} +8 -8
  9. package/dist/{Credit-DGsbEvMw.js → Credit-EwMv7P6u.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-Cj89MnB0.js → DateRangeChip.vue_vue_type_script_setup_true_lang-EhwxqiPf.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C77dXZo-.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DkkO_gn1.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CcIiEV2Z.js → EffectSheet.vue_vue_type_style_index_0_lang-BirRksYU.js} +6 -6
  13. package/dist/{Experience-DlJycdKe.js → Experience-QuulWZ2l.js} +13 -13
  14. package/dist/{FileSaver.min-DVGF0TBc.js → FileSaver.min-RTo5UlWI.js} +1 -1
  15. package/dist/{Game-q2X_SSup.js → Game-BGGe7pFk.js} +13 -13
  16. package/dist/{GiftCardSetup-BLDm3RfC.js → GiftCardSetup-CNPP7HtQ.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-CBC5AGR-.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-yBUVNHEP.js} +7 -7
  18. package/dist/{Goals-CD8vdUPQ.js → Goals-D-Q-ht66.js} +4 -4
  19. package/dist/{Grab-KDYktOCn.js → Grab-D2jS-RCL.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DUi1YY1x.js → ImageInput.vue_vue_type_script_setup_true_lang-Byemh4AD.js} +1 -1
  21. package/dist/{Index-BT4esMkG.js → Index-QP8P79Tu.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-BRCrx3DA.js → LocationPicker.vue_vue_type_script_setup_true_lang-CrYa6Vek.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-D3G4alTX.js → LottieAnimation.vue_vue_type_script_setup_true_lang-BGxbglj5.js} +1 -1
  24. package/dist/{LoyaltyDashboard-CzmwuzTw.js → LoyaltyDashboard-Bkquum-3.js} +15 -15
  25. package/dist/{MainLayout-CVYfxfuS.js → MainLayout-BQ_PiBqS.js} +3 -3
  26. package/dist/{Marketing-sDWWcaL5.js → Marketing-CHTPSOIj.js} +4 -4
  27. package/dist/{MarketingMaterialEdit-DHmI38Lo.js → MarketingMaterialEdit-BAYHnYKe.js} +6 -6
  28. package/dist/{Member-sdcMiTmr.js → Member-D7xDe5Rt.js} +7 -7
  29. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DqchRq6h.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-B3074-er.js} +24 -24
  30. package/dist/{MemberImportHistory-Df_5SiGn.js → MemberImportHistory-BndvQb_w.js} +7 -7
  31. package/dist/{MemberList-BGoClGZE.js → MemberList-Ctxdpre8.js} +14 -14
  32. package/dist/{MemberTransactions-qR38yGk5.js → MemberTransactions-qQXjqnUy.js} +1 -1
  33. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D4yY57Vo.js → MessageInput.vue_vue_type_script_setup_true_lang-Bzc0IePL.js} +10 -10
  34. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-Co9oeOFx.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-1fr2pugZ.js} +1 -1
  35. package/dist/{Mission-DSyqYeI6.js → Mission-B4wOanDj.js} +14 -14
  36. package/dist/{Overview-BDM8Lxfv.js → Overview-D8-Xzdh4.js} +21 -21
  37. package/dist/{Overview-sLhLv5Oa.js → Overview-Dg8Uoyo3.js} +4 -4
  38. package/dist/{Point-DO5Z5sOL.js → Point-CS4mzCm5.js} +14 -14
  39. package/dist/{Promotion-BXm1Dxlv.js → Promotion-Ccuo6zoT.js} +14 -14
  40. package/dist/{Queue-C4kEj_Bp.js → Queue-ChNawIta.js} +13 -13
  41. package/dist/{Record-iKUy-nn3.js → Record-DmH2pbgo.js} +9 -9
  42. package/dist/{Review-D-3-BRON.js → Review-vhLtZ7y7.js} +2 -2
  43. package/dist/{ReviewFacebookCallback-SLzE3D7c.js → ReviewFacebookCallback-TgdFbPrW.js} +5 -5
  44. package/dist/{ReviewGoogleCallback-DntrtfGB.js → ReviewGoogleCallback-CpK6sWqa.js} +5 -5
  45. package/dist/{Reward-CNQS6F2m.js → Reward-645jqAha.js} +16 -16
  46. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-D0ZNJilO.js → RewardGroup.vue_vue_type_script_setup_true_lang-G_iME05g.js} +14 -14
  47. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-BgvaMOAJ.js → RuleGroup.vue_vue_type_script_setup_true_lang-e3CagrVZ.js} +15 -15
  48. package/dist/{Segment-Bi58A7cw.js → Segment-fj3Nqtpv.js} +26 -26
  49. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CxC6ZLZT.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-D_yFLAc4.js} +15 -15
  50. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-CToVAWKO.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-D3JDTWXp.js} +4 -4
  51. package/dist/{Setting-CixcOp_l.js → Setting-CBVP-Mpb.js} +14 -14
  52. package/dist/{SettingAdvertisements-DkPNDfxz.js → SettingAdvertisements-BdPPUvDC.js} +12 -12
  53. package/dist/{Settings-bD_DkKI0.js → Settings-BT6OdqEM.js} +5 -5
  54. package/dist/{Store-BvnsumDX.js → Store-nlIBDj84.js} +27 -27
  55. package/dist/{StoreRewards-CKPnV_j3.js → StoreRewards-DaMOOzw0.js} +15 -15
  56. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-k46T2rql.js → StoreTransactions.vue_vue_type_script_setup_true_lang-UyV-RU5E.js} +25 -25
  57. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-IknvTIMG.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Dnr-6tzT.js} +2 -2
  58. package/dist/{Tier-CiKGy-Do.js → Tier-DUvEF-Ns.js} +27 -27
  59. package/dist/{Title-CNFamvkQ.js → Title-C3FZriO7.js} +23 -23
  60. package/dist/{Transaction-C8SnyFML.js → Transaction-Ctd7qzJI.js} +2 -2
  61. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-DQrTH7cz.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-CI8jF-Vn.js} +6 -6
  62. package/dist/{Voucher-9Q-GHuvD.js → Voucher-IoMmmYh2.js} +18 -18
  63. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-B-6mF0RH.js → VoucherEditor.vue_vue_type_script_setup_true_lang-CdBrD2bP.js} +12 -12
  64. package/dist/{WhatsappAccount-DRKJVs0I.js → WhatsappAccount-D1a0ABEK.js} +5 -5
  65. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DUdFMygT.js +80 -0
  66. package/dist/WhatsappBot-CVirkYvU.js +561 -0
  67. package/dist/WhatsappBotSettings-BV_HgL-p.js +394 -0
  68. package/dist/WhatsappBotTickets-Ca_c5_B2.js +153 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-7tSuZ_C3.js → ZodTextField.vue_vue_type_script_setup_true_lang-Z4TFGdcH.js} +2 -2
  70. package/dist/{app-CQnX8TXq.js → app-Cj6OWO36.js} +4002 -3647
  71. package/dist/app.js +1 -1
  72. package/dist/{base.export-CwCY41wr.js → base.export-7wLpz1Vu.js} +2 -2
  73. package/dist/{business-DGYo03yh.js → business-COKUtA0N.js} +1 -1
  74. package/dist/{campaign-BFhMhQWk.js → campaign-B2HD3DRn.js} +8 -8
  75. package/dist/{campaign-BmVMseCM.js → campaign-CIyWTu9f.js} +2 -2
  76. package/dist/{campaign.fn-DHdhR9C8.js → campaign.fn-DJzUFP-T.js} +140 -140
  77. package/dist/{collection.fn-CYrQd8Th.js → collection.fn-LB9uKdHM.js} +2 -2
  78. package/dist/{currency-B7wFZjCM.js → currency-B3pBZiCD.js} +1 -1
  79. package/dist/{duplicateCampaign-C62eVSKZ.js → duplicateCampaign-CiIDQH1W.js} +2 -2
  80. package/dist/{effect-XVC0SyM1.js → effect-Bp0w1Vly.js} +1 -1
  81. package/dist/{email-addresses-DUWzbknH.js → email-addresses-qxmP-ghm.js} +2 -2
  82. package/dist/{helper-Bw_KFook.js → helper-PRIAnsXY.js} +1 -1
  83. package/dist/{index-BL01AAGF.js → index-BId5mHYh.js} +3 -3
  84. package/dist/{index-DHRVhERM.js → index-BLH6nPs9.js} +3 -3
  85. package/dist/{index-DlFjUct2.js → index-BV4bWZM1.js} +18 -18
  86. package/dist/{index-D5D85re4.js → index-BZ42-wj6.js} +9 -9
  87. package/dist/{index-XCHxkJPE.js → index-B_fZHfs-.js} +2 -2
  88. package/dist/{index-CmJ4UtbH.js → index-C6jzfbh8.js} +7 -7
  89. package/dist/{index-C0WVYJgp.js → index-CA5-wXVF.js} +1 -1
  90. package/dist/{index-CRX2b_-n.js → index-DA-OPM4v.js} +2 -2
  91. package/dist/{index-CsZ7_Qzf.js → index-DMRdy2Kz.js} +2 -2
  92. package/dist/{index-DKabvlsg.js → index-DPF_QE13.js} +23 -23
  93. package/dist/index-DS__Cknq.js +74 -0
  94. package/dist/{index-BHPcqvxB.js → index-DbdZvsUQ.js} +2 -2
  95. package/dist/{index-Bu0rl1Jm.js → index-DgR5Yphl.js} +1 -1
  96. package/dist/{index-BpcakDLo.js → index-DiuFB2hK.js} +2 -2
  97. package/dist/index-DopAV1p0.js +68 -0
  98. package/dist/{index-D89ye2yV.js → index-F3o5W57q.js} +9 -9
  99. package/dist/{index-C5a9ZaAM.js → index-TRXyLWUu.js} +2 -2
  100. package/dist/{index-B88wz0DA.js → index-XzWyheJy.js} +1 -1
  101. package/dist/{index-CSaO5mCs.js → index-aTCNe4X_.js} +1 -1
  102. package/dist/{index-CX2tKi6X.js → index-fjrIMEy7.js} +1 -1
  103. package/dist/{index-CoaZuwwm.js → index-nyzNkE9r.js} +1 -1
  104. package/dist/{index.esm2017-cOXL--fX.js → index.esm2017-DZIDjb2C.js} +37 -37
  105. package/dist/{loading-BlfJuA-h.js → loading-CSdKEjY5.js} +1 -1
  106. package/dist/{lodash-CFkpI5Sp.js → lodash-BIB2o8LD.js} +1 -1
  107. package/dist/{member-import-B4ihDPgR.js → member-import-PcGNpuqH.js} +1 -1
  108. package/dist/{membership-CyNEU3ld.js → membership-ivTpKFxy.js} +2 -2
  109. package/dist/{money-B0QV3AtE.js → money-BSDhQ-zg.js} +1 -1
  110. package/dist/{number-DJ7EhoTu.js → number-ByYnVDwR.js} +1 -1
  111. package/dist/{objectid-DZ8o9_J4.js → objectid-BJu8QMfW.js} +6 -6
  112. package/dist/{onboarding-BhMbuIRK.js → onboarding-Cr2iuJY2.js} +3 -3
  113. package/dist/{onboardingSetup-BZMYTun6.js → onboardingSetup-D6I4p209.js} +2 -2
  114. package/dist/{plugins-C7hEP98r.js → plugins-D3BYIk9P.js} +3 -3
  115. package/dist/{reward-D4975Y4s.js → reward-UplovmpX.js} +1 -1
  116. package/dist/{rule-BfSrqM9Z.js → rule-CI8Gfa0f.js} +10 -10
  117. package/dist/style.css +1 -1
  118. package/dist/{template-CTCYJKDu.js → template-Bepdb4Vy.js} +6 -6
  119. package/dist/{timezone-hBjTK85u.js → timezone-CdDDjOpp.js} +1 -1
  120. package/dist/{transaction.fn-1iGyAGZA.js → transaction.fn-DiRDf20s.js} +2 -2
  121. package/dist/{trigger-CdJikvw9.js → trigger-B9BqJ3WQ.js} +5 -5
  122. package/dist/{useMarketingMaterialActions-R1rDbIr8.js → useMarketingMaterialActions-Do9xLe-A.js} +3 -3
  123. package/dist/{usePagination-CqSRHo9z.js → usePagination-CuHuUThw.js} +1 -1
  124. package/dist/{user-C8i4TfQt.js → user-CX4hU-xf.js} +1 -1
  125. package/dist/{vue-i18n-CiJ_kNkt.js → vue-i18n-DOpMPUHr.js} +390 -390
  126. package/dist/{xlsx-DGiPalb9.js → xlsx-BQVBwvzT.js} +224 -224
  127. package/dist/{zod-CKl6yP5K.js → zod-Jw_6SDXB.js} +1 -1
  128. package/package.json +1 -1
  129. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DGOPGiGH.js +0 -96
  130. package/dist/WhatsappBot-muUmTIyY.js +0 -441
  131. package/dist/WhatsappBotSettings-DUjKwiv6.js +0 -136
  132. package/dist/index-o2Ga_qaX.js +0 -39
  133. package/dist/index-z0K48rtR.js +0 -54
@@ -1,4 +1,4 @@
1
- import { i as Z } from "./plugins-C7hEP98r.js";
1
+ import { i as Z } from "./plugins-D3BYIk9P.js";
2
2
  import { h as f } from "vue";
3
3
  function u(e, o) {
4
4
  return e.path.join(".") === o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-connect",
3
- "version": "0.1.98-beta.81",
3
+ "version": "0.1.98-beta.82",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -1,96 +0,0 @@
1
- import { computed as n, toValue as h, defineComponent as x, openBlock as w, createElementBlock as A, normalizeClass as b, createElementVNode as B, createTextVNode as _, toDisplayString as C, unref as N } from "vue";
2
- import { u as f } from "./vue-i18n-CiJ_kNkt.js";
3
- function O(a) {
4
- const o = a.connectedAt !== null;
5
- switch (a.status) {
6
- case "connected":
7
- return "connected";
8
- case "disconnected":
9
- return "disconnected";
10
- case "connecting":
11
- return o ? "connecting" : void 0;
12
- case "not_found":
13
- return o ? "loggedOut" : void 0;
14
- case "unavailable":
15
- return o ? "unavailable" : void 0;
16
- case "pairing":
17
- return;
18
- }
19
- }
20
- const g = [
21
- "bg-fm-color-primary",
22
- "bg-fm-color-secondary-plum",
23
- "bg-fm-color-system-success-400"
24
- ];
25
- function I(a) {
26
- const { t: o, locale: l } = f(), t = n(() => h(a)), c = n(
27
- () => {
28
- var e, s, p, i, m, d;
29
- return ((s = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : s.businessName) || ((i = (p = t.value) == null ? void 0 : p.account) == null ? void 0 : i.name) || ((d = (m = t.value) == null ? void 0 : m.account) == null ? void 0 : d.phoneNumber) || o("connect.whatsappBot.unnamedAccount");
30
- }
31
- ), r = n(
32
- () => {
33
- var e, s;
34
- return ((s = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : s.phoneNumber) || o("connect.whatsappBot.phoneUnavailable");
35
- }
36
- ), u = n(
37
- () => c.value.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]).join("").toLocaleUpperCase(l.value)
38
- ), v = n(
39
- () => t.value ? O(t.value) ?? "unavailable" : "unavailable"
40
- ), y = n(
41
- () => {
42
- var e;
43
- return g[parseInt(((e = t.value) == null ? void 0 : e.clientId.slice(-6)) ?? "0", 16) % g.length];
44
- }
45
- );
46
- return { name: c, phoneNumber: r, initials: u, state: v, avatarColor: y };
47
- }
48
- const L = /* @__PURE__ */ x({
49
- __name: "WhatsappAccountStatusLabel",
50
- props: {
51
- state: {}
52
- },
53
- setup(a) {
54
- const o = a, { t: l } = f(), t = {
55
- connected: {
56
- label: "connect.whatsappBot.connected",
57
- pill: "text-fm-color-typo-success bg-fm-color-system-success-100",
58
- dot: "bg-fm-color-system-success-400"
59
- },
60
- connecting: {
61
- label: "connect.whatsappBot.statusConnecting",
62
- pill: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
63
- dot: "bg-fm-color-system-warning-400"
64
- },
65
- disconnected: {
66
- label: "connect.whatsappBot.disconnected",
67
- pill: "text-fm-color-typo-error bg-fm-color-system-error-100",
68
- dot: "bg-fm-color-system-error-400"
69
- },
70
- loggedOut: {
71
- label: "connect.whatsappBot.loggedOut",
72
- pill: "text-fm-color-typo-error bg-fm-color-system-error-100",
73
- dot: "bg-fm-color-system-error-400"
74
- },
75
- unavailable: {
76
- label: "connect.whatsappBot.statusUnavailable",
77
- pill: "text-fm-color-typo-secondary bg-fm-color-neutral-gray-100",
78
- dot: "bg-fm-color-neutral-gray-400"
79
- }
80
- }, c = n(() => t[o.state]);
81
- return (r, u) => (w(), A("span", {
82
- class: b(["flex items-center gap-[6px] text-[12px] font-semibold px-[8px] py-[3px] rounded-[6px]", c.value.pill])
83
- }, [
84
- B("span", {
85
- "aria-hidden": "true",
86
- class: b(["w-[6px] h-[6px] rounded-full", c.value.dot])
87
- }, null, 2),
88
- _(" " + C(N(l)(c.value.label)), 1)
89
- ], 2));
90
- }
91
- });
92
- export {
93
- L as _,
94
- I as u,
95
- O as w
96
- };
@@ -1,441 +0,0 @@
1
- import { defineComponent as F, computed as W, resolveComponent as _, openBlock as a, createElementBlock as d, createVNode as h, unref as t, withCtx as k, createElementVNode as e, normalizeClass as G, toDisplayString as s, createCommentVNode as D, Fragment as U, renderList as Q, createBlock as $, useModel as J, ref as A, watch as O, onBeforeUnmount as q, createTextVNode as H, mergeProps as K, createSlots as X } from "vue";
2
- import { u as I } from "./vue-i18n-CiJ_kNkt.js";
3
- import { useRouter as Y } from "vue-router";
4
- import { S as M } from "./index-BpcakDLo.js";
5
- import { w as L } from "./index-z0K48rtR.js";
6
- import { u as ee, _ as te, w as oe } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DGOPGiGH.js";
7
- import { R as T } from "./app-CQnX8TXq.js";
8
- import { b as ne } from "./browser-BSAOEeIM.js";
9
- const se = { class: "flex items-center gap-[12px]" }, ae = { class: "min-w-0 flex-1" }, ce = ["title"], le = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary break-all" }, re = { class: "flex items-center justify-between flex-wrap gap-[8px] border-t border-fm-color-neutral-gray-100 pt-[12px]" }, ie = {
10
- key: 0,
11
- class: "text-[12px] text-fm-color-typo-secondary"
12
- }, pe = /* @__PURE__ */ F({
13
- __name: "WhatsappAccountCard",
14
- props: {
15
- account: {}
16
- },
17
- setup(b) {
18
- const l = b, { t: n, locale: i } = I(), { name: g, phoneNumber: p, initials: u, state: x, avatarColor: y } = ee(
19
- () => l.account
20
- ), C = W(
21
- () => x.value === "connected" || x.value === "connecting"
22
- );
23
- function w(f) {
24
- return new Intl.DateTimeFormat(i.value, {
25
- year: "numeric",
26
- month: "short",
27
- day: "numeric"
28
- }).format(new Date(f));
29
- }
30
- return (f, B) => {
31
- const S = _("RouterLink");
32
- return a(), d("li", null, [
33
- h(S, {
34
- to: {
35
- name: t(T)["$connect-WHATSAPP_ACCOUNT"],
36
- params: { clientId: b.account.clientId }
37
- },
38
- class: "h-full border border-fm-color-neutral-gray-100 rounded-[16px] p-[20px] flex flex-col gap-[16px] bg-fm-color-neutral-white text-fm-color-typo-primary no-underline cursor-pointer transition-shadow hover:border-fm-color-neutral-gray-200 hover:fm-shadow-light-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary focus-visible:ring-offset-[2px]"
39
- }, {
40
- default: k(() => [
41
- e("div", se, [
42
- e("div", {
43
- "aria-hidden": "true",
44
- class: G(["w-[48px] h-[48px] rounded-full shrink-0 flex items-center justify-center text-[16px] font-semibold text-fm-color-typo-white", t(y)])
45
- }, s(t(u)), 3),
46
- e("div", ae, [
47
- e("h2", {
48
- class: "text-[16px] leading-[24px] font-semibold truncate",
49
- title: t(g)
50
- }, s(t(g)), 9, ce),
51
- e("p", le, s(t(p)), 1)
52
- ])
53
- ]),
54
- e("div", re, [
55
- h(te, { state: t(x) }, null, 8, ["state"]),
56
- C.value && b.account.connectedAt ? (a(), d("span", ie, s(t(n)("connect.whatsappBot.connectedSince", {
57
- date: w(b.account.connectedAt)
58
- })), 1)) : D("", !0)
59
- ])
60
- ]),
61
- _: 1
62
- }, 8, ["to"])
63
- ]);
64
- };
65
- }
66
- }), ue = { class: "mt-[24px] grid grid-cols-[repeat(auto-fill,minmax(280px,1fr))] xs:grid-cols-1 gap-[16px]" }, de = /* @__PURE__ */ F({
67
- __name: "WhatsappAccountList",
68
- props: {
69
- accounts: {}
70
- },
71
- setup(b) {
72
- return (l, n) => (a(), d("ul", ue, [
73
- (a(!0), d(U, null, Q(b.accounts, (i) => (a(), $(pe, {
74
- key: i.clientId,
75
- account: i
76
- }, null, 8, ["account"]))), 128))
77
- ]));
78
- }
79
- }), me = { class: "text-[18px] font-semibold" }, xe = {
80
- key: 0,
81
- role: "status",
82
- class: "flex flex-col items-center text-center gap-[8px] px-[8px] py-[40px]"
83
- }, fe = { class: "text-[18px] font-semibold" }, _e = { class: "text-[14px] text-fm-color-typo-secondary break-all" }, he = {
84
- key: 1,
85
- class: "grid grid-cols-[minmax(0,1fr)_232px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
86
- }, ve = { class: "flex flex-col gap-[20px] text-[14px] leading-[20px]" }, ge = { class: "text-fm-color-typo-secondary" }, ye = { class: "flex flex-col gap-[14px]" }, be = { class: "w-[22px] h-[22px] shrink-0 rounded-full bg-fm-color-neutral-gray-100 flex items-center justify-center text-[12px] font-semibold" }, we = { key: 0 }, Be = { class: "font-semibold" }, Te = { class: "font-semibold" }, ke = { class: "font-semibold" }, Ae = { class: "font-semibold" }, $e = { key: 3 }, Ce = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Se = { class: "relative w-[232px] h-[232px] xs:justify-self-center border border-fm-color-neutral-gray-100 rounded-xl flex items-center justify-center overflow-hidden" }, Pe = {
87
- key: 0,
88
- role: "status",
89
- class: "flex flex-col items-center gap-[12px] text-[13px]"
90
- }, Fe = {
91
- key: 1,
92
- class: "flex flex-col items-center text-center gap-[12px] p-[12px]"
93
- }, Ee = {
94
- role: "alert",
95
- class: "text-[14px] text-fm-color-typo-error"
96
- }, Ve = ["src", "alt"], We = {
97
- key: 3,
98
- role: "status",
99
- "aria-live": "polite",
100
- class: "absolute inset-0 bg-fm-color-neutral-white/90 flex flex-col items-center justify-center gap-[10px] text-[13px] font-medium"
101
- }, De = /* @__PURE__ */ F({
102
- __name: "WhatsappConnectDialog",
103
- props: {
104
- modelValue: { type: Boolean, required: !0 },
105
- modelModifiers: {}
106
- },
107
- emits: ["update:modelValue"],
108
- setup(b) {
109
- const l = J(b, "modelValue"), { t: n } = I(), i = A(""), g = A(!1), p = A(""), u = A(!1), x = A();
110
- let y, C, w;
111
- function f() {
112
- y == null || y.abort(), clearTimeout(C), C = void 0, clearTimeout(w), w = void 0;
113
- }
114
- async function B(c, o, r) {
115
- if (!r.aborted) {
116
- try {
117
- const m = await L.getClient(c, o, r);
118
- if (r.aborted) return;
119
- if ((m.status === "connecting" || m.status === "connected") && (u.value = !0), m.status === "connected" && m.profileStatus === "ready") {
120
- f(), u.value = !1, x.value = m, w = setTimeout(() => {
121
- l.value = !1;
122
- }, 1800);
123
- return;
124
- }
125
- if (m.status === "not_found") {
126
- f(), u.value = !1, i.value = "", p.value = n("connect.whatsappBot.errors.qrExpired");
127
- return;
128
- }
129
- } catch {
130
- }
131
- r.aborted || (C = setTimeout(() => {
132
- B(c, o, r);
133
- }, 2e3));
134
- }
135
- }
136
- async function S() {
137
- f();
138
- const c = new AbortController();
139
- y = c, i.value = "", p.value = "", u.value = !1, x.value = void 0, g.value = !0;
140
- try {
141
- const o = M.getBusinessId();
142
- if (!o)
143
- throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
144
- const r = await L.createClient(
145
- o,
146
- c.signal
147
- ), m = await ne.toDataURL(r.qr, {
148
- width: 224,
149
- margin: 2,
150
- errorCorrectionLevel: "M"
151
- });
152
- c.signal.aborted || (i.value = m, B(o, r.clientId, c.signal));
153
- } catch (o) {
154
- c.signal.aborted || (p.value = o instanceof Error ? o.message : n("connect.whatsappBot.errors.loadQr"));
155
- } finally {
156
- c.signal.aborted || (g.value = !1);
157
- }
158
- }
159
- return O(
160
- l,
161
- (c) => {
162
- c ? S() : f();
163
- },
164
- { immediate: !0 }
165
- ), q(f), (c, o) => {
166
- const r = _("i18n-t"), m = _("FmCircularProgress"), N = _("FmButton"), j = _("FmDialog");
167
- return a(), $(j, {
168
- modelValue: l.value,
169
- "onUpdate:modelValue": o[0] || (o[0] = (P) => l.value = P),
170
- "min-width": "min(720px, calc(100% - 32px))",
171
- "max-width": "720px",
172
- "max-height": "90vh",
173
- "dismiss-away": ""
174
- }, {
175
- "dialog-header": k(() => [
176
- e("h2", me, s(t(n)("connect.whatsappBot.connectAccount")), 1)
177
- ]),
178
- default: k(() => {
179
- var P, E, V;
180
- return [
181
- x.value ? (a(), d("div", xe, [
182
- o[1] || (o[1] = e("div", {
183
- "aria-hidden": "true",
184
- class: "w-[64px] h-[64px] rounded-full bg-fm-color-system-success-100 text-fm-color-typo-success flex items-center justify-center mb-[8px]"
185
- }, [
186
- e("svg", {
187
- width: "32",
188
- height: "32",
189
- viewBox: "0 0 24 24",
190
- fill: "none",
191
- stroke: "currentColor",
192
- "stroke-width": "2.2",
193
- "stroke-linecap": "round",
194
- "stroke-linejoin": "round"
195
- }, [
196
- e("path", { d: "M20 6 9 17l-5-5" })
197
- ])
198
- ], -1)),
199
- e("h3", fe, s(t(n)("connect.whatsappBot.accountConnected")), 1),
200
- e("p", _e, s(((P = x.value.account) == null ? void 0 : P.businessName) || ((E = x.value.account) == null ? void 0 : E.name) || t(n)("connect.whatsappBot.unnamedAccount")) + " · " + s(((V = x.value.account) == null ? void 0 : V.phoneNumber) || t(n)("connect.whatsappBot.phoneUnavailable")), 1)
201
- ])) : (a(), d("div", he, [
202
- e("div", ve, [
203
- e("p", ge, s(t(n)("connect.whatsappBot.scanDescription")), 1),
204
- e("ol", ye, [
205
- (a(), d(U, null, Q(4, (v) => e("li", {
206
- key: v,
207
- class: "flex gap-[12px]"
208
- }, [
209
- e("span", be, s(v), 1),
210
- v === 1 ? (a(), d("span", we, s(t(n)("connect.whatsappBot.steps.openApp")), 1)) : v === 2 ? (a(), $(r, {
211
- key: 1,
212
- keypath: "connect.whatsappBot.steps.openSettings",
213
- tag: "span",
214
- scope: "global"
215
- }, {
216
- menu: k(() => [
217
- e("b", Be, s(t(n)("connect.whatsappBot.menu")), 1)
218
- ]),
219
- settings: k(() => [
220
- e("b", Te, s(t(n)("connect.whatsappBot.settings")), 1)
221
- ]),
222
- _: 1
223
- })) : v === 3 ? (a(), $(r, {
224
- key: 2,
225
- keypath: "connect.whatsappBot.steps.linkDevice",
226
- tag: "span",
227
- scope: "global"
228
- }, {
229
- linkedDevices: k(() => [
230
- e("b", ke, s(t(n)("connect.whatsappBot.linkedDevices")), 1)
231
- ]),
232
- linkDevice: k(() => [
233
- e("b", Ae, s(t(n)("connect.whatsappBot.linkDevice")), 1)
234
- ]),
235
- _: 1
236
- })) : (a(), d("span", $e, s(t(n)("connect.whatsappBot.steps.scanQr")), 1))
237
- ])), 64))
238
- ]),
239
- e("p", Ce, s(t(n)("connect.whatsappBot.connectionNote")), 1)
240
- ]),
241
- e("div", Se, [
242
- g.value ? (a(), d("div", Pe, [
243
- h(m),
244
- H(s(t(n)("connect.whatsappBot.generatingQr")), 1)
245
- ])) : p.value ? (a(), d("div", Fe, [
246
- e("p", Ee, s(p.value), 1),
247
- h(N, {
248
- label: t(n)("connect.whatsappBot.tryAgain"),
249
- "prepend-icon": "refresh",
250
- onClick: S
251
- }, null, 8, ["label"])
252
- ])) : i.value ? (a(), d("img", {
253
- key: 2,
254
- src: i.value,
255
- alt: t(n)("connect.whatsappBot.qrAlt"),
256
- width: "224",
257
- height: "224",
258
- class: G({ "opacity-20": u.value })
259
- }, null, 10, Ve)) : D("", !0),
260
- u.value ? (a(), d("div", We, [
261
- h(m),
262
- H(" " + s(t(n)("connect.whatsappBot.connecting")), 1)
263
- ])) : D("", !0)
264
- ])
265
- ]))
266
- ];
267
- }),
268
- _: 1
269
- }, 8, ["modelValue"]);
270
- };
271
- }
272
- }), Ie = { class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[8px]" }, Ne = { class: "text-[20px] leading-[28px] font-bold" }, je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary max-w-[420px]" }, Oe = /* @__PURE__ */ F({
273
- __name: "WhatsappEmptyState",
274
- emits: ["connect"],
275
- setup(b, { emit: l }) {
276
- const n = l, { t: i } = I();
277
- return (g, p) => {
278
- const u = _("FmButton");
279
- return a(), d("div", Ie, [
280
- p[1] || (p[1] = e("div", { class: "w-[72px] h-[72px] rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center mb-[12px]" }, [
281
- e("svg", {
282
- width: "34",
283
- height: "34",
284
- viewBox: "0 0 24 24",
285
- fill: "none",
286
- stroke: "currentColor",
287
- "stroke-width": "1.6",
288
- "stroke-linecap": "round",
289
- "stroke-linejoin": "round",
290
- "aria-hidden": "true"
291
- }, [
292
- e("path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z" }),
293
- e("path", { d: "M9 10h.01M12 10h.01M15 10h.01" })
294
- ])
295
- ], -1)),
296
- e("h2", Ne, s(t(i)("connect.whatsappBot.emptyTitle")), 1),
297
- e("p", je, s(t(i)("connect.whatsappBot.emptyDescription")), 1),
298
- h(u, {
299
- class: "mt-[16px]",
300
- label: t(i)("connect.whatsappBot.connectAccountCta"),
301
- "prepend-icon": "add",
302
- onClick: p[0] || (p[0] = (x) => n("connect"))
303
- }, null, 8, ["label"])
304
- ]);
305
- };
306
- }
307
- }), He = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, Me = { class: "flex items-center justify-between gap-[16px] flex-wrap min-h-[40px]" }, Le = { class: "flex items-center gap-8" }, Ue = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em]" }, Re = {
308
- key: 1,
309
- role: "status",
310
- class: "mt-[24px] py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
311
- }, Ge = {
312
- key: 2,
313
- class: "mt-[24px] border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[16px]"
314
- }, Qe = {
315
- role: "alert",
316
- class: "text-[14px] text-fm-color-typo-error"
317
- }, tt = /* @__PURE__ */ F({
318
- __name: "WhatsappBot",
319
- setup(b) {
320
- const { t: l } = I(), n = Y(), i = A([]), g = A(!0), p = A("");
321
- let u, x;
322
- const y = W(
323
- () => i.value.filter((c) => oe(c) !== void 0)
324
- ), C = W(() => [
325
- {
326
- label: l("connect.whatsappBot.accounts"),
327
- value: T["$connect-WHATSAPP_BOT"],
328
- badge: y.value.length
329
- },
330
- {
331
- label: l("connect.whatsappBot.settings"),
332
- value: T["$connect-WHATSAPP_BOT_SETTINGS"]
333
- }
334
- ]), w = W(
335
- () => n.currentRoute.value.name === T["$connect-WHATSAPP_BOT_SETTINGS"] ? T["$connect-WHATSAPP_BOT_SETTINGS"] : T["$connect-WHATSAPP_BOT"]
336
- );
337
- async function f(c = !1) {
338
- clearTimeout(x), u == null || u.abort();
339
- const o = new AbortController();
340
- u = o, c || (g.value = !0, p.value = "");
341
- try {
342
- const r = M.getBusinessId();
343
- if (!r)
344
- throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
345
- const m = await L.listClients(r, o.signal);
346
- o.signal.aborted || (i.value = m, p.value = "");
347
- } catch (r) {
348
- !o.signal.aborted && !c && (p.value = r instanceof Error ? r.message : l("connect.whatsappBot.errors.loadSessions"));
349
- } finally {
350
- o.signal.aborted || (g.value = !1, x = setTimeout(() => void f(!0), 1e4));
351
- }
352
- }
353
- const B = A(!1);
354
- function S(c) {
355
- (c === T["$connect-WHATSAPP_BOT"] || c === T["$connect-WHATSAPP_BOT_SETTINGS"]) && n.push({ name: c });
356
- }
357
- return O(B, (c) => {
358
- c || f();
359
- }), O(
360
- () => M.getBusinessId(),
361
- () => {
362
- B.value = !1, i.value = [], f();
363
- },
364
- { immediate: !0 }
365
- ), q(() => {
366
- u == null || u.abort(), clearTimeout(x);
367
- }), (c, o) => {
368
- const r = _("FmPill"), m = _("FmButton"), N = _("FmBadge"), j = _("FmTab"), P = _("FmTabs"), E = _("RouterView"), V = _("FmCircularProgress");
369
- return a(), d(U, null, [
370
- e("div", He, [
371
- e("div", Me, [
372
- e("div", Le, [
373
- e("h1", Ue, s(t(l)("connect.navigation.whatsappBot")), 1),
374
- h(r, { variant: "beta" })
375
- ]),
376
- w.value === t(T)["$connect-WHATSAPP_BOT"] && y.value.length ? (a(), $(m, {
377
- key: 0,
378
- label: t(l)("connect.whatsappBot.connectAccountCta"),
379
- "prepend-icon": "add",
380
- onClick: o[0] || (o[0] = (v) => B.value = !0)
381
- }, null, 8, ["label"])) : D("", !0)
382
- ]),
383
- h(P, {
384
- "model-value": w.value,
385
- items: C.value,
386
- role: "tablist",
387
- "aria-label": t(l)("connect.navigation.whatsappBot"),
388
- class: "mt-[16px] border-b border-fm-color-neutral-gray-100"
389
- }, {
390
- default: k(({ label: v, value: z, badge: R, tabsProps: Z }) => [
391
- h(j, K(Z, {
392
- "model-value": w.value,
393
- label: v,
394
- value: z,
395
- "onUpdate:modelValue": S
396
- }), X({ _: 2 }, [
397
- R ? {
398
- name: "append",
399
- fn: k(() => [
400
- h(N, {
401
- value: R,
402
- variant: "neutral",
403
- inline: "",
404
- class: "bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary"
405
- }, null, 8, ["value"])
406
- ]),
407
- key: "0"
408
- } : void 0
409
- ]), 1040, ["model-value", "label", "value"])
410
- ]),
411
- _: 1
412
- }, 8, ["model-value", "items", "aria-label"]),
413
- w.value === t(T)["$connect-WHATSAPP_BOT_SETTINGS"] ? (a(), $(E, { key: 0 })) : g.value ? (a(), d("div", Re, [
414
- h(V),
415
- H(" " + s(t(l)("connect.whatsappBot.loadingSessions")), 1)
416
- ])) : p.value ? (a(), d("div", Ge, [
417
- e("p", Qe, s(p.value), 1),
418
- h(m, {
419
- label: t(l)("connect.whatsappBot.tryAgain"),
420
- "prepend-icon": "refresh",
421
- onClick: o[1] || (o[1] = (v) => f())
422
- }, null, 8, ["label"])
423
- ])) : y.value.length ? (a(), $(de, {
424
- key: 3,
425
- accounts: y.value
426
- }, null, 8, ["accounts"])) : (a(), $(Oe, {
427
- key: 4,
428
- onConnect: o[2] || (o[2] = (v) => B.value = !0)
429
- }))
430
- ]),
431
- h(De, {
432
- modelValue: B.value,
433
- "onUpdate:modelValue": o[3] || (o[3] = (v) => B.value = v)
434
- }, null, 8, ["modelValue"])
435
- ], 64);
436
- };
437
- }
438
- });
439
- export {
440
- tt as default
441
- };