@feedmepos/mf-connect 0.1.113-beta.3 → 0.1.114-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 (137) hide show
  1. package/dist/{App-YfpYV7C0.js → App-CIWTDYuZ.js} +11 -11
  2. package/dist/{AuditLogs-kD0_HO_p.js → AuditLogs-BluLDXu9.js} +12 -12
  3. package/dist/{Bin-Dr-Xp3pn.js → Bin-jS6pM4L3.js} +8 -8
  4. package/dist/{Broadcast-CEbHu2xA.js → Broadcast-DBqsSZ0S.js} +12 -12
  5. package/dist/{CampaignAnalytic-DDiGxPwp.js → CampaignAnalytic-DJrjXD4H.js} +7 -7
  6. package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Cc_Yho9-.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CzwigRLi.js} +8 -8
  7. package/dist/{Card-BUnwg0eM.js → Card-B10nLilL.js} +22 -22
  8. package/dist/{Collections-CKyBkKq2.js → Collections-BN42A73p.js} +8 -8
  9. package/dist/{Credit-CJOXWLV1.js → Credit-0SS26HGE.js} +12 -12
  10. package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-DmEBLeNI.js → DateRangeChip.vue_vue_type_script_setup_true_lang-B3wozBFs.js} +1 -1
  11. package/dist/{EditCampaignSheet.vue_vue_type_script_setup_true_lang-Ce5R4Un6.js → EditCampaignSheet.vue_vue_type_script_setup_true_lang-BRd5RVYe.js} +35 -35
  12. package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-CMFmlqfF.js → EffectSheet.vue_vue_type_style_index_0_lang-zV9dLCWp.js} +6 -6
  13. package/dist/{Experience-C_Am5CTY.js → Experience-D7qPzsrc.js} +13 -13
  14. package/dist/{FileSaver.min-CueAGbjq.js → FileSaver.min-BKWoklMK.js} +1 -1
  15. package/dist/{Game-B6GO_LVU.js → Game-BoYMwfog.js} +13 -13
  16. package/dist/{GiftCardSetup-CVLDDpI2.js → GiftCardSetup-B87O0xzo.js} +10 -10
  17. package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-isfGhKO1.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-B3uGbEFY.js} +7 -7
  18. package/dist/{Goals-BX-sMV2V.js → Goals-CVxf3xCA.js} +4 -4
  19. package/dist/{Grab-Bh335Srh.js → Grab-mGL1Mue_.js} +9 -9
  20. package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-srSgUY3e.js → ImageInput.vue_vue_type_script_setup_true_lang-HipBZ1_T.js} +1 -1
  21. package/dist/{Index-CyXRbwcm.js → Index-Dptuy-6c.js} +10 -10
  22. package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-S3GB2Ems.js → LocationPicker.vue_vue_type_script_setup_true_lang-Cjc4UeKz.js} +1 -1
  23. package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-ZlWHXwXZ.js → LottieAnimation.vue_vue_type_script_setup_true_lang-Bh0ari3f.js} +1 -1
  24. package/dist/{LoyaltyDashboard-DrTq8oiu.js → LoyaltyDashboard-BxhI6RAE.js} +15 -15
  25. package/dist/{MainLayout-KbKkpX5n.js → MainLayout-YfDxvZXl.js} +1 -1
  26. package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-2D5ate_s.js → MainLayout.vue_vue_type_script_setup_true_lang-BgXpznbi.js} +3 -3
  27. package/dist/{Marketing-DQT1MWQg.js → Marketing-C2cVJacf.js} +4 -4
  28. package/dist/{MarketingMaterialEdit-fSqr53-M.js → MarketingMaterialEdit-DkOEy_L-.js} +6 -6
  29. package/dist/{Member-DwDUCzlv.js → Member-DufbKDOh.js} +7 -7
  30. package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-DaQ4Lw8f.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-CU8EmBxy.js} +23 -23
  31. package/dist/{MemberImportHistory-D4ezvJGZ.js → MemberImportHistory-DlFN-uQl.js} +7 -7
  32. package/dist/{MemberList-DFieV7Qk.js → MemberList-B344n8I4.js} +14 -14
  33. package/dist/{MemberTransactions-BPOXyAuC.js → MemberTransactions-BS7H640M.js} +1 -1
  34. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-DhfsgDd4.js → MessageInput.vue_vue_type_script_setup_true_lang-CxDtXvwd.js} +10 -10
  35. package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CX8bk_IQ.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-lY0jlyOG.js} +1 -1
  36. package/dist/{Mission-nErb05Es.js → Mission-D2ed_oKn.js} +14 -14
  37. package/dist/{Overview-DuJr_hAg.js → Overview-CLh_T6YY.js} +4 -4
  38. package/dist/{Overview-7G31a7B-.js → Overview-DJa-hXDC.js} +20 -20
  39. package/dist/{Point-PWDLemD4.js → Point-DAPeg1VD.js} +14 -14
  40. package/dist/{Promotion-N80Tj8M6.js → Promotion-CPPCMMFl.js} +14 -14
  41. package/dist/{Queue-M7ZpgiMT.js → Queue-BcPwCRcM.js} +12 -12
  42. package/dist/{Record-NhxrdvWv.js → Record-C5XKn--g.js} +9 -9
  43. package/dist/{Review-DiAaAzIG.js → Review-Cc51luIv.js} +2 -2
  44. package/dist/{ReviewFacebookCallback-JdyxFbNl.js → ReviewFacebookCallback-BSGInFB8.js} +5 -5
  45. package/dist/{ReviewGoogleCallback-BXbI3Bsh.js → ReviewGoogleCallback-C1gY4vcP.js} +5 -5
  46. package/dist/{Reward-yTaOqOT8.js → Reward-k1R3hLiF.js} +16 -16
  47. package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-BWPfjZ9K.js → RewardGroup.vue_vue_type_script_setup_true_lang-BGbbGVK4.js} +13 -13
  48. package/dist/{RuleGroup.vue_vue_type_script_setup_true_lang-Cz2H9MKe.js → RuleGroup.vue_vue_type_script_setup_true_lang-Coh3L11L.js} +14 -14
  49. package/dist/{Segment-DE9Bcd6R.js → Segment-DsBnIvje.js} +25 -25
  50. package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-pmv0cb4J.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-CMKpvXN-.js} +14 -14
  51. package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-BeWwkTix.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-LyAtRMs8.js} +4 -4
  52. package/dist/{Setting-C0JAxIRT.js → Setting-BRueNgc4.js} +14 -14
  53. package/dist/{SettingAdvertisements-DxueyKU8.js → SettingAdvertisements-BrVcQyhF.js} +12 -12
  54. package/dist/{Settings-Cs46AcxZ.js → Settings-fOvXd29Z.js} +5 -5
  55. package/dist/{Store-DqQae9nE.js → Store-rrh2pIHH.js} +26 -26
  56. package/dist/{StoreRewards-JxSUsOzJ.js → StoreRewards-D-jivVKr.js} +15 -15
  57. package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-qgrBtUNX.js → StoreTransactions.vue_vue_type_script_setup_true_lang-CvQXsZbH.js} +24 -24
  58. package/dist/{TargetLocationInput.vue_vue_type_script_setup_true_lang-D7ifzgsI.js → TargetLocationInput.vue_vue_type_script_setup_true_lang-DbnY9VE9.js} +2 -2
  59. package/dist/{Tier-DWhgWush.js → Tier-DJiLtw3M.js} +26 -26
  60. package/dist/{Title-DUNeMdz8.js → Title-s0bzA7yZ.js} +22 -22
  61. package/dist/{Transaction-DAv-LVhC.js → Transaction-CQ-CJ_eh.js} +2 -2
  62. package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-Cih-9IoW.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-Bfy8SZH1.js} +6 -6
  63. package/dist/{Voucher-uLTq9RSK.js → Voucher-9vydRET7.js} +18 -18
  64. package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-BevVL_Kx.js → VoucherEditor.vue_vue_type_script_setup_true_lang-Dq7veRL5.js} +12 -12
  65. package/dist/{WhatsappAccount-BpXQ4q0P.js → WhatsappAccount-D12Hvzfl.js} +52 -51
  66. package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-EssnbsgT.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BrZEDi6O.js} +1 -1
  67. package/dist/WhatsappBot-o5b_0CnB.js +629 -0
  68. package/dist/{WhatsappBotLogs-DDN4H_bv.js → WhatsappBotLogs-CK_V_iT5.js} +39 -39
  69. package/dist/WhatsappBotSettings-BooibLUg.js +694 -0
  70. package/dist/{WhatsappLayout-DSnq84Uo.js → WhatsappLayout-bOyNHGUI.js} +3 -3
  71. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-Cytrffdh.js +253 -0
  72. package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CR-F0x1r.js → ZodTextField.vue_vue_type_script_setup_true_lang-96t_eUzk.js} +2 -2
  73. package/dist/{app-Devzv4gO.js → app-DV3e2LkD.js} +342 -267
  74. package/dist/app.js +1 -1
  75. package/dist/{base.export-CCSMkvAm.js → base.export-DQUUtGmy.js} +2 -2
  76. package/dist/{business-BjAmUqNA.js → business-BZ0boE-5.js} +1 -1
  77. package/dist/{campaign-C5c47GqT.js → campaign-CsfFq2S-.js} +8 -8
  78. package/dist/{campaign-CTe-T5Gd.js → campaign-DMrtYWcs.js} +2 -2
  79. package/dist/{campaign.fn-DxAO8A5b.js → campaign.fn-C-CdNNdR.js} +185 -185
  80. package/dist/{collection.fn-C9l-OtNt.js → collection.fn-C-rryKSc.js} +2 -2
  81. package/dist/{currency-mwm4AWXK.js → currency-BOd9iVZV.js} +1 -1
  82. package/dist/{duplicateCampaign-BbC4AwQ1.js → duplicateCampaign-ey_rW0Bz.js} +2 -2
  83. package/dist/{effect-D8ba9z0K.js → effect-BP6Hkxmj.js} +1 -1
  84. package/dist/{email-addresses-BR5J6_Jz.js → email-addresses-CO61QAq0.js} +2 -2
  85. package/dist/{feature-flag-C-5NdFW8.js → feature-flag-Bq1SgbYC.js} +1 -1
  86. package/dist/{feature-flag-CNcU4_3r.js → feature-flag-lvPP0ED-.js} +1 -1
  87. package/dist/{helper-D9cEaMIv.js → helper-BRpts-M-.js} +1 -1
  88. package/dist/{index-OvnHt5x5.js → index-03WIXl-H.js} +2 -2
  89. package/dist/{index-BfoDdVQS.js → index-B0RavybO.js} +2 -2
  90. package/dist/{index-BvY2hQac.js → index-BDNkoALK.js} +1 -1
  91. package/dist/{index-CmzjBrHR.js → index-BV5aPSYo.js} +8 -8
  92. package/dist/{index-B_gzo75q.js → index-Bk20uvPY.js} +1 -1
  93. package/dist/{index-Drmh0FT-.js → index-Bn19rfby.js} +3 -3
  94. package/dist/{index-DwTBiVts.js → index-Cj-eugzc.js} +1 -1
  95. package/dist/{index-DtcUCknS.js → index-CoROn5OA.js} +2 -2
  96. package/dist/{index-DnepoNWn.js → index-CrBhcMaL.js} +3 -3
  97. package/dist/{index-CZfqqrVu.js → index-CsBjAM3E.js} +1 -1
  98. package/dist/{index-yGSko6Eq.js → index-D1t4_KaG.js} +1 -1
  99. package/dist/{index-B7HH6vKF.js → index-D3wGTCWf.js} +2 -2
  100. package/dist/{index-D34iYRdc.js → index-D41kjcrZ.js} +4 -4
  101. package/dist/{index-B1jP-_Z_.js → index-DIZLkVe0.js} +10 -10
  102. package/dist/{index-Ct6YjTIW.js → index-DucKyzrD.js} +2 -2
  103. package/dist/{index-D4k1G2oE.js → index-R5WS21OL.js} +1 -1
  104. package/dist/{index-BFaZp6Et.js → index-VYI0zWNC.js} +2 -2
  105. package/dist/{index-0H82-X0n.js → index-ZRE89TKq.js} +1 -1
  106. package/dist/{index-Byg4ztr-.js → index-_Cj-bsd_.js} +14 -14
  107. package/dist/{index-VqAbYyHH.js → index-mToWKHVs.js} +2 -2
  108. package/dist/{index.esm2017-DLb2VyCT.js → index.esm2017-B_Sag8Pg.js} +76 -76
  109. package/dist/{loading-CUNk5u1d.js → loading-C5fVI0ry.js} +1 -1
  110. package/dist/{lodash-BJXravls.js → lodash-COo8_xCU.js} +1 -1
  111. package/dist/{member-import-DjYoddBi.js → member-import-I_pKwUfF.js} +1 -1
  112. package/dist/{membership-ByJUFP8f.js → membership-BgfH9Kva.js} +2 -2
  113. package/dist/{money-Bf2IEMJJ.js → money-Cr07YDlV.js} +1 -1
  114. package/dist/{number-CRBHrRUL.js → number-DFsj0dkh.js} +1 -1
  115. package/dist/objectid-Cu89BzwI.js +145 -0
  116. package/dist/{onboarding-CQ3lw7eY.js → onboarding-DlkJCm-5.js} +3 -3
  117. package/dist/{onboardingSetup-CsdZKGFk.js → onboardingSetup-BEhVj613.js} +2 -2
  118. package/dist/{plugins-iTZLbJGy.js → plugins-CPTtiKqf.js} +3 -3
  119. package/dist/{reward-DTN6JpEd.js → reward-DqY0mQ_5.js} +1 -1
  120. package/dist/{rule-BYACNQOL.js → rule-mJJ48eKw.js} +9 -9
  121. package/dist/{template--Vr0PCjB.js → template-C1QftpDG.js} +6 -6
  122. package/dist/{timezone-DwzjOED-.js → timezone-BBgBHels.js} +1 -1
  123. package/dist/{transaction.fn-DapYe3n7.js → transaction.fn-Sr0hj3kY.js} +2 -2
  124. package/dist/{trigger-D8r76yb0.js → trigger-PUP0mwKM.js} +7 -7
  125. package/dist/{useMarketingMaterialActions-CdMmibPE.js → useMarketingMaterialActions-faslwaHd.js} +3 -3
  126. package/dist/{usePagination-BRcQJkO1.js → usePagination-Be6nIQ9y.js} +1 -1
  127. package/dist/{user-vBZFKqXQ.js → user-DBSYzG_9.js} +1 -1
  128. package/dist/{vue-i18n-Cw6fF11e.js → vue-i18n-C6c2jsH3.js} +409 -409
  129. package/dist/{xlsx-Muy_Rjhk.js → xlsx-Bfo19lFv.js} +224 -224
  130. package/dist/{zod-CCPTOeUz.js → zod-CihbDg3N.js} +1 -1
  131. package/package.json +1 -1
  132. package/dist/WhatsappBot-DB4NRZMd.js +0 -589
  133. package/dist/WhatsappBotSettings-Bkv1VNwF.js +0 -387
  134. package/dist/WhatsappBotTickets-DAKgnE6T.js +0 -162
  135. package/dist/WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-1BvxPD-k.js +0 -195
  136. package/dist/objectid-58gyOvdR.js +0 -145
  137. package/dist/useWhatsappAccount-BOJ8fz84.js +0 -62
@@ -0,0 +1,694 @@
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
+ };