@feedmepos/mf-connect 0.1.114-dev → 0.1.115-dev

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/dist/{App-CIWTDYuZ.js → App-43mZfFAr.js} +11 -11
  2. package/dist/{AuditLogs-BluLDXu9.js → AuditLogs-BPpdm96t.js} +13 -13
  3. package/dist/{Bin-jS6pM4L3.js → Bin-CA7v180Y.js} +8 -8
  4. package/dist/{Broadcast-DBqsSZ0S.js → Broadcast-qmdifF2Y.js} +12 -12
  5. package/dist/{CampaignAnalytic-DJrjXD4H.js → CampaignAnalytic-xnrDxqaH.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-zjk-QdtX.js} +9 -9
  7. package/dist/{Card-B10nLilL.js → Card-D8icsk7L.js} +23 -23
  8. package/dist/{Collections-BN42A73p.js → Collections--THcD-E_.js} +8 -8
  9. package/dist/{Credit-0SS26HGE.js → Credit-JrbtVMBp.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js → DateRangeChip.vue_vue_type_script_setup_true_lang-DrwKtnE5.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-DgdAlHU7.js} +36 -36
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js → EffectSheet.vue_vue_type_style_index_0_lang-hVgqWdD0.js} +6 -6
  13. package/dist/{Experience-D7qPzsrc.js → Experience-CFeRqBoj.js} +13 -13
  14. package/dist/{FileSaver.min-BKWoklMK.js → FileSaver.min-CCXIBm58.js} +1 -1
  15. package/dist/{Game-BoYMwfog.js → Game-CPxq6Ex3.js} +13 -13
  16. package/dist/{GiftCardSetup-B87O0xzo.js → GiftCardSetup-D0esVZDp.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-CJ1-vL-K.js} +7 -7
  18. package/dist/{Goals-CVxf3xCA.js → Goals-DaKI6uXt.js} +4 -4
  19. package/dist/{Grab-mGL1Mue_.js → Grab-BWzdN_cd.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js → ImageInput.vue_vue_type_script_setup_true_lang-BOnL0GxM.js} +1 -1
  21. package/dist/{Index-Dptuy-6c.js → Index-2kENoaZm.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js → LocationPicker.vue_vue_type_script_setup_true_lang-BtWnJKU_.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CX_Sspu5.js} +1 -1
  24. package/dist/{LoyaltyDashboard-BxhI6RAE.js → LoyaltyDashboard-CB93Fz8u.js} +15 -15
  25. package/dist/{MainLayout-YfDxvZXl.js → MainLayout-DwnjGXh6.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js → MainLayout.vue_vue_type_script_setup_true_lang-Du8fw5v_.js} +3 -3
  27. package/dist/Marketing-DCco__2F.js +273 -0
  28. package/dist/{MarketingMaterialEdit-DkOEy_L-.js → MarketingMaterialEdit-BbgFtrYP.js} +6 -6
  29. package/dist/{Member-DufbKDOh.js → Member-B--nYyr0.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-BBlzO7Db.js} +24 -24
  31. package/dist/{MemberImportHistory-DlFN-uQl.js → MemberImportHistory-D52Y4RTC.js} +7 -7
  32. package/dist/{MemberList-B344n8I4.js → MemberList-13Owa1fj.js} +14 -14
  33. package/dist/{MemberTransactions-BS7H640M.js → MemberTransactions-CpXEWNbq.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js → MessageInput.vue_vue_type_script_setup_true_lang-DlELjFM0.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-C_y0rM8c.js} +1 -1
  36. package/dist/{Mission-D2ed_oKn.js → Mission-Ci-UzXSu.js} +14 -14
  37. package/dist/{Overview-CLh_T6YY.js → Overview-CKxSfAGF.js} +4 -4
  38. package/dist/{Overview-DJa-hXDC.js → Overview-CXen9Ram.js} +21 -21
  39. package/dist/{Point-DAPeg1VD.js → Point-CR3YOaag.js} +14 -14
  40. package/dist/{Promotion-CPPCMMFl.js → Promotion-tw3J4ul-.js} +14 -14
  41. package/dist/{Queue-BcPwCRcM.js → Queue-BZGA5ZXt.js} +13 -13
  42. package/dist/{Record-C5XKn--g.js → Record-BTevVXnT.js} +9 -9
  43. package/dist/{Review-Cc51luIv.js → Review-BU7c8ZF0.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-BSGInFB8.js → ReviewFacebookCallback-BnMF6Arh.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-C1gY4vcP.js → ReviewGoogleCallback-xpdPHSdg.js} +5 -5
  46. package/dist/{Reward-k1R3hLiF.js → Reward-jlA_7cxz.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js → RewardGroup.vue_vue_type_script_setup_true_lang-D3z_n42G.js} +14 -14
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js → RuleGroup.vue_vue_type_script_setup_true_lang-CsHxqH9h.js} +15 -15
  49. package/dist/{Segment-DsBnIvje.js → Segment-C1Bwm--Q.js} +26 -26
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-B6apgWTM.js} +15 -15
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-B7m2F9UV.js} +4 -4
  52. package/dist/{Setting-BRueNgc4.js → Setting-CDM4RhLW.js} +14 -14
  53. package/dist/{SettingAdvertisements-BrVcQyhF.js → SettingAdvertisements-4XEAJzlL.js} +12 -12
  54. package/dist/{Settings-fOvXd29Z.js → Settings-D-0tvZRr.js} +5 -5
  55. package/dist/{Store-rrh2pIHH.js → Store-C56dXtc4.js} +27 -27
  56. package/dist/{StoreRewards-D-jivVKr.js → StoreRewards-DQ1Q6WS6.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js → StoreTransactions.vue_vue_type_script_setup_true_lang-LLD91Rz6.js} +25 -25
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-Bvy4NJMd.js} +2 -2
  59. package/dist/{Tier-DJiLtw3M.js → Tier-D4CPZqw7.js} +27 -27
  60. package/dist/{Title-s0bzA7yZ.js → Title-DCbwhUic.js} +23 -23
  61. package/dist/{Transaction-CQ-CJ_eh.js → Transaction-C5LrasXr.js} +2 -2
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Cl9b4mrK.js} +6 -6
  63. package/dist/{Voucher-9vydRET7.js → Voucher-rrVbNZKR.js} +18 -18
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BIq227nz.js} +12 -12
  65. package/dist/{WhatsappAccount-D12Hvzfl.js → WhatsappAccount-oJDo5zTr.js} +6 -6
  66. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-aCQCYFYq.js} +1 -1
  67. package/dist/WhatsappBot-Cl64wG_F.js +876 -0
  68. package/dist/{WhatsappBotLogs-CK_V_iT5.js → WhatsappBotLogs-D3uT4EiB.js} +64 -64
  69. package/dist/WhatsappBotSettings-Cs1lLxh-.js +705 -0
  70. package/dist/{WhatsappLayout-bOyNHGUI.js → WhatsappLayout-C639d2HP.js} +3 -3
  71. package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-DpPxWp2x.js} +3 -3
  72. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js → ZodTextField.vue_vue_type_script_setup_true_lang-C39_95SZ.js} +2 -2
  73. package/dist/{app-DV3e2LkD.js → app-CgimGODl.js} +214 -214
  74. package/dist/app.js +1 -1
  75. package/dist/{base.export-DQUUtGmy.js → base.export-D2P6HFvo.js} +2 -2
  76. package/dist/{business-BZ0boE-5.js → business-Bu5TqSA0.js} +1 -1
  77. package/dist/{campaign-CsfFq2S-.js → campaign-BFIXSgdJ.js} +8 -8
  78. package/dist/{campaign-DMrtYWcs.js → campaign-zJxttSIk.js} +2 -2
  79. package/dist/{campaign.fn-C-CdNNdR.js → campaign.fn-gvjlcEfe.js} +20 -20
  80. package/dist/{collection.fn-C-rryKSc.js → collection.fn-DOm0HsSh.js} +2 -2
  81. package/dist/{currency-BOd9iVZV.js → currency-BpbQvbm8.js} +1 -1
  82. package/dist/{duplicateCampaign-ey_rW0Bz.js → duplicateCampaign-CvsvjRE9.js} +2 -2
  83. package/dist/{effect-BP6Hkxmj.js → effect-D-GtNB3n.js} +1 -1
  84. package/dist/{email-addresses-CO61QAq0.js → email-addresses-BKMoAtMi.js} +2 -2
  85. package/dist/{feature-flag-Bq1SgbYC.js → feature-flag-BJ_eyKsq.js} +1 -1
  86. package/dist/{feature-flag-lvPP0ED-.js → feature-flag-Bo-k5sIG.js} +1 -1
  87. package/dist/{helper-BRpts-M-.js → helper-CkfjBgMM.js} +1 -1
  88. package/dist/{index-CoROn5OA.js → index-B6kU3PkV.js} +2 -2
  89. package/dist/{index-B0RavybO.js → index-BAtUrtqM.js} +2 -2
  90. package/dist/{index-Bn19rfby.js → index-BKsxIwbi.js} +3 -3
  91. package/dist/{index-R5WS21OL.js → index-BdEXUNoG.js} +1 -1
  92. package/dist/{index-BV5aPSYo.js → index-Bhl5IRXy.js} +9 -9
  93. package/dist/{index-Cj-eugzc.js → index-BpTIulTX.js} +1 -1
  94. package/dist/{index-RwNlbTO8.js → index-C-iwb2Ln.js} +49 -55
  95. package/dist/{index-03WIXl-H.js → index-CCEXSPxk.js} +2 -2
  96. package/dist/{index-CsBjAM3E.js → index-CIej31pF.js} +1 -1
  97. package/dist/{index-DucKyzrD.js → index-CQ8XFbBk.js} +2 -2
  98. package/dist/{index-Bk20uvPY.js → index-CfQuYqXn.js} +1 -1
  99. package/dist/{index-D3wGTCWf.js → index-CuREApMc.js} +2 -2
  100. package/dist/{index-DIZLkVe0.js → index-D0JK99Ko.js} +9 -8
  101. package/dist/{index-_Cj-bsd_.js → index-DKxN1mMS.js} +4 -4
  102. package/dist/{index-ZRE89TKq.js → index-DQ8JJhxs.js} +15 -21
  103. package/dist/{index-D1t4_KaG.js → index-DUAZOMVJ.js} +1 -1
  104. package/dist/{index-D41kjcrZ.js → index-DqGs6RJG.js} +4 -4
  105. package/dist/{index-VYI0zWNC.js → index-DwU3fsLW.js} +2 -2
  106. package/dist/{index-CrBhcMaL.js → index-LygS9WsG.js} +3 -3
  107. package/dist/{index-BDNkoALK.js → index-feCrYhi6.js} +1 -1
  108. package/dist/{index-mToWKHVs.js → index-zTvr2GR4.js} +2 -2
  109. package/dist/{index.esm2017-B_Sag8Pg.js → index.esm2017-DZi9IQPS.js} +1 -1
  110. package/dist/{loading-C5fVI0ry.js → loading-Brid2wnu.js} +1 -1
  111. package/dist/{lodash-COo8_xCU.js → lodash-C1epw3Kv.js} +1 -1
  112. package/dist/{member-import-I_pKwUfF.js → member-import-DAIxTIiu.js} +1 -1
  113. package/dist/{membership-BgfH9Kva.js → membership-BZmljFhF.js} +2 -2
  114. package/dist/{money-Cr07YDlV.js → money-cLcyGcSZ.js} +1 -1
  115. package/dist/{number-DFsj0dkh.js → number-C2jPLJr2.js} +1 -1
  116. package/dist/{objectid-Cu89BzwI.js → objectid-C-wocWKI.js} +6 -6
  117. package/dist/{onboarding-DlkJCm-5.js → onboarding-oRfy_g05.js} +3 -3
  118. package/dist/{onboardingSetup-BEhVj613.js → onboardingSetup-BLD6m8HY.js} +2 -2
  119. package/dist/{plugins-CPTtiKqf.js → plugins-CUsr9vB0.js} +3 -3
  120. package/dist/{reward-DqY0mQ_5.js → reward-UOT03odb.js} +1 -1
  121. package/dist/{rule-mJJ48eKw.js → rule-BgJnPjkI.js} +10 -10
  122. package/dist/{template-C1QftpDG.js → template-BZyFhr73.js} +6 -6
  123. package/dist/{timezone-BBgBHels.js → timezone-BXA4wq7Y.js} +1 -1
  124. package/dist/{transaction.fn-Sr0hj3kY.js → transaction.fn-CQ4fpRt3.js} +2 -2
  125. package/dist/{trigger-PUP0mwKM.js → trigger-DXJCGT0q.js} +5 -5
  126. package/dist/useMarketingMaterialActions-B-Wib5ga.js +125 -0
  127. package/dist/{usePagination-Be6nIQ9y.js → usePagination-Pp4okWr8.js} +1 -1
  128. package/dist/{user-DBSYzG_9.js → user-B3gXcAIy.js} +1 -1
  129. package/dist/{vue-i18n-C6c2jsH3.js → vue-i18n-DWGiC_vs.js} +158 -158
  130. package/dist/{xlsx-Bfo19lFv.js → xlsx-CCaDUTgW.js} +1 -1
  131. package/dist/{zod-CihbDg3N.js → zod-CPwjOxvW.js} +1 -1
  132. package/package.json +1 -1
  133. package/dist/Marketing-C2cVJacf.js +0 -236
  134. package/dist/WhatsappBot-o5b_0CnB.js +0 -629
  135. package/dist/WhatsappBotSettings-BooibLUg.js +0 -694
  136. package/dist/useMarketingMaterialActions-faslwaHd.js +0 -96
