@adatechnology/conversations-ui 0.1.0-rc.32 → 0.1.0-rc.34
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/index.d.ts +44 -1
- package/dist/index.js +340 -292
- package/package.json +2 -2
- package/src/DarkModeToggle.test.tsx +76 -0
- package/src/DarkModeToggle.tsx +92 -0
- package/src/index.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -2566,6 +2566,52 @@ function downloadTextFile(filename, content) {
|
|
|
2566
2566
|
URL.revokeObjectURL(url);
|
|
2567
2567
|
}
|
|
2568
2568
|
|
|
2569
|
+
// src/DarkModeToggle.tsx
|
|
2570
|
+
import { Moon, Sun } from "lucide-react";
|
|
2571
|
+
import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2572
|
+
var DEFAULT_DARK_MODE_TOGGLE_LABELS = {
|
|
2573
|
+
toDark: "Tema escuro",
|
|
2574
|
+
toLight: "Tema claro"
|
|
2575
|
+
};
|
|
2576
|
+
function DarkModeToggle({
|
|
2577
|
+
isDark,
|
|
2578
|
+
onToggle,
|
|
2579
|
+
showLabel = false,
|
|
2580
|
+
labels,
|
|
2581
|
+
className,
|
|
2582
|
+
classNames
|
|
2583
|
+
}) {
|
|
2584
|
+
const label = isDark ? labels?.toLight ?? DEFAULT_DARK_MODE_TOGGLE_LABELS.toLight : labels?.toDark ?? DEFAULT_DARK_MODE_TOGGLE_LABELS.toDark;
|
|
2585
|
+
const Icon = isDark ? Sun : Moon;
|
|
2586
|
+
return /* @__PURE__ */ jsxs15(
|
|
2587
|
+
"button",
|
|
2588
|
+
{
|
|
2589
|
+
type: "button",
|
|
2590
|
+
onClick: onToggle,
|
|
2591
|
+
"data-cv-tooltip": showLabel ? void 0 : label,
|
|
2592
|
+
"aria-label": label,
|
|
2593
|
+
className: cn(
|
|
2594
|
+
"inline-flex items-center justify-center gap-2 rounded-lg border border-gray-200 px-3 py-2 text-sm text-gray-600 transition-colors",
|
|
2595
|
+
"hover:bg-gray-100 hover:text-gray-900",
|
|
2596
|
+
"dark:border-gray-700 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100",
|
|
2597
|
+
!showLabel && "cv-touch",
|
|
2598
|
+
className
|
|
2599
|
+
),
|
|
2600
|
+
children: [
|
|
2601
|
+
/* @__PURE__ */ jsx17(
|
|
2602
|
+
Icon,
|
|
2603
|
+
{
|
|
2604
|
+
"aria-hidden": "true",
|
|
2605
|
+
className: cn("shrink-0", classNames?.icon),
|
|
2606
|
+
size: classNames?.icon ? void 0 : ICON_SIZE_ACTION
|
|
2607
|
+
}
|
|
2608
|
+
),
|
|
2609
|
+
showLabel ? /* @__PURE__ */ jsx17("span", { className: classNames?.label, children: label }) : null
|
|
2610
|
+
]
|
|
2611
|
+
}
|
|
2612
|
+
);
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2569
2615
|
// src/useWaitingNotifications.ts
|
|
2570
2616
|
import { useState as useState12, useEffect as useEffect8, useRef as useRef6, useCallback as useCallback5 } from "react";
|
|
2571
2617
|
var DEFAULT_POLL_INTERVAL_MS = 1e4;
|
|
@@ -2626,7 +2672,7 @@ function useWaitingNotifications(params) {
|
|
|
2626
2672
|
|
|
2627
2673
|
// src/settings/WhatsAppTemplateSettingsForm.tsx
|
|
2628
2674
|
import { Plus, RefreshCw, Save, Trash2 as Trash22 } from "lucide-react";
|
|
2629
|
-
import { jsx as
|
|
2675
|
+
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2630
2676
|
var DEFAULT_LABELS2 = {
|
|
2631
2677
|
sectionTitle: "WhatsApp",
|
|
2632
2678
|
sectionDescription: "Template usado para reabrir a janela de 24h com o cliente.",
|
|
@@ -2685,16 +2731,16 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2685
2731
|
}
|
|
2686
2732
|
onVariablesChange([...variables, token]);
|
|
2687
2733
|
}
|
|
2688
|
-
return /* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2690
|
-
/* @__PURE__ */
|
|
2691
|
-
/* @__PURE__ */
|
|
2734
|
+
return /* @__PURE__ */ jsxs16("section", { className: "bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden", children: [
|
|
2735
|
+
/* @__PURE__ */ jsxs16("div", { className: "px-6 py-4 border-b border-gray-100 dark:border-gray-700", children: [
|
|
2736
|
+
/* @__PURE__ */ jsx18("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: labels.sectionTitle }),
|
|
2737
|
+
/* @__PURE__ */ jsx18("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: labels.sectionDescription })
|
|
2692
2738
|
] }),
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2695
|
-
/* @__PURE__ */
|
|
2696
|
-
/* @__PURE__ */
|
|
2697
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ jsxs16("form", { onSubmit: onSave, className: "p-6 space-y-4", children: [
|
|
2740
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2741
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
2742
|
+
/* @__PURE__ */ jsx18("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.templateLabel }),
|
|
2743
|
+
/* @__PURE__ */ jsxs16(
|
|
2698
2744
|
"button",
|
|
2699
2745
|
{
|
|
2700
2746
|
"data-cv-tooltip": labels.refreshList,
|
|
@@ -2704,31 +2750,31 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2704
2750
|
disabled: loadingTemplates,
|
|
2705
2751
|
className: "flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400 hover:underline disabled:opacity-50",
|
|
2706
2752
|
children: [
|
|
2707
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ jsx18(RefreshCw, { size: 11, className: loadingTemplates ? "animate-spin" : "" }),
|
|
2708
2754
|
labels.refreshList
|
|
2709
2755
|
]
|
|
2710
2756
|
}
|
|
2711
2757
|
)
|
|
2712
2758
|
] }),
|
|
2713
|
-
templatesError && /* @__PURE__ */
|
|
2759
|
+
templatesError && /* @__PURE__ */ jsxs16("div", { className: "mb-2 rounded-lg bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-800 px-3 py-2 text-xs text-amber-700 dark:text-amber-400", children: [
|
|
2714
2760
|
labels.errorLoading,
|
|
2715
|
-
/* @__PURE__ */
|
|
2716
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ jsx18("br", {}),
|
|
2762
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-gray-500 dark:text-gray-400 mt-0.5 block", children: [
|
|
2717
2763
|
labels.currentNameSaved,
|
|
2718
2764
|
" ",
|
|
2719
|
-
/* @__PURE__ */
|
|
2765
|
+
/* @__PURE__ */ jsx18("strong", { children: selectedTemplateName || "\u2014" })
|
|
2720
2766
|
] })
|
|
2721
2767
|
] }),
|
|
2722
|
-
loadingTemplates && /* @__PURE__ */
|
|
2723
|
-
!loadingTemplates && !templatesError && /* @__PURE__ */
|
|
2768
|
+
loadingTemplates && /* @__PURE__ */ jsx18("div", { className: "h-10 rounded-xl bg-gray-100 dark:bg-gray-700 animate-pulse" }),
|
|
2769
|
+
!loadingTemplates && !templatesError && /* @__PURE__ */ jsxs16(
|
|
2724
2770
|
"select",
|
|
2725
2771
|
{
|
|
2726
2772
|
value: selectedTemplateName,
|
|
2727
2773
|
onChange: (e) => handleSelect(e.target.value),
|
|
2728
2774
|
className: "w-full border border-gray-200 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 rounded-xl px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent transition-all",
|
|
2729
2775
|
children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
templates.map((template) => /* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ jsx18("option", { value: "", children: labels.selectPlaceholder }),
|
|
2777
|
+
templates.map((template) => /* @__PURE__ */ jsxs16("option", { value: template.name, disabled: template.status !== "APPROVED", children: [
|
|
2732
2778
|
template.displayName,
|
|
2733
2779
|
" \xB7 ",
|
|
2734
2780
|
template.shortId,
|
|
@@ -2740,12 +2786,12 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2740
2786
|
]
|
|
2741
2787
|
}
|
|
2742
2788
|
),
|
|
2743
|
-
selected?.bodyText && /* @__PURE__ */
|
|
2789
|
+
selected?.bodyText && /* @__PURE__ */ jsx18("div", { className: "mt-2 rounded-lg bg-gray-50 dark:bg-gray-700/50 border border-gray-200 dark:border-gray-600 px-3 py-2 text-xs text-gray-600 dark:text-gray-300 whitespace-pre-wrap", children: selected.bodyText })
|
|
2744
2790
|
] }),
|
|
2745
|
-
/* @__PURE__ */
|
|
2746
|
-
/* @__PURE__ */
|
|
2747
|
-
/* @__PURE__ */
|
|
2748
|
-
/* @__PURE__ */
|
|
2791
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
2792
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between mb-1.5", children: [
|
|
2793
|
+
/* @__PURE__ */ jsx18("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.variablesLabel }),
|
|
2794
|
+
/* @__PURE__ */ jsxs16(
|
|
2749
2795
|
"button",
|
|
2750
2796
|
{
|
|
2751
2797
|
"data-cv-tooltip": labels.addVariable,
|
|
@@ -2754,15 +2800,15 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2754
2800
|
onClick: () => onVariablesChange([...variables, ""]),
|
|
2755
2801
|
className: "flex items-center gap-1 text-xs text-blue-600 dark:text-blue-400 hover:underline",
|
|
2756
2802
|
children: [
|
|
2757
|
-
/* @__PURE__ */
|
|
2803
|
+
/* @__PURE__ */ jsx18(Plus, { size: 12 }),
|
|
2758
2804
|
labels.addVariable
|
|
2759
2805
|
]
|
|
2760
2806
|
}
|
|
2761
2807
|
)
|
|
2762
2808
|
] }),
|
|
2763
|
-
availableVariables.length > 0 && /* @__PURE__ */
|
|
2764
|
-
/* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2809
|
+
availableVariables.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "mb-3 rounded-lg border border-gray-200 dark:border-gray-600 bg-gray-50 dark:bg-gray-700/40 p-2.5", children: [
|
|
2810
|
+
/* @__PURE__ */ jsx18("p", { className: "text-xs font-medium text-gray-600 dark:text-gray-300 mb-1.5", children: labels.variablesAvailableTitle }),
|
|
2811
|
+
/* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-1.5", children: availableVariables.map((available) => /* @__PURE__ */ jsxs16(
|
|
2766
2812
|
"button",
|
|
2767
2813
|
{
|
|
2768
2814
|
type: "button",
|
|
@@ -2771,8 +2817,8 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2771
2817
|
"aria-label": `Inserir ${available.token}`,
|
|
2772
2818
|
className: "inline-flex items-center gap-1 rounded-md border border-gray-200 dark:border-gray-600 bg-white dark:bg-gray-800 px-2 py-1 text-xs hover:border-blue-400 dark:hover:border-blue-500 transition-colors",
|
|
2773
2819
|
children: [
|
|
2774
|
-
/* @__PURE__ */
|
|
2775
|
-
/* @__PURE__ */
|
|
2820
|
+
/* @__PURE__ */ jsx18("code", { className: "text-blue-600 dark:text-blue-300", children: available.token }),
|
|
2821
|
+
/* @__PURE__ */ jsxs16("span", { className: "text-gray-400 dark:text-gray-500", children: [
|
|
2776
2822
|
"\xB7 ",
|
|
2777
2823
|
available.label
|
|
2778
2824
|
] })
|
|
@@ -2780,13 +2826,13 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2780
2826
|
},
|
|
2781
2827
|
available.token
|
|
2782
2828
|
)) }),
|
|
2783
|
-
/* @__PURE__ */
|
|
2829
|
+
/* @__PURE__ */ jsx18("p", { className: "mt-1.5 text-[11px] text-gray-400 dark:text-gray-500", children: labels.variablesAvailableHint })
|
|
2784
2830
|
] }),
|
|
2785
|
-
/* @__PURE__ */
|
|
2786
|
-
variables.length === 0 && /* @__PURE__ */
|
|
2787
|
-
/* @__PURE__ */
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2831
|
+
/* @__PURE__ */ jsx18("p", { className: "text-xs text-gray-400 dark:text-gray-500 mb-2", children: labels.variablesMappingHint }),
|
|
2832
|
+
variables.length === 0 && /* @__PURE__ */ jsx18("p", { className: "text-xs text-gray-400 dark:text-gray-500 italic", children: labels.noVariables }),
|
|
2833
|
+
/* @__PURE__ */ jsx18("div", { className: "space-y-2", children: variables.map((variable, index) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
2834
|
+
/* @__PURE__ */ jsx18("span", { className: "text-xs text-gray-400 dark:text-gray-500 w-6 text-right flex-shrink-0", children: `{{${index + 1}}}` }),
|
|
2835
|
+
/* @__PURE__ */ jsx18(
|
|
2790
2836
|
"input",
|
|
2791
2837
|
{
|
|
2792
2838
|
type: "text",
|
|
@@ -2796,7 +2842,7 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2796
2842
|
className: "flex-1 border border-gray-200 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent transition-all placeholder:text-gray-400 dark:placeholder:text-gray-500"
|
|
2797
2843
|
}
|
|
2798
2844
|
),
|
|
2799
|
-
/* @__PURE__ */
|
|
2845
|
+
/* @__PURE__ */ jsx18(
|
|
2800
2846
|
"button",
|
|
2801
2847
|
{
|
|
2802
2848
|
type: "button",
|
|
@@ -2804,13 +2850,13 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2804
2850
|
className: "text-gray-400 hover:text-red-500 dark:hover:text-red-400 transition-colors flex-shrink-0",
|
|
2805
2851
|
"data-cv-tooltip": labels.removeVariable,
|
|
2806
2852
|
"aria-label": labels.removeVariable,
|
|
2807
|
-
children: /* @__PURE__ */
|
|
2853
|
+
children: /* @__PURE__ */ jsx18(Trash22, { size: 14 })
|
|
2808
2854
|
}
|
|
2809
2855
|
)
|
|
2810
2856
|
] }, index)) })
|
|
2811
2857
|
] }),
|
|
2812
|
-
saveSuccess && /* @__PURE__ */
|
|
2813
|
-
/* @__PURE__ */
|
|
2858
|
+
saveSuccess && /* @__PURE__ */ jsx18("div", { className: "bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-800 rounded-xl px-4 py-3 text-sm text-green-700 dark:text-green-400", children: labels.saveSuccess }),
|
|
2859
|
+
/* @__PURE__ */ jsx18("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs16(
|
|
2814
2860
|
"button",
|
|
2815
2861
|
{
|
|
2816
2862
|
"data-cv-tooltip": saving ? labels.saving : labels.save,
|
|
@@ -2819,7 +2865,7 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2819
2865
|
disabled: saving || !selectedTemplateName.trim(),
|
|
2820
2866
|
className: "flex items-center gap-2 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-semibold px-5 py-2.5 rounded-xl transition-colors text-sm",
|
|
2821
2867
|
children: [
|
|
2822
|
-
saving ? /* @__PURE__ */
|
|
2868
|
+
saving ? /* @__PURE__ */ jsx18("span", { className: "w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin" }) : /* @__PURE__ */ jsx18(Save, { size: 14 }),
|
|
2823
2869
|
saving ? labels.saving : labels.save
|
|
2824
2870
|
]
|
|
2825
2871
|
}
|
|
@@ -2830,7 +2876,7 @@ function WhatsAppTemplateSettingsForm({
|
|
|
2830
2876
|
|
|
2831
2877
|
// src/settings/WhatsAppCreateTemplateForm.tsx
|
|
2832
2878
|
import { SendHorizonal as SendHorizonal2 } from "lucide-react";
|
|
2833
|
-
import { jsx as
|
|
2879
|
+
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2834
2880
|
var DEFAULT_LABELS3 = {
|
|
2835
2881
|
sectionTitle: "Criar novo template",
|
|
2836
2882
|
sectionDescription: "Envia um template para aprova\xE7\xE3o da Meta.",
|
|
@@ -2887,16 +2933,16 @@ function WhatsAppCreateTemplateForm({
|
|
|
2887
2933
|
function set(key, next) {
|
|
2888
2934
|
onChange({ ...value, [key]: next });
|
|
2889
2935
|
}
|
|
2890
|
-
return /* @__PURE__ */
|
|
2891
|
-
/* @__PURE__ */
|
|
2892
|
-
/* @__PURE__ */
|
|
2893
|
-
/* @__PURE__ */
|
|
2936
|
+
return /* @__PURE__ */ jsxs17("section", { className: "bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden", children: [
|
|
2937
|
+
/* @__PURE__ */ jsxs17("div", { className: "px-6 py-4 border-b border-gray-100 dark:border-gray-700", children: [
|
|
2938
|
+
/* @__PURE__ */ jsx19("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: labels.sectionTitle }),
|
|
2939
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: labels.sectionDescription })
|
|
2894
2940
|
] }),
|
|
2895
|
-
/* @__PURE__ */
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
/* @__PURE__ */
|
|
2898
|
-
/* @__PURE__ */
|
|
2899
|
-
/* @__PURE__ */
|
|
2941
|
+
/* @__PURE__ */ jsxs17("form", { onSubmit, className: "p-6 space-y-4", children: [
|
|
2942
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
2943
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.nameLabel }),
|
|
2944
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-gray-400 mb-1.5", children: labels.nameHint }),
|
|
2945
|
+
/* @__PURE__ */ jsx19(
|
|
2900
2946
|
"input",
|
|
2901
2947
|
{
|
|
2902
2948
|
type: "text",
|
|
@@ -2908,56 +2954,56 @@ function WhatsAppCreateTemplateForm({
|
|
|
2908
2954
|
}
|
|
2909
2955
|
)
|
|
2910
2956
|
] }),
|
|
2911
|
-
/* @__PURE__ */
|
|
2912
|
-
/* @__PURE__ */
|
|
2913
|
-
/* @__PURE__ */
|
|
2914
|
-
/* @__PURE__ */
|
|
2957
|
+
/* @__PURE__ */ jsxs17("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
2958
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
2959
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.categoryLabel }),
|
|
2960
|
+
/* @__PURE__ */ jsxs17(
|
|
2915
2961
|
"select",
|
|
2916
2962
|
{
|
|
2917
2963
|
value: value.category,
|
|
2918
2964
|
onChange: (e) => set("category", e.target.value),
|
|
2919
2965
|
className: "w-full border border-gray-200 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 rounded-xl px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent transition-all",
|
|
2920
2966
|
children: [
|
|
2921
|
-
/* @__PURE__ */
|
|
2922
|
-
/* @__PURE__ */
|
|
2967
|
+
/* @__PURE__ */ jsx19("option", { value: "UTILITY", children: "UTILITY (Transacional)" }),
|
|
2968
|
+
/* @__PURE__ */ jsx19("option", { value: "MARKETING", children: "MARKETING (Promocional)" })
|
|
2923
2969
|
]
|
|
2924
2970
|
}
|
|
2925
2971
|
)
|
|
2926
2972
|
] }),
|
|
2927
|
-
/* @__PURE__ */
|
|
2928
|
-
/* @__PURE__ */
|
|
2929
|
-
/* @__PURE__ */
|
|
2973
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
2974
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.languageLabel }),
|
|
2975
|
+
/* @__PURE__ */ jsxs17(
|
|
2930
2976
|
"select",
|
|
2931
2977
|
{
|
|
2932
2978
|
value: value.language,
|
|
2933
2979
|
onChange: (e) => set("language", e.target.value),
|
|
2934
2980
|
className: "w-full border border-gray-200 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 rounded-xl px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent transition-all",
|
|
2935
2981
|
children: [
|
|
2936
|
-
/* @__PURE__ */
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
/* @__PURE__ */
|
|
2982
|
+
/* @__PURE__ */ jsx19("option", { value: "pt_BR", children: "Portugu\xEAs (Brasil)" }),
|
|
2983
|
+
/* @__PURE__ */ jsx19("option", { value: "en_US", children: "Ingl\xEAs (EUA)" }),
|
|
2984
|
+
/* @__PURE__ */ jsx19("option", { value: "es_ES", children: "Espanhol" })
|
|
2939
2985
|
]
|
|
2940
2986
|
}
|
|
2941
2987
|
)
|
|
2942
2988
|
] })
|
|
2943
2989
|
] }),
|
|
2944
|
-
/* @__PURE__ */
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
/* @__PURE__ */
|
|
2947
|
-
/* @__PURE__ */
|
|
2948
|
-
/* @__PURE__ */
|
|
2990
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
2991
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.headerLabel }),
|
|
2992
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-gray-400 mb-1.5", children: labels.headerHint }),
|
|
2993
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex gap-2", children: [
|
|
2994
|
+
/* @__PURE__ */ jsxs17(
|
|
2949
2995
|
"select",
|
|
2950
2996
|
{
|
|
2951
2997
|
value: value.headerType,
|
|
2952
2998
|
onChange: (e) => set("headerType", e.target.value),
|
|
2953
2999
|
className: "border border-gray-200 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 rounded-xl px-3 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 transition-all",
|
|
2954
3000
|
children: [
|
|
2955
|
-
/* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
3001
|
+
/* @__PURE__ */ jsx19("option", { value: "NONE", children: labels.headerNone }),
|
|
3002
|
+
/* @__PURE__ */ jsx19("option", { value: "TEXT", children: labels.headerText })
|
|
2957
3003
|
]
|
|
2958
3004
|
}
|
|
2959
3005
|
),
|
|
2960
|
-
value.headerType === "TEXT" && /* @__PURE__ */
|
|
3006
|
+
value.headerType === "TEXT" && /* @__PURE__ */ jsx19(
|
|
2961
3007
|
"input",
|
|
2962
3008
|
{
|
|
2963
3009
|
type: "text",
|
|
@@ -2970,10 +3016,10 @@ function WhatsAppCreateTemplateForm({
|
|
|
2970
3016
|
)
|
|
2971
3017
|
] })
|
|
2972
3018
|
] }),
|
|
2973
|
-
/* @__PURE__ */
|
|
2974
|
-
/* @__PURE__ */
|
|
2975
|
-
/* @__PURE__ */
|
|
2976
|
-
/* @__PURE__ */
|
|
3019
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3020
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.bodyLabel }),
|
|
3021
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-gray-400 mb-1.5", children: labels.bodyHint }),
|
|
3022
|
+
/* @__PURE__ */ jsx19(
|
|
2977
3023
|
"textarea",
|
|
2978
3024
|
{
|
|
2979
3025
|
value: value.bodyText,
|
|
@@ -2984,26 +3030,26 @@ function WhatsAppCreateTemplateForm({
|
|
|
2984
3030
|
required: true
|
|
2985
3031
|
}
|
|
2986
3032
|
),
|
|
2987
|
-
detectedVariables.length > 0 && /* @__PURE__ */
|
|
2988
|
-
/* @__PURE__ */
|
|
2989
|
-
/* @__PURE__ */
|
|
2990
|
-
/* @__PURE__ */
|
|
2991
|
-
/* @__PURE__ */
|
|
3033
|
+
detectedVariables.length > 0 && /* @__PURE__ */ jsxs17("div", { className: "mt-2 rounded-lg bg-gray-50 dark:bg-gray-700/50 border border-gray-200 dark:border-gray-600 px-3 py-2", children: [
|
|
3034
|
+
/* @__PURE__ */ jsx19("p", { className: "font-medium text-gray-500 dark:text-gray-400 mb-1.5 uppercase tracking-wide text-xs", children: labels.detectedVariables }),
|
|
3035
|
+
/* @__PURE__ */ jsx19("div", { className: "flex flex-wrap gap-2", children: detectedVariables.map((num) => /* @__PURE__ */ jsxs17("span", { className: "inline-flex items-center gap-1 text-xs", children: [
|
|
3036
|
+
/* @__PURE__ */ jsx19("code", { className: "bg-blue-100 dark:bg-blue-900/40 text-blue-700 dark:text-blue-300 px-1.5 py-0.5 rounded font-mono", children: `{{${num}}}` }),
|
|
3037
|
+
/* @__PURE__ */ jsxs17("span", { className: "text-gray-400 dark:text-gray-500", children: [
|
|
2992
3038
|
"= ",
|
|
2993
3039
|
variableExamples[Number(num) - 1] ?? labels.variableLabel(Number(num))
|
|
2994
3040
|
] })
|
|
2995
3041
|
] }, num)) }),
|
|
2996
|
-
/* @__PURE__ */
|
|
3042
|
+
/* @__PURE__ */ jsxs17("p", { className: "text-gray-400 dark:text-gray-500 mt-1.5 text-xs", children: [
|
|
2997
3043
|
labels.configureHintPrefix,
|
|
2998
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ jsx19("strong", { children: labels.configureHintLink }),
|
|
2999
3045
|
labels.configureHintSuffix
|
|
3000
3046
|
] })
|
|
3001
3047
|
] })
|
|
3002
3048
|
] }),
|
|
3003
|
-
/* @__PURE__ */
|
|
3004
|
-
/* @__PURE__ */
|
|
3005
|
-
/* @__PURE__ */
|
|
3006
|
-
/* @__PURE__ */
|
|
3049
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3050
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.footerLabel }),
|
|
3051
|
+
/* @__PURE__ */ jsx19("p", { className: "text-xs text-gray-400 mb-1.5", children: labels.footerHint }),
|
|
3052
|
+
/* @__PURE__ */ jsx19(
|
|
3007
3053
|
"input",
|
|
3008
3054
|
{
|
|
3009
3055
|
type: "text",
|
|
@@ -3015,41 +3061,41 @@ function WhatsAppCreateTemplateForm({
|
|
|
3015
3061
|
}
|
|
3016
3062
|
)
|
|
3017
3063
|
] }),
|
|
3018
|
-
/* @__PURE__ */
|
|
3019
|
-
/* @__PURE__ */
|
|
3020
|
-
/* @__PURE__ */
|
|
3021
|
-
/* @__PURE__ */
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
/* @__PURE__ */
|
|
3024
|
-
/* @__PURE__ */
|
|
3025
|
-
/* @__PURE__ */
|
|
3064
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3065
|
+
/* @__PURE__ */ jsx19("label", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-2 block", children: labels.previewLabel }),
|
|
3066
|
+
/* @__PURE__ */ jsxs17("div", { className: "rounded-2xl bg-[#e5ddd5] dark:bg-[#1a1a2e] border border-gray-300 dark:border-gray-600 overflow-hidden shadow-inner", children: [
|
|
3067
|
+
/* @__PURE__ */ jsxs17("div", { className: "bg-[#075e54] px-4 py-2.5 flex items-center gap-2", children: [
|
|
3068
|
+
/* @__PURE__ */ jsx19("div", { className: "w-8 h-8 rounded-full bg-white/20 flex items-center justify-center text-white text-xs font-bold", children: previewCompanyName.slice(0, 2).toUpperCase() }),
|
|
3069
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
3070
|
+
/* @__PURE__ */ jsx19("p", { className: "text-white text-xs font-semibold leading-tight", children: previewCompanyName }),
|
|
3071
|
+
/* @__PURE__ */ jsx19("p", { className: "text-white/60 text-xs", children: labels.previewOnline })
|
|
3026
3072
|
] })
|
|
3027
3073
|
] }),
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
/* @__PURE__ */
|
|
3030
|
-
/* @__PURE__ */
|
|
3031
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ jsxs17("div", { className: "px-3 py-4 space-y-3", style: { minHeight: "120px" }, children: [
|
|
3075
|
+
/* @__PURE__ */ jsx19("div", { className: "flex justify-start", style: { maxWidth: "85%" }, children: /* @__PURE__ */ jsxs17("div", { className: "bg-white dark:bg-gray-700 rounded-lg rounded-tl-none px-3 py-2 shadow-sm", children: [
|
|
3076
|
+
/* @__PURE__ */ jsx19("p", { className: "text-gray-500 dark:text-gray-400 leading-tight text-sm", children: labels.previewDescription }),
|
|
3077
|
+
/* @__PURE__ */ jsx19("p", { className: "text-gray-400 dark:text-gray-500 mt-1 text-right text-[9px]", children: "12:00" })
|
|
3032
3078
|
] }) }),
|
|
3033
|
-
/* @__PURE__ */
|
|
3034
|
-
value.headerType === "TEXT" && value.headerText && /* @__PURE__ */
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
value.footerText && /* @__PURE__ */
|
|
3037
|
-
/* @__PURE__ */
|
|
3079
|
+
/* @__PURE__ */ jsx19("div", { className: "flex justify-end ml-auto", style: { maxWidth: "85%" }, children: /* @__PURE__ */ jsxs17("div", { className: "bg-[#dcf8c6] dark:bg-[#1b5e20] rounded-lg rounded-tr-none px-3 py-2 shadow-sm", children: [
|
|
3080
|
+
value.headerType === "TEXT" && value.headerText && /* @__PURE__ */ jsx19("p", { className: "text-xs font-bold text-gray-700 dark:text-gray-200 mb-1", children: fillPreviewTokens(value.headerText) || labels.previewHeaderFallback }),
|
|
3081
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm text-gray-800 dark:text-gray-100 leading-relaxed", children: value.bodyText ? fillPreviewTokens(value.bodyText) : /* @__PURE__ */ jsx19("span", { className: "text-gray-400 italic", children: labels.previewBodyPlaceholder }) }),
|
|
3082
|
+
value.footerText && /* @__PURE__ */ jsx19("p", { className: "text-gray-400 dark:text-gray-400 mt-1 text-xs", children: value.footerText }),
|
|
3083
|
+
/* @__PURE__ */ jsx19("p", { className: "text-gray-400 dark:text-gray-400 mt-1 text-right text-[9px]", children: "12:01 \u2713" })
|
|
3038
3084
|
] }) })
|
|
3039
3085
|
] })
|
|
3040
3086
|
] })
|
|
3041
3087
|
] }),
|
|
3042
|
-
result && /* @__PURE__ */
|
|
3088
|
+
result && /* @__PURE__ */ jsxs17(
|
|
3043
3089
|
"div",
|
|
3044
3090
|
{
|
|
3045
3091
|
className: `rounded-xl px-4 py-3 text-sm ${result.ok ? "bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-800 text-green-700 dark:text-green-400" : "bg-red-50 dark:bg-red-950/40 border border-red-200 dark:border-red-800 text-red-700 dark:text-red-400"}`,
|
|
3046
3092
|
children: [
|
|
3047
3093
|
result.message,
|
|
3048
|
-
result.ok && result.status && /* @__PURE__ */
|
|
3094
|
+
result.ok && result.status && /* @__PURE__ */ jsx19("p", { className: "text-xs mt-1 opacity-75", children: labels.successStatus(result.status) })
|
|
3049
3095
|
]
|
|
3050
3096
|
}
|
|
3051
3097
|
),
|
|
3052
|
-
/* @__PURE__ */
|
|
3098
|
+
/* @__PURE__ */ jsx19("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs17(
|
|
3053
3099
|
"button",
|
|
3054
3100
|
{
|
|
3055
3101
|
"data-cv-tooltip": submitting ? labels.sending : labels.sendForApproval,
|
|
@@ -3058,7 +3104,7 @@ function WhatsAppCreateTemplateForm({
|
|
|
3058
3104
|
disabled: submitting || !value.name || !value.bodyText,
|
|
3059
3105
|
className: "flex items-center gap-2 bg-emerald-600 hover:bg-emerald-700 disabled:bg-emerald-400 text-white font-semibold px-5 py-2.5 rounded-xl transition-colors text-sm",
|
|
3060
3106
|
children: [
|
|
3061
|
-
submitting ? /* @__PURE__ */
|
|
3107
|
+
submitting ? /* @__PURE__ */ jsx19("span", { className: "w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin" }) : /* @__PURE__ */ jsx19(SendHorizonal2, { size: 14 }),
|
|
3062
3108
|
submitting ? labels.sending : labels.sendForApproval
|
|
3063
3109
|
]
|
|
3064
3110
|
}
|
|
@@ -3069,7 +3115,7 @@ function WhatsAppCreateTemplateForm({
|
|
|
3069
3115
|
|
|
3070
3116
|
// src/settings/WelcomeFarewellForm.tsx
|
|
3071
3117
|
import { LogOut, Mail, Save as Save2 } from "lucide-react";
|
|
3072
|
-
import { jsx as
|
|
3118
|
+
import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3073
3119
|
var DEFAULT_LABELS4 = {
|
|
3074
3120
|
sectionTitle: "Boas-vindas e encerramento",
|
|
3075
3121
|
welcomeMessage: "Mensagem de boas-vindas",
|
|
@@ -3097,15 +3143,15 @@ function WelcomeFarewellForm({
|
|
|
3097
3143
|
labels: labelsOverride
|
|
3098
3144
|
}) {
|
|
3099
3145
|
const labels = { ...DEFAULT_LABELS4, ...labelsOverride };
|
|
3100
|
-
return /* @__PURE__ */
|
|
3101
|
-
/* @__PURE__ */
|
|
3102
|
-
/* @__PURE__ */
|
|
3103
|
-
/* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3105
|
-
/* @__PURE__ */
|
|
3146
|
+
return /* @__PURE__ */ jsxs18("section", { className: "bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden", children: [
|
|
3147
|
+
/* @__PURE__ */ jsx20("div", { className: "px-6 py-4 border-b border-gray-100 dark:border-gray-700", children: /* @__PURE__ */ jsx20("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: labels.sectionTitle }) }),
|
|
3148
|
+
/* @__PURE__ */ jsxs18("form", { onSubmit: onSave, className: "p-6 space-y-5", children: [
|
|
3149
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
3150
|
+
/* @__PURE__ */ jsxs18("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5 flex items-center gap-1.5", children: [
|
|
3151
|
+
/* @__PURE__ */ jsx20(Mail, { size: 13, className: "text-blue-600 dark:text-blue-400" }),
|
|
3106
3152
|
labels.welcomeMessage
|
|
3107
3153
|
] }),
|
|
3108
|
-
/* @__PURE__ */
|
|
3154
|
+
/* @__PURE__ */ jsx20(
|
|
3109
3155
|
WhatsAppMessageEditor,
|
|
3110
3156
|
{
|
|
3111
3157
|
value: welcomeMessage,
|
|
@@ -3114,14 +3160,14 @@ function WelcomeFarewellForm({
|
|
|
3114
3160
|
placeholders: welcomePlaceholders
|
|
3115
3161
|
}
|
|
3116
3162
|
),
|
|
3117
|
-
/* @__PURE__ */
|
|
3163
|
+
/* @__PURE__ */ jsx20("p", { className: "mt-1.5 text-xs text-gray-500 dark:text-gray-400", children: labels.welcomeMessageHint })
|
|
3118
3164
|
] }),
|
|
3119
|
-
/* @__PURE__ */
|
|
3120
|
-
/* @__PURE__ */
|
|
3121
|
-
/* @__PURE__ */
|
|
3165
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
3166
|
+
/* @__PURE__ */ jsxs18("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1.5 flex items-center gap-1.5", children: [
|
|
3167
|
+
/* @__PURE__ */ jsx20(LogOut, { size: 13, className: "text-blue-600 dark:text-blue-400" }),
|
|
3122
3168
|
labels.farewellMessage
|
|
3123
3169
|
] }),
|
|
3124
|
-
/* @__PURE__ */
|
|
3170
|
+
/* @__PURE__ */ jsx20(
|
|
3125
3171
|
WhatsAppMessageEditor,
|
|
3126
3172
|
{
|
|
3127
3173
|
value: farewellMessage,
|
|
@@ -3130,10 +3176,10 @@ function WelcomeFarewellForm({
|
|
|
3130
3176
|
placeholders: farewellPlaceholders
|
|
3131
3177
|
}
|
|
3132
3178
|
),
|
|
3133
|
-
/* @__PURE__ */
|
|
3179
|
+
/* @__PURE__ */ jsx20("p", { className: "mt-1.5 text-xs text-gray-500 dark:text-gray-400", children: labels.farewellMessageHint })
|
|
3134
3180
|
] }),
|
|
3135
|
-
saveSuccess && /* @__PURE__ */
|
|
3136
|
-
/* @__PURE__ */
|
|
3181
|
+
saveSuccess && /* @__PURE__ */ jsx20("div", { className: "bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-800 rounded-xl px-4 py-3 text-sm text-green-700 dark:text-green-400", children: labels.saveSuccess }),
|
|
3182
|
+
/* @__PURE__ */ jsx20("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs18(
|
|
3137
3183
|
"button",
|
|
3138
3184
|
{
|
|
3139
3185
|
"data-cv-tooltip": saving ? labels.saving : labels.save,
|
|
@@ -3142,7 +3188,7 @@ function WelcomeFarewellForm({
|
|
|
3142
3188
|
disabled: saving,
|
|
3143
3189
|
className: "flex items-center gap-2 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-semibold px-5 py-2.5 rounded-xl transition-colors text-sm",
|
|
3144
3190
|
children: [
|
|
3145
|
-
saving ? /* @__PURE__ */
|
|
3191
|
+
saving ? /* @__PURE__ */ jsx20("span", { className: "w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin" }) : /* @__PURE__ */ jsx20(Save2, { size: 14 }),
|
|
3146
3192
|
saving ? labels.saving : labels.save
|
|
3147
3193
|
]
|
|
3148
3194
|
}
|
|
@@ -3153,7 +3199,7 @@ function WelcomeFarewellForm({
|
|
|
3153
3199
|
|
|
3154
3200
|
// src/settings/TranscriptionSettingsForm.tsx
|
|
3155
3201
|
import { AudioLines, Save as Save3 } from "lucide-react";
|
|
3156
|
-
import { jsx as
|
|
3202
|
+
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3157
3203
|
var DEFAULT_LABELS5 = {
|
|
3158
3204
|
sectionTitle: "Transcri\xE7\xE3o de \xE1udio",
|
|
3159
3205
|
enabled: "Transcrever notas de voz",
|
|
@@ -3180,15 +3226,15 @@ function TranscriptionSettingsForm({
|
|
|
3180
3226
|
labels: labelsOverride
|
|
3181
3227
|
}) {
|
|
3182
3228
|
const labels = { ...DEFAULT_LABELS5, ...labelsOverride };
|
|
3183
|
-
return /* @__PURE__ */
|
|
3184
|
-
/* @__PURE__ */
|
|
3185
|
-
/* @__PURE__ */
|
|
3229
|
+
return /* @__PURE__ */ jsxs19("section", { className: "bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden", children: [
|
|
3230
|
+
/* @__PURE__ */ jsx21("div", { className: "px-6 py-4 border-b border-gray-100 dark:border-gray-700", children: /* @__PURE__ */ jsxs19("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-1.5", children: [
|
|
3231
|
+
/* @__PURE__ */ jsx21(AudioLines, { size: 14, className: "text-blue-600 dark:text-blue-400" }),
|
|
3186
3232
|
labels.sectionTitle
|
|
3187
3233
|
] }) }),
|
|
3188
|
-
/* @__PURE__ */
|
|
3189
|
-
!isAvailable && /* @__PURE__ */
|
|
3190
|
-
/* @__PURE__ */
|
|
3191
|
-
/* @__PURE__ */
|
|
3234
|
+
/* @__PURE__ */ jsxs19("form", { onSubmit: onSave, className: "p-6 space-y-5", children: [
|
|
3235
|
+
!isAvailable && /* @__PURE__ */ jsx21("div", { className: "bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-800 rounded-xl px-4 py-3 text-sm text-amber-800 dark:text-amber-300", children: labels.unavailable }),
|
|
3236
|
+
/* @__PURE__ */ jsxs19("label", { className: "flex items-start gap-3 cursor-pointer", children: [
|
|
3237
|
+
/* @__PURE__ */ jsx21(
|
|
3192
3238
|
"input",
|
|
3193
3239
|
{
|
|
3194
3240
|
type: "checkbox",
|
|
@@ -3198,14 +3244,14 @@ function TranscriptionSettingsForm({
|
|
|
3198
3244
|
className: "mt-0.5 h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 disabled:opacity-50"
|
|
3199
3245
|
}
|
|
3200
3246
|
),
|
|
3201
|
-
/* @__PURE__ */
|
|
3202
|
-
/* @__PURE__ */
|
|
3203
|
-
/* @__PURE__ */
|
|
3247
|
+
/* @__PURE__ */ jsxs19("span", { children: [
|
|
3248
|
+
/* @__PURE__ */ jsx21("span", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: labels.enabled }),
|
|
3249
|
+
/* @__PURE__ */ jsx21("span", { className: "block text-xs text-gray-500 dark:text-gray-400", children: labels.enabledHint })
|
|
3204
3250
|
] })
|
|
3205
3251
|
] }),
|
|
3206
|
-
enabled && /* @__PURE__ */
|
|
3207
|
-
/* @__PURE__ */
|
|
3208
|
-
/* @__PURE__ */
|
|
3252
|
+
enabled && /* @__PURE__ */ jsxs19("fieldset", { disabled: !isAvailable, className: "space-y-2.5", children: [
|
|
3253
|
+
/* @__PURE__ */ jsx21("legend", { className: "text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: labels.modeTitle }),
|
|
3254
|
+
/* @__PURE__ */ jsx21(
|
|
3209
3255
|
ModeOption,
|
|
3210
3256
|
{
|
|
3211
3257
|
value: "onDemand",
|
|
@@ -3215,7 +3261,7 @@ function TranscriptionSettingsForm({
|
|
|
3215
3261
|
hint: labels.modeOnDemandHint
|
|
3216
3262
|
}
|
|
3217
3263
|
),
|
|
3218
|
-
/* @__PURE__ */
|
|
3264
|
+
/* @__PURE__ */ jsx21(
|
|
3219
3265
|
ModeOption,
|
|
3220
3266
|
{
|
|
3221
3267
|
value: "auto",
|
|
@@ -3226,8 +3272,8 @@ function TranscriptionSettingsForm({
|
|
|
3226
3272
|
}
|
|
3227
3273
|
)
|
|
3228
3274
|
] }),
|
|
3229
|
-
saveSuccess && /* @__PURE__ */
|
|
3230
|
-
/* @__PURE__ */
|
|
3275
|
+
saveSuccess && /* @__PURE__ */ jsx21("div", { className: "bg-green-50 dark:bg-green-950/40 border border-green-200 dark:border-green-800 rounded-xl px-4 py-3 text-sm text-green-700 dark:text-green-400", children: labels.saveSuccess }),
|
|
3276
|
+
/* @__PURE__ */ jsx21("div", { className: "flex justify-end", children: /* @__PURE__ */ jsxs19(
|
|
3231
3277
|
"button",
|
|
3232
3278
|
{
|
|
3233
3279
|
"data-cv-tooltip": saving ? labels.saving : labels.save,
|
|
@@ -3236,7 +3282,7 @@ function TranscriptionSettingsForm({
|
|
|
3236
3282
|
disabled: saving || !isAvailable,
|
|
3237
3283
|
className: "flex items-center gap-2 bg-blue-600 hover:bg-blue-700 disabled:bg-blue-400 text-white font-semibold px-5 py-2.5 rounded-xl transition-colors text-sm",
|
|
3238
3284
|
children: [
|
|
3239
|
-
saving ? /* @__PURE__ */
|
|
3285
|
+
saving ? /* @__PURE__ */ jsx21("span", { className: "w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin" }) : /* @__PURE__ */ jsx21(Save3, { size: 14 }),
|
|
3240
3286
|
saving ? labels.saving : labels.save
|
|
3241
3287
|
]
|
|
3242
3288
|
}
|
|
@@ -3252,12 +3298,12 @@ function ModeOption({
|
|
|
3252
3298
|
hint
|
|
3253
3299
|
}) {
|
|
3254
3300
|
const isSelected = current === value;
|
|
3255
|
-
return /* @__PURE__ */
|
|
3301
|
+
return /* @__PURE__ */ jsxs19(
|
|
3256
3302
|
"label",
|
|
3257
3303
|
{
|
|
3258
3304
|
className: `flex items-start gap-3 cursor-pointer rounded-xl border px-4 py-3 transition-colors ${isSelected ? "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/30" : "border-gray-200 hover:border-gray-300 dark:border-gray-700 dark:hover:border-gray-600"}`,
|
|
3259
3305
|
children: [
|
|
3260
|
-
/* @__PURE__ */
|
|
3306
|
+
/* @__PURE__ */ jsx21(
|
|
3261
3307
|
"input",
|
|
3262
3308
|
{
|
|
3263
3309
|
type: "radio",
|
|
@@ -3268,9 +3314,9 @@ function ModeOption({
|
|
|
3268
3314
|
className: "mt-0.5 h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"
|
|
3269
3315
|
}
|
|
3270
3316
|
),
|
|
3271
|
-
/* @__PURE__ */
|
|
3272
|
-
/* @__PURE__ */
|
|
3273
|
-
/* @__PURE__ */
|
|
3317
|
+
/* @__PURE__ */ jsxs19("span", { children: [
|
|
3318
|
+
/* @__PURE__ */ jsx21("span", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300", children: title }),
|
|
3319
|
+
/* @__PURE__ */ jsx21("span", { className: "block text-xs text-gray-500 dark:text-gray-400", children: hint })
|
|
3274
3320
|
] })
|
|
3275
3321
|
]
|
|
3276
3322
|
}
|
|
@@ -3279,7 +3325,7 @@ function ModeOption({
|
|
|
3279
3325
|
|
|
3280
3326
|
// src/settings/WhatsAppTemplatesSettings.tsx
|
|
3281
3327
|
import { useState as useState13 } from "react";
|
|
3282
|
-
import { jsx as
|
|
3328
|
+
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3283
3329
|
var TEMPLATE_SETTINGS_TAB = {
|
|
3284
3330
|
SELECT: "select",
|
|
3285
3331
|
CREATE: "create"
|
|
@@ -3296,9 +3342,9 @@ function WhatsAppTemplatesSettings({
|
|
|
3296
3342
|
}) {
|
|
3297
3343
|
const labels = { ...DEFAULT_TEMPLATES_SETTINGS_LABELS, ...labelsOverride };
|
|
3298
3344
|
const [tab, setTab] = useState13(TEMPLATE_SETTINGS_TAB.SELECT);
|
|
3299
|
-
return /* @__PURE__ */
|
|
3300
|
-
/* @__PURE__ */
|
|
3301
|
-
/* @__PURE__ */
|
|
3345
|
+
return /* @__PURE__ */ jsxs20("div", { className: "space-y-4", children: [
|
|
3346
|
+
/* @__PURE__ */ jsxs20("nav", { className: "flex gap-1 border-b", role: "tablist", children: [
|
|
3347
|
+
/* @__PURE__ */ jsx22(
|
|
3302
3348
|
"button",
|
|
3303
3349
|
{
|
|
3304
3350
|
"data-cv-tooltip": labels.selectTab,
|
|
@@ -3311,7 +3357,7 @@ function WhatsAppTemplatesSettings({
|
|
|
3311
3357
|
children: labels.selectTab
|
|
3312
3358
|
}
|
|
3313
3359
|
),
|
|
3314
|
-
create ? /* @__PURE__ */
|
|
3360
|
+
create ? /* @__PURE__ */ jsx22(
|
|
3315
3361
|
"button",
|
|
3316
3362
|
{
|
|
3317
3363
|
"data-cv-tooltip": labels.createTab,
|
|
@@ -3325,13 +3371,13 @@ function WhatsAppTemplatesSettings({
|
|
|
3325
3371
|
}
|
|
3326
3372
|
) : null
|
|
3327
3373
|
] }),
|
|
3328
|
-
tab === TEMPLATE_SETTINGS_TAB.SELECT ? /* @__PURE__ */
|
|
3374
|
+
tab === TEMPLATE_SETTINGS_TAB.SELECT ? /* @__PURE__ */ jsx22(WhatsAppTemplateSettingsForm, { ...settingsProps, ...settingsLabels ? { labels: settingsLabels } : {} }) : create ? /* @__PURE__ */ jsx22(WhatsAppCreateTemplateForm, { ...create }) : null
|
|
3329
3375
|
] });
|
|
3330
3376
|
}
|
|
3331
3377
|
|
|
3332
3378
|
// src/settings/TopicsForm.tsx
|
|
3333
3379
|
import { Megaphone, Save as Save4 } from "lucide-react";
|
|
3334
|
-
import { jsx as
|
|
3380
|
+
import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
3335
3381
|
var DEFAULT_LABELS6 = {
|
|
3336
3382
|
sectionTitle: "T\xF3picos intermedi\xE1rios",
|
|
3337
3383
|
sectionDescription: "Mensagens autom\xE1ticas para assuntos espec\xEDficos, disparadas quando o cliente demonstra interesse.",
|
|
@@ -3349,19 +3395,19 @@ function TopicsForm({
|
|
|
3349
3395
|
labels: labelsOverride
|
|
3350
3396
|
}) {
|
|
3351
3397
|
const labels = { ...DEFAULT_LABELS6, ...labelsOverride };
|
|
3352
|
-
return /* @__PURE__ */
|
|
3353
|
-
/* @__PURE__ */
|
|
3354
|
-
/* @__PURE__ */
|
|
3355
|
-
/* @__PURE__ */
|
|
3398
|
+
return /* @__PURE__ */ jsxs21("section", { className: "bg-white dark:bg-gray-800 rounded-xl border border-gray-200 dark:border-gray-700 overflow-hidden", children: [
|
|
3399
|
+
/* @__PURE__ */ jsxs21("div", { className: "px-6 py-4 border-b border-gray-100 dark:border-gray-700", children: [
|
|
3400
|
+
/* @__PURE__ */ jsxs21("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100 flex items-center gap-2", children: [
|
|
3401
|
+
/* @__PURE__ */ jsx23(Megaphone, { size: 16, className: "text-orange-600 dark:text-orange-400" }),
|
|
3356
3402
|
labels.sectionTitle
|
|
3357
3403
|
] }),
|
|
3358
|
-
/* @__PURE__ */
|
|
3404
|
+
/* @__PURE__ */ jsx23("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-1", children: labels.sectionDescription })
|
|
3359
3405
|
] }),
|
|
3360
|
-
/* @__PURE__ */
|
|
3361
|
-
topics.map((topic) => /* @__PURE__ */
|
|
3362
|
-
/* @__PURE__ */
|
|
3363
|
-
/* @__PURE__ */
|
|
3364
|
-
/* @__PURE__ */
|
|
3406
|
+
/* @__PURE__ */ jsxs21("form", { onSubmit: onSave, className: "p-6 space-y-6", children: [
|
|
3407
|
+
topics.map((topic) => /* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
3408
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-start gap-4", children: [
|
|
3409
|
+
/* @__PURE__ */ jsx23("div", { className: "flex-1", children: /* @__PURE__ */ jsx23("p", { className: "text-sm font-medium text-gray-900 dark:text-gray-100", children: topic.label }) }),
|
|
3410
|
+
/* @__PURE__ */ jsx23(
|
|
3365
3411
|
"button",
|
|
3366
3412
|
{
|
|
3367
3413
|
"data-cv-tooltip": topic.label,
|
|
@@ -3371,7 +3417,7 @@ function TopicsForm({
|
|
|
3371
3417
|
className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none ${topic.enabled ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-700"}`,
|
|
3372
3418
|
role: "switch",
|
|
3373
3419
|
"aria-checked": topic.enabled,
|
|
3374
|
-
children: /* @__PURE__ */
|
|
3420
|
+
children: /* @__PURE__ */ jsx23(
|
|
3375
3421
|
"span",
|
|
3376
3422
|
{
|
|
3377
3423
|
className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out ${topic.enabled ? "translate-x-5" : "translate-x-0"}`
|
|
@@ -3380,7 +3426,7 @@ function TopicsForm({
|
|
|
3380
3426
|
}
|
|
3381
3427
|
)
|
|
3382
3428
|
] }),
|
|
3383
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx23(
|
|
3384
3430
|
"textarea",
|
|
3385
3431
|
{
|
|
3386
3432
|
value: topic.message,
|
|
@@ -3392,8 +3438,8 @@ function TopicsForm({
|
|
|
3392
3438
|
}
|
|
3393
3439
|
)
|
|
3394
3440
|
] }, topic.key)),
|
|
3395
|
-
/* @__PURE__ */
|
|
3396
|
-
/* @__PURE__ */
|
|
3441
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-3", children: [
|
|
3442
|
+
/* @__PURE__ */ jsxs21(
|
|
3397
3443
|
"button",
|
|
3398
3444
|
{
|
|
3399
3445
|
"data-cv-tooltip": labels.saveButton,
|
|
@@ -3402,12 +3448,12 @@ function TopicsForm({
|
|
|
3402
3448
|
disabled: saving,
|
|
3403
3449
|
className: "inline-flex items-center gap-2 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",
|
|
3404
3450
|
children: [
|
|
3405
|
-
/* @__PURE__ */
|
|
3451
|
+
/* @__PURE__ */ jsx23(Save4, { size: 14 }),
|
|
3406
3452
|
labels.saveButton
|
|
3407
3453
|
]
|
|
3408
3454
|
}
|
|
3409
3455
|
),
|
|
3410
|
-
saveSuccess && /* @__PURE__ */
|
|
3456
|
+
saveSuccess && /* @__PURE__ */ jsx23("span", { className: "text-sm text-green-600 dark:text-green-400", children: labels.saveSuccess })
|
|
3411
3457
|
] })
|
|
3412
3458
|
] })
|
|
3413
3459
|
] });
|
|
@@ -3415,7 +3461,7 @@ function TopicsForm({
|
|
|
3415
3461
|
|
|
3416
3462
|
// src/settings/MessagesWorkspace.tsx
|
|
3417
3463
|
import { useCallback as useCallback6, useEffect as useEffect9, useState as useState14 } from "react";
|
|
3418
|
-
import { jsx as
|
|
3464
|
+
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3419
3465
|
var DEFAULT_LABELS7 = {
|
|
3420
3466
|
title: "Mensagens",
|
|
3421
3467
|
subtitle: "Mensagens do bot e templates do WhatsApp.",
|
|
@@ -3607,23 +3653,23 @@ function MessagesWorkspace({
|
|
|
3607
3653
|
});
|
|
3608
3654
|
}
|
|
3609
3655
|
if (loadState === "loading") {
|
|
3610
|
-
return /* @__PURE__ */
|
|
3656
|
+
return /* @__PURE__ */ jsx24("p", { className: "p-6 text-sm text-gray-500 dark:text-gray-400", children: labels.loading });
|
|
3611
3657
|
}
|
|
3612
3658
|
if (loadState === "error") {
|
|
3613
|
-
return /* @__PURE__ */
|
|
3659
|
+
return /* @__PURE__ */ jsx24("p", { role: "alert", className: "p-6 text-sm text-red-600 dark:text-red-400", children: labels.loadError });
|
|
3614
3660
|
}
|
|
3615
3661
|
const tabs = [
|
|
3616
3662
|
{ id: MESSAGES_TAB.BOT, label: labels.tabBot },
|
|
3617
3663
|
...hasTemplates ? [{ id: MESSAGES_TAB.TEMPLATES, label: labels.tabTemplates }] : [],
|
|
3618
3664
|
...hasTranscription ? [{ id: MESSAGES_TAB.TRANSCRIPTION, label: labels.tabTranscription }] : []
|
|
3619
3665
|
];
|
|
3620
|
-
return /* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3622
|
-
/* @__PURE__ */
|
|
3623
|
-
/* @__PURE__ */
|
|
3624
|
-
/* @__PURE__ */
|
|
3666
|
+
return /* @__PURE__ */ jsxs22("div", { className: `space-y-6 p-4 lg:p-0 ${className ?? ""}`, children: [
|
|
3667
|
+
/* @__PURE__ */ jsx24(TooltipLayer, {}),
|
|
3668
|
+
/* @__PURE__ */ jsxs22("header", { children: [
|
|
3669
|
+
/* @__PURE__ */ jsx24("h1", { className: "text-xl font-semibold text-gray-900 dark:text-gray-100", children: labels.title }),
|
|
3670
|
+
/* @__PURE__ */ jsx24("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: labels.subtitle })
|
|
3625
3671
|
] }),
|
|
3626
|
-
tabs.length > 1 ? /* @__PURE__ */
|
|
3672
|
+
tabs.length > 1 ? /* @__PURE__ */ jsx24("nav", { className: "flex gap-1 border-b border-gray-200 dark:border-gray-700", role: "tablist", children: tabs.map((item) => /* @__PURE__ */ jsx24(
|
|
3627
3673
|
"button",
|
|
3628
3674
|
{
|
|
3629
3675
|
"data-cv-tooltip": item.label,
|
|
@@ -3637,8 +3683,8 @@ function MessagesWorkspace({
|
|
|
3637
3683
|
},
|
|
3638
3684
|
item.id
|
|
3639
3685
|
)) }) : null,
|
|
3640
|
-
tab === MESSAGES_TAB.BOT ? /* @__PURE__ */
|
|
3641
|
-
/* @__PURE__ */
|
|
3686
|
+
tab === MESSAGES_TAB.BOT ? /* @__PURE__ */ jsxs22("div", { className: "space-y-8", children: [
|
|
3687
|
+
/* @__PURE__ */ jsx24(
|
|
3642
3688
|
WelcomeFarewellForm,
|
|
3643
3689
|
{
|
|
3644
3690
|
welcomeMessage: messages.welcomeMessage,
|
|
@@ -3653,7 +3699,7 @@ function MessagesWorkspace({
|
|
|
3653
3699
|
...farewellPlaceholders ? { farewellPlaceholders } : {}
|
|
3654
3700
|
}
|
|
3655
3701
|
),
|
|
3656
|
-
hasTopics ? /* @__PURE__ */
|
|
3702
|
+
hasTopics ? /* @__PURE__ */ jsx24(
|
|
3657
3703
|
TopicsForm,
|
|
3658
3704
|
{
|
|
3659
3705
|
topics,
|
|
@@ -3670,9 +3716,9 @@ function MessagesWorkspace({
|
|
|
3670
3716
|
}
|
|
3671
3717
|
) : null
|
|
3672
3718
|
] }) : null,
|
|
3673
|
-
tab === MESSAGES_TAB.TEMPLATES ? /* @__PURE__ */
|
|
3719
|
+
tab === MESSAGES_TAB.TEMPLATES ? /* @__PURE__ */ jsxs22("div", { className: "space-y-4", children: [
|
|
3674
3720
|
renderTemplatesNotice?.(),
|
|
3675
|
-
/* @__PURE__ */
|
|
3721
|
+
/* @__PURE__ */ jsx24(
|
|
3676
3722
|
WhatsAppTemplatesSettings,
|
|
3677
3723
|
{
|
|
3678
3724
|
templates,
|
|
@@ -3702,7 +3748,7 @@ function MessagesWorkspace({
|
|
|
3702
3748
|
}
|
|
3703
3749
|
)
|
|
3704
3750
|
] }) : null,
|
|
3705
|
-
tab === MESSAGES_TAB.TRANSCRIPTION ? /* @__PURE__ */
|
|
3751
|
+
tab === MESSAGES_TAB.TRANSCRIPTION ? /* @__PURE__ */ jsx24(
|
|
3706
3752
|
TranscriptionSettingsForm,
|
|
3707
3753
|
{
|
|
3708
3754
|
enabled: transcription.enabled,
|
|
@@ -3898,7 +3944,7 @@ import { Check as Check2, CheckCheck, FlaskConical, Hourglass as Hourglass2, Mai
|
|
|
3898
3944
|
|
|
3899
3945
|
// src/workspace/BulkTemplateModal.tsx
|
|
3900
3946
|
import { useEffect as useEffect11, useMemo as useMemo4, useState as useState16 } from "react";
|
|
3901
|
-
import { jsx as
|
|
3947
|
+
import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
3902
3948
|
function BulkTemplateModal({
|
|
3903
3949
|
labels,
|
|
3904
3950
|
expiredCount,
|
|
@@ -3929,15 +3975,15 @@ function BulkTemplateModal({
|
|
|
3929
3975
|
if (!term) return templates;
|
|
3930
3976
|
return templates.filter((template) => template.name.toLowerCase().includes(term));
|
|
3931
3977
|
}, [templates, search]);
|
|
3932
|
-
return /* @__PURE__ */
|
|
3933
|
-
/* @__PURE__ */
|
|
3934
|
-
/* @__PURE__ */
|
|
3935
|
-
/* @__PURE__ */
|
|
3936
|
-
/* @__PURE__ */
|
|
3978
|
+
return /* @__PURE__ */ jsx25("div", { className: "cv-workspace-modal", role: "dialog", "aria-modal": "true", "aria-label": labels.templateModalTitle, children: /* @__PURE__ */ jsxs23("div", { className: "cv-workspace-modal__box", children: [
|
|
3979
|
+
/* @__PURE__ */ jsxs23("header", { className: "cv-workspace-modal__header", children: [
|
|
3980
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
3981
|
+
/* @__PURE__ */ jsx25("h3", { children: labels.templateModalTitle }),
|
|
3982
|
+
/* @__PURE__ */ jsx25("p", { children: labels.templateModalAvailable(templates.length) })
|
|
3937
3983
|
] }),
|
|
3938
|
-
/* @__PURE__ */
|
|
3984
|
+
/* @__PURE__ */ jsx25("button", { "data-cv-tooltip": labels.templateModalCancel, type: "button", onClick: onClose, "aria-label": labels.templateModalCancel, children: "\u2715" })
|
|
3939
3985
|
] }),
|
|
3940
|
-
/* @__PURE__ */
|
|
3986
|
+
/* @__PURE__ */ jsx25("div", { className: "cv-workspace-modal__search", children: /* @__PURE__ */ jsx25(
|
|
3941
3987
|
"input",
|
|
3942
3988
|
{
|
|
3943
3989
|
type: "search",
|
|
@@ -3947,9 +3993,9 @@ function BulkTemplateModal({
|
|
|
3947
3993
|
autoFocus: true
|
|
3948
3994
|
}
|
|
3949
3995
|
) }),
|
|
3950
|
-
/* @__PURE__ */
|
|
3951
|
-
filtered.length === 0 ? /* @__PURE__ */
|
|
3952
|
-
filtered.map((template) => /* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ jsxs23("div", { className: "cv-workspace-modal__list", children: [
|
|
3997
|
+
filtered.length === 0 ? /* @__PURE__ */ jsx25("p", { className: "cv-workspace-empty", children: labels.templateModalEmpty }) : null,
|
|
3998
|
+
filtered.map((template) => /* @__PURE__ */ jsxs23(
|
|
3953
3999
|
"button",
|
|
3954
4000
|
{
|
|
3955
4001
|
"data-cv-tooltip": template.name,
|
|
@@ -3959,8 +4005,8 @@ function BulkTemplateModal({
|
|
|
3959
4005
|
"aria-pressed": template.name === selected,
|
|
3960
4006
|
className: `cv-workspace-modal__item${template.name === selected ? " cv-workspace-modal__item--on" : ""}`,
|
|
3961
4007
|
children: [
|
|
3962
|
-
/* @__PURE__ */
|
|
3963
|
-
/* @__PURE__ */
|
|
4008
|
+
/* @__PURE__ */ jsx25("span", { className: "cv-workspace-modal__item-name", children: template.name }),
|
|
4009
|
+
/* @__PURE__ */ jsxs23("span", { className: "cv-workspace-modal__item-meta", children: [
|
|
3964
4010
|
template.language,
|
|
3965
4011
|
template.category ? ` \xB7 ${template.category.toLowerCase()}` : ""
|
|
3966
4012
|
] })
|
|
@@ -3969,10 +4015,10 @@ function BulkTemplateModal({
|
|
|
3969
4015
|
template.name
|
|
3970
4016
|
))
|
|
3971
4017
|
] }),
|
|
3972
|
-
expiredCount === 0 ? /* @__PURE__ */
|
|
3973
|
-
/* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
4018
|
+
expiredCount === 0 ? /* @__PURE__ */ jsx25("p", { className: "cv-workspace-modal__warning", children: labels.templateModalNoneExpired }) : null,
|
|
4019
|
+
/* @__PURE__ */ jsxs23("footer", { className: "cv-workspace-modal__footer", children: [
|
|
4020
|
+
/* @__PURE__ */ jsx25("button", { "data-cv-tooltip": labels.templateModalCancel, "aria-label": labels.templateModalCancel, type: "button", onClick: onClose, children: labels.templateModalCancel }),
|
|
4021
|
+
/* @__PURE__ */ jsx25(
|
|
3976
4022
|
"button",
|
|
3977
4023
|
{
|
|
3978
4024
|
"data-cv-tooltip": sending ? labels.templateModalSending : labels.templateModalSend(expiredCount),
|
|
@@ -3989,7 +4035,7 @@ function BulkTemplateModal({
|
|
|
3989
4035
|
|
|
3990
4036
|
// src/workspace/ConversationPane.tsx
|
|
3991
4037
|
import { useEffect as useEffect12, useRef as useRef9, useState as useState17 } from "react";
|
|
3992
|
-
import { jsx as
|
|
4038
|
+
import { jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3993
4039
|
function ConversationPane({
|
|
3994
4040
|
conversation,
|
|
3995
4041
|
now,
|
|
@@ -4118,8 +4164,8 @@ function ConversationPane({
|
|
|
4118
4164
|
text: typeof reply.text === "string" ? applyQuickReplyVariables(reply.text, quickReplyVariablesFor?.(conversation, conversationContext) ?? {}) : reply.text(quickReplyVariablesFor?.(conversation, conversationContext) ?? {})
|
|
4119
4165
|
}));
|
|
4120
4166
|
const botOwnsConversation = Boolean(requireTakeoverToReply) && conversation.mode !== "human";
|
|
4121
|
-
return /* @__PURE__ */
|
|
4122
|
-
/* @__PURE__ */
|
|
4167
|
+
return /* @__PURE__ */ jsxs24("div", { className: "cv-workspace-pane", children: [
|
|
4168
|
+
/* @__PURE__ */ jsx26(
|
|
4123
4169
|
ConversationHeader,
|
|
4124
4170
|
{
|
|
4125
4171
|
conversation,
|
|
@@ -4134,10 +4180,10 @@ function ConversationPane({
|
|
|
4134
4180
|
...extraUtilities ? { extraUtilities } : {}
|
|
4135
4181
|
}
|
|
4136
4182
|
),
|
|
4137
|
-
contextEntries && contextEntries.length > 0 || flowLabel ? /* @__PURE__ */
|
|
4138
|
-
/* @__PURE__ */
|
|
4183
|
+
contextEntries && contextEntries.length > 0 || flowLabel ? /* @__PURE__ */ jsx26(ConversationContextPanel, { entries: contextEntries ?? [], ...flowLabel ? { flowLabel } : {} }) : null,
|
|
4184
|
+
/* @__PURE__ */ jsx26(ConversationDocumentsPanel, { conversationId: conversation.id, open: documentsOpen }),
|
|
4139
4185
|
renderAboveTranscript?.(conversation, conversationContext),
|
|
4140
|
-
/* @__PURE__ */
|
|
4186
|
+
/* @__PURE__ */ jsx26(
|
|
4141
4187
|
ConversationWallpaper,
|
|
4142
4188
|
{
|
|
4143
4189
|
ref: scroll.containerRef,
|
|
@@ -4146,9 +4192,9 @@ function ConversationPane({
|
|
|
4146
4192
|
children: messages.map((message, index) => {
|
|
4147
4193
|
const previous = index > 0 ? messages[index - 1] : void 0;
|
|
4148
4194
|
const startsNewDay = !previous || new Date(message.timestamp).toDateString() !== new Date(previous.timestamp).toDateString();
|
|
4149
|
-
return /* @__PURE__ */
|
|
4150
|
-
startsNewDay ? /* @__PURE__ */
|
|
4151
|
-
/* @__PURE__ */
|
|
4195
|
+
return /* @__PURE__ */ jsxs24("div", { children: [
|
|
4196
|
+
startsNewDay ? /* @__PURE__ */ jsx26(DateDivider, { iso: message.timestamp }) : null,
|
|
4197
|
+
/* @__PURE__ */ jsx26(
|
|
4152
4198
|
MessageBubble,
|
|
4153
4199
|
{
|
|
4154
4200
|
message,
|
|
@@ -4165,15 +4211,15 @@ function ConversationPane({
|
|
|
4165
4211
|
})
|
|
4166
4212
|
}
|
|
4167
4213
|
),
|
|
4168
|
-
messageSelection && selectedMessageIds.size > 0 ? /* @__PURE__ */
|
|
4169
|
-
/* @__PURE__ */
|
|
4170
|
-
/* @__PURE__ */
|
|
4171
|
-
/* @__PURE__ */
|
|
4172
|
-
/* @__PURE__ */
|
|
4214
|
+
messageSelection && selectedMessageIds.size > 0 ? /* @__PURE__ */ jsxs24("div", { className: "cv-workspace-selection", children: [
|
|
4215
|
+
/* @__PURE__ */ jsx26("span", { children: labels.messagesSelected(selectedMessageIds.size) }),
|
|
4216
|
+
/* @__PURE__ */ jsxs24("div", { className: "cv-workspace-selection__actions", children: [
|
|
4217
|
+
/* @__PURE__ */ jsx26("button", { "data-cv-tooltip": labels.bulkClear, "aria-label": labels.bulkClear, type: "button", onClick: () => setSelectedMessageIds(/* @__PURE__ */ new Set()), children: labels.bulkClear }),
|
|
4218
|
+
/* @__PURE__ */ jsx26("button", { "data-cv-tooltip": labels.copySelected, "aria-label": labels.copySelected, type: "button", onClick: copySelectedMessages, children: labels.copySelected })
|
|
4173
4219
|
] })
|
|
4174
4220
|
] }) : null,
|
|
4175
|
-
sendFailure ? /* @__PURE__ */
|
|
4176
|
-
blocked ? /* @__PURE__ */
|
|
4221
|
+
sendFailure ? /* @__PURE__ */ jsx26("p", { role: "alert", className: "cv-workspace-alert", children: sendFailure }) : null,
|
|
4222
|
+
blocked ? /* @__PURE__ */ jsx26(
|
|
4177
4223
|
WindowExpiredNotice,
|
|
4178
4224
|
{
|
|
4179
4225
|
disabled: busy,
|
|
@@ -4181,8 +4227,8 @@ function ConversationPane({
|
|
|
4181
4227
|
}
|
|
4182
4228
|
) : botOwnsConversation ? (
|
|
4183
4229
|
// Responder com a conversa no bot atropelaria o fluxo automático no meio de uma pergunta.
|
|
4184
|
-
/* @__PURE__ */
|
|
4185
|
-
) : composer === "rich" ? /* @__PURE__ */
|
|
4230
|
+
/* @__PURE__ */ jsx26("p", { className: "cv-workspace-notice", children: labels.takeoverToReply })
|
|
4231
|
+
) : composer === "rich" ? /* @__PURE__ */ jsx26(
|
|
4186
4232
|
RichMessageComposer,
|
|
4187
4233
|
{
|
|
4188
4234
|
value: draft,
|
|
@@ -4197,7 +4243,7 @@ function ConversationPane({
|
|
|
4197
4243
|
isSending: busy || isSendingDraft,
|
|
4198
4244
|
hasQueuedAttachments: queuedFiles.length > 0,
|
|
4199
4245
|
...onRecordAudio ? {
|
|
4200
|
-
idleAction: /* @__PURE__ */
|
|
4246
|
+
idleAction: /* @__PURE__ */ jsx26(
|
|
4201
4247
|
AudioRecorderButton,
|
|
4202
4248
|
{
|
|
4203
4249
|
onRecorded: (file) => void runSend(() => onRecordAudio(file), labels.recordFailure),
|
|
@@ -4206,9 +4252,9 @@ function ConversationPane({
|
|
|
4206
4252
|
)
|
|
4207
4253
|
} : {},
|
|
4208
4254
|
...queuedFiles.length > 0 ? {
|
|
4209
|
-
attachmentsPreview: /* @__PURE__ */
|
|
4210
|
-
/* @__PURE__ */
|
|
4211
|
-
/* @__PURE__ */
|
|
4255
|
+
attachmentsPreview: /* @__PURE__ */ jsx26("ul", { className: "cv-workspace-attachments", children: queuedFiles.map((file, index) => /* @__PURE__ */ jsxs24("li", { children: [
|
|
4256
|
+
/* @__PURE__ */ jsx26("span", { children: file.name }),
|
|
4257
|
+
/* @__PURE__ */ jsx26(
|
|
4212
4258
|
"button",
|
|
4213
4259
|
{
|
|
4214
4260
|
"data-cv-tooltip": labels.attachmentRemove,
|
|
@@ -4223,7 +4269,7 @@ function ConversationPane({
|
|
|
4223
4269
|
...richQuickReplies ? { quickReplies: [...richQuickReplies] } : {},
|
|
4224
4270
|
...composerVariables ? { variables: [...composerVariables] } : {}
|
|
4225
4271
|
}
|
|
4226
|
-
) : /* @__PURE__ */
|
|
4272
|
+
) : /* @__PURE__ */ jsx26(
|
|
4227
4273
|
MessageComposer,
|
|
4228
4274
|
{
|
|
4229
4275
|
value: draft,
|
|
@@ -4239,7 +4285,7 @@ function ConversationPane({
|
|
|
4239
4285
|
}
|
|
4240
4286
|
|
|
4241
4287
|
// src/workspace/ConversationsInboxList.tsx
|
|
4242
|
-
import { jsx as
|
|
4288
|
+
import { jsx as jsx27, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4243
4289
|
function ConversationsInboxList({
|
|
4244
4290
|
inbox,
|
|
4245
4291
|
labels,
|
|
@@ -4250,13 +4296,13 @@ function ConversationsInboxList({
|
|
|
4250
4296
|
onSendTemplateToSelected
|
|
4251
4297
|
}) {
|
|
4252
4298
|
const hasSelection = inbox.selectedIds.size > 0;
|
|
4253
|
-
return /* @__PURE__ */
|
|
4254
|
-
hasSelection ? /* @__PURE__ */
|
|
4255
|
-
/* @__PURE__ */
|
|
4256
|
-
/* @__PURE__ */
|
|
4257
|
-
/* @__PURE__ */
|
|
4258
|
-
onSendTemplateToSelected ? /* @__PURE__ */
|
|
4259
|
-
inbox.canFinalize ? /* @__PURE__ */
|
|
4299
|
+
return /* @__PURE__ */ jsxs25("aside", { className, children: [
|
|
4300
|
+
hasSelection ? /* @__PURE__ */ jsxs25("div", { className: "cv-workspace-bulk", children: [
|
|
4301
|
+
/* @__PURE__ */ jsx27("span", { className: "cv-workspace-bulk__count", children: labels.bulkSelected(inbox.selectedIds.size) }),
|
|
4302
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-bulk__actions", children: [
|
|
4303
|
+
/* @__PURE__ */ jsx27("button", { "data-cv-tooltip": labels.bulkClear, "aria-label": labels.bulkClear, type: "button", onClick: inbox.clearBulkSelection, children: labels.bulkClear }),
|
|
4304
|
+
onSendTemplateToSelected ? /* @__PURE__ */ jsx27("button", { "data-cv-tooltip": labels.bulkTemplate, "aria-label": labels.bulkTemplate, type: "button", onClick: onSendTemplateToSelected, disabled: inbox.busy, children: labels.bulkTemplate }) : null,
|
|
4305
|
+
inbox.canFinalize ? /* @__PURE__ */ jsx27(
|
|
4260
4306
|
"button",
|
|
4261
4307
|
{
|
|
4262
4308
|
"data-cv-tooltip": labels.bulkFinalize,
|
|
@@ -4274,8 +4320,8 @@ function ConversationsInboxList({
|
|
|
4274
4320
|
renderBulkActions?.(inbox)
|
|
4275
4321
|
] })
|
|
4276
4322
|
] }) : null,
|
|
4277
|
-
/* @__PURE__ */
|
|
4278
|
-
/* @__PURE__ */
|
|
4323
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-filters", children: [
|
|
4324
|
+
/* @__PURE__ */ jsx27(
|
|
4279
4325
|
"input",
|
|
4280
4326
|
{
|
|
4281
4327
|
type: "search",
|
|
@@ -4285,9 +4331,9 @@ function ConversationsInboxList({
|
|
|
4285
4331
|
className: "cv-workspace-search"
|
|
4286
4332
|
}
|
|
4287
4333
|
),
|
|
4288
|
-
/* @__PURE__ */
|
|
4289
|
-
/* @__PURE__ */
|
|
4290
|
-
WINDOW_FILTERS.map((filter) => /* @__PURE__ */
|
|
4334
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-chips", children: [
|
|
4335
|
+
/* @__PURE__ */ jsx27("span", { className: "cv-workspace-chips__legend", children: labels.windowLegend }),
|
|
4336
|
+
WINDOW_FILTERS.map((filter) => /* @__PURE__ */ jsx27(
|
|
4291
4337
|
"button",
|
|
4292
4338
|
{
|
|
4293
4339
|
type: "button",
|
|
@@ -4305,9 +4351,9 @@ function ConversationsInboxList({
|
|
|
4305
4351
|
filter.value
|
|
4306
4352
|
))
|
|
4307
4353
|
] }),
|
|
4308
|
-
inbox.channelFilters.length > 0 ? /* @__PURE__ */
|
|
4309
|
-
/* @__PURE__ */
|
|
4310
|
-
inbox.channelFilters.map((filter) => /* @__PURE__ */
|
|
4354
|
+
inbox.channelFilters.length > 0 ? /* @__PURE__ */ jsxs25("div", { className: "cv-workspace-chips", children: [
|
|
4355
|
+
/* @__PURE__ */ jsx27("span", { className: "cv-workspace-chips__legend", children: labels.channelLegend }),
|
|
4356
|
+
inbox.channelFilters.map((filter) => /* @__PURE__ */ jsxs25(
|
|
4311
4357
|
"button",
|
|
4312
4358
|
{
|
|
4313
4359
|
"data-cv-tooltip": filter.label,
|
|
@@ -4317,7 +4363,7 @@ function ConversationsInboxList({
|
|
|
4317
4363
|
"aria-pressed": inbox.channelFilter === filter.value,
|
|
4318
4364
|
className: `cv-workspace-chip${inbox.channelFilter === filter.value ? " cv-workspace-chip--on" : ""}`,
|
|
4319
4365
|
children: [
|
|
4320
|
-
filter.value === CHANNEL_FILTER_ALL ? null : /* @__PURE__ */
|
|
4366
|
+
filter.value === CHANNEL_FILTER_ALL ? null : /* @__PURE__ */ jsx27(ChannelIcon, { channel: filter.value }),
|
|
4321
4367
|
filter.label
|
|
4322
4368
|
]
|
|
4323
4369
|
},
|
|
@@ -4325,14 +4371,14 @@ function ConversationsInboxList({
|
|
|
4325
4371
|
))
|
|
4326
4372
|
] }) : null,
|
|
4327
4373
|
renderFilters?.(inbox),
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4374
|
+
/* @__PURE__ */ jsxs25("label", { className: "cv-workspace-selectall", children: [
|
|
4375
|
+
/* @__PURE__ */ jsx27("input", { type: "checkbox", checked: inbox.allOnPageSelected, onChange: inbox.toggleSelectAllOnPage }),
|
|
4330
4376
|
labels.selectAll
|
|
4331
4377
|
] })
|
|
4332
4378
|
] }),
|
|
4333
|
-
/* @__PURE__ */
|
|
4379
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-rows", children: [
|
|
4334
4380
|
inbox.pageConversations.map(
|
|
4335
|
-
(conversation) => renderRow ? /* @__PURE__ */
|
|
4381
|
+
(conversation) => renderRow ? /* @__PURE__ */ jsx27("div", { children: renderRow(conversation) }, conversation.id) : /* @__PURE__ */ jsx27(
|
|
4336
4382
|
ConversationRow,
|
|
4337
4383
|
{
|
|
4338
4384
|
conversation,
|
|
@@ -4347,13 +4393,13 @@ function ConversationsInboxList({
|
|
|
4347
4393
|
conversation.id
|
|
4348
4394
|
)
|
|
4349
4395
|
),
|
|
4350
|
-
!inbox.loading && inbox.filteredCount === 0 ? /* @__PURE__ */
|
|
4396
|
+
!inbox.loading && inbox.filteredCount === 0 ? /* @__PURE__ */ jsx27("p", { className: "cv-workspace-empty", children: labels.emptyList }) : null
|
|
4351
4397
|
] }),
|
|
4352
|
-
/* @__PURE__ */
|
|
4353
|
-
/* @__PURE__ */
|
|
4354
|
-
/* @__PURE__ */
|
|
4355
|
-
/* @__PURE__ */
|
|
4356
|
-
/* @__PURE__ */
|
|
4398
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-pager", children: [
|
|
4399
|
+
/* @__PURE__ */ jsx27("span", { children: labels.rangeOf(inbox.firstOnPage, inbox.lastOnPage, inbox.filteredCount) }),
|
|
4400
|
+
/* @__PURE__ */ jsxs25("div", { className: "cv-workspace-pager__buttons", children: [
|
|
4401
|
+
/* @__PURE__ */ jsx27("button", { type: "button", onClick: () => inbox.goToPage(1), disabled: inbox.page === 1, "aria-label": PAGINATION_LABELS.first, "data-cv-tooltip": PAGINATION_LABELS.first, children: "\xAB" }),
|
|
4402
|
+
/* @__PURE__ */ jsx27(
|
|
4357
4403
|
"button",
|
|
4358
4404
|
{
|
|
4359
4405
|
type: "button",
|
|
@@ -4364,8 +4410,8 @@ function ConversationsInboxList({
|
|
|
4364
4410
|
children: "\u2039"
|
|
4365
4411
|
}
|
|
4366
4412
|
),
|
|
4367
|
-
/* @__PURE__ */
|
|
4368
|
-
/* @__PURE__ */
|
|
4413
|
+
/* @__PURE__ */ jsx27("span", { children: labels.pageOf(inbox.page, inbox.pageCount) }),
|
|
4414
|
+
/* @__PURE__ */ jsx27(
|
|
4369
4415
|
"button",
|
|
4370
4416
|
{
|
|
4371
4417
|
type: "button",
|
|
@@ -4376,7 +4422,7 @@ function ConversationsInboxList({
|
|
|
4376
4422
|
children: "\u203A"
|
|
4377
4423
|
}
|
|
4378
4424
|
),
|
|
4379
|
-
/* @__PURE__ */
|
|
4425
|
+
/* @__PURE__ */ jsx27(
|
|
4380
4426
|
"button",
|
|
4381
4427
|
{
|
|
4382
4428
|
type: "button",
|
|
@@ -4616,7 +4662,7 @@ function useConversationsInbox(params = {}) {
|
|
|
4616
4662
|
}
|
|
4617
4663
|
|
|
4618
4664
|
// src/workspace/ConversationsWorkspace.tsx
|
|
4619
|
-
import { Fragment as Fragment6, jsx as
|
|
4665
|
+
import { Fragment as Fragment6, jsx as jsx28, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4620
4666
|
function ConversationsWorkspace({
|
|
4621
4667
|
labels: labelsOverride,
|
|
4622
4668
|
filters,
|
|
@@ -4680,50 +4726,50 @@ function ConversationsWorkspace({
|
|
|
4680
4726
|
...fromProduct,
|
|
4681
4727
|
{
|
|
4682
4728
|
key: "simulator",
|
|
4683
|
-
icon: simulator?.icon ?? /* @__PURE__ */
|
|
4729
|
+
icon: simulator?.icon ?? /* @__PURE__ */ jsx28(FlaskConical, { size: ICON_SIZE_ACTION }),
|
|
4684
4730
|
label: simulator?.label ?? "Simular cliente",
|
|
4685
4731
|
active: simulatorOpen,
|
|
4686
4732
|
run: () => setSimulatorOpen((open) => !open)
|
|
4687
4733
|
}
|
|
4688
4734
|
];
|
|
4689
4735
|
}, [selected, extraUtilitiesFor, simulatorEnabled, simulator, simulatorOpen]);
|
|
4690
|
-
return /* @__PURE__ */
|
|
4691
|
-
/* @__PURE__ */
|
|
4692
|
-
/* @__PURE__ */
|
|
4693
|
-
/* @__PURE__ */
|
|
4694
|
-
/* @__PURE__ */
|
|
4695
|
-
/* @__PURE__ */
|
|
4696
|
-
/* @__PURE__ */
|
|
4697
|
-
/* @__PURE__ */
|
|
4736
|
+
return /* @__PURE__ */ jsxs26("div", { className: `cv-workspace${className ? ` ${className}` : ""}`, children: [
|
|
4737
|
+
/* @__PURE__ */ jsx28(TooltipLayer, {}),
|
|
4738
|
+
/* @__PURE__ */ jsxs26("header", { className: "cv-workspace-header", children: [
|
|
4739
|
+
/* @__PURE__ */ jsxs26("div", { className: "cv-workspace-header__titles", children: [
|
|
4740
|
+
/* @__PURE__ */ jsx28("h1", { children: labels.title }),
|
|
4741
|
+
/* @__PURE__ */ jsxs26("p", { children: [
|
|
4742
|
+
/* @__PURE__ */ jsxs26("span", { "data-cv-tooltip": labels.conversations, className: "cv-stat", children: [
|
|
4743
|
+
/* @__PURE__ */ jsx28(MessagesSquare, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
4698
4744
|
" ",
|
|
4699
4745
|
inbox.totalCount,
|
|
4700
|
-
/* @__PURE__ */
|
|
4746
|
+
/* @__PURE__ */ jsxs26("span", { className: "cv-only-wide", children: [
|
|
4701
4747
|
" ",
|
|
4702
4748
|
labels.conversations
|
|
4703
4749
|
] })
|
|
4704
4750
|
] }),
|
|
4705
|
-
/* @__PURE__ */
|
|
4706
|
-
/* @__PURE__ */
|
|
4751
|
+
/* @__PURE__ */ jsxs26("span", { "data-cv-tooltip": labels.waiting, className: "cv-stat cv-workspace-header__waiting", children: [
|
|
4752
|
+
/* @__PURE__ */ jsx28(Hourglass2, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
4707
4753
|
" ",
|
|
4708
4754
|
inbox.waitingCount,
|
|
4709
|
-
/* @__PURE__ */
|
|
4755
|
+
/* @__PURE__ */ jsxs26("span", { className: "cv-only-wide", children: [
|
|
4710
4756
|
" ",
|
|
4711
4757
|
labels.waiting
|
|
4712
4758
|
] })
|
|
4713
4759
|
] }),
|
|
4714
|
-
/* @__PURE__ */
|
|
4715
|
-
/* @__PURE__ */
|
|
4760
|
+
/* @__PURE__ */ jsxs26("span", { "data-cv-tooltip": labels.unread, className: "cv-stat", children: [
|
|
4761
|
+
/* @__PURE__ */ jsx28(Mail2, { size: ICON_SIZE_INLINE, "aria-hidden": "true" }),
|
|
4716
4762
|
" ",
|
|
4717
4763
|
inbox.unreadCount,
|
|
4718
|
-
/* @__PURE__ */
|
|
4764
|
+
/* @__PURE__ */ jsxs26("span", { className: "cv-only-wide", children: [
|
|
4719
4765
|
" ",
|
|
4720
4766
|
labels.unread
|
|
4721
4767
|
] })
|
|
4722
4768
|
] })
|
|
4723
4769
|
] })
|
|
4724
4770
|
] }),
|
|
4725
|
-
/* @__PURE__ */
|
|
4726
|
-
/* @__PURE__ */
|
|
4771
|
+
/* @__PURE__ */ jsxs26("div", { className: "cv-workspace-header__actions", children: [
|
|
4772
|
+
/* @__PURE__ */ jsxs26(
|
|
4727
4773
|
"button",
|
|
4728
4774
|
{
|
|
4729
4775
|
type: "button",
|
|
@@ -4733,12 +4779,12 @@ function ConversationsWorkspace({
|
|
|
4733
4779
|
"aria-label": labels.waitingOnly,
|
|
4734
4780
|
className: inbox.waitingOnly ? "cv-workspace-toggle cv-workspace-toggle--on" : "cv-workspace-toggle",
|
|
4735
4781
|
children: [
|
|
4736
|
-
/* @__PURE__ */
|
|
4737
|
-
/* @__PURE__ */
|
|
4782
|
+
/* @__PURE__ */ jsx28(Hourglass2, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
4783
|
+
/* @__PURE__ */ jsx28("span", { className: "cv-only-wide", children: labels.waitingOnly })
|
|
4738
4784
|
]
|
|
4739
4785
|
}
|
|
4740
4786
|
),
|
|
4741
|
-
/* @__PURE__ */
|
|
4787
|
+
/* @__PURE__ */ jsxs26(
|
|
4742
4788
|
"button",
|
|
4743
4789
|
{
|
|
4744
4790
|
type: "button",
|
|
@@ -4748,9 +4794,9 @@ function ConversationsWorkspace({
|
|
|
4748
4794
|
"aria-label": labels.markSelectedAsRead,
|
|
4749
4795
|
className: "cv-workspace-toggle",
|
|
4750
4796
|
children: [
|
|
4751
|
-
/* @__PURE__ */
|
|
4752
|
-
/* @__PURE__ */
|
|
4753
|
-
inbox.selectedIds.size > 0 ? /* @__PURE__ */
|
|
4797
|
+
/* @__PURE__ */ jsx28(Check2, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
4798
|
+
/* @__PURE__ */ jsx28("span", { className: "cv-only-wide", children: labels.markSelectedAsRead }),
|
|
4799
|
+
inbox.selectedIds.size > 0 ? /* @__PURE__ */ jsxs26("span", { children: [
|
|
4754
4800
|
"(",
|
|
4755
4801
|
inbox.selectedIds.size,
|
|
4756
4802
|
")"
|
|
@@ -4758,7 +4804,7 @@ function ConversationsWorkspace({
|
|
|
4758
4804
|
]
|
|
4759
4805
|
}
|
|
4760
4806
|
),
|
|
4761
|
-
inbox.canMarkAllRead && inbox.unreadCount > 0 ? /* @__PURE__ */
|
|
4807
|
+
inbox.canMarkAllRead && inbox.unreadCount > 0 ? /* @__PURE__ */ jsxs26(
|
|
4762
4808
|
"button",
|
|
4763
4809
|
{
|
|
4764
4810
|
type: "button",
|
|
@@ -4768,28 +4814,28 @@ function ConversationsWorkspace({
|
|
|
4768
4814
|
"aria-label": labels.markAllAsRead,
|
|
4769
4815
|
className: "cv-workspace-toggle",
|
|
4770
4816
|
children: [
|
|
4771
|
-
/* @__PURE__ */
|
|
4772
|
-
/* @__PURE__ */
|
|
4817
|
+
/* @__PURE__ */ jsx28(CheckCheck, { size: ICON_SIZE_ACTION, "aria-hidden": "true" }),
|
|
4818
|
+
/* @__PURE__ */ jsx28("span", { className: "cv-only-wide", children: labels.markAllAsRead })
|
|
4773
4819
|
]
|
|
4774
4820
|
}
|
|
4775
4821
|
) : null,
|
|
4776
4822
|
renderHeaderActions?.(inbox)
|
|
4777
4823
|
] })
|
|
4778
4824
|
] }),
|
|
4779
|
-
inbox.loadFailure ? /* @__PURE__ */
|
|
4825
|
+
inbox.loadFailure ? /* @__PURE__ */ jsxs26("p", { role: "alert", className: "cv-workspace-failure", children: [
|
|
4780
4826
|
inbox.loadFailure,
|
|
4781
|
-
signInHref ? /* @__PURE__ */
|
|
4827
|
+
signInHref ? /* @__PURE__ */ jsxs26(Fragment6, { children: [
|
|
4782
4828
|
" ",
|
|
4783
|
-
/* @__PURE__ */
|
|
4829
|
+
/* @__PURE__ */ jsx28("a", { href: signInHref, className: "cv-workspace-failure__link", children: labels.signIn })
|
|
4784
4830
|
] }) : null
|
|
4785
4831
|
] }) : null,
|
|
4786
|
-
/* @__PURE__ */
|
|
4832
|
+
/* @__PURE__ */ jsxs26(
|
|
4787
4833
|
"div",
|
|
4788
4834
|
{
|
|
4789
4835
|
className: `cv-workspace-grid${showSimulator ? " cv-workspace-grid--with-simulator" : ""}`,
|
|
4790
4836
|
"data-detail": selected ? "open" : "closed",
|
|
4791
4837
|
children: [
|
|
4792
|
-
/* @__PURE__ */
|
|
4838
|
+
/* @__PURE__ */ jsx28(
|
|
4793
4839
|
ConversationsInboxList,
|
|
4794
4840
|
{
|
|
4795
4841
|
inbox,
|
|
@@ -4801,7 +4847,7 @@ function ConversationsWorkspace({
|
|
|
4801
4847
|
...onSendTemplateToSelected ? { onSendTemplateToSelected: () => onSendTemplateToSelected(inbox) } : inbox.canListTemplates ? { onSendTemplateToSelected: () => setTemplateModalOpen(true) } : {}
|
|
4802
4848
|
}
|
|
4803
4849
|
),
|
|
4804
|
-
/* @__PURE__ */
|
|
4850
|
+
/* @__PURE__ */ jsx28("section", { className: "cv-workspace-detail", children: selected ? /* @__PURE__ */ jsx28(
|
|
4805
4851
|
ConversationPane,
|
|
4806
4852
|
{
|
|
4807
4853
|
conversation: selected,
|
|
@@ -4830,16 +4876,16 @@ function ConversationsWorkspace({
|
|
|
4830
4876
|
...renderAboveTranscript ? { renderAboveTranscript } : {},
|
|
4831
4877
|
...onAttach ? { onAttach: (file) => onAttach(selected, file) } : {}
|
|
4832
4878
|
}
|
|
4833
|
-
) : /* @__PURE__ */
|
|
4879
|
+
) : /* @__PURE__ */ jsx28("p", { className: "cv-workspace-empty", children: labels.emptyDetail }) }),
|
|
4834
4880
|
showSimulator && selected ? (
|
|
4835
4881
|
// `min-height:0` junto do `min-width:0`: sem isso a linha do grid cresce com o conteúdo do
|
|
4836
4882
|
// painel, o scroll interno nunca ativa e quem rola passa a ser a página inteira.
|
|
4837
|
-
/* @__PURE__ */
|
|
4883
|
+
/* @__PURE__ */ jsx28("div", { className: "cv-workspace-simulator", children: simulator?.render({ conversationId: selected.id, close: () => setSimulatorOpen(false) }) })
|
|
4838
4884
|
) : null
|
|
4839
4885
|
]
|
|
4840
4886
|
}
|
|
4841
4887
|
),
|
|
4842
|
-
templateModalOpen ? /* @__PURE__ */
|
|
4888
|
+
templateModalOpen ? /* @__PURE__ */ jsx28(
|
|
4843
4889
|
BulkTemplateModal,
|
|
4844
4890
|
{
|
|
4845
4891
|
labels,
|
|
@@ -4886,6 +4932,7 @@ export {
|
|
|
4886
4932
|
DEFAULT_CONVERSATION_DOCUMENTS_LABELS,
|
|
4887
4933
|
DEFAULT_CONVERSATION_HEADER_LABELS,
|
|
4888
4934
|
DEFAULT_CONVERSATION_LIST_ITEM_LABELS,
|
|
4935
|
+
DEFAULT_DARK_MODE_TOGGLE_LABELS,
|
|
4889
4936
|
DEFAULT_DOCUMENTS_LIBRARY_LABELS,
|
|
4890
4937
|
DEFAULT_DOCUMENTS_WORKSPACE_LABELS,
|
|
4891
4938
|
DEFAULT_EMOJI_PICKER_LABELS,
|
|
@@ -4898,6 +4945,7 @@ export {
|
|
|
4898
4945
|
DEFAULT_WHATSAPP_MESSAGE_EDITOR_LABELS,
|
|
4899
4946
|
DEFAULT_WINDOW_EXPIRED_LABELS,
|
|
4900
4947
|
DOCUMENT_SOURCE_FILTER,
|
|
4948
|
+
DarkModeToggle,
|
|
4901
4949
|
DateDivider,
|
|
4902
4950
|
DocumentsLibrary,
|
|
4903
4951
|
DocumentsWorkspace,
|