@consilioweb/payload-support 0.6.2 → 0.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/components/TicketConversation/components/AISummaryPanel.cjs +77 -0
  2. package/dist/components/TicketConversation/components/AISummaryPanel.js +76 -0
  3. package/dist/components/TicketConversation/components/ActionPanels.cjs +121 -0
  4. package/dist/components/TicketConversation/components/ActionPanels.js +118 -0
  5. package/dist/components/TicketConversation/components/ActivityLog.cjs +24 -0
  6. package/dist/components/TicketConversation/components/ActivityLog.js +23 -0
  7. package/dist/components/TicketConversation/components/ClientBar.cjs +43 -0
  8. package/dist/components/TicketConversation/components/ClientBar.js +42 -0
  9. package/dist/components/TicketConversation/components/ClientHistory.cjs +138 -0
  10. package/dist/components/TicketConversation/components/ClientHistory.js +137 -0
  11. package/dist/components/TicketConversation/components/CodeBlock.cjs +154 -0
  12. package/dist/components/TicketConversation/components/CodeBlock.js +152 -0
  13. package/dist/components/TicketConversation/components/CodeBlockInserter.cjs +156 -0
  14. package/dist/components/TicketConversation/components/CodeBlockInserter.js +155 -0
  15. package/dist/components/TicketConversation/components/QuickActions.cjs +66 -0
  16. package/dist/components/TicketConversation/components/QuickActions.js +65 -0
  17. package/dist/components/TicketConversation/components/TicketHeader.cjs +93 -0
  18. package/dist/components/TicketConversation/components/TicketHeader.js +92 -0
  19. package/dist/components/TicketConversation/components/TimeTrackingPanel.cjs +134 -0
  20. package/dist/components/TicketConversation/components/TimeTrackingPanel.js +133 -0
  21. package/dist/components/TicketConversation/config.cjs +44 -0
  22. package/dist/components/TicketConversation/config.js +41 -0
  23. package/dist/components/TicketConversation/constants.cjs +100 -0
  24. package/dist/components/TicketConversation/constants.js +96 -0
  25. package/dist/components/TicketConversation/context.cjs +13 -0
  26. package/dist/components/TicketConversation/context.js +11 -0
  27. package/dist/components/TicketConversation/hooks/useAI.cjs +177 -0
  28. package/dist/components/TicketConversation/hooks/useAI.js +176 -0
  29. package/dist/components/TicketConversation/hooks/useMessageActions.cjs +136 -0
  30. package/dist/components/TicketConversation/hooks/useMessageActions.js +135 -0
  31. package/dist/components/TicketConversation/hooks/useReply.cjs +188 -0
  32. package/dist/components/TicketConversation/hooks/useReply.js +187 -0
  33. package/dist/components/TicketConversation/hooks/useTicketActions.cjs +231 -0
  34. package/dist/components/TicketConversation/hooks/useTicketActions.js +230 -0
  35. package/dist/components/TicketConversation/hooks/useTimeTracking.cjs +123 -0
  36. package/dist/components/TicketConversation/hooks/useTimeTracking.js +122 -0
  37. package/dist/components/TicketConversation/hooks/useTranslation.cjs +78 -0
  38. package/dist/components/TicketConversation/hooks/useTranslation.js +70 -0
  39. package/dist/components/TicketConversation/index.cjs +1128 -0
  40. package/dist/components/TicketConversation/index.js +1123 -0
  41. package/dist/components/TicketConversation/locales/en.json +878 -0
  42. package/dist/components/TicketConversation/locales/fr.json +878 -0
  43. package/dist/components/TicketConversation/types.cjs +2 -0
  44. package/dist/components/TicketConversation/types.js +2 -0
  45. package/dist/components/TicketConversation/utils.cjs +27 -0
  46. package/dist/components/TicketConversation/utils.js +25 -0
  47. package/dist/styles/BillingView.module.scss +311 -0
  48. package/dist/styles/ChatView.module.scss +438 -0
  49. package/dist/styles/CommandPalette.module.scss +160 -0
  50. package/dist/styles/CrmView.module.scss +554 -0
  51. package/dist/styles/EmailTracking.module.scss +238 -0
  52. package/dist/styles/ImportConversation.module.scss +267 -0
  53. package/dist/styles/Layout.module.scss +55 -0
  54. package/dist/styles/Logs.module.scss +164 -0
  55. package/dist/styles/NewTicket.module.scss +143 -0
  56. package/dist/styles/PendingEmails.module.scss +629 -0
  57. package/dist/styles/SupportDashboard.module.scss +649 -0
  58. package/dist/styles/TicketDetail.module.scss +1050 -0
  59. package/dist/styles/TicketInbox.module.scss +296 -0
  60. package/dist/styles/TicketingSettings.module.scss +358 -0
  61. package/dist/styles/TimeDashboard.module.scss +287 -0
  62. package/dist/styles/_tokens.scss +78 -0
  63. package/dist/{components/TicketConversation.css → styles/theme.css} +326 -13
  64. package/dist/views/BillingView/client.js +1 -1
  65. package/dist/views/BillingView/index.js +2 -2
  66. package/dist/views/ChatView/client.js +1 -1
  67. package/dist/views/ChatView/index.js +2 -2
  68. package/dist/views/CrmView/client.js +1 -1
  69. package/dist/views/CrmView/index.js +2 -2
  70. package/dist/views/EmailTrackingView/client.js +1 -1
  71. package/dist/views/EmailTrackingView/index.js +2 -2
  72. package/dist/views/ImportConversationView/client.js +1 -1
  73. package/dist/views/ImportConversationView/index.js +2 -2
  74. package/dist/views/LogsView/client.js +1 -1
  75. package/dist/views/LogsView/index.js +2 -2
  76. package/dist/views/NewTicketView/client.js +1 -1
  77. package/dist/views/NewTicketView/index.js +2 -2
  78. package/dist/views/PendingEmailsView/client.js +1 -1
  79. package/dist/views/PendingEmailsView/index.js +2 -2
  80. package/dist/views/SupportDashboardView/client.js +1 -1
  81. package/dist/views/SupportDashboardView/index.js +2 -2
  82. package/dist/views/TicketDetailView/client.js +2 -2
  83. package/dist/views/TicketDetailView/index.js +2 -2
  84. package/dist/views/TicketInboxView/client.js +1 -1
  85. package/dist/views/TicketInboxView/index.js +2 -2
  86. package/dist/views/TicketingSettingsView/client.js +3 -3
  87. package/dist/views/TicketingSettingsView/index.js +2 -2
  88. package/dist/views/TimeDashboardView/client.js +1 -1
  89. package/dist/views/TimeDashboardView/index.js +2 -2
  90. package/dist/views/shared/AdminViewHeader.js +1 -1
  91. package/dist/views/shared/index.js +5 -5
  92. package/dist/views.js +13 -13
  93. package/package.json +2 -2
  94. package/dist/components/TicketConversation.js +0 -3004
