/* global React */ // Mock data — realistic Spanish-language tickets across channels const TICKETS = [ // ============ URGENT / ESCALATED ============ { id: "CNL-2841", channel: "whatsapp", customer: "María Fernanda Soto", customerSub: "+502 5512 0481", company: "Distribuidora El Quetzal, S.A.", printer: "HP LaserJet Pro M404dn", serial: "VNB3K12089", state: "auto", handler: "sofia", time: "10:46", age: "hace 3 min", issue: "Atasco de papel · bandeja 2", urgent: false, }, { id: "CNL-2840", channel: "call", customer: "Roberto Cifuentes", customerSub: "+502 2477 8830 · ext. 14", company: "Constructora Cifuentes Hnos.", printer: "Canon imageRUNNER 2630i", serial: "DLP04221", state: "escalated", handler: "dispatch", time: "11:08", age: "hace 1 min", issue: "Serie no aparece en BD", urgent: true, escalationReason: "serie-no-aparece", }, { id: "CNL-2839", channel: "web", customer: "Luis Pérez", customerSub: "luis.perez@imprenta-color.gt", company: "Imprenta Color GT", printer: "HP LaserJet M428fdw", serial: "CNB8H42P11", state: "progress", handler: "sofia", time: "14:02", age: "hace 6 min", issue: "Calidad: líneas verticales", urgent: false, }, { id: "CNL-2838", channel: "web", customer: "Andrea Molina", customerSub: "andrea.molina@grupotecho.gt", company: "Grupo Techo", printer: "HP Color LaserJet M283fdw", serial: "CNF9X22033", state: "progress", handler: "sofia", time: "09:48", age: "hace 12 min", issue: "Toner amarillo agotado", urgent: false, }, { id: "CNL-2837", channel: "call", customer: "Industrias Polar", customerSub: "+502 2245 9912", company: "Industrias Polar de Centroamérica", printer: "Canon LBP6230dw", serial: "—", state: "escalated", handler: "dispatch", time: "13:30", age: "hace 18 min", issue: "Robo de equipo arrendado", urgent: true, escalationReason: "equipo-retirado", }, { id: "CNL-2836", channel: "email", customer: "Karla Estrada", customerSub: "kestrada@notariaestrada.com.gt", company: "Notaría Estrada & Asoc.", printer: "HP OfficeJet Pro 9015e", serial: "TH1B9011XK", state: "auto", handler: "sofia", time: "10:26", age: "hace 24 min", issue: "Solicita visita · falla intermitente", urgent: false, }, { id: "CNL-2835", channel: "whatsapp", customer: "José Alvarado", customerSub: "+502 4112 7700", company: "Ferretería Alvarado", printer: "HP LaserJet M111w", serial: "VNB5L88PX2", state: "resolved", handler: "sofia", time: "10:18", age: "hace 41 min", issue: "Configuración WiFi · resuelto KB", urgent: false, }, { id: "CNL-2834", channel: "call", customer: "Helena Castañeda", customerSub: "+502 5790 2200", company: "Clínicas Vida Nueva", printer: "HP LaserJet Pro M428", serial: "CNB8H4XXXX (ilegible)", state: "escalated", handler: "dispatch", time: "11:24", age: "hace 55 min", issue: "Cliente no puede leer la serie", urgent: false, escalationReason: "cliente-no-serie", }, // ============ EXTRA AUTO SOF.IA ============ { id: "CNL-2833", channel: "whatsapp", customer: "Eva Maldonado", customerSub: "+502 5544 1102", company: "Mueblería del Centro", printer: "HP LaserJet Pro M404n", serial: "VNB7K42189", state: "auto", handler: "sofia", time: "11:32", age: "hace 8 min", issue: "Conexión a red por WiFi", urgent: false, }, { id: "CNL-2832", channel: "email", customer: "Pablo Recinos", customerSub: "precinos@auditoresrec.com.gt", company: "Auditores Recinos & Asoc.", printer: "Canon imageRUNNER 2625i", serial: "DLP08840", state: "auto", handler: "sofia", time: "11:18", age: "hace 14 min", issue: "Validación de serie en BD", urgent: false, }, { id: "CNL-2831", channel: "web", customer: "Cristina Vela", customerSub: "cvela@colegiosanpedro.edu.gt", company: "Colegio San Pedro", printer: "HP LaserJet M428dw", serial: "CNB9X11422", state: "progress", handler: "sofia", time: "11:02", age: "hace 22 min", issue: "Indagación de falla · sin imprimir", urgent: false, }, { id: "CNL-2830", channel: "whatsapp", customer: "Karen Avilés", customerSub: "+502 4810 5021", company: "Florería Tulipán", printer: "HP DeskJet 2755e", serial: "TH4N20991", state: "auto", handler: "sofia", time: "10:52", age: "hace 28 min", issue: "Cómo escanear desde el panel", urgent: false, }, { id: "CNL-2829", channel: "call", customer: "Mario Ovalle", customerSub: "+502 2384 1100", company: "Importadora Sol", printer: "HP LaserJet Pro M404dn", serial: "VNB3K42088", state: "progress", handler: "sofia", time: "10:44", age: "hace 31 min", issue: "Solicita cotización mantto. preventivo", urgent: false, }, { id: "CNL-2828", channel: "web", customer: "Boutique Vera", customerSub: "contacto@boutique-vera.gt", company: "Boutique Vera", printer: "Canon LBP6230dw", serial: "DLP12099", state: "resolved", handler: "sofia", time: "10:36", age: "hace 39 min", issue: "Cambio de cartucho · paso a paso", urgent: false, }, { id: "CNL-2827", channel: "email", customer: "Sergio Funes", customerSub: "sergio@funescia.com", company: "Funes & Cía.", printer: "HP LaserJet M428fdw", serial: "CNB8H42M88", state: "waiting", handler: "sofia", time: "10:20", age: "hace 51 min", issue: "Validación de cliente · NIT pendiente", urgent: false, }, { id: "CNL-2826", channel: "call", customer: "Hugo Méndez", customerSub: "+502 5621 4488", company: "Distribuciones HM", printer: "HP Color LaserJet M283fdw", serial: "CNF7X19044", state: "auto", handler: "sofia", time: "10:08", age: "hace 1 h", issue: "Reinicio tras corte eléctrico", urgent: false, }, { id: "CNL-2825", channel: "whatsapp", customer: "Andrea Saquic", customerSub: "+502 3399 7710", company: "Floristería Petalia", printer: "HP DeskJet 4155e", serial: "TH3N18822", state: "auto", handler: "sofia", time: "09:58", age: "hace 1 h", issue: "Cómo descargar el driver Mac", urgent: false, }, // ============ MORE PROGRESS / WAITING ============ { id: "CNL-2824", channel: "email", customer: "Hotel Casa Blanca", customerSub: "reservas@casablanca.gt", company: "Hotel Casa Blanca Antigua", printer: "HP LaserJet Pro M404dn", serial: "VNB3K28811", state: "waiting", handler: "sofia", time: "09:42", age: "hace 1 h 12 min", issue: "Esperando foto del display", urgent: false, }, { id: "CNL-2823", channel: "call", customer: "Tienda La Aurora", customerSub: "+502 2278 1144", company: "Tienda La Aurora", printer: "HP LaserJet Pro M404n", serial: "VNB6L33042", state: "progress", handler: "sofia", time: "09:24", age: "hace 1 h 30 min", issue: "Cliente revisando contrato", urgent: false, }, // ============ MORE ESCALATED / URGENT ============ { id: "CNL-2822", channel: "whatsapp", customer: "Ferretería El Sol", customerSub: "+502 4400 2210", company: "Ferretería El Sol", printer: "HP LaserJet M111w", serial: "VNB5L48820 (parcial)", state: "escalated", handler: "dispatch", time: "11:14", age: "hace 11 min", issue: "Cliente no puede leer serie completa", urgent: true, escalationReason: "cliente-no-serie", }, { id: "CNL-2821", channel: "call", customer: "Restaurante Doña Luisa", customerSub: "+502 5587 9001", company: "Restaurante Doña Luisa", printer: "Canon imageRUNNER 2625i", serial: "DLP08812", state: "escalated", handler: "dispatch", time: "10:58", age: "hace 27 min", issue: "Contrato arrendamiento no grabado", urgent: true, escalationReason: "contrato-no-grabado", }, // ============ RECENTLY RESOLVED ============ { id: "CNL-2820", channel: "whatsapp", customer: "Carlos Aguilar", customerSub: "+502 5044 1188", company: "Carrocería Aguilar", printer: "HP LaserJet Pro M404dn", serial: "VNB3K10488", state: "resolved", handler: "sofia", time: "08:54", age: "hace 2 h", issue: "Limpieza tambor de imagen", urgent: false, }, ]; // ============ FOCUSED CASE — Andrea Molina, web chat resolved by SOF.IA ============ // Actually let's use the WhatsApp star case with mispronounced serial const FOCUSED_CASE = { id: "CNL-2841", channel: "whatsapp", customer: "María Fernanda Soto", customerSub: "+502 5512 0481", company: "Distribuidora El Quetzal, S.A.", printer: "HP LaserJet Pro M404dn", serial: "VNB3K12089", contract: "MANT-2023-118 · vigente", state: "auto", handler: "sofia", startedAt: "10:42:18", resolvedAt: "10:46:00", duration: "3 min 42 s", conversation: [ { dir: "in", text: "Buen día, soy María de El Quetzal. La impresora se atascó otra vez 😩", time: "10:42" }, { dir: "out", text: "Hola María, soy SOF.IA, la asistente de soporte de Canella 👋\nLamento el inconveniente. Para abrirte el ticket necesito el número de serie del equipo. ¿Lo tienes a la mano?", time: "10:42" }, { dir: "in", text: "Sí espérame… dice VNB tres K uno dos cero ochenta y nueve", time: "10:43" }, { dir: "out", text: "Perfecto, te confirmo: VNB3K12089, ¿correcto?", time: "10:43" }, { dir: "in", text: "Sí esa es", time: "10:43" }, { dir: "out", text: "Anotado. ✅ Veo que el equipo está bajo contrato de mantenimiento MANT-2023-118 a nombre de Distribuidora El Quetzal, S.A. ¿Me confirmas que sigues en la sucursal de Calzada Roosevelt 24-69 zona 11?", time: "10:44" }, { dir: "in", text: "Sí ahí estoy", time: "10:44" }, { dir: "out", text: "Gracias. Sobre el atasco: ¿el papel se queda atorado al entrar (bandeja 2) o ya cuando va saliendo por arriba?", time: "10:44" }, { dir: "in", text: "Al entrar, no jala bien el papel desde la bandeja de abajo", time: "10:45" }, { dir: "out", text: "Entendido. Por la descripción coincide con desgaste del rodillo de arrastre de la bandeja 2 — falla común en este modelo después de ~80k impresiones. Tu equipo lleva 91,420 impresiones registradas, así que probablemente sea eso.\n\nVoy a coordinar visita de un técnico para reemplazo del rodillo. Te propongo *mañana martes entre 9:00 y 12:00*. ¿Te funciona?", time: "10:45" }, { dir: "in", text: "Mañana sí pero mejor en la tarde, en la mañana no estoy", time: "10:45" }, { dir: "out", text: "Listo, agendado para *mañana martes 27/05 entre 14:00 y 17:00*.\n\nTu ticket es *#CNL-2841*. Te llegará confirmación por correo y el técnico te avisará 30 min antes.\n\n¿Algo más en lo que te ayude? 🛠️", time: "10:46" }, { dir: "in", text: "No, mil gracias!! 🙌", time: "10:46" }, ], reasoning: [ { idx: 1, title: "Clasificación inicial", body: "Reporte categorizado como **falla de hardware** · subcat. *atasco de papel*. Confianza 0.94.", time: "10:42:18", state: "done" }, { idx: 2, title: "Captura de serie (entrada por voz)", body: "Cliente dictó la serie en lenguaje natural. Parsed: `VNB3K12089` (10 caracteres alfanuméricos, formato válido HP).", time: "10:43:04", state: "done" }, { idx: 3, title: "Validación contra BD Canella", body: "Match exacto en `equipos.serie`. Cliente verificado: *Distribuidora El Quetzal, S.A.* — NIT *7842031-5*.", time: "10:43:07", state: "done" }, { idx: 4, title: "Verificación de contrato", body: "Contrato `MANT-2023-118` vigente hasta 2026-08-15. Cubre mantenimiento preventivo y correctivo. ✓ Dentro de alcance.", time: "10:43:09", state: "done" }, { idx: 5, title: "Indagación de falla (árbol HW)", body: "Pregunta dirigida confirma síntoma de arrastre, no de salida. Descarta fusor y rodillo de salida.", time: "10:45:12", state: "done" }, { idx: 6, title: "Consulta Knowledge Base", body: "3 documentos relevantes recuperados. Top match: *KB-HP-M404-008 · Reemplazo rodillo bandeja 2* (score 0.91).", time: "10:45:14", state: "done" }, { idx: 7, title: "Cruce con histórico del equipo", body: "Contador de impresiones: **91,420**. Umbral de fallo del rodillo: ~80k. Probabilidad de causa raíz: alta.", time: "10:45:16", state: "done" }, { idx: 8, title: "Decisión: agendar visita", body: "Falla amerita visita de técnico. Asignado a *Eddy R. Marroquín* (zona 11). Slot confirmado por cliente.", time: "10:45:58", state: "done" }, { idx: 9, title: "Generación de ticket + correo", body: "Ticket `#CNL-2841` creado. Correo de confirmación redactado y enviado al cliente y a despacho.", time: "10:46:00", state: "done" }, ], kbHits: [ { score: "0.91", title: "KB-HP-M404-008 · Reemplazo rodillo de arrastre bandeja 2", snippet: "Procedimiento estándar tras ~80,000 impresiones. Repuesto ref. RM2-5397-000CN.", section: "Mantenimiento HW" }, { score: "0.74", title: "KB-HP-M404-003 · Diagnóstico de atascos por bandeja", snippet: "Árbol de decisión para localizar el rodillo o sensor responsable.", section: "Diagnóstico" }, { score: "0.68", title: "KB-GEN-014 · Política de visitas bajo contrato MANT", snippet: "Tiempos de respuesta y zonas cubiertas para clientes con contrato vigente.", section: "Operación" }, ], email: { to: "maria.soto@elquetzal.gt; despacho@canella.gt", cc: "tecnicos.zona11@canella.gt", subject: "Ticket #CNL-2841 · Visita técnica programada · Distribuidora El Quetzal", body: `Estimada María Fernanda, Confirmamos la apertura de su ticket de servicio: # Ticket: CNL-2841 Serie equipo: VNB3K12089 (HP LaserJet Pro M404dn) Cliente: Distribuidora El Quetzal, S.A. · NIT 7842031-5 Contrato: MANT-2023-118 · Vigente Motivo: Reemplazo de rodillo de arrastre — bandeja 2 Diagnóstico: Desgaste por uso (91,420 impresiones) Visita programada Fecha: Martes 27 de mayo de 2026 Ventana: 14:00 – 17:00 hrs Dirección: Calzada Roosevelt 24-69 zona 11, Guatemala Técnico asign.: Eddy R. Marroquín · DPI 2541 88203 0101 Vehículo: Pickup Toyota Hilux blanco · Placas P-742CXR Le confirmaremos 30 minutos antes del arribo. Atentamente, SOF.IA · Soporte Canella (generado automáticamente · 27/05/2026 10:46)` } }; // ============ ESCALATED CASE — Roberto Cifuentes, phone call, serial not found ============ const ESCALATED_CASE = { id: "CNL-2840", channel: "call", customer: "Roberto Cifuentes", customerSub: "+502 2477 8830 ext. 14", company: "Constructora Cifuentes Hnos.", printer: "Canon imageRUNNER 2630i", serialAttempted: "DLP04221", state: "escalated", reason: "serie-no-aparece", escalatedAt: "11:08:42", duration: "1 min 08 s con SOF.IA", transcript: [ { speaker: "Cliente", bot: false, text: "Buenos días, le llamo porque la copiadora no quiere imprimir, marca un error en pantalla.", time: "11:07:34" }, { speaker: "SOF.IA", bot: true, text: "Buenos días, soy SOF.IA, asistente automatizada de soporte Canella. Con gusto le ayudo. ¿Me podría compartir el número de serie del equipo, por favor?", time: "11:07:38" }, { speaker: "Cliente", bot: false, text: "Sí, es DLP cero cuatro dos dos uno.", time: "11:07:52" }, { speaker: "SOF.IA", bot: true, text: "Permítame un momento, valido en nuestra base de datos… DLP04221. No me aparece en el sistema. ¿El equipo fue adquirido a Canella, o lo arrenda?", time: "11:08:04" }, { speaker: "Cliente", bot: false, text: "Mire, este equipo lo compramos al contado hace tiempo, no recuerdo si fue con Canella directamente.", time: "11:08:18" }, { speaker: "SOF.IA", bot: true, text: "Entiendo. Voy a escalar su caso a uno de nuestros operadores para validar manualmente. Conservaré toda esta conversación. ¿Me permite mantenerlo en línea un momento mientras transfiero?", time: "11:08:30" }, { speaker: "Cliente", bot: false, text: "Sí, está bien, gracias.", time: "11:08:38" }, ], collected: [ { k: "Canal de origen", v: "Llamada telefónica entrante", src: "AUTO", mono: true }, { k: "Cliente", v: "Roberto Cifuentes", src: "AUTO" }, { k: "Empresa", v: "Constructora Cifuentes Hnos.", src: "AUTO" }, { k: "Teléfono", v: "+502 2477 8830 ext. 14", src: "AUTO", mono: true }, { k: "Modelo declarado", v: "Canon imageRUNNER 2630i", src: "VOZ" }, { k: "Serie dictada", v: "DLP04221", src: "VOZ", mono: true, hint: "no encontrada" }, { k: "Modo de compra", v: "Al contado · presunto no-Canella", src: "VOZ" }, { k: "Síntoma reportado", v: "Error en pantalla, no imprime", src: "VOZ" }, { k: "Sentimiento", v: "Neutro · cooperativo", src: "AUTO", muted: true }, ], }; const RESOLVED_TODAY = 47; const TOTAL_ACTIVE = 12; Object.assign(window, { TICKETS, FOCUSED_CASE, ESCALATED_CASE, RESOLVED_TODAY, TOTAL_ACTIVE });