@@ -1,694 +0,0 @@
1
- import { defineComponent as O, mergeModels as Q, useModel as W, openBlock as a, createElementBlock as c, createElementVNode as e, toDisplayString as o, unref as t, withDirectives as Y, vModelText as ae, resolveComponent as T, Fragment as L, renderList as Z, createBlock as D, ref as B, computed as C, watch as ne, onBeforeUnmount as re, createCommentVNode as _, createVNode as k, createTextVNode as V, withCtx as oe, normalizeClass as K, vModelRadio as pe } from "vue";
2
- import { u as R } from "./vue-i18n-C6c2jsH3.js";
3
- import { useSnackbar as ce } from "@feedmepos/ui-library";
4
- import { F as j, a as U, b as ue, c as le, d as me, e as M, f as xe } from "./index-RwNlbTO8.js";
5
- import { S as X } from "./index-03WIXl-H.js";
6
- import { w as J } from "./index-ZRE89TKq.js";
7
- import { p as be } from "./plugins-CPTtiKqf.js";
8
- const fe = { class: "flex flex-col gap-[10px]" }, ge = { class: "flex flex-col gap-[2px]" }, ve = {
9
- id: "whatsapp-bot-instructions-title",
10
- class: "text-[16px] leading-[24px] font-semibold"
11
- }, he = {
12
- id: "whatsapp-bot-instructions-description",
13
- class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
14
- }, ye = { class: "flex flex-col gap-[6px]" }, _e = ["placeholder", "maxlength", "disabled"], we = {
15
- id: "whatsapp-bot-instructions-count",
16
- class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
17
- }, Be = /* @__PURE__ */ O({
18
- __name: "BotInstructions",
19
- props: /* @__PURE__ */ Q({
20
- disabled: { type: Boolean }
21
- }, {
22
- modelValue: { required: !0 },
23
- modelModifiers: {}
24
- }),
25
- emits: ["update:modelValue"],
26
- setup(n) {
27
- const f = W(n, "modelValue"), { t: d } = R();
28
- return (l, s) => (a(), c("div", fe, [
29
- e("div", ge, [
30
- e("h2", ve, o(t(d)("connect.whatsappBot.botSettings.instructions")), 1),
31
- e("p", he, o(t(d)("connect.whatsappBot.botSettings.description")), 1)
32
- ]),
33
- e("div", ye, [
34
- Y(e("textarea", {
35
- "onUpdate:modelValue": s[0] || (s[0] = (x) => f.value = x),
36
- "aria-labelledby": "whatsapp-bot-instructions-title",
37
- "aria-describedby": "whatsapp-bot-instructions-description whatsapp-bot-instructions-count",
38
- placeholder: t(d)("connect.whatsappBot.botSettings.placeholder"),
39
- maxlength: t(j),
40
- disabled: n.disabled,
41
- rows: "6",
42
- class: "block w-full min-h-[136px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white p-[12px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
43
- }, null, 8, _e), [
44
- [ae, f.value]
45
- ]),
46
- e("p", we, o(f.value.length) + " / " + o(t(j)), 1)
47
- ])
48
- ]));
49
- }
50
- }), ke = { class: "overflow-x-auto" }, Se = ["aria-label"], $e = { class: "border-b border-fm-color-neutral-gray-100 bg-fm-color-neutral-gray-100/30 text-[12px] leading-[16px] text-fm-color-typo-tertiary" }, Ae = {
51
- scope: "col",
52
- class: "py-[10px] pl-[16px] pr-[8px] font-semibold"
53
- }, Te = {
54
- scope: "col",
55
- class: "px-[8px] py-[10px] font-semibold"
56
- }, Ie = {
57
- scope: "col",
58
- class: "px-[8px] py-[10px] font-semibold"
59
- }, Fe = {
60
- scope: "col",
61
- class: "py-[10px] pl-[8px] pr-[16px]"
62
- }, Ce = { class: "sr-only" }, Ee = { class: "text-[14px] leading-[20px]" }, Ve = { class: "py-[8px] pl-[16px] pr-[8px] font-medium" }, Pe = ["title"], Ne = { class: "px-[8px] py-[8px] text-fm-color-typo-secondary tabular-nums" }, De = ["title"], Le = { class: "px-[8px] py-[8px] text-fm-color-typo-tertiary tabular-nums" }, Oe = ["datetime", "title"], Re = { class: "py-[8px] pl-[8px] pr-[16px]" }, Ue = ["aria-label", "disabled", "aria-busy", "onClick"], Me = { key: 1 }, se = /* @__PURE__ */ O({
63
- __name: "ExcludedAccountsTable",
64
- props: {
65
- accounts: {},
66
- removingId: {}
67
- },
68
- emits: ["remove"],
69
- setup(n, { emit: f }) {
70
- const d = f, { t: l, locale: s } = R();
71
- function x(u) {
72
- return u.customerName || u.phoneNumber || u.customerLid;
73
- }
74
- function i(u) {
75
- return new Intl.DateTimeFormat(s.value, {
76
- dateStyle: "medium",
77
- timeStyle: "short"
78
- }).format(new Date(u));
79
- }
80
- return (u, v) => {
81
- const y = T("FmCircularProgress");
82
- return a(), c("div", ke, [
83
- e("table", {
84
- "aria-label": t(l)("connect.whatsappBot.excludedAccounts.title"),
85
- class: "w-full min-w-[600px] table-fixed border-collapse text-left"
86
- }, [
87
- v[0] || (v[0] = e("colgroup", null, [
88
- e("col", { class: "w-[30%]" }),
89
- e("col", { class: "w-[25%]" }),
90
- e("col"),
91
- e("col", { class: "w-[116px]" })
92
- ], -1)),
93
- e("thead", $e, [
94
- e("tr", null, [
95
- e("th", Ae, o(t(l)("connect.whatsappBot.excludedAccounts.name")), 1),
96
- e("th", Te, o(t(l)("connect.whatsappBot.excludedAccounts.phoneNumber")), 1),
97
- e("th", Ie, o(t(l)("connect.whatsappBot.excludedAccounts.excludedOn")), 1),
98
- e("th", Fe, [
99
- e("span", Ce, o(t(l)("connect.whatsappBot.excludedAccounts.actions")), 1)
100
- ])
101
- ])
102
- ]),
103
- e("tbody", Ee, [
104
- (a(!0), c(L, null, Z(n.accounts, (r) => (a(), c("tr", {
105
- key: r.id,
106
- class: "border-b border-fm-color-neutral-gray-100 last:border-b-0"
107
- }, [
108
- e("td", Ve, [
109
- e("span", {
110
- class: "block truncate",
111
- title: x(r)
112
- }, o(x(r)), 9, Pe)
113
- ]),
114
- e("td", Ne, [
115
- e("span", {
116
- class: "block truncate",
117
- title: r.phoneNumber || t(l)("connect.whatsappBot.phoneUnavailable")
118
- }, o(r.phoneNumber || t(l)("connect.whatsappBot.phoneUnavailable")), 9, De)
119
- ]),
120
- e("td", Le, [
121
- e("time", {
122
- datetime: r.updatedAt,
123
- title: i(r.updatedAt),
124
- class: "block truncate"
125
- }, o(i(r.updatedAt)), 9, Oe)
126
- ]),
127
- e("td", Re, [
128
- e("button", {
129
- type: "button",
130
- "aria-label": t(l)("connect.whatsappBot.excludedAccounts.removeAccount", {
131
- name: x(r)
132
- }),
133
- disabled: !!n.removingId,
134
- "aria-busy": n.removingId === r.id,
135
- class: "flex h-[32px] w-[84px] items-center justify-center rounded-[8px] text-[14px] font-semibold text-fm-color-typo-secondary transition-colors hover:bg-fm-color-system-error-100 hover:text-fm-color-typo-error focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary disabled:cursor-wait disabled:opacity-50",
136
- onClick: (F) => d("remove", r)
137
- }, [
138
- n.removingId === r.id ? (a(), D(y, {
139
- key: 0,
140
- size: "md",
141
- "aria-hidden": "true"
142
- })) : (a(), c("span", Me, o(t(l)("connect.common.remove")), 1))
143
- ], 8, Ue)
144
- ])
145
- ]))), 128))
146
- ])
147
- ], 8, Se)
148
- ]);
149
- };
150
- }
151
- }), We = {
152
- id: "whatsapp-excluded-accounts",
153
- "aria-labelledby": "whatsapp-excluded-accounts-title",
154
- class: "flex min-w-0 flex-col gap-[12px]"
155
- }, ze = { class: "flex flex-col gap-[2px]" }, He = {
156
- id: "whatsapp-excluded-accounts-title",
157
- class: "text-[16px] leading-[24px] font-semibold"
158
- }, Ge = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Ke = {
159
- key: 0,
160
- role: "alert",
161
- class: "text-[14px] text-fm-color-typo-error"
162
- }, je = {
163
- key: 1,
164
- role: "status",
165
- class: "flex flex-col items-center gap-[12px] py-[32px] text-[14px] text-fm-color-typo-secondary"
166
- }, Xe = {
167
- key: 0,
168
- class: "flex flex-wrap items-center gap-[12px]"
169
- }, Je = {
170
- role: "alert",
171
- class: "text-[14px] text-fm-color-typo-error"
172
- }, Qe = {
173
- key: 1,
174
- class: "flex flex-col items-center gap-[6px] rounded-[16px] border border-fm-color-neutral-gray-200 px-[24px] py-[32px] text-center"
175
- }, Ye = { class: "text-[16px] leading-[24px] font-semibold" }, Ze = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, qe = {
176
- key: 2,
177
- class: "overflow-hidden rounded-[16px] border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white"
178
- }, et = { class: "flex min-w-0 flex-col" }, tt = { class: "text-[18px] leading-[24px] font-semibold" }, ot = { class: "text-[14px] leading-[20px] text-fm-color-typo-tertiary" }, lt = {
179
- key: 0,
180
- role: "alert",
181
- class: "mb-[12px] text-[14px] text-fm-color-typo-error"
182
- }, st = {
183
- key: 1,
184
- class: "px-[24px] py-[40px] text-center text-[14px] text-fm-color-typo-secondary"
185
- }, at = /* @__PURE__ */ O({
186
- __name: "ExcludedAccounts",
187
- props: {
188
- tickets: {},
189
- loading: { type: Boolean },
190
- error: {}
191
- },
192
- emits: ["retry", "removed"],
193
- setup(n, { emit: f }) {
194
- const d = n, l = f, { t: s } = R(), x = ce(), i = B(""), u = B(""), v = B(!1);
195
- let y;
196
- const r = C(
197
- () => [...d.tickets].sort((g, b) => b.updatedAt.localeCompare(g.updatedAt))
198
- ), F = C(() => r.value.slice(0, 3));
199
- async function $(g) {
200
- if (i.value) return;
201
- const b = X.getBusinessId();
202
- if (!b || g.businessId !== b) return;
203
- const h = new AbortController();
204
- y = h, i.value = g.id, u.value = "";
205
- try {
206
- if (await J.resolveTicket(b, g.id, h.signal), h.signal.aborted) return;
207
- l("removed", g.id), x.open({
208
- type: "success",
209
- message: s("connect.whatsappBot.excludedAccounts.removed", {
210
- name: g.customerName || g.phoneNumber || g.customerLid
211
- })
212
- });
213
- } catch (A) {
214
- h.signal.aborted || (u.value = A instanceof Error ? A.message : s("connect.whatsappBot.excludedAccounts.removeError"), x.open({ type: "error", message: u.value }));
215
- } finally {
216
- h.signal.aborted || (i.value = "");
217
- }
218
- }
219
- function w() {
220
- y == null || y.abort(), i.value = "", u.value = "", v.value = !1;
221
- }
222
- return ne(() => X.getBusinessId(), w), re(w), (g, b) => {
223
- const h = T("FmCircularProgress"), A = T("FmButton"), z = T("FmIcon"), H = T("FmDialog");
224
- return a(), c(L, null, [
225
- e("section", We, [
226
- e("div", ze, [
227
- e("h2", He, o(t(s)("connect.whatsappBot.excludedAccounts.title")), 1),
228
- e("p", Ge, o(t(s)("connect.whatsappBot.excludedAccounts.description")), 1)
229
- ]),
230
- u.value ? (a(), c("p", Ke, o(u.value), 1)) : _("", !0),
231
- n.loading ? (a(), c("div", je, [
232
- k(h),
233
- V(" " + o(t(s)("connect.whatsappBot.excludedAccounts.loading")), 1)
234
- ])) : (a(), c(L, { key: 2 }, [
235
- n.error ? (a(), c("div", Xe, [
236
- e("p", Je, o(n.error), 1),
237
- k(A, {
238
- variant: "secondary",
239
- "border-color": "neutral-gray-200",
240
- label: t(s)("connect.whatsappBot.tryAgain"),
241
- "prepend-icon": "refresh",
242
- class: "!rounded-full [&_.label]:text-[14px]",
243
- onClick: b[0] || (b[0] = (E) => l("retry"))
244
- }, null, 8, ["label"])
245
- ])) : _("", !0),
246
- !r.value.length && !n.error ? (a(), c("div", Qe, [
247
- e("h3", Ye, o(t(s)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1),
248
- e("p", Ze, o(t(s)("connect.whatsappBot.excludedAccounts.emptyDescription")), 1)
249
- ])) : r.value.length ? (a(), c("div", qe, [
250
- k(se, {
251
- accounts: F.value,
252
- "removing-id": i.value,
253
- onRemove: $
254
- }, null, 8, ["accounts", "removing-id"]),
255
- r.value.length > F.value.length ? (a(), c("button", {
256
- key: 0,
257
- type: "button",
258
- class: "flex min-h-[44px] w-full items-center justify-center gap-[6px] border-t border-fm-color-neutral-gray-100 px-[16px] py-[8px] text-[14px] font-semibold text-fm-color-primary transition-colors hover:bg-fm-color-primary-oats focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-inset focus-visible:ring-fm-color-primary",
259
- onClick: b[1] || (b[1] = (E) => v.value = !0)
260
- }, [
261
- V(o(t(s)("connect.whatsappBot.excludedAccounts.showAll", {
262
- count: r.value.length
263
- })) + " ", 1),
264
- k(z, {
265
- name: "chevron_right",
266
- size: "sm",
267
- "aria-hidden": "true"
268
- })
269
- ])) : _("", !0)
270
- ])) : _("", !0)
271
- ], 64))
272
- ]),
273
- k(H, {
274
- modelValue: v.value,
275
- "onUpdate:modelValue": b[2] || (b[2] = (E) => v.value = E),
276
- "min-width": "min(720px, calc(100% - 32px))",
277
- "max-width": "720px",
278
- "max-height": "90vh",
279
- "dismiss-away": ""
280
- }, {
281
- "dialog-header": oe(() => [
282
- e("div", et, [
283
- e("h2", tt, o(t(s)("connect.whatsappBot.excludedAccounts.title")), 1),
284
- e("p", ot, o(t(s)("connect.whatsappBot.accountCount", r.value.length)), 1)
285
- ])
286
- ]),
287
- default: oe(() => [
288
- u.value ? (a(), c("p", lt, o(u.value), 1)) : _("", !0),
289
- r.value.length ? (a(), D(se, {
290
- key: 2,
291
- accounts: r.value,
292
- "removing-id": i.value,
293
- onRemove: $
294
- }, null, 8, ["accounts", "removing-id"])) : (a(), c("p", st, o(t(s)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1))
295
- ]),
296
- _: 1
297
- }, 8, ["modelValue"])
298
- ], 64);
299
- };
300
- }
301
- }), nt = {
302
- "aria-labelledby": "knowledge-base-title",
303
- class: "flex flex-col gap-[10px]"
304
- }, rt = { class: "flex flex-col gap-[2px]" }, ct = {
305
- id: "knowledge-base-title",
306
- class: "text-[16px] leading-[24px] font-semibold"
307
- }, it = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, dt = { class: "flex flex-wrap gap-[8px]" }, pt = ["title", "aria-expanded", "disabled", "onClick"], ut = ["disabled"], mt = {
308
- key: 0,
309
- class: "text-[14px] text-fm-color-typo-tertiary"
310
- }, xt = {
311
- key: 1,
312
- class: "text-[14px] text-fm-color-typo-secondary"
313
- }, bt = { class: "flex flex-col gap-[6px]" }, ft = {
314
- for: "whatsapp-knowledge-topic-description",
315
- class: "text-[14px] leading-[20px] font-medium text-fm-color-typo-secondary"
316
- }, gt = ["placeholder", "maxlength", "disabled"], vt = {
317
- id: "whatsapp-knowledge-topic-description-count",
318
- class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
319
- }, ht = /* @__PURE__ */ O({
320
- __name: "KnowledgeBase",
321
- props: /* @__PURE__ */ Q({
322
- disabled: { type: Boolean }
323
- }, {
324
- modelValue: {
325
- required: !0
326
- },
327
- modelModifiers: {},
328
- activeTopicIndex: {
329
- required: !0
330
- },
331
- activeTopicIndexModifiers: {}
332
- }),
333
- emits: ["update:modelValue", "update:activeTopicIndex"],
334
- setup(n) {
335
- const f = n, d = W(n, "modelValue"), l = W(n, "activeTopicIndex"), { t: s } = R(), x = C(
336
- () => l.value === null ? null : d.value[l.value]
337
- );
338
- function i() {
339
- f.disabled || d.value.length >= U || (d.value.push({ title: "", description: "" }), l.value = d.value.length - 1);
340
- }
341
- function u() {
342
- f.disabled || l.value === null || (d.value.splice(l.value, 1), l.value = null);
343
- }
344
- return (v, y) => {
345
- const r = T("FmIcon"), F = T("FmTextField"), $ = T("FmButton");
346
- return a(), c("section", nt, [
347
- e("div", rt, [
348
- e("h2", ct, o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
349
- e("p", it, o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
350
- ]),
351
- e("div", dt, [
352
- (a(!0), c(L, null, Z(d.value, (w, g) => (a(), c("button", {
353
- key: g,
354
- type: "button",
355
- title: w.title.trim() || t(s)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
356
- "aria-expanded": l.value === g,
357
- "aria-controls": "knowledge-topic-editor",
358
- disabled: n.disabled,
359
- class: K(["h-[32px] max-w-[240px] rounded-[8px] border-[1px] px-[12px] truncate text-[14px] font-medium transition-colors focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60", [
360
- l.value === g ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
361
- n.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
362
- ]]),
363
- onClick: (b) => l.value = l.value === g ? null : g
364
- }, o(w.title.trim() || t(s)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, pt))), 128)),
365
- e("button", {
366
- type: "button",
367
- disabled: n.disabled || d.value.length >= t(U),
368
- class: "h-[32px] rounded-[8px] border-[1px] border-dashed border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] flex items-center gap-[6px] text-[14px] font-semibold text-fm-color-primary hover:border-fm-color-primary focus-visible:ring-2 focus-visible:ring-fm-color-primary disabled:opacity-60 disabled:cursor-default",
369
- onClick: i
370
- }, [
371
- k(r, {
372
- name: "add",
373
- size: "sm"
374
- }),
375
- V(" " + o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
376
- ], 8, ut)
377
- ]),
378
- d.value.length === 0 ? (a(), c("p", mt, o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : _("", !0),
379
- d.value.length >= t(U) ? (a(), c("p", xt, o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
380
- count: t(U)
381
- })), 1)) : _("", !0),
382
- x.value ? (a(), c("div", {
383
- id: "knowledge-topic-editor",
384
- key: l.value ?? void 0,
385
- class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[10px]"
386
- }, [
387
- k(F, {
388
- modelValue: x.value.title,
389
- "onUpdate:modelValue": y[0] || (y[0] = (w) => x.value.title = w),
390
- label: t(s)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
391
- placeholder: t(s)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
392
- "max-length": t(ue),
393
- disabled: n.disabled
394
- }, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
395
- e("div", bt, [
396
- e("label", ft, o(t(s)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel")), 1),
397
- Y(e("textarea", {
398
- id: "whatsapp-knowledge-topic-description",
399
- "onUpdate:modelValue": y[1] || (y[1] = (w) => x.value.description = w),
400
- "aria-describedby": "whatsapp-knowledge-topic-description-count",
401
- placeholder: t(s)(
402
- "connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
403
- ),
404
- maxlength: t(le),
405
- disabled: n.disabled,
406
- rows: "5",
407
- class: "block w-full min-h-[116px] resize-y rounded-[8px] border border-fm-color-neutral-gray-200 bg-fm-color-neutral-white px-[12px] py-[8px] text-[14px] leading-[20px] text-fm-color-typo-primary placeholder:text-fm-color-typo-tertiary transition-[border-color,box-shadow] focus:border-fm-color-primary focus:outline-none focus:ring-[4px] focus:ring-fm-color-primary/30 disabled:cursor-not-allowed disabled:bg-fm-color-neutral-gray-100 disabled:text-fm-color-typo-disabled"
408
- }, null, 8, gt), [
409
- [ae, x.value.description]
410
- ]),
411
- e("p", vt, o(x.value.description.length) + " / " + o(t(le)), 1)
412
- ]),
413
- k($, {
414
- variant: "plain",
415
- size: "sm",
416
- "prepend-icon": "delete",
417
- "text-color": "typo-error",
418
- label: t(s)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
419
- disabled: n.disabled,
420
- class: "self-start",
421
- onClick: u
422
- }, null, 8, ["label", "disabled"])
423
- ])) : _("", !0)
424
- ]);
425
- };
426
- }
427
- }), yt = {
428
- "aria-labelledby": "response-speed-title",
429
- class: "flex flex-col gap-[12px]"
430
- }, _t = { class: "flex flex-col gap-[2px]" }, wt = {
431
- id: "response-speed-title",
432
- class: "text-[16px] leading-[24px] font-semibold"
433
- }, Bt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, kt = {
434
- role: "radiogroup",
435
- "aria-labelledby": "response-speed-title",
436
- "aria-describedby": "response-speed-detail",
437
- class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
438
- }, St = ["value", "disabled"], $t = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, At = {
439
- key: 0,
440
- class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
441
- }, Tt = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, It = {
442
- id: "response-speed-detail",
443
- "aria-live": "polite",
444
- class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
445
- }, Ft = {
446
- key: 0,
447
- class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
448
- }, Ct = /* @__PURE__ */ O({
449
- __name: "ResponseSpeed",
450
- props: /* @__PURE__ */ Q({
451
- disabled: { type: Boolean }
452
- }, {
453
- modelValue: {
454
- required: !0
455
- },
456
- modelModifiers: {}
457
- }),
458
- emits: ["update:modelValue"],
459
- setup(n) {
460
- const f = W(n, "modelValue"), { t: d } = R();
461
- return (l, s) => {
462
- const x = T("FmIcon");
463
- return a(), c("section", yt, [
464
- e("div", _t, [
465
- e("h2", wt, o(t(d)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
466
- e("p", Bt, o(t(d)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
467
- ]),
468
- e("div", kt, [
469
- (a(!0), c(L, null, Z(t(me), (i) => (a(), c("label", { key: i }, [
470
- Y(e("input", {
471
- "onUpdate:modelValue": s[0] || (s[0] = (u) => f.value = u),
472
- type: "radio",
473
- name: "response-speed",
474
- value: i,
475
- disabled: n.disabled,
476
- class: "sr-only peer"
477
- }, null, 8, St), [
478
- [pe, f.value]
479
- ]),
480
- e("span", {
481
- class: K(["h-full border-[1px] rounded-[8px] p-[12px] flex flex-col gap-[4px] transition-colors peer-focus-visible:ring-2 peer-focus-visible:ring-fm-color-primary", [
482
- f.value === i ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
483
- n.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
484
- ]])
485
- }, [
486
- e("span", $t, [
487
- e("span", {
488
- "aria-hidden": "true",
489
- class: K([
490
- "w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
491
- f.value === i ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
492
- ])
493
- }, [
494
- f.value === i ? (a(), c("span", At)) : _("", !0)
495
- ], 2),
496
- V(" " + o(t(d)(`connect.whatsappBot.botSettings.responseSpeed.${i}.label`)), 1)
497
- ]),
498
- e("span", Tt, o(t(d)(`connect.whatsappBot.botSettings.responseSpeed.${i}.hint`)), 1)
499
- ], 2)
500
- ]))), 128))
501
- ]),
502
- e("p", It, o(t(d)(
503
- `connect.whatsappBot.botSettings.responseSpeed.${f.value}.detail`
504
- )), 1),
505
- f.value === "immediate" ? (a(), c("div", Ft, [
506
- k(x, {
507
- name: "warning",
508
- size: "sm",
509
- class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
510
- }),
511
- V(" " + o(t(d)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
512
- ])) : _("", !0)
513
- ]);
514
- };
515
- }
516
- }), Et = { class: "mt-[20px] mx-auto w-full min-w-0 flex flex-col gap-[20px]" }, Vt = {
517
- key: 0,
518
- role: "status",
519
- class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
520
- }, Pt = { class: "border-t border-fm-color-neutral-gray-100 pt-[20px]" }, Nt = { class: "group border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Dt = { class: "flex h-[36px] w-fit cursor-pointer list-none items-center gap-[8px] rounded-[8px] px-[8px] -ml-[8px] text-[16px] font-semibold transition-colors hover:bg-fm-color-neutral-gray-100 focus-visible:outline-none focus-visible:ring-[2px] focus-visible:ring-fm-color-primary [&::-webkit-details-marker]:hidden" }, Lt = { class: "mt-[20px] flex flex-col gap-[20px]" }, Ot = {
521
- key: 1,
522
- role: "alert",
523
- class: "text-[14px] text-fm-color-typo-error"
524
- }, Rt = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, jt = /* @__PURE__ */ O({
525
- __name: "WhatsappBotSettings",
526
- props: {
527
- tickets: {},
528
- ticketsLoading: { type: Boolean },
529
- ticketsError: {}
530
- },
531
- emits: ["retryExclusions", "excludedAccountRemoved"],
532
- setup(n, { emit: f }) {
533
- const d = f, { t: l } = R(), s = ce(), x = C(() => X.getBusinessId() ?? ""), i = B(""), u = B(""), v = B([]), y = B([]), r = B(null), F = C(
534
- () => v.value.filter(
535
- (m) => m.title.trim() || m.description.trim()
536
- )
537
- ), $ = B(
538
- M
539
- ), w = B(
540
- M
541
- ), g = B(!0), b = B(!1), h = B(!1), A = B(""), z = j, H = C(
542
- () => i.value !== u.value || $.value !== w.value || JSON.stringify(v.value) !== JSON.stringify(y.value)
543
- ), E = C(
544
- () => !b.value || h.value || !H.value
545
- ), q = C(
546
- () => !b.value || h.value || i.value.length > z || !xe.safeParse(F.value).success
547
- );
548
- let S;
549
- function ee(m) {
550
- i.value = m.botInstructions, u.value = m.botInstructions, $.value = m.responseSpeed, w.value = m.responseSpeed, v.value = m.knowledgeBase.map((p) => ({ ...p })), y.value = m.knowledgeBase.map((p) => ({
551
- ...p
552
- }));
553
- }
554
- async function te() {
555
- S == null || S.abort();
556
- const m = new AbortController();
557
- S = m, g.value = !0, b.value = !1, h.value = !1, A.value = "", i.value = "", u.value = "", $.value = M, w.value = M, v.value = [], y.value = [], r.value = null;
558
- try {
559
- if (!x.value)
560
- throw new Error(l("connect.whatsappBot.errors.selectBusiness"));
561
- const p = await J.getSettings(
562
- x.value,
563
- m.signal
564
- );
565
- if (m.signal.aborted) return;
566
- ee(p), b.value = !0;
567
- } catch (p) {
568
- m.signal.aborted || (A.value = p instanceof Error ? p.message : l("connect.whatsappBot.errors.loadSettings"));
569
- } finally {
570
- m.signal.aborted || (g.value = !1);
571
- }
572
- }
573
- async function ie() {
574
- if (q.value) return;
575
- S == null || S.abort();
576
- const m = new AbortController();
577
- S = m, h.value = !0, A.value = "";
578
- const p = r.value === null ? void 0 : v.value[r.value], P = p ? F.value.indexOf(p) : -1;
579
- try {
580
- const N = await J.saveSettings(
581
- x.value,
582
- {
583
- botInstructions: i.value,
584
- responseSpeed: $.value,
585
- knowledgeBase: F.value
586
- },
587
- m.signal
588
- );
589
- if (m.signal.aborted) return;
590
- ee(N), r.value = P < 0 ? null : P, s.open({
591
- type: "success",
592
- message: l("connect.whatsappBot.botSettings.saved")
593
- });
594
- } catch (N) {
595
- m.signal.aborted || (A.value = N instanceof Error ? N.message : l("connect.whatsappBot.errors.saveSettings"), s.open({ type: "error", message: A.value }));
596
- } finally {
597
- m.signal.aborted || (h.value = !1);
598
- }
599
- }
600
- async function de() {
601
- if (E.value) return;
602
- const m = S;
603
- !await be.confirm(
604
- l("connect.whatsappBot.botSettings.discardChangesMessage"),
605
- l("connect.whatsappBot.botSettings.discardChangesTitle"),
606
- l("connect.common.confirm"),
607
- l("connect.common.cancel")
608
- ) || E.value || S !== m || (i.value = u.value, $.value = w.value, v.value = y.value.map((P) => ({ ...P })), r.value = null);
609
- }
610
- return ne(x, te, { immediate: !0 }), re(() => {
611
- S == null || S.abort();
612
- }), (m, p) => {
613
- const P = T("FmCircularProgress"), N = T("FmIcon"), G = T("FmButton");
614
- return a(), c("div", Et, [
615
- g.value ? (a(), c("div", Vt, [
616
- k(P),
617
- V(" " + o(t(l)("connect.whatsappBot.botSettings.loading")), 1)
618
- ])) : (a(), c(L, { key: 1 }, [
619
- b.value ? (a(), D(Be, {
620
- key: 0,
621
- modelValue: i.value,
622
- "onUpdate:modelValue": p[0] || (p[0] = (I) => i.value = I),
623
- disabled: h.value
624
- }, null, 8, ["modelValue", "disabled"])) : _("", !0),
625
- e("div", Pt, [
626
- k(at, {
627
- tickets: n.tickets,
628
- loading: n.ticketsLoading,
629
- error: n.ticketsError,
630
- onRetry: p[1] || (p[1] = (I) => d("retryExclusions")),
631
- onRemoved: p[2] || (p[2] = (I) => d("excludedAccountRemoved", I))
632
- }, null, 8, ["tickets", "loading", "error"])
633
- ]),
634
- e("details", Nt, [
635
- e("summary", Dt, [
636
- V(o(t(l)("connect.whatsappBot.botSettings.advancedSettings")) + " ", 1),
637
- k(N, {
638
- name: "keyboard_arrow_down",
639
- size: "sm",
640
- class: "transition-transform group-open:rotate-180 motion-reduce:transition-none",
641
- "aria-hidden": "true"
642
- })
643
- ]),
644
- e("div", Lt, [
645
- b.value ? (a(), D(ht, {
646
- key: 0,
647
- modelValue: v.value,
648
- "onUpdate:modelValue": p[3] || (p[3] = (I) => v.value = I),
649
- "active-topic-index": r.value,
650
- "onUpdate:activeTopicIndex": p[4] || (p[4] = (I) => r.value = I),
651
- disabled: h.value
652
- }, null, 8, ["modelValue", "active-topic-index", "disabled"])) : _("", !0),
653
- b.value ? (a(), D(Ct, {
654
- key: 1,
655
- modelValue: $.value,
656
- "onUpdate:modelValue": p[5] || (p[5] = (I) => $.value = I),
657
- disabled: h.value,
658
- class: "border-t border-fm-color-neutral-gray-100 pt-[20px]"
659
- }, null, 8, ["modelValue", "disabled"])) : _("", !0)
660
- ])
661
- ]),
662
- A.value ? (a(), c("p", Ot, o(A.value), 1)) : _("", !0),
663
- b.value ? _("", !0) : (a(), D(G, {
664
- key: 2,
665
- class: "self-start !rounded-full [&_.label]:text-[14px]",
666
- label: t(l)("connect.whatsappBot.tryAgain"),
667
- "prepend-icon": "refresh",
668
- onClick: te
669
- }, null, 8, ["label"])),
670
- e("div", Rt, [
671
- k(G, {
672
- variant: "secondary",
673
- "border-color": "neutral-gray-200",
674
- label: t(l)("connect.common.cancel"),
675
- disabled: E.value,
676
- class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
677
- onClick: de
678
- }, null, 8, ["label", "disabled"]),
679
- k(G, {
680
- label: t(l)("connect.common.save"),
681
- disabled: q.value,
682
- loading: h.value,
683
- class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
684
- onClick: ie
685
- }, null, 8, ["label", "disabled", "loading"])
686
- ])
687
- ], 64))
688
- ]);
689
- };
690
- }
691
- });
692
- export {
693
- jt as default
694
- };