@@ -0,0 +1,156 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var react = require('react');
5
+
6
+ const LANGUAGES = [
7
+ { value: "javascript", label: "JavaScript" },
8
+ { value: "typescript", label: "TypeScript" },
9
+ { value: "php", label: "PHP" },
10
+ { value: "python", label: "Python" },
11
+ { value: "html", label: "HTML" },
12
+ { value: "css", label: "CSS" },
13
+ { value: "scss", label: "SCSS" },
14
+ { value: "json", label: "JSON" },
15
+ { value: "sql", label: "SQL" },
16
+ { value: "bash", label: "Bash" },
17
+ { value: "yaml", label: "YAML" },
18
+ { value: "xml", label: "XML" },
19
+ { value: "markdown", label: "Markdown" },
20
+ { value: "diff", label: "Diff" },
21
+ { value: "go", label: "Go" },
22
+ { value: "rust", label: "Rust" },
23
+ { value: "java", label: "Java" },
24
+ { value: "ruby", label: "Ruby" },
25
+ { value: "swift", label: "Swift" },
26
+ { value: "docker", label: "Dockerfile" },
27
+ { value: "nginx", label: "Nginx" },
28
+ { value: "env", label: ".env" }
29
+ ];
30
+ function CodeBlockInserter({ onInsert, className, style }) {
31
+ const [open, setOpen] = react.useState(false);
32
+ const [filter, setFilter] = react.useState("");
33
+ const dropdownRef = react.useRef(null);
34
+ const inputRef = react.useRef(null);
35
+ react.useEffect(() => {
36
+ if (open && inputRef.current) inputRef.current.focus();
37
+ }, [open]);
38
+ react.useEffect(() => {
39
+ const handleClickOutside = (e) => {
40
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
41
+ setOpen(false);
42
+ setFilter("");
43
+ }
44
+ };
45
+ if (open) document.addEventListener("mousedown", handleClickOutside);
46
+ return () => document.removeEventListener("mousedown", handleClickOutside);
47
+ }, [open]);
48
+ const filtered = filter ? LANGUAGES.filter((l) => l.label.toLowerCase().includes(filter.toLowerCase()) || l.value.includes(filter.toLowerCase())) : LANGUAGES;
49
+ const handleSelect = (lang) => {
50
+ onInsert(`
51
+ \`\`\`${lang}
52
+
53
+ \`\`\`
54
+ `);
55
+ setOpen(false);
56
+ setFilter("");
57
+ };
58
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: dropdownRef, style: { position: "relative", display: "inline-block" }, children: [
59
+ /* @__PURE__ */ jsxRuntime.jsx(
60
+ "button",
61
+ {
62
+ onClick: () => setOpen(!open),
63
+ className,
64
+ style: {
65
+ fontSize: 11,
66
+ fontWeight: 700,
67
+ padding: "4px 10px",
68
+ width: "auto",
69
+ cursor: "pointer",
70
+ ...style
71
+ },
72
+ type: "button",
73
+ "aria-label": "Ins\xE9rer un bloc de code",
74
+ "data-tooltip": "Bloc de code",
75
+ children: "</> Code"
76
+ }
77
+ ),
78
+ open && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
79
+ position: "absolute",
80
+ bottom: "100%",
81
+ left: 0,
82
+ marginBottom: 4,
83
+ width: 200,
84
+ maxHeight: 280,
85
+ backgroundColor: "#1e293b",
86
+ border: "1px solid #334155",
87
+ borderRadius: 8,
88
+ boxShadow: "0 8px 24px rgba(0,0,0,0.4)",
89
+ zIndex: 1e3,
90
+ overflow: "hidden",
91
+ display: "flex",
92
+ flexDirection: "column"
93
+ }, children: [
94
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 8px 4px" }, children: /* @__PURE__ */ jsxRuntime.jsx(
95
+ "input",
96
+ {
97
+ ref: inputRef,
98
+ type: "text",
99
+ value: filter,
100
+ onChange: (e) => setFilter(e.target.value),
101
+ onKeyDown: (e) => {
102
+ if (e.key === "Escape") {
103
+ setOpen(false);
104
+ setFilter("");
105
+ }
106
+ if (e.key === "Enter" && filtered.length > 0) handleSelect(filtered[0].value);
107
+ },
108
+ placeholder: "Rechercher...",
109
+ style: {
110
+ width: "100%",
111
+ padding: "6px 10px",
112
+ fontSize: 12,
113
+ backgroundColor: "#0f172a",
114
+ border: "1px solid #334155",
115
+ borderRadius: 6,
116
+ color: "#e2e8f0",
117
+ outline: "none",
118
+ boxSizing: "border-box"
119
+ }
120
+ }
121
+ ) }),
122
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { overflowY: "auto", maxHeight: 230, padding: "4px 0" }, children: [
123
+ filtered.map((lang) => /* @__PURE__ */ jsxRuntime.jsx(
124
+ "button",
125
+ {
126
+ onClick: () => handleSelect(lang.value),
127
+ style: {
128
+ display: "block",
129
+ width: "100%",
130
+ padding: "6px 12px",
131
+ fontSize: 12,
132
+ fontWeight: 500,
133
+ color: "#e2e8f0",
134
+ backgroundColor: "transparent",
135
+ border: "none",
136
+ cursor: "pointer",
137
+ textAlign: "left"
138
+ },
139
+ onMouseEnter: (e) => {
140
+ e.target.style.backgroundColor = "#334155";
141
+ },
142
+ onMouseLeave: (e) => {
143
+ e.target.style.backgroundColor = "transparent";
144
+ },
145
+ type: "button",
146
+ children: lang.label
147
+ },
148
+ lang.value
149
+ )),
150
+ filtered.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "12px", fontSize: 12, color: "#64748b", textAlign: "center" }, children: "Aucun langage trouv\xE9" })
151
+ ] })
152
+ ] })
153
+ ] });
154
+ }
155
+
156
+ exports.CodeBlockInserter = CodeBlockInserter;
@@ -0,0 +1,155 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { useState, useRef, useEffect } from 'react';
4
+
5
+ const LANGUAGES = [
6
+ { value: "javascript", label: "JavaScript" },
7
+ { value: "typescript", label: "TypeScript" },
8
+ { value: "php", label: "PHP" },
9
+ { value: "python", label: "Python" },
10
+ { value: "html", label: "HTML" },
11
+ { value: "css", label: "CSS" },
12
+ { value: "scss", label: "SCSS" },
13
+ { value: "json", label: "JSON" },
14
+ { value: "sql", label: "SQL" },
15
+ { value: "bash", label: "Bash" },
16
+ { value: "yaml", label: "YAML" },
17
+ { value: "xml", label: "XML" },
18
+ { value: "markdown", label: "Markdown" },
19
+ { value: "diff", label: "Diff" },
20
+ { value: "go", label: "Go" },
21
+ { value: "rust", label: "Rust" },
22
+ { value: "java", label: "Java" },
23
+ { value: "ruby", label: "Ruby" },
24
+ { value: "swift", label: "Swift" },
25
+ { value: "docker", label: "Dockerfile" },
26
+ { value: "nginx", label: "Nginx" },
27
+ { value: "env", label: ".env" }
28
+ ];
29
+ function CodeBlockInserter({ onInsert, className, style }) {
30
+ const [open, setOpen] = useState(false);
31
+ const [filter, setFilter] = useState("");
32
+ const dropdownRef = useRef(null);
33
+ const inputRef = useRef(null);
34
+ useEffect(() => {
35
+ if (open && inputRef.current) inputRef.current.focus();
36
+ }, [open]);
37
+ useEffect(() => {
38
+ const handleClickOutside = (e) => {
39
+ if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
40
+ setOpen(false);
41
+ setFilter("");
42
+ }
43
+ };
44
+ if (open) document.addEventListener("mousedown", handleClickOutside);
45
+ return () => document.removeEventListener("mousedown", handleClickOutside);
46
+ }, [open]);
47
+ const filtered = filter ? LANGUAGES.filter((l) => l.label.toLowerCase().includes(filter.toLowerCase()) || l.value.includes(filter.toLowerCase())) : LANGUAGES;
48
+ const handleSelect = (lang) => {
49
+ onInsert(`
50
+ \`\`\`${lang}
51
+
52
+ \`\`\`
53
+ `);
54
+ setOpen(false);
55
+ setFilter("");
56
+ };
57
+ return /* @__PURE__ */ jsxs("div", { ref: dropdownRef, style: { position: "relative", display: "inline-block" }, children: [
58
+ /* @__PURE__ */ jsx(
59
+ "button",
60
+ {
61
+ onClick: () => setOpen(!open),
62
+ className,
63
+ style: {
64
+ fontSize: 11,
65
+ fontWeight: 700,
66
+ padding: "4px 10px",
67
+ width: "auto",
68
+ cursor: "pointer",
69
+ ...style
70
+ },
71
+ type: "button",
72
+ "aria-label": "Ins\xE9rer un bloc de code",
73
+ "data-tooltip": "Bloc de code",
74
+ children: "</> Code"
75
+ }
76
+ ),
77
+ open && /* @__PURE__ */ jsxs("div", { style: {
78
+ position: "absolute",
79
+ bottom: "100%",
80
+ left: 0,
81
+ marginBottom: 4,
82
+ width: 200,
83
+ maxHeight: 280,
84
+ backgroundColor: "#1e293b",
85
+ border: "1px solid #334155",
86
+ borderRadius: 8,
87
+ boxShadow: "0 8px 24px rgba(0,0,0,0.4)",
88
+ zIndex: 1e3,
89
+ overflow: "hidden",
90
+ display: "flex",
91
+ flexDirection: "column"
92
+ }, children: [
93
+ /* @__PURE__ */ jsx("div", { style: { padding: "8px 8px 4px" }, children: /* @__PURE__ */ jsx(
94
+ "input",
95
+ {
96
+ ref: inputRef,
97
+ type: "text",
98
+ value: filter,
99
+ onChange: (e) => setFilter(e.target.value),
100
+ onKeyDown: (e) => {
101
+ if (e.key === "Escape") {
102
+ setOpen(false);
103
+ setFilter("");
104
+ }
105
+ if (e.key === "Enter" && filtered.length > 0) handleSelect(filtered[0].value);
106
+ },
107
+ placeholder: "Rechercher...",
108
+ style: {
109
+ width: "100%",
110
+ padding: "6px 10px",
111
+ fontSize: 12,
112
+ backgroundColor: "#0f172a",
113
+ border: "1px solid #334155",
114
+ borderRadius: 6,
115
+ color: "#e2e8f0",
116
+ outline: "none",
117
+ boxSizing: "border-box"
118
+ }
119
+ }
120
+ ) }),
121
+ /* @__PURE__ */ jsxs("div", { style: { overflowY: "auto", maxHeight: 230, padding: "4px 0" }, children: [
122
+ filtered.map((lang) => /* @__PURE__ */ jsx(
123
+ "button",
124
+ {
125
+ onClick: () => handleSelect(lang.value),
126
+ style: {
127
+ display: "block",
128
+ width: "100%",
129
+ padding: "6px 12px",
130
+ fontSize: 12,
131
+ fontWeight: 500,
132
+ color: "#e2e8f0",
133
+ backgroundColor: "transparent",
134
+ border: "none",
135
+ cursor: "pointer",
136
+ textAlign: "left"
137
+ },
138
+ onMouseEnter: (e) => {
139
+ e.target.style.backgroundColor = "#334155";
140
+ },
141
+ onMouseLeave: (e) => {
142
+ e.target.style.backgroundColor = "transparent";
143
+ },
144
+ type: "button",
145
+ children: lang.label
146
+ },
147
+ lang.value
148
+ )),
149
+ filtered.length === 0 && /* @__PURE__ */ jsx("div", { style: { padding: "12px", fontSize: 12, color: "#64748b", textAlign: "center" }, children: "Aucun langage trouv\xE9" })
150
+ ] })
151
+ ] })
152
+ ] });
153
+ }
154
+
155
+ export { CodeBlockInserter };
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var constants = require('../constants');
5
+
6
+ function QuickActions({
7
+ statusTransitions,
8
+ statusUpdating,
9
+ onStatusChange,
10
+ snoozeUntil,
11
+ snoozeSaving,
12
+ onCancelSnooze,
13
+ showMerge: _showMerge,
14
+ showExtMsg: _showExtMsg,
15
+ showSnooze: _showSnooze,
16
+ onToggleMerge,
17
+ onToggleExtMsg,
18
+ onToggleSnooze,
19
+ onNextTicket,
20
+ showNextTicket,
21
+ nextTicketId,
22
+ nextTicketInfo,
23
+ onCloseNextTicket
24
+ }) {
25
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
26
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", marginBottom: "16px", alignItems: "center" }, children: [
27
+ statusTransitions.map((a) => /* @__PURE__ */ jsxRuntime.jsx(
28
+ "button",
29
+ {
30
+ onClick: () => onStatusChange(a.status),
31
+ disabled: statusUpdating,
32
+ style: constants.s.outlineBtn(a.color, statusUpdating),
33
+ children: a.label
34
+ },
35
+ a.status
36
+ )),
37
+ snoozeUntil && new Date(snoozeUntil) > /* @__PURE__ */ new Date() && /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onCancelSnooze, disabled: snoozeSaving, style: { ...constants.s.ghostBtn("#7c3aed", snoozeSaving), fontSize: "12px", padding: "5px 10px" }, children: "Annuler snooze" }),
38
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { borderLeft: `1px solid ${constants.C.border}`, height: "20px", margin: "0 4px" } }),
39
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onToggleMerge, style: constants.s.ghostBtn("#be185d"), children: "Fusionner" }),
40
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onToggleExtMsg, style: constants.s.ghostBtn("#4f46e5"), children: "+ Message re\xE7u" }),
41
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onToggleSnooze, style: constants.s.ghostBtn("#7c3aed"), children: "Snooze" }),
42
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onNextTicket, style: constants.s.ghostBtn("#16a34a"), children: "Ticket suivant" })
43
+ ] }),
44
+ showNextTicket && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "10px 14px", borderRadius: "8px", backgroundColor: "#f0fdf4", border: `1px solid ${constants.C.border}`, marginBottom: "14px", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
45
+ nextTicketId ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
46
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "13px", color: "#166534", fontWeight: 600 }, children: [
47
+ "Ticket suivant : ",
48
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: nextTicketInfo })
49
+ ] }),
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ "button",
52
+ {
53
+ onClick: () => {
54
+ window.location.href = `/admin/support/ticket?id=${nextTicketId}`;
55
+ },
56
+ style: { ...constants.s.btn(constants.C.statusResolved), color: constants.C.white, fontSize: "12px", padding: "5px 14px" },
57
+ children: "Ouvrir"
58
+ }
59
+ )
60
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "13px", color: "#166534", fontWeight: 700 }, children: nextTicketInfo }),
61
+ /* @__PURE__ */ jsxRuntime.jsx("button", { onClick: onCloseNextTicket, style: { border: "none", background: "none", color: constants.C.textMuted, cursor: "pointer", fontSize: "16px", fontWeight: 700, marginLeft: "8px" }, children: "\xD7" })
62
+ ] })
63
+ ] });
64
+ }
65
+
66
+ exports.QuickActions = QuickActions;
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
3
+ import { s, C } from '../constants.js';
4
+
5
+ function QuickActions({
6
+ statusTransitions,
7
+ statusUpdating,
8
+ onStatusChange,
9
+ snoozeUntil,
10
+ snoozeSaving,
11
+ onCancelSnooze,
12
+ showMerge: _showMerge,
13
+ showExtMsg: _showExtMsg,
14
+ showSnooze: _showSnooze,
15
+ onToggleMerge,
16
+ onToggleExtMsg,
17
+ onToggleSnooze,
18
+ onNextTicket,
19
+ showNextTicket,
20
+ nextTicketId,
21
+ nextTicketInfo,
22
+ onCloseNextTicket
23
+ }) {
24
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
25
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: "8px", flexWrap: "wrap", marginBottom: "16px", alignItems: "center" }, children: [
26
+ statusTransitions.map((a) => /* @__PURE__ */ jsx(
27
+ "button",
28
+ {
29
+ onClick: () => onStatusChange(a.status),
30
+ disabled: statusUpdating,
31
+ style: s.outlineBtn(a.color, statusUpdating),
32
+ children: a.label
33
+ },
34
+ a.status
35
+ )),
36
+ snoozeUntil && new Date(snoozeUntil) > /* @__PURE__ */ new Date() && /* @__PURE__ */ jsx("button", { onClick: onCancelSnooze, disabled: snoozeSaving, style: { ...s.ghostBtn("#7c3aed", snoozeSaving), fontSize: "12px", padding: "5px 10px" }, children: "Annuler snooze" }),
37
+ /* @__PURE__ */ jsx("span", { style: { borderLeft: `1px solid ${C.border}`, height: "20px", margin: "0 4px" } }),
38
+ /* @__PURE__ */ jsx("button", { onClick: onToggleMerge, style: s.ghostBtn("#be185d"), children: "Fusionner" }),
39
+ /* @__PURE__ */ jsx("button", { onClick: onToggleExtMsg, style: s.ghostBtn("#4f46e5"), children: "+ Message re\xE7u" }),
40
+ /* @__PURE__ */ jsx("button", { onClick: onToggleSnooze, style: s.ghostBtn("#7c3aed"), children: "Snooze" }),
41
+ /* @__PURE__ */ jsx("button", { onClick: onNextTicket, style: s.ghostBtn("#16a34a"), children: "Ticket suivant" })
42
+ ] }),
43
+ showNextTicket && /* @__PURE__ */ jsxs("div", { style: { padding: "10px 14px", borderRadius: "8px", backgroundColor: "#f0fdf4", border: `1px solid ${C.border}`, marginBottom: "14px", display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
44
+ nextTicketId ? /* @__PURE__ */ jsxs(Fragment, { children: [
45
+ /* @__PURE__ */ jsxs("span", { style: { fontSize: "13px", color: "#166534", fontWeight: 600 }, children: [
46
+ "Ticket suivant : ",
47
+ /* @__PURE__ */ jsx("strong", { children: nextTicketInfo })
48
+ ] }),
49
+ /* @__PURE__ */ jsx(
50
+ "button",
51
+ {
52
+ onClick: () => {
53
+ window.location.href = `/admin/support/ticket?id=${nextTicketId}`;
54
+ },
55
+ style: { ...s.btn(C.statusResolved), color: C.white, fontSize: "12px", padding: "5px 14px" },
56
+ children: "Ouvrir"
57
+ }
58
+ )
59
+ ] }) : /* @__PURE__ */ jsx("span", { style: { fontSize: "13px", color: "#166534", fontWeight: 700 }, children: nextTicketInfo }),
60
+ /* @__PURE__ */ jsx("button", { onClick: onCloseNextTicket, style: { border: "none", background: "none", color: C.textMuted, cursor: "pointer", fontSize: "16px", fontWeight: 700, marginLeft: "8px" }, children: "\xD7" })
61
+ ] })
62
+ ] });
63
+ }
64
+
65
+ export { QuickActions };
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var constants = require('../constants');
5
+
6
+ const sourceLabels = {
7
+ email: "Email",
8
+ "live-chat": "Live Chat",
9
+ portal: "Portail",
10
+ admin: "Admin"
11
+ };
12
+ function TicketHeader({
13
+ ticketNumber,
14
+ currentStatus,
15
+ clientSentiment,
16
+ ticketSource,
17
+ chatSession,
18
+ snoozeUntil,
19
+ satisfaction,
20
+ copiedLink,
21
+ onCopyLink
22
+ }) {
23
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
24
+ display: "flex",
25
+ alignItems: "center",
26
+ gap: "10px",
27
+ padding: "10px 14px",
28
+ borderRadius: "8px",
29
+ backgroundColor: "var(--theme-elevation-100)",
30
+ marginBottom: "12px",
31
+ flexWrap: "wrap"
32
+ }, children: [
33
+ ticketNumber && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace", fontWeight: 700, fontSize: "14px", color: constants.C.textPrimary }, children: ticketNumber }),
34
+ currentStatus && (() => {
35
+ const st = constants.statusLabels[currentStatus] || constants.statusLabels.open;
36
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { style: constants.s.badge(st.bg, st.color), children: st.label });
37
+ })(),
38
+ clientSentiment && /* @__PURE__ */ jsxRuntime.jsxs(
39
+ "span",
40
+ {
41
+ style: { ...constants.s.badge(`${clientSentiment.color}15`, clientSentiment.color), fontSize: "11px" },
42
+ title: `Sentiment : ${clientSentiment.label}`,
43
+ children: [
44
+ clientSentiment.emoji,
45
+ " ",
46
+ clientSentiment.label
47
+ ]
48
+ }
49
+ ),
50
+ ticketSource && ticketSource !== "portal" && /* @__PURE__ */ jsxRuntime.jsx("span", { style: constants.s.badge("#f1f5f9", "#475569"), children: sourceLabels[ticketSource] || ticketSource }),
51
+ chatSession && ticketSource === "live-chat" && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { fontSize: "11px", color: constants.C.textMuted }, children: [
52
+ "Session : ",
53
+ chatSession.slice(0, 16),
54
+ "..."
55
+ ] }),
56
+ snoozeUntil && new Date(snoozeUntil) > /* @__PURE__ */ new Date() && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: constants.s.badge("#f5f3ff", "#7c3aed"), children: [
57
+ "Snooz\xE9 ",
58
+ new Date(snoozeUntil).toLocaleDateString("fr-FR", { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" })
59
+ ] }),
60
+ satisfaction && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: constants.s.badge(
61
+ satisfaction.rating >= 4 ? "#dcfce7" : satisfaction.rating >= 3 ? "#fef9c3" : "#fee2e2",
62
+ satisfaction.rating >= 4 ? "#166534" : satisfaction.rating >= 3 ? "#854d0e" : "#991b1b"
63
+ ), children: [
64
+ Array.from({ length: 5 }, (_, i) => i < satisfaction.rating ? "\u2605" : "\u2606").join(""),
65
+ " ",
66
+ satisfaction.rating,
67
+ "/5"
68
+ ] }),
69
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { marginLeft: "auto", display: "inline-flex", alignItems: "center", gap: "4px" }, children: [
70
+ /* @__PURE__ */ jsxRuntime.jsx(
71
+ "button",
72
+ {
73
+ onClick: () => onCopyLink("admin"),
74
+ title: "Copier le lien admin",
75
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "13px", opacity: copiedLink === "admin" ? 1 : 0.5, padding: "2px 4px" },
76
+ children: copiedLink === "admin" ? "\u2705" : "\u{1F4CB}"
77
+ }
78
+ ),
79
+ /* @__PURE__ */ jsxRuntime.jsx(
80
+ "button",
81
+ {
82
+ onClick: () => onCopyLink("client"),
83
+ title: "Copier le lien client",
84
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "13px", opacity: copiedLink === "client" ? 1 : 0.5, padding: "2px 4px" },
85
+ children: copiedLink === "client" ? "\u2705" : "\u{1F517}"
86
+ }
87
+ ),
88
+ copiedLink && /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: "11px", color: "#16a34a", fontWeight: 600 }, children: "Copi\xE9" })
89
+ ] })
90
+ ] });
91
+ }
92
+
93
+ exports.TicketHeader = TicketHeader;
@@ -0,0 +1,92 @@
1
+ "use client";
2
+ import { jsxs, jsx } from 'react/jsx-runtime';
3
+ import { C, statusLabels, s } from '../constants.js';
4
+
5
+ const sourceLabels = {
6
+ email: "Email",
7
+ "live-chat": "Live Chat",
8
+ portal: "Portail",
9
+ admin: "Admin"
10
+ };
11
+ function TicketHeader({
12
+ ticketNumber,
13
+ currentStatus,
14
+ clientSentiment,
15
+ ticketSource,
16
+ chatSession,
17
+ snoozeUntil,
18
+ satisfaction,
19
+ copiedLink,
20
+ onCopyLink
21
+ }) {
22
+ return /* @__PURE__ */ jsxs("div", { style: {
23
+ display: "flex",
24
+ alignItems: "center",
25
+ gap: "10px",
26
+ padding: "10px 14px",
27
+ borderRadius: "8px",
28
+ backgroundColor: "var(--theme-elevation-100)",
29
+ marginBottom: "12px",
30
+ flexWrap: "wrap"
31
+ }, children: [
32
+ ticketNumber && /* @__PURE__ */ jsx("span", { style: { fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', 'Cascadia Code', monospace", fontWeight: 700, fontSize: "14px", color: C.textPrimary }, children: ticketNumber }),
33
+ currentStatus && (() => {
34
+ const st = statusLabels[currentStatus] || statusLabels.open;
35
+ return /* @__PURE__ */ jsx("span", { style: s.badge(st.bg, st.color), children: st.label });
36
+ })(),
37
+ clientSentiment && /* @__PURE__ */ jsxs(
38
+ "span",
39
+ {
40
+ style: { ...s.badge(`${clientSentiment.color}15`, clientSentiment.color), fontSize: "11px" },
41
+ title: `Sentiment : ${clientSentiment.label}`,
42
+ children: [
43
+ clientSentiment.emoji,
44
+ " ",
45
+ clientSentiment.label
46
+ ]
47
+ }
48
+ ),
49
+ ticketSource && ticketSource !== "portal" && /* @__PURE__ */ jsx("span", { style: s.badge("#f1f5f9", "#475569"), children: sourceLabels[ticketSource] || ticketSource }),
50
+ chatSession && ticketSource === "live-chat" && /* @__PURE__ */ jsxs("span", { style: { fontSize: "11px", color: C.textMuted }, children: [
51
+ "Session : ",
52
+ chatSession.slice(0, 16),
53
+ "..."
54
+ ] }),
55
+ snoozeUntil && new Date(snoozeUntil) > /* @__PURE__ */ new Date() && /* @__PURE__ */ jsxs("span", { style: s.badge("#f5f3ff", "#7c3aed"), children: [
56
+ "Snooz\xE9 ",
57
+ new Date(snoozeUntil).toLocaleDateString("fr-FR", { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" })
58
+ ] }),
59
+ satisfaction && /* @__PURE__ */ jsxs("span", { style: s.badge(
60
+ satisfaction.rating >= 4 ? "#dcfce7" : satisfaction.rating >= 3 ? "#fef9c3" : "#fee2e2",
61
+ satisfaction.rating >= 4 ? "#166534" : satisfaction.rating >= 3 ? "#854d0e" : "#991b1b"
62
+ ), children: [
63
+ Array.from({ length: 5 }, (_, i) => i < satisfaction.rating ? "\u2605" : "\u2606").join(""),
64
+ " ",
65
+ satisfaction.rating,
66
+ "/5"
67
+ ] }),
68
+ /* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "inline-flex", alignItems: "center", gap: "4px" }, children: [
69
+ /* @__PURE__ */ jsx(
70
+ "button",
71
+ {
72
+ onClick: () => onCopyLink("admin"),
73
+ title: "Copier le lien admin",
74
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "13px", opacity: copiedLink === "admin" ? 1 : 0.5, padding: "2px 4px" },
75
+ children: copiedLink === "admin" ? "\u2705" : "\u{1F4CB}"
76
+ }
77
+ ),
78
+ /* @__PURE__ */ jsx(
79
+ "button",
80
+ {
81
+ onClick: () => onCopyLink("client"),
82
+ title: "Copier le lien client",
83
+ style: { background: "none", border: "none", cursor: "pointer", fontSize: "13px", opacity: copiedLink === "client" ? 1 : 0.5, padding: "2px 4px" },
84
+ children: copiedLink === "client" ? "\u2705" : "\u{1F517}"
85
+ }
86
+ ),
87
+ copiedLink && /* @__PURE__ */ jsx("span", { style: { fontSize: "11px", color: "#16a34a", fontWeight: 600 }, children: "Copi\xE9" })
88
+ ] })
89
+ ] });
90
+ }
91
+
92
+ export { TicketHeader };