@feedmepos/mf-connect 0.1.98-beta.84 → 0.1.98-beta.85

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 (136) hide show
  1. package/README.md +9 -1
  2. package/dist/{App-2gK-7sDH.js → App-BxA547CP.js} +409 -403
  3. package/dist/{AuditLogs-DsvvAt8f.js → AuditLogs-DjsuO-ou.js} +13 -13
  4. package/dist/{Bin-f4C6ymIq.js → Bin-Cp1JuoPV.js} +8 -8
  5. package/dist/{Broadcast-tdqUBB_9.js → Broadcast-C-dZ7I7J.js} +12 -12
  6. package/dist/{CampaignAnalytic-BI7qfGV2.js → CampaignAnalytic-CeJrlblr.js} +7 -7
  7. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CGAIYHt6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DNshyt4k.js} +8 -8
  8. package/dist/{Card-CBU8ZOFT.js → Card-BRkDbHgP.js} +23 -23
  9. package/dist/{Collections-DWPcYM4M.js → Collections-KGkn4jVg.js} +8 -8
  10. package/dist/{Credit-Cq12WUk_.js → Credit-CYtdA8LR.js} +12 -12
  11. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-BwpYtfRw.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B_GGXmKj.js} +1 -1
  12. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-C7b6aFq3.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-CC84YrQj.js} +36 -35
  13. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-KkAGKKsV.js → EffectSheet.vue_vue_type_style_index_0_lang-Y8euxc9u.js} +6 -6
  14. package/dist/{Experience-BuIgMiB3.js → Experience-DyCWhTIc.js} +13 -13
  15. package/dist/{FileSaver.min-DS15uUce.js → FileSaver.min-sifwJvOC.js} +1 -1
  16. package/dist/{Game-_NIMd0cY.js → Game-D2dtBGMx.js} +13 -13
  17. package/dist/{GiftCardSetup-Bw_8x29B.js → GiftCardSetup-4_wPeuGx.js} +73 -61
  18. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B1sHLgFd.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DaXZiLCz.js} +7 -7
  19. package/dist/{Goals-BE_FaHh-.js → Goals-BZriqe6a.js} +4 -4
  20. package/dist/{Grab-CIIr5EZR.js → Grab-DE43gcBH.js} +9 -9
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-fg6xOcnj.js → ImageInput.vue_vue_type_script_setup_true_lang-BSmoRIp3.js} +1 -1
  22. package/dist/{Index-BiShzj-5.js → Index-3-__a-F8.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DQXs_qw9.js → LocationPicker.vue_vue_type_script_setup_true_lang-DMFmuJHS.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-B6NRhdWR.js → LottieAnimation.vue_vue_type_script_setup_true_lang-aCBsAVgf.js} +1 -1
  25. package/dist/{LoyaltyDashboard-B5AG4nLL.js → LoyaltyDashboard-BxqVkHWZ.js} +24 -23
  26. package/dist/MainLayout-VDwSL1-n.js +4 -0
  27. package/dist/{MainLayout-DxqoiKXJ.js → MainLayout.vue_vue_type_script_setup_true_lang-DKwbltBD.js} +4 -4
  28. package/dist/{Marketing-rtJPqmHZ.js → Marketing-BkTXd2kV.js} +4 -4
  29. package/dist/{MarketingMaterialEdit-DZbsKiMW.js → MarketingMaterialEdit-DCmGVhn1.js} +6 -6
  30. package/dist/{Member-B_4IU8GD.js → Member-BZ-cZyCC.js} +7 -7
  31. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CtQiWe15.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-DeRvNRsk.js} +24 -24
  32. package/dist/{MemberImportHistory-DepqkpDF.js → MemberImportHistory-CunTfazI.js} +7 -7
  33. package/dist/{MemberList-RbR2vpfv.js → MemberList-H8H9xzMg.js} +14 -14
  34. package/dist/{MemberTransactions-BXJy6Ism.js → MemberTransactions-B1GTs17R.js} +1 -1
  35. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-0OCCIP0v.js → MessageInput.vue_vue_type_script_setup_true_lang-C2K_acoB.js} +10 -10
  36. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-DnECpLmj.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-BCRSJoq7.js} +1 -1
  37. package/dist/{Mission-CMNVAn_S.js → Mission-CNXUBVI4.js} +14 -14
  38. package/dist/{Overview-C05OOSXQ.js → Overview-CiIMyx-_.js} +21 -21
  39. package/dist/{Overview-C-QEY2MS.js → Overview-CwoDIRXD.js} +4 -4
  40. package/dist/{Point-XEJSumy7.js → Point-BpFvqe5M.js} +14 -14
  41. package/dist/{Promotion-DfzE_BnO.js → Promotion-DwcxXXS3.js} +14 -14
  42. package/dist/{Queue-D4Td8Bgv.js → Queue-CI9PtRqs.js} +13 -13
  43. package/dist/{Record-DgkTuKc4.js → Record-Cl73WIoN.js} +9 -9
  44. package/dist/{Review-8ZMji0fb.js → Review-BQL9TzxZ.js} +2 -2
  45. package/dist/{ReviewFacebookCallback-Ve87-GyX.js → ReviewFacebookCallback-BVcW6zNJ.js} +5 -5
  46. package/dist/{ReviewGoogleCallback-DRpVe1uq.js → ReviewGoogleCallback-peKv_-nP.js} +5 -5
  47. package/dist/{Reward-CEhr7Ns0.js → Reward-6rLOoOkv.js} +16 -16
  48. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-w3QixigS.js → RewardGroup.vue_vue_type_script_setup_true_lang-CZ2OWRik.js} +14 -14
  49. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CnTY1iff.js → RuleGroup.vue_vue_type_script_setup_true_lang-B7GKzELx.js} +15 -15
  50. package/dist/{Segment-CeMerVn4.js → Segment-DnrCf_-F.js} +26 -26
  51. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CQ038K1l.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DyYWf2RR.js} +15 -15
  52. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-Cq5ywNFY.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-C-GxdVOH.js} +4 -4
  53. package/dist/{Setting-Rge2DsP0.js → Setting-BlU3XioB.js} +14 -14
  54. package/dist/{SettingAdvertisements-YXLfS10e.js → SettingAdvertisements-CW9KUQAk.js} +12 -12
  55. package/dist/{Settings-Cnp1yLCt.js → Settings-DfKCItWN.js} +5 -5
  56. package/dist/{Store-BqNd-YZA.js → Store-Dh90RjUg.js} +780 -771
  57. package/dist/{StoreRewards-CtFg932k.js → StoreRewards-BmEJZR1O.js} +15 -15
  58. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-DSLRZ4_T.js → StoreTransactions.vue_vue_type_script_setup_true_lang-C-Efc4SV.js} +25 -25
  59. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-ViE-riFl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Bv0_e1wk.js} +2 -2
  60. package/dist/{Tier-77bfKMw8.js → Tier-C7EiLGJW.js} +27 -27
  61. package/dist/{Title-ExsDsweT.js → Title-DPf-0vrF.js} +23 -23
  62. package/dist/{Transaction-rtSeIIw0.js → Transaction-DsAk9Gb9.js} +2 -2
  63. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-CRBQ9Fda.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Csojc1fI.js} +6 -6
  64. package/dist/{Voucher-BkZtSGlP.js → Voucher-BKp9CMMe.js} +18 -18
  65. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-4PYSnlPB.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Cpn8legF.js} +12 -12
  66. package/dist/WhatsappAccount-DjAL89Re.js +342 -0
  67. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D25DVRXA.js +97 -0
  68. package/dist/WhatsappBot-CSy_Z1bz.js +581 -0
  69. package/dist/{WhatsappBotSettings-BuKmIjV8.js → WhatsappBotSettings-CxcuCZ-V.js} +4 -4
  70. package/dist/WhatsappBotTickets-DS7_jaE3.js +162 -0
  71. package/dist/WhatsappLayout-Db3329On.js +21 -0
  72. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CZfhn5Jq.js → ZodTextField.vue_vue_type_script_setup_true_lang-D6Z-3QOR.js} +2 -2
  73. package/dist/{app-Bc6LqwtE.js → app-BiUEivOU.js} +316 -316
  74. package/dist/app.js +1 -1
  75. package/dist/{base.export-Btj8Rg8X.js → base.export-Bvf3GR9p.js} +2 -2
  76. package/dist/{business-D764zw_0.js → business-DgmJwclv.js} +5 -5
  77. package/dist/{campaign-BQup_7UA.js → campaign-C9TU71PO.js} +8 -8
  78. package/dist/{campaign-z0b9Kjkw.js → campaign-DxjYod5y.js} +2 -2
  79. package/dist/{campaign.fn-CFw7_K_I.js → campaign.fn-BGdwcW0r.js} +2 -2
  80. package/dist/{collection.fn-C4U4ilHh.js → collection.fn-B9t79SwE.js} +2 -2
  81. package/dist/{currency-ByFTp6eT.js → currency-K9kgZvJm.js} +1 -1
  82. package/dist/{duplicateCampaign-CbmUt1Lo.js → duplicateCampaign-CLeVibNm.js} +2 -2
  83. package/dist/{effect-DsO-mw9A.js → effect-Bj5p3FOF.js} +1 -1
  84. package/dist/{email-addresses-CL-EMr73.js → email-addresses-CUpmh5j3.js} +2 -2
  85. package/dist/feature-flag-Dfon0BoK.js +18 -0
  86. package/dist/{helper-Avy2CxJa.js → helper-iVOlqZr5.js} +1 -1
  87. package/dist/{index-QesgyoGt.js → index-BIqP1bQh.js} +2 -2
  88. package/dist/{index-BOX-kv2H.js → index-BRk5I8NE.js} +1 -1
  89. package/dist/{index-DJBDlwI0.js → index-C57WFxg7.js} +2 -2
  90. package/dist/{index-0iobnNos.js → index-C641kFzY.js} +1 -1
  91. package/dist/{index-CqHP5Wpq.js → index-CGctGLsw.js} +1 -1
  92. package/dist/{index-DUiP6eMM.js → index-COB25nai.js} +583 -576
  93. package/dist/{index-BYJfzCGF.js → index-CedoUPYn.js} +2 -2
  94. package/dist/index-Cfr0vxa5.js +1775 -0
  95. package/dist/{index-BaRq5efe.js → index-Cq0kWJ_W.js} +2 -2
  96. package/dist/{index-4Gb9FUwx.js → index-D6CbkBm6.js} +3 -3
  97. package/dist/{index-DLWc6jN6.js → index-DAcwqenP.js} +7 -7
  98. package/dist/{index-6kHtFMu_.js → index-DJQVYP1Z.js} +1 -1
  99. package/dist/{index-DIEsCZpR.js → index-DUr59xHS.js} +2 -2
  100. package/dist/{index-DKVgQIxK.js → index-DXNB9FHg.js} +2 -2
  101. package/dist/{index-DopAV1p0.js → index-DgkRREfK.js} +18 -14
  102. package/dist/{index-DV97WJgE.js → index-Dhd9eEjz.js} +1 -1
  103. package/dist/{index-C_ZRQxuy.js → index-FcdiLtUc.js} +9 -9
  104. package/dist/{index-Dw1JLMxf.js → index-HctLGyyi.js} +4 -4
  105. package/dist/{index-BwbjP4YO.js → index-MVfpQsRI.js} +4 -3
  106. package/dist/{index-BtlTdbMh.js → index-YV22ZWWA.js} +2 -2
  107. package/dist/{index-BGYPv4nh.js → index-dEfSQ43r.js} +1 -1
  108. package/dist/{index-BqBHO03o.js → index-onmieavP.js} +5975 -7746
  109. package/dist/{index.esm2017-6fTAB2zC.js → index.esm2017-BUZxOBD5.js} +1 -1
  110. package/dist/{loading-Ctv0pifD.js → loading-D3jN17Xy.js} +1 -1
  111. package/dist/{lodash-voP8B3y-.js → lodash-DvKbipfn.js} +1 -1
  112. package/dist/{member-import-Cnclh9kc.js → member-import-BuytQk0w.js} +1 -1
  113. package/dist/{membership-BFw22ljB.js → membership-Beh_I5Kj.js} +2 -2
  114. package/dist/{money-UKkYKlYB.js → money-C3v95tda.js} +1 -1
  115. package/dist/{number-C3ZVrlnG.js → number-Cc7Yq2nP.js} +1 -1
  116. package/dist/{objectid-cm0MpmhJ.js → objectid-fKMrrct7.js} +8 -8
  117. package/dist/{onboarding-DPlyVNxC.js → onboarding-DJgY8HJr.js} +3 -3
  118. package/dist/{onboardingSetup-DNxWR49X.js → onboardingSetup-DJJLdr11.js} +2 -2
  119. package/dist/{plugins-CmODURCb.js → plugins-CcGeLF_l.js} +3 -3
  120. package/dist/{reward-PFP-zWBV.js → reward-4aAVrRc8.js} +1 -1
  121. package/dist/{rule-O6gC43w9.js → rule-D6x2GyGw.js} +10 -10
  122. package/dist/{template-C3wE6QI8.js → template-Dafdx5YI.js} +6 -6
  123. package/dist/{timezone-h8QjEIVE.js → timezone-BDIlVTOp.js} +1 -1
  124. package/dist/{transaction.fn-CMLlNsBi.js → transaction.fn-CBVylmzu.js} +2 -2
  125. package/dist/{trigger-rwKj95on.js → trigger-ChNg0oG9.js} +5 -5
  126. package/dist/{useMarketingMaterialActions-DFhA_QMl.js → useMarketingMaterialActions-LSsbTrFn.js} +3 -3
  127. package/dist/{usePagination-DG6Ztr9a.js → usePagination-CqPRf6q3.js} +1 -1
  128. package/dist/{user-B8GnAjaS.js → user-6kqmEFbR.js} +1 -1
  129. package/dist/{vue-i18n-Bc5Ls0lk.js → vue-i18n-BJ_ZHWvK.js} +109 -109
  130. package/dist/{xlsx-CKvgpuVs.js → xlsx-CWXvmWqg.js} +1 -1
  131. package/dist/{zod-Bt021IY2.js → zod-DBefBbjY.js} +1 -1
  132. package/package.json +1 -1
  133. package/dist/WhatsappAccount-BHhjnuXB.js +0 -325
  134. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-DKFevg6y.js +0 -80
  135. package/dist/WhatsappBot-DDDfDb-u.js +0 -566
  136. package/dist/WhatsappBotTickets-D1fGYaRQ.js +0 -153
