@feedmepos/mf-connect 0.1.98-beta.8 → 0.1.98-beta.80

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 (167) hide show
  1. package/dist/{App-DsB2o1oB.js → App-DievprEi.js} +853 -683
  2. package/dist/{AuditLogs-BcfgiYnJ.js → AuditLogs-DrdqOhZL.js} +16 -13
  3. package/dist/{Bin-DMr7K8Kj.js → Bin-Ci2k3z77.js} +8 -8
  4. package/dist/Broadcast-CpDMAG1o.js +306 -0
  5. package/dist/CampaignAnalytic-uRyGaLaN.js +1830 -0
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CwGoEBsW.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-DtGe2Og1.js} +8 -5
  7. package/dist/Card-tb98Kyr-.js +1086 -0
  8. package/dist/{Collections-B0uGC2FE.js → Collections-P1S5WjnJ.js} +14 -13
  9. package/dist/Credit-DwK7JYf-.js +286 -0
  10. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-Cyk0iIsd.js +53 -0
  11. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-8r29jKh9.js +4432 -0
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-DJLxGk7W.js → EffectSheet.vue_vue_type_style_index_0_lang-BML_-v8I.js} +36 -36
  13. package/dist/Experience-BejtRlOj.js +288 -0
  14. package/dist/{FileSaver.min-BlA0oZEC.js → FileSaver.min-C-hmBaHm.js} +1 -1
  15. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-3bH-tZAm.js +138 -0
  16. package/dist/Game-n8qL896g.js +356 -0
  17. package/dist/GiftCardSetup-Bgsfcu7N.js +736 -0
  18. package/dist/GoalPickerPanel.vue_vue_type_script_setup_true_lang-CzL68PPP.js +424 -0
  19. package/dist/Goals-BB8LJlq3.js +247 -0
  20. package/dist/{Grab-DmmwrGzk.js → Grab-COq3Ujst.js} +33 -32
  21. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-DNtLW0yQ.js → ImageInput.vue_vue_type_script_setup_true_lang-BmLclEyi.js} +1 -1
  22. package/dist/{Index-m7l4insz.js → Index-BdkIinaE.js} +10 -10
  23. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-B9sJ-M20.js → LocationPicker.vue_vue_type_script_setup_true_lang-DsWv3DVb.js} +1 -1
  24. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Dsg2sWjF.js → LottieAnimation.vue_vue_type_script_setup_true_lang-DvOzGF8c.js} +1 -1
  25. package/dist/LoyaltyDashboard-D4Jtpw0n.js +2911 -0
  26. package/dist/MainLayout-Ca-Xm3eZ.js +143 -0
  27. package/dist/{Marketing-C9pSIdBU.js → Marketing-Cpe4s7NZ.js} +7 -6
  28. package/dist/{MarketingMaterialEdit-BEF2T9LR.js → MarketingMaterialEdit-nTeS9VVx.js} +15 -14
  29. package/dist/Member-DgGZ4Cdg.js +654 -0
  30. package/dist/MemberDetailSheet.vue_vue_type_script_setup_true_lang-_O3B-FIA.js +1281 -0
  31. package/dist/MemberImportHistory-rdlbDVWU.js +187 -0
  32. package/dist/MemberList-BC4aRJTt.js +334 -0
  33. package/dist/{MemberTransactions-CAut1TQb.js → MemberTransactions-BFfdTttp.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-1AuHixPC.js → MessageInput.vue_vue_type_script_setup_true_lang-DXajAQy9.js} +5928 -5644
  35. package/dist/MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8xVDzdO3.js +40 -0
  36. package/dist/Mission-BWCNKTjU.js +363 -0
  37. package/dist/Overview--Q7vzhNK.js +1316 -0
  38. package/dist/{Overview-DOJj4XvO.js → Overview-i02Wnyjn.js} +23 -20
  39. package/dist/Point-CiWxqny5.js +297 -0
  40. package/dist/Promotion-B0G9qfBm.js +426 -0
  41. package/dist/{Queue-55G2gtP5.js → Queue-YfwgYmzH.js} +16 -13
  42. package/dist/{Record-DNPI02c6.js → Record-CCuwrPKW.js} +9 -9
  43. package/dist/Review-ymsfdh7Q.js +45 -0
  44. package/dist/ReviewFacebookCallback-DyDExWvP.js +238 -0
  45. package/dist/ReviewGoogleCallback-DNyg3n2S.js +213 -0
  46. package/dist/{Reward-CnP8R2pS.js → Reward-BKIb0ezH.js} +28 -28
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BN71h9IK.js → RewardGroup.vue_vue_type_script_setup_true_lang-DPaaNgpr.js} +26 -23
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-CtB9Ls5-.js → RuleGroup.vue_vue_type_script_setup_true_lang-BLFLybFn.js} +198 -186
  49. package/dist/{Segment-CxiQnnyj.js → Segment-D5_pp7fh.js} +278 -276
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-B1vj5f7T.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-BLLjIA-D.js} +45 -42
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-cWx0G3nM.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-BRIcZwnU.js} +4 -4
  52. package/dist/Setting-CD78gIMU.js +574 -0
  53. package/dist/{SettingAdvertisements-Vt7w1WN3.js → SettingAdvertisements-C2AIT4s4.js} +12 -12
  54. package/dist/Settings-DI_tryQV.js +230 -0
  55. package/dist/Store-BV2JTRNZ.js +2615 -0
  56. package/dist/{StoreRewards-DILeipMG.js → StoreRewards-Bk55YXyO.js} +15 -15
  57. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-BZZ1fqwg.js +1331 -0
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-C7lVeybl.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-BrEzWVrH.js} +2 -2
  59. package/dist/{Tier-BAZ1xuKL.js → Tier-CO2K30Ew.js} +2576 -757
  60. package/dist/{Title-CcNAt47f.js → Title-qProQh3T.js} +41 -37
  61. package/dist/Transaction-qL5L-fE_.js +45 -0
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-hUjQVZ_U.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Co1BPScS.js} +26 -26
  63. package/dist/Voucher-VFD1LY9Y.js +837 -0
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-CTQDxc5l.js → VoucherEditor.vue_vue_type_script_setup_true_lang-9QyTl7iq.js} +118 -124
  65. package/dist/WhatsappAccount-CxSGqm7H.js +325 -0
  66. package/dist/WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js +96 -0
  67. package/dist/WhatsappBot-C4Oz7Xwv.js +441 -0
  68. package/dist/WhatsappBotSettings-CKqaWzwE.js +136 -0
  69. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-DuRKA4cj.js → ZodTextField.vue_vue_type_script_setup_true_lang-Bcsi94dw.js} +2 -2
  70. package/dist/{app-Z-UKRG5V.js → app-BEYzXWZO.js} +50954 -42517
  71. package/dist/app.js +1 -1
  72. package/dist/base.export-S_82Elmg.js +75 -0
  73. package/dist/browser-BSAOEeIM.js +1478 -0
  74. package/dist/{business-C7EF6cKC.js → business-DH7djUl8.js} +5 -5
  75. package/dist/campaign-DlHDgoFX.js +100 -0
  76. package/dist/campaign-k_WHxsOR.js +400 -0
  77. package/dist/{campaign.enum-BNN2gLFY.js → campaign.enum-Dx-Zo68Q.js} +1 -1
  78. package/dist/{campaign.fn-Bd34dVnx.js → campaign.fn-B-4JRzft.js} +67 -67
  79. package/dist/{collectible.enum-DO9HdJGH.js → collectible.enum-Liy2wH3s.js} +1 -1
  80. package/dist/collection.fn-zQwWDzZT.js +26 -0
  81. package/dist/currency-CQVHXBFe.js +7 -0
  82. package/dist/{duplicateCampaign-2ODeDw3a.js → duplicateCampaign-YTXMbJTj.js} +11 -11
  83. package/dist/{effect-BcB8IlTI.js → effect-CQkVLHWi.js} +1 -1
  84. package/dist/{email-addresses-BcTeU4Sh.js → email-addresses-BIoVbPGC.js} +209 -201
  85. package/dist/google-C3S8u0mT.js +4 -0
  86. package/dist/{helper-BSgrCJRv.js → helper-BCkTvF4m.js} +1 -1
  87. package/dist/{index-CoHWpylO.js → index-B-bQnb0_.js} +2115 -2557
  88. package/dist/index-BAJOC43K.js +14550 -0
  89. package/dist/{index-HXiYGO4_.js → index-BFIHEBnX.js} +6343 -7693
  90. package/dist/{index-VlFWaBrg.js → index-BJIQe3QJ.js} +1 -1
  91. package/dist/{index-BpI-BI4H.js → index-BJkRTH5T.js} +4 -4
  92. package/dist/index-BOJogkKQ.js +172 -0
  93. package/dist/{index-BoYEqLif.js → index-BRPajAkE.js} +1517 -263
  94. package/dist/{index-CsoBDon4.js → index-BTkxgos0.js} +1590 -1523
  95. package/dist/index-BUP4aHq8.js +32438 -0
  96. package/dist/index-BYvnqARr.js +902 -0
  97. package/dist/{index-hlyg-wxV.js → index-Bonq819P.js} +1 -1
  98. package/dist/{index-CIBPhxlC.js → index-C6mOI2Pp.js} +105 -123
  99. package/dist/{index-Bf6jNZit.js → index-CDIe15AY.js} +24 -9
  100. package/dist/index-CTrcdIkt.js +137 -0
  101. package/dist/index-C_H8jFYf.js +2743 -0
  102. package/dist/index-CpnchVe1.js +74 -0
  103. package/dist/index-D5AR7A5e.js +151 -0
  104. package/dist/index-D7-Q86HI.js +54 -0
  105. package/dist/index-DdOj8Hew.js +53 -0
  106. package/dist/{index-iMPtFp54.js → index-Dvqguh2B.js} +10 -9
  107. package/dist/{index-Bm0QPucw.js → index-hAKRfE-4.js} +14 -14
  108. package/dist/index-o2Ga_qaX.js +39 -0
  109. package/dist/{index.esm2017-CM7OnEyP.js → index.esm2017-D0fhMMPG.js} +128 -128
  110. package/dist/{loading-CSXr0Yqz.js → loading-C686AMVG.js} +1 -1
  111. package/dist/{lodash-Bh7XKI-R.js → lodash-CANlWUWW.js} +1 -1
  112. package/dist/member-import-UzJ6ByIS.js +188 -0
  113. package/dist/membership-DCVzFaFy.js +274 -0
  114. package/dist/{money-BZIST_m9.js → money-DuazwoX7.js} +1 -1
  115. package/dist/{number-DXLR2w95.js → number-B2HFiV0g.js} +1 -1
  116. package/dist/objectid-Bq-oVMdP.js +145 -0
  117. package/dist/onboarding-BxvNxz-9.js +131 -0
  118. package/dist/onboardingSetup-CcvKmyx8.js +17 -0
  119. package/dist/{plugins-4FlbwoES.js → plugins-C39O5j42.js} +13 -12
  120. package/dist/remy-Qz_pNsUS.js +13 -0
  121. package/dist/{reward-DUbl79bZ.js → reward-HYt-2nxt.js} +1 -1
  122. package/dist/{rule-BQUoZ4l_.js → rule-3xNIYM7z.js} +337 -275
  123. package/dist/style.css +1 -1
  124. package/dist/{template-BoiSG7G7.js → template-D37Z_b0m.js} +6 -6
  125. package/dist/timezone-JwnQgpaU.js +20 -0
  126. package/dist/transaction.fn-C5vswLI_.js +71 -0
  127. package/dist/{trigger-D5g5m6tT.js → trigger-Bc6s2cvq.js} +17 -17
  128. package/dist/useMarketingMaterialActions-DMGyAXcy.js +96 -0
  129. package/dist/{usePagination-DHePBBoR.js → usePagination-DLOOwiiY.js} +1 -1
  130. package/dist/{user-C_ToSo-g.js → user-CTIGugVF.js} +1 -1
  131. package/dist/{vue-i18n-BcYh6_51.js → vue-i18n-Dpic36zz.js} +287 -287
  132. package/dist/{xlsx-h4G1C-xj.js → xlsx-CT9_1SFr.js} +786 -786
  133. package/dist/{zod-CgigfJar.js → zod-CGVrMcDl.js} +1 -1
  134. package/package.json +10 -6
  135. package/dist/Broadcast-C9akM-TB.js +0 -266
  136. package/dist/Card-DRkIYs0M.js +0 -910
  137. package/dist/Credit-V5YA_hGx.js +0 -260
  138. package/dist/DateRangeChip.vue_vue_type_script_setup_true_lang-eIoPtgO5.js +0 -58
  139. package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-CYQMXARx.js +0 -3377
  140. package/dist/Experience-WTWy5yY6.js +0 -259
  141. package/dist/FilterChip.vue_vue_type_script_setup_true_lang-DaU-9GzO.js +0 -129
  142. package/dist/Game-BwOfTCW5.js +0 -330
  143. package/dist/LoyaltyDashboard-CJdhYiea.js +0 -1082
  144. package/dist/MainLayout-Du5kZOtA.js +0 -41
  145. package/dist/Member-DUV_vbPI.js +0 -280
  146. package/dist/MemberList-Ye4nOk-i.js +0 -1601
  147. package/dist/Mission-BBmCGpt8.js +0 -334
  148. package/dist/Point-Bzg6hi6o.js +0 -262
  149. package/dist/Promotion-BMXIp_ef.js +0 -397
  150. package/dist/Review-CYNPPxYU.js +0 -1141
  151. package/dist/ReviewFacebookCallback-0SUkKAaC.js +0 -243
  152. package/dist/ReviewGoogleCallback-BZEzx68n.js +0 -208
  153. package/dist/SelectItems.vue_vue_type_script_setup_true_lang-C4vohf6c.js +0 -181
  154. package/dist/Setting-jHAjccod.js +0 -2047
  155. package/dist/Store-Cu-hKmVa.js +0 -1996
  156. package/dist/StoreTransactions.vue_vue_type_script_setup_true_lang-CGz6CTWA.js +0 -1130
  157. package/dist/Transaction-D7DO3dKQ.js +0 -39
  158. package/dist/Voucher-Cq-n1CaC.js +0 -421
  159. package/dist/campaign--MjoY1Mn.js +0 -219
  160. package/dist/campaign-DHBuP4UA.js +0 -277
  161. package/dist/export-CjB7qxZ9.js +0 -97
  162. package/dist/index-BIAjmMga.js +0 -85
  163. package/dist/index-Bv4MBLQ5.js +0 -52
  164. package/dist/index-hbyCVNa7.js +0 -30289
  165. package/dist/membership-CfredTm3.js +0 -255
  166. package/dist/objectid-Dg4ZodlT.js +0 -145
  167. package/dist/useMarketingMaterialActions-B-Jlw2Z9.js +0 -107
