@feedmepos/mf-connect 0.1.126-dev → 0.1.126-prod
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.
- package/dist/{App-B_Yp6cvN.js → App-DRHHPaMz.js} +216 -224
- package/dist/{Bin-CmIpEIwe.js → Bin-FkcYLSTm.js} +8 -8
- package/dist/{Broadcast-DkV4BdU_.js → Broadcast-Cgqp_BMa.js} +21 -22
- package/dist/{CampaignAnalytic-Dkwo_lpB.js → CampaignAnalytic-kKZ_BwW0.js} +7 -7
- package/dist/{CampaignTypeDialog.vue_vue_type_script_setup_true_lang-Ch8Gblw6.js → CampaignTypeDialog.vue_vue_type_script_setup_true_lang-CX0mWLjO.js} +10 -9
- package/dist/{Card-DXCkG34M.js → Card-Bu1y37hV.js} +23 -23
- package/dist/{Collections-CybPfSO4.js → Collections-B3mJkBCT.js} +185 -197
- package/dist/{Credit-B-KUzWsX.js → Credit-Bn-2EcVy.js} +20 -21
- package/dist/{DateRangeChip.vue_vue_type_script_setup_true_lang-CWHYeYVD.js → DateRangeChip.vue_vue_type_script_setup_true_lang-Cz7pZ7LD.js} +1 -1
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-DIUEjCFW.js +3638 -0
- package/dist/{EffectSheet.vue_vue_type_style_index_0_lang-nMcH6y5e.js → EffectSheet.vue_vue_type_style_index_0_lang-B7XBiv4l.js} +33 -33
- package/dist/{Experience-Q2NHpa-V.js → Experience-CunbmoAu.js} +31 -32
- package/dist/{FileSaver.min-CKw2rn-J.js → FileSaver.min-ChFSxYyS.js} +1 -1
- package/dist/{Game-lZvkg04z.js → Game-dFDwx_UJ.js} +18 -19
- package/dist/{GiftCardSetup-CPRju80_.js → GiftCardSetup-DYpEqqX0.js} +31 -31
- package/dist/{GoalPickerPanel.vue_vue_type_script_setup_true_lang-Ci686UoB.js → GoalPickerPanel.vue_vue_type_script_setup_true_lang-DxJdI6gc.js} +7 -7
- package/dist/{Goals-asGsUeVv.js → Goals-DuZzgM_K.js} +4 -4
- package/dist/{ImageInput.vue_vue_type_script_setup_true_lang-nk87zPWH.js → ImageInput.vue_vue_type_script_setup_true_lang-lDulspkF.js} +1 -1
- package/dist/{Index-DIasPS4Y.js → Index-BxB2ohT0.js} +10 -10
- package/dist/{LocationPicker.vue_vue_type_script_setup_true_lang-DkOn8p1v.js → LocationPicker.vue_vue_type_script_setup_true_lang-9sKJE1A5.js} +1 -1
- package/dist/{LottieAnimation.vue_vue_type_script_setup_true_lang-BdSkxiP-.js → LottieAnimation.vue_vue_type_script_setup_true_lang-CxBNYzcz.js} +1 -1
- package/dist/{LoyaltyDashboard-DlCsZ3YX.js → LoyaltyDashboard-DQzGvQ7j.js} +15 -15
- package/dist/{MainLayout-DLObnTAA.js → MainLayout-MAZ1S06H.js} +1 -1
- package/dist/{MainLayout.vue_vue_type_script_setup_true_lang-DigSZKt1.js → MainLayout.vue_vue_type_script_setup_true_lang-CeF3LU-N.js} +3 -3
- package/dist/{Marketing-JflPW-w9.js → Marketing-ACF6F7be.js} +4 -4
- package/dist/{MarketingMaterialEdit-fSAB3YVb.js → MarketingMaterialEdit-B8NfkoHg.js} +211 -214
- package/dist/{Member-CzNahXTj.js → Member-rLxDUOr8.js} +7 -7
- package/dist/{MemberDetailSheet.vue_vue_type_script_setup_true_lang-bqWUIbMG.js → MemberDetailSheet.vue_vue_type_script_setup_true_lang-Bq3UKX7v.js} +48 -40
- package/dist/{MemberImportHistory--r_A_2Es.js → MemberImportHistory-BuG6DmdV.js} +7 -7
- package/dist/{MemberList-CQZQ4sN8.js → MemberList-CC6zm_I6.js} +105 -103
- package/dist/{MemberTransactions-BPg9JaUA.js → MemberTransactions-Bw2xu6jZ.js} +1 -1
- package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-BhIFChx-.js → MessageInput.vue_vue_type_script_setup_true_lang-Cav8gQUK.js} +12 -12
- package/dist/{MetricInfoTooltip.vue_vue_type_script_setup_true_lang-CdGSNqEp.js → MetricInfoTooltip.vue_vue_type_script_setup_true_lang-8wdY4FnI.js} +1 -1
- package/dist/{Mission-CYCB3YQc.js → Mission-DnEcbALs.js} +21 -22
- package/dist/{Overview-DuNuUYYq.js → Overview-COytI5xN.js} +21 -21
- package/dist/{Overview-B5ylMBHT.js → Overview-DShFohlk.js} +144 -145
- package/dist/{Point-DG-Uwj25.js → Point-CWYwlx0i.js} +21 -22
- package/dist/{Promotion-DqxBQ1yO.js → Promotion-LBrQYtad.js} +131 -137
- package/dist/{Queue-Cy8LGt_Y.js → Queue-DKg5EvDM.js} +46 -46
- package/dist/{Record-CzXbu41w.js → Record--lYpawLN.js} +9 -9
- package/dist/{Review-7VL6gIqp.js → Review-C4pNmJ7n.js} +2 -2
- package/dist/ReviewFacebookCallback-BYXwKQNG.js +238 -0
- package/dist/{ReviewGoogleCallback-1JXR_f5O.js → ReviewGoogleCallback-ge8fL_A-.js} +5 -5
- package/dist/{Reward-BKhUDEu3.js → Reward-B67r1Bpz.js} +16 -16
- package/dist/{RewardGroup.vue_vue_type_script_setup_true_lang-DjjCytWF.js → RewardGroup.vue_vue_type_script_setup_true_lang-Bt0Kx2--.js} +14 -14
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-fLtn32Rw.js +1884 -0
- package/dist/{Segment-DdHDJhaS.js → Segment-DeSC3z5G.js} +307 -304
- package/dist/{SendCollectionSheet.vue_vue_type_script_setup_true_lang-9kGUkHMi.js → SendCollectionSheet.vue_vue_type_script_setup_true_lang-DdjC7X1V.js} +15 -15
- package/dist/{SendVoucherSheet.vue_vue_type_script_setup_true_lang-DeFw0px7.js → SendVoucherSheet.vue_vue_type_script_setup_true_lang-Crys59UO.js} +4 -4
- package/dist/{Setting-DZKGXw-i.js → Setting-DiDcMU5E.js} +17 -17
- package/dist/{SettingAdvertisements-BBNs8tCw.js → SettingAdvertisements-3wMI9egH.js} +12 -12
- package/dist/Settings-BR6Y1DBZ.js +179 -0
- package/dist/{Store-C8IlE4IH.js → Store-DgefqByH.js} +29 -29
- package/dist/{StoreRewards-DWygRLR1.js → StoreRewards-CS2h5RVB.js} +15 -15
- package/dist/{StoreTransactions.vue_vue_type_script_setup_true_lang-CeYYws6P.js → StoreTransactions.vue_vue_type_script_setup_true_lang-gPR8sn4k.js} +25 -25
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-Cjnkpd1j.js +142 -0
- package/dist/{Tier-7RoxGHsP.js → Tier-Cye6888q.js} +688 -2583
- package/dist/{Title-0q2Z4HIe.js → Title-B1eJh5oy.js} +95 -96
- package/dist/{Transaction-CFasERdg.js → Transaction-ouzdsBUx.js} +2 -2
- package/dist/{Upselling-DM9R6pYw.js → Upselling-CdQd2Fuk.js} +3 -3
- package/dist/{UserRuleGroup.vue_vue_type_script_setup_true_lang-BDjwcgnc.js → UserRuleGroup.vue_vue_type_script_setup_true_lang-BSlxe1Hf.js} +26 -26
- package/dist/{Voucher-BkzW2hVV.js → Voucher-CJJt8VlJ.js} +19 -19
- package/dist/{VoucherEditor.vue_vue_type_script_setup_true_lang-DaE4xa3x.js → VoucherEditor.vue_vue_type_script_setup_true_lang-BzbNaK6H.js} +12 -12
- package/dist/{WhatsappAccount-C3WpDF9O.js → WhatsappAccount-DIxSP6Tp.js} +6 -6
- package/dist/{WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-BxC_3h52.js → WhatsappAccountStatusLabel.vue_vue_type_script_setup_true_lang-L9Y5lAft.js} +1 -1
- package/dist/{WhatsappBot-DZb-Dn3s.js → WhatsappBot-BXxoaz7-.js} +6 -6
- package/dist/{WhatsappBotLogs--KskC32Z.js → WhatsappBotLogs-D8IfLHk3.js} +6 -6
- package/dist/WhatsappBotSettings-Bq9C7pNZ.js +704 -0
- package/dist/{WhatsappLayout-NIrFGbId.js → WhatsappLayout-3rWwmGRd.js} +3 -3
- package/dist/{WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-BfD5hHc7.js → WhatsappNotificationGroupDialog.vue_vue_type_script_setup_true_lang-C3N-loYJ.js} +3 -3
- package/dist/{ZodTextField.vue_vue_type_script_setup_true_lang-CJGxy7gf.js → ZodTextField.vue_vue_type_script_setup_true_lang-D1dORvMi.js} +2 -2
- package/dist/{app-B9nLnoBt.js → app-BXqas0p1.js} +3386 -4174
- package/dist/app.js +3 -4
- package/dist/{base.export-CBzNea0v.js → base.export-DQCZiS2E.js} +2 -2
- package/dist/{business-aT2zslwu.js → business-RsRhXSh8.js} +1 -1
- package/dist/{campaign-BDCLKFwN.js → campaign-C2X6aa7B.js} +25 -31
- package/dist/{campaign-B6nTwt17.js → campaign-DASPASQ0.js} +113 -126
- package/dist/{campaign.enum-Dx-Zo68Q.js → campaign.enum-BqekIiiN.js} +1 -2
- package/dist/campaign.fn-BEX99lsa.js +776 -0
- package/dist/{collection.fn-CDna_VLD.js → collection.fn-C7jNdh0A.js} +2 -2
- package/dist/{currency-Baum67Wz.js → currency-BvBM_Io9.js} +1 -1
- package/dist/{effect-CeJbflOK.js → effect-BA1yh6Mj.js} +1 -1
- package/dist/{email-addresses-Y3vF73J0.js → email-addresses-haS5P7hq.js} +2 -2
- package/dist/{feature-flag-zn6Ql9tv.js → feature-flag-B4bJnuei.js} +84 -84
- package/dist/google-C3S8u0mT.js +4 -0
- package/dist/{helper-DZvnn-yx.js → helper-BtTBvFuA.js} +1 -1
- package/dist/{index-CMs3aIA6.js → index-B1dAoOWi.js} +6 -19
- package/dist/{index-DXyOBtgF.js → index-B6A6sHpy.js} +1 -1
- package/dist/{index-B22ojkMy.js → index-BRTy6G9c.js} +2 -2
- package/dist/{index-r_T5o_hF.js → index-BV-YiCDM.js} +2 -2
- package/dist/{index-DJIt5tXC.js → index-BvFq5REc.js} +7 -7
- package/dist/{index-FgM7b2Sw.js → index-C2rjmdar.js} +2 -2
- package/dist/{index-DXKJsqgW.js → index-C7UBk5gq.js} +13 -31
- package/dist/{index-BqniSMV6.js → index-CBfVFFME.js} +197 -197
- package/dist/{index-B3LCTMwV.js → index-CH-uRaZH.js} +41 -52
- package/dist/{index-juXxYQ_a.js → index-CJ-BZCvB.js} +1242 -1314
- package/dist/{index-B5H4znfe.js → index-CXznvd79.js} +4 -4
- package/dist/{index-Da0-7h2j.js → index-ChGZ_S3V.js} +1 -1
- package/dist/{index-DCR1GFCA.js → index-D-D0s8PB.js} +234 -380
- package/dist/{index-BL2zQnXK.js → index-D9zjHXFU.js} +3 -3
- package/dist/{index-CPi3Qwmj.js → index-DAtVp1NI.js} +2613 -2699
- package/dist/{index-DkBOM8za.js → index-DeomfIu9.js} +251 -608
- package/dist/{index-DHNhIloU.js → index-Dg972Dfv.js} +1 -1
- package/dist/{index-BYUEPfbP.js → index-Dm2Dvxph.js} +23 -23
- package/dist/{index-njg4JLa-.js → index-DtbR7I4C.js} +9 -9
- package/dist/{index-B20FfbEE.js → index-Q-iHraJ3.js} +1 -1
- package/dist/{index-CDRTiAEu.js → index-g_SHjVWE.js} +1 -1
- package/dist/{index.esm2017-Dtk7BscN.js → index.esm2017-B7iE1Ggr.js} +93 -93
- package/dist/{loading-PoODMkQD.js → loading-BvlSfSVK.js} +1 -1
- package/dist/{lodash-TthNgH98.js → lodash-Daey2k0N.js} +1 -1
- package/dist/{member-import-D7zs0Jvh.js → member-import-CF9aym_y.js} +1 -1
- package/dist/{membership-Cab-iWQ1.js → membership-DfG-fl80.js} +2 -2
- package/dist/{money-9Q306M3g.js → money-SBIQhxqf.js} +1 -1
- package/dist/{number-D9M3D435.js → number-Cp1bFK9U.js} +1 -1
- package/dist/objectid-BMRA1fIL.js +145 -0
- package/dist/{onboarding-D5LKUHVI.js → onboarding-bjc7C8O-.js} +25 -25
- package/dist/{onboardingSetup-D0jsS6w5.js → onboardingSetup-BAu9TDI6.js} +2 -2
- package/dist/{plugins-CDTKQ1Pg.js → plugins-Def73Eyk.js} +3 -3
- package/dist/{reward-De3e9vYS.js → reward-KecVeztH.js} +1 -1
- package/dist/rule-builder-DgU6P24U.js +102 -0
- package/dist/{rule-trVJgEOe.js → rule-kMIC0vOi.js} +492 -572
- package/dist/style.css +1 -1
- package/dist/template-BH9vS8A9.js +275 -0
- package/dist/{timezone-DkuByUmb.js → timezone-CMX1sJ0a.js} +1 -1
- package/dist/{transaction.fn-CPE-oQhA.js → transaction.fn-Bjy5utxD.js} +2 -2
- package/dist/{trigger-C6oM-8pe.js → trigger-DnnOJVUi.js} +9 -9
- package/dist/{useMarketingMaterialActions-C5scdJQp.js → useMarketingMaterialActions-DMrNOpok.js} +4 -4
- package/dist/{usePagination-CIuTHSSG.js → usePagination-BCY4a-dh.js} +1 -1
- package/dist/{user-Bdlgn2yo.js → user-BTc0S1Vx.js} +1 -1
- package/dist/vue-i18n-7BKLPLxj.js +2365 -0
- package/dist/{xlsx-CvecxUOG.js → xlsx-DR5oLrEs.js} +1 -1
- package/dist/{zod-bniyeWdY.js → zod-CMq39HWn.js} +1 -1
- package/package.json +2 -6
- package/dist/AuditLogs-C1U17evK.js +0 -2016
- package/dist/EditCampaignSheet.vue_vue_type_script_setup_true_lang-C86llTFR.js +0 -4439
- package/dist/Grab-BjFLSMpE.js +0 -301
- package/dist/ReviewFacebookCallback-BwzuPmrz.js +0 -225
- package/dist/RuleGroup.vue_vue_type_script_setup_true_lang-Vg7pRGIz.js +0 -1923
- package/dist/Settings-9v0hnBJZ.js +0 -286
- package/dist/TargetLocationInput.vue_vue_type_script_setup_true_lang-BiN3uRJ_.js +0 -7007
- package/dist/WhatsappBotSettings-Dns_PqVE.js +0 -945
- package/dist/campaign.fn-Ck1t5C1T.js +0 -776
- package/dist/duplicateCampaign-BwrMZgaV.js +0 -51
- package/dist/google-BQK68wbe.js +0 -5
- package/dist/objectid-DKvQl6FD.js +0 -145
- package/dist/template-Bj3Tb6bP.js +0 -227
- package/dist/vue-i18n-DEpDI-dt.js +0 -2365
|
@@ -0,0 +1,704 @@
|
|
|
1
|
+
import { defineComponent as L, mergeModels as Z, useModel as H, openBlock as a, createElementBlock as i, createElementVNode as e, toDisplayString as l, unref as t, withDirectives as q, vModelText as re, resolveComponent as $, Fragment as O, renderList as ee, createBlock as P, ref as y, computed as E, watch as ce, onBeforeUnmount as ie, createCommentVNode as _, createVNode as S, createTextVNode as N, withCtx as ae, normalizeClass as X, vModelRadio as fe } from "vue";
|
|
2
|
+
import { u as U } from "./vue-i18n-7BKLPLxj.js";
|
|
3
|
+
import { useSnackbar as de } from "@feedmepos/ui-library";
|
|
4
|
+
import { F as J, a as W, b as ve, c as se, d as be, e as z, f as ge } from "./index-CH-uRaZH.js";
|
|
5
|
+
import { S as Q } from "./index-BvFq5REc.js";
|
|
6
|
+
import { w as Y } from "./index-C7UBk5gq.js";
|
|
7
|
+
import { p as he } from "./plugins-Def73Eyk.js";
|
|
8
|
+
const ye = { class: "flex flex-col gap-[10px]" }, _e = { class: "flex flex-col gap-[2px]" }, we = {
|
|
9
|
+
id: "whatsapp-bot-instructions-title",
|
|
10
|
+
class: "text-[16px] leading-[24px] font-semibold"
|
|
11
|
+
}, Be = {
|
|
12
|
+
id: "whatsapp-bot-instructions-description",
|
|
13
|
+
class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]"
|
|
14
|
+
}, ke = { class: "flex flex-col gap-[6px]" }, Se = ["placeholder", "maxlength", "disabled"], $e = {
|
|
15
|
+
id: "whatsapp-bot-instructions-count",
|
|
16
|
+
class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
|
|
17
|
+
}, Ae = /* @__PURE__ */ L({
|
|
18
|
+
__name: "BotInstructions",
|
|
19
|
+
props: /* @__PURE__ */ Z({
|
|
20
|
+
disabled: { type: Boolean }
|
|
21
|
+
}, {
|
|
22
|
+
modelValue: { required: !0 },
|
|
23
|
+
modelModifiers: {}
|
|
24
|
+
}),
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(p) {
|
|
27
|
+
const n = H(p, "modelValue"), { t: m } = U();
|
|
28
|
+
return (s, o) => (a(), i("div", ye, [
|
|
29
|
+
e("div", _e, [
|
|
30
|
+
e("h2", we, l(t(m)("connect.whatsappBot.botSettings.instructions")), 1),
|
|
31
|
+
e("p", Be, l(t(m)("connect.whatsappBot.botSettings.description")), 1)
|
|
32
|
+
]),
|
|
33
|
+
e("div", ke, [
|
|
34
|
+
q(e("textarea", {
|
|
35
|
+
"onUpdate:modelValue": o[0] || (o[0] = (v) => n.value = v),
|
|
36
|
+
"aria-labelledby": "whatsapp-bot-instructions-title",
|
|
37
|
+
"aria-describedby": "whatsapp-bot-instructions-description whatsapp-bot-instructions-count",
|
|
38
|
+
placeholder: t(m)("connect.whatsappBot.botSettings.placeholder"),
|
|
39
|
+
maxlength: t(J),
|
|
40
|
+
disabled: p.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, Se), [
|
|
44
|
+
[re, n.value]
|
|
45
|
+
]),
|
|
46
|
+
e("p", $e, l(n.value.length) + " / " + l(t(J)), 1)
|
|
47
|
+
])
|
|
48
|
+
]));
|
|
49
|
+
}
|
|
50
|
+
}), Te = { class: "overflow-x-auto" }, Ie = ["aria-label"], Fe = { 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" }, Ce = {
|
|
51
|
+
scope: "col",
|
|
52
|
+
class: "py-[10px] pl-[16px] pr-[8px] font-semibold"
|
|
53
|
+
}, Ee = {
|
|
54
|
+
scope: "col",
|
|
55
|
+
class: "px-[8px] py-[10px] font-semibold"
|
|
56
|
+
}, Ve = {
|
|
57
|
+
scope: "col",
|
|
58
|
+
class: "px-[8px] py-[10px] font-semibold"
|
|
59
|
+
}, Pe = {
|
|
60
|
+
scope: "col",
|
|
61
|
+
class: "py-[10px] pl-[8px] pr-[16px]"
|
|
62
|
+
}, Ne = { class: "sr-only" }, De = { class: "text-[14px] leading-[20px]" }, Oe = { class: "py-[8px] pl-[16px] pr-[8px] font-medium" }, Le = ["title"], Ue = { class: "px-[8px] py-[8px] text-fm-color-typo-secondary tabular-nums" }, Me = ["title"], Re = { class: "px-[8px] py-[8px] text-fm-color-typo-tertiary tabular-nums" }, We = ["datetime", "title"], ze = { class: "py-[8px] pl-[8px] pr-[16px]" }, He = ["aria-label", "disabled", "aria-busy", "onClick"], Ge = { key: 1 }, ne = /* @__PURE__ */ L({
|
|
63
|
+
__name: "ExcludedAccountsTable",
|
|
64
|
+
props: {
|
|
65
|
+
accounts: {},
|
|
66
|
+
removingId: {}
|
|
67
|
+
},
|
|
68
|
+
emits: ["remove"],
|
|
69
|
+
setup(p, { emit: n }) {
|
|
70
|
+
const m = n, { t: s, locale: o } = U();
|
|
71
|
+
function v(f) {
|
|
72
|
+
return f.customerName || f.phoneNumber || f.conversationId;
|
|
73
|
+
}
|
|
74
|
+
function u(f) {
|
|
75
|
+
return new Intl.DateTimeFormat(o.value, {
|
|
76
|
+
dateStyle: "medium",
|
|
77
|
+
timeStyle: "short"
|
|
78
|
+
}).format(new Date(f));
|
|
79
|
+
}
|
|
80
|
+
return (f, h) => {
|
|
81
|
+
const w = $("FmCircularProgress");
|
|
82
|
+
return a(), i("div", Te, [
|
|
83
|
+
e("table", {
|
|
84
|
+
"aria-label": t(s)("connect.whatsappBot.excludedAccounts.title"),
|
|
85
|
+
class: "w-full min-w-[600px] table-fixed border-collapse text-left"
|
|
86
|
+
}, [
|
|
87
|
+
h[0] || (h[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", Fe, [
|
|
94
|
+
e("tr", null, [
|
|
95
|
+
e("th", Ce, l(t(s)("connect.whatsappBot.excludedAccounts.name")), 1),
|
|
96
|
+
e("th", Ee, l(t(s)("connect.whatsappBot.excludedAccounts.phoneNumber")), 1),
|
|
97
|
+
e("th", Ve, l(t(s)("connect.whatsappBot.excludedAccounts.excludedOn")), 1),
|
|
98
|
+
e("th", Pe, [
|
|
99
|
+
e("span", Ne, l(t(s)("connect.whatsappBot.excludedAccounts.actions")), 1)
|
|
100
|
+
])
|
|
101
|
+
])
|
|
102
|
+
]),
|
|
103
|
+
e("tbody", De, [
|
|
104
|
+
(a(!0), i(O, null, ee(p.accounts, (r) => (a(), i("tr", {
|
|
105
|
+
key: r.id,
|
|
106
|
+
class: "border-b border-fm-color-neutral-gray-100 last:border-b-0"
|
|
107
|
+
}, [
|
|
108
|
+
e("td", Oe, [
|
|
109
|
+
e("span", {
|
|
110
|
+
class: "block truncate",
|
|
111
|
+
title: v(r)
|
|
112
|
+
}, l(v(r)), 9, Le)
|
|
113
|
+
]),
|
|
114
|
+
e("td", Ue, [
|
|
115
|
+
e("span", {
|
|
116
|
+
class: "block truncate",
|
|
117
|
+
title: r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")
|
|
118
|
+
}, l(r.phoneNumber || t(s)("connect.whatsappBot.phoneUnavailable")), 9, Me)
|
|
119
|
+
]),
|
|
120
|
+
e("td", Re, [
|
|
121
|
+
e("time", {
|
|
122
|
+
datetime: r.updatedAt,
|
|
123
|
+
title: u(r.updatedAt),
|
|
124
|
+
class: "block truncate"
|
|
125
|
+
}, l(u(r.updatedAt)), 9, We)
|
|
126
|
+
]),
|
|
127
|
+
e("td", ze, [
|
|
128
|
+
e("button", {
|
|
129
|
+
type: "button",
|
|
130
|
+
"aria-label": t(s)("connect.whatsappBot.excludedAccounts.removeAccount", {
|
|
131
|
+
name: v(r)
|
|
132
|
+
}),
|
|
133
|
+
disabled: !!p.removingId,
|
|
134
|
+
"aria-busy": p.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: (T) => m("remove", r)
|
|
137
|
+
}, [
|
|
138
|
+
p.removingId === r.id ? (a(), P(w, {
|
|
139
|
+
key: 0,
|
|
140
|
+
size: "md",
|
|
141
|
+
"aria-hidden": "true"
|
|
142
|
+
})) : (a(), i("span", Ge, l(t(s)("connect.common.remove")), 1))
|
|
143
|
+
], 8, He)
|
|
144
|
+
])
|
|
145
|
+
]))), 128))
|
|
146
|
+
])
|
|
147
|
+
], 8, Ie)
|
|
148
|
+
]);
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}), Ke = {
|
|
152
|
+
id: "whatsapp-excluded-accounts",
|
|
153
|
+
"aria-labelledby": "whatsapp-excluded-accounts-title",
|
|
154
|
+
class: "flex min-w-0 flex-col gap-[12px]"
|
|
155
|
+
}, je = { class: "flex flex-col gap-[2px]" }, Xe = {
|
|
156
|
+
id: "whatsapp-excluded-accounts-title",
|
|
157
|
+
class: "text-[16px] leading-[24px] font-semibold"
|
|
158
|
+
}, Je = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Qe = {
|
|
159
|
+
key: 0,
|
|
160
|
+
role: "alert",
|
|
161
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
162
|
+
}, Ye = {
|
|
163
|
+
key: 1,
|
|
164
|
+
class: "flex flex-col items-center gap-[12px] py-[32px] text-[14px] text-fm-color-typo-secondary"
|
|
165
|
+
}, Ze = {
|
|
166
|
+
key: 0,
|
|
167
|
+
class: "flex flex-wrap items-center gap-[12px]"
|
|
168
|
+
}, qe = {
|
|
169
|
+
role: "alert",
|
|
170
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
171
|
+
}, et = {
|
|
172
|
+
key: 1,
|
|
173
|
+
class: "flex flex-col items-center gap-[6px] rounded-[16px] border border-fm-color-neutral-gray-200 px-[24px] py-[32px] text-center"
|
|
174
|
+
}, tt = { class: "text-[16px] leading-[24px] font-semibold" }, ot = { class: "max-w-[420px] text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, lt = {
|
|
175
|
+
key: 2,
|
|
176
|
+
class: "overflow-hidden rounded-[16px] border border-fm-color-neutral-gray-100 bg-fm-color-neutral-white"
|
|
177
|
+
}, at = { class: "flex min-w-0 flex-col" }, st = { class: "text-[18px] leading-[24px] font-semibold" }, nt = { class: "text-[14px] leading-[20px] text-fm-color-typo-tertiary" }, rt = {
|
|
178
|
+
key: 0,
|
|
179
|
+
role: "alert",
|
|
180
|
+
class: "mb-[12px] text-[14px] text-fm-color-typo-error"
|
|
181
|
+
}, ct = {
|
|
182
|
+
key: 1,
|
|
183
|
+
class: "px-[24px] py-[40px] text-center text-[14px] text-fm-color-typo-secondary"
|
|
184
|
+
}, it = /* @__PURE__ */ L({
|
|
185
|
+
__name: "ExcludedAccounts",
|
|
186
|
+
props: {
|
|
187
|
+
accounts: {},
|
|
188
|
+
loading: { type: Boolean },
|
|
189
|
+
error: {}
|
|
190
|
+
},
|
|
191
|
+
emits: ["retry", "removed"],
|
|
192
|
+
setup(p, { emit: n }) {
|
|
193
|
+
const m = p, s = n, { t: o } = U(), v = de(), u = y(""), f = y(""), h = y(!1);
|
|
194
|
+
let w;
|
|
195
|
+
const r = E(
|
|
196
|
+
() => [...m.accounts].sort((x, b) => b.updatedAt.localeCompare(x.updatedAt))
|
|
197
|
+
), T = E(() => r.value.slice(0, 3));
|
|
198
|
+
async function C(x) {
|
|
199
|
+
if (u.value) return;
|
|
200
|
+
const b = Q.getBusinessId();
|
|
201
|
+
if (!b || x.businessId !== b) return;
|
|
202
|
+
const B = new AbortController();
|
|
203
|
+
w = B, u.value = x.id, f.value = "";
|
|
204
|
+
try {
|
|
205
|
+
if (await Y.removeExcludedAccount(
|
|
206
|
+
b,
|
|
207
|
+
x.id,
|
|
208
|
+
B.signal
|
|
209
|
+
), B.signal.aborted) return;
|
|
210
|
+
s("removed", x.id), v.open({
|
|
211
|
+
type: "success",
|
|
212
|
+
message: o("connect.whatsappBot.excludedAccounts.removed", {
|
|
213
|
+
name: x.customerName || x.phoneNumber || x.conversationId
|
|
214
|
+
})
|
|
215
|
+
});
|
|
216
|
+
} catch (I) {
|
|
217
|
+
B.signal.aborted || (f.value = I instanceof Error ? I.message : o("connect.whatsappBot.excludedAccounts.removeError"), v.open({ type: "error", message: f.value }));
|
|
218
|
+
} finally {
|
|
219
|
+
B.signal.aborted || (u.value = "");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function g() {
|
|
223
|
+
w == null || w.abort(), u.value = "", f.value = "", h.value = !1;
|
|
224
|
+
}
|
|
225
|
+
return ce(() => Q.getBusinessId(), g), ie(g), (x, b) => {
|
|
226
|
+
const B = $("FmCircularProgress"), I = $("FmButton"), G = $("FmIcon"), K = $("FmDialog");
|
|
227
|
+
return a(), i(O, null, [
|
|
228
|
+
e("section", Ke, [
|
|
229
|
+
e("div", je, [
|
|
230
|
+
e("h2", Xe, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
|
|
231
|
+
e("p", Je, l(t(o)("connect.whatsappBot.excludedAccounts.description")), 1)
|
|
232
|
+
]),
|
|
233
|
+
f.value ? (a(), i("p", Qe, l(f.value), 1)) : _("", !0),
|
|
234
|
+
p.loading ? (a(), i("output", Ye, [
|
|
235
|
+
S(B),
|
|
236
|
+
N(" " + l(t(o)("connect.whatsappBot.excludedAccounts.loading")), 1)
|
|
237
|
+
])) : (a(), i(O, { key: 2 }, [
|
|
238
|
+
p.error ? (a(), i("div", Ze, [
|
|
239
|
+
e("p", qe, l(p.error), 1),
|
|
240
|
+
S(I, {
|
|
241
|
+
variant: "secondary",
|
|
242
|
+
"border-color": "neutral-gray-200",
|
|
243
|
+
label: t(o)("connect.whatsappBot.tryAgain"),
|
|
244
|
+
"prepend-icon": "refresh",
|
|
245
|
+
class: "!rounded-full [&_.label]:text-[14px]",
|
|
246
|
+
onClick: b[0] || (b[0] = (V) => s("retry"))
|
|
247
|
+
}, null, 8, ["label"])
|
|
248
|
+
])) : _("", !0),
|
|
249
|
+
!r.value.length && !p.error ? (a(), i("div", et, [
|
|
250
|
+
e("h3", tt, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1),
|
|
251
|
+
e("p", ot, l(t(o)("connect.whatsappBot.excludedAccounts.emptyDescription")), 1)
|
|
252
|
+
])) : r.value.length ? (a(), i("div", lt, [
|
|
253
|
+
S(ne, {
|
|
254
|
+
accounts: T.value,
|
|
255
|
+
"removing-id": u.value,
|
|
256
|
+
onRemove: C
|
|
257
|
+
}, null, 8, ["accounts", "removing-id"]),
|
|
258
|
+
r.value.length > T.value.length ? (a(), i("button", {
|
|
259
|
+
key: 0,
|
|
260
|
+
type: "button",
|
|
261
|
+
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",
|
|
262
|
+
onClick: b[1] || (b[1] = (V) => h.value = !0)
|
|
263
|
+
}, [
|
|
264
|
+
N(l(t(o)("connect.whatsappBot.excludedAccounts.showAll", {
|
|
265
|
+
count: r.value.length
|
|
266
|
+
})) + " ", 1),
|
|
267
|
+
S(G, {
|
|
268
|
+
name: "chevron_right",
|
|
269
|
+
size: "sm",
|
|
270
|
+
"aria-hidden": "true"
|
|
271
|
+
})
|
|
272
|
+
])) : _("", !0)
|
|
273
|
+
])) : _("", !0)
|
|
274
|
+
], 64))
|
|
275
|
+
]),
|
|
276
|
+
S(K, {
|
|
277
|
+
modelValue: h.value,
|
|
278
|
+
"onUpdate:modelValue": b[2] || (b[2] = (V) => h.value = V),
|
|
279
|
+
"min-width": "min(720px, calc(100% - 32px))",
|
|
280
|
+
"max-width": "720px",
|
|
281
|
+
"max-height": "90vh",
|
|
282
|
+
"dismiss-away": ""
|
|
283
|
+
}, {
|
|
284
|
+
"dialog-header": ae(() => [
|
|
285
|
+
e("div", at, [
|
|
286
|
+
e("h2", st, l(t(o)("connect.whatsappBot.excludedAccounts.title")), 1),
|
|
287
|
+
e("p", nt, l(t(o)("connect.whatsappBot.accountCount", r.value.length)), 1)
|
|
288
|
+
])
|
|
289
|
+
]),
|
|
290
|
+
default: ae(() => [
|
|
291
|
+
f.value ? (a(), i("p", rt, l(f.value), 1)) : _("", !0),
|
|
292
|
+
r.value.length ? (a(), P(ne, {
|
|
293
|
+
key: 2,
|
|
294
|
+
accounts: r.value,
|
|
295
|
+
"removing-id": u.value,
|
|
296
|
+
onRemove: C
|
|
297
|
+
}, null, 8, ["accounts", "removing-id"])) : (a(), i("p", ct, l(t(o)("connect.whatsappBot.excludedAccounts.emptyTitle")), 1))
|
|
298
|
+
]),
|
|
299
|
+
_: 1
|
|
300
|
+
}, 8, ["modelValue"])
|
|
301
|
+
], 64);
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}), dt = {
|
|
305
|
+
"aria-labelledby": "knowledge-base-title",
|
|
306
|
+
class: "flex flex-col gap-[10px]"
|
|
307
|
+
}, pt = { class: "flex flex-col gap-[2px]" }, ut = {
|
|
308
|
+
id: "knowledge-base-title",
|
|
309
|
+
class: "text-[16px] leading-[24px] font-semibold"
|
|
310
|
+
}, mt = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, xt = { class: "flex flex-wrap gap-[8px]" }, ft = ["title", "aria-expanded", "disabled", "onClick"], vt = ["disabled"], bt = {
|
|
311
|
+
key: 0,
|
|
312
|
+
class: "text-[14px] text-fm-color-typo-tertiary"
|
|
313
|
+
}, gt = {
|
|
314
|
+
key: 1,
|
|
315
|
+
class: "text-[14px] text-fm-color-typo-secondary"
|
|
316
|
+
}, ht = { class: "flex flex-col gap-[6px]" }, yt = {
|
|
317
|
+
for: "whatsapp-knowledge-topic-description",
|
|
318
|
+
class: "text-[14px] leading-[20px] font-medium text-fm-color-typo-secondary"
|
|
319
|
+
}, _t = ["placeholder", "maxlength", "disabled"], wt = {
|
|
320
|
+
id: "whatsapp-knowledge-topic-description-count",
|
|
321
|
+
class: "text-right text-[12px] leading-[16px] text-fm-color-typo-tertiary tabular-nums"
|
|
322
|
+
}, Bt = /* @__PURE__ */ L({
|
|
323
|
+
__name: "KnowledgeBase",
|
|
324
|
+
props: /* @__PURE__ */ Z({
|
|
325
|
+
disabled: { type: Boolean }
|
|
326
|
+
}, {
|
|
327
|
+
modelValue: {
|
|
328
|
+
required: !0
|
|
329
|
+
},
|
|
330
|
+
modelModifiers: {},
|
|
331
|
+
activeTopicIndex: {
|
|
332
|
+
required: !0
|
|
333
|
+
},
|
|
334
|
+
activeTopicIndexModifiers: {}
|
|
335
|
+
}),
|
|
336
|
+
emits: ["update:modelValue", "update:activeTopicIndex"],
|
|
337
|
+
setup(p) {
|
|
338
|
+
const n = p, m = H(p, "modelValue"), s = H(p, "activeTopicIndex"), { t: o } = U(), v = E(
|
|
339
|
+
() => s.value === null ? null : m.value[s.value]
|
|
340
|
+
);
|
|
341
|
+
function u() {
|
|
342
|
+
n.disabled || m.value.length >= W || (m.value.push({ title: "", description: "" }), s.value = m.value.length - 1);
|
|
343
|
+
}
|
|
344
|
+
function f() {
|
|
345
|
+
n.disabled || s.value === null || (m.value.splice(s.value, 1), s.value = null);
|
|
346
|
+
}
|
|
347
|
+
return (h, w) => {
|
|
348
|
+
const r = $("FmIcon"), T = $("FmTextField"), C = $("FmButton");
|
|
349
|
+
return a(), i("section", dt, [
|
|
350
|
+
e("div", pt, [
|
|
351
|
+
e("h2", ut, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.title")), 1),
|
|
352
|
+
e("p", mt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.description")), 1)
|
|
353
|
+
]),
|
|
354
|
+
e("div", xt, [
|
|
355
|
+
(a(!0), i(O, null, ee(m.value, (g, x) => (a(), i("button", {
|
|
356
|
+
key: x,
|
|
357
|
+
type: "button",
|
|
358
|
+
title: g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled"),
|
|
359
|
+
"aria-expanded": s.value === x,
|
|
360
|
+
"aria-controls": "knowledge-topic-editor",
|
|
361
|
+
disabled: p.disabled,
|
|
362
|
+
class: X(["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", [
|
|
363
|
+
s.value === x ? "border-fm-color-primary bg-fm-color-primary-oats text-fm-color-primary" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
|
|
364
|
+
p.disabled ? "cursor-default" : "cursor-pointer hover:border-fm-color-primary"
|
|
365
|
+
]]),
|
|
366
|
+
onClick: (b) => s.value = s.value === x ? null : x
|
|
367
|
+
}, l(g.title.trim() || t(o)("connect.whatsappBot.botSettings.knowledgeBase.untitled")), 11, ft))), 128)),
|
|
368
|
+
e("button", {
|
|
369
|
+
type: "button",
|
|
370
|
+
disabled: p.disabled || m.value.length >= t(W),
|
|
371
|
+
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",
|
|
372
|
+
onClick: u
|
|
373
|
+
}, [
|
|
374
|
+
S(r, {
|
|
375
|
+
name: "add",
|
|
376
|
+
size: "sm"
|
|
377
|
+
}),
|
|
378
|
+
N(" " + l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.addTopic")), 1)
|
|
379
|
+
], 8, vt)
|
|
380
|
+
]),
|
|
381
|
+
m.value.length === 0 ? (a(), i("p", bt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.empty")), 1)) : _("", !0),
|
|
382
|
+
m.value.length >= t(W) ? (a(), i("p", gt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.topicLimit", {
|
|
383
|
+
count: t(W)
|
|
384
|
+
})), 1)) : _("", !0),
|
|
385
|
+
v.value ? (a(), i("div", {
|
|
386
|
+
id: "knowledge-topic-editor",
|
|
387
|
+
key: s.value ?? void 0,
|
|
388
|
+
class: "rounded-[8px] border-[1px] border-fm-color-neutral-gray-100 p-[16px] flex flex-col gap-[10px]"
|
|
389
|
+
}, [
|
|
390
|
+
S(T, {
|
|
391
|
+
modelValue: v.value.title,
|
|
392
|
+
"onUpdate:modelValue": w[0] || (w[0] = (g) => v.value.title = g),
|
|
393
|
+
label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titleLabel"),
|
|
394
|
+
placeholder: t(o)("connect.whatsappBot.botSettings.knowledgeBase.titlePlaceholder"),
|
|
395
|
+
"max-length": t(ve),
|
|
396
|
+
disabled: p.disabled
|
|
397
|
+
}, null, 8, ["modelValue", "label", "placeholder", "max-length", "disabled"]),
|
|
398
|
+
e("div", ht, [
|
|
399
|
+
e("label", yt, l(t(o)("connect.whatsappBot.botSettings.knowledgeBase.descriptionLabel")), 1),
|
|
400
|
+
q(e("textarea", {
|
|
401
|
+
id: "whatsapp-knowledge-topic-description",
|
|
402
|
+
"onUpdate:modelValue": w[1] || (w[1] = (g) => v.value.description = g),
|
|
403
|
+
"aria-describedby": "whatsapp-knowledge-topic-description-count",
|
|
404
|
+
placeholder: t(o)(
|
|
405
|
+
"connect.whatsappBot.botSettings.knowledgeBase.descriptionPlaceholder"
|
|
406
|
+
),
|
|
407
|
+
maxlength: t(se),
|
|
408
|
+
disabled: p.disabled,
|
|
409
|
+
rows: "5",
|
|
410
|
+
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"
|
|
411
|
+
}, null, 8, _t), [
|
|
412
|
+
[re, v.value.description]
|
|
413
|
+
]),
|
|
414
|
+
e("p", wt, l(v.value.description.length) + " / " + l(t(se)), 1)
|
|
415
|
+
]),
|
|
416
|
+
S(C, {
|
|
417
|
+
variant: "plain",
|
|
418
|
+
size: "sm",
|
|
419
|
+
"prepend-icon": "delete",
|
|
420
|
+
"text-color": "typo-error",
|
|
421
|
+
label: t(o)("connect.whatsappBot.botSettings.knowledgeBase.removeTopic"),
|
|
422
|
+
disabled: p.disabled,
|
|
423
|
+
class: "self-start",
|
|
424
|
+
onClick: f
|
|
425
|
+
}, null, 8, ["label", "disabled"])
|
|
426
|
+
])) : _("", !0)
|
|
427
|
+
]);
|
|
428
|
+
};
|
|
429
|
+
}
|
|
430
|
+
}), kt = {
|
|
431
|
+
"aria-labelledby": "response-speed-title",
|
|
432
|
+
class: "flex flex-col gap-[12px]"
|
|
433
|
+
}, St = { class: "flex flex-col gap-[2px]" }, $t = {
|
|
434
|
+
id: "response-speed-title",
|
|
435
|
+
class: "text-[16px] leading-[24px] font-semibold"
|
|
436
|
+
}, At = { class: "text-[14px] leading-[20px] text-fm-color-typo-secondary [text-wrap:pretty]" }, Tt = {
|
|
437
|
+
role: "radiogroup",
|
|
438
|
+
"aria-labelledby": "response-speed-title",
|
|
439
|
+
"aria-describedby": "response-speed-detail",
|
|
440
|
+
class: "grid grid-cols-[repeat(auto-fit,minmax(150px,1fr))] gap-[8px]"
|
|
441
|
+
}, It = ["value", "disabled"], Ft = { class: "flex items-center gap-[8px] text-[14px] leading-[20px] font-semibold" }, Ct = {
|
|
442
|
+
key: 0,
|
|
443
|
+
class: "w-[8px] h-[8px] rounded-full bg-fm-color-primary"
|
|
444
|
+
}, Et = { class: "text-[12px] leading-[16px] text-fm-color-typo-secondary" }, Vt = {
|
|
445
|
+
id: "response-speed-detail",
|
|
446
|
+
"aria-live": "polite",
|
|
447
|
+
class: "text-[14px] leading-[20px] text-fm-color-typo-secondary"
|
|
448
|
+
}, Pt = {
|
|
449
|
+
key: 0,
|
|
450
|
+
class: "rounded-[8px] bg-fm-color-system-warning-100 px-[12px] py-[10px] flex items-start gap-[10px] text-[14px] leading-[20px]"
|
|
451
|
+
}, Nt = /* @__PURE__ */ L({
|
|
452
|
+
__name: "ResponseSpeed",
|
|
453
|
+
props: /* @__PURE__ */ Z({
|
|
454
|
+
disabled: { type: Boolean }
|
|
455
|
+
}, {
|
|
456
|
+
modelValue: {
|
|
457
|
+
required: !0
|
|
458
|
+
},
|
|
459
|
+
modelModifiers: {}
|
|
460
|
+
}),
|
|
461
|
+
emits: ["update:modelValue"],
|
|
462
|
+
setup(p) {
|
|
463
|
+
const n = H(p, "modelValue"), { t: m } = U();
|
|
464
|
+
return (s, o) => {
|
|
465
|
+
const v = $("FmIcon");
|
|
466
|
+
return a(), i("section", kt, [
|
|
467
|
+
e("div", St, [
|
|
468
|
+
e("h2", $t, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.title")), 1),
|
|
469
|
+
e("p", At, l(t(m)("connect.whatsappBot.botSettings.responseSpeed.description")), 1)
|
|
470
|
+
]),
|
|
471
|
+
e("div", Tt, [
|
|
472
|
+
(a(!0), i(O, null, ee(t(be), (u) => (a(), i("label", { key: u }, [
|
|
473
|
+
q(e("input", {
|
|
474
|
+
"onUpdate:modelValue": o[0] || (o[0] = (f) => n.value = f),
|
|
475
|
+
type: "radio",
|
|
476
|
+
name: "response-speed",
|
|
477
|
+
value: u,
|
|
478
|
+
disabled: p.disabled,
|
|
479
|
+
class: "sr-only peer"
|
|
480
|
+
}, null, 8, It), [
|
|
481
|
+
[fe, n.value]
|
|
482
|
+
]),
|
|
483
|
+
e("span", {
|
|
484
|
+
class: X(["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", [
|
|
485
|
+
n.value === u ? "border-fm-color-primary bg-fm-color-primary-oats" : "border-fm-color-neutral-gray-200 bg-fm-color-neutral-white",
|
|
486
|
+
p.disabled ? "cursor-default opacity-60" : "cursor-pointer hover:border-fm-color-primary"
|
|
487
|
+
]])
|
|
488
|
+
}, [
|
|
489
|
+
e("span", Ft, [
|
|
490
|
+
e("span", {
|
|
491
|
+
"aria-hidden": "true",
|
|
492
|
+
class: X([
|
|
493
|
+
"w-[16px] h-[16px] shrink-0 rounded-full border-[1.5px] bg-fm-color-neutral-white flex items-center justify-center",
|
|
494
|
+
n.value === u ? "border-fm-color-primary" : "border-fm-color-neutral-gray-300"
|
|
495
|
+
])
|
|
496
|
+
}, [
|
|
497
|
+
n.value === u ? (a(), i("span", Ct)) : _("", !0)
|
|
498
|
+
], 2),
|
|
499
|
+
N(" " + l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.label`)), 1)
|
|
500
|
+
]),
|
|
501
|
+
e("span", Et, l(t(m)(`connect.whatsappBot.botSettings.responseSpeed.${u}.hint`)), 1)
|
|
502
|
+
], 2)
|
|
503
|
+
]))), 128))
|
|
504
|
+
]),
|
|
505
|
+
e("p", Vt, l(t(m)(
|
|
506
|
+
`connect.whatsappBot.botSettings.responseSpeed.${n.value}.detail`
|
|
507
|
+
)), 1),
|
|
508
|
+
n.value === "immediate" ? (a(), i("div", Pt, [
|
|
509
|
+
S(v, {
|
|
510
|
+
name: "warning",
|
|
511
|
+
size: "sm",
|
|
512
|
+
class: "mt-[2px] shrink-0 text-fm-color-typo-warning"
|
|
513
|
+
}),
|
|
514
|
+
N(" " + l(t(m)("connect.whatsappBot.botSettings.responseSpeed.immediateWarning")), 1)
|
|
515
|
+
])) : _("", !0)
|
|
516
|
+
]);
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
}), Dt = { class: "mt-[20px] mx-auto w-full min-w-0 flex flex-col gap-[20px]" }, Ot = {
|
|
520
|
+
key: 0,
|
|
521
|
+
class: "py-[56px] flex flex-col items-center gap-[12px] text-[14px] text-fm-color-typo-secondary"
|
|
522
|
+
}, Lt = { class: "border-t border-fm-color-neutral-gray-100 pt-[20px]" }, Ut = { class: "group border-t border-fm-color-neutral-gray-100 pt-[12px]" }, Mt = { 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" }, Rt = { class: "mt-[20px] flex flex-col gap-[20px]" }, Wt = {
|
|
523
|
+
key: 1,
|
|
524
|
+
role: "alert",
|
|
525
|
+
class: "text-[14px] text-fm-color-typo-error"
|
|
526
|
+
}, zt = { class: "flex items-center justify-end gap-[12px] flex-wrap" }, Yt = /* @__PURE__ */ L({
|
|
527
|
+
__name: "WhatsappBotSettings",
|
|
528
|
+
setup(p) {
|
|
529
|
+
const { t: n } = U(), m = de(), s = E(() => Q.getBusinessId() ?? ""), o = y(""), v = y(""), u = y([]), f = y([]), h = y(null), w = E(
|
|
530
|
+
() => u.value.filter(
|
|
531
|
+
(d) => d.title.trim() || d.description.trim()
|
|
532
|
+
)
|
|
533
|
+
), r = y(
|
|
534
|
+
z
|
|
535
|
+
), T = y(
|
|
536
|
+
z
|
|
537
|
+
), C = y(!0), g = y(!1), x = y(!1), b = y(""), B = y([]), I = y(""), G = J, K = E(
|
|
538
|
+
() => o.value !== v.value || r.value !== T.value || JSON.stringify(u.value) !== JSON.stringify(f.value)
|
|
539
|
+
), V = E(
|
|
540
|
+
() => !g.value || x.value || !K.value
|
|
541
|
+
), te = E(
|
|
542
|
+
() => !g.value || x.value || o.value.length > G || !ge.safeParse(w.value).success
|
|
543
|
+
);
|
|
544
|
+
let A, M;
|
|
545
|
+
function oe(d) {
|
|
546
|
+
B.value = d.excludedAccounts, o.value = d.botInstructions, v.value = d.botInstructions, r.value = d.responseSpeed, T.value = d.responseSpeed, u.value = d.knowledgeBase.map((c) => ({ ...c })), f.value = d.knowledgeBase.map((c) => ({
|
|
547
|
+
...c
|
|
548
|
+
}));
|
|
549
|
+
}
|
|
550
|
+
function pe(d, c) {
|
|
551
|
+
const k = d instanceof Error ? d.message : n("connect.whatsappBot.errors.loadSettings");
|
|
552
|
+
c ? I.value = k : b.value = k;
|
|
553
|
+
}
|
|
554
|
+
async function R(d = !1) {
|
|
555
|
+
if (d && x.value) return;
|
|
556
|
+
clearTimeout(M), A == null || A.abort();
|
|
557
|
+
const c = new AbortController();
|
|
558
|
+
A = c, d || (C.value = !0, g.value = !1, x.value = !1, b.value = "", o.value = "", v.value = "", r.value = z, T.value = z, u.value = [], f.value = [], h.value = null, B.value = [], I.value = "");
|
|
559
|
+
try {
|
|
560
|
+
if (!s.value)
|
|
561
|
+
throw new Error(n("connect.whatsappBot.errors.selectBusiness"));
|
|
562
|
+
const k = await Y.getSettings(
|
|
563
|
+
s.value,
|
|
564
|
+
c.signal
|
|
565
|
+
);
|
|
566
|
+
if (c.signal.aborted) return;
|
|
567
|
+
B.value = k.excludedAccounts, I.value = "", d || (oe(k), g.value = !0);
|
|
568
|
+
} catch (k) {
|
|
569
|
+
c.signal.aborted || pe(k, d);
|
|
570
|
+
} finally {
|
|
571
|
+
c.signal.aborted || (C.value = !1, g.value && le());
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
function le() {
|
|
575
|
+
clearTimeout(M), M = setTimeout(() => void R(!0), 1e4);
|
|
576
|
+
}
|
|
577
|
+
function ue(d) {
|
|
578
|
+
B.value = B.value.filter(
|
|
579
|
+
(c) => c.id !== d
|
|
580
|
+
), R(!0);
|
|
581
|
+
}
|
|
582
|
+
async function me() {
|
|
583
|
+
if (te.value) return;
|
|
584
|
+
clearTimeout(M), A == null || A.abort();
|
|
585
|
+
const d = new AbortController();
|
|
586
|
+
A = d, x.value = !0, b.value = "";
|
|
587
|
+
const c = h.value === null ? void 0 : u.value[h.value], k = c ? w.value.indexOf(c) : -1;
|
|
588
|
+
try {
|
|
589
|
+
const D = await Y.saveSettings(
|
|
590
|
+
s.value,
|
|
591
|
+
{
|
|
592
|
+
botInstructions: o.value,
|
|
593
|
+
responseSpeed: r.value,
|
|
594
|
+
knowledgeBase: w.value
|
|
595
|
+
},
|
|
596
|
+
d.signal
|
|
597
|
+
);
|
|
598
|
+
if (d.signal.aborted) return;
|
|
599
|
+
oe(D), h.value = k < 0 ? null : k, m.open({
|
|
600
|
+
type: "success",
|
|
601
|
+
message: n("connect.whatsappBot.botSettings.saved")
|
|
602
|
+
});
|
|
603
|
+
} catch (D) {
|
|
604
|
+
d.signal.aborted || (b.value = D instanceof Error ? D.message : n("connect.whatsappBot.errors.saveSettings"), m.open({ type: "error", message: b.value }));
|
|
605
|
+
} finally {
|
|
606
|
+
d.signal.aborted || (x.value = !1, le());
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
async function xe() {
|
|
610
|
+
if (V.value) return;
|
|
611
|
+
const d = s.value;
|
|
612
|
+
!await he.confirm(
|
|
613
|
+
n("connect.whatsappBot.botSettings.discardChangesMessage"),
|
|
614
|
+
n("connect.whatsappBot.botSettings.discardChangesTitle"),
|
|
615
|
+
n("connect.common.confirm"),
|
|
616
|
+
n("connect.common.cancel")
|
|
617
|
+
) || V.value || s.value !== d || (o.value = v.value, r.value = T.value, u.value = f.value.map((k) => ({ ...k })), h.value = null);
|
|
618
|
+
}
|
|
619
|
+
return ce(s, () => void R(), { immediate: !0 }), ie(() => {
|
|
620
|
+
A == null || A.abort(), clearTimeout(M);
|
|
621
|
+
}), (d, c) => {
|
|
622
|
+
const k = $("FmCircularProgress"), D = $("FmIcon"), j = $("FmButton");
|
|
623
|
+
return a(), i("div", Dt, [
|
|
624
|
+
C.value ? (a(), i("output", Ot, [
|
|
625
|
+
S(k),
|
|
626
|
+
N(" " + l(t(n)("connect.whatsappBot.botSettings.loading")), 1)
|
|
627
|
+
])) : (a(), i(O, { key: 1 }, [
|
|
628
|
+
g.value ? (a(), P(Ae, {
|
|
629
|
+
key: 0,
|
|
630
|
+
modelValue: o.value,
|
|
631
|
+
"onUpdate:modelValue": c[0] || (c[0] = (F) => o.value = F),
|
|
632
|
+
disabled: x.value
|
|
633
|
+
}, null, 8, ["modelValue", "disabled"])) : _("", !0),
|
|
634
|
+
e("div", Lt, [
|
|
635
|
+
g.value ? (a(), P(it, {
|
|
636
|
+
key: 0,
|
|
637
|
+
accounts: B.value,
|
|
638
|
+
loading: !1,
|
|
639
|
+
error: I.value,
|
|
640
|
+
onRetry: c[1] || (c[1] = (F) => R(!0)),
|
|
641
|
+
onRemoved: ue
|
|
642
|
+
}, null, 8, ["accounts", "error"])) : _("", !0)
|
|
643
|
+
]),
|
|
644
|
+
e("details", Ut, [
|
|
645
|
+
e("summary", Mt, [
|
|
646
|
+
N(l(t(n)("connect.whatsappBot.botSettings.advancedSettings")) + " ", 1),
|
|
647
|
+
S(D, {
|
|
648
|
+
name: "keyboard_arrow_down",
|
|
649
|
+
size: "sm",
|
|
650
|
+
class: "transition-transform group-open:rotate-180 motion-reduce:transition-none",
|
|
651
|
+
"aria-hidden": "true"
|
|
652
|
+
})
|
|
653
|
+
]),
|
|
654
|
+
e("div", Rt, [
|
|
655
|
+
g.value ? (a(), P(Bt, {
|
|
656
|
+
key: 0,
|
|
657
|
+
modelValue: u.value,
|
|
658
|
+
"onUpdate:modelValue": c[2] || (c[2] = (F) => u.value = F),
|
|
659
|
+
"active-topic-index": h.value,
|
|
660
|
+
"onUpdate:activeTopicIndex": c[3] || (c[3] = (F) => h.value = F),
|
|
661
|
+
disabled: x.value
|
|
662
|
+
}, null, 8, ["modelValue", "active-topic-index", "disabled"])) : _("", !0),
|
|
663
|
+
g.value ? (a(), P(Nt, {
|
|
664
|
+
key: 1,
|
|
665
|
+
modelValue: r.value,
|
|
666
|
+
"onUpdate:modelValue": c[4] || (c[4] = (F) => r.value = F),
|
|
667
|
+
disabled: x.value,
|
|
668
|
+
class: "border-t border-fm-color-neutral-gray-100 pt-[20px]"
|
|
669
|
+
}, null, 8, ["modelValue", "disabled"])) : _("", !0)
|
|
670
|
+
])
|
|
671
|
+
]),
|
|
672
|
+
b.value ? (a(), i("p", Wt, l(b.value), 1)) : _("", !0),
|
|
673
|
+
g.value ? _("", !0) : (a(), P(j, {
|
|
674
|
+
key: 2,
|
|
675
|
+
class: "self-start !rounded-full [&_.label]:text-[14px]",
|
|
676
|
+
label: t(n)("connect.whatsappBot.tryAgain"),
|
|
677
|
+
"prepend-icon": "refresh",
|
|
678
|
+
onClick: c[5] || (c[5] = (F) => R())
|
|
679
|
+
}, null, 8, ["label"])),
|
|
680
|
+
e("div", zt, [
|
|
681
|
+
S(j, {
|
|
682
|
+
variant: "secondary",
|
|
683
|
+
"border-color": "neutral-gray-200",
|
|
684
|
+
label: t(n)("connect.common.cancel"),
|
|
685
|
+
disabled: V.value,
|
|
686
|
+
class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
687
|
+
onClick: xe
|
|
688
|
+
}, null, 8, ["label", "disabled"]),
|
|
689
|
+
S(j, {
|
|
690
|
+
label: t(n)("connect.common.save"),
|
|
691
|
+
disabled: te.value,
|
|
692
|
+
loading: x.value,
|
|
693
|
+
class: "!rounded-full !px-[20px] [&_.label]:text-[14px]",
|
|
694
|
+
onClick: me
|
|
695
|
+
}, null, 8, ["label", "disabled", "loading"])
|
|
696
|
+
])
|
|
697
|
+
], 64))
|
|
698
|
+
]);
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
export {
|
|
703
|
+
Yt as default
|
|
704
|
+
};
|