@@ -0,0 +1,342 @@
1
+ import { defineComponent as U, mergeModels as J, useModel as K, computed as E, ref as d, watch as M, onBeforeUnmount as S, resolveComponent as y, openBlock as i, createBlock as W, withCtx as P, createElementVNode as e, toDisplayString as a, unref as t, createElementBlock as c, createVNode as x, createTextVNode as T, Fragment as j, renderList as Q, createCommentVNode as A, normalizeClass as X } from "vue";
2
+ import { u as z } from "./vue-i18n-BJ_ZHWvK.js";
3
+ import { useRoute as Y } from "vue-router";
4
+ import { S as O, a as D } from "./index-Cfr0vxa5.js";
5
+ import { w as q } from "./index-Cq0kWJ_W.js";
6
+ import { u as H, _ as Z } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D25DVRXA.js";
7
+ import { b as ee } from "./browser-BSAOEeIM.js";
8
+ import { R as te } from "./app-BiUEivOU.js";
9
+ const oe = { class: "min-w-0 flex flex-col" }, ne = { class: "text-[18px] leading-[24px] font-semibold" }, ae = { class: "text-[13px] leading-[18px] text-fm-color-typo-secondary break-words" }, se = {
10
+ key: 0,
11
+ role: "status",
12
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
13
+ }, le = {
14
+ key: 1,
15
+ class: "py-[40px] flex flex-col items-center text-center gap-[16px]"
16
+ }, re = {
17
+ role: "alert",
18
+ class: "text-[14px] text-fm-color-typo-error"
19
+ }, ie = {
20
+ key: 2,
21
+ class: "grid grid-cols-[minmax(0,1fr)_226px] xs:grid-cols-1 gap-[32px] p-[8px] xs:p-[0px]"
22
+ }, ce = { class: "min-w-0 flex flex-col gap-[20px] text-[14px] leading-[20px]" }, pe = { class: "text-fm-color-typo-secondary" }, ue = { class: "flex flex-col gap-[10px]" }, de = { class: "text-[12px] leading-[16px] font-semibold uppercase tracking-[0.06em] text-fm-color-typo-secondary" }, fe = { class: "flex flex-col gap-[10px]" }, xe = { class: "flex flex-col gap-[6px]" }, me = {
23
+ id: "whatsapp-group-invite-link-label",
24
+ class: "font-medium text-fm-color-typo-secondary"
25
+ }, ve = { class: "flex items-center gap-[8px] border border-fm-color-neutral-gray-200 rounded-[8px] pl-[12px] pr-[4px] py-[4px]" }, he = {
26
+ id: "whatsapp-group-invite-link",
27
+ role: "textbox",
28
+ "aria-readonly": "true",
29
+ "aria-labelledby": "whatsapp-group-invite-link-label",
30
+ tabindex: "0",
31
+ class: "flex-1 min-w-0 h-[32px] overflow-x-auto overflow-y-hidden whitespace-nowrap text-[13px] leading-[32px] font-mono bg-fm-color-neutral-white rounded-[4px] focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary"
32
+ }, ge = ["disabled"], _e = {
33
+ key: 0,
34
+ role: "status",
35
+ class: "sr-only"
36
+ }, ye = {
37
+ key: 1,
38
+ role: "alert",
39
+ class: "text-[12px] leading-[16px] text-fm-color-typo-error"
40
+ }, be = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, we = { class: "flex flex-col items-center gap-[12px] w-[226px] xs:justify-self-center" }, Be = { class: "border border-fm-color-neutral-gray-100 rounded-[12px] overflow-hidden" }, ke = ["src", "alt"], $e = ["href"], Ge = /* @__PURE__ */ U({
41
+ __name: "WhatsappNotificationGroupDialog",
42
+ props: /* @__PURE__ */ J({
43
+ account: {}
44
+ }, {
45
+ modelValue: { type: Boolean, required: !0 },
46
+ modelModifiers: {}
47
+ }),
48
+ emits: ["update:modelValue"],
49
+ setup(L) {
50
+ const l = L, k = K(L, "modelValue"), { t: n } = z(), b = E(() => O.getBusinessId() ?? ""), { name: f, phoneNumber: C } = H(() => l.account), r = d(), m = d(""), F = d(!1), g = d(""), _ = d(!1), w = d(!1), B = d("");
51
+ let v, $;
52
+ function p() {
53
+ v == null || v.abort(), clearTimeout($), _.value = !1, w.value = !1;
54
+ }
55
+ async function G() {
56
+ p();
57
+ const s = new AbortController();
58
+ v = s, F.value = !0, g.value = "", B.value = "", r.value = void 0, m.value = "";
59
+ try {
60
+ if (!b.value)
61
+ throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
62
+ const o = await q.getNotificationGroup(
63
+ b.value,
64
+ l.account.clientId,
65
+ s.signal
66
+ );
67
+ if (s.signal.aborted) return;
68
+ const u = await ee.toDataURL(o.inviteLink, {
69
+ width: 224,
70
+ margin: 2,
71
+ errorCorrectionLevel: "M"
72
+ });
73
+ if (s.signal.aborted) return;
74
+ r.value = o, m.value = u;
75
+ } catch (o) {
76
+ if (s.signal.aborted) return;
77
+ o instanceof D && o.status === 409 ? g.value = n("connect.whatsappBot.notificationGroup.notReady") : o instanceof D && o.status === 404 ? g.value = n("connect.whatsappBot.errors.accountNotFound") : g.value = b.value ? n("connect.whatsappBot.errors.loadGroup") : n("connect.whatsappBot.errors.selectBusiness");
78
+ } finally {
79
+ s.signal.aborted || (F.value = !1);
80
+ }
81
+ }
82
+ async function I() {
83
+ if (!r.value || !v || w.value) return;
84
+ const s = v;
85
+ w.value = !0, _.value = !1, B.value = "", clearTimeout($);
86
+ try {
87
+ if (await navigator.clipboard.writeText(r.value.inviteLink), s.signal.aborted) return;
88
+ _.value = !0, $ = setTimeout(() => {
89
+ _.value = !1;
90
+ }, 2e3);
91
+ } catch {
92
+ s.signal.aborted || (B.value = n("connect.whatsappBot.errors.copyGroupLink"));
93
+ } finally {
94
+ s.signal.aborted || (w.value = !1);
95
+ }
96
+ }
97
+ return M(
98
+ [k, b, () => l.account.clientId],
99
+ ([s]) => {
100
+ s ? G() : p();
101
+ },
102
+ { immediate: !0 }
103
+ ), S(p), (s, o) => {
104
+ const u = y("FmCircularProgress"), N = y("FmButton"), R = y("FmIcon"), V = y("FmDialog");
105
+ return i(), W(V, {
106
+ modelValue: k.value,
107
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => k.value = h),
108
+ "min-width": "min(720px, calc(100% - 32px))",
109
+ "max-width": "720px",
110
+ "max-height": "90vh",
111
+ "dismiss-away": ""
112
+ }, {
113
+ "dialog-header": P(() => [
114
+ e("div", oe, [
115
+ e("h2", ne, a(t(n)("connect.whatsappBot.notificationGroup.dialogTitle")), 1),
116
+ e("p", ae, a(t(f)) + " · " + a(t(C)), 1)
117
+ ])
118
+ ]),
119
+ default: P(() => [
120
+ F.value ? (i(), c("div", se, [
121
+ x(u),
122
+ T(" " + a(t(n)("connect.whatsappBot.notificationGroup.loading")), 1)
123
+ ])) : g.value ? (i(), c("div", le, [
124
+ e("p", re, a(g.value), 1),
125
+ x(N, {
126
+ label: t(n)("connect.whatsappBot.tryAgain"),
127
+ "prepend-icon": "refresh",
128
+ onClick: G
129
+ }, null, 8, ["label"])
130
+ ])) : r.value ? (i(), c("div", ie, [
131
+ e("div", ce, [
132
+ e("p", pe, a(t(n)("connect.whatsappBot.notificationGroup.scanDescription")), 1),
133
+ e("div", ue, [
134
+ e("h3", de, a(t(n)("connect.whatsappBot.notificationGroup.postsTitle")), 1),
135
+ e("ul", fe, [
136
+ (i(), c(j, null, Q(["unanswered", "staffRequests", "humanRequests"], (h) => e("li", {
137
+ key: h,
138
+ class: "flex gap-[10px]"
139
+ }, [
140
+ o[1] || (o[1] = e("span", {
141
+ "aria-hidden": "true",
142
+ class: "w-[6px] h-[6px] rounded-full bg-fm-color-primary shrink-0 mt-[7px]"
143
+ }, null, -1)),
144
+ T(" " + a(t(n)(`connect.whatsappBot.notificationGroup.posts.${h}`)), 1)
145
+ ])), 64))
146
+ ])
147
+ ]),
148
+ e("div", xe, [
149
+ e("span", me, a(t(n)("connect.whatsappBot.notificationGroup.inviteLink")), 1),
150
+ e("div", ve, [
151
+ e("div", he, a(r.value.inviteLink), 1),
152
+ e("button", {
153
+ type: "button",
154
+ disabled: w.value,
155
+ class: "shrink-0 h-[32px] px-[12px] rounded-[6px] bg-fm-color-neutral-gray-100 text-[13px] font-semibold hover:bg-fm-color-neutral-gray-200 disabled:opacity-50 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary",
156
+ onClick: I
157
+ }, a(t(n)(
158
+ `connect.whatsappBot.notificationGroup.${_.value ? "copied" : "copy"}`
159
+ )), 9, ge)
160
+ ]),
161
+ _.value ? (i(), c("span", _e, a(t(n)("connect.whatsappBot.notificationGroup.copied")), 1)) : A("", !0),
162
+ B.value ? (i(), c("p", ye, a(B.value), 1)) : A("", !0),
163
+ e("p", be, a(t(n)("connect.whatsappBot.notificationGroup.shareNote")), 1)
164
+ ])
165
+ ]),
166
+ e("div", we, [
167
+ e("div", Be, [
168
+ e("img", {
169
+ src: m.value,
170
+ alt: t(n)("connect.whatsappBot.notificationGroup.qrAlt"),
171
+ width: "224",
172
+ height: "224"
173
+ }, null, 8, ke)
174
+ ]),
175
+ e("a", {
176
+ href: r.value.inviteLink,
177
+ target: "_blank",
178
+ rel: "noopener noreferrer",
179
+ class: "w-full h-[40px] flex items-center justify-center gap-[6px] rounded-full bg-fm-color-primary text-fm-color-typo-white text-[14px] font-semibold no-underline hover:opacity-90 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary focus-visible:ring-offset-[2px]"
180
+ }, [
181
+ T(a(t(n)("connect.whatsappBot.notificationGroup.openWhatsapp")) + " ", 1),
182
+ x(R, {
183
+ name: "open_in_new",
184
+ size: "sm"
185
+ })
186
+ ], 8, $e)
187
+ ])
188
+ ])) : A("", !0)
189
+ ]),
190
+ _: 1
191
+ }, 8, ["modelValue"]);
192
+ };
193
+ }
194
+ }), Ce = { class: "px-[24px] xs:px-[12px] pt-[20px] pb-[40px] text-fm-color-typo-primary" }, Fe = { class: "w-full flex flex-col gap-[24px]" }, Ie = {
195
+ key: 0,
196
+ role: "status",
197
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
198
+ }, Te = {
199
+ key: 1,
200
+ class: "border border-fm-color-neutral-gray-200 rounded-[16px] px-[24px] py-[56px] flex flex-col items-center text-center gap-[16px]"
201
+ }, Ae = {
202
+ role: "alert",
203
+ class: "text-[14px] text-fm-color-typo-error"
204
+ }, Ve = { class: "flex items-center gap-[16px]" }, Le = ["src"], Ne = { key: 1 }, Re = { class: "min-w-0 flex-1 flex flex-col gap-[2px]" }, Ee = { class: "text-[24px] leading-[32px] font-semibold tracking-[-0.01em] break-words" }, Pe = { class: "flex items-center gap-[10px] flex-wrap text-[14px] text-fm-color-typo-secondary" }, je = { class: "break-all" }, De = {
205
+ "aria-labelledby": "notification-group-title",
206
+ class: "border border-fm-color-neutral-gray-100 rounded-[16px] p-[24px] xs:p-[20px] flex items-center gap-[16px] flex-wrap"
207
+ }, Ue = {
208
+ "aria-hidden": "true",
209
+ class: "w-[40px] h-[40px] rounded-[8px] shrink-0 self-start bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center"
210
+ }, Me = { class: "min-w-[240px] xs:min-w-0 flex-1 flex flex-col gap-[4px]" }, Se = {
211
+ id: "notification-group-title",
212
+ class: "text-[16px] leading-[24px] font-semibold"
213
+ }, We = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ U({
214
+ __name: "WhatsappAccount",
215
+ setup(L) {
216
+ const { t: l } = z(), k = Y(), n = E(() => O.getBusinessId() ?? ""), b = E(
217
+ () => typeof k.params.clientId == "string" ? k.params.clientId : ""
218
+ ), f = d(), C = d(!0), r = d(""), m = d(!1), {
219
+ name: F,
220
+ phoneNumber: g,
221
+ initials: _,
222
+ state: w,
223
+ avatarColor: B,
224
+ profilePictureUrl: v,
225
+ profilePictureFailed: $
226
+ } = H(f);
227
+ let p, G;
228
+ async function I(s = !1) {
229
+ clearTimeout(G), p == null || p.abort();
230
+ const o = new AbortController();
231
+ p = o, s || (C.value = !0, r.value = "");
232
+ try {
233
+ if (!n.value)
234
+ throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
235
+ const u = await q.getClient(
236
+ n.value,
237
+ b.value,
238
+ o.signal
239
+ );
240
+ if (o.signal.aborted) return;
241
+ f.value = u, r.value = "";
242
+ } catch (u) {
243
+ if (o.signal.aborted) return;
244
+ u instanceof D && u.status === 404 ? (m.value = !1, f.value = void 0, r.value = l("connect.whatsappBot.errors.accountNotFound")) : s || (r.value = n.value ? l("connect.whatsappBot.errors.loadAccount") : l("connect.whatsappBot.errors.selectBusiness"));
245
+ } finally {
246
+ o.signal.aborted || (C.value = !1, f.value && (G = setTimeout(() => void I(!0), 1e4)));
247
+ }
248
+ }
249
+ return M(
250
+ [n, b],
251
+ () => {
252
+ m.value = !1, f.value = void 0, I();
253
+ },
254
+ { immediate: !0 }
255
+ ), S(() => {
256
+ p == null || p.abort(), clearTimeout(G);
257
+ }), (s, o) => {
258
+ const u = y("FmIcon"), N = y("RouterLink"), R = y("FmCircularProgress"), V = y("FmButton");
259
+ return i(), c(j, null, [
260
+ e("div", Ce, [
261
+ e("div", Fe, [
262
+ x(N, {
263
+ to: { name: t(te)["$connect-WHATSAPP_BOT"] },
264
+ class: "self-start flex items-center gap-[4px] h-[32px] pl-[6px] pr-[10px] -ml-[6px] rounded-[8px] text-[14px] font-medium text-fm-color-typo-secondary no-underline hover:bg-fm-color-neutral-gray-100 hover:text-fm-color-typo-primary focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary"
265
+ }, {
266
+ default: P(() => [
267
+ x(u, {
268
+ name: "chevron_left",
269
+ size: "sm"
270
+ }),
271
+ T(" " + a(t(l)("connect.navigation.whatsappBot")), 1)
272
+ ]),
273
+ _: 1
274
+ }, 8, ["to"]),
275
+ C.value ? (i(), c("div", Ie, [
276
+ x(R),
277
+ T(" " + a(t(l)("connect.whatsappBot.loadingAccount")), 1)
278
+ ])) : r.value ? (i(), c("div", Te, [
279
+ e("p", Ae, a(r.value), 1),
280
+ x(V, {
281
+ label: t(l)("connect.whatsappBot.tryAgain"),
282
+ "prepend-icon": "refresh",
283
+ onClick: o[0] || (o[0] = (h) => I())
284
+ }, null, 8, ["label"])
285
+ ])) : f.value ? (i(), c(j, { key: 2 }, [
286
+ e("div", Ve, [
287
+ e("div", {
288
+ "aria-hidden": "true",
289
+ class: X(["w-[56px] h-[56px] rounded-full overflow-hidden shrink-0 flex items-center justify-center text-[18px] font-semibold text-fm-color-typo-white", t(B)])
290
+ }, [
291
+ t(v) && !t($) ? (i(), c("img", {
292
+ key: 0,
293
+ src: t(v),
294
+ alt: "",
295
+ class: "w-full h-full object-cover",
296
+ referrerpolicy: "no-referrer",
297
+ onError: o[1] || (o[1] = (h) => $.value = !0)
298
+ }, null, 40, Le)) : (i(), c("span", Ne, a(t(_)), 1))
299
+ ], 2),
300
+ e("div", Re, [
301
+ e("h1", Ee, a(t(F)), 1),
302
+ e("div", Pe, [
303
+ e("span", je, a(t(g)), 1),
304
+ x(Z, { state: t(w) }, null, 8, ["state"])
305
+ ])
306
+ ])
307
+ ]),
308
+ e("section", De, [
309
+ e("div", Ue, [
310
+ x(u, {
311
+ name: "notifications",
312
+ size: "md"
313
+ })
314
+ ]),
315
+ e("div", Me, [
316
+ e("h2", Se, a(t(l)("connect.whatsappBot.notificationGroup.title")), 1),
317
+ e("p", We, a(t(l)("connect.whatsappBot.notificationGroup.description")), 1)
318
+ ]),
319
+ x(V, {
320
+ variant: "secondary",
321
+ label: t(l)("connect.whatsappBot.notificationGroup.join"),
322
+ "prepend-icon": "group",
323
+ class: "shrink-0",
324
+ onClick: o[2] || (o[2] = (h) => m.value = !0)
325
+ }, null, 8, ["label"])
326
+ ])
327
+ ], 64)) : A("", !0)
328
+ ])
329
+ ]),
330
+ f.value ? (i(), W(Ge, {
331
+ key: 0,
332
+ modelValue: m.value,
333
+ "onUpdate:modelValue": o[3] || (o[3] = (h) => m.value = h),
334
+ account: f.value
335
+ }, null, 8, ["modelValue", "account"])) : A("", !0)
336
+ ], 64);
337
+ };
338
+ }
339
+ });
340
+ export {
341
+ Ye as default
342
+ };
@@ -0,0 +1,97 @@
1
+ import { computed as c, toValue as w, ref as A, watch as _, defineComponent as B, openBlock as C, createElementBlock as N, normalizeClass as f, createElementVNode as S, createTextVNode as V, toDisplayString as I, unref as L } from "vue";
2
+ import { u as g } from "./vue-i18n-BJ_ZHWvK.js";
3
+ function P(s) {
4
+ const n = s.connectedAt !== null;
5
+ switch (s.status) {
6
+ case "connected":
7
+ return "connected";
8
+ case "disconnected":
9
+ return n ? "disconnected" : void 0;
10
+ case "connecting":
11
+ return n ? "connecting" : void 0;
12
+ }
13
+ }
14
+ const b = [
15
+ "bg-fm-color-primary",
16
+ "bg-fm-color-secondary-plum",
17
+ "bg-fm-color-system-success-400"
18
+ ];
19
+ function E(s) {
20
+ const { t: n, locale: r } = g(), t = c(() => w(s)), a = c(
21
+ () => {
22
+ var e, o, l;
23
+ return (l = (o = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : o.profilePicture) == null ? void 0 : l.url;
24
+ }
25
+ ), p = A(!1);
26
+ _(a, () => {
27
+ p.value = !1;
28
+ });
29
+ const u = c(
30
+ () => {
31
+ var e, o, l, i, m, d;
32
+ return ((o = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : o.businessName) || ((i = (l = t.value) == null ? void 0 : l.account) == null ? void 0 : i.name) || ((d = (m = t.value) == null ? void 0 : m.account) == null ? void 0 : d.phoneNumber) || n("connect.whatsappBot.unnamedAccount");
33
+ }
34
+ ), h = c(
35
+ () => {
36
+ var e, o;
37
+ return ((o = (e = t.value) == null ? void 0 : e.account) == null ? void 0 : o.phoneNumber) || n("connect.whatsappBot.phoneUnavailable");
38
+ }
39
+ ), v = c(
40
+ () => u.value.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]).join("").toLocaleUpperCase(r.value)
41
+ ), y = c(
42
+ () => t.value ? P(t.value) ?? "disconnected" : "disconnected"
43
+ ), x = c(
44
+ () => {
45
+ var e;
46
+ return b[parseInt(((e = t.value) == null ? void 0 : e.clientId.slice(-6)) ?? "0", 16) % b.length];
47
+ }
48
+ );
49
+ return {
50
+ name: u,
51
+ phoneNumber: h,
52
+ initials: v,
53
+ state: y,
54
+ avatarColor: x,
55
+ profilePictureUrl: a,
56
+ profilePictureFailed: p
57
+ };
58
+ }
59
+ const O = /* @__PURE__ */ B({
60
+ __name: "WhatsappAccountStatusLabel",
61
+ props: {
62
+ state: {}
63
+ },
64
+ setup(s) {
65
+ const n = s, { t: r } = g(), t = {
66
+ connected: {
67
+ label: "connect.whatsappBot.connected",
68
+ pill: "text-fm-color-typo-success bg-fm-color-system-success-100",
69
+ dot: "bg-fm-color-system-success-400"
70
+ },
71
+ disconnected: {
72
+ label: "connect.whatsappBot.disconnected",
73
+ pill: "text-fm-color-typo-error bg-fm-color-system-error-100",
74
+ dot: "bg-fm-color-system-error-400"
75
+ },
76
+ connecting: {
77
+ label: "connect.whatsappBot.statusConnecting",
78
+ pill: "text-fm-color-typo-warning bg-fm-color-system-warning-100",
79
+ dot: "bg-fm-color-system-warning-400"
80
+ }
81
+ }, a = c(() => t[n.state]);
82
+ return (p, u) => (C(), N("span", {
83
+ class: f(["flex items-center gap-[6px] text-[12px] font-semibold px-[8px] py-[3px] rounded-[6px]", a.value.pill])
84
+ }, [
85
+ S("span", {
86
+ "aria-hidden": "true",
87
+ class: f(["w-[6px] h-[6px] rounded-full", a.value.dot])
88
+ }, null, 2),
89
+ V(" " + I(L(r)(a.value.label)), 1)
90
+ ], 2));
91
+ }
92
+ });
93
+ export {
94
+ O as _,
95
+ E as u,
96
+ P as w
97
+ };