@@ -0,0 +1,441 @@
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-Dpic36zz.js";
3
+ import { useRouter as Y } from "vue-router";
4
+ import { S as M } from "./index-BUP4aHq8.js";
5
+ import { w as L } from "./index-D7-Q86HI.js";
6
+ import { u as ee, _ as te, w as oe } from "./WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-D8L6izf0.js";
7
+ import { R as T } from "./app-BEYzXWZO.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
+ };
@@ -0,0 +1,136 @@
1
+ import { defineComponent as j, computed as C, ref as l, watch as F, onBeforeUnmount as D, resolveComponent as b, openBlock as c, createElementBlock as u, createVNode as v, createTextVNode as T, toDisplayString as f, unref as n, Fragment as H, createElementVNode as _, createCommentVNode as h, createBlock as L } from "vue";
2
+ import { u as O } from "./vue-i18n-Dpic36zz.js";
3
+ import { F as z } from "./index-o2Ga_qaX.js";
4
+ import { S as G } from "./index-BUP4aHq8.js";
5
+ import { w as A } from "./index-D7-Q86HI.js";
6
+ import { _ as M } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
+ const R = { class: "mt-[24px] max-w-[720px] flex flex-col gap-[20px]" }, X = {
8
+ key: 0,
9
+ role: "status",
10
+ class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
11
+ }, J = {
12
+ key: 0,
13
+ class: "border-[1px] border-fm-color-neutral-gray-100 rounded-[16px] p-[24px] flex flex-col gap-[16px]"
14
+ }, K = { class: "flex flex-col gap-[4px]" }, Q = { class: "text-[16px] leading-[24px] font-semibold" }, Y = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary" }, Z = {
15
+ key: 1,
16
+ role: "alert",
17
+ class: "text-[14px] text-fm-color-typo-error"
18
+ }, $ = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, q = {
19
+ key: 0,
20
+ role: "status",
21
+ class: "mr-auto flex items-center gap-[6px] text-[14px] text-fm-color-typo-success"
22
+ }, ee = /* @__PURE__ */ j({
23
+ __name: "WhatsappBotSettings",
24
+ setup(te) {
25
+ const { t } = O(), g = C(() => G.getBusinessId() ?? ""), s = l(""), p = l(""), y = l(!0), d = l(!1), r = l(!1), i = l(""), x = l(!1), B = z, w = C(
26
+ () => !d.value || r.value || s.value === p.value || s.value.length > B
27
+ );
28
+ let o, I;
29
+ function m() {
30
+ clearTimeout(I), x.value = !1;
31
+ }
32
+ async function k() {
33
+ o == null || o.abort(), m();
34
+ const a = new AbortController();
35
+ o = a, y.value = !0, d.value = !1, r.value = !1, i.value = "", s.value = "", p.value = "";
36
+ try {
37
+ if (!g.value)
38
+ throw new Error(t("connect.whatsappBot.errors.selectBusiness"));
39
+ const e = await A.getSettings(
40
+ g.value,
41
+ a.signal
42
+ );
43
+ if (a.signal.aborted) return;
44
+ s.value = e.botInstructions, p.value = e.botInstructions, d.value = !0;
45
+ } catch (e) {
46
+ a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.loadSettings"));
47
+ } finally {
48
+ a.signal.aborted || (y.value = !1);
49
+ }
50
+ }
51
+ async function N() {
52
+ if (w.value) return;
53
+ o == null || o.abort();
54
+ const a = new AbortController();
55
+ o = a, r.value = !0, i.value = "", m();
56
+ try {
57
+ const e = await A.saveSettings(
58
+ g.value,
59
+ { botInstructions: s.value },
60
+ a.signal
61
+ );
62
+ if (a.signal.aborted) return;
63
+ p.value = e.botInstructions, s.value = e.botInstructions, x.value = !0, I = setTimeout(() => {
64
+ x.value = !1;
65
+ }, 2500);
66
+ } catch (e) {
67
+ a.signal.aborted || (i.value = e instanceof Error ? e.message : t("connect.whatsappBot.errors.saveSettings"));
68
+ } finally {
69
+ a.signal.aborted || (r.value = !1);
70
+ }
71
+ }
72
+ function V() {
73
+ s.value = p.value, m();
74
+ }
75
+ return F(s, m, { flush: "sync" }), F(g, k, { immediate: !0 }), D(() => {
76
+ o == null || o.abort(), m();
77
+ }), (a, e) => {
78
+ const E = b("FmCircularProgress"), P = b("FmTextarea"), S = b("FmButton"), U = b("FmIcon");
79
+ return c(), u("div", R, [
80
+ y.value ? (c(), u("div", X, [
81
+ v(E),
82
+ T(" " + f(n(t)("connect.whatsappBot.botSettings.loading")), 1)
83
+ ])) : (c(), u(H, { key: 1 }, [
84
+ d.value ? (c(), u("div", J, [
85
+ _("div", K, [
86
+ _("h2", Q, f(n(t)("connect.whatsappBot.botSettings.instructions")), 1),
87
+ _("p", Y, f(n(t)("connect.whatsappBot.botSettings.description")), 1)
88
+ ]),
89
+ v(P, {
90
+ modelValue: s.value,
91
+ "onUpdate:modelValue": e[0] || (e[0] = (W) => s.value = W),
92
+ "aria-label": n(t)("connect.whatsappBot.botSettings.instructions"),
93
+ placeholder: n(t)("connect.whatsappBot.botSettings.placeholder"),
94
+ "max-length": n(B),
95
+ disabled: r.value,
96
+ "show-word-count": "",
97
+ class: "bot-instructions-textarea"
98
+ }, null, 8, ["modelValue", "aria-label", "placeholder", "max-length", "disabled"])
99
+ ])) : h("", !0),
100
+ i.value ? (c(), u("p", Z, f(i.value), 1)) : h("", !0),
101
+ d.value ? h("", !0) : (c(), L(S, {
102
+ key: 2,
103
+ class: "self-start",
104
+ label: n(t)("connect.whatsappBot.tryAgain"),
105
+ "prepend-icon": "refresh",
106
+ onClick: k
107
+ }, null, 8, ["label"])),
108
+ _("div", $, [
109
+ x.value ? (c(), u("span", q, [
110
+ v(U, {
111
+ name: "check",
112
+ size: "sm"
113
+ }),
114
+ T(" " + f(n(t)("connect.whatsappBot.botSettings.saved")), 1)
115
+ ])) : h("", !0),
116
+ v(S, {
117
+ variant: "secondary",
118
+ label: n(t)("connect.common.cancel"),
119
+ disabled: w.value,
120
+ onClick: V
121
+ }, null, 8, ["label", "disabled"]),
122
+ v(S, {
123
+ label: n(t)("connect.common.save"),
124
+ disabled: w.value,
125
+ loading: r.value,
126
+ onClick: N
127
+ }, null, 8, ["label", "disabled", "loading"])
128
+ ])
129
+ ], 64))
130
+ ]);
131
+ };
132
+ }
133
+ }), re = /* @__PURE__ */ M(ee, [["__scopeId", "data-v-b989ed03"]]);
134
+ export {
135
+ re as default
136
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as f, useAttrs as y, resolveComponent as b, openBlock as l, createBlock as v, mergeProps as x, unref as t, createSlots as g, withCtx as h, createElementVNode as a, toDisplayString as n, renderSlot as k, createElementBlock as F, createCommentVNode as S } from "vue";
2
- import { Z as d } from "./zod-CgigfJar.js";
3
- import { u as V } from "./vue-i18n-BcYh6_51.js";
2
+ import { Z as d } from "./zod-CGVrMcDl.js";
3
+ import { u as V } from "./vue-i18n-Dpic36zz.js";
4
4
  const B = { class: "fm-typo-en-body-lg-400 flex gap-4 text-fm-color-typo-primary items-center" }, C = {
5
5
  key: 0,
6
6
  class: "text-fm-color-typo-tertiary"