/* ============================================================ FLUJO COLABORADOR — Bienvenida · Datos · Evaluación Exporta: ScreenWelcome, ScreenDatos, ScreenEval ============================================================ */ const { useState, useEffect, useRef } = React; const IHF = window.IH; /* ---------- Marca compacta ---------- */ function Brand({ small }) { return (
Ingeniería Humana
El Sendero del Alto Rendimiento
); } /* ============================================================ 1 · BIENVENIDA ============================================================ */ function ScreenWelcome({ onStart, onExec }) { return (
Diagnóstico conductual organizacional

No es un test.
Es una radiografía de cómo opera tu gente.

Todos llevamos dentro seis arquetipos. La evaluación no etiqueta personas: revela qué arquetipo gobierna hoy las decisiones, los comportamientos y el desempeño de cada colaborador.

60 afirmaciones · 6 arquetipos · un mapa conductual claro para la persona y para la organización.

≈ 8 minutos
); } /* El sendero de los 6 arquetipos */ function SenderoVisual() { return (
El sendero · de la contracción a la maestría
{IHF.archetypes.map((a, i) => (
{a.name} 0{a.order}
{a.glyph}
{a.group === 'riesgo' ? 'Riesgo' : a.group === 'transicion' ? 'Transición' : 'Evolución'}
))}
); } /* ============================================================ 2 · DATOS GENERALES ============================================================ */ function ScreenDatos({ profile, onChange, onNext, onBack }) { const fields = [ { k: 'nombre', label: 'Nombre completo', type: 'text', ph: 'Ej. Ana García' }, { k: 'empresa', label: 'Empresa', type: 'text', ph: 'Ej. Grupo Nexa' }, { k: 'area', label: 'Área', type: 'select', opts: IHF.areas }, { k: 'puesto', label: 'Puesto', type: 'text', ph: 'Ej. Coordinador comercial' }, { k: 'antiguedad', label: 'Antigüedad', type: 'select', opts: IHF.antiguedades }, { k: 'sucursal', label: 'Sucursal', type: 'select', opts: IHF.sucursales }, ]; const complete = profile.nombre && profile.empresa && profile.area; return (
Antes de comenzar

Cuéntanos quién eres

Estos datos permiten agrupar tus resultados por área y organización. Tus respuestas son confidenciales.

{fields.map(f => (
{f.type === 'select' ? ( ) : ( onChange(f.k, e.target.value)} className="ih-input" /> )}
))}
); } /* ============================================================ 3 · EVALUACIÓN (6 bloques × 10 afirmaciones) ============================================================ */ function ScreenEval({ answers, onAnswer, onFinish, onBack, blockIdx, setBlockIdx }) { const ids = IHF.order; const id = ids[blockIdx]; const arch = IHF.byId[id]; const qs = IHF.questions[id]; const blockAnswers = answers[id] || []; const blockDone = blockAnswers.filter(Boolean).length; const totalAnswered = ids.reduce((s, a) => s + (answers[a] || []).filter(Boolean).length, 0); const pct = Math.round((totalAnswered / 60) * 100); const blockComplete = blockDone === 10; const isLast = blockIdx === 5; const topRef = useRef(null); useEffect(() => { if (topRef.current) topRef.current.scrollTop = 0; }, [blockIdx]); return (
{/* barra superior con progreso */}
{totalAnswered} / 60 respondidas
Guardado
{/* cabecera de bloque (neutral, sin nombrar el arquetipo para no sesgar) */}
Bloque {String(blockIdx + 1).padStart(2, '0')} de 06
10 afirmaciones

Indica con qué frecuencia te identificas con cada afirmación. Responde con honestidad: no hay respuestas correctas.

{qs.map((q, i) => ( onAnswer(id, i, v)} /> ))}
{/* footer navegación */}
); } function QuestionRow({ idx, text, value, onChange, color }) { return (
{String(idx + 1).padStart(2, '0')} {text}
{IHF.scaleLabels.map((lbl, v) => { const active = value === v + 1; return ( ); })}
); } /* ---------- Shell de pasos intermedios ---------- */ function FlowShell({ step, onBack, children }) { return (
{step}
{children}
); } /* ============================================================ ScreenLogin — acceso al panel ejecutivo ============================================================ */ function ScreenLogin({ onSuccess, onBack }) { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [busy, setBusy] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e) => { e.preventDefault(); if (!email || !password) return; setBusy(true); setError(null); try { const user = await IHA.login(email, password); onSuccess(user); } catch (err) { setError(err.message || 'Credenciales incorrectas'); } finally { setBusy(false); } }; return (
Panel ejecutivo

Acceso restringido

Ingresa con tu cuenta de administrador para ver el panel ejecutivo.

setEmail(e.target.value)} placeholder="admin@empresa.com" className="ih-input" autoFocus />
setPassword(e.target.value)} placeholder="••••••••" className="ih-input" />
{error && (
{error}
)}
); } Object.assign(window, { Brand, ScreenWelcome, ScreenDatos, ScreenEval, FlowShell, ScreenLogin });