1import{r as i,a as Ya,u as Ct,N as yr,b as he,L as Se,c as vr,R as Io,d as da,e as Di,f as Ne,B as $i}from"./vendor-Cck-BZPK.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))s(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function r(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(n){if(n.ep)return;n.ep=!0;const o=r(n);fetch(n.href,o)}})();var Do={exports:{}},jr={};/** 2 * @license React 3 * react-jsx-runtime.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Oi=i,qi=Symbol.for("react.element"),Ui=Symbol.for("react.fragment"),Wi=Object.prototype.hasOwnProperty,Hi=Oi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Vi={key:!0,ref:!0,__self:!0,__source:!0};function $o(t,a,r){var s,n={},o=null,l=null;r!==void 0&&(o=""+r),a.key!==void 0&&(o=""+a.key),a.ref!==void 0&&(l=a.ref);for(s in a)Wi.call(a,s)&&!Vi.hasOwnProperty(s)&&(n[s]=a[s]);if(t&&t.defaultProps)for(s in a=t.defaultProps,a)n[s]===void 0&&(n[s]=a[s]);return{$$typeof:qi,type:t,key:o,ref:l,props:n,_owner:Hi.current}}jr.Fragment=Ui;jr.jsx=$o;jr.jsxs=$o;Do.exports=jr;var e=Do.exports,Oo,un=Ya;Oo=un.createRoot,un.hydrateRoot;const Lt="https://api.neuralpitch.ai";function ns(){try{const t=sessionStorage.getItem("user");return t?JSON.parse(t):null}catch{return null}}function Ma(t){t?sessionStorage.setItem("user",JSON.stringify(t)):sessionStorage.removeItem("user")}function ir(){sessionStorage.removeItem("user")}let tr=null;function qo(){const t=!!ns();ir(),t&&window.dispatchEvent(new CustomEvent("neuralpitch:session-expired"))}async function Gi(){const t=await fetch(`${Lt}/api/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({})});if(!t.ok){qo();const a=new Error("Sesión expirada. Inicia sesión de nuevo.");throw a.status=401,a.code="SESSION_EXPIRED",a}return t.json()}async function Es(){return tr||(tr=Gi().finally(()=>{tr=null})),tr}async function ja(t,a={},r=!0){const s=`${Lt}${t}`,n={...a.headers};a.body instanceof FormData||(n["Content-Type"]="application/json");let o;try{o=await fetch(s,{...a,headers:n,credentials:"include"})}catch{throw new Error("Error de red. Comprueba tu conexión a internet.")}const l=/^\/api\/auth\/(login|register|verify-email|resend-verification)/.test(t);if(o.status===401&&r&&!l)try{return await Es(),ja(t,a,!1)}catch{throw new Error("Sesión expirada. Inicia sesión de nuevo.")}if(o.status===403&&!l){let u;try{u=await o.clone().json()}catch{u={}}
9if((typeof(u==null?void 0:u.detail)=="string"?u.detail:"")==="Could not validate credentials"){qo();const p=new Error("Sesión no válida. Inicia sesión de nuevo.");throw p.status=403,p.code="SESSION_EXPIRED",p}}if(o.status===451){sessionStorage.setItem("neuralpitch_consent_return",window.location.pathname),window.dispatchEvent(new CustomEvent("neuralpitch:consent-required"));const u=new Error("Consentimiento de procesamiento de voz requerido.");throw u.status=451,u.code="CONSENT_REQUIRED",u}if(o.status===204)return null;let c;if((o.headers.get("content-type")||"").includes("application/json")?c=await o.json():c=await o.text(),!o.ok){let u;typeof c=="object"&&(c!=null&&c.detail)?typeof c.detail=="string"?u=c.detail:Array.isArray(c.detail)?u=c.detail.map(p=>p.msg||String(p)).join(". "):typeof c.detail=="object"?u=c.detail.message||c.detail.code||`Error ${o.status}`:u=String(c.detail):typeof c=="object"&&typeof(c==null?void 0:c.message)=="string"?u=c.message:typeof c=="string"&&c?u=c:u=`Error ${o.status}`;const m=new Error(u);throw m.status=o.status,m.data=c,m}return c}const R={get(t,a={}){return ja(t,{...a,method:"GET"})},post(t,a,r={}){return ja(t,{...r,method:"POST",body:typeof a=="object"&&!(a instanceof FormData)?JSON.stringify(a):a})},put(t,a,r={}){return ja(t,{...r,method:"PUT",body:typeof a=="object"&&!(a instanceof FormData)?JSON.stringify(a):a})},delete(t,a={}){return ja(t,{...a,method:"DELETE"})},upload(t,a,r={}){return ja(t,{...r,method:"POST",body:a})},async download(t,a={}){const r=`${Lt}${t}`,s=await fetch(r,{...a,method:"GET",credentials:"include"});if(s.status===401)try{return await Es(),R.download(t,a)}catch{throw new Error("Sesión expirada.")}if(!s.ok)throw new Error(`Error ${s.status} al descargar fichero`);return s.blob()}};async function cr(t,a={},r=!0){const s=await fetch(`${Lt}${t}`,{...a,credentials:"include"});if(s.status===401&&r)try{return await Es(),cr(t,a,!1)}catch{return s}return s}const Ji="neuralpitch",Yi=1,qt="audio_sessions",Uo=72*60*60*1e3;function Nr(){return new Promise((t,a)=>{if(!window.indexedDB)return a(new Error("IndexedDB not supported"));
9const r=window.indexedDB.open(Ji,Yi);r.onupgradeneeded=s=>{const n=s.target.result;n.objectStoreNames.contains(qt)||n.createObjectStore(qt,{keyPath:"sessionId"})},r.onsuccess=s=>t(s.target.result),r.onerror=s=>a(s.target.error)})}async function Cs(t,a){try{const r=await Nr();return new Promise((s,n)=>{const o=r.transaction(qt,"readwrite");o.objectStore(qt).put({sessionId:t,storedAt:Date.now(),...a}),o.oncomplete=()=>s(!0),o.onerror=l=>n(l.target.error)})}catch{return!1}}async function Wo(t){try{const a=await Nr();return new Promise((r,s)=>{const o=a.transaction(qt,"readonly").objectStore(qt).get(t);o.onsuccess=l=>{const c=l.target.result;if(!c)return r(null);if(Date.now()-c.storedAt>Uo)return Ki(t),r(null);r(c)},o.onerror=l=>s(l.target.error)})}catch{return null}}async function Ki(t){try{(await Nr()).transaction(qt,"readwrite").objectStore(qt).delete(t)}catch{}}async function Xi(){try{const t=await Nr();return new Promise(a=>{const r=t.transaction(qt,"readwrite");r.objectStore(qt).clear(),r.oncomplete=()=>a(!0),r.onerror=()=>a(!1)})}catch{return!1}}function Qi(t){const a=Uo-(Date.now()-t);if(a<=0)return null;const r=Math.floor(a/(60*60*1e3)),s=Math.floor(a%(60*60*1e3)/6e4);return r>0?`${r}h ${s}m`:`${s}m`}const Bt=i.createContext(null),Zi=30*60*1e3,ec=25*60*1e3,tc=1e3;function ac({children:t}){const[a,r]=i.useState(()=>ns()),[s,n]=i.useState(!0),[o,l]=i.useState(null),[c,d]=i.useState(!1),[u,m]=i.useState(!1),p=i.useRef(null);i.useEffect(()=>{async function b(){const w=!!ns();try{const L=await R.get("/api/auth/me");r(L),Ma(L)}catch{ir(),r(null),w&&d(!0)}finally{n(!1)}}b()},[]),i.useEffect(()=>{const b=()=>{r(null),m(!1),d(!0)};return window.addEventListener("neuralpitch:session-expired",b),()=>window.removeEventListener("neuralpitch:session-expired",b)},[]),i.useEffect(()=>{if(!a)return;let b,w,L=0;function z(){clearTimeout(b),clearTimeout(w),m(!1),b=setTimeout(()=>m(!0),ec),w=setTimeout(()=>{m(!1),r(null),ir(),d(!0)},Zi)}function A(){const D=Date.now();D-L<tc||(L=D,z())}p.current=z;const S=["mousedown","keydown","touchstart","click","neuralpitch:user-active"],_=["pointermove","scroll","wheel"];return S.forEach(D=>window.addEventListener(D,z,{passive:!0})),_.forEach(D=>window.addEventListener(D,A,{passive:!0,capture:!0})),z(),()=>{clearTimeout(b),clearTimeout(w),S.forEach(D=>window.removeEventListener(D,z)),_.forEach(D=>window.removeEventListener(D,A,{capture:!0})),p.current=null}},[a]);const x=i.useCallback(()=>{d(!1)},[]),v=i.useCallback(()=>{m(!1)},[]),f=i.useCallback(async()=>{var b;try{await R.post("/api/auth/refresh",{}),(b=p.current)==null||b.call(p)}catch{m(!1),d(!0)}},[]),h=i.useCallback(async(b,w)=>{l(null);const L=await R.post("/api/auth/login",{email:b,password:w});return r(L.user),Ma(L.user),L.user},[]),g=i.useCallback(async b=>{l(null);const w=await R.post("/api/auth/register",b);return w.email_verification_required?{emailVerificationRequired:!0,message:w.message}:(r(w.user),Ma(w.user),w.user)},[]),y=i.useCallback(async()=>{try{await R.post("/api/auth/logout",{})}catch{}ir(),r(null),Xi()},[]),j=i.useCallback(async b=>{const w=await R.put("/api/auth/me",b);return r(w),Ma(w),w},[]),F=i.useCallback(async(b,w)=>{await R.put("/api/auth/me/password",{current_password:b,new_password:w})},[]),C=i.useCallback(async()=>{const b=await R.get("/api/auth/me");return r(b),Ma(b),b},[]),N={user:a,loading:s,authError:o,isAuthenticated:!!a,sessionExpired:c,sessionWarning:u,dismissSessionExpired:x,dismissSessionWarning:v,extendSession:f,login:h,register:g,logout:y,updateProfile:j,changePassword:F,refreshUser:C};return e.jsx(Bt.Provider,{value:N,children:t})}const Ho=i.createContext(null);function rc({children:t}){const[a,r]=i.useState([]),[s,n]=i.useState(!0);i.useEffect(()=>{R.get("/api/techniques").then(l=>r(l.techniques||[])).catch(()=>{}).finally(()=>n(!1))},[]);const o=i.useCallback(l=>a.find(c=>c.id===l)??null,[a]);return e.jsx(Ho.Provider,{value:{techniques:a,getTechniqueById:o,loading:s},children:t})}function Ut(){const t=i.useContext(Ho);if(!t)throw new Error("useTechniques must be used within TechniquesProvider");return t}function Ge(){const t=i.useContext(Bt);if(!t)throw new Error("useAuth must be used within an AuthProvider");return t}const Vo=i.createContext(null),dr="neuralpitch_tour_state";function mn(){try{return JSON.parse(localStorage.getItem(dr))||null}catch{return null}}function sc({children:t}){const{user:a,refreshUser:r}=Ge(),[s,n]=i.useState(mn);i.useEffect(()=>{if(!a||a.onboarding_completed_at)return;const u=mn();if(u!=null&&u.active)return;const m={active:!0,mandatory:!0,step:0};localStorage.setItem(dr,JSON.stringify(m)),n(m)},[a==null?void 0:a.id,a==null?void 0:a.onboarding_completed_at]);const o=i.useCallback(u=>{n(m=>{const p=typeof u=="function"?u(m):u;return p?localStorage.setItem(dr,JSON.stringify(p)):localStorage.removeItem(dr),p})},[]),l=i.useCallback(u=>{o(m=>({...m,step:u}))},[o]),c=i.useCallback(async()=>{o(null);try{await R.post("/api/onboarding/complete"),await r()}catch{}},[o,r]),d=i.useCallback(async()=>{try{await R.post("/api/onboarding/reset"),await r()}catch{}o({active:!0,mandatory:!1,step:0})},[o,r]);return e.jsx(Vo.Provider,{value:{tourState:s,goToStep:l,completeTour:c,resetTour:d},children:t})}const Go=()=>i.useContext(Vo);function at({children:t}){const{isAuthenticated:a,loading:r}=Ge(),s=Ct();return r?e.jsx("div",{className:"min-h-screen bg-neuro-dark flex items-center justify-center",children:e.jsx("div",{className:"w-10 h-10 rounded-full border-[3px] border-neuro-green/20 border-t-neuro-green animate-rotate","aria-label":"Cargando..."})}):a?t:e.jsx(yr,{to:"/login",state:{from:s},replace:!0})}function pn({children:t}){const{user:a,loading:r}=i.useContext(Bt);return r?e.jsx("div",{className:"min-h-screen bg-neuro-dark flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-t-2 border-neuro-green"})}):!a||a.role!=="admin"?e.jsx(yr,{to:"/",replace:!0}):t}function ua({size:t=32,className:a=""}){const r=Math.round(t*.21);return e.jsxs("svg",{viewBox:"0 0 80 80",width:t,height:t,xmlns:"http://www.w3.org/2000/svg",className:a,"aria-hidden":"true",children:[e.jsx("rect",{width:"80",height:"80",rx:r,fill:"#00E5A0"}),e.jsx("text",{x:"40",y:"54",textAnchor:"middle",fontFamily:"Inter, system-ui, sans-serif",fontWeight:"800",fontSize:"34",fill:"#0A0A0F",letterSpacing:"-1",children:"NP"})]})}const nc=[{to:"/",label:"Técnicas"},{to:"/entrenador",label:"Entrenador",premium:!0,tourId:"tour-nav-entrenador"},{to:"/sparring",label:"Sparring",premium:!0,tourId:"tour-nav-sparring"},{to:"/custom-practice",label:"Script propio"},{to:"/biblioteca",label:"Biblioteca"},{to:"/llamadas",label:"Llamadas",premium:!0,tourId:"tour-nav-llamadas"},{to:"/history",label:"Historial"}];function oc(){const{user:t,logout:a,isAuthenticated:r}=Ge(),{resetTour:s}=Go(),n=Ct(),o=he(),[l,c]=i.useState(!1),[d,u]=i.useState(!1),[m,p]=i.useState(!1),x=i.useRef(null);i.useEffect(()=>{!r||!t||R.get("/api/team/mine").then(g=>{const y=(g.teams||[]).some(j=>j.is_manager);p(y)}).catch(()=>{})},[r,t]);const v=[...nc,...m?[{to:"/team",label:"Equipo",tourId:"tour-nav-team"}]:[]];i.useEffect(()=>{function g(y){x.current&&!x.current.contains(y.target)&&u(!1)}return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]),i.useEffect(()=>{c(!1),u(!1)},[n.pathname]);const f=async()=>{await a(),o("/login")},h=g=>g==="/"?n.pathname==="/":n.pathname.startsWith(g);return e.jsxs("header",{className:"fixed top-0 left-0 right-0 z-40",style:{background:"rgba(10,10,15,0.92)",borderBottom:"1px solid rgba(255,255,255,0.04)",backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[e.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:e.jsxs("div",{className:"flex items-center justify-between h-16",children:[e.jsxs(Se,{to:r?"/":"/login",className:"flex items-center gap-3 flex-shrink-0","aria-label":"NeuralPitch Simulator · Inicio",children:[e.jsx(ua,{size:34}),e.jsxs("div",{className:"hidden sm:block",children:[e.jsx("p",{className:"text-base font-bold leading-none tracking-tight",children:"NeuralPitch"}),e.jsx("p",{className:"text-xs uppercase tracking-widest mt-0.5",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Simulator v2.1"})]})]}),r&&e.jsx("nav",{id:"tour-nav",className:"hidden lg:flex items-center gap-0.5","aria-label":"Navegación principal",children:v.map(g=>{const y=g.premium&&!(t!=null&&t.is_premium);return e.jsxs(Se,{to:g.to,id:g.tourId,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors duration-200 whitespace-nowrap",style:{color:h(g.to)?"#00E5A0":y?"rgba(255,255,255,0.35)":"rgba(255,255,255,0.5)",background:h(g.to)?"rgba(0,229,160,0.08)":"transparent"},"aria-current":h(g.to)?"page":void 0,children:[g.label,y&&e.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Premium",style:{opacity:.45},children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]},g.to)})}),e.jsxs("div",{className:"flex items-center gap-3",children:[r&&t?e.jsxs("div",{id:"tour-user-menu",className:"relative",ref:x,children:[e.jsxs("button",{onClick:()=>u(g=>!g),className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.7)",cursor:"pointer"},"aria-expanded":d,"aria-haspopup":"true","aria-label":"Menú de usuario",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,255,255,0.08)"},onMouseLeave:g=>{g.currentTarget.style.background="rgba(255,255,255,0.04)"},children:[e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},"aria-hidden":"true",children:(t.full_name||t.email||"U")[0].toUpperCase()}),e.jsx("span",{className:"hidden sm:block max-w-32 truncate",children:t.full_name||t.email}),e.jsx("svg",{className:"w-3 h-3 flex-shrink-0",viewBox:"0 0 12 12",fill:"
9currentColor","aria-hidden":"true",style:{transform:d?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s"},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})]}),d&&e.jsxs("div",{className:"absolute right-0 mt-2 w-48 rounded-xl border overflow-hidden",style:{background:"rgba(14,14,24,0.98)",borderColor:"rgba(255,255,255,0.08)",boxShadow:"0 8px 32px rgba(0,0,0,0.5)",animation:"fadeSlideUp 0.2s both"},role:"menu",children:[e.jsxs("div",{className:"px-4 py-3 border-b",style:{borderColor:"rgba(255,255,255,0.05)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-xs font-semibold text-white truncate",children:t.full_name||"Usuario"}),t.is_premium&&e.jsx("span",{className:"text-xs font-bold px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"rgba(255,184,0,0.15)",border:"1px solid rgba(255,184,0,0.3)",color:"#FFB800",fontFamily:"'JetBrains Mono', monospace",fontSize:9,letterSpacing:"0.05em"},"aria-label":"Plan Premium activo",children:"PRO"})]}),e.jsx("p",{className:"text-xs truncate mt-0.5",style:{color:"rgba(255,255,255,0.65)"},children:t.email})]}),e.jsxs("div",{className:"py-1",children:[t.role==="admin"&&e.jsx(Se,{to:"/admin/review",className:"flex items-center gap-2 px-4 py-2.5 text-sm transition-colors duration-150",style:{color:"#FFB800"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,184,0,0.06)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Cola de revisión"}),e.jsx(Se,{to:"/billing",className:"flex items-center gap-2 px-4 py-2.5 text-sm transition-colors duration-150",style:{color:"rgba(255,255,255,0.6)"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,255,255,0.04)",g.currentTarget.style.color="white"},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.color="rgba(255,255,255,0.6)"},children:"Facturación"}),e.jsx(Se,{to:"/profile",className:"flex items-center gap-2 px-4 py-2.5 text-sm transition-colors duration-150",style:{color:"rgba(255,255,255,0.6)"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,255,255,0.04)",g.currentTarget.style.color="white"},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.color="rgba(255,255,255,0.6)"},children:"Mi perfil"}),e.jsx(Se,{to:"/privacy",className:"flex items-center gap-2 px-4 py-2.5 text-sm transition-colors duration-150",style:{color:"rgba(255,255,255,0.6)"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,255,255,0.04)",g.currentTarget.style.color="white"},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.color="rgba(255,255,255,0.6)"},children:"Privacidad"}),e.jsx("button",{onClick:()=>{u(!1),s()},className:"flex items-center gap-2 w-full px-4 py-2.5 text-sm transition-colors duration-150",style:{background:"none",border:"none",color:"rgba(0,229,160,0.8)",cursor:"pointer",textAlign:"left"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(0,229,160,0.06)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Repetir tour"}),e.jsx("button",{onClick:f,className:"flex items-center gap-2 w-full px-4 py-2.5 text-sm transition-colors duration-150",style:{background:"none",border:"none",color:"#FF4757",cursor:"pointer",textAlign:"left"},role:"menuitem",onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,71,87,0.06)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Cerrar sesión"})]})]})]}):e.jsx(Se,{to:"/login",className:"text-sm px-4 py-2 rounded-lg font-medium transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},children:"Iniciar sesión"}),r&&e.jsx("button",{className:"lg:hidden p-2 rounded-lg transition-colors duration-200",style:{background:l?"rgba(255,255,255,0.08)":"transparent",border:"none",color:"rgba(255,255,255,0.7)",cursor:"pointer"},onClick:()=>c(g=>!g),"aria-expanded":l,"aria-label":l?"Cerrar menú":"Abrir menú","aria-controls":"mobile-nav",children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:l?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]})}),r&&l&&e.jsx("nav",{id:"mobile-nav",className:"lg:hidden border-t",style:{borderColor:"rgba(255,255,255,0.04)",background:"rgba(10,10,15,0.98)",animation:"fadeSlideUp 0.2s both"},"aria-label":"Navegación móvil",children:e.jsxs("div",{className:"px-4 py-3 flex flex-col gap-1",children:[v.map(g=>{const y=g.premium&&!(t!=null&&t.is_premium);return e.jsxs(Se,{to:g.to,className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-colors duration-200",style:{color:h(g.to)?"#00E5A0":y?"rgba(255,255,255,0.35)":"rgba(255,255,255,0.6)",background:h(g.to)?"rgba(0,229,160,0.08)":"transparent"},"aria-current":h(g.to)?"page":void 0,children:[g.label,y&&e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Premium",style:{opacity:.4},children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})]},g.to)}
9),e.jsxs("div",{className:"border-t mt-2 pt-2 flex flex-col gap-1",style:{borderColor:"rgba(255,255,255,0.04)"},children:[(t==null?void 0:t.role)==="admin"&&e.jsx(Se,{to:"/admin/review",className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-colors duration-200",style:{color:"#FFB800"},children:"Cola de revisión"}),e.jsx(Se,{to:"/billing",className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-colors duration-200",style:{color:"rgba(255,255,255,0.6)"},children:"Facturación"}),e.jsx(Se,{to:"/profile",className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-colors duration-200",style:{color:"rgba(255,255,255,0.6)"},children:"Mi perfil"}),e.jsx(Se,{to:"/privacy",className:"flex items-center gap-2 px-4 py-3 rounded-lg text-sm font-medium transition-colors duration-200",style:{color:"rgba(255,255,255,0.6)"},children:"Privacidad"}),e.jsx("button",{onClick:()=>{c(!1),s()},className:"flex items-center gap-2 w-full px-4 py-3 rounded-lg text-sm font-medium text-left transition-colors duration-200",style:{background:"none",border:"none",color:"rgba(0,229,160,0.8)",cursor:"pointer"},children:"Repetir tour"}),e.jsx("button",{onClick:f,className:"flex items-center gap-2 w-full px-4 py-3 rounded-lg text-sm font-medium text-left transition-colors duration-200",style:{background:"none",border:"none",color:"#FF4757",cursor:"pointer"},children:"Cerrar sesión"})]})]})})]})}const Lr="Entiendo y acepto",fn={first_login:{badge:"â ï¸ Aviso Ãtico y Legal",title:"Uso Responsable de la PNL",subtitle:"Lee detenidamente antes de continuar",body:["NeuralPitch Simulator es una plataforma educativa diseñada exclusivamente para el aprendizaje y la práctica de técnicas de comunicación avanzada y Programación NeurolingüÃstica (PNL).","Estas técnicas son herramientas de comunicación poderosas. Con ese poder viene una responsabilidad ética fundamental."],points:["Utilizarás estas técnicas únicamente con fines éticos, legÃtimos y respetando siempre la autonomÃa y el bienestar de las personas.","No emplearás estos conocimientos para manipular, engañar, coaccionar ni causar perjuicio a terceros.","Asumes plena responsabilidad personal por el uso que hagas de lo aprendido en esta plataforma.","NeuralPitch no asume ninguna responsabilidad civil, penal ni de ningún otro tipo por el uso que los usuarios hagan de las técnicas aquà aprendidas.","El valor ético de estas técnicas depende enteramente de la intención de quien las aplica."],disclaimer:"NeuralPitch actúa como plataforma educativa. El uso indebido de estas técnicas es responsabilidad exclusiva del usuario."},level_2_unlock:{badge:"ð Nivel 2 Desbloqueado",title:"Técnicas Intermedias â Mayor Responsabilidad",subtitle:"Has completado el Nivel 1. Ahora accedes a técnicas más complejas.",body:["Las técnicas de Nivel 2 tienen un impacto persuasivo significativamente mayor. Incluyen patrones lingüÃsticos hipnóticos, anclajes emocionales y sugestiones compuestas.","Con mayor conocimiento y capacidad de influencia, la responsabilidad ética se intensifica."],points:["Aplicarás estas técnicas únicamente en contextos donde el objetivo sea beneficioso y legÃtimo para todas las partes.","No utilizarás estas herramientas para crear dependencia emocional, manipular decisiones importantes ni explotar vulnerabilidades.","Mantendrás siempre la integridad y el respeto hacia las personas con quienes interactúes.","NeuralPitch no asume ninguna responsabilidad por el uso que los usuarios hagan de estas técnicas avanzadas."],disclaimer:"El acceso a estas técnicas implica un nivel mayor de madurez ética. NeuralPitch confÃa en tu compromiso con un uso responsable."},level_3_unlock:{badge:"ð Nivel 3 Desbloqueado",title:"Técnicas Avanzadas â Máxima Responsabilidad",subtitle:"Has completado los Niveles 1 y 2. Accedes al nivel de maestrÃa.",body:["Las técnicas de Nivel 3 representan el estado del arte de la influencia lingüÃstica: Modelo Milton, Bucles Anidados, Amnesia Estructurada, Estrategias de Decisión. Son las mismas herramientas utilizadas en entornos terapéuticos, negociación de alto nivel y comunicación ejecutiva.","Este nivel exige el más alto estándar ético. Su misuse puede causar daño psicológico real."],points:["Utilizarás estas técnicas exclusivamente en contextos donde exista un beneficio claro y ético para todas las partes involucradas.","Nunca emplearás estas técnicas para crear estados alterados no consentidos, manipular decisiones crÃticas ni explotar el subconsciente de las personas.","Asumes plena y exclusiva responsabilidad por cada aplicación de estas técnicas.","NeuralPitch no asume ninguna responsabilidad legal, civil ni moral por el uso que los usuarios hagan de estas técnicas de nivel avanzado.","Si en algún momento utilizas estas técnicas de forma no ética, aceptas que NeuralPitch podrá revocar tu acceso a la plataforma."],disclaimer:"NeuralPitch es una plataforma educativa. La maestrÃa técnica sin ética es peligrosa. Ãsala con sabidurÃa."},level_4_unlock:{badge:"ð Nivel 4 · MaestrÃa Desbloqueado",title:"MaestrÃa â Mentalismo y Persuasión Avanzada",subtitle:"Has completado los Niveles 1, 2 y 3. Accedes al nivel de MaestrÃa.",body:["Las técnicas de Nivel 4 son las más sofisticadas y difÃciles de dominar del catálogo: validación personal, lectura en frÃo honesta, anclaje cognitivo, concesión recÃproca, inoculación de objeciones y presencia vocal de autoridad. Tienen respaldo en la psicologÃa de la influencia y un alto poder persuasivo.","Con la herramienta más poderosa viene la responsabilidad más alta. Estas técnicas solo son legÃtimas cuando ayudan a la otra persona a decidir mejor, nunca cuando la manipulan."],points:["Usarás estas técnicas exclusivamente para construir confianza, claridad y acuerdos honestos en los que ambas partes ganan.","Nunca las emplearás para engañar, fabricar urgencia, inflar cifras, fingir un conocimiento que no tienes ni explotar vulnerabilidades.","Asumes plena y exclusiva responsabilidad por cada aplicación de estas técnicas de MaestrÃa.","NeuralPitch no asume ninguna responsabilidad legal, civil ni moral por el uso que hagas de estas técnicas.","Si utilizas estas técnicas de forma no ética, aceptas que NeuralPitch podrá revocar tu acceso a la plataforma."],disclaimer:"El nivel de MaestrÃa exige el estándar ético más alto. La influencia honesta construye relaciones; la manipulación las destruye. Ãsala con integridad."}};function lc({eventType:t,onAccepted:a}){const[r,s]=i.useState(""),[n,o]=i.useState(!1),[l,c]=i.useState(null),d=fn[t]??fn.first_login,u=r===Lr,m=async()=>
9{if(!(!u||n)){o(!0),c(null);try{await R.post("/api/ethical-acceptance",{event_type:t}),a()}catch{c("Error al guardar tu aceptación. Por favor, inténtalo de nuevo."),o(!1)}}},p=x=>{x.key==="Enter"&&u&&m()};return e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"ethical-modal-title","data-testid":"ethical-disclaimer-modal",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center",padding:"16px",background:"rgba(10,10,15,0.92)",backdropFilter:"blur(8px)"},children:e.jsxs("div",{style:{background:"#0F0F18",border:"1px solid rgba(0,229,160,0.2)",borderRadius:20,maxWidth:600,width:"100%",maxHeight:"90vh",overflowY:"auto",padding:"32px",boxShadow:"0 0 60px rgba(0,229,160,0.06)"},children:[e.jsx("div",{className:"inline-block text-xs font-bold px-3 py-1 rounded-full mb-4",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.25)",color:"#00E5A0",letterSpacing:"0.05em"},children:d.badge}),e.jsx("h2",{id:"ethical-modal-title",className:"text-2xl font-bold mb-1",style:{fontFamily:"'Playfair Display', serif"},children:d.title}),e.jsx("p",{className:"text-sm mb-6",style:{color:"rgba(255,255,255,0.45)"},children:d.subtitle}),d.body.map((x,v)=>e.jsx("p",{className:"text-sm leading-relaxed mb-3",style:{color:"rgba(255,255,255,0.7)"},children:x},v)),e.jsxs("div",{className:"rounded-xl p-4 my-5",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.07)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.35)"},children:"Al continuar, te comprometes a:"}),e.jsx("ul",{className:"space-y-2",children:d.points.map((x,v)=>e.jsxs("li",{className:"flex gap-2 text-sm",style:{color:"rgba(255,255,255,0.65)"},children:[e.jsx("span",{style:{color:"#00E5A0",flexShrink:0,marginTop:1},children:"·"}),x]},v))})]}),e.jsx("div",{className:"rounded-xl p-4 mb-6",style:{background:"rgba(255,71,87,0.05)",border:"1px solid rgba(255,71,87,0.15)"},children:e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.5)"},children:[e.jsx("span",{style:{color:"#FF4757",fontWeight:600},children:"Aviso legal: "}),d.disclaimer]})}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{htmlFor:"ethical-confirm-input",className:"block text-sm font-medium mb-2",style:{color:"rgba(255,255,255,0.7)"},children:["Para confirmar que has leÃdo y comprendido este aviso, escribe exactamente:",e.jsx("span",{className:"ml-2 font-mono font-bold",style:{color:"#00E5A0"},children:Lr})]}),e.jsx("input",{id:"ethical-confirm-input",type:"text",value:r,onChange:x=>s(x.target.value),onKeyDown:p,placeholder:"Escribe aquÃ...",autoComplete:"off",style:{width:"100%",background:"rgba(255,255,255,0.04)",border:`1px solid ${u?"rgba(0,229,160,0.5)":"rgba(255,255,255,0.12)"}`,borderRadius:12,padding:"12px 16px",color:"white",outline:"none",fontFamily:"'JetBrains Mono', monospace",fontSize:14,transition:"border-color 0.2s"}}),r.length>0&&!u&&e.jsxs("p",{"data-testid":"phrase-error",className:"text-xs mt-1.5",style:{color:"rgba(255,71,87,0.8)"},children:["Escribe exactamente: ",e.jsx("em",{children:Lr})]})]}),l&&e.jsx("p",{className:"text-sm mb-3",style:{color:"#FF4757"},children:l}),e.jsx("button",{onClick:m,disabled:!u||n,style:{width:"100%",padding:"14px",borderRadius:12,border:"none",fontWeight:700,fontSize:15,cursor:u&&!n?"pointer":"not-allowed",background:u?"linear-gradient(135deg, #00E5A0, #00B4D8)":"rgba(255,255,255,0.07)",color:u?"#0A0A0F":"rgba(255,255,255,0.25)",transition:"all 0.2s"},children:n?"Guardandoâ¦":"Confirmar y continuar"})]})})}function Jo({html:t}){const a=[],r=/<(b|i|span)(?:\s+style=['"]([^'"]*)['"]\s*)?>(.*?)<\/\1>|([^<]+)/gs;let s,n=0;for(;(s=r.exec(t))!==null;){const[,o,l,c,d]=s;if(d!==void 0)a.push(d);else{const u={};l&&l.split(";").filter(Boolean).forEach(p=>{const[x,v]=p.split(":").map(f=>f.trim());if(x&&v){const f=x.replace(/-([a-z])/g,(h,g)=>g.toUpperCase());u[f]=v}});const m=o==="b"?"strong":o==="i"?"em":"span";a.push(e.jsx(m,{style:o==="span"?u:void 0,children:c},n++))}}return e.jsx(e.Fragment,{children:a})}const Ta=[{page:"/",el:null,title:"Bienvenido a NeuralPitch",desc:"Este recorrido te guiará por las principales funciones de la plataforma. Aprenderás a seleccionar técnicas, practicar scripts y analizar tus resultados.",nextLabel:"Empezar â"},{page:"/",el:"#tour-nav",title:"Navegación principal",desc:"Accesos directos a las secciones clave: <b>Historial</b> de sesiones, <b>Biblioteca</b> comunitaria y <b>Script propio</b> para practicar con tus propios textos."},{page:"/",el:"#tour-user-menu",title:"Tu cuenta",desc:"Accede a tu perfil, plan de suscripción, privacidad y cierre de sesión. Desde aquà también puedes repetir este tour cuando quieras."},{page:"/",el:"#tour-technique-grid",title:"Técnicas PNL",desc:"NeuralPitch incluye <b>{TOTAL} técnicas de Programación NeurolingüÃstica</b>
9. Cada tarjeta muestra nombre, categorÃa y nivel de dificultad. Selecciona una para ver el script y la teorÃa antes de grabar."},{page:"/",el:"#tour-level-lock",optional:!0,title:"Sistema de niveles",desc:"Las técnicas se organizan en <b>4 niveles</b>. El plan gratuito incluye el <b>nivel 1</b> (<b>{FREE} técnicas</b>); los niveles 2, 3 y el nuevo <b>nivel 4 · MaestrÃa</b> â con las técnicas más avanzadas de mentalismo y persuasión â requieren plan Premium."},{page:"/",el:"#tour-premium-lock",optional:!0,title:"Plan Premium",desc:"Con Premium accedes a las <b>{TOTAL} técnicas</b>, evaluaciones ilimitadas, Sparring, Entrenador de voz y generación de scripts con IA. El plan gratuito incluye 10 evaluaciones al mes. Gestiona tu suscripción desde <b>Facturación</b> en el menú de usuario."},{page:"/",el:"#tour-nav-entrenador",optional:!0,title:"Entrenador de voz",desc:"Calibra tu voz en tiempo real: <b>velocidad, tono, pausas y energÃa</b>. Es práctica libre, se ejecuta en tu navegador y no consume evaluaciones."},{page:"/",el:"#tour-nav-sparring",optional:!0,title:"Sparring con IA",desc:"Conversa por voz con un <b>cliente simulado por IA</b> (10 perfiles: escéptico, indeciso, negociadorâ¦). Practica objeciones y cierres y recibe una evaluación al terminar."},{page:"/",el:"#tour-nav-llamadas",optional:!0,title:"Llamadas reales",desc:"Sube la grabación de una llamada de ventas real y la IA la transcribe y analiza qué técnicas aplicaste. <b>El audio no se almacena.</b>"},{page:"/",el:"#tour-nav-team",optional:!0,title:"Equipo",desc:"Si gestionas un equipo, aquà ves <b>métricas agregadas y anónimas</b> del rendimiento del grupo â nunca datos individuales de cada persona.",nextLabel:"Ver página de preparación â"},{page:"/prepare/",el:"#tour-script-viewer",title:"Script de la técnica",desc:"Estudia el script antes de grabar. Verás marcadores de color: <span style='color:#FF4757;font-weight:600'>rojo</span> para comandos encubiertos, <span style='color:#FFB800;font-weight:600'>ámbar</span> para pausas estratégicas y <span style='color:#00B4D8;font-weight:600'>azul</span> para notas del formador (no se pronuncian)."},{page:"/prepare/",el:"#tour-theory-section",title:"TeorÃa y fundamentos",desc:"Cada técnica incluye su base teórica, el mecanismo psicológico que activa y consejos de aplicación. Léelos para entender el <i>por qué</i> de cada elemento del script."},{page:"/prepare/",el:"#tour-audio-player",optional:!0,title:"Ejemplo de audio",desc:"Escucha cómo suena el script con la entonación correcta. FÃjate en el <b>bajado de tono</b> en los comandos encubiertos: es la marca analógica que activa el procesamiento inconsciente."},{page:"/prepare/",el:"#tour-record-btn",title:"Grabar y evaluar",desc:"Pulsa <b>Grabar</b> para pasar a la pantalla de grabación. Allà verás el script mientras grabas. Después, la IA evaluará tu desempeño en 4 pilares: Semántica, Timing, Tono y Fluidez.",nextLabel:"Ver historial â"},{page:"/history",el:"#tour-history-content",title:"Tu historial de práctica",desc:"Aquà se guardan todas tus sesiones. Puedes ver la evolución de cada técnica con <b>gráficos de progreso</b>, comparar puntuaciones e identificar dónde mejorar. Los <b>hitos</b> (primera práctica, racha de 5 dÃas, 90+ puntos) aparecen como banners en los resultados.",nextLabel:"Ver biblioteca â"},{page:"/biblioteca",el:"#tour-biblioteca-grid",title:"Biblioteca de scripts",desc:"Scripts aprobados por la comunidad y el equipo de NeuralPitch. Filtra por categorÃa, nivel y ordena por fecha o valoración. Los scripts de <b>nivel 3</b> requieren plan Premium. Pulsa <b>Practicar</b> en cualquier script para entrenarlo directamente.",nextLabel:"Ver práctica libre â"},{page:"/custom-practice",el:"#tour-custom-editor",title:"Práctica libre: editor",desc:"Escribe o pega tu propio script. El editor resalta en tiempo real: comandos en <span style='color:#FF4757;font-weight:600'>rojo</span>, pausas en <span style='color:#FFB800;font-weight:600'>ámbar</span> y notas en <span style='color:#00B4D8;font-weight:600'>azul</span>. El analizador te dará una puntuación y sugerencias de mejora."},{page:"/custom-practice",el:"#tour-script-generator",optional:!0,title:"Generador de scripts con IA",desc:'Con Premium, la IA genera un script personalizado para tu producto, sector y contexto. Describe el escenario (<i>"venta de seguro a pyme, objeción precio"</i>) y la IA aplicará las técnicas más adecuadas.',nextLabel:"Finalizar tour â"}];function ar(t,a){return a==="/"?t==="/"||t==="":t.startsWith(a)}function ic(t,a){return t==="/"?"/":t==="/prepare/"?a?`/prepare/${a}`:null:t}const cc=380,dc=16,xn=520;function ka(t,a){if(a)return{position:"fixed",bottom:0,left:0,right:0,maxHeight:"65vh",borderRadius:"20px 20px 0 0",overflowY:"auto"};const r=window.innerWidth,s=window.innerHeight,n=dc,o=cc,l=Math.min(xn,s-2*n),c={position:"fixed",width:o,overflowY:"auto"},d={...c,top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxHeight:l};if(!t)return d;const u=F=>Math.max(n,Math.min(F,r-o-n)),m=(F,C)=>Math.max(n,Math.min(F,s-C-n)),p=t.getBoundingClientRect(),x=r-p.right-n,v=p.left-n,f=s-p.bottom-n,h=p.top-n;let g,y,j=l;if(x>=o)y=p.right+n,g=p.top;else if(v>=o)y=p.left-n-o,g=p.top;else if(f>=200)y=p.left,g=p.bottom+n,j=Math.min(l,f);else if(h>=200)j=Math.min(l,h),y=p.left,g=p.top-n-j;else return{...c,left:"50%",bottom:n,transform:"translateX(-50%)",maxHeight:Math.min(xn,Math.round(s*.5))};return y=u(y),g=m(g,j),{...c,left:y,top:g,maxHeight:j}}function uc({gated:t=!1}){var S;const{tourState:a,goToStep:r,completeTour:s}=Go(),{techniques:n}=Ut(),o=he(),l=Ct(),[c,d]=i.useState({}),u=i.useRef(null),m=(S=n==null?void 0:n[0])==null?void 0:S.id,p=(n==null?void 0:n.length)||0,x=(n==null?void 0:n.filter(_=>(_.difficulty??1)<=1).length)||0,v=_=>_.replace(/\{TOTAL\}/g,p||"todas las").replace(/\{FREE\}/g,x||""),f=a==null?void 0:a.active,h=a==null?void 0:a.mandatory,g=(a==null?void 0:a.step)??0,y=Ta[g];i.useEffect(()=>{if(t||!f||!y||ar(l.pathname,y.page))return;const _=ic(y.page,m);_&&o(_,{replace:!1})},[t,f,g,l.pathname,m]),i.useEffect(()=>{if(t||!f||!y||!ar(l.pathname,y.page)||!y.optional||!y.el)return;const _=setTimeout(()=>{if(!document.querySelector(y.el)){const D=g+1;D>=Ta.length?s():r(D)}},450);return()=>clearTimeout(_)},[t,f,g,l.pathname,r,s]),i.useEffect(()=>{if(t||!f||!y||!ar(l.pathname,y.page))return;u.current&&(u.current.removeAttribute("data-tour-active"),u.current=null);const _=window.innerWidth<640;let D=null,q=null;return y.el?D=setTimeout(()=>{const H=document.querySelector(y.el);if(H){H.setAttribute("data-tour-active","true"),u.current=H;const oe=H.getBoundingClientRect().height>window.innerHeight*.7;H.scrollIntoView({behavior:"auto",block:oe?"start":"center"}),oe&&window.scrollBy(0,-88),q=setTimeout(()=>{const ie=document.querySelector(y.el);ie&&d(ka(ie,_))},90)}else d(ka(null,_))},300):d(ka(null,_)),()=>{clearTimeout(D),clearTimeout(q)}},[t,f,g,l.pathname]),i.useEffect(()=>()=>{u.current&&(u.current.removeAttribute("data-tour-active"),u.current=null)},[]);const j=i.useCallback(()=>{const _=g+1;_>=Ta.length?(s(),o("/",{replace:!1})):r(_)},[g,r,s,o]),F=i.useCallback(()=>{g>0&&r(g-1)},[g,r]),C=i.useCallback(()=>s(),[s]);if(t||!f||!y||!ar(l.pathname,y.page))return null;const N=typeof window<"u"&&window.innerWidth<640,b=g===0,w=g===Ta.length-1,L=y.nextLabel||"Siguiente â",z=Ta.length,A=e.jsxs(e.Fragment,{children:[e.jsx("div",{"aria-hidden":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:9e3,pointerEvents:h?"all":"none"},onClick:h?void 0:C}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":y.title,style:{...c,zIndex:9001,background:"#0e0e18",border:"1px solid rgba(0,229,160,0.25)",borderRadius:N?"20p
9x 20px 0 0":14,boxShadow:"0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,229,160,0.08)",padding:N?"20px 20px calc(20px + env(safe-area-inset-bottom, 0px))":"22px 24px",boxSizing:"border-box",fontFamily:"'Inter', sans-serif"},children:[e.jsx("div",{style:{height:3,background:"rgba(255,255,255,0.08)",borderRadius:2,marginBottom:16,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${(g+1)/z*100}%`,background:"linear-gradient(90deg, #00E5A0, #00B4D8)",borderRadius:2,transition:"width 0.3s ease"}})}),e.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:12,color:"rgba(255,255,255,0.45)",marginBottom:8,letterSpacing:"0.05em"},children:[g+1," / ",z]}),e.jsx("h3",{style:{fontSize:N?19:17,fontWeight:700,color:"#00E5A0",margin:"0 0 10px 0",lineHeight:1.3},children:y.title}),e.jsx("p",{style:{fontSize:N?15:14,color:"rgba(255,255,255,0.88)",lineHeight:1.7,margin:"0 0 20px 0"},children:e.jsx(Jo,{html:v(y.desc)})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[!b&&e.jsx("button",{onClick:F,style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"rgba(255,255,255,0.6)",fontSize:13,fontWeight:600,padding:"8px 16px",cursor:"pointer",fontFamily:"'Inter', sans-serif"},children:"â Anterior"}),e.jsx("button",{onClick:j,style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",borderRadius:8,color:"#0A0A0F",fontSize:13,fontWeight:700,padding:"8px 18px",cursor:"pointer",fontFamily:"'Inter', sans-serif",flexShrink:0},children:w?"Finalizar â":L}),e.jsx("button",{onClick:C,title:"Puedes retomarlo cuando quieras desde «Repetir tour», en tu menú",style:{background:"none",border:"none",color:"rgba(255,255,255,0.45)",fontSize:12,cursor:"pointer",fontFamily:"'Inter', sans-serif",marginLeft:"auto",padding:"7px 4px",textDecoration:"underline",textUnderlineOffset:3},children:"Omitir tour"})]})]})]});return Ya.createPortal(A,document.body)}function Yo(){const{sessionExpired:t,dismissSessionExpired:a}=i.useContext(Bt),r=he();if(!t)return null;const s=()=>{a(),r("/login")};return Ya.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9999,background:"rgba(10,10,15,0.85)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",padding:24},children:e.jsxs("div",{style:{background:"#13131A",border:"1px solid rgba(255,255,255,0.1)",borderRadius:16,padding:32,maxWidth:420,width:"100%",textAlign:"center",boxShadow:"0 24px 64px rgba(0,0,0,0.6)"},children:[e.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px",fontSize:24},children:"ð"}),e.jsx("h2",{style:{fontFamily:"'Playfair Display', serif",fontSize:22,fontWeight:700,color:"rgba(255,255,255,0.9)",marginBottom:10},children:"Sesión expirada"}),e.jsx("p",{style:{fontSize:14,color:"rgba(255,255,255,0.6)",lineHeight:1.6,marginBottom:28},children:"Tu sesión ha caducado por inactividad prolongada. Inicia sesión de nuevo para continuar."}),e.jsx("button",{onClick:s,style:{width:"100%",padding:"12px 24px",borderRadius:10,background:"#00E5A0",color:"#0A0A0F",fontWeight:700,fontSize:15,border:"none",cursor:"pointer",letterSpacing:"0.01em"},children:"Iniciar sesión"})]})}),document.body)}function mc(){const{sessionWarning:t,extendSession:a,dismissSessionWarning:r,logout:s}=i.useContext(Bt),n=he();if(!t)return null;const o=async()=>{await a()},l=async()=>{r(),await s(),n("/login")};return Ya.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:9998,background:"rgba(10,10,15,0.80)",backdropFilter:"blur(6px)",display:"flex",alignItems:"center",justifyContent:"center",padding:24},role:"dialog","aria-modal":"true","aria-labelledby":"session-warning-title",children:e.jsxs("div",{style:{background:"#13131A",border:"1px solid rgba(255,184,0,0.25)",borderRadius:16,padding:32,maxWidth:420,width:"100%",textAlign:"center",boxShadow:"0 24px 64px rgba(0,0,0,0.6)",animation:"fadeSlideUp 0.25s both"},children:[e.jsx("div",{style:{width:56,height:56,borderRadius:"50%",background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.3)",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto 20px"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#FFB800",strokeWidth:1.5,style:{width:26,height:26},"aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6l4 2m6-2a10 10 0 11-20 0 10 10 0 0120 0z"})})}),e.jsx("h2",{id:"session-warning-title",style:{fontFamily:"'Playfair Display', serif",fontSize:22,fontWeight:700,color:"rgba(255,255,255,0.9)",marginBottom:10},children:"Sesión a punto de expirar"}),e.jsxs("p",{style:{fontSize:14,color:"rgba(255,255,255,0.6)",lineHeight:1.6,marginBottom:28},children:["Tu sesión cerrará por inactividad en"," ",e.jsx("strong",{style:{color:"#FFB800"},children:"5 minutos"}),". ¿Deseas continuar?"]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.jsx("button",{onClick:o,style:{width:"100%",padding:"12px 24px",borderRadius:10,background:"#00E5A0",color:"#0A0A0F",fontWeight:700,fontSize:15,border:"none",cursor:"pointer",letterSpacing:"0.01em"},children:"Continuar sesión"}),e.jsx("button",{onClick:l,style:{width:"100%",padding:"11px 24px",borderRadius:10,background:"transparent",color:"rgba(255,255,255,0.5)",fontWeight:500,fontSize:14,border:"1px solid rgba(255,255,255,0.1)",cursor:"pointer"},children:"Cerrar sesión"})]})]})}),document.body)}function Xe({children:t}){const{isAuthenticated:a}=i.useContext(Bt),r=Ct(),[s,n]=i.useState(null),[o,l]=i.useState(()=>{try{return!!localStorage.getItem("neuralpitch_consent_given")}catch{return!0}});i.useEffect(()=>{const d=()=>l(!0);return window.addEventListener("neuralpitch:consent-decided",d),()=>window.removeEventListener("neuralpitch:consent-decided",d)},[]),i.useEffect(()=>{if(!a){n(null);return}R.get("/api/ethical-acceptance/pending").then(d=>{d.event_type&&n(d.event_type)}).catch(()=>{})},[a,r.pathname]);const c=()=>n(null);return e.jsxs("div",{className:"min-h-screen relative",style:{background:"#0A0A0F",color:"white"},children:[e.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0)",backgroundSize:"40px 40px",zIndex:0},"aria-hidden":"true"}
9),e.jsx("div",{className:"fixed pointer-events-none",style:{top:"-30%",right:"-20%",width:600,height:600,background:"radial-gradient(circle, rgba(0,229,160,0.04) 0%, transparent 70%)",zIndex:0},"aria-hidden":"true"}),e.jsx(oc,{}),e.jsx("main",{className:"relative pt-16",style:{zIndex:1},children:t}),s&&e.jsx(lc,{eventType:s,onAccepted:c}),e.jsx(uc,{gated:!!s||!o}),e.jsx(mc,{}),e.jsx(Yo,{})]})}const pc="wg3fvjf574",xr="neuralpitch_consent_given";function _s(){typeof window>"u"||window.clarity&&window.clarity.q||localStorage.getItem(xr)==="accepted"&&function(t,a,r,s,n,o,l){t[r]=t[r]||function(){(t[r].q=t[r].q||[]).push(arguments)},o=a.createElement(s),o.async=1,o.src="https://www.clarity.ms/tag/"+n,l=a.getElementsByTagName(s)[0],l.parentNode.insertBefore(o,l)}(window,document,"clarity","script",pc)}function fc(t){return typeof window>"u"?!1:t?(localStorage.setItem(xr,"accepted"),_s(),!1):(localStorage.setItem(xr,"declined"),!!(window.clarity&&window.clarity.q))}function xc(){return typeof window>"u"?!1:localStorage.getItem(xr)==="accepted"}const Rr="neuralpitch_consent_given";function gc(){const[t,a]=i.useState(!1);i.useEffect(()=>{if(!localStorage.getItem(Rr)){const l=setTimeout(()=>a(!0),800);return()=>clearTimeout(l)}},[]);const r=()=>{try{window.dispatchEvent(new Event("neuralpitch:consent-decided"))}catch{}},s=()=>{localStorage.setItem(Rr,"accepted"),a(!1),r(),_s()},n=()=>{localStorage.setItem(Rr,"declined"),a(!1),r()};return t?e.jsx("div",{role:"dialog","aria-label":"Aviso de cookies y privacidad","aria-live":"polite",className:"fixed bottom-0 left-0 right-0 z-50 p-4 md:p-6",style:{animation:"fadeSlideUp 0.4s both"},children:e.jsx("div",{className:"max-w-4xl mx-auto rounded-2xl border",style:{background:"rgba(14,14,24,0.97)",borderColor:"rgba(255,255,255,0.08)",backdropFilter:"blur(12px)",padding:"20px 24px",boxShadow:"0 -4px 40px rgba(0,0,0,0.5)"},children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("p",{className:"text-sm leading-relaxed mb-1",style:{color:"rgba(255,255,255,0.75)"},children:[e.jsx("strong",{className:"text-white",children:"Privacidad y cookies."})," ","Utilizamos cookies esenciales para el funcionamiento de la plataforma y procesamos tu audio con IA para evaluarte. Puedes consultar nuestra"," ",e.jsx(Se,{to:"/privacy",className:"underline hover:text-neuro-green transition-colors",style:{color:"#00E5A0"},onClick:s,children:"polÃtica de privacidad"})," ","en cualquier momento."]}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.55)"},children:"Regulado por el RGPD (UE 2016/679) y la Ley de IA de la UE."})]}),e.jsxs("div",{className:"flex gap-3 flex-shrink-0",children:[e.jsx("button",{onClick:n,className:"text-xs px-4 py-2 rounded-lg border transition-all duration-200",style:{background:"transparent",borderColor:"rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",cursor:"pointer"},onMouseEnter:o=>{o.currentTarget.style.background="rgba(255,255,255,0.05)",o.currentTarget.style.color="rgba(255,255,255,0.8)"},onMouseLeave:o=>{o.currentTarget.style.background="transparent",o.currentTarget.style.color="rgba(255,255,255,0.5)"},children:"Solo esenciales"}),e.jsx("button",{onClick:s,className:"text-xs px-4 py-2 rounded-lg font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:"pointer"},onMouseEnter:o=>{o.currentTarget.style.opacity="0.9"},onMouseLeave:o=>{o.currentTarget.style.opacity="1"},children:"Aceptar todo"})]})]})})}):null}function bc(){var C,N;const{login:t}=Ge(),a=he(),s=(N=(C=Ct().state)==null?void 0:C.from)==null?void 0:N.pathname,n=s&&s.startsWith("/")&&!s.startsWith("//")?s:"/",[o,l]=i.useState({email:"",password:""}),[c,d]=i.useState(null),[u,m]=i.useState(!1),[p,x]=i.useState(!1),[v,f]=i.useState(!1),[h,g]=i.useState(!1),y=b=>{l(w=>({...w,[b.target.name]:b.target.value})),d(null),m(!1),g(!1)},j=async b=>{var w,L;if(b.preventDefault(),!o.email||!o.password){d("Por favor completa todos los campos.");return}x(!0),d(null),m(!1);try{await t(o.email,o.password),a(n,{replace:!0})}catch(z){((L=(w=z.data)==null?void 0:w.detail)==null?void 0:L.code)==="email_not_verified"?m(!0):d(z.message||"Credenciales incorrectas. Inténtalo de nuevo.")}finally{x(!1)}},F=async()=>{f(!0),g(!1);try{await R.post("/api/auth/resend-verification",{email:o.email}),g(!0)}catch{g(!0)}finally{f(!1)}};return e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"#0A0A0F"},children:[e.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"},"aria-hidden":"true"}
9),e.jsx("div",{className:"fixed pointer-events-none",style:{top:"-30%",right:"-20%",width:600,height:600,background:"radial-gradient(circle, rgba(0,229,160,0.04) 0%, transparent 70%)"},"aria-hidden":"true"}),e.jsxs("div",{className:"relative w-full max-w-md rounded-2xl border",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:"40px 32px",animation:"fadeSlideUp 0.5s both",zIndex:1},children:[e.jsxs("div",{className:"flex flex-col items-center mb-8",children:[e.jsx(ua,{size:56,className:"mb-4"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight mb-1",style:{fontFamily:"'Playfair Display', serif"},children:"NeuralPitch Simulator"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Inicia sesión para entrenar"})]}),u&&e.jsxs("div",{className:"rounded-xl border px-4 py-4 mb-6 text-sm",style:{background:"rgba(255,184,0,0.08)",borderColor:"rgba(255,184,0,0.25)",animation:"fadeSlideUp 0.3s both"},role:"alert",children:[e.jsx("p",{className:"font-semibold mb-1",style:{color:"#FFB800"},children:"Correo no verificado"}),e.jsx("p",{className:"mb-3",style:{color:"rgba(255,255,255,0.65)"},children:"Debes verificar tu correo electrónico antes de iniciar sesión. Revisa tu bandeja de entrada (y la carpeta de spam)."}),h?e.jsx("p",{className:"text-xs font-medium",style:{color:"#00E5A0"},children:"Nuevo enlace enviado. Revisa tu correo."}):e.jsx("button",{type:"button",onClick:F,disabled:v,className:"text-xs font-semibold underline transition-opacity duration-200",style:{color:"#00E5A0",opacity:v?.5:1,cursor:v?"not-allowed":"pointer",background:"none",border:"none",padding:0},children:v?"Enviando...":"Reenviar correo de verificación"})]}),c&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757",animation:"fadeSlideUp 0.3s both"},role:"alert",children:c}),e.jsxs("form",{onSubmit:j,noValidate:!0,className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"email",className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.65)",letterSpacing:"0.12em"},children:"Correo electrónico"}),e.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",value:o.email,onChange:y,placeholder:"[email protected]",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"white",outline:"none"},onFocus:b=>{b.target.style.borderColor="rgba(0,229,160,0.4)",b.target.style.background="rgba(255,255,255,0.06)"},onBlur:b=>{b.target.style.borderColor="rgba(255,255,255,0.08)",b.target.style.background="rgba(255,255,255,0.04)"}})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:"password",className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.65)",letterSpacing:"0.12em"},children:"Contraseña"}),e.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"current-password",value:o.password,onChange:y,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"white",outline:"none"},onFocus:b=>{b.target.style.borderColor="rgba(0,229,160,0.4)",b.target.style.background="rgba(255,255,255,0.06)"},onBlur:b=>{b.target.style.borderColor="rgba(255,255,255,0.08)",b.target.style.background="rgba(255,255,255,0.04)"}})]}),e.jsx("button",{type:"submit",disabled:p,className:"w-full py-3 rounded-xl font-bold text-sm transition-all duration-200 mt-2",style:{background:p?"rgba(0,229,160,0.3)":"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:p?"not-allowed":"pointer"},onMouseEnter:b=>{p||(b.currentTarget.style.transform="scale(1.02)")},onMouseLeave:b=>{b.currentTarget.style.transform="scale(1)"},"aria-busy":p,children:p?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx("span",{className:"inline-block w-4 h-4 rounded-full border-2 border-current border-t-transparent animate-spin","aria-hidden":"true"}),"Iniciando sesión..."]}):"Iniciar sesión"})]}),e.jsxs("div",{className:"mt-6 flex flex-col gap-3 text-center",children:[e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:["¿No tienes cuenta?"," ",e.jsx(Se,{to:"/register",className:"font-semibold transition-colors duration-200",style:{color:"#00E5A0"},children:"RegÃstrate"})]}),e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.25)"},children:["Al iniciar sesión aceptas nuestra"," ",e.jsx(Se,{to:"/politica-privacidad",className:"underline hover:text-white transition-colors duration-200",children:"polÃtica de privacidad"})]})]})]})]})}const Fs="neuralpitch_utm",Ko=["utm_source","utm_medium","utm_campaign","utm_content"],hc=/^[a-z0-9._-]{1,100}$/;function Xo(t){if(typeof t!="string")return null;const a=t.trim().toLowerCase();return hc.test(a)?a:null}function Qo(t=window.location.search){const a=new URLSearchParams(t),r={};for(const s of Ko){const n=Xo(a.get(s));n&&(r[s]=n)}if(Object.keys(r).length===0)return Ms();try{sessionStorage.setItem(Fs,JSON.stringify(r))}catch{}return r}function Ms(){try{const t=sessionStorage.getItem(Fs);if(!t)return{};const a=JSON.parse(t),r={};for(const s of Ko){const n=Xo(a==null?void 0:a[s]);n&&(r[s]=n)}return r}catch{return{}}}
9function yc(){try{sessionStorage.removeItem(Fs)}catch{}}const os={free:{label:"Plan Gratuito",badge:null,isB2B:!1,isPaid:!1},premium_monthly:{label:"Premium Mensual",badge:"99 â¬/mes",isB2B:!1,isPaid:!0},premium_quarterly:{label:"Premium Trimestral",badge:"79,20 â¬/mes",isB2B:!1,isPaid:!0},premium_program:{label:"Premium Programa (6 meses)",badge:"70 â¬/mes equiv.",isB2B:!1,isPaid:!0},b2b_demo:{label:"Demo Empresarial",badge:"Gratis 3 dÃas",isB2B:!0,isPaid:!1},team_monthly:{label:"Teams Mensual",badge:"89 â¬/asiento",isB2B:!0,isPaid:!0},team_quarterly:{label:"Teams Trimestral",badge:"71,20 â¬/mes",isB2B:!0,isPaid:!0},team_annual:{label:"Teams Anual",badge:"62 â¬/mes equiv.",isB2B:!0,isPaid:!0}};function pa(t){return{background:"rgba(255,255,255,0.04)",border:`1px solid ${t?"rgba(255,71,87,0.4)":"rgba(255,255,255,0.08)"}`,color:"white",outline:"none",transition:"all 0.2s"}}function fa(t){t.target.style.borderColor="rgba(0,229,160,0.4)",t.target.style.background="rgba(255,255,255,0.06)"}function xa(t){t.target.style.borderColor="rgba(255,255,255,0.08)",t.target.style.background="rgba(255,255,255,0.04)"}function ga({label:t,htmlFor:a,error:r,children:s}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:a,className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.65)",letterSpacing:"0.12em"},children:t}),s,r&&e.jsx("p",{className:"text-xs",style:{color:"#FF4757"},role:"alert",children:r})]})}function gn({id:t,name:a,checked:r,onChange:s,error:n,children:o}){return e.jsxs("div",{children:[e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer",htmlFor:t,children:[e.jsx("input",{id:t,name:a,type:"checkbox",checked:r,onChange:s,className:"mt-0.5 flex-shrink-0 w-4 h-4 rounded cursor-pointer",style:{accentColor:"#00E5A0"}}),e.jsx("span",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.55)"},children:o})]}),n&&e.jsx("p",{className:"text-xs mt-1 ml-7",style:{color:"#FF4757"},role:"alert",children:n})]})}function vc({plan:t}){const a=os[t];return!a||t==="free"?null:e.jsxs("div",{className:"flex items-center gap-2 rounded-xl px-4 py-3 mb-6",style:{background:"rgba(0,229,160,0.06)",border:"1px solid rgba(0,229,160,0.15)"},children:[e.jsx("span",{className:"text-xs font-bold uppercase tracking-widest",style:{color:"#00E5A0",letterSpacing:"0.12em"},children:a.label}),a.badge&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:"rgba(255,255,255,0.3)"},children:"·"}),e.jsx("span",{className:"text-xs font-semibold",style:{color:"rgba(255,255,255,0.7)"},children:a.badge})]})]})}function jc(){const{register:t}=Ge(),a=he(),[r]=vr(),s=r.get("plan")||"free",n=s in os?s:"free",o=os[n];i.useEffect(()=>{Qo()},[]);const[l,c]=i.useState(1),[d,u]=i.useState({full_name:"",email:"",password:"",confirmPassword:"",gdpr_consent:!1,ai_processing_consent:!1,org_name:"",seat_count:5}),[m,p]=i.useState({}),[x,v]=i.useState(null),[f,h]=i.useState(!1),[g,y]=i.useState(!1),[j,F]=i.useState(""),C=z=>{const{name:A,value:S,type:_,checked:D}=z.target;u(q=>({...q,[A]:_==="checkbox"?D:S})),p(q=>({...q,[A]:null})),v(null)},N=()=>{const z={};return d.full_name.trim()||(z.full_name="El nombre es obligatorio."),(!d.email.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(d.email))&&(z.email="Introduce un correo electrónico válido."),(!d.password||d.password.length<8)&&(z.password="La contraseña debe tener al menos 8 caracteres."),d.password!==d.confirmPassword&&(z.confirmPassword="Las contraseñas no coinciden."),d.gdpr_consent||(z.gdpr_consent="Debes aceptar la polÃtica de privacidad para continuar."),d.ai_processing_consent||(z.ai_processing_consent="Debes aceptar el procesamiento por IA para usar la plataforma."),z},b=()=>{const z={};if(d.org_name.trim()||(z.org_name="El nombre de la organización es obligatorio."),o.isPaid){const A=parseInt(d.seat_count,10);(!A||A<5)&&(z.seat_count="El mÃnimo es 5 asientos.")}return z},w=()=>{const z=N();if(Object.keys(z).length>0){p(z);return}p({}),c(2)},L=async z=>{if(z.preventDefault(),o.isB2B&&l===1){w();return}let A={};if(l===1&&(A=N()),l===2&&(A=b()),Object.keys(A).length>0){p(A);return}h(!0),v(null);try{const S={full_name:d.full_name.trim(),email:d.email.trim().toLowerCase(),password:d.password,gdpr_consent:d.gdpr_consent,ai_consent:d.ai_processing_consent,plan:n==="free"?void 0:n,...Ms()};o.isB2B&&(S.org_name=d.org_name.trim(),o.isPaid&&(S.seat_count=parseInt(d.seat_count,10)));const _=await t(S);yc(),_!=null&&_.emailVerificationRequired?(F(d.email.trim().toLowerCase()),y(!0)):a("/",{replace:!0})}catch(S){v(S.message||"Error al crear la cuenta. Inténtalo de nuevo.")}finally{h(!1)}};return g?e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"#0A0A0F"},children:[e.jsx(bn,{}),e.jsxs("div",{className:"relative w-full max-w-md rounded-2xl border text-center",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:"48px 32px",animation:"fadeSlideUp 0.5s both",zIndex:1},children:[e.jsx("div",{className:"flex items-center justify-center mx-auto mb-6 rounded-full",style:{width:64,height:64,background:"rgba(0,229,160,0.1)",border:"2px s
9olid rgba(0,229,160,0.3)"},children:e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2z",stroke:"#00E5A0",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("path",{d:"M2 6l10 7 10-7",stroke:"#00E5A0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("h2",{className:"text-xl font-bold mb-3",style:{color:"#ffffff"},children:"Revisa tu correo electrónico"}),e.jsx("p",{className:"text-sm mb-2",style:{color:"rgba(255,255,255,0.65)",lineHeight:1.6},children:"Hemos enviado un enlace de verificación a:"}),e.jsx("p",{className:"text-sm font-semibold mb-6",style:{color:"#00E5A0"},children:j}),o.isB2B&&e.jsx("div",{className:"rounded-xl px-4 py-3 mb-6 text-left text-xs",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.2)",color:"rgba(255,255,255,0.65)",lineHeight:1.6},children:o.isPaid?"También recibirás un correo de bienvenida con los detalles de tu organización y el enlace para completar el pago.":"También recibirás un correo de bienvenida con los detalles de tu organización y los 3 dÃas de acceso Premium."}),e.jsx("p",{className:"text-xs mb-8",style:{color:"rgba(255,255,255,0.4)",lineHeight:1.6},children:"Pulsa el enlace del correo para activar tu cuenta. El enlace caduca en 48 horas. Revisa también la carpeta de spam."}),e.jsx(Se,{to:"/login",className:"text-sm font-semibold transition-colors duration-200",style:{color:"#00E5A0"},children:"Volver a inicio de sesión"})]})]}):e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"#0A0A0F"},children:[e.jsx(bn,{}),e.jsxs("div",{className:"relative w-full max-w-md rounded-2xl border",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:"40px 32px",animation:"fadeSlideUp 0.5s both",zIndex:1},children:[e.jsxs("div",{className:"flex flex-col items-center mb-6",children:[e.jsx(ua,{size:56,className:"mb-4"}),e.jsx("h1",{className:"text-2xl font-bold tracking-tight mb-1",style:{fontFamily:"'Playfair Display', serif"},children:o.isB2B&&l===2?"Tu organización":"Crear cuenta"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:o.isB2B&&l===2?"Configura los datos de tu empresa":"Ãnete y empieza a entrenar tus técnicas"})]}),e.jsx(vc,{plan:n}),e.jsxs("p",{className:"text-xs leading-relaxed rounded-xl border px-3.5 py-2.5 mb-5",style:{background:"rgba(0,180,216,0.06)",borderColor:"rgba(0,180,216,0.18)",color:"rgba(255,255,255,0.7)"},children:["Por ahora, la aplicación está disponible"," ",e.jsx("strong",{style:{color:"#fff",fontWeight:600},children:"solo en español"})," (de momento)."]}),o.isB2B&&e.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[[1,2].map(z=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold",style:{background:l>=z?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.05)",border:`1px solid ${l>=z?"rgba(0,229,160,0.4)":"rgba(255,255,255,0.1)"}`,color:l>=z?"#00E5A0":"rgba(255,255,255,0.3)"},children:z}),z<2&&e.jsx("div",{className:"flex-1 h-px",style:{width:24,background:l>z?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.1)"}})]},z)),e.jsxs("span",{className:"text-xs ml-2",style:{color:"rgba(255,255,255,0.4)"},children:["Paso ",l," de 2"]})]}),x&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:x}),e.jsxs("form",{onSubmit:L,noValidate:!0,className:"flex flex-col gap-4",children:[l===1&&e.jsxs(e.Fragment,{children:[e.jsx(ga,{label:"Nombre completo",htmlFor:"full_name",error:m.full_name,children:e.jsx("input",{id:"full_name",name:"full_name",type:"text",autoComplete:"name",value:d.full_name,onChange:C,placeholder:"Ana GarcÃa MartÃnez",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.full_name),onFocus:fa,onBlur:xa})}),e.jsxs(ga,{label:"Correo electrónico",htmlFor:"email",error:m.email,children:[e.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",value:d.email,onChange:C,placeholder:o.isPaid&&o.isB2B?"[email protected] (corporativo)":"[email protected]",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.email),onFocus:fa,onBlur:xa}),o.isPaid&&o.isB2B&&e.jsx("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.35)"},children:"Los planes de equipo requieren email corporativo (no Gmail, Hotmail, etc.)"})]}),e.jsx(ga,{label:"Contraseña",htmlFor:"password",error:m.password,children:e.jsx("input",{id:"password",name:"password",type:"password",autoComplete:"new-password",value:d.password,onChange:C,placeholder:"MÃnimo 8 caracteres",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.password),onFocus:fa,onBlur:xa})}),e.jsx(ga,{label:"Confirmar contraseña",htmlFor:"confirmPassword",error:m.confirmPassword,children:e.jsx("input",{id:"confirmPassword",name:"confirmPassword",type:"password",autoComplete:"new-password",value:d.confirmPassword,onChange:C,placeholder:"Repite la contraseña",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.confirmPassword),onFocus:fa,onBlur:xa})}),e.jsxs("div",{className:"flex flex-col gap-3 mt-2",children:[e.jsxs(gn,{id:"gdpr_consent",name:"gdpr_consent",checked:d.gdpr_consent,onChange:C,error:m.gdpr_consent,children:["He leÃdo y acepto la"," ",e.jsx(Se,{to:"/politica-privacidad",target:"_blank",className:"underline",style:{color:"#00E5A0"},children:"polÃtica de privacidad"})," ","y el tratamiento de mis datos personales conforme al RGPD."," ",e.jsx("span",{style:{color:"#FF4757"},children:"*"})]}),e.jsxs(gn,{id:"ai_processing_consent",name:"ai_processing_consent",checked:d.ai_processing_consent,onChange:C,error:m.ai_processing_consent,children:["Acepto que mis grabaciones de audio sean procesadas por sistemas de inteligencia artificial para obtener evaluaciones de entrenamiento, conforme a la Ley de IA de la UE."," ",e.jsx("span",{style:{color:"#FF4757"},children:"*"})]})]})]}),l===2&&o.isB2B&&e.jsxs(e.Fragment,{children:[e.jsx(ga,{label:"Nombre de la empresa u organización",htmlFor:"org_name",error:m.org_name,children:e.jsx("input",{id:"org_name",name:"org_name",type:"text",value:d.org_name,onChange:C,placeholder:"Acme Corporation S.L.",required:!0,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.org_name),onFocus:fa,onBlur:xa})}),o.isPaid&&e.jsxs(ga,{label:"Número de asientos (mÃnimo 5)",htmlFor:"seat_count",error:m.seat_count,children:[e.jsx("input",{id:"seat_count",name:"seat_count",type:"number",min:5,max:500,value:d.seat_count,onChange:C,className:"w-full rounded-xl px-4 py-3 text-sm",style:pa(!!m.seat_count),onFocus:fa,onBlur:xa}),!m.seat_count&&e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:["Total:"," ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:n==="team_monthly"?`${(parseInt(d.seat_count,10)*89).toLocaleStr
9ing("es-ES")} â¬/mes`:n==="team_annual"?`${(parseInt(d.seat_count,10)*744).toLocaleString("es-ES")} â¬/año`:`${(parseInt(d.seat_count,10)*213.6).toLocaleString("es-ES")} â¬/trimestre`})]})]}),n==="b2b_demo"&&e.jsxs("div",{className:"rounded-xl px-4 py-3 text-xs",style:{background:"rgba(0,229,160,0.05)",border:"1px solid rgba(0,229,160,0.15)",color:"rgba(255,255,255,0.65)",lineHeight:1.7},children:["Tendrás acceso ",e.jsx("strong",{style:{color:"#00E5A0"},children:"Premium completo durante 3 dÃas"}),". Si no contratas un plan de equipo antes de que expire, tu cuenta pasará al plan gratuito y la organización se eliminará automáticamente."]})]}),e.jsx("button",{type:"submit",disabled:f,className:"w-full py-3 rounded-xl font-bold text-sm transition-all duration-200 mt-2",style:{background:f?"rgba(0,229,160,0.3)":"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:f?"not-allowed":"pointer"},onMouseEnter:z=>{f||(z.currentTarget.style.transform="scale(1.02)")},onMouseLeave:z=>{z.currentTarget.style.transform="scale(1)"},"aria-busy":f,children:f?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx("span",{className:"inline-block w-4 h-4 rounded-full border-2 border-current border-t-transparent animate-spin","aria-hidden":"true"}),l===1&&o.isB2B?"Continuando...":"Creando cuenta..."]}):l===1&&o.isB2B?"Continuar â":"Crear cuenta"}),l===2&&e.jsx("button",{type:"button",onClick:()=>{c(1),p({})},className:"w-full py-2 rounded-xl text-sm transition-colors duration-200",style:{background:"transparent",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.55)",cursor:"pointer"},children:"â Volver"})]}),e.jsxs("p",{className:"text-sm text-center mt-6",style:{color:"rgba(255,255,255,0.65)"},children:["¿Ya tienes cuenta?"," ",e.jsx(Se,{to:"/login",className:"font-semibold transition-colors duration-200",style:{color:"#00E5A0"},children:"Inicia sesión"})]})]})]})}function bn(){return e.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"},"aria-hidden":"true"})}/*! 10 * Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com 11 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 12 * Copyright 2026 Fonticons, Inc. 13 */function ls(t,a){(a==null||a>t.length)&&(a=t.length);for(var r=0,s=Array(a);r<a;r++)s[r]=t[r];return s}function Nc(t){if(Array.isArray(t))return t}function wc(t){if(Array.isArray(t))return ls(t)}function kc(t,a){if(!(t instanceof a))throw new TypeError("Cannot call a class as a function")}function Sc(t,a){for(var r=0;r<a.length;r++){var s=a[r];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,Zo(s.key),s)}}function Ac(t,a,r){return a&&Sc(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function ur(t,a){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Ts(t))||a){r&&(t=r);var s=0,n=function(){};return{s:n,n:function(){return s>=t.length?{done:!0}:{done:!1,value:t[s++]}},e:function(d){throw d},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 14In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,l=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var d=r.next();return l=d.done,d},e:function(d){c=!0,o=d},f:function(){try{l||r.return==null||r.return()}finally{if(c)throw o}}}}function ne(t,a,r){return(a=Zo(a))in t?Object.defineProperty(t,a,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[a]=r,t}function Ec(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Cc(t,a){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,n,o,l,c=[],d=!0,u=!1;try{if(o=(r=r.call(t)).next,a===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(s=o.call(r)).done)&&(c.push(s.value),c.length!==a);d=!0);}catch(m){u=!0,n=m}
14finally{try{if(!d&&r.return!=null&&(l=r.return(),Object(l)!==l))return}finally{if(u)throw n}}return c}}function _c(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 15In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fc(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 16In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(t,a){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);a&&(s=s.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,s)}return r}function O(t){for(var a=1;a<arguments.length;a++){var r=arguments[a]!=null?arguments[a]:{};a%2?hn(Object(r),!0).forEach(function(s){ne(t,s,r[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hn(Object(r)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(r,s))})}return t}function wr(t,a){return Nc(t)||Cc(t,a)||Ts(t,a)||_c()}function Rt(t){return wc(t)||Ec(t)||Ts(t)||Fc()}function Mc(t,a){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,a);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(t)}function Zo(t){var a=Mc(t,"string");return typeof a=="symbol"?a:a+""}function gr(t){"@babel/helpers - typeof";return gr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},gr(t)}function Ts(t,a){if(t){if(typeof t=="string")return ls(t,a);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ls(t,a):void 0}}var yn=function(){},Ps={},el={},tl=null,al={mark:yn,measure:yn};try{typeof window<"u"&&(Ps=window),typeof document<"u"&&(el=document),typeof MutationObserver<"u"&&(tl=MutationObserver),typeof performance<"u"&&(al=performance)}catch{}var Tc=Ps.navigator||{},vn=Tc.userAgent,jn=vn===void 0?"":vn,Zt=Ps,Me=el,Nn=tl,rr=al;Zt.document;var Kt=!!Me.documentElement&&!!Me.head&&typeof Me.addEventListener=="function"&&typeof Me.createElement=="function",rl=~jn.indexOf("MSIE")||~jn.indexOf("Trident/"),Br,Pc=/fa(k|kd|s|r|l|t|d|dr|dl|dt|b|slr|slpr|wsb|tl|ns|nds|es|gt|jr|jfr|jdr|usb|ufsb|udsb|cr|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,Lc=/Font ?Awesome ?([567 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit|Notdog Duo|Notdog|Chisel|Etch|Graphite|Thumbprint|Jelly Fill|Jelly Duo|Jelly|Utility|Utility Fill|Utility Duo|Slab Press|Slab|Whiteboard)?.*/i,sl={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"},slab:{"fa-regular":"regular",faslr:"regular"},"slab-press":{"fa-regular":"regular",faslpr:"regular"},thumbprint:{"fa-light":"light",fatl:"light"},whiteboard:{"fa-semibold":"semibold",fawsb:"semibold"},notdog:{"fa-solid":"solid",fans:"solid"},"notdog-duo":{"fa-solid":"solid",fands:"solid"},etch:{"fa-solid":"solid",faes:"solid"},graphite:{"fa-thin":"thin",fagt:"thin"},jelly:{"fa-regular":"regular",fajr:"regular"},"jelly-fill":{"fa-regular":"regular",fajfr:"regular"},"jelly-duo":{"fa-regular":"regular",fajdr:"regular"},chisel:{"fa-regular":"regular",facr:"regular"},utility:{"fa-semibold":"semibold",fausb:"semibold"},"utility-duo":{"fa-semibold":"semibold",faudsb:"semibold"},"utility-fill":{"fa-semibold":"semibold",faufsb:"semibold"}},Rc={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},nl=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-graphite","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press","fa-utility","fa-utility-duo","fa-utility-fill"],rt="classic",Ka="duotone",ol="sharp",ll="sharp-duotone",il="chisel",cl="etch",dl="graphite",ul="jelly",ml="jelly-duo",pl="jelly-fill",fl="notdog",xl="notdog-duo",gl="slab",bl="slab-press",hl="thumbprint",yl="utility",vl="utility-duo",jl="utility-fill",Nl="whiteboard",Bc="Classic",zc="Duotone",Ic="Sharp",Dc="Sharp Duotone",$c="Chisel",Oc="Etch",qc="Graphite",Uc="Jelly",Wc="Jelly Duo",Hc="Jelly Fill",Vc="Notdog",Gc="Notdog Duo",Jc="Slab",Yc="Slab Press",Kc="Thumbprint",Xc="Utility",Qc="Utility Duo",Zc="Utility Fill",ed="Whiteboard",wl=[rt,Ka,ol,ll,il,cl,dl,ul,ml,pl,fl,xl,gl,bl,hl,yl,vl,jl,Nl];Br={},ne(ne(ne(ne(ne(ne(ne(ne(ne(ne(Br,rt,Bc),Ka,zc),ol,Ic),ll,Dc),il,$c),cl,Oc),dl,qc),ul,Uc),ml,Wc),pl,Hc),ne(ne(ne(ne(ne(ne(ne(ne(ne(Br,fl,Vc),xl,Gc),gl,Jc),bl,Yc),hl,Kc),yl,Xc),vl,Qc),jl,Zc),Nl,ed);
vendor: 6,619 bytes, line 16
16var td={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"},slab:{400:"faslr"},"slab-press":{400:"faslpr"},whiteboard:{600:"fawsb"},thumbprint:{300:"fatl"},notdog:{900:"fans"},"notdog-duo":{900:"fands"},etch:{900:"faes"},graphite:{100:"fagt"},chisel:{400:"facr"},jelly:{400:"fajr"},"jelly-fill":{400:"fajfr"},"jelly-duo":{400:"fajdr"},utility:{600:"fausb"},"utility-duo":{600:"faudsb"},"utility-fill":{600:"faufsb"}},ad={"Font Awesome 7 Free":{900:"fas",400:"far"},"Font Awesome 7 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 7 Brands":{400:"fab",normal:"fab"},"Font Awesome 7 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 7 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 7 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"},"Font Awesome 7 Jelly":{400:"fajr",normal:"fajr"},"Font Awesome 7 Jelly Fill":{400:"fajfr",normal:"fajfr"},"Font Awesome 7 Jelly Duo":{400:"fajdr",normal:"fajdr"},"Font Awesome 7 Slab":{400:"faslr",normal:"faslr"},"Font Awesome 7 Slab Press":{400:"faslpr",normal:"faslpr"},"Font Awesome 7 Thumbprint":{300:"fatl",normal:"fatl"},"Font Awesome 7 Notdog":{900:"fans",normal:"fans"},"Font Awesome 7 Notdog Duo":{900:"fands",normal:"fands"},"Font Awesome 7 Etch":{900:"faes",normal:"faes"},"Font Awesome 7 Graphite":{100:"fagt",normal:"fagt"},"Font Awesome 7 Chisel":{400:"facr",normal:"facr"},"Font Awesome 7 Whiteboard":{600:"fawsb",normal:"fawsb"},"Font Awesome 7 Utility":{600:"fausb",normal:"fausb"},"Font Awesome 7 Utility Duo":{600:"faudsb",normal:"faudsb"},"Font Awesome 7 Utility Fill":{600:"faufsb",normal:"faufsb"}},rd=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["chisel",{defaultShortPrefixId:"facr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["etch",{defaultShortPrefixId:"faes",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["graphite",{defaultShortPrefixId:"fagt",defaultStyleId:"thin",styleIds:["thin"],futureStyleIds:[],defaultFontWeight:100}],["jelly",{defaultShortPrefixId:"fajr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-duo",{defaultShortPrefixId:"fajdr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["jelly-fill",{defaultShortPrefixId:"fajfr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["notdog",{defaultShortPrefixId:"fans",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["notdog-duo",{defaultShortPrefixId:"fands",defaultStyleId:"solid",styleIds:["solid"],futureStyleIds:[],defaultFontWeight:900}],["slab",{defaultShortPrefixId:"faslr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["slab-press",{defaultShortPrefixId:"faslpr",defaultStyleId:"regular",styleIds:["regular"],futureStyleIds:[],defaultFontWeight:400}],["thumbprint",{defaultShortPrefixId:"fatl",defaultStyleId:"light",styleIds:["light"],futureStyleIds:[],defaultFontWeight:300}],["utility",{defaultShortPrefixId:"fausb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["utility-duo",{defaultShortPrefixId:"faudsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["utility-fill",{defaultShortPrefixId:"faufsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}],["whiteboard",{defaultShortPrefixId:"fawsb",defaultStyleId:"semibold",styleIds:["semibold"],futureStyleIds:[],defaultFontWeight:600}]]),sd={chisel:{regular:"facr"},classic:{brands:"fab",light:"fal",regular:"far",solid:"fas",thin:"fat"},duotone:{light:"fadl",regular:"fadr",solid:"fad",thin:"fadt"},etch:{solid:"faes"},graphite:{thin:"fagt"},jelly:{regular:"fajr"},"jelly-duo":{regular:"fajdr"},"jelly-fill":{regular:"fajfr"},notdog:{solid:"fans"},"notdog-duo":{solid:"fands"},sharp:{light:"fasl",regular:"fasr",solid:"fass",thin:"fast"},"sharp-duotone":{light:"fasdl",regular:"fasdr",solid:"fasds",thin:"fasdt"},slab:{regular:"faslr"},"slab-press":{regular:"faslpr"},thumbprint:{light:"fatl"},utility:{semibold:"fausb"},"utility-duo":{semibold:"faudsb"},"utility-fill":{semibold:"faufsb"},whiteboard:{semibold:"fawsb"}},kl=["fak","fa-kit","fakd","fa-kit-duotone"],wn={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},nd=["kit"],od="kit",ld="kit-duotone",id="Kit",cd="Kit Duotone";ne(ne({},od,id),ld,cd);var dd={kit:{"fa-kit":"fak"}},ud={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},md={kit:{fak:"fa-kit"}},kn={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},zr,sr={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},pd=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone","fa-thumbprint","fa-whiteboard","fa-notdog","fa-notdog-duo","fa-chisel","fa-etch","fa-graphite","fa-jelly","fa-jelly-fill","fa-jelly-duo","fa-slab","fa-slab-press","fa-utility","fa-utility-duo","fa-utility-fill"],fd="classic",xd="duotone",gd="sharp",bd="sharp-duotone",hd="chisel",yd="etch",vd="graphite",jd="jelly",Nd="jelly-duo",wd="jelly-fill",kd="notdog",Sd="notdog-duo",Ad="slab",Ed="slab-press",Cd="thumbprint",_d="utility",Fd="utility-duo",Md="utility-fill",Td="whiteboard",Pd="Classic",Ld="Duotone",Rd="Sharp",Bd="Sharp Duotone",zd="Chisel",Id="Etch",Dd="Graphite",$d="Jelly",Od="Jelly Duo",qd="Jelly Fill",Ud="Notdog",Wd="Notdog Duo",Hd="Slab",Vd="Slab Press",Gd="Thumbprint",Jd="Utility",Yd="Utility Duo",Kd="Utility Fill",Xd="Whiteboard";zr={},ne(ne(ne(ne(ne(ne(ne(ne(ne(ne(zr,fd,Pd),xd,Ld),gd,Rd),bd,Bd),hd,zd),yd,Id),vd,Dd),jd,$d),Nd,Od),wd,qd),ne(ne(ne(ne(ne(ne(ne(ne(ne(zr,kd,Ud),Sd,Wd),Ad,Hd),Ed,Vd),
vendor: 2,646 bytes, line 16
16Cd,Gd),_d,Jd),Fd,Yd),Md,Kd),Td,Xd);var Qd="kit",Zd="kit-duotone",e5="Kit",t5="Kit Duotone";ne(ne({},Qd,e5),Zd,t5);var a5={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"},slab:{"fa-regular":"faslr"},"slab-press":{"fa-regular":"faslpr"},whiteboard:{"fa-semibold":"fawsb"},thumbprint:{"fa-light":"fatl"},notdog:{"fa-solid":"fans"},"notdog-duo":{"fa-solid":"fands"},etch:{"fa-solid":"faes"},graphite:{"fa-thin":"fagt"},jelly:{"fa-regular":"fajr"},"jelly-fill":{"fa-regular":"fajfr"},"jelly-duo":{"fa-regular":"fajdr"},chisel:{"fa-regular":"facr"},utility:{"fa-semibold":"fausb"},"utility-duo":{"fa-semibold":"faudsb"},"utility-fill":{"fa-semibold":"faufsb"}},r5={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"],slab:["faslr"],"slab-press":["faslpr"],whiteboard:["fawsb"],thumbprint:["fatl"],notdog:["fans"],"notdog-duo":["fands"],etch:["faes"],graphite:["fagt"],jelly:["fajr"],"jelly-fill":["fajfr"],"jelly-duo":["fajdr"],chisel:["facr"],utility:["fausb"],"utility-duo":["faudsb"],"utility-fill":["faufsb"]},is={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"},slab:{faslr:"fa-regular"},"slab-press":{faslpr:"fa-regular"},whiteboard:{fawsb:"fa-semibold"},thumbprint:{fatl:"fa-light"},notdog:{fans:"fa-solid"},"notdog-duo":{fands:"fa-solid"},etch:{faes:"fa-solid"},graphite:{fagt:"fa-thin"},jelly:{fajr:"fa-regular"},"jelly-fill":{fajfr:"fa-regular"},"jelly-duo":{fajdr:"fa-regular"},chisel:{facr:"fa-regular"},utility:{fausb:"fa-semibold"},"utility-duo":{faudsb:"fa-semibold"},"utility-fill":{faufsb:"fa-semibold"}},s5=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands","fa-semibold"],Sl=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt","faslr","faslpr","fawsb","fatl","fans","fands","faes","fagt","fajr","fajfr","fajdr","facr","fausb","faudsb","faufsb"].concat(pd,s5),n5=["solid","regular","light","thin","duotone","brands","semibold"],Al=[1,2,3,4,5,6,7,8,9,10],o
165=Al.concat([11,12,13,14,15,16,17,18,19,20]),l5=["aw","fw","pull-left","pull-right"],i5=[].concat(Rt(Object.keys(r5)),n5,l5,["2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vertical","flip","inverse","layers","layers-bottom-left","layers-bottom-right","layers-counter","layers-text","layers-top-left","layers-top-right","li","pull-end","pull-start","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul","width-auto","width-fixed",sr.GROUP,sr.SWAP_OPACITY,sr.PRIMARY,sr.SECONDARY]).concat(Al.map(function(t){return"".concat(t,"x")})).concat(o5.map(function(t){return"w-".concat(t)})),c5={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}},Jt="___FONT_AWESOME___",cs=16,El="fa",Cl="svg-inline--fa",la="data-fa-i2svg",ds="data-fa-pseudo-element",d5="data-fa-pseudo-element-pending",Ls="data-prefix",Rs="data-icon",Sn="fontawesome-i2svg",u5="async",m5=["HTML","HEAD","STYLE","SCRIPT"],_l=["::before","::after",":before",":after"],Fl
16=function(){try{return!0}catch{return!1}}();function Xa(t){return new Proxy(t,{get:function(r,s){return s in r?r[s]:r[rt]}})}var Ml=O({},sl);Ml[rt]=O(O(O(O({},{"fa-duotone":"duotone"}),sl[rt]),wn.kit),wn["kit-duotone"]);var p5=Xa(Ml),us=O({},sd);us[rt]=O(O(O(O({},{duotone:"fad"}),us[rt]),kn.kit),kn["kit-duotone"]);var An=Xa(us),ms=O({},is);ms[rt]=O(O({},ms[rt]),md.kit);var Bs=Xa(ms),ps=O({},a5);ps[rt]=O(O({},ps[rt]),dd.kit);Xa(ps);var f5=Pc,Tl="fa-layers-text",x5=Lc,g5=O({},td);Xa(g5);var b5=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Ir=Rc,h5=[].concat(Rt(nd),Rt(i5)),Da=Zt.FontAwesomeConfig||{};function y5(t){var a=Me.querySelector("script["+t+"]");if(a)return a.getAttribute(t)}function v5(t){return t===""?!0:t==="false"?!1:t==="true"?!0:t}if(Me&&typeof Me.querySelector=="function"){var j5=[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-search-pseudo-elements","searchPseudoElements"],["data-search-pseudo-elements-warnings","searchPseudoElementsWarnings"],["data-search-pseudo-elements-full-scan","searchPseudoElementsFullScan"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]];
16j5.forEach(function(t){var a=wr(t,2),r=a[0],s=a[1],n=v5(y5(r));n!=null&&(Da[s]=n)})}var Pl={styleDefault:"solid",familyDefault:rt,cssPrefix:El,replacementClass:Cl,autoReplaceSvg:!0,autoAddCss:!0,searchPseudoElements:!1,searchPseudoElementsWarnings:!0,searchPseudoElementsFullScan:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};Da.familyPrefix&&(Da.cssPrefix=Da.familyPrefix);var Aa=O(O({},Pl),Da);Aa.autoReplaceSvg||(Aa.observeMutations=!1);var ee={};Object.keys(Pl).forEach(function(t){Object.defineProperty(ee,t,{enumerable:!0,set:function(r){Aa[t]=r,$a.forEach(function(s){return s(ee)})},get:function(){return Aa[t]}})});Object.defineProperty(ee,"familyPrefix",{enumerable:!0,set:function(a){Aa.cssPrefix=a,$a.forEach(function(r){return r(ee)})},get:function(){return Aa.cssPrefix}});Zt.FontAwesomeConfig=ee;var $a=[];function N5(t){return $a.push(t),function(){$a.splice($a.indexOf(t),1)}}var ba=cs,Ot={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function w5(t){if(!(!t||!Kt)){var a=Me.createElement("style");a.setAttribute("type","text/css"),a.innerHTML=t;for(var r=Me.head.childNodes,s=null,n=r.length-1;n>-1;n--){var o=r[n],l=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(l)>-1&&(s=o)}return Me.head.insertBefore(a,s),t}}var k5="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function En(){for(var t=12,a="";t-- >0;)a+=k5[Math.random()*62|0];return a}function Ca(t){for(var a=[],r=(t||[]).length>>>0;r--;)a[r]=t[r];return a}function zs(t){return t.classList?Ca(t.classList):(t.getAttribute("class")||"").split(" ").filter(function(a){return a})}function Ll(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function S5(t){return Object.keys(t||{}).reduce(function(a,r){return a+"".concat(r,'="').concat(Ll(t[r]),'" ')},"").trim()}function kr(t){return Object.keys(t||{}).reduce(function(a,r){return a+"".concat(r,": ").concat(t[r].trim(),";")},"")}function Is(t){return t.size!==Ot.size||t.x!==Ot.x||t.y!==Ot.y||t.rotate!==Ot.rotate||t.flipX||t.flipY}function A5(t){var a=t.transform,r=t.containerWidth,s=t.iconWidth,n={transform:"translate(".concat(r/2," 256)")},o="translate(".concat(a.x*32,", ").concat(a.y*32,") "),l="scale(".concat(a.size/16*(a.flipX?-1:1),", ").concat(a.size/16*(a.flipY?-1:1),") "),c="rotate(".concat(a.rotate," 0 0)"),d={transform:"".concat(o," ").concat(l," ").concat(c)},u={transform:"translate(".concat(s/2*-1," -256)")};return{outer:n,inner:d,path:u}}function E5(t){var a=t.transform,r=t.width,s=r===void 0?cs:r,n=t.height,o=n===void 0?cs:n,l="";return rl?l+="translate(".concat(a.x/ba-s/2,"em, ").concat(a.y/ba-o/2,"em) "):l+="translate(calc(-50% + ".concat(a.x/ba,"em), calc(-50% + ").concat(a.y/ba,"em)) "),l+="scale(".concat(a.size/ba*(a.flipX?-1:1),", ").concat(a.size/ba*(a.flipY?-1:1),") "),l+="rotate(".concat(a.rotate,"deg) "),l}var C5=`:root, :host { 17 --fa-font-solid: normal 900 1em/1 'Font Awesome 7 Free'; 18 --fa-font-regular: normal 400 1em/1 'Font Awesome 7 Free'; 19 --fa-font-light: normal 300 1em/1 'Font Awesome 7 Pro'; 20 --fa-font-thin: normal 100 1em/1 'Font Awesome 7 Pro'; 21 --fa-font-duotone: normal 900 1em/1 'Font Awesome 7 Duotone'; 22 --fa-font-duotone-regular: normal 400 1em/1 'Font Awesome 7 Duotone'; 23 --fa-font-duotone-light: normal 300 1em/1 'Font Awesome 7 Duotone'; 24 --fa-font-duotone-thin: normal 100 1em/1 'Font Awesome 7 Duotone'; 25 --fa-font-brands: normal 400 1em/1 'Font Awesome 7 Brands'; 26 --fa-font-sharp-solid: normal 900 1em/1 'Font Awesome 7 Sharp'; 27 --fa-font-sharp-regular: normal 400 1em/1 'Font Awesome 7 Sharp'; 28 --fa-font-sharp-light: normal 300 1em/1 'Font Awesome 7 Sharp'; 29 --fa-font-sharp-thin: normal 100 1em/1 'Font Awesome 7 Sharp'; 30 --fa-font-sharp-duotone-solid: normal 900 1em/1 'Font Awesome 7 Sharp Duotone'; 31 --fa-font-sharp-duotone-regular: normal 400 1em/1 'Font Awesome 7 Sharp Duotone'; 32 --fa-font-sharp-duotone-light: normal 300 1em/1 'Font Awesome 7 Sharp Duotone'; 33 --fa-font-sharp-duotone-thin: normal 100 1em/1 'Font Awesome 7 Sharp Duotone'; 34 --fa-font-slab-regular: normal 400 1em/1 'Font Awesome 7 Slab'; 35 --fa-font-slab-press-regular: normal 400 1em/1 'Font Awesome 7 Slab Press'; 36 --fa-font-whiteboard-semibold: normal 600 1em/1 'Font Awesome 7 Whiteboard'; 37 --fa-font-thumbprint-light: normal 300 1em/1 'Font Awesome 7 Thumbprint'; 38 --fa-font-notdog-solid: normal 900 1em/1 'Font Awesome 7 Notdog'; 39 --fa-font-notdog-duo-solid: normal 900 1em/1 'Font Awesome 7 Notdog Duo'; 40 --fa-font-etch-solid: normal 900 1em/1 'Font Awesome 7 Etch'; 41 --fa-font-graphite-thin: normal 100 1em/1 'Font Awesome 7 Graphite'; 42 --fa-font-jelly-regular: normal 400 1em/1 'Font Awesome 7 Jelly'; 43 --fa-font-jelly-fill-regular: normal 400 1em/1 'Font Awesome 7 Jelly Fill'; 44 --fa-font-jelly-duo-regular: normal 400 1em/1 'Font Awesome 7 Jelly Duo'; 45 --fa-font-chisel-regular: normal 400 1em/1 'Font Awesome 7 Chisel'; 46 --fa-font-utility-semibold: normal 600 1em/1 'Font Awesome 7 Utility'; 47 --fa-font-utility-duo-semibold: normal 600 1em/1 'Font Awesome 7 Utility Duo'; 48 --fa-font-utility-fill-semibold: normal 600 1em/1 'Font Awesome 7 Utility Fill'; 49} 50 51.svg-inline--fa { 52 box-sizing: content-box; 53 display: var(--fa-display, inline-block); 54 height: 1em; 55 overflow: visible; 56 vertical-align: -0.125em; 57 width: var(--fa-width, 1.25em); 58} 59.svg-inline--fa.fa-2xs { 60 vertical-align: 0.1em; 61} 62.svg-inline--fa.fa-xs { 63 vertical-align: 0em; 64} 65.svg-inline--fa.fa-sm { 66 vertical-align: -0.0714285714em; 67} 68.svg-inline--fa.fa-lg { 69 vertical-align: -0.2em; 70} 71.svg-inline--fa.fa-xl { 72 vertical-align: -0.25em; 73} 74.svg-inline--fa.fa-2xl { 75 vertical-align: -0.3125em; 76} 77.svg-inline--fa.fa-pull-left, 78.svg-inline--fa .fa-pull-start { 79 float: inline-start; 80 margin-inline-end: var(--fa-pull-margin, 0.3em); 81} 82.svg-inline--fa.fa-pull-right, 83.svg-inline--fa .fa-pull-end { 84 float: inline-end; 85 margin-inline-start: var(--fa-pull-margin, 0.3em); 86} 87.svg-inline--fa.fa-li { 88 width: var(--fa-li-width, 2em); 89 inset-inline-start: calc(-1 * var(--fa-li-width, 2em)); 90 inset-block-start: 0.25em; /* syncing vertical alignment with Web Font rendering */ 91} 92 93.fa-layers-counter, .fa-layers-text { 94 display: inline-block; 95 position: absolute; 96 text-align: center; 97} 98 99.fa-layers { 100 display: inline-block; 101 height: 1em; 102 position: relative; 103 text-align: center; 104 vertical-align: -0.125em; 105 width: var(--fa-width, 1.25em); 106} 107.fa-layers .svg-inline--fa { 108 inset: 0; 109 margin: auto; 110 position: absolute; 111 transform-origin: center center; 112} 113 114.fa-layers-text { 115 left: 50%; 116 top: 50%; 117 transform: translate(-50%, -50%); 118 transform-origin: center center; 119} 120 121.fa-layers-counter { 122 background-color: var(--fa-counter-background-color, #ff253a); 123 border-radius: var(--fa-counter-border-radius, 1em); 124 box-sizing: border-box; 125 color: var(--fa-inverse, #fff); 126 line-height: var(--fa-counter-line-height, 1); 127 max-width: var(--fa-counter-max-width, 5em); 128 min-width: var(--fa-counter-min-width, 1.5em); 129 overflow: hidden; 130 padding: var(--fa-counter-padding, 0.25em 0.5em); 131 right: var(--fa-right, 0); 132 text-overflow: ellipsis; 133 top: var(--fa-top, 0); 134 transform: scale(var(--fa-counter-scale, 0.25)); 135 transform-origin: top right; 136} 137 138.fa-layers-bottom-right { 139 bottom: var(--fa-bottom, 0); 140 right: var(--fa-right, 0); 141 top: auto; 142 transform: scale(var(--fa-layers-scale, 0.25)); 143 transform-origin: bottom right; 144} 145 146.fa-layers-bottom-left { 147 bottom: var(--fa-bottom, 0); 148 left: var(--fa-left, 0); 149 right: auto; 150 top: auto; 151 transform: scale(var(--fa-layers-scale, 0.25)); 152 transform-origin: bottom left; 153} 154 155.fa-layers-top-right { 156 top: var(--fa-top, 0); 157 right: var(--fa-right, 0); 158 transform: scale(var(--fa-layers-scale, 0.25)); 159 transform-origin: top right; 160} 161 162.fa-layers-top-left { 163 left: var(--fa-left, 0); 164 right: auto; 165 top: var(--fa-top, 0); 166 transform: scale(var(--fa-layers-scale, 0.25)); 167 transform-origin: top left; 168} 169 170.fa-1x { 171 font-size: 1em; 172} 173 174.fa-2x { 175 font-size: 2em; 176} 177 178.fa-3x { 179 font-size: 3em; 180} 181 182.fa-4x { 183 font-size: 4em; 184} 185 186.fa-5x { 187 font-size: 5em; 188} 189 190.fa-6x { 191 font-size: 6em; 192} 193 194.fa-7x { 195 font-size: 7em; 196} 197 198.fa-8x { 199 font-size: 8em; 200} 201 202.fa-9x { 203 font-size: 9em; 204} 205 206.fa-10x { 207 font-size: 10em; 208} 209 210.fa-2xs { 211 font-size: calc(10 / 16 * 1em); /* converts a 10px size into an em-based value that's relative to the scale's 16px base */ 212 line-height: calc(1 / 10 * 1em); /* sets the line-height of the icon back to that of it's parent */ 213 vertical-align: calc((6 / 10 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 214} 215 216.fa-xs { 217 font-size: calc(12 / 16 * 1em); /* converts a 12px size into an em-based value that's relative to the scale's 16px base */ 218 line-height: calc(1 / 12 * 1em); /* sets the line-height of the icon back to that of it's parent */ 219 vertical-align: calc((6 / 12 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 220} 221 222.fa-sm { 223 font-size: calc(14 / 16 * 1em); /* converts a 14px size into an em-based value that's relative to the scale's 16px base */ 224 line-height: calc(1 / 14 * 1em); /* sets the line-height of the icon back to that of it's parent */ 225 vertical-align: calc((6 / 14 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 226} 227 228.fa-lg { 229 font-size: calc(20 / 16 * 1em); /* converts a 20px size into an em-based value that's relative to the scale's 16px base */ 230 line-height: calc(1 / 20 * 1em); /* sets the line-height of the icon back to that of it's parent */ 231 vertical-align: calc((6 / 20 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 232} 233 234.fa-xl { 235 font-size: calc(24 / 16 * 1em); /* converts a 24px size into an em-based value that's relative to the scale's 16px base */ 236 line-height: calc(1 / 24 * 1em); /* sets the line-height of the icon back to that of it's parent */ 237 vertical-align: calc((6 / 24 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 238} 239 240.fa-2xl { 241 font-size: calc(32 / 16 * 1em); /* converts a 32px size into an em-based value that's relative to the scale's 16px base */ 242 line-height: calc(1 / 32 * 1em); /* sets the line-height of the icon back to that of it's parent */ 243 vertical-align: calc((6 / 32 - 0.375) * 1em); /* vertically centers the icon taking into account the surrounding text's descender */ 244} 245 246.fa-width-auto { 247 --fa-width: auto; 248} 249 250.fa-fw, 251.fa-width-fixed { 252 --fa-width: 1.25em; 253} 254 255.fa-ul { 256 list-style-type: none; 257 margin-inline-start: var(--fa-li-margin, 2.5em); 258 padding-inline-start: 0; 259} 260.fa-ul > li { 261 position: relative; 262} 263 264.fa-li { 265 inset-inline-start: calc(-1 * var(--fa-li-width, 2em)); 266 position: absolute; 267 text-align: center; 268 width: var(--fa-li-width, 2em); 269 line-height: inherit; 270} 271
272/* Heads Up: Bordered Icons will not be supported in the future! 273 - This feature will be deprecated in the next major release of Font Awesome (v8)! 274 - You may continue to use it in this version *v7), but it will not be supported in Font Awesome v8. 275*/ 276/* Notes: 277* --@{v.$css-prefix}-border-width = 1/16 by default (to render as ~1px based on a 16px default font-size) 278* --@{v.$css-prefix}-border-padding = 279 ** 3/16 for vertical padding (to give ~2px of vertical whitespace around an icon considering it's vertical alignment) 280 ** 4/16 for horizontal padding (to give ~4px of horizontal whitespace around an icon) 281*/ 282.fa-border { 283 border-color: var(--fa-border-color, #eee); 284 border-radius: var(--fa-border-radius, 0.1em); 285 border-style: var(--fa-border-style, solid); 286 border-width: var(--fa-border-width, 0.0625em); 287 box-sizing: var(--fa-border-box-sizing, content-box); 288 padding: var(--fa-border-padding, 0.1875em 0.25em); 289} 290 291.fa-pull-left, 292.fa-pull-start { 293 float: inline-start; 294 margin-inline-end: var(--fa-pull-margin, 0.3em); 295} 296 297.fa-pull-right, 298.fa-pull-end { 299 float: inline-end; 300 margin-inline-start: var(--fa-pull-margin, 0.3em); 301} 302 303.fa-beat { 304 animation-name: fa-beat; 305 animation-delay: var(--fa-animation-delay, 0s); 306 animation-direction: var(--fa-animation-direction, normal); 307 animation-duration: var(--fa-animation-duration, 1s); 308 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 309 animation-timing-function: var(--fa-animation-timing, ease-in-out); 310} 311 312.fa-bounce { 313 animation-name: fa-bounce; 314 animation-delay: var(--fa-animation-delay, 0s); 315 animation-direction: var(--fa-animation-direction, normal); 316 animation-duration: var(--fa-animation-duration, 1s); 317 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 318 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); 319} 320 321.fa-fade { 322 animation-name: fa-fade; 323 animation-delay: var(--fa-animation-delay, 0s); 324 animation-direction: var(--fa-animation-direction, normal); 325 animation-duration: var(--fa-animation-duration, 1s); 326 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 327 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 328} 329 330.fa-beat-fade { 331 animation-name: fa-beat-fade; 332 animation-delay: var(--fa-animation-delay, 0s); 333 animation-direction: var(--fa-animation-direction, normal); 334 animation-duration: var(--fa-animation-duration, 1s); 335 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 336 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 337} 338 339.fa-flip { 340 animation-name: fa-flip; 341 animation-delay: var(--fa-animation-delay, 0s); 342 animation-direction: var(--fa-animation-direction, normal); 343 animation-duration: var(--fa-animation-duration, 1s); 344 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 345 animation-timing-function: var(--fa-animation-timing, ease-in-out); 346} 347 348.fa-shake { 349 animation-name: fa-shake; 350 animation-delay: var(--fa-animation-delay, 0s); 351 animation-direction: var(--fa-animation-direction, normal); 352 animation-duration: var(--fa-animation-duration, 1s); 353 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 354 animation-timing-function: var(--fa-animation-timing, linear); 355} 356 357.fa-spin { 358 animation-name: fa-spin; 359 animation-delay: var(--fa-animation-delay, 0s); 360 animation-direction: var(--fa-animation-direction, normal); 361 animation-duration: var(--fa-animation-duration, 2s); 362 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 363 animation-timing-function: var(--fa-animation-timing, linear); 364} 365 366.fa-spin-reverse { 367 --fa-animation-direction: reverse; 368} 369 370.fa-pulse, 371.fa-spin-pulse { 372 animation-name: fa-spin; 373 animation-direction: var(--fa-animation-direction, normal); 374 animation-duration: var(--fa-animation-duration, 1s); 375 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 376 animation-timing-function: var(--fa-animation-timing, steps(8)); 377} 378 379@media (prefers-reduced-motion: reduce) { 380 .fa-beat, 381 .fa-bounce, 382 .fa-fade, 383 .fa-beat-fade, 384 .fa-flip, 385 .fa-pulse, 386 .fa-shake, 387 .fa-spin, 388 .fa-spin-pulse { 389 animation: none !important; 390 transition: none !important; 391 } 392} 393@keyframes fa-beat { 394 0%, 90% { 395 transform: scale(1); 396 } 397 45% { 398 transform: scale(var(--fa-beat-scale, 1.25)); 399 } 400} 401@keyframes fa-bounce { 402 0% { 403 transform: scale(1, 1) translateY(0); 404 } 405 10% { 406 transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); 407 } 408 30% { 409 transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); 410 } 411 50% { 412 transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); 413 } 414 57% { 415 transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); 416 } 417 64% { 418 transform: scale(1, 1) translateY(0); 419 } 420 100% { 421 transform: scale(1, 1) translateY(0); 422 } 423} 424@keyframes fa-fade { 425 50% { 426 opacity: var(--fa-fade-opacity, 0.4); 427 } 428} 429@keyframes fa-beat-fade { 430 0%, 100% { 431 opacity: var(--fa-beat-fade-opacity, 0.4); 432 transform: scale(1); 433 } 434 50% { 435 opacity: 1; 436 transform: scale(var(--fa-beat-fade-scale, 1.125)); 437 } 438} 439@keyframes fa-flip { 440 50% { 441 transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); 442 } 443} 444@keyframes fa-shake { 445 0% { 446 transform: rotate(-15deg); 447 } 448 4% { 449 transform: rotate(15deg); 450 } 451 8%, 24% { 452 transform: rotate(-18deg); 453 } 454 12%, 28% { 455 transform: rotate(18deg); 456 } 457 16% { 458 transform: rotate(-22deg); 459 } 460 20% { 461 transform: rotate(22deg); 462 } 463 32% { 464 transform: rotate(-12deg); 465 } 466 36% { 467 transform: rotate(12deg); 468 } 469 40%, 100% { 470 transform: rotate(0deg); 471 } 472} 473@keyframes fa-spin { 474 0% { 475 transform: rotate(0deg); 476 } 477 100% { 478 transform: rotate(360deg); 479 } 480} 481.fa-rotate-90 { 482 transform: rotate(90deg); 483} 484 485.fa-rotate-180 { 486 transform: rotate(180deg); 487} 488 489.fa-rotate-270 { 490 transform: rotate(270deg); 491} 492 493.fa-flip-horizontal { 494 transform: scale(-1, 1); 495} 496
497.fa-flip-vertical { 498 transform: scale(1, -1); 499} 500 501.fa-flip-both, 502.fa-flip-horizontal.fa-flip-vertical { 503 transform: scale(-1, -1); 504} 505 506.fa-rotate-by { 507 transform: rotate(var(--fa-rotate-angle, 0)); 508} 509 510.svg-inline--fa .fa-primary { 511 fill: var(--fa-primary-color, currentColor); 512 opacity: var(--fa-primary-opacity, 1); 513} 514 515.svg-inline--fa .fa-secondary { 516 fill: var(--fa-secondary-color, currentColor); 517 opacity: var(--fa-secondary-opacity, 0.4); 518} 519 520.svg-inline--fa.fa-swap-opacity .fa-primary { 521 opacity: var(--fa-secondary-opacity, 0.4); 522} 523 524.svg-inline--fa.fa-swap-opacity .fa-secondary { 525 opacity: var(--fa-primary-opacity, 1); 526} 527 528.svg-inline--fa mask .fa-primary, 529.svg-inline--fa mask .fa-secondary { 530 fill: black; 531} 532 533.svg-inline--fa.fa-inverse { 534 fill: var(--fa-inverse, #fff); 535} 536 537.fa-stack { 538 display: inline-block; 539 height: 2em; 540 line-height: 2em; 541 position: relative; 542 vertical-align: middle; 543 width: 2.5em; 544} 545 546.fa-inverse { 547 color: var(--fa-inverse, #fff); 548} 549 550.svg-inline--fa.fa-stack-1x { 551 --fa-width: 1.25em; 552 height: 1em; 553 width: var(--fa-width); 554} 555.svg-inline--fa.fa-stack-2x { 556 --fa-width: 2.5em; 557 height: 2em; 558 width: var(--fa-width); 559} 560 561.fa-stack-1x, 562.fa-stack-2x { 563 inset: 0; 564 margin: auto; 565 position: absolute; 566 z-index: var(--fa-stack-z-index, auto); 567}`;function Rl(){var t=El,a=Cl,r=ee.cssPrefix,s=ee.replacementClass,n=C5;if(r!==t||s!==a){var o=new RegExp("\\.".concat(t,"\\-"),"g"),l=new RegExp("\\--".concat(t,"\\-"),"g"),c=new RegExp("\\.".concat(a),"g");n=n.replace(o,".".concat(r,"-")).replace(l,"--".concat(r,"-")).replace(c,".".concat(s))}return n}var Cn=!1;function Dr(){ee.autoAddCss&&!Cn&&(w5(Rl()),Cn=!0)}var _5={mixout:function(){return{dom:{css:Rl,insertCss:Dr}}},hooks:function(){return{beforeDOMElementCreation:function(){Dr()},beforeI2svg:function(){Dr()}}}},Yt=Zt||{};Yt[Jt]||(Yt[Jt]={});Yt[Jt].styles||(Yt[Jt].styles={});Yt[Jt].hooks||(Yt[Jt].hooks={});Yt[Jt].shims||(Yt[Jt].shims=[]);var Pt=Yt[Jt],Bl=[],zl=function(){Me.removeEventListener("DOMContentLoaded",zl),br=1,Bl.map(function(a){return a()})},br=!1;Kt&&(br=(Me.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(Me.readyState),br||Me.addEventListener("DOMContentLoaded",zl));function F5(t){Kt&&(br?setTimeout(t,0):Bl.push(t))}function Qa(t){var a=t.tag,r=t.attributes,s=r===void 0?{}:r,n=t.children,o=n===void 0?[]:n;return typeof t=="string"?Ll(t):"<".concat(a," ").concat(S5(s),">").concat(o.map(Qa).join(""),"</").concat(a,">")}function _n(t,a,r){if(t&&t[a]&&t[a][r])return{prefix:a,iconName:r,icon:t[a][r]}}var $r=function(a,r,s,n){var o=Object.keys(a),l=o.length,c=r,d,u,m;for(s===void 0?(d=1,m=a[o[0]]):(d=0,m=s);d<l;d++)u=o[d],m=c(m,a[u],u,a);return m};function Il(t){return Rt(t).length!==1?null:t.codePointAt(0).toString(16)}function Fn(t){return Object.keys(t).reduce(function(a,r){var s=t[r],n=!!s.icon;return n?a[s.iconName]=s.icon:a[r]=s,a},{})}function fs(t,a){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=r.skipHooks,n=s===void 0?!1:s,o=Fn(a);typeof Pt.hooks.addPack=="function"&&!n?Pt.hooks.addPack(t,Fn(a)):Pt.styles[t]=O(O({},Pt.styles[t]||{}),o),t==="fas"&&fs("fa",a)}var Ua=Pt.styles,M5=Pt.shims,Dl=Object.keys(Bs),T5=Dl.reduce(function(t,a){return t[a]=Object.keys(Bs[a]),t},{}),Ds=null,$l={},Ol={},ql={},Ul={},Wl={};function P5(t){return~h5.indexOf(t)}function L5(t,a){var r=a.split("-"),s=r[0],n=r.slice(1).join("-");return s===t&&n!==""&&!P5(n)?n:null}var Hl=function(){var a=function(o){return $r(Ua,function(l,c,d){return l[d]=$r(c,o,{}),l},{})};$l=a(function(n,o,l){if(o[3]&&(n[o[3]]=l),o[2]){var c=o[2].filter(function(d){return typeof d=="number"});c.forEach(function(d){n[d.toString(16)]=l})}return n}),Ol=a(function(n,o,l){if(n[l]=l,o[2]){var c=o[2].filter(function(d){return typeof d=="string"});c.forEach(function(d){n[d]=l})}return n}),Wl=a(function(n,o,l){var c=o[2];return n[l]=l,c.forEach(function(d){n[d]=l}),n});var r="far"in Ua||ee.autoFetchSvg,s=$r(M5,function(n,o){var l=o[0],c=o[1],d=o[2];return c==="far"&&!r&&(c="fas"),typeof l=="string"&&(n.names[l]={prefix:c,iconName:d}),typeof l=="number"&&(n.unicodes[l.toString(16)]={prefix:c,iconName:d}),n},{names:{},unicodes:{}});ql=s.names,Ul=s.unicodes,Ds=Sr(ee.styleDefault,{family:ee.familyDefault})};
567N5(function(t){Ds=Sr(t.styleDefault,{family:ee.familyDefault})});Hl();function $s(t,a){return($l[t]||{})[a]}function R5(t,a){return(Ol[t]||{})[a]}function na(t,a){return(Wl[t]||{})[a]}function Vl(t){return ql[t]||{prefix:null,iconName:null}}function B5(t){var a=Ul[t],r=$s("fas",t);return a||(r?{prefix:"fas",iconName:r}:null)||{prefix:null,iconName:null}}function ea(){return Ds}var Gl=function(){return{prefix:null,iconName:null,rest:[]}};function z5(t){var a=rt,r=Dl.reduce(function(s,n){return s[n]="".concat(ee.cssPrefix,"-").concat(n),s},{});return wl.forEach(function(s){(t.includes(r[s])||t.some(function(n){return T5[s].includes(n)}))&&(a=s)}),a}function Sr(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.family,s=r===void 0?rt:r,n=p5[s][t];if(s===Ka&&!t)return"fad";var o=An[s][t]||An[s][n],l=t in Pt.styles?t:null,c=o||l||null;return c}function I5(t){var a=[],r=null;return t.forEach(function(s){var n=L5(ee.cssPrefix,s);n?r=n:s&&a.push(s)}),{iconName:r,rest:a}}function Mn(t){return t.sort().filter(function(a,r,s){return s.indexOf(a)===r})}var Tn=Sl.concat(kl);function Ar(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.skipLookups,s=r===void 0?!1:r,n=null,o=Mn(t.filter(function(v){return Tn.includes(v)})),l=Mn(t.filter(function(v){return!Tn.includes(v)})),c=o.filter(function(v){return n=v,!nl.includes(v)}),d=wr(c,1),u=d[0],m=u===void 0?null:u,p=z5(o),x=O(O({},I5(l)),{},{prefix:Sr(m,{family:p})});return O(O(O({},x),q5({values:t,family:p,styles:Ua,config:ee,canonical:x,givenPrefix:n})),D5(s,n,x))}function D5(t,a,r){var s=r.prefix,n=r.iconName;if(t||!s||!n)return{prefix:s,iconName:n};var o=a==="fa"?Vl(n):{},l=na(s,n);return n=o.iconName||l||n,s=o.prefix||s,s==="far"&&!Ua.far&&Ua.fas&&!ee.autoFetchSvg&&(s="fas"),{prefix:s,iconName:n}}var $5=wl.filter(function(t){return t!==rt||t!==Ka}),O5=Object.keys(is).filter(function(t){return t!==rt}).map(function(t){return Object.keys(is[t])}).flat();function q5(t){var a=t.values,r=t.family,s=t.canonical,n=t.givenPrefix,o=n===void 0?"":n,l=t.styles,c=l===void 0?{}:l,d=t.config,u=d===void 0?{}:d,m=r===Ka,p=a.includes("fa-duotone")||a.includes("fad"),x=u.familyDefault==="duotone",v=s.prefix==="fad"||s.prefix==="fa-duotone";if(!m&&(p||x||v)&&(s.prefix="fad"),(a.includes("fa-brands")||a.includes("fab"))&&(s.prefix="fab"),!s.prefix&&$5.includes(r)){var f=Object.keys(c).find(function(g){return O5.includes(g)});if(f||u.autoFetchSvg){var h=rd.get(r).defaultShortPrefixId;s.prefix=h,s.iconName=na(s.prefix,s.iconName)||s.iconName}}return(s.prefix==="fa"||o==="fa")&&(s.prefix=ea()||"fas"),s}var U5=function(){function t(){kc(this,t),this.definitions={}}return Ac(t,[{key:"add",value:function(){for(var r=this,s=arguments.length,n=new Array(s),o=0;o<s;o++)n[o]=arguments[o];var l=n.reduce(this._pullDefinitions,{});Object.keys(l).forEach(function(c){r.definitions[c]=O(O({},r.definitions[c]||{}),l[c]),fs(c,l[c]);var d=Bs[rt][c];d&&fs(d,l[c]),Hl()})}},{key:"reset",value:function(){this.definitions={}}},{key:"_pullDefinitions",value:function(r,s){var n=s.prefix&&s.iconName&&s.icon?{0:s}:s;return Object.keys(n).map(function(o){var l=n[o],c=l.prefix,d=l.iconName,u=l.icon,m=u[2];r[c]||(r[c]={}),m.length>0&&m.forEach(function(p){typeof p=="string"&&(r[c][p]=u)}),r[c][d]=u}),r}}])}(),Pn=[],Na={},Sa={},W5=Object.keys(Sa);function H5(t,a){var r=a.mixoutsTo;return Pn=t,Na={},Object.keys(Sa).forEach(function(s){W5.indexOf(s)===-1&&delete Sa[s]}),Pn.forEach(function(s){var n=s.mixout?s.mixout():{};if(Object.keys(n).forEach(function(l){typeof n[l]=="function"&&(r[l]=n[l]),gr(n[l])==="object"&&Object.keys(n[l]).forEach(function(c){r[l]||(r[l]={}),r[l][c]=n[l][c]})}),s.hooks){var o=s.hooks();Object.keys(o).forEach(function(l){Na[l]||(Na[l]=[]),Na[l].push(o[l])})}s.provides&&s.provides(Sa)}),r}function xs(t,a){for(var r=arguments.length,s=new Array(r>2?r-2:0),n=2;n<r;n++)s[n-2]=arguments[n];var o=Na[t]||[];return o.forEach(function(l){a=l.apply(null,[a].concat(s))}),a}function ia(t){for(var a=arguments.length,r=new Array(a>1?a-1:0),s=1;s<a;s++)r[s-1]=arguments[s];var n=Na[t]||[];
567n.forEach(function(o){o.apply(null,r)})}function ta(){var t=arguments[0],a=Array.prototype.slice.call(arguments,1);return Sa[t]?Sa[t].apply(null,a):void 0}function gs(t){t.prefix==="fa"&&(t.prefix="fas");var a=t.iconName,r=t.prefix||ea();if(a)return a=na(r,a)||a,_n(Jl.definitions,r,a)||_n(Pt.styles,r,a)}var Jl=new U5,V5=function(){ee.autoReplaceSvg=!1,ee.observeMutations=!1,ia("noAuto")},G5={i2svg:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Kt?(ia("beforeI2svg",a),ta("pseudoElements2svg",a),ta("i2svg",a)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=a.autoReplaceSvgRoot;ee.autoReplaceSvg===!1&&(ee.autoReplaceSvg=!0),ee.observeMutations=!0,F5(function(){Y5({autoReplaceSvgRoot:r}),ia("watch",a)})}},J5={icon:function(a){if(a===null)return null;if(gr(a)==="object"&&a.prefix&&a.iconName)return{prefix:a.prefix,iconName:na(a.prefix,a.iconName)||a.iconName};if(Array.isArray(a)&&a.length===2){var r=a[1].indexOf("fa-")===0?a[1].slice(3):a[1],s=Sr(a[0]);return{prefix:s,iconName:na(s,r)||r}}if(typeof a=="string"&&(a.indexOf("".concat(ee.cssPrefix,"-"))>-1||a.match(f5))){var n=Ar(a.split(" "),{skipLookups:!0});return{prefix:n.prefix||ea(),iconName:na(n.prefix,n.iconName)||n.iconName}}if(typeof a=="string"){var o=ea();return{prefix:o,iconName:na(o,a)||a}}}},wt={noAuto:V5,config:ee,dom:G5,parse:J5,library:Jl,findIconDefinition:gs,toHtml:Qa},Y5=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=a.autoReplaceSvgRoot,s=r===void 0?Me:r;(Object.keys(Pt.styles).length>0||ee.autoFetchSvg)&&Kt&&ee.autoReplaceSvg&&wt.dom.i2svg({node:s})};function Er(t,a){return Object.defineProperty(t,"abstract",{get:a}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(function(s){return Qa(s)})}}),Object.defineProperty(t,"node",{get:function(){if(Kt){var s=Me.createElement("div");return s.innerHTML=t.html,s.children}}}),t}function K5(t){var a=t.children,r=t.main,s=t.mask,n=t.attributes,o=t.styles,l=t.transform;if(Is(l)&&r.found&&!s.found){var c=r.width,d=r.height,u={x:c/d/2,y:.5};n.style=kr(O(O({},o),{},{"transform-origin":"".concat(u.x+l.x/16,"em ").concat(u.y+l.y/16,"em")}))}return[{tag:"svg",attributes:n,children:a}]}function X5(t){var a=t.prefix,r=t.iconName,s=t.children,n=t.attributes,o=t.symbol,l=o===!0?"".concat(a,"-").concat(ee.cssPrefix,"-").concat(r):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:O(O({},n),{},{id:l}),children:s}]}]}function Q5(t){var a=["aria-label","aria-labelledby","title","role"];return a.some(function(r){return r in t})}function Os(t){var a=t.icons,r=a.main,s=a.mask,n=t.prefix,o=t.iconName,l=t.transform,c=t.symbol,d=t.maskId,u=t.extra,m=t.watchable,p=m===void 0?!1:m,x=s.found?s:r,v=x.width,f=x.height,h=[ee.replacementClass,o?"".concat(ee.cssPrefix,"-").concat(o):""].filter(function(N){return u.classes.indexOf(N)===-1}).filter(function(N){return N!==""||!!N}).concat(u.classes).join(" "),g={children:[],attributes:O(O({},u.attributes),{},{"data-prefix":n,"data-icon":o,class:h,role:u.attributes.role||"img",viewBox:"0 0 ".concat(v," ").concat(f)})};!Q5(u.attributes)&&!u.attributes["aria-hidden"]&&(g.attributes["aria-hidden"]="true"),p&&(g.attributes[la]="");var y=O(O({},g),{},{prefix:n,iconName:o,main:r,mask:s,maskId:d,transform:l,symbol:c,styles:O({},u.styles)}),j=s.found&&r.found?ta("generateAbstractMask",y)||{children:[],attributes:{}}:ta("generateAbstractIcon",y)||{children:[],attributes:{}},F=j.children,C=j.attributes;return y.children=F,y.attributes=C,c?X5(y):K5(y)}function Ln(t){var a=t.content,r=t.width,s=t.height,n=t.transform,o=t.extra,l=t.watchable,c=l===void 0?!1:l,d=O(O({},o.attributes),{},{class:o.classes.join(" ")});c&&(d[la]="");var u=O({},o.styles);Is(n)&&(u.transform=E5({transform:n,width:r,height:s}),u["-webkit-transform"]=u.transform);var m=kr(u);m.length>0&&(d.style=m);var p=[];return p.push({tag:"span",attributes:d,children:[a]}),p}function Z5(t){var a=t.content,r=t.extra,s=O(O({},r.attributes),{},{class:r.classes.join(" ")}),n=kr(r.styles);n.length>0&&(s.style=n);var o=[];return o.push({tag:"span",attributes:s,children:[a]}),o}var Or=Pt.styles;function bs(t){var a=t[0],r=t[1],s=t.slice(4),n=wr(s,1),o=n[0],l=null;return Array.isArray(o)?l={tag:"g",attributes:{class:"".concat(ee.cssPrefix,"-").concat(Ir.GROUP)},children:[{tag:"path",attributes:{class:"".concat(ee.cssPrefix,"-").concat(Ir.SECONDARY),fill:"currentColor",d:o[0]}},{tag:"path",attributes:{class:"".concat(ee.cssPrefix,"-").concat(Ir.PRIMARY),fill:"currentColor",d:o[1]}}]}
567:l={tag:"path",attributes:{fill:"currentColor",d:o}},{found:!0,width:a,height:r,icon:l}}var eu={found:!1,width:512,height:512};function tu(t,a){!Fl&&!ee.showMissingIcons&&t&&console.error('Icon with name "'.concat(t,'" and prefix "').concat(a,'" is missing.'))}function hs(t,a){var r=a;return a==="fa"&&ee.styleDefault!==null&&(a=ea()),new Promise(function(s,n){if(r==="fa"){var o=Vl(t)||{};t=o.iconName||t,a=o.prefix||a}if(t&&a&&Or[a]&&Or[a][t]){var l=Or[a][t];return s(bs(l))}tu(t,a),s(O(O({},eu),{},{icon:ee.showMissingIcons&&t?ta("missingIconAbstract")||{}:{}}))})}var Rn=function(){},ys=ee.measurePerformance&&rr&&rr.mark&&rr.measure?rr:{mark:Rn,measure:Rn},za='FA "7.2.0"',au=function(a){return ys.mark("".concat(za," ").concat(a," begins")),function(){return Yl(a)}},Yl=function(a){ys.mark("".concat(za," ").concat(a," ends")),ys.measure("".concat(za," ").concat(a),"".concat(za," ").concat(a," begins"),"".concat(za," ").concat(a," ends"))},qs={begin:au,end:Yl},mr=function(){};function Bn(t){var a=t.getAttribute?t.getAttribute(la):null;return typeof a=="string"}function ru(t){var a=t.getAttribute?t.getAttribute(Ls):null,r=t.getAttribute?t.getAttribute(Rs):null;return a&&r}function su(t){return t&&t.classList&&t.classList.contains&&t.classList.contains(ee.replacementClass)}function nu(){if(ee.autoReplaceSvg===!0)return pr.replace;var t=pr[ee.autoReplaceSvg];return t||pr.replace}function ou(t){return Me.createElementNS("http://www.w3.org/2000/svg",t)}function lu(t){return Me.createElement(t)}function Kl(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.ceFn,s=r===void 0?t.tag==="svg"?ou:lu:r;if(typeof t=="string")return Me.createTextNode(t);var n=s(t.tag);Object.keys(t.attributes||[]).forEach(function(l){n.setAttribute(l,t.attributes[l])});var o=t.children||[];return o.forEach(function(l){n.appendChild(Kl(l,{ceFn:s}))}),n}function iu(t){var a=" ".concat(t.outerHTML," ");return a="".concat(a,"Font Awesome fontawesome.com "),a}var pr={replace:function(a){var r=a[0];if(r.parentNode)if(a[1].forEach(function(n){r.parentNode.insertBefore(Kl(n),r)}),r.getAttribute(la)===null&&ee.keepOriginalSource){var s=Me.createComment(iu(r));r.parentNode.replaceChild(s,r)}else r.remove()},nest:function(a){var r=a[0],s=a[1];if(~zs(r).indexOf(ee.replacementClass))return pr.replace(a);var n=new RegExp("".concat(ee.cssPrefix,"-.*"));if(delete s[0].attributes.id,s[0].attributes.class){var o=s[0].attributes.class.split(" ").reduce(function(c,d){return d===ee.replacementClass||d.match(n)?c.toSvg.push(d):c.toNode.push(d),c},{toNode:[],toSvg:[]});s[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?r.removeAttribute("class"):r.setAttribute("class",o.toNode.join(" "))}var l=s.map(function(c){return Qa(c)}).join(` 568`);r.setAttribute(la,""),r.innerHTML=l}};function zn(t){t()}function Xl(t,a){var r=typeof a=="function"?a:mr;if(t.length===0)r();else{var s=zn;ee.mutateApproach===u5&&(s=Zt.requestAnimationFrame||zn),s(function(){var n=nu(),o=qs.begin("mutate");t.map(n),o(),r()})}}var Us=!1;function Ql(){Us=!0}
568function vs(){Us=!1}var hr=null;function In(t){if(Nn&&ee.observeMutations){var a=t.treeCallback,r=a===void 0?mr:a,s=t.nodeCallback,n=s===void 0?mr:s,o=t.pseudoElementsCallback,l=o===void 0?mr:o,c=t.observeMutationsRoot,d=c===void 0?Me:c;hr=new Nn(function(u){if(!Us){var m=ea();Ca(u).forEach(function(p){if(p.type==="childList"&&p.addedNodes.length>0&&!Bn(p.addedNodes[0])&&(ee.searchPseudoElements&&l(p.target),r(p.target)),p.type==="attributes"&&p.target.parentNode&&ee.searchPseudoElements&&l([p.target],!0),p.type==="attributes"&&Bn(p.target)&&~b5.indexOf(p.attributeName))if(p.attributeName==="class"&&ru(p.target)){var x=Ar(zs(p.target)),v=x.prefix,f=x.iconName;p.target.setAttribute(Ls,v||m),f&&p.target.setAttribute(Rs,f)}else su(p.target)&&n(p.target)})}}),Kt&&hr.observe(d,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}}function cu(){hr&&hr.disconnect()}function du(t){var a=t.getAttribute("style"),r=[];return a&&(r=a.split(";").reduce(function(s,n){var o=n.split(":"),l=o[0],c=o.slice(1);return l&&c.length>0&&(s[l]=c.join(":").trim()),s},{})),r}function uu(t){var a=t.getAttribute("data-prefix"),r=t.getAttribute("data-icon"),s=t.innerText!==void 0?t.innerText.trim():"",n=Ar(zs(t));return n.prefix||(n.prefix=ea()),a&&r&&(n.prefix=a,n.iconName=r),n.iconName&&n.prefix||(n.prefix&&s.length>0&&(n.iconName=R5(n.prefix,t.innerText)||$s(n.prefix,Il(t.innerText))),!n.iconName&&ee.autoFetchSvg&&t.firstChild&&t.firstChild.nodeType===Node.TEXT_NODE&&(n.iconName=t.firstChild.data)),n}function mu(t){var a=Ca(t.attributes).reduce(function(r,s){return r.name!=="class"&&r.name!=="style"&&(r[s.name]=s.value),r},{});return a}function pu(){return{iconName:null,prefix:null,transform:Ot,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function Dn(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0},r=uu(t),s=r.iconName,n=r.prefix,o=r.rest,l=mu(t),c=xs("parseNodeAttributes",{},t),d=a.styleParser?du(t):[];return O({iconName:s,prefix:n,transform:Ot,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:o,styles:d,attributes:l}},c)}var fu=Pt.styles;function Zl(t){var a=ee.autoReplaceSvg==="nest"?Dn(t,{styleParser:!1}):Dn(t);return~a.extra.classes.indexOf(Tl)?ta("generateLayersText",t,a):ta("generateSvgReplacementMutation",t,a)}function xu(){return[].concat(Rt(kl),Rt(Sl))}function $n(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Kt)return Promise.resolve();var r=Me.documentElement.classList,s=function(p){return r.add("".concat(Sn,"-").concat(p))},n=function(p){return r.remove("".concat(Sn,"-").concat(p))},o=ee.autoFetchSvg?xu():nl.concat(Object.keys(fu));o.includes("fa")||o.push("fa");var l=[".".concat(Tl,":not([").concat(la,"])")].concat(o.map(function(m){return".".concat(m,":not([").concat(la,"])")})).join(", ");if(l.length===0)return Promise.resolve();var c=[];try{c=Ca(t.querySelectorAll(l))}catch{}if(c.length>0)s("pending"),n("complete");else return Promise.resolve();var d=qs.begin("onTree"),u=c.reduce(function(m,p){try{var x=Zl(p);x&&m.push(x)}catch(v){Fl||v.name==="MissingIcon"&&console.error(v)}return m},[]);return new Promise(function(m,p){Promise.all(u).then(function(x){Xl(x,function(){s("active"),s("complete"),n("pending"),typeof a=="function"&&a(),d(),m()})}).catch(function(x){d(),p(x)})})}function gu(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Zl(t).then(function(r){r&&Xl([r],a)})}function bu(t){return function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=(a||{}).icon?a:gs(a||{}),n=r.mask;return n&&(n=(n||{}).icon?n:gs(n||{})),t(s,O(O({},r),{},{mask:n}))}}var hu=function(a){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.transform,n=s===void 0?Ot:s,o=r.symbol,l=o===void 0?!1:o,c=r.mask,d=c===void 0?null:c,u=r.maskId,m=u===void 0?null:u,p=r.classes,x=p===void 0?[]:p,v=r.attributes,f=v===void 0?{}:v,h=r.styles,g=h===void 0?{}:h;if(a){var y=a.prefix,j=a.iconName,F=a.icon;return Er(O({type:"icon"},a),function(){return ia("beforeDOMElementCreation",{iconDefinition:a,params:r}),Os({icons:{main:bs(F),mask:d?bs(d.icon):{found:!1,width:null,height:null,icon:{}}},prefix:y,iconName:j,transform:O(O({},Ot),n),symbol:l,maskId:m,extra:{attributes:f,styles:g,classes:x}})})}},yu={mixout:function(){return{icon:bu(hu)}},hooks:function(){return{mutationObserverCallbacks:function(r){return r.treeCallback=$n,r.nodeCallback=gu,r}}},provides:function(a){a.i2svg=function(r){var s=r.node,n=s===void 0?Me:s,o=r.callback,l=o===void 0?function(){}:o;return $n(n,l)},a.generateSvgReplacementMutation=function(r,s){var n=s.iconName,o=s.prefix,l=s.transform,c=s.symbol,d=s.mask,u=s.maskId,m=s.extra;return new Promise(function(p,x){Promise.all([hs(n,o),d.iconName?hs(d.iconName,d.prefix):Promise.resolve({foun
568d:!1,width:512,height:512,icon:{}})]).then(function(v){var f=wr(v,2),h=f[0],g=f[1];p([r,Os({icons:{main:h,mask:g},prefix:o,iconName:n,transform:l,symbol:c,maskId:u,extra:m,watchable:!0})])}).catch(x)})},a.generateAbstractIcon=function(r){var s=r.children,n=r.attributes,o=r.main,l=r.transform,c=r.styles,d=kr(c);d.length>0&&(n.style=d);var u;return Is(l)&&(u=ta("generateAbstractTransformGrouping",{main:o,transform:l,containerWidth:o.width,iconWidth:o.width})),s.push(u||o.icon),{children:s,attributes:n}}}},vu={mixout:function(){return{layer:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=s.classes,o=n===void 0?[]:n;return Er({type:"layer"},function(){ia("beforeDOMElementCreation",{assembler:r,params:s});var l=[];return r(function(c){Array.isArray(c)?c.map(function(d){l=l.concat(d.abstract)}):l=l.concat(c.abstract)}),[{tag:"span",attributes:{class:["".concat(ee.cssPrefix,"-layers")].concat(Rt(o)).join(" ")},children:l}]})}}}},ju={mixout:function(){return{counter:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};s.title;var n=s.classes,o=n===void 0?[]:n,l=s.attributes,c=l===void 0?{}:l,d=s.styles,u=d===void 0?{}:d;return Er({type:"counter",content:r},function(){return ia("beforeDOMElementCreation",{content:r,params:s}),Z5({content:r.toString(),extra:{attributes:c,styles:u,classes:["".concat(ee.cssPrefix,"-layers-counter")].concat(Rt(o))}})})}}}},Nu={mixout:function(){return{text:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=s.transform,o=n===void 0?Ot:n,l=s.classes,c=l===void 0?[]:l,d=s.attributes,u=d===void 0?{}:d,m=s.styles,p=m===void 0?{}:m;return Er({type:"text",content:r},function(){return ia("beforeDOMElementCreation",{content:r,params:s}),Ln({content:r,transform:O(O({},Ot),o),extra:{attributes:u,styles:p,classes:["".concat(ee.cssPrefix,"-layers-text")].concat(Rt(c))}})})}}},provides:function(a){a.generateLayersText=function(r,s){var n=s.transform,o=s.extra,l=null,c=null;if(rl){var d=parseInt(getComputedStyle(r).fontSize,10),u=r.getBoundingClientRect();l=u.width/d,c=u.height/d}return Promise.resolve([r,Ln({content:r.innerHTML,width:l,height:c,transform:n,extra:o,watchable:!0})])}}},ei=new RegExp('"',"ug"),On=[1105920,1112319],qn=O(O(O(O({},{FontAwesome:{normal:"fas",400:"fas"}}),ad),c5),ud),js=Object.keys(qn).reduce(function(t,a){return t[a.toLowerCase()]=qn[a],t},{}),wu=Object.keys(js).reduce(function(t,a){var r=js[a];return t[a]=r[900]||Rt(Object.entries(r))[0][1],t},{});function ku(t){var a=t.replace(ei,"");return Il(Rt(a)[0]||"")}function Su(t){var a=t.getPropertyValue("font-feature-settings").includes("ss01"),r=t.getPropertyValue("content"),s=r.replace(ei,""),n=s.codePointAt(0),o=n>=On[0]&&n<=On[1],l=s.length===2?s[0]===s[1]:!1;return o||l||a}function Au(t,a){var r=t.replace(/^['"]|['"]$/g,"").toLowerCase(),s=parseInt(a),n=isNaN(s)?"normal":s;return(js[r]||{})[n]||wu[r]}function Un(t,a){var r="".concat(d5).concat(a.replace(":","-"));return new Promise(function(s,n){if(t.getAttribute(r)!==null)return s();var o=Ca(t.children),l=o.filter(function(b){return b.getAttribute(ds)===a})[0],c=Zt.getComputedStyle(t,a),d=c.getPropertyValue("font-family"),u=d.match(x5),m=c.getPropertyValue("font-weight"),p=c.getPropertyValue("content");if(l&&!u)return t.removeChild(l),s();if(u&&p!=="none"&&p!==""){var x=c.getPropertyValue("content"),v=Au(d,m),f=ku(x),h=u[0].startsWith("FontAwesome"),g=Su(c),y=$s(v,f),j=y;if(h){var F=B5(f);F.iconName&&F.prefix&&(y=F.iconName,v=F.prefix)}if(y&&!g&&(!l||l.getAttribute(Ls)!==v||l.getAttribute(Rs)!==j)){t.setAttribute(r,j),l&&t.removeChild(l);var C=pu(),N=C.extra;N.attributes[ds]=a,hs(y,v).then(function(b){var w=Os(O(O({},C),{},{icons:{main:b,mask:Gl()},prefix:v,iconName:j,extra:N,watchable:!0})),L=Me.createElementNS("http://www.w3.org/2000/svg","svg");a==="::before"?t.insertBefore(L,t.firstChild):t.appendChild(L),L.outerHTML=w.map(function(z){return Qa(z)}).join(` 569`),t.removeAttribute(r),s()}).catch(n)}else s()}else s()})}function Eu(t){return Promise.all([Un(t,"::before"),Un(t,"::after")])}function Cu(t){return t.parentNode!==document.head&&!~m5.indexOf(t.tagName.toUpperCase())&&!t.getAttribute(ds)&&(!t.parentNode||t.parentNode.tagName!=="svg")}var _u=function(a){return!!a&&_l.some(function(r){return a.includes(r)})}
569,Fu=function(a){if(!a)return[];var r=new Set,s=a.split(/,(?![^()]*\))/).map(function(d){return d.trim()});s=s.flatMap(function(d){return d.includes("(")?d:d.split(",").map(function(u){return u.trim()})});var n=ur(s),o;try{for(n.s();!(o=n.n()).done;){var l=o.value;if(_u(l)){var c=_l.reduce(function(d,u){return d.replace(u,"")},l);c!==""&&c!=="*"&&r.add(c)}}}catch(d){n.e(d)}finally{n.f()}return r};function Wn(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(Kt){var r;if(a)r=t;else if(ee.searchPseudoElementsFullScan)r=t.querySelectorAll("*");else{var s=new Set,n=ur(document.styleSheets),o;try{for(n.s();!(o=n.n()).done;){var l=o.value;try{var c=ur(l.cssRules),d;try{for(c.s();!(d=c.n()).done;){var u=d.value,m=Fu(u.selectorText),p=ur(m),x;try{for(p.s();!(x=p.n()).done;){var v=x.value;s.add(v)}}catch(h){p.e(h)}finally{p.f()}}}catch(h){c.e(h)}finally{c.f()}}catch(h){ee.searchPseudoElementsWarnings&&console.warn("Font Awesome: cannot parse stylesheet: ".concat(l.href," (").concat(h.message,`) 570If it declares any Font Awesome CSS pseudo-elements, they will not be rendered as SVG icons. Add crossorigin="anonymous" to the <link>, enable searchPseudoElementsFullScan for slower but more thorough DOM parsing, or suppress this warning by setting searchPseudoElementsWarnings to false.`))}}}catch(h){n.e(h)}finally{n.f()}if(!s.size)return;var f=Array.from(s).join(", ");try{r=t.querySelectorAll(f)}catch{}}return new Promise(function(h,g){var y=Ca(r).filter(Cu).map(Eu),j=qs.begin("searchPseudoElements");Ql(),Promise.all(y).then(function(){j(),vs(),h()}).catch(function(){j(),vs(),g()})})}}var Mu={hooks:function(){return{mutationObserverCallbacks:function(r){return r.pseudoElementsCallback=Wn,r}}},provides:function(a){a.pseudoElements2svg=function(r){var s=r.node,n=s===void 0?Me:s;ee.searchPseudoElements&&Wn(n)}}},Hn=!1,Tu={mixout:function(){return{dom:{unwatch:function(){Ql(),Hn=!0}}}},hooks:function(){return{bootstrap:function(){In(xs("mutationObserverCallbacks",{}))},noAuto:function(){cu()},watch:function(r){var s=r.observeMutationsRoot;Hn?vs():In(xs("mutationObserverCallbacks",{observeMutationsRoot:s}))}}}},Vn=function(a){var r={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return a.toLowerCase().split(" ").reduce(function(s,n){var o=n.toLowerCase().split("-"),l=o[0],c=o.slice(1).join("-");if(l&&c==="h")return s.flipX=!0,s;if(l&&c==="v")return s.flipY=!0,s;if(c=parseFloat(c),isNaN(c))return s;switch(l){case"grow":s.size=s.size+c;break;case"shrink":s.size=s.size-c;break;case"left":s.x=s.x-c;break;case"right":s.x=s.x+c;break;case"up":s.y=s.y-c;break;case"down":s.y=s.y+c;break;case"rotate":s.rotate=s.rotate+c;break}return s},r)},Pu={mixout:function(){return{parse:{transform:function(r){return Vn(r)}}}},hooks:function(){return{parseNodeAttributes:function(r,s){var n=s.getAttribute("data-fa-transform");return n&&(r.transform=Vn(n)),r}}},provides:function(a){a.generateAbstractTransformGrouping=function(r){var s=r.main,n=r.transform,o=r.containerWidth,l=r.iconWidth,c={transform:"translate(".concat(o/2," 256)")},d="translate(".concat(n.x*32,", ").concat(n.y*32,") "),u="scale(".concat(n.size/16*(n.flipX?-1:1),", ").concat(n.size/16*(n.flipY?-1:1),") "),m="rotate(".concat(n.rotate," 0 0)"),p={transform:"".concat(d," ").concat(u," ").concat(m)},x={transform:"translate(".concat(l/2*-1," -256)")},v={outer:c,inner:p,path:x};return{tag:"g",attributes:O({},v.outer),children:[{tag:"g",attributes:O({},v.inner),children:[{tag:s.icon.tag,children:s.icon.children,attributes:O(O({},s.icon.attributes),v.path)}]}]}}}},qr={x:0,y:0,width:"100%",height:"100%"};function Gn(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.attributes&&(t.attributes.fill||a)&&(t.attributes.fill="black"),t}function Lu(t){return t.tag==="g"?t.children:[t]}var Ru={hooks:function(){return{parseNodeAttributes:function(r,s){var n=s.getAttribute("data-fa-mask"),o=n?Ar(n.split(" ").map(function(l){return l.trim()})):Gl();return o.prefix||(o.prefix=ea()),r.mask=o,r.maskId=s.getAttribute("data-fa-mask-id"),r}}},provides:function(a){a.generateAbstractMask=function(r){var s=r.children,n=r.attributes,o=r.main,l=r.mask,c=r.maskId,d=r.transform,u=o.width,m=o.icon,p=l.width,x=l.icon,v=A5({transform:d,containerWidth:p,iconWidth:u}),f={tag:"rect",attributes:O(O({},qr),{},{fill:"white"})},h=m.children?{children:m.children.map(Gn)}:{},g={tag:"g",attributes:O({},v.inner),children:[Gn(O({tag:m.tag,attributes:O(O({},m.attributes),v.path)},h))]},y={tag:"g",attributes:O({},v.outer),children:[g]},j="mask-".concat(c||En()),F="clip-".concat(c||En()),C={tag:"mask",attributes:O(O({},qr),{},{id:j,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[f,y]},N={tag:"defs",children:[{tag:"clipPath",attributes:{id:F},children:Lu(x)},C]};return s.push(N,{tag:"rect",attributes:O({fill:"currentColor","clip-path":"url(#".concat(F,")"),mask:"url(#".concat(j,")")},qr)}),{children:s,attributes:n}}}},Bu={provides:function(a){var r=!1;Zt.matchMedia&&(r=Zt.matchMedia("(prefers-reduced-motion: reduce)").matches),a.missingIconAbstract=function(){var s=[],n={fill:"
570currentColor"},o={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};s.push({tag:"path",attributes:O(O({},n),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});var l=O(O({},o),{},{attributeName:"opacity"}),c={tag:"circle",attributes:O(O({},n),{},{cx:"256",cy:"364",r:"28"}),children:[]};return r||c.children.push({tag:"animate",attributes:O(O({},o),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:O(O({},l),{},{values:"1;0;1;1;0;1;"})}),s.push(c),s.push({tag:"path",attributes:O(O({},n),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:r?[]:[{tag:"animate",attributes:O(O({},l),{},{values:"1;0;0;0;0;1;"})}]}),r||s.push({tag:"path",attributes:O(O({},n),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:O(O({},l),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:s}}}},zu={hooks:function(){return{parseNodeAttributes:function(r,s){var n=s.getAttribute("data-fa-symbol"),o=n===null?!1:n===""?!0:n;return r.symbol=o,r}}}},Iu=[_5,yu,vu,ju,Nu,Mu,Tu,Pu,Ru,Bu,zu];H5(Iu,{mixoutsTo:wt});wt.noAuto;var Wa=wt.config;wt.library;wt.dom;var ti=wt.parse;wt.findIconDefinition;wt.toHtml;var Du=wt.icon;wt.layer;wt.text;wt.counter;function $u(t){return t=t-0,t===t}function ai(t){return $u(t)?t:(t=t.replace(/[_-]+(.)?/g,(a,r)=>r?r.toUpperCase():""),t.charAt(0).toLowerCase()+t.slice(1))}function Ou(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ha=new Map,qu=1e3;function Uu(t){if(ha.has(t))return ha.get(t);const a={};let r=0;const s=t.length;for(;r<s;){const n=t.indexOf(";",r),o=n===-1?s:n,l=t.slice(r,o).trim();if(l){const c=l.indexOf(":");if(c>0){const d=l.slice(0,c).trim(),u=l.slice(c+1).trim();if(d&&u){const m=ai(d);a[m.startsWith("webkit")?Ou(m):m]=u}}}r=o+1}if(ha.size===qu){const n=ha.keys().next().value;n&&ha.delete(n)}return ha.set(t,a),a}function ri(t,a,r={}){if(typeof a=="string")return a;const s=(a.children||[]).map(m=>ri(t,m)),n=a.attributes||{},o={};for(const[m,p]of Object.entries(n))switch(!0){case m==="class":{o.className=p;break}case m==="style":{o.style=Uu(String(p));break}case m.startsWith("aria-"):case m.startsWith("data-"):{o[m.toLowerCase()]=p;break}default:o[ai(m)]=p}const{style:l,role:c,"aria-label":d,...u}=r;return l&&(o.style=o.style?{...o.style,...l}:l),c&&(o.role=c),d&&(o["aria-label"]=d,o["aria-hidden"]="false"),t(a.tag,{...o,...u},...s)}var Wu=ri.bind(null,Io.createElement),Jn=(t,a)=>{const r=i.useId();return t||(a?r:void 0)},Hu=class{constructor(t="react-fontawesome"){this.enabled=!1;let a=!1;try{a=typeof process<"u"&&!1}catch{}this.scope=t,this.enabled=a}log(...t){this.enabled&&console.log(`[${this.scope}]`,...t)}warn(...t){this.enabled&&console.warn(`[${this.scope}]`,...t)}error(...t){this.enabled&&console.error(`[${this.scope}]`,...t)}},Vu="searchPseudoElementsFullScan"in Wa?"7.0.0":"6.0.0",Gu=Number.parseInt(Vu)>=7,Oa="fa",Vt={beat:"fa-beat",fade:"fa-fade",beatFade:"fa-beat-fade",bounce:"fa-bounce",shake:"fa-shake",spin:"fa-spin",spinPulse:"fa-spin-pulse",spinReverse:"fa-spin-reverse",pulse:"fa-pulse"},Ju={left:"fa-pull-left",right:"fa-pull-right"},Yu={90:"fa-rotate-90",180:"fa-rotate-180",270:"fa-rotate-270"},Ku={"2xs":"fa-2xs",xs:"fa-xs",sm:"fa-sm",lg:"fa-lg",xl:"fa-xl","2xl":"fa-2xl","1x":"fa-1x","2x":"fa-2x","3x":"fa-3x","4x":"fa-4x","5x":"fa-5x","6x":"fa-6x","7x":"fa-7x","8x":"fa-8x","9x":"fa-9x","10x":"fa-10x"},Gt={border:"fa-border",fixedWidth:"fa-fw",flip:"fa-flip",flipHorizontal:"fa-flip-horizontal",flipVertical:"fa-flip-vert
570ical",inverse:"fa-inverse",rotateBy:"fa-rotate-by",swapOpacity:"fa-swap-opacity",widthAuto:"fa-width-auto"};function Xu(t){const a=Wa.cssPrefix||Wa.familyPrefix||Oa;return a===Oa?t:t.replace(new RegExp(String.raw`(?<=^|\s)${Oa}-`,"g"),`${a}-`)}function Qu(t){const{beat:a,fade:r,beatFade:s,bounce:n,shake:o,spin:l,spinPulse:c,spinReverse:d,pulse:u,fixedWidth:m,inverse:p,border:x,flip:v,size:f,rotation:h,pull:g,swapOpacity:y,rotateBy:j,widthAuto:F,className:C}=t,N=[];return C&&N.push(...C.split(" ")),a&&N.push(Vt.beat),r&&N.push(Vt.fade),s&&N.push(Vt.beatFade),n&&N.push(Vt.bounce),o&&N.push(Vt.shake),l&&N.push(Vt.spin),d&&N.push(Vt.spinReverse),c&&N.push(Vt.spinPulse),u&&N.push(Vt.pulse),m&&N.push(Gt.fixedWidth),p&&N.push(Gt.inverse),x&&N.push(Gt.border),v===!0&&N.push(Gt.flip),(v==="horizontal"||v==="both")&&N.push(Gt.flipHorizontal),(v==="vertical"||v==="both")&&N.push(Gt.flipVertical),f!=null&&N.push(Ku[f]),h!=null&&h!==0&&N.push(Yu[h]),g!=null&&N.push(Ju[g]),y&&N.push(Gt.swapOpacity),Gu?(j&&N.push(Gt.rotateBy),F&&N.push(Gt.widthAuto),(Wa.cssPrefix||Wa.familyPrefix||Oa)===Oa?N:N.map(Xu)):N}var Zu=t=>typeof t=="object"&&"icon"in t&&!!t.icon;function Yn(t){if(t)return Zu(t)?t:ti.icon(t)}function e0(t){return Object.keys(t)}var Kn=new Hu("FontAwesomeIcon"),si={border:!1,className:"",mask:void 0,maskId:void 0,fixedWidth:!1,inverse:!1,flip:!1,icon:void 0,listItem:!1,pull:void 0,pulse:!1,rotation:void 0,rotateBy:!1,size:void 0,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:void 0,transform:void 0,swapOpacity:!1,widthAuto:!1},t0=new Set(Object.keys(si)),J=Io.forwardRef((t,a)=>{const r={...si,...t},{icon:s,mask:n,symbol:o,title:l,titleId:c,maskId:d,transform:u}=r,m=Jn(d,!!n),p=Jn(c,!!l),x=Yn(s);if(!x)return Kn.error("Icon lookup is undefined",s),null;const v=Qu(r),f=typeof u=="string"?ti.transform(u):u,h=Yn(n),g=Du(x,{...v.length>0&&{classes:v},...f&&{transform:f},...h&&{mask:h},symbol:o,title:l,titleId:p,maskId:m});if(!g)return Kn.error("Could not find icon",x),null;const{abstract:y}=g,j={ref:a};for(const F of e0(r))t0.has(F)||(j[F]=r[F]);return Wu(y[0],j)});J.displayName="FontAwesomeIcon";/*! 571 * Font Awesome Free 7.2.0 by @fontawesome - https://fontawesome.com 572 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 573 * Copyright 2026 Fonticons, Inc. 574 */var a0={prefix:"fas",iconName:"rotate",icon:[512,512,[128260,"sync-alt"],"f2f1","M480.1 192l7.9 0c13.3 0 24-10.7 24-24l0-144c0-9.7-5.8-18.5-14.8-22.2S477.9 .2 471 7L419.3 58.8C375 22.1 318 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1C79.2 135.5 159.3 64 256 64 300.4 64 341.2 79 373.7 104.3L327 151c-6.9 6.9-8.9 17.2-5.2 26.2S334.3 192 344 192l136.1 0zm29.4 100.5c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-44.4 0-85.2-15-117.7-40.3L185 361c6.9-6.9 8.9-17.2 5.2-26.2S177.7 320 168 320L24 320c-13.3 0-24 10.7-24 24L0 488c0 9.7 5.8 18.5 14.8 22.2S34.1 511.8 41 505l51.8-51.8C137 489.9 194 512 256 512 385 512 491.7 416.6 509.4 292.5z"]},r0={prefix:"fas",iconName:"microphone-slash",icon:[576,512,[],"f131","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9L424.7 358.8C458.9 324.2 480 276.6 480 224l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 39.3-15.7 74.9-41.3 100.9L356.8 291C373.6 273.7 384 250 384 224l0-128c0-53-43-96-96-96s-96 43-96 96l0 30.2-151-151zm298.3 434l-41.4-41.4c-3.3 .2-6.5 .3-9.8 .3-79.5 0-144-64.5-144-144l0-10.2-43.6-43.6c-2.8 3.9-4.4 8.7-4.4 13.8l0 40c0 97.9 73.3 178.7 168 190.5l0 49.5-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-49.5c9.3-1.2 18.4-3 27.3-5.4z"]},s0={prefix:"fas",iconName:"crop-simple",icon:[512,512,["crop-alt"],"f565","M128 32c0-17.7-14.3-32-32-32S64 14.3 64 32l0 32-32 0C14.3 64 0 78.3 0 96s14.3 32 32 32l32 0 0 256c0 35.3 28.7 64 64 64l208 0 0-64-208 0 0-352zM384 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-32 32 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-32 0 0-256c0-35.3-28.7-64-64-64l-208
5740 0 64 208 0 0 352z"]},n0={prefix:"fas",iconName:"envelope",icon:[512,512,[128386,9993,61443],"f0e0","M48 64c-26.5 0-48 21.5-48 48 0 15.1 7.1 29.3 19.2 38.4l208 156c17.1 12.8 40.5 12.8 57.6 0l208-156c12.1-9.1 19.2-23.3 19.2-38.4 0-26.5-21.5-48-48-48L48 64zM0 196L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-188-198.4 148.8c-34.1 25.6-81.1 25.6-115.2 0L0 196z"]},o0={prefix:"fas",iconName:"arrows-turn-to-dots",icon:[448,512,[],"e4c1","M265.4-6.6c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L285.3 64 352 64c53 0 96 43 96 96l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32c0-17.7-14.3-32-32-32l-66.7 0 25.4 25.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0l-80-80c-12.5-12.5-12.5-32.8 0-45.3l80-80zm-82.7 272l80 80c12.5 12.5 12.5 32.8 0 45.3l-80 80c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L162.7 400 96 400c-17.7 0-32 14.3-32 32l0 32c0 17.7-14.3 32-32 32S0 481.7 0 464l0-32c0-53 43-96 96-96l66.7 0-25.4-25.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0zM320 368a64 64 0 1 1 128 0 64 64 0 1 1 -128 0zM64 160a64 64 0 1 1 0-128 64 64 0 1 1 0 128z"]},l0={prefix:"fas",iconName:"calendar-days",icon:[448,512,["calendar-alt"],"f073","M128 0c17.7 0 32 14.3 32 32l0 32 128 0 0-32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 32 32 0c35.3 0 64 28.7 64 64l0 288c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 128C0 92.7 28.7 64 64 64l32 0 0-32c0-17.7 14.3-32 32-32zM64 240l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm128 0l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zM64 368l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16zm144-16c-8.8 0-16 7.2-16 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0zm112 16l0 32c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-32c0-8.8-7.2-16-16-16l-32 0c-8.8 0-16 7.2-16 16z"]},i0={prefix:"fas",iconName:"up-right-from-square",icon:[512,512,["external-link-alt"],"f35d","M290.4 19.8C295.4 7.8 307.1 0 320 0L480 0c17.7 0 32 14.3 32 32l0 160c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9L400 157.3 246.6 310.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L354.7 112 297.4 54.6c-9.2-9.2-11.9-22.9-6.9-34.9zM0 176c0-44.2 35.8-80 80-80l80 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-80 0c-8.8 0-16 7.2-16 16l0 256c0 8.8 7.2 16 16 16l256 0c8.8 0 16-7.2 16-16l0-80c0-17.7 14.3-32 32-32s32 14.3 32 32l0 80c0 44.2-35.8 80-80 80L80 512c-44.2 0-80-35.8-80-80L0 176z"]},c0=i0,d0={prefix:"fas",iconName:"code-branch",icon:[448,512,[],"f126","M80 104a24 24 0 1 0 0-48 24 24 0 1 0 0 48zm80-24c0 32.8-19.7 61-48 73.3l0 70.7 176 0c26.5 0 48-21.5 48-48l0-22.7c-28.3-12.3-48-40.5-48-73.3 0-44.2 35.8-80 80-80s80 35.8 80 80c0 32.8-19.7 61-48 73.3l0 22.7c0 61.9-50.1 112-112 112l-176 0 0 70.7c28.3 12.3 48 40.5 48 73.3 0 44.2-35.8 80-80 80S0 476.2 0 432c0-32.8 19.7-61 48-73.3l0-205.3C19.7 141 0 112.8 0 80 0 35.8 35.8 0 80 0s80 35.8 80 80zm232 0a24 24 0 1 0 -48 0 24 24 0 1 0 48 0zM80 456a24 24 0 1 0 0-48 24 24 0 1 0 0 48z"]},u0={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8c-22.4 31.4-35.5 69.8-35.5 111.2 0 106 86 192 192 192 41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3c22.4-31.4 35.5-69.8 35.5-111.2 0-106-86-192-192-192-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z"]},m0={prefix:"fas",iconName:"key",icon:[512,512,[128273],"f084","M336 352c97.2 0 176-78.8 176-176S433.2 0 336 0 160 78.8 160 176c0 18.7 2.9 36.8 8.3 53.7L7 391c-4.5 4.5-7 10.6-7 17l0 80c0 13.3 10.7 24 24 24l80 0c13.3 0 24-10.7 24-24l0-40 40 0c13.3 0 24-10.7 24-24l0-40 40 0c6.4 0 12.5-2.5 17-7l33.3-33.3c16.9 5.4 35 8.3 53.7 8.3zM376 96a40 40 0 1 1 0 80 40 40 0 1 1 0-80z"]},p0={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6-46.8 43.5-78.1 95.4-93 131.1-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64-11.5 0-22.3-3-31.7-8.4-1 10.9-.1 22.1 2.9 33.2 13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-12.2-45.7-55.5-74.8-101.1-70.8 5.3 9.3 8.4 20.1 8.4 31.7z"]},f0={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M136.7 5.9L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-8.7-26.1C306.9-7.2 294.7-16 280.9-16L167.1-16c-13.8 0-26 8.8-30.4 21.9zM4
57416 144L32 144 53.1 467.1C54.7 492.4 75.7 512 101 512L347 512c25.3 0 46.3-19.6 47.9-44.9L416 144z"]},x0={prefix:"fas",iconName:"equals",icon:[448,512,[62764],"3d","M32 128c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 128zm0 192c-17.7 0-32 14.3-32 32s14.3 32 32 32l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320z"]},ni={prefix:"fas",iconName:"circle-notch",icon:[512,512,[],"f1ce","M222.7 32.1c5 16.9-4.6 34.8-21.5 39.8-79.3 23.6-137.1 97.1-137.1 184.1 0 106 86 192 192 192s192-86 192-192c0-86.9-57.8-160.4-137.1-184.1-16.9-5-26.6-22.9-21.5-39.8s22.9-26.6 39.8-21.5C434.9 42.1 512 140 512 256 512 397.4 397.4 512 256 512S0 397.4 0 256c0-116 77.1-213.9 182.9-245.4 16.9-5 34.8 4.6 39.8 21.5z"]},g0={prefix:"fas",iconName:"wave-square",icon:[512,512,[],"f83e","M64 96c0-17.7 14.3-32 32-32l160 0c17.7 0 32 14.3 32 32l0 288 96 0 0-128c0-17.7 14.3-32 32-32l64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-32 0 0 128c0 17.7-14.3 32-32 32l-160 0c-17.7 0-32-14.3-32-32l0-288-96 0 0 128c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l32 0 0-128z"]},b0={prefix:"fas",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M256 0a256 256 0 1 1 0 512 256 256 0 1 1 0-512zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]},h0={prefix:"fas",iconName:"magnifying-glass-minus",icon:[512,512,["search-minus"],"f010","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM136 184c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z"]},y0={prefix:"fas",iconName:"paper-plane",icon:[576,512,[61913],"f1d8","M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z"]},v0={prefix:"fas",iconName:"infinity",icon:[640,512,[8734,9854],"f534","M0 256c0-88.4 71.6-160 160-160 50.4 0 97.8 23.7 128 64l32 42.7 32-42.7c30.2-40.3 77.6-64 128-64 88.4 0 160 71.6 160 160S568.4 416 480 416c-50.4 0-97.8-23.7-128-64l-32-42.7-32 42.7c-30.2 40.3-77.6 64-128 64-88.4 0-160-71.6-160-160zm280 0l-43.2-57.6c-18.1-24.2-46.6-38.4-76.8-38.4-53 0-96 43-96 96s43 96 96 96c30.2 0 58.7-14.2 76.8-38.4L280 256zm80 0l43.2 57.6c18.1 24.2 46.6 38.4 76.8 38.4 53 0 96-43 96-96s-43-96-96-96c-30.2 0-58.7 14.2-76.8 38.4L360 256z"]},j0={prefix:"fas",iconName:"seedling",icon:[512,512,[127793,"sprout"],"f4d8","M512 32C512 140.1 435.4 230.3 333.6 251.4 325.7 193.3 299.6 141 261.1 100.5 301.2 40 369.9 0 448 0l32 0c17.7 0 32 14.3 32 32zM0 96C0 78.3 14.3 64 32 64l32 0c123.7 0 224 100.3 224 224l0 192c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-160C100.3 320 0 219.7 0 96z"]},Ha={prefix:"fas",iconName:"users",icon:[640,512,[],"f0c0","M320 16a104 104 0 1 1 0 208 104 104 0 1 1 0-208zM96 88a72 72 0 1 1 0 144 72 72 0 1 1 0-144zM0 416c0-70.7 57.3-128 128-128 12.8 0 25.2 1.9 36.9 5.4-32.9 36.8-52.9 85.4-52.9 138.6l0 16c0 11.4 2.4 22.2 6.7 32L32 480c-17.7 0-32-14.3-32-32l0-32zm521.3 64c4.3-9.8 6.7-20.6 6.7-32l0-16c0-53.2-20-101.8-52.9-138.6 11.7-3.5 24.1-5.4 36.9-5.4 70.7 0 128 57.3 128 128l0 32c0 17.7-14.3 32-32 32l-86.7 0zM472 160a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM160 432c0-88.4 71.6-160 160-160s160 71.6 160 160l0 16c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-16z"]},N0={prefix:"fas",iconName:"database",icon:[448,512,[],"f1c0","M448 205.8c-14.8 9.8-31.8 17.7-49.5 24-47 16.8-108.7 26.2-174.5 26.2S96.4 246.5 49.5 229.8c-17.6-6.3-34.7-14.2-49.5-24L0 288c0 44.2 100.3 80 224 80s224-35.8 224-80l0-82.2zm0-77.8l0-48C448 35.8 347.7 0 224 0S0 35.8 0 80l0 48c0 44.2 100.3 80 224 80s224-35.8 224-80zM398.5 389.8C351.6 406.5 289.9 416 224 416S96.4 406.5 49.5 389.8c-17.6-6.3-34.7-14.2-49.5-24L0 432c0 44.2 100.3 80 224 80s224-35.8 224-80l0-66.2c-14.8 9.8-31.8 17.7-49.5 24z"]},w0={prefix:"fas",iconName:"microphone",icon:[384,512,[],"f130","M192 0C139 0 96 43 96 96l0 128c0 53 43 96 96 96s96-43 96-96l0-128c0-53-43-96-96-96zM48 184c0-13.3-10.7-24-24-24S0 170.7 0 184l0 40c0 97.9 73.3 178.7 168 190.5l0 49.5-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-48 0 0-49.5c94.7-11.8 168-92.6 168-190.5l0-40c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 40c0 79.5-64.5 144-144 144S48 303.5 48 224l0-40z"]}
vendor: 4,197 bytes, line 574
574,_a={prefix:"fas",iconName:"crown",icon:[576,512,[128081],"f521","M313 87.2c9.2-7.3 15-18.6 15-31.2 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 12.6 5.9 23.9 15 31.2L194.6 194.8c-10 15.7-31.3 19.6-46.2 8.4L88.9 158.7c4.5-6.4 7.1-14.3 7.1-22.7 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 21.8 17.5 39.6 39.2 40L87.8 393.5c4.7 31.3 31.6 54.5 63.3 54.5l273.8 0c31.7 0 58.6-23.2 63.3-54.5L520.8 176c21.7-.4 39.2-18.2 39.2-40 0-22.1-17.9-40-40-40s-40 17.9-40 40c0 8.4 2.6 16.3 7.1 22.7l-59.4 44.6c-14.9 11.2-36.2 7.3-46.2-8.4L313 87.2z"]},k0={prefix:"fas",iconName:"pencil",icon:[512,512,[9999,61504,"pencil-alt"],"f303","M36.4 353.2c4.1-14.6 11.8-27.9 22.6-38.7l181.2-181.2 33.9-33.9c16.6 16.6 51.3 51.3 104 104l33.9 33.9-33.9 33.9-181.2 181.2c-10.7 10.7-24.1 18.5-38.7 22.6L30.4 510.6c-8.3 2.3-17.3 0-23.4-6.2S-1.4 489.3 .9 481L36.4 353.2zm55.6-3.7c-4.4 4.7-7.6 10.4-9.3 16.6l-24.1 86.9 86.9-24.1c6.4-1.8 12.2-5.1 17-9.7L91.9 349.5zm354-146.1c-16.6-16.6-51.3-51.3-104-104L308 65.5C334.5 39 349.4 24.1 352.9 20.6 366.4 7 384.8-.6 404-.6S441.6 7 455.1 20.6l35.7 35.7C504.4 69.9 512 88.3 512 107.4s-7.6 37.6-21.2 51.1c-3.5 3.5-18.4 18.4-44.9 44.9z"]},S0={prefix:"fas",iconName:"code",icon:[576,512,[],"f121","M360.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm64.6 136.1c-12.5 12.5-12.5 32.8 0 45.3l73.4 73.4-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0zm-274.7 0c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 150.6 182.6c12.5-12.5 12.5-32.8 0-45.3z"]},A0={prefix:"fas",iconName:"user-plus",icon:[640,512,[],"f234","M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM528 80c13.3 0 24 10.7 24 24l0 48 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0 0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-48c0-13.3 10.7-24 24-24zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z"]},E0={prefix:"fas",iconName:"link",icon:[576,512,[128279,"chain"],"f0c1","M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"]},oi={prefix:"fas",iconName:"chart-line",icon:[512,512,["line-chart"],"f201","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64L0 400c0 44.2 35.8 80 80 80l400 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 416c-8.8 0-16-7.2-16-16L64 64zm406.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L320 210.7 262.6 153.4c-12.5-12.5-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l73.4-73.4 57.4 57.4c12.5 12.5 32.8 12.5 45.3 0l128-128z"]},C0={prefix:"fas",iconName:"building",icon:[384,512,[127970,61687],"f1ad","M64 0C28.7 0 0 28.7 0 64L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-384c0-35.3-28.7-64-64-64L64 0zM176 352l32 0c17.7 0 32 14.3 32 32l0 80-96 0 0-80c0-17.7 14.3-32 32-32zM96 112c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zM240 96l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16zM96 240c0-8.8 7.2-16 16-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32zm144-16l32 0c8.8 0 16 7.2 16 16l0 32c0 8.8-7.2 16-16 16l-32 0c-8.8 0-16-7.2-16-16l0-32c0-8.8 7.2-16 16-16z"]}
vendor: 7,426 bytes, line 574
574,_0={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-336c-17.7 0-32 14.3-32 32 0 13.3-10.7 24-24 24s-24-10.7-24-24c0-44.2 35.8-80 80-80s80 35.8 80 80c0 47.2-36 67.2-56 74.5l0 3.8c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-8.1c0-20.5 14.8-35.2 30.1-40.2 6.4-2.1 13.2-5.5 18.2-10.3 4.3-4.2 7.7-10 7.7-19.6 0-17.7-14.3-32-32-32zM224 368a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},li={prefix:"fas",iconName:"play",icon:[448,512,[9654],"f04b","M91.2 36.9c-12.4-6.8-27.4-6.5-39.6 .7S32 57.9 32 72l0 368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6 .7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1l-336-184z"]},F0={prefix:"fas",iconName:"wrench",icon:[576,512,[128295],"f0ad","M509.4 98.6c7.6-7.6 20.3-5.7 24.1 4.3 6.8 17.7 10.5 37 10.5 57.1 0 88.4-71.6 160-160 160-17.5 0-34.4-2.8-50.2-8L146.9 498.9c-28.1 28.1-73.7 28.1-101.8 0s-28.1-73.7 0-101.8L232 210.2c-5.2-15.8-8-32.6-8-50.2 0-88.4 71.6-160 160-160 20.1 0 39.4 3.7 57.1 10.5 10 3.8 11.8 16.5 4.3 24.1l-88.7 88.7c-3 3-4.7 7.1-4.7 11.3l0 41.4c0 8.8 7.2 16 16 16l41.4 0c4.2 0 8.3-1.7 11.3-4.7l88.7-88.7z"]},M0={prefix:"fas",iconName:"eraser",icon:[576,512,[],"f12d","M178.5 416l123 0 65.3-65.3-173.5-173.5-126.7 126.7 112 112zM224 480l-45.5 0c-17 0-33.3-6.7-45.3-18.7L17 345C6.1 334.1 0 319.4 0 304s6.1-30.1 17-41L263 17C273.9 6.1 288.6 0 304 0s30.1 6.1 41 17L527 199c10.9 10.9 17 25.6 17 41s-6.1 30.1-17 41l-135 135 120 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-288 0z"]},Va={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},T0={prefix:"fas",iconName:"fingerprint",icon:[512,512,[],"f577","M48 256c0-114.9 93.1-208 208-208 63.1 0 119.6 28.1 157.8 72.5 8.6 10.1 23.8 11.2 33.8 2.6s11.2-23.8 2.6-33.8C403.3 34.6 333.7 0 256 0 114.6 0 0 114.6 0 256l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40zm458.5-52.9c-2.7-13-15.5-21.3-28.4-18.5s-21.3 15.5-18.5 28.4c2.9 13.9 4.5 28.3 4.5 43.1l0 40c0 13.3 10.7 24 24 24s24-10.7 24-24l0-40c0-18.1-1.9-35.8-5.5-52.9zM256 80c-19 0-37.4 3-54.5 8.6-15.2 5-18.7 23.7-8.3 35.9 7.1 8.3 18.8 10.8 29.4 7.9 10.6-2.9 21.8-4.4 33.4-4.4 70.7 0 128 57.3 128 128l0 24.9c0 25.2-1.5 50.3-4.4 75.3-1.7 14.6 9.4 27.8 24.2 27.8 11.8 0 21.9-8.6 23.3-20.3 3.3-27.4 5-55 5-82.7l0-24.9c0-97.2-78.8-176-176-176zM150.7 148.7c-9.1-10.6-25.3-11.4-33.9-.4-23.1 29.8-36.8 67.1-36.8 107.7l0 24.9c0 24.2-2.6 48.4-7.8 71.9-3.4 15.6 7.9 31.1 23.9 31.1 10.5 0 19.9-7 22.2-17.3 6.4-28.1 9.7-56.8 9.7-85.8l0-24.9c0-27.2 8.5-52.4 22.9-73.1 7.2-10.4 8-24.6-.2-34.2zM256 160c-53 0-96 43-96 96l0 24.9c0 35.9-4.6 71.5-13.8 106.1-3.8 14.3 6.7 29 21.5 29 9.5 0 17.9-6.2 20.4-15.4 10.5-39 15.9-79.2 15.9-119.7l0-24.9c0-28.7 23.3-52 52-52s52 23.3 52 52l0 24.9c0 36.3-3.5 72.4-10.4 107.9-2.7 13.9 7.7 27.2 21.8 27.2 10.2 0 19-7 21-17 7.7-38.8 11.6-78.3 11.6-118.1l0-24.9c0-53-43-96-96-96zm24 96c0-13.3-10.7-24-24-24s-24 10.7-24 24l0 24.9c0 59.9-11 119.3-32.5 175.2l-5.9 15.3c-4.8 12.4 1.4 26.3 13.8 31s26.3-1.4 31-13.8l5.9-15.3C267.9 411.9 280 346.7 280 280.9l0-24.9z"]},P0={prefix:"fas",iconName:"chart-bar",icon:[512,512,["bar-chart"],"f080","M32 32c17.7 0 32 14.3 32 32l0 336c0 8.8 7.2 16 16 16l400 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L80 480c-44.2 0-80-35.8-80-80L0 64C0 46.3 14.3 32 32 32zm96 64c0-17.7 14.3-32 32-32l192 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32zm32 80l128 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm0 112l256 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32s14.3-32 32-32z"]},L0={prefix:"fas",iconName:"sliders",icon:[512,512,["sliders-h"],"f1de","M32 64C14.3 64 0 78.3 0 96s14.3 32 32 32l86.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 128c17.7 0 32-14.3 32-32s-14.3-32-32-32L265.3 64C253 35.7 224.8 16 192 16s-61 19.7-73.3 48L32 64zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l246.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48l54.7 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-54.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 224zm0 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l54.7 0c12.3 28.3 40.5 48 73.3 48s61-19.7 73.3-48L480 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-246.7 0c-12.3-28.3-40.5-48-73.3-48s-61 19.7-73.3 48L32 384z"]},R0={prefix:"fas",iconName:"brain",icon:[512,512,[129504],"f5dc","M120 56c0-30.9 25.1-56 56-56l24 0c17.7 0 32 14.3 32 32l0 448c0 17.7-14.3 32-32 32l-32 0c-29.8 0-54.9-20.4-62-48-.7 0-1.3 0-2 0-44.2 0-80-35.8-80-80 0-18 6-34.6 16-48-19.4-14.6-32-37.8-32-64 0-30.9 17.6-57.8 43.2-71.1-7.1-12-11.2-26-11.2-40.9 0-44.2 35.8-80 80-80l0-24zm272 0l0 24c44.2 0 80 35.8 80 80 0 15-4.1 29-11.2 40.9 25.7 13.3 43.2 40.1 43.2 71.1 0 26.2-12.6 49.4-32 64 10 13.4 16 30 16 48 0 44.2-35.8 80-80 80-.7 0-1.3 0-2 0-7.1 27.6-32.2 48-62 48l-32 0c-17.7 0-32-14.3-32-32l0-448c0-17.7 14.3-32 32-32l24 0c30.9 0 56 25.1 56 56z"]},B0={prefix:"fas",iconName:"gauge-high",icon:[512,512,[62461,"tachometer-alt","tachometer-alt-fast"],"f625","M0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM256 416c35.3 0 64-28.7 64-64 0-16.2-6-31.1-16-42.3l69.5-138.9c5.9-11.9 1.1-26.3-10.7-32.2s-26.3-1.1-32.2 10.7L261.1 288.2c-1.7-.1-3.4-.2-5.1-.2-35.3 0-64 28.7-64 64s28.7 64 64 64zM176 144a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM96 288a32 32 0 1 0 0-64 32 32 0 1 0 0 64zm352-32a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Za={prefix:"fas",iconName:"arrow-right",icon:[512,512,[8594],"f061","M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l370.7 0-105.4 105.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},z0={prefix:"fas",iconName:"handshake",icon:[576,512,[129309,62662,"handshake-alt","handshake-simple"],"f2b5","M268.9 85.2L152.3 214.8c-4.6 5.1-4.4 13 .5 17.9 30.5 30.5 80 30.5 110.5 0l31.8-31.8c4.2-4.2 9.5-6.5 14.9-6.9 6.8-.6 13.8 1.7 19 6.9L505.6 376 576 320 576 32 464 96 440.2 80.1C424.4 69.6 405.9 64 386.9 64l-70.4 0c-1.1 0-2.3 0-3.4 .1-16.9 .9-32.8 8.5-44.2 21.1zM116.6 182.7L223.4 64 183.8 64c-25.5 0-49.9 10.1-67.9 28.1L112 96 0 32 0 320 156.4 450.3c23 19.2 52 29.7 81.9 29.7l15.7 0-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l41 41 9 0c19.1 0 37.8-4.3 54.8-12.3L359 441c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l32 32 17.5-17.5c8.9-8.9 11.5-21.8 7.6-33.1l-137.9-136.8-14.9 14.9c-49.3 49.3-129.1 49.3-178.4 0-23-23-23.9-59.9-2.2-84z"]},I0={prefix:"fas",iconName:"right-left",icon:[512,512,["exchange-alt"],"f362","M502.6 150.6l-96 96c-9.2 9.2-22.9 11.9-34.9 6.9S352 236.9 352 224l0-64-320 0c-17.7 0-32-14.3-32-32S14.3 96 32 96l320 0 0-64c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l96 96c12.5 12.5 12.5 32.8 0 45.3zm-397.3 352l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c9.2-9.2 22.9-11.9 34.9-6.9S160 275.1 160 288l0 64 320 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-320 0 0 64c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9z"]},ii={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192.5 301.3 329.9 438.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256 375.1 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7 55.1 73.4z"]}
vendor: 5,914 bytes, line 574
574,D0=ii,$0={prefix:"fas",iconName:"comments",icon:[576,512,[128490,61670],"f086","M384 144c0 97.2-86 176-192 176-26.7 0-52.1-5-75.2-14L35.2 349.2c-9.3 4.9-20.7 3.2-28.2-4.2s-9.2-18.9-4.2-28.2l35.6-67.2C14.3 220.2 0 183.6 0 144 0 46.8 86-32 192-32S384 46.8 384 144zm0 368c-94.1 0-172.4-62.1-188.8-144 120-1.5 224.3-86.9 235.8-202.7 83.3 19.2 145 88.3 145 170.7 0 39.6-14.3 76.2-38.4 105.6l35.6 67.2c4.9 9.3 3.2 20.7-4.2 28.2s-18.9 9.2-28.2 4.2L459.2 498c-23.1 9-48.5 14-75.2 14z"]},O0={prefix:"fas",iconName:"tags",icon:[576,512,[],"f02c","M401.2 39.1L549.4 189.4c27.7 28.1 27.7 73.1 0 101.2L393 448.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L515.3 256.8c9.2-9.3 9.2-24.4 0-33.7L367 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM32.1 229.5L32.1 96c0-35.3 28.7-64 64-64l133.5 0c17 0 33.3 6.7 45.3 18.7l144 144c25 25 25 65.5 0 90.5L285.4 418.7c-25 25-65.5 25-90.5 0l-144-144c-12-12-18.7-28.3-18.7-45.3zm144-85.5a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Ws={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"]},Cr=Ws,q0={prefix:"fas",iconName:"microphone-lines",icon:[384,512,[127897,"microphone-alt"],"f3c9","M96 96c0-53 43-96 96-96 50.3 0 91.6 38.7 95.7 88L232 88c-13.3 0-24 10.7-24 24s10.7 24 24 24l56 0 0 48-56 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l55.7 0c-4.1 49.3-45.3 88-95.7 88-53 0-96-43-96-96L96 96zM24 160c13.3 0 24 10.7 24 24l0 40c0 79.5 64.5 144 144 144s144-64.5 144-144l0-40c0-13.3 10.7-24 24-24s24 10.7 24 24l0 40c0 97.9-73.3 178.7-168 190.5l0 49.5 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-49.5C73.3 402.7 0 321.9 0 224l0-40c0-13.3 10.7-24 24-24z"]},U0={prefix:"fas",iconName:"headphones",icon:[448,512,[127911,62863,"headphones-alt","headphones-simple"],"f025","M64 224c0-88.4 71.6-160 160-160s160 71.6 160 160l0 37.5c-10-3.5-20.8-5.5-32-5.5l-16 0c-26.5 0-48 21.5-48 48l0 128c0 26.5 21.5 48 48 48l16 0c53 0 96-43 96-96l0-160C448 100.3 347.7 0 224 0S0 100.3 0 224L0 384c0 53 43 96 96 96l16 0c26.5 0 48-21.5 48-48l0-128c0-26.5-21.5-48-48-48l-16 0c-11.2 0-22 1.9-32 5.5L64 224z"]},W0={prefix:"fas",iconName:"quote-left",icon:[448,512,[8220,"quote-left-alt"],"f10d","M0 216C0 149.7 53.7 96 120 96l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64L0 216zm256 0c0-66.3 53.7-120 120-120l8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-8 0c-30.9 0-56 25.1-56 56l0 8 64 0c35.3 0 64 28.7 64 64l0 64c0 35.3-28.7 64-64 64l-64 0c-35.3 0-64-28.7-64-64l0-136z"]},H0={prefix:"fas",iconName:"star",icon:[576,512,[11088,61446],"f005","M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z"]},Hs={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.1 480 472 480L40 480c-14.1 0-27.2-7.4-34.4-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zm0 352a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.5 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Vs=Hs,er={prefix:"fas",iconName:"lock",icon:[384,512,[128274],"f023","M128 96l0 64 128 0 0-64c0-35.3-28.7-64-64-64s-64 28.7-64 64zM64 160l0-64C64 25.3 121.3-32 192-32S320 25.3 320 96l0 64c35.3 0 64 28.7 64 64l0 224c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 224c0-35.3 28.7-64 64-64z"]},V0={prefix:"fas",iconName:"anchor",icon:[576,512,[9875],"f13d","M288 64a32 32 0 1 0 0 64 32 32 0 1 0 0-64zM192 96c0-53 43-96 96-96s96 43 96 96c0 41.8-26.7 77.4-64 90.5l0 257.9c62.9-14.3 110.2-69.7 111.9-136.5l-16.1 14.1c-10 8.7-25.1 7.7-33.9-2.3s-7.7-25.1 2.3-33.9l64-56c9-7.9 22.6-7.9 31.6 0l64 56c10 8.7 11 23.9 2.3 33.9s-23.9 11-33.9 2.3L496 307.9C493.9 421 401.6 512 288 512S82.1 421 80 307.9L63.8 322.1c-10 8.7-25.1 7.7-33.9-2.3s-7.7-25.1 2.3-33.9l64-56c9-7.9 22.6-7.9 31.6 0l64 56c10 8.7 11 23.9 2.3 33.9s-23.9 11-33.9 2.3l-16.1-14.1c1.8 66.8 49.1 122.2 111.9 136.5l0-257.9c-37.3-13.2-64-48.7-64-90.5z"]},G0={prefix:"fas",iconName:"user-minus",icon:[640,512,[],"f503","M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240zm344-96c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l144 0z"]},Gs={prefix:"fas",iconName:"download",icon:[448,512,[],"f019","M256 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 210.7-41.4-41.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0l96-96c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 242.7 256 32zM64 320c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-46.9 0-56.6 56.6c-31.2 31.2-81.9 31.2-113.1 0L110.9 320 64 320zm304 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},ci={prefix:"fas",iconName:"arrow-right-arrow-left",icon:[512,512,[8644,"exchange"],"f0ec","M502.6 150.6l-96 96c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L402.7 160 32 160c-17.7 0-32-14.3-32-32S14.3 96 32 96l370.7 0-41.4-41.4c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l96 96c12.5 12.5 12.5 32.8 0 45.3zm-397.3 352l-96-96c-12.5-12.5-12.5-32.8 0-45.3l96-96c12.5-12.5 32.8-12.5 45.3 0s12.5 32.8 0 45.3L109.3 352 480 352c17.7 0 32 14.3 32 32s-14.3 32-32 32l-370.7 0 41.4 41.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0z"]}
574,di={prefix:"fas",iconName:"shield-halved",icon:[512,512,["shield-alt"],"f3ed","M256 0c4.6 0 9.2 1 13.4 2.9L457.8 82.8c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0-172.4-82.5-213.1-264-213.6-363.2-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0zm0 66.8l0 378.1c138-66.8 175.1-214.8 176-303.4l-176-74.6 0 0z"]},ui={prefix:"fas",iconName:"arrow-left",icon:[512,512,[8592],"f060","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288 480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"]},J0={prefix:"fas",iconName:"shuffle",icon:[512,512,[128256,"random"],"f074","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9S384 204.9 384 192l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8l-32.4 43.2-40-53.3 21.2-28.3C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM154 296l40 53.3-21.2 28.3C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L154 296zM438.6 470.6c-9.2 9.2-22.9 11.9-34.9 6.9S384 460.9 384 448l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32S14.3 96 32 96l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]},Y0={prefix:"fas",iconName:"copy",icon:[448,512,[],"f0c5","M192 0c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-200.6c0-17.4-7.1-34.1-19.7-46.2L370.6 17.8C358.7 6.4 342.8 0 326.3 0L192 0zM64 128c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l192 0c35.3 0 64-28.7 64-64l0-16-64 0 0 16-192 0 0-256 16 0 0-64-16 0z"]},K0={prefix:"fas",iconName:"arrows-left-right",icon:[576,512,["arrows-h"],"f07e","M470.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l41.4 41.4-357.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-6 6-9.4 14.1-9.4 22.6s3.4 16.6 9.4 22.6l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-41.4-41.4 357.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"]},X0={prefix:"fas",iconName:"link-slash",icon:[576,512,["chain-broken","chain-slash","unlink"],"f127","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"]},Q0={prefix:"fas",iconName:"bolt",icon:[448,512,[9889,"zap"],"f0e7","M338.8-9.9c11.9 8.6 16.3 24.2 10.9 37.8L271.3 224 416 224c13.5 0 25.5 8.4 30.1 21.1s.7 26.9-9.6 35.5l-288 240c-11.3 9.4-27.4 9.9-39.3 1.3s-16.3-24.2-10.9-37.8L176.7 288 32 288c-13.5 0-25.5-8.4-30.1-21.1s-.7-26.9 9.6-35.5l288-240c11.3-9.4 27.4-9.9 39.3-1.3z"]},Z0={prefix:"fas",iconName:"hand-holding-heart",icon:[576,512,[],"f4be","M279.6 31C265.5 11.5 242.9 0 218.9 0 177.5 0 144 33.5 144 74.9l0 2.4c0 64.4 82 133.4 122.2 163.3 13 9.7 30.5 9.7 43.5 0 40.2-30 122.2-98.9 122.2-163.3l0-2.4c0-41.4-33.5-74.9-74.9-74.9-24 0-46.6 11.5-60.7 31L288 42.7 279.6 31zM109.3 341.5L66.7 384 32 384c-17.7 0-32 14.3-32 32l0 64c0 17.7 14.3 32 32 32l320.5 0c29 0 57.3-9.3 80.7-26.5l126.6-93.3c17.8-13.1 21.6-38.1 8.5-55.9s-38.1-21.6-55.9-8.5L392.6 416 280 416c-13.3 0-24-10.7-24-24s10.7-24 24-24l72 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-152.2 0c-33.9 0-66.5 13.5-90.5 37.5z"]},mi={prefix:"fas",iconName:"tag",icon:[512,512,[127991],"f02b","M32.5 96l0 149.5c0 17 6.7 33.3 18.7 45.3l192 192c25 25 65.5 25 90.5 0L483.2 333.3c25-25 25-6
5745.5 0-90.5l-192-192C279.2 38.7 263 32 246 32L96.5 32c-35.3 0-64 28.7-64 64zm112 16a32 32 0 1 1 0 64 32 32 0 1 1 0-64z"]},e2={prefix:"fas",iconName:"forward-fast",icon:[512,512,[9197,"fast-forward"],"f050","M19.8 477.6c12 5 25.7 2.2 34.9-6.9L224 301.3 224 448c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9L448 301.3 448 448c0 17.7 14.3 32 32 32s32-14.3 32-32l0-384c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 146.7-169.4-169.4c-9.2-9.2-22.9-11.9-34.9-6.9S224 51.1 224 64L224 210.7 54.6 41.4c-9.2-9.2-22.9-11.9-34.9-6.9S0 51.1 0 64L0 448c0 12.9 7.8 24.6 19.8 29.6z"]},t2={prefix:"fas",iconName:"magnifying-glass-chart",icon:[512,512,[],"e522","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zm-312 8l0 64c0 13.3 10.7 24 24 24s24-10.7 24-24l0-64c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80-96l0 160c0 13.3 10.7 24 24 24s24-10.7 24-24l0-160c0-13.3-10.7-24-24-24s-24 10.7-24 24zm80 64l0 96c0 13.3 10.7 24 24 24s24-10.7 24-24l0-96c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]},pi={prefix:"fas",iconName:"pause",icon:[384,512,[9208],"f04c","M48 32C21.5 32 0 53.5 0 80L0 432c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48L48 32zm224 0c-26.5 0-48 21.5-48 48l0 352c0 26.5 21.5 48 48 48l64 0c26.5 0 48-21.5 48-48l0-352c0-26.5-21.5-48-48-48l-64 0z"]},a2={prefix:"fas",iconName:"handshake-angle",icon:[576,512,["hands-helping"],"f4c4","M268.9 53.2L152.3 182.8c-4.6 5.1-4.4 13 .5 17.9 30.5 30.5 80 30.5 110.5 0l31.8-31.8c4.2-4.2 9.5-6.5 14.9-6.9 6.8-.6 13.8 1.7 19 6.9L505.6 344 576 288 576 0 464 64 440.2 48.1C424.4 37.6 405.9 32 386.9 32l-70.4 0c-1.1 0-2.3 0-3.4 .1-16.9 .9-32.8 8.5-44.2 21.1zM116.6 150.7L223.4 32 183.8 32c-25.5 0-49.9 10.1-67.9 28.1L0 192 0 544 144 408 156.4 418.3c23 19.2 52 29.7 81.9 29.7l15.7 0-7-7c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l41 41 9 0c19.1 0 37.8-4.3 54.8-12.3L359 409c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l32 32 17.5-17.5c8.9-8.9 11.5-21.8 7.6-33.1l-137.9-136.8-14.9 14.9c-49.3 49.3-129.1 49.3-178.4 0-23-23-23.9-59.9-2.2-84z"]},r2={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32l384 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 288c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32L32 448c-17.7 0-32-14.3-32-32s14.3-32 32-32l384 0c17.7 0 32 14.3 32 32z"]},s2={prefix:"fas",iconName:"route",icon:[512,512,[],"f4d7","M512 96c0 50.2-59.1 125.1-84.6 155-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8 6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96 0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8-25.2-27.4-85-97.9-85-148.4 0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},n2={prefix:"fas",iconName:"hashtag",icon:[512,512,[62098],"23","M214.7 .7c17.3 3.7 28.3 20.7 24.6 38l-19.1 89.3 126.5 0 22-102.7C372.4 8 389.4-3 406.7 .7s28.3 20.7 24.6 38L412.2 128 480 128c17.7 0 32 14.3 32 32s-14.3 32-32 32l-81.6 0-27.4 128 67.8 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-81.6 0-22 102.7c-3.7 17.3-20.7 28.3-38 24.6s-28.3-20.7-24.6-38l19.1-89.3-126.5 0-22 102.7c-3.7 17.3-20.7 28.3-38 24.6s-28.3-20.7-24.6-38L99.8 384 32 384c-17.7 0-32-14.3-32-32s14.3-32 32-32l81.6 0 27.4-128-67.8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l81.6 0 22-102.7C180.4 8 197.4-3 214.7 .7zM206.4 192l-27.4 128 126.5 0 27.4-128-126.5 0z"]},_r={prefix:"fas",iconName:"circle-dot",icon:[512,512,[128280,"dot-circle"],"f192","M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]},o2={prefix:"fas",iconName:"object-group",icon:[576,512,[],"f247","M32 119.4C12.9 108.4 0 87.7 0 64 0 28.7 28.7 0 64 0 87.7 0 108.4 12.9 119.4 32l337.1 0c11.1-19.1 31.7-32 55.4-32 35.3 0 64 28.7 64 64 0 23.7-12.9 44.4-32 55.4l0 273.1c19.1 11.1 32 31.7 32 55.4 0 35.3-28.7 64-64 64-23.7 0-44.4-12.9-55.4-32l-337.
5741 0c-11.1 19.1-31.7 32-55.4 32-35.3 0-64-28.7-64-64 0-23.7 12.9-44.4 32-55.4l0-273.1zm448 0c-9.7-5.6-17.8-13.7-23.4-23.4L119.4 96c-5.6 9.7-13.7 17.8-23.4 23.4l0 273.1c9.7 5.6 17.8 13.7 23.4 23.4l337.1 0c5.6-9.7 13.7-17.8 23.4-23.4l0-273.1zM144 176c0-17.7 14.3-32 32-32l112 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-112 0c-17.7 0-32-14.3-32-32l0-64zM256 320l32 0c44.2 0 80-35.8 80-80l32 0c17.7 0 32 14.3 32 32l0 64c0 17.7-14.3 32-32 32l-112 0c-17.7 0-32-14.3-32-32l0-16z"]},l2={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M65.9 228.5c13.3-93 93.4-164.5 190.1-164.5 53 0 101 21.5 135.8 56.2 .2 .2 .4 .4 .6 .6l7.6 7.2-47.9 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.4-11.3-10.7C390.5 28.6 326.5 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1zm443.5 64c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-53 0-101-21.5-135.8-56.2-.2-.2-.4-.4-.6-.6l-7.6-7.2 47.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320c-8.5 0-16.7 3.4-22.7 9.5S-.1 343.7 0 352.3l1 127c.1 17.7 14.6 31.9 32.3 31.7S65.2 496.4 65 478.7l-.4-51.5 10.7 10.1c46.3 46.1 110.2 74.7 180.7 74.7 129 0 235.7-95.4 253.4-219.5z"]},i2={prefix:"fas",iconName:"book-open",icon:[512,512,[128214,128366],"f518","M256 141.3l0 309.3 .5-.2C311.1 427.7 369.7 416 428.8 416l19.2 0 0-320-19.2 0c-42.2 0-84.1 8.4-123.1 24.6-16.8 7-33.4 13.9-49.7 20.7zM230.9 61.5L256 72 281.1 61.5C327.9 42 378.1 32 428.8 32L464 32c26.5 0 48 21.5 48 48l0 352c0 26.5-21.5 48-48 48l-35.2 0c-50.7 0-100.9 10-147.7 29.5l-12.8 5.3c-7.9 3.3-16.7 3.3-24.6 0l-12.8-5.3C184.1 490 133.9 480 83.2 480L48 480c-26.5 0-48-21.5-48-48L0 80C0 53.5 21.5 32 48 32l35.2 0c50.7 0 100.9 10 147.7 29.5z"]},c2={prefix:"fas",iconName:"circle-info",icon:[512,512,["info-circle"],"f05a","M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM224 160a32 32 0 1 1 64 0 32 32 0 1 1 -64 0zm-8 64l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"]},d2=c2,u2={prefix:"fas",iconName:"arrow-trend-down",icon:[576,512,[],"e097","M384 352c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0c17.7 0 32-14.3 32-32l0-160c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 82.7-169.4-169.4c-12.5-12.5-32.8-12.5-45.3 0L192 242.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0L320 205.3 466.7 352 384 352z"]},m2={prefix:"fas",iconName:"layer-group",icon:[512,512,[],"f5fd","M232.5 5.2c14.9-6.9 32.1-6.9 47 0l218.6 101c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 149.8C5.4 145.8 0 137.3 0 128s5.4-17.9 13.9-21.8L232.5 5.2zM48.1 218.4l164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 277.8C5.4 273.8 0 265.3 0 256s5.4-17.9 13.9-21.8l34.1-15.8zM13.9 362.2l34.1-15.8 164.3 75.9c27.7 12.8 59.6 12.8 87.3 0l164.3-75.9 34.1 15.8c8.5 3.9 13.9 12.4 13.9 21.8s-5.4 17.9-13.9 21.8l-218.6 101c-14.9 6.9-32.1 6.9-47 0L13.9 405.8C5.4 401.8 0 393.3 0 384s5.4-17.9 13.9-21.8z"]};const Fr={"nested-loops":a0,"pattern-interrupt":Q0,"double-bind":d0,reframe:s0,anchoring:V0,"pacing-leading":o0,"embedded-commands":S0,presuppositions:m2,metaphors:i2,"future-pacing":e2,"reality-stacking":N0,"milton-model":R0,nominalizations:mi,"complex-equivalence":x0,"implied-causative":ci,"selectional-violations":J0,"quotes-pattern":W0,"tag-questions":_0,mirroring:K0,calibration:B0,"vak-systems":p0,confusion:h0,"structured-amnesia":M0,dissociation:X0,"compound-suggestions":o2,seeding:j0,"sleight-of-mouth":$0,"agreement-frame":z0,"perceptual-positions":Ha,"state-chaining":E0,submodalities:L0,"logical-levels":oi,timeline:l0,"reverse-meta-model":l2,"decision-strategy":s2,"etiquetado-emocional":O0,"anclaje-numerico":n2,"concesion-reciproca":a2,"encuadre-perdida":u2,"voz-autoridad-serena":q0,"validacion-personal":T0,"auditoria-acusaciones":di,"admitir-fallo":Z0,"pregunta-orientada-no":u0,"sondeo-conversacional":t2};let be=null,Ea={id:null,playing:!1,loading:!1,currentTime:0,duration:0};const Ns=new Set;function $t(t){Ea={...Ea,...t},Ns.forEach(a=>a())}function p2(t){return Ns.add(t),()=>Ns.delete(t)}function Xn(){return Ea}function fi(){be&&(be.pause(),be.onloadedmetadata=null,be.ontimeupdate=null,be.onplay=null,be.onpause=null,be.onended=null,be.onerror=null,be.src="",be=null)}function xi(t,a){if(Ea.id===t&&be){be.paused?be.play().catch(()=>{}):be.pause();return}fi(),be=new Audio(a),$t({id:t,playing:!1,loading:!0,currentTime:0,duration:0}),be.onloadedmetadata=()=>$t({duration:be.duration||0,loading:!1}),be.ontimeupdate=()=>$t({currentTime:be.currentTime}),be.onplay=()=>$t({playing:!0,loading:!1}),be.onpause=()=>$t({playing:!1}),be.onended=()=>
574$t({playing:!1,currentTime:0}),be.onerror=()=>$t({playing:!1,loading:!1}),be.play().catch(()=>$t({loading:!1}))}function Ur(t,a){if(Ea.id===t&&be&&be.duration){const r=Math.max(0,Math.min(1,a));be.currentTime=r*be.duration,$t({currentTime:be.currentTime})}}function f2(){fi(),$t({id:null,playing:!1,loading:!1,currentTime:0,duration:0})}function x2(){return Ea.id}function gi(t){const a=i.useSyncExternalStore(p2,Xn,Xn),r=a.id===t;return{isCurrent:r,playing:r&&a.playing,loading:r&&a.loading,currentTime:r?a.currentTime:0,duration:r?a.duration:0,progress:r&&a.duration?a.currentTime/a.duration:0}}const Qn="#00E5A0",Zn={green:{main:"#00E5A0",grad:"linear-gradient(135deg, rgba(0,229,160,0.10), rgba(0,180,216,0.05))",btn:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"rgba(0,229,160,0.22)",borderOn:"rgba(0,229,160,0.45)",shadow:"0 0 0 1px rgba(0,229,160,0.25), 0 10px 34px -12px rgba(0,229,160,0.45)"},blue:{main:"#00B4D8",grad:"linear-gradient(135deg, rgba(0,180,216,0.13), rgba(0,229,160,0.04))",btn:"linear-gradient(135deg, #00B4D8, #0096c7)",border:"rgba(0,180,216,0.30)",borderOn:"rgba(0,180,216,0.55)",shadow:"0 0 0 1px rgba(0,180,216,0.30), 0 10px 34px -12px rgba(0,180,216,0.45)"}};function eo(t){return t=Math.max(0,Math.round(t||0)),`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`}function to({id:t,url:a,duration:r,label:s="Resumen en audio",subtitle:n="En 1 minuto: qué es, para qué sirve y cómo aplicarla bien.",icon:o=U0,accent:l="green",anchorId:c="tour-audio-player"}){const d=Zn[l]||Zn.green,{playing:u,loading:m,progress:p,currentTime:x,duration:v}=gi(t),f=v||r||0,h=x||0,g=f?Math.min(100,h/f*100):p*100,y=j=>{const F=j.currentTarget.getBoundingClientRect();Ur(t,(j.clientX-F.left)/F.width)};return e.jsx("div",{id:c,className:"rounded-2xl border mb-6",style:{background:d.grad,borderColor:u?d.borderOn:d.border,boxShadow:u?d.shadow:"none",transition:"border-color .3s, box-shadow .3s"},children:e.jsxs("div",{className:"flex items-center gap-4 px-5 py-4",children:[e.jsx("button",{onClick:()=>xi(t,a),"aria-label":u?"Pausar":`Reproducir: ${s}`,className:"flex items-center justify-center rounded-full shrink-0",style:{width:56,height:56,background:d.btn,color:"#06140f",border:"none",cursor:"pointer",boxShadow:`0 6px 18px -6px ${d.main}99`,transition:"transform .15s"},onMouseEnter:j=>j.currentTarget.style.transform="scale(1.06)",onMouseLeave:j=>j.currentTarget.style.transform="scale(1)",children:e.jsx(J,{icon:m?ni:u?pi:li,spin:m,style:{fontSize:20,marginLeft:u||m?0:3}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[e.jsx(J,{icon:o,style:{fontSize:11,color:d.main},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-bold uppercase",style:{color:d.main,letterSpacing:"0.16em",fontFamily:"'JetBrains Mono', monospace"},children:s}),f>0&&e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:["· ",eo(f)]})]}),e.jsx("p",{className:"text-sm mb-2.5",style:{color:"rgba(255,255,255,0.8)"},children:n}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{onClick:y,role:"slider","aria-label":`Progreso: ${s}`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(g),tabIndex:0,onKeyDown:j=>{j.key==="ArrowRight"&&Ur(t,(h+5)/(f||1)),j.key==="ArrowLeft"&&Ur(t,(h-5)/(f||1))},className:"relative flex-1 rounded-full cursor-pointer",style:{height:6,background:"rgba(255,255,255,0.12)"},children:e.jsx("div",{style:{position:"absolute",left:0,top:0,bottom:0,width:`${g}%`,background:d.main,borderRadius:999,transition:u?"width .15s linear":"none"}})}),e.jsx("span",{className:"text-xs shrink-0",style:{color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace",minWidth:38,textAlign:"right"},children:eo(h)})]})]})]})})}function ao({id:t,url:a,size:r=40}){const{playing:s,loading:n,progress:o,isCurrent:l}=gi(t),c=(r-6)/2,d=2*Math.PI*c;return e.jsxs("button",{onClick:u=>{u.stopPropagation(),u.preventDefault(),xi(t,a)},"aria-label":s?"Pausar resumen":"Escuchar resumen",title:"Escuchar resumen (â1 min)",className:"relative flex items-center justify-center rounded-full",style:{width:r,height:r,background:l?"rgba(0,229,160,0.20)":"rgba(0,229,160,0.10)",border:`1px solid ${l?"rgba(0,229,160,0.55)":"rgba(0,229,160,0.28)"}`,color:Qn,cursor:"pointer",backdropFilter:"blur(4px)",transition:"background .2s, border-color .2s, transform .15s"},onMouseEnter:u=>{u.currentTarget.style.background="rgba(0,229,160,0.26)",u.currentTarget.style.transform="scale(1.08)"},onMouseLeave:u=>{u.currentTarget.style.background=l?"rgba(0,229,160,0.20)":"rgba(0,229,160,0.10)",u.currentTarget.style.transform="scale(1)"},children:[l&&e.jsx("svg",{width:r,height:r,style:{position:"absolute",inset:0,transform:"rotate(-90deg)"},"aria-hidden":"true",children:e.jsx("circle",{cx:r/2,cy:r/2,r:c,fill:"none",stroke:Qn,strokeWidth:2,strokeDasharray:d,strokeDashoffset:d*(1-o),strokeLinecap:"round",style:{transition:s?"stroke-dashoffset .15s linear":"none"}})}),e.jsx(J,{icon:n?ni:s?pi:li,spin:n,style:{fontSize:13,marginLeft:s||n?0:2}}
574)]})}const g2={1:"Principiante",2:"Intermedio",3:"Avanzado",4:"MaestrÃa"},ro={1:"#00E5A0",2:"#FFB800",3:"#FF7A45",4:"#FF4757"};function so({difficulty:t}){return t!==4?null:e.jsx("span",{style:{display:"inline-flex",alignItems:"center",fontSize:9,fontWeight:700,fontFamily:"'JetBrains Mono', monospace",color:"#FF4757",background:"rgba(255,71,87,0.12)",border:"1px solid rgba(255,71,87,0.35)",borderRadius:4,padding:"2px 6px",whiteSpace:"nowrap",letterSpacing:"0.08em"},children:"MAESTRÃA"})}function no({bestScore:t}){if(t==null)return null;let a,r,s,n,o;return t>=80?(a="â
",r="ORO",s="#FFB800",n="rgba(255,184,0,0.12)",o="rgba(255,184,0,0.3)"):t>=60?(a="â",r="PLATA",s="rgba(200,200,220,0.9)",n="rgba(200,200,220,0.08)",o="rgba(200,200,220,0.25)"):(a="â",r="BRONCE",s="rgba(205,127,50,0.9)",n="rgba(205,127,50,0.1)",o="rgba(205,127,50,0.3)"),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3,fontSize:10,fontWeight:700,fontFamily:"'JetBrains Mono', monospace",color:s,background:n,border:`1px solid ${o}`,borderRadius:4,padding:"2px 6px",whiteSpace:"nowrap"},"aria-label":`MaestrÃa: ${r}, mejor puntuación ${Math.round(t)}`,children:[a," ",r," · ",Math.round(t)]})}function b2({technique:t,onClick:a,locked:r=!1,bestScore:s=null,style:n={}}){const o=Fr[t.id]??_r,l={background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)",borderRadius:16,padding:24,color:"white",display:"flex",flexDirection:"column"};if(r){const c=t.difficulty-1,d=g2[c]??"anterior";return e.jsxs("div",{"data-testid":"technique-card","aria-label":`Técnica bloqueada: ${t.name}`,title:`Completa todas las técnicas de Nivel ${c} (${d}) para desbloquear`,style:{...l,opacity:.38,cursor:"not-allowed",position:"relative",...n},children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx(J,{icon:o,"aria-hidden":"true",style:{fontSize:22,color:"rgba(255,255,255,0.55)",width:22}}),e.jsx(J,{icon:er,"aria-hidden":"true",style:{fontSize:14,color:"rgba(255,255,255,0.35)"}})]}),e.jsx("h3",{className:"text-lg font-bold mb-1",children:t.name}),e.jsx("span",{className:"text-sm uppercase tracking-widest block mb-3",style:{color:"rgba(0,229,160,0.45)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em"},children:t.category}),e.jsx("p",{className:"text-sm leading-relaxed mb-3",style:{color:"rgba(255,255,255,0.35)",lineHeight:1.5,flex:1},children:t.description}),e.jsxs("span",{className:"text-sm",style:{color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace"},children:["Completa Nivel ",c," para desbloquear"]})]})}return t.image_url?e.jsxs("div",{className:"group transition-all duration-300",style:{position:"relative",display:"flex",borderRadius:16,overflow:"hidden",border:"1px solid rgba(255,255,255,0.12)",background:"#17171F",boxShadow:"0 10px 30px -16px rgba(0,0,0,0.9)",...n},onMouseEnter:c=>{c.currentTarget.style.transform="translateY(-3px)",c.currentTarget.style.borderColor="rgba(0,229,160,0.45)",c.currentTarget.style.boxShadow="0 16px 44px -16px rgba(0,229,160,0.30)"},onMouseLeave:c=>{c.currentTarget.style.transform="translateY(0)",c.currentTarget.style.borderColor="rgba(255,255,255,0.12)",c.currentTarget.style.boxShadow="0 10px 30px -16px rgba(0,0,0,0.9)"},children:[e.jsxs("button",{"data-testid":"technique-card",onClick:a,className:"text-left w-full flex flex-col focus-visible:outline focus-visible:outline-2 focus-visible:outline-neuro-green/60 focus-visible:outline-offset-2",style:{background:"transparent",border:"none",color:"white",cursor:"pointer",padding:0,flex:1},"aria-label":`Seleccionar técnica: ${t.name}`,children:[e.jsxs("div",{style:{position:"relative",aspectRatio:"3 / 2",overflow:"hidden"},children:[e.jsx("img",{src:`${Lt}${t.image_url}`,alt:"","aria-hidden":"true",loading:"lazy",className:"w-full h-full transition-transform duration-500 group-hover:scale-[1.06]",style:{objectFit:"cover",display:"block"}}),e.jsx("div",{style:{position:"absolute",left:0,right:0,bottom:0,height:"45%",background:"linear-gradient(to top, #17171F, rgba(23,23,31,0))"}}),e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-2",children:[e.jsx(so,{difficulty:t.difficulty}),e.jsx(no,{bestScore:s}),e.jsx("div",{className:"flex gap-1 items-center","aria-label":`Dificultad: ${t.difficulty} de 4`,children:[1,2,3,4].map(c=>e.jsx("div",{className:"rounded-full",style:{width:5,height:5,background:c<=t.difficulty?ro[t.difficulty]:"rgba(255,255,255,0.3)",boxShadow:"0 0 4px rgba(0,0,0,0.6)"}},c))})]})]}),e.jsxs("div",{style:{padding:"14px 18px 18px"},className:"flex flex-col",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest block mb-1",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em"},children:t.category}),e.jsx("h3",{className:"text-lg font-bold",style:{lineHeight:1.2},children:t.name})]})]}),t.audio_url&&e.jsx("div",{style:{position:"absolute",right:12,bottom:12,zIndex:2},children:e.jsx(ao,{id:t.id,url:`${Lt}${t.audio_url}`})})]}):e.jsxs("div",{style:{position:"relative",display:"flex",...n},children:[e.jsxs("button",{"data-testid":"technique-card",onClick:a,className:"text-left w-full transition-all duration-300 group focus-visible:outline focus-visible:outline-2 focus-visible:outline-neuro-green/60 focus-visible:outline-offset-2",style:{...l,cursor:"pointer",flex:1},onMouseEnter:c=>{c.currentTarget.style.border="1px solid rgba(0,229,160,0.3)",c.currentTarget.style.background="rgba(0,229,160,0.04)",c.currentTarget.style.transform="translateY(-2px)"},onMouseLeave:c=>{c.currentTarget.style.border="1px solid rgba(255,255,255,0.06)",c.currentTarget.style.background="rgba(255,255,255,0.02)",c.currentTarget.style.transform="translateY(0)"},"aria-label":`Seleccionar técnica: ${t.name}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx(J,{icon:o,"aria-hidden":"true",style:{fontSize:22,color:"rgba(255,255,255,0.55)",width:22}}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex gap-1 items-center","aria-label":`Dificultad: ${t.difficulty} de 4`,children:[1,2,3,4].map(c=>e.jsx("div",{className:"rounded-full",style:{width:5,height:5,background:c<=t.difficulty?ro[t.difficulty]:"rgba(255,255,255,0.1)"}},c))}),e.jsx(so,{difficulty:t.difficulty}),e.jsx(no,{bestScore:s})]})]}),e.jsx("h3",{className:"text-lg font-bold mb-1",children:t.name}),e.jsx("span",{className:"text-xs uppercase tracking-widest block mb-3",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em"},children:t.category}),e.jsx("p",{className:"text-sm leading-relaxed mb-3",style:{color:"rgba(255,255,255,0.65)",lineHeight:1.5,flex:1},children:t.description}),t.scripts&&t.scripts.length>0&&e.jsxs("span",{className:"text-sm",style:{color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:[t.scripts.length," scripts"]})]}),t.audio_url&&e.jsx("div",{style:{position:"absolute",right:14,bottom:14,zIndex:2},children:e.jsx(ao,{id:t.id,url:`${Lt}${t.audio_url}`})})]})}function h2(t){const a=new Set,r=[];for(const s of t)a.has(s.category)||(a.add(s.category),r.push(s.category));return r}function y2({technique:t,onUpgrade:a,style:r={},id:s}){const n=Fr[t.id]??_r;return e.jsxs("div",{id:s,"data-testid":"technique-card","aria-label":`Técnica Premium: ${t.name}`,style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,184,0,0.15)",borderRadius:16,padding:24,color:"white",opacity:.75,position:"relative",display:"flex",flexDirection:"column",...r},children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsx(J,{icon:n,"aria-hidden":"true",style:{fontSize:22,color:"rgba(255,255,255,0.25)",width:22,filter:"blur(3px)"}}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{icon:_a,style:{color:"#FFB800",fontSize:12},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-bold",style:{color:"#FFB800",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.05em"},children:"PREMIUM"})]})]}),e.jsx("h3",{className:"text-lg font-bold mb-1",style:{filter:"blur(5px)",userSelect:"none",pointerEvents:"none"},"aria-hidden":"true",children:t.name}),e.jsx("span",{className:"text-xs uppercase tracking-widest block mb-3",style:{color:"rgba(0,229,160,0.35)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em",filter:"blur(4px)",userSelect:"none",pointerEvents:"none"},"aria-hidden":"true",children:t.category}),e.jsx("p",{className:"text-sm leading-relaxed mb-4",style:{color:"rgba(255,255,255,0.55)",lineHeight:1.5,filter:"blur(4px)",userSelect:"none",pointerEvents:"none",flex:1},"aria-hidden":"true",children:t.description}),e.jsxs("button",{onClick:a,className:"flex items-center gap-2 w-full py-2.5 rounded-xl text-xs font-bold justify-center transition-all duration-200",style:{background:"rgba(255,184,0,0.09)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",cursor:"pointer",marginTop:"auto"},onMouseEnter:o=>{o.currentTarget.style.background="rgba(255,184,0,0.16)"},onMouseLeave:o=>{o.currentTarget.style.background="rgba(255,184,0,0.09)"},"aria-label":"Desbloquear técnica Premium",children:[e.jsx(J,{icon:er,style:{fontSize:11},"aria-hidden":"true"}),"Desbloquear"]})]})}function v2(){var N;const t=he(),a=Ct(),{isAuthenticated:r,user:s}=i.useContext(Bt),{techniques:n,loading:o}=Ut(),[l,c]=i.useState("Todas"),[d,u]=i.useState(""),[m,p]=i.useState(null),[x,v]=i.useState(null);i.useEffect(()=>{r&&(R.get("/api/progress").then(p).catch(()=>{}),R.get("/api/billing/access").then(v).catch(()=>{}))},[r,a.key]);const f=(s==null?void 0:s.role)==="admin",h=f?4:(m==null?void 0:m.max_unlocked_level)??1,g=f?4:(x==null?void 0:x.max_difficulty)??1,y=(x==null?void 0:x.is_premium)??!1,j=i.useMemo(()=>["Todas",...h2(n)],[n]),F=i.useMemo(()=>{let b=n;if(l!=="Todas"&&(b=b.filter(w=>w.category===l)),d.trim()){const w=d.toLowerCase().trim();b=b.filter(L=>L.name.toLowerCase().includes(w)||L.description.toLowerCase().includes(w)||L.category.toLowerCase().includes(w))}return[...b].sort((w,L)=>w.difficulty-L.difficulty||(w.sort_order??0)-(L.sort_order??0))},[l,d,n]),C=(N=F.find(b=>b.difficulty>g))==null?void 0:N.id;return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"text-center mb-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsx("h2",{className:"text-3xl sm:text-4xl font-bold tracking-tight mb-3",style:{fontFamily:"'Playfair Display', serif"},children:"Selecciona tu técnica"}),e.jsxs("p",{className:"text-sm sm:text-base mb-6",style:{color:"rgba(255,255,255,0.65)"},children:[o?"â¦":n.length," técnicas de PNL para dominar la persuasión"]}),e.jsx("div",{className:"max-w-md mx-auto mb-6",children:e.jsx("input",{type:"text",placeholder:"Buscar técnica...",value:d,onChange:b=>u(b.target.value),className:"w-full rounded-xl px-4 py-3 text-sm",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"white",outline:"none"},onFocus:b=>{b.target.style.borderColor="rgba(0,229,160,0.4)"},onBlur:b=>{b.target.style.borderColor="rgba(255,255,255,0.08)"}})}),e.jsx("div",{className:"flex flex-wrap justify-center gap-2",children:j.map(b=>e.jsxs("button",{onClick:()=>c(b),className:"px-4 py-1.5 rounded-full text-xs font-medium transition-all duration-200",style:{background:l===b?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.04)",border:`1px solid ${l===b?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.08)"}`,color:l===b?"#00E5A0":"rgba(255,255,255,0.5)",cursor:"pointer"},children:[b,b!=="Todas"&&e.jsx("span",{style:{opacity:.5,marginLeft:4},children:n.filter(w=>w.category===b).length})]},b))})]}),r&&x&&!y&&!f&&e.jsxs("div",{"data-testid":"premium-banner",className:"rounded-2xl border px-5 py-4 mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",style:{background:"rgba(255,184,0,0.04)",borderColor:"rgba(255,184,0,0.12)",animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:["Estás en el plan"," ",e.jsx("span",{className:"font-semibold text-white",children:"Gratuito"}),". Tienes acceso a"," ",e.jsxs("span",{className:"font-semibold",style:{color:"#00E5A0"},children:[n.filter(b=>b.difficulty<=g).length," técnicas"]}),". Activa Premium para acceder a las"," ",e.jsxs("span",{className:"font-semibold text-white",children:[n.length," técnicas"]}),"."]}),e.jsx("button",{onClick:()=>t("/billing"),className:"flex-shrink-0 text-xs font-bold px-4 py-2 rounded-xl transition-all duration-200",style:{background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",cursor:"pointer",whiteSpace:"nowrap"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(255,184,0,0.18)"},onMouseLeave:b=>{b.currentTarget.style.background="rgba(255,184,0,0.1)"},children:"Activar Premium"})]}),r&&m&&h<4&&e.jsxs("div",{id:"tour-level-lock","data-testid":"progress-banner",className:"rounded-2xl border px-5 py-4 mb-8",style:{background:"rgba(0,229,160,0.04)",borderColor:"rgba(0,229,160,0.12)",animation:"fadeSlideUp 0.4s both"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.6)"},children:"Tu progreso"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.7)"},children:"Nivel 1 · Principiante"}),e.jsxs("span",{className:"text-xs font-mono",style:{color:h>=2?"#00E5A0":"rgba(255,255,255,0.5)"},children:[m.level1_practiced,"/",m.level1_total]})]}),e.jsx("div",{className:"rounded-full overflow-hidden",style:{height:4,background:"rgba(255,255,255,0.07)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.round(m.level1_practiced/m.level1_total*100)}%`,background:h>=2?"#00E5A0":"rgba(0,229,160,0.7)"}})})]}),h>=2&&e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.7)"},children:"Nivel 2 · Intermedio"}),e.jsxs("span",{className:"text-xs font-mono",style:{color:h>=3?"#00E5A0":"rgba(255,255,255,0.5)"},children:[m.level2_practiced,"/",m.level2_total]})]}),e.jsx("div",{className:"rounded-full overflow-hidden",style:{height:4,background:"rgba(255,255,255,0.07)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.round(m.level2_practiced/m.level2_total*100)}%`,background:h>=3?"#00E5A0":"rgba(0,229,160,0.7)"}})})]}),h>=3&&e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex justify-between items-center mb-1.5",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.7)"},children:"Nivel 3 · Avanzado"}),e.jsxs("span",{className:"text-xs font-mono",style:{color:h>=4?"#FF4757":"rgba(255,255,255,0.5)"},children:[m.level3_practiced,"/",m.level3_total||0]})]}),e.jsx("div",{className:"rounded-full overflow-hidden",style:{height:4,background:"rgba(255,255,255,0.07)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${m.level3_total?Math.round(m.level3_practiced/m.level3_total*100):0}
574%`,background:h>=4?"#FF4757":"rgba(0,229,160,0.7)"}})})]})]})]}),F.length===0?e.jsx("div",{className:"text-center py-16",children:e.jsx("p",{style:{color:"rgba(255,255,255,0.65)"},children:"No se encontraron técnicas con ese criterio."})}):e.jsx("div",{id:"tour-technique-grid",className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:F.map((b,w)=>{var S;const L=b.difficulty>g,z=!L&&b.difficulty>h,A={animation:`fadeSlideUp 0.5s ${w*.05}s both`};return L?e.jsx(y2,{technique:b,onUpgrade:()=>t("/billing"),style:A,id:b.id===C?"tour-premium-lock":void 0},b.id):e.jsx(b2,{technique:b,locked:z,bestScore:z?null:((S=m==null?void 0:m.technique_bests)==null?void 0:S[b.id])??null,onClick:z?void 0:()=>t(`/prepare/${b.id}`),style:A},b.id)})}),e.jsxs("div",{className:"mt-10 flex flex-col items-center gap-4",style:{animation:"fadeSlideUp 0.5s 0.5s both"},children:[e.jsx("div",{className:"flex items-center justify-center gap-5 flex-wrap",children:[{lvl:1,label:"Principiante",accent:"#00E5A0"},{lvl:2,label:"Intermedio",accent:"#FFB800"},{lvl:3,label:"Avanzado",accent:"#FF7A45"},{lvl:4,label:"MaestrÃa",accent:"#FF4757"}].map(({lvl:b,label:w,accent:L})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4].map(z=>e.jsx("div",{className:"rounded-full",style:{width:6,height:6,background:z<=b?L:"rgba(255,255,255,0.1)"}},z))}),e.jsx("span",{className:"text-xs",style:{color:b===4?"rgba(255,71,87,0.85)":"rgba(255,255,255,0.55)"},children:w})]},b))}),e.jsxs("div",{className:"flex items-center gap-4 flex-wrap justify-center px-4 py-2.5 rounded-xl",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsx("div",{className:"rounded-full",style:{width:6,height:6,background:"#00E5A0"}}),[2,3,4].map(b=>e.jsx("div",{className:"rounded-full",style:{width:6,height:6,background:"rgba(255,255,255,0.1)"}},b))]}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:"Gratuito: solo Nivel 1"})]}),e.jsx("div",{className:"w-px h-3",style:{background:"rgba(255,255,255,0.08)"}}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{icon:_a,style:{color:"#FFB800",fontSize:10},"aria-hidden":"true"}),e.jsx("div",{className:"flex gap-1",children:[{d:1,c:"#00E5A0"},{d:2,c:"#FFB800"},{d:3,c:"#FF7A45"},{d:4,c:"#FF4757"}].map(({d:b,c:w})=>e.jsx("div",{className:"rounded-full",style:{width:6,height:6,background:w}},b))}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:"Premium: todos los niveles e IA"})]})]})]})]})}function Ia(t){const r=t.replace(/([^\n])(\[BAJAR TONO[^\]]*\]\s*"[^"]*")/g,`$1 575$2`).replace(/(\[BAJAR TONO[^\]]*\]\s*"[^"]*")([^\n])/g,`$1 576$2`).replace(/([^\n])(\[PAUSA\s+[\d.]+s\])/g,`$1 577$2`).replace(/(\[PAUSA\s+[\d.]+s\])([^\n])/g,`$1 578$2`).replace(/\n{3,}/g,` 579 580`).split(` 581`).map(c=>c.trimEnd()).join(` 582`).trim().split(` 583`),s=[];let n=0;for(;n<r.length;){const d=r[n].trim().match(/^(\[BAJAR TONO[^\]]*\]\s*)"(.*)$/);if(d){const u=d[1];let m=d[2];if(m.endsWith('"')&&m.length>0){s.push(r[n]),n++;continue}for(n++;n<r.length;){const x=r[n].trim();if(x==='"'){n++;break}if(x.endsWith('"')){m+=(m?" ":"")+x,n++;break}m+=(m?" ":"")+x,n++}const p=m.replace(/^"+|"+$/g,"");s.push(`${u}"${p}"`)}else s.push(r[n]),n++}const o=/^\[PAUSA\s+([\d.]+)s\]$/,l=[];for(const c of s){const d=c.trim().match(o);if(d){let u=l.length-1;for(;u>=0&&l[u].trim()==="";)u--;if(u>=0){const m=l[u].trim().match(o);if(m){const p=Math.max(parseFloat(d[1]),parseFloat(m[1])),x=Number.isInteger(p)?`${p}s`:`${p}s`;l.splice(u,l.length-u,`[PAUSA ${x}]`);continue}}}l.push(c)}return l.join(` 584`)}const Ga=[{bg:"rgba(0,180,216,0.18)",border:"rgba(0,180,216,0.35)",color:"#00B4D8",underline:"#00B4D8"},{bg:"rgba(0,229,160,0.15)",border:"rgba(0,229,160,0.3)",color:"#00E5A0",underline:"#00E5A0"},{bg:"rgba(255,184,0,0.18)",border:"rgba(255,184,0,0.35)",color:"#FFB800",underline:"#FFB800"},{bg:"rgba(155,89,182,0.18)",border:"rgba(155,89,182,0.35)",color:"#BF7FE8",underline:"#BF7FE8"},{bg:"rgba(255,71,87,0.15)",border:"rgba(255,71,87,0.3)",color:"#FF4757",underline:"#FF4757"},{bg:"rgba(255,140,0,0.18)",border:"rgba(255,140,0,0.35)",color:"#FF8C00",underline:"#FF8C00"},{bg:"rgba(52,211,153,0.18)",border:"rgba(52,211,153,0.35)",color:"#34D399",underline:"#34D399"},{bg:"rgba(99,179,237,0.18)",border:"rgba(99,179,237,0.35)",color:"#63B3ED",underline:"#63B3ED"}];function bi(t){const a={};let r=0;for(const s of t)s.label&&!(s.label in a)&&(a[s.label]=Ga[r%Ga.length],r++);return a}function Wr({text:t,annotations:a,labelColors:r}){if(!a.length)return e.jsx(e.Fragment,{children:t});const s=d=>d.replace(/^[.â¦]+\s*/,"").replace(/\s*(\.{2,}|â¦)$/,"").trim(),n=t.toLowerCase(),o=[...a].map(d=>({...d,phrase:s(d.phrase||"")})).filter(d=>d.phrase&&n.includes(d.phrase.toLowerCase())).sort((d,u)=>u.phrase.length-d.phrase.length);if(!o.length)return e.jsx(e.Fragment,{children:t});let l=t;const c=[];for(;l.length>0;){let d=!1;for(const u of o){const m=l.toLowerCase().indexOf(u.phrase.toLowerCase());if(m===0){c.push({text:l.slice(0,u.phrase.length),annotation:u}),l=l.slice(u.phrase.length),d=!0;break}else if(m>0){c.push({text:l.slice(0,m),annotation:null}),c.push({text:l.slice(m,m+u.phrase.length),annotation:u}),l=l.slice(m+u.phrase.length),d=!0;break}}if(!d){c.push({text:l,annotation:null});break}}return e.jsx(e.Fragment,{children:c.map((d,u)=>{if(!d.annotation)return e.jsx("span",{children:d.text},u);const m=r[d.annotation.label]||Ga[0];return e.jsx("span",{title:`[${d.annotation.label}
584] ${d.annotation.explanation}`,style:{borderBottom:`2px solid ${m.underline}`,paddingBottom:1,cursor:"help",color:"inherit"},children:d.text},u)})})}function Js({annotations:t}){if(!t||t.length===0)return null;const a=bi(t),r=new Set,s=[];for(const n of t)r.has(n.label)||(r.add(n.label),s.push(n));return e.jsxs("div",{className:"mt-3 rounded-xl border px-3 py-2.5",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest mb-2",style:{color:"rgba(255,255,255,0.45)"},children:"Elementos de técnica identificados"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map((n,o)=>{const l=a[n.label]||Ga[0];return e.jsxs("span",{title:n.explanation,style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,fontWeight:600,fontFamily:"'JetBrains Mono', monospace",background:l.bg,border:`1px solid ${l.border}`,color:l.color,borderRadius:5,padding:"2px 8px",cursor:"help",whiteSpace:"nowrap"},children:[e.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:l.underline,display:"inline-block",flexShrink:0}}),n.label]},o)})})]})}function Xt({script:t,defaultExpanded:a=!1,annotations:r=[]}){const[s,n]=i.useState(a),o=bi(r),l=(u,m)=>{const p=u.trim();if(!p)return null;if(p.startsWith("[PAUSA"))return e.jsx("div",{style:{color:"#FFB800",fontSize:13,fontFamily:"'JetBrains Mono', monospace",padding:"4px 0",opacity:.7},children:p},m);if(p.startsWith("[BAJAR TONO")){const x=p.match(/^(\[BAJAR TONO[^\]]*\]\s*)"(.+)"?\s*$/);if(x){const v=`${x[1]}`,f=x[2].replace(/"+$/,""),h=f.toLowerCase(),g=r.length>0?r.find(j=>{const F=(j.phrase||"").replace(/^[.â¦]+\s*/,"").replace(/\s*(\.{2,}|â¦)$/,"").trim();return F&&h.includes(F.toLowerCase())}):null,y=g?o[g.label]||Ga[0]:null;return e.jsxs("div",{style:{padding:"4px 0",fontFamily:"'JetBrains Mono', monospace",fontSize:13},children:[e.jsx("span",{style:{color:"#FF4757"},children:v}),e.jsx("span",{title:g?`[${g.label}] ${g.explanation||""}`:void 0,style:{color:"#00E5A0",fontWeight:700,fontSize:13,borderLeft:"2px solid #00E5A0",paddingLeft:8,marginLeft:4,...y?{borderBottom:`2px solid ${y.underline}`,paddingBottom:1,cursor:"help"}:{}},children:`"${f}"`})]},m)}return e.jsx("div",{style:{color:"#FF4757",fontSize:13,fontFamily:"'JetBrains Mono', monospace",padding:"4px 0"},children:p},m)}return p.startsWith("[NOTA")||p.startsWith("[FASE")||p.startsWith("[VISUAL")||p.startsWith("[AUDITIVO")||p.startsWith("[CINESTÃSICO")?e.jsx("div",{style:{color:"#00B4D8",fontSize:14,fontStyle:"italic",lineHeight:1.6,padding:"3px 0 3px 10px",borderLeft:"2px solid rgba(0,180,216,0.35)",opacity:.85},title:"Nota interna: no leer en voz alta",children:r.length>0?e.jsx(Wr,{text:p,annotations:r,labelColors:o}):p},m):p.startsWith("(")&&p.endsWith(")")?e.jsx("div",{style:{color:"rgba(255,255,255,0.38)",fontSize:14,fontStyle:"italic",lineHeight:1.6,padding:"2px 0 2px 10px",borderLeft:"2px solid rgba(255,255,255,0.1)"},children:r.length>0?e.jsx(Wr,{text:p,annotations:r,labelColors:o}):p},m):e.jsx("div",{style:{color:"rgba(255,255,255,0.88)",fontSize:14,lineHeight:1.7,padding:"1px 0"},children:r.length>0?e.jsx(Wr,{text:p,annotations:r,labelColors:o}):p},m)},d=Ia(t).split(` 585`);return e.jsxs("div",{className:"rounded-xl border",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:20},children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Script Base"}),e.jsx("button",{onClick:()=>n(u=>!u),className:"text-xs transition-colors duration-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-neuro-green/60 focus-visible:outline-offset-2 rounded",style:{background:"none",border:"none",color:"#00E5A0",cursor:"pointer"},"aria-expanded":s,"aria-label":s?"Contraer script":"Expandir script",children:s?"Contraer":"Expandir"})]}),e.jsxs("div",{style:{maxHeight:s?"none":200,overflow:"hidden",position:"relative"},children:[d.map((u,m)=>l(u,m)),!s&&e.jsx("div",{style:{position:"absolute",bottom:0,left:0,right:0,height:60,background:"linear-gradient(transparent, #0A0A0F)",pointerEvents:"none"}})]}),!s&&e.jsx("button",{onClick:()=>n(!0),className:"mt-3 text-xs w-full text-center transition-colors duration-200",style:{background:"none",border:"none",color:"rgba(255,255,255,0.55)",cursor:"pointer"},"aria-label":"Ver script completo",children:"Ver script completo"}),e.jsx(Js,{annotations:r})]})}const Hr="rgba(255,255,255,0.75)",j2="#00E5A0";function Vr(t){return t.split(/(\*\*[^*]+\*\*)/).map((r,s)=>r.startsWith("**")&&r.endsWith("**")?e.jsx("strong",{style:{fontWeight:700,color:"rgba(255,255,255,0.92)"},children:r.slice(2,-2)},s):r||null)}function N2({text:t}){if(!t)return null;const a=t.split(` 586`),r=[];let s=0,n=0;for(;s<a.length;){const o=a[s].trim();if(!o){s++;continue}if(/^[-â¢]\s/.test(o)){const c=[];for(;s<a.length&&/^[-â¢]\s/.test(a[s].trim());)c.push(a[s].trim().replace(/^[-â¢]\s*/,"")),s++;r.push(e.jsx("ul",{style:{margin:"8px 0",padding:0,listStyle:"none"},children:c.map((d,u)=>e.jsxs("li",{style:{display:"flex",gap:8,marginBottom:6,color:Hr,fontSize:14,lineHeight:1.65},children:[e.jsx("span",{style:{color:j2,flexShrink:0,marginTop:2},children:"â¢"}),e.jsx("span",{children:Vr(d)})]},u))},n++));continue}if(/^\d+\.\s/.test(o)){const c=[];for(;s<a.length;){const d=a[s].trim();if(/^\d+\.\s/.test(d)){for(c.push(d.replace(/^\d+\.\s*/,"")),s++;s<a.length&&!a[s].trim();)s++;if(s<a.length&&!/^\d+\.\s/.test(a[s].trim()))break}else break}r.push(e.jsx("ol",{style:{margin:"8px 0",paddingLeft:22,listStyleType:"decimal"},children:c.map((d,u)=>e.jsx("li",{style:{marginBottom:8,color:Hr,fontSize:14,lineHeight:1.65,paddingLeft:4},children:Vr(d)},u))},n++));continue}const l=[];for(;s<a.length&&a[s].trim()&&!/^[-â¢]\s/.test(a[s].trim())&&!/^\d+\.\s/.test(a[s].trim());)l.push(a[s].trim()),s++;l.length&&r.push(e.jsx("p",{style:{margin:"6px 0",color:Hr,fontSize:14,lineHeight:1.7},children:Vr(l.join(" "))},n++))}return e.jsx("div",{children:r})}function w2(){const{id:t}=da(),a=he(),{user:r}=i.useContext(Bt),{getTechniqueById:s,loading:n}=Ut(),o=s(t),[l,c]=i.useState(0),[d,u]=i.useState(!1),[m,p]=i.useState(null),[x,v]=i.useState(!0);if(i.useEffect(()=>{t&&(v(!0),R.get(`/api/techniques/${t}`).then(N=>{var b;((b=N==null?void 0:N.scripts)==null?void 0:b.length)>0&&p(N.scripts)}).catch(()=>{}).finally(()=>v(!1)))},[t]),i.useEffect(()=>{const N=x2();N&&N.startsWith("script-")&&f2()},[l]),n)return e.jsx("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[...Array(6)].map((N,b)=>e.jsx("div",{className:"rounded mb-4",style:{height:b===0?32:16,width:`${40+Math.random()*55}%`,background:"rgba(255,255,255,0.06)",animation:"pulse 1.5s ease-in-out infinite"}},b))});if(!o)return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-4",style:{color:"rgba(255,255,255,0.6)"},children:"Técnica no encontrada"}),e.jsx("button",{onClick:()=>a("/"),className:"text-sm px-6 py-2 rounded-xl font-medium",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",cursor:"pointer"},children:"Volver a técnicas"})]});const f=m||o.scripts||[],h=f[l]||null,g=(h==null?void 0:h.scenario)||o.scenario,y=(h==null?void 0:h.script)||o.script,j=(h==null?void 0:h.commands)||o.commands||[],F=(h==null?void 0:h.id)||`${o.id}-01`,C=(r==null?void 0:r.role)==="admin";return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsxs("button",{onClick:()=>a("/"),className:"flex items-center gap-2 text-sm mb-8 transition-colors duration-200",style:{background:"none",border:"none",color:"rgba(255,255,255,0.65)",cursor:"pointer",padding:0},onMouseEnter:N=>N.currentTarget.style.color="white",onMouseLeave:N=>N.currentTarget.style.color="rgba(255,255,255,0.65)","aria-label":"Volver a selección de técnicas",children:[e.jsx("span",{"aria-hidden":"true",children:"â"})," Volver"]}),e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx(J,{icon:Fr[o.id]??_r,"aria-hidden":"true",style:{fontSize:32,color:"rgba(255,255,255,0.55)",width:32}}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold",children:o.name}),e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.12em"},children:o.category})]}),e.jsx("div",{className:"ml-auto flex gap-1 items-center","aria-label":`Dificultad: ${o.difficulty} de 4`,children:[1,2,3,4].map(N=>e.jsx("div",{className:"rounded-full",style:{width:8,height:8,background:N<=o.difficulty?{1:"#00E5A0",2:"#FFB800",3:"#FF7A45",4:"#FF4757"}[o.difficulty]||"#00E5A0":"rgba(255,255,255,0.1)"}},N))})]}),e.jsx("p",{className:"text-sm leading-relaxed mb-6",style:{color:"rgba(255,255,255,0.75)"},children:o.description}),o.audio_url&&e.jsx(to,{id:o.id,url:`${Lt}${o.audio_url}`,duration:o.audio_duration}),o.theory&&e.jsxs("div",{id:"tour-theory-section",className:"rounded-xl border mb-6",style:{background:"rgba(0,180,216,0.03)",borderColor:"rgba(0,180,216,0.1)"},children:[e.jsxs("button",{onClick:()=>u(!d),className:"w-full flex items-center justify-between px-5 py-4",style:{background:"none",border:"none",cursor:"pointer",color:"white"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest",style:{color:"#00B4D8",letterSpacing:"0.15em"},children:"TeorÃa y fundamentos"}),e.jsx("span",{className:"text-xs",style:{color:"#00B4D8",transition:"transform 0.2s"},children:d?"â²":"â¼"})]}),d&&e.jsxs("div",{className:"px-5 pb-4",children:[e.jsx(N2,{text:o.theory}),o.tips&&o.tips.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("h5",{className:"text-xs uppercase tracking-widest mb-2",style:{color:"#00B4D8",letterSpacing:"0.12em"},children:"Consejos prácticos"}),e.jsx("ul",{className:"space-y-1.5",children:o.tips.map((N,b)=>e.jsxs("li",{className:"text-sm flex gap-2",style:{color:"rgba(255,255,255,0.75)"},children:[e.jsx("span",{style:{color:"#00E5A0",flexShrink:0},children:"â¢"}),N]},b))})]})]})]}),f.length>1&&e.jsxs("div",{className:"mb-6",children:[e.jsxs("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:["Elige un script para practicar (",f.length," disponibles)"]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:f.map((N,b)=>e.jsxs("button",{onClick:()=>c(b),className:"px-4 py-2 rounded-xl text-sm transition-all duration-200 text-left",style:{background:l===b?"rgba(0,229,160,0.1)":"rgba(255,255,255,0.03)",border:`1px solid ${l===b?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.06)"}`,color:l===b?"#00E5A0":"rgba(255,255,255,0.5)",cursor:"pointer"},children:[e.jsx("span",{className:"text-xs font-mono",style:{opacity:.5,marginRight:6},children:String(b+1).padStart(2,"0")}),N.title]},N.id))})]}),(h==null?void 0:h.audio_url)&&e.jsx(to,{id:`script-${o.id}-${l}`,url:`${Lt}${h.audio_url}`,duration:h.audio_duration,label:"Cómo se ejecuta este script",subtitle:"Escucha la ejecución correcta: ritmo, pausas y bajada de tono en los comandos.",icon:g0,accent:"blue",anchorId:"tour-script-audio"}),g&&e.jsxs("div",{className:"rounded-xl border mb-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:"20px 24px"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Escenario"}),e.jsxs("p",{className:"text-sm leading-relaxed mb-3",style:{color:"rgba(255,255,255,0.8)"},children:[e.jsxs("strong",{style:{color:"rgba(255,255,255,0.95)"},children:["Cliente:"," "]}),g.client]}),e.jsxs("p",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.8)"},children:[e.jsxs("strong",{style:{color:"rgba(255,255,255,0.95)"},children:["Objetivo:"," "]}),g.objective]})]}),j.length>0&&e.jsxs("div",{className:"rounded-xl border mb-4",style:{background:"rgba(0,229,160,0.03)",borderColor:"rgba(0,229,160,0.1)",padding:"16px 20px"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"#00E5A0",letterSpacing:"0.15em"},children:"Comandos encubiertos clave"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:j.map((N,b)=>e.jsxs("span",{className:"text-xs px-3 py-1 rounded-full",style:{background:"rgba(0,229,160,0.1)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:["â",N,"â"]},b))})]}),e.jsx("div",{id:"tour-script-viewer",className:"mb-6",children:x?e.jsx("div",{className:"rounded-xl border px-6 py-8",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[...Array(6)].map((N,b)=>e.jsx("div",{className:"rounded mb-3",style:{height:14,width:`${60+Math.random()*35}%`,background:"rgba(255,255,255,0.06)",animation:"pulse 1.5s ease-in-out infinite"}},b))}):y&&e.jsx(Xt,{script:y,annotations:(h==null?void 0:h.technique_annotations)||[]})}),C&&!x&&e.jsx("div",{className:"mb-6 flex justify-end",children:e.jsxs("button",{onClick:()=>a(`/admin/enhance/${o.id}/${l}`),className:"flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium transition-all duration-200",style:{background:"rgba(255,184,0,0.08)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",cursor:"pointer"},onMouseEnter:N=>{N.currentTarget.style.background="rgba(255,184,0,0.15)",N.currentTarget.style.borderColor="rgba(255,184,0,0.4)"},onMouseLeave:N=>{N.currentTarget.style.background="rgba(255,184,0,0.08)",N.currentTarget.style.borderColor="rgba(255,184,0,0.25)"},children:[e.jsx(J,{icon:F0,style:{fontSize:12}}),"Mejorar guión"]})}),e.jsx("div",{className:"rounded-xl border mb-8 px-5 py-4",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.04)"},children:e.jsxs("p",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.7)"},children:[e.jsxs("strong",{style:{color:"rgba(255,255,255,0.85)"},children:["Recuerda:"," "]}),o.description," No tienes que leer el script literalmente; internaliza la estructura y el propósito de cada parte."]})}),e.jsx("div",{id:"tour-record-btn",className:"flex justify-center",children:e.jsx("button",{onClick:()=>a(`/record/${o.id}`,{state:{scriptIndex:l,scriptId:F}}),className:"px-8 py-4 rounded-xl font-bold text-sm transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:"pointer"},onMouseEnter:N=>{N.currentTarget.style.transform="scale(1.03)",N.currentTarget.style.boxShadow="0 8px 30px rgba(0,229,160,0.3)"},onMouseLeave:N=>{N.currentTarget.style.transform="scale(1)",N.currentTarget.style.boxShadow="none"},children:"Estoy listo, ir a grabar â"})})]})}function hi({hqMic:t=!1}={}){const[a,r]=i.useState(!1),[s,n]=i.useState(0),[o,l]=i.useState(null),[c,d]=i.useState(null),u=i.useRef(null),m=i.useRef(null),p=i.useRef(null),x=i.useRef(null),v=i.useRef(null),f=i.useRef([]),h=i.useRef(null),g=i.useCallback(()=>{v.current&&(clearInterval(v.current),v.current=null),m.current&&(m.current.getTracks().forEac
586h(C=>C.stop()),m.current=null),p.current&&(p.current.close().catch(()=>{}),p.current=null),x.current=null,u.current=null},[]);i.useEffect(()=>()=>{g()},[g]);const y=i.useCallback(async()=>{d(null),l(null),f.current=[];try{const C=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!t,noiseSuppression:!t,autoGainControl:!1,sampleRate:48e3,channelCount:1}});m.current=C;const N=window.AudioContext||window.webkitAudioContext,b=new N;p.current=b;const w=b.createMediaStreamSource(C),L=b.createAnalyser();L.fftSize=2048;let z=C;if(t){const _=b.createGain();_.gain.value=2.5;const D=b.createMediaStreamDestination();w.connect(_),_.connect(L),_.connect(D),z=D.stream}else w.connect(L);x.current=L;const A=k2(),S=new MediaRecorder(z,{...A?{mimeType:A}:{},audioBitsPerSecond:128e3});u.current=S,S.ondataavailable=_=>{_.data&&_.data.size>0&&f.current.push(_.data)},S.onstop=()=>{const _=new Blob(f.current,{type:A||"audio/webm"});l(_),h.current&&(h.current(_),h.current=null)},S.start(100),r(!0),n(0),v.current=setInterval(()=>{n(_=>_+1)},1e3)}catch(C){const N=C.name==="NotAllowedError"?"Se necesita permiso de micrófono para grabar. ActÃvalo en la configuración del navegador.":C.name==="NotFoundError"?"No se ha encontrado ningún micrófono. Conecta uno e inténtalo de nuevo.":"No se pudo acceder al micrófono: "+C.message;d(N),g()}},[g]),j=i.useCallback(()=>new Promise(C=>{if(!u.current||u.current.state==="inactive"){C(null);return}h.current=C,clearInterval(v.current),v.current=null,r(!1),u.current.stop(),m.current&&m.current.getTracks().forEach(N=>N.stop()),setTimeout(()=>{p.current&&(p.current.close().catch(()=>{}),p.current=null)},300)}),[]),F=i.useCallback(()=>{g(),r(!1),n(0),l(null),d(null),f.current=[]},[g]);return{isRecording:a,recordingTime:s,analyserRef:x,audioBlob:o,error:c,startRecording:y,stopRecording:j,resetRecorder:F}}function k2(){const t=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/mp4"];for(const a of t)if(MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported(a))return a;return null}function Ys({isRecording:t,analyserRef:a}){const r=i.useRef(null),s=i.useRef(null);return i.useEffect(()=>{const n=r.current;if(!n)return;const o=n.getContext("2d"),l=()=>{const c=n.width,d=n.height;if(o.clearRect(0,0,c,d),t&&a.current){const u=a.current,m=u.frequencyBinCount,p=new Uint8Array(m);u.getByteTimeDomainData(p),o.beginPath(),o.strokeStyle="#00E5A0",o.lineWidth=2;const x=c/m;let v=0;for(let f=0;f<m;f++){const g=p[f]/128*d/2;f===0?o.moveTo(v,g):o.lineTo(v,g),v+=x}o.lineTo(c,d/2),o.stroke()}else{o.beginPath(),o.strokeStyle="rgba(255,255,255,0.08)",o.lineWidth=1,o.moveTo(0,d/2);for(let u=0;u<c;u++)o.lineTo(u,d/2+Math.sin(u*.03+Date.now()*.001)*3);o.stroke()}s.current=requestAnimationFrame(l)};return l(),()=>{s.current&&cancelAnimationFrame(s.current)}},[t,a]),e.jsx("canvas",{ref:r,width:600,height:60,className:"w-full rounded-lg",style:{height:60},"aria-label":t?"Onda de audio en tiempo real":"Visualizador de audio en espera"})}function ca(t){if(!t&&t!==0)return"0:00";const a=Math.floor(t/60),r=Math.floor(t%60);return`${a}:${String(r).padStart(2,"0")}`}function Ks(){const{user:t,loading:a}=Ge(),r=he(),s=Ct(),n=!a&&t!=null&&t.voice_consent_ok===!1;return i.useEffect(()=>{n&&r("/voice-consent",{state:{from:s.pathname+s.search},replace:!0})},[n,r,s.pathname,s.search]),!n}function yi({message:t,onRetry:a,disabled:r=!1}){return e.jsxs("div",{className:"rounded-xl border px-5 py-4 mb-6 text-sm text-center",style:{background:"rgba(255,184,0,0.07)",borderColor:"rgba(255,184,0,0.3)",color:"rgba(255,255,255,0.85)"},role:"alert","data-testid":"no-speech-notice",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2 mb-1 font-semibold",style:{color:"#FFB800"},children:[e.jsx(J,{icon:r0,"aria-hidden":"true"}),"No se ha detectado voz"]}),e.jsx("p",{className:"mb-4",style:{color:"rgba(255,255,255,0.65)"},children:t}),e.jsx("button",{type:"button",onClick:a,disabled:r,className:"px-5 py-2 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"#FFB800",color:"#0A0A0F",border:"none",cursor:r?"not-allowed":"pointer",opacity:r?.6:1},children:"Volver a grabar"})]})}const oa="NO_SPEECH_DETECTED",S2="Error al enviar la grabación. Por favor inténtalo de nuevo.";function Xs(t){var r;const a=(r=t==null?void 0:t.data)==null?void 0:r.detail;return a&&typeof a=="object"&&typeof a.code=="string"?a.code:null}function A2(t){return(t==null?void 0:t.status)===422&&Xs(t)===oa}function vi(t){const a=t==null?void 0:t.status,r=(t==null?void 0:t.message)||"",s=r.toLowerCase();return A2(t)?r:a===429?s.includes("lÃmite")?r:"Demasiadas evaluaciones seguidas. Espera un momento e inténtalo de nuevo.":a===403?s.includes("not authenticated")||s.includes("sesión")?"Tu sesión ha expirado. Por favor inicia sesión de nuevo.":"Acceso denegado. Comprueba tu plan de suscripción.":
586a===502||a===503?"El servicio de evaluación no está disponible ahora. Inténtalo en unos segundos.":r||S2}function E2(){var P;const{id:t}=da(),a=he(),r=Ct(),{getTechniqueById:s}=Ut(),n=s(t),{user:o}=Ge();Ks();const l=((P=r.state)==null?void 0:P.scriptIndex)??0,[c,d]=i.useState(null);i.useEffect(()=>{t&&R.get(`/api/techniques/${t}`).then(M=>{var U;((U=M==null?void 0:M.scripts)==null?void 0:U.length)>0&&d(M.scripts)}).catch(()=>{})},[t]);const[u,m]=i.useState(null);i.useEffect(()=>{!o||o.role==="admin"||R.get("/api/billing/status").then(M=>{if(M!=null&&M.is_premium)return;const U=(M==null?void 0:M.monthly_eval_count)??0,X=(M==null?void 0:M.monthly_eval_limit)??10;U>=X?m(`Has agotado tus ${X} evaluaciones mensuales del plan gratuito. SuscrÃbete a Premium para continuar.`):U>=X-2&&m(`Te quedan ${X-U} evaluación${X-U===1?"":"es"} gratuita${X-U===1?"":"s"} este mes.`)}).catch(()=>{})},[o]);const x=(c||(n==null?void 0:n.scripts)||[])[l]||null,v=(x==null?void 0:x.script)||(n==null?void 0:n.script),[f,h]=i.useState(()=>localStorage.getItem("neuralpitch_hq_mic")==="1"),g=()=>{h(M=>{const U=!M;return localStorage.setItem("neuralpitch_hq_mic",U?"1":"0"),U})},{isRecording:y,recordingTime:j,analyserRef:F,error:C,startRecording:N,stopRecording:b,resetRecorder:w}=hi({hqMic:f}),[L,z]=i.useState("idle"),[A,S]=i.useState(null),[_,D]=i.useState(null),[q,H]=i.useState(null),oe=i.useCallback(async()=>{S(null),D(null),await N(),z("recording")},[N]),ie=i.useCallback(async()=>{const M=await b();if(j<15){w(),z("idle");return}H(M),z("confirm")},[b,j,w]),B=i.useCallback(async M=>{var U,X,T,$;if(!M){w();return}z("analyzing");try{const Y=new FormData;Y.append("audio",M,"recording.webm"),Y.append("technique_id",t),x!=null&&x.id&&Y.append("script_id",x.id),x!=null&&x.script&&(Y.append("script",x.script),Y.append("commands",JSON.stringify(x.commands||[])),Y.append("pause_markers",JSON.stringify(x.pause_markers||[])));const ae=await R.upload("/api/evaluate",Y),de=ae.session_id||ae.id;await Cs(de,{audioBlob:M,words:ae.words||[],detectedPauses:ae.detected_pauses||[],duration:ae.duration||0,commandAnalysis:((X=(U=ae.pillars)==null?void 0:U.semantica)==null?void 0:X.command_analysis)||[],pauseAnalysis:(($=(T=ae.pillars)==null?void 0:T.timing)==null?void 0:$.pause_analysis)||[]}),a(`/results/${de}`)}catch(Y){if((Y==null?void 0:Y.status)===451){z("idle"),w();return}D(Xs(Y)),S(vi(Y)),z("idle"),w()}},[t,x,a,w]),K=i.useCallback(()=>{const M=q;H(null),B(M)},[q,B]),V=i.useCallback(()=>{H(null),w(),z("idle")},[w]);return n?L==="confirm"?e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[70vh]",style:{animation:"fadeSlideUp 0.3s both"},children:e.jsxs("div",{className:"rounded-2xl p-8 max-w-sm w-full mx-4 text-center",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)"},children:[e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Grabación completada"}),e.jsx("p",{className:"text-sm mb-8",style:{color:"rgba(255,255,255,0.55)"},children:"¿Quieres ver el análisis o prefieres volver a grabar?"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("button",{onClick:K,className:"w-full py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:"pointer"},onMouseEnter:M=>M.currentTarget.style.opacity="0.88",onMouseLeave:M=>M.currentTarget.style.opacity="1",children:"Ver resultados"}),e.jsx("button",{onClick:V,className:"w-full py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.75)",cursor:"pointer"},onMouseEnter:M=>M.currentTarget.style.background="rgba(255,255,255,0.1)",onMouseLeave:M=>M.currentTarget.style.background="rgba(255,255,255,0.06)",children:"Volver a grabar"})]})]})}):L==="analyzing"?e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[70vh]",style:{animation:"fadeSlideUp 0.5s both"},"aria-live":"polite","aria-busy":"true",children:[e.jsx("div",{className:"w-12 h-12 rounded-full mb-6",style:{border:"3px solid rgba(0,229,160,0.2)",borderTop:"3px solid #00E5A0",animation:"rotate 1s linear infinite"},"aria-hidden":"true"}),e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Analizando tu interpretación..."}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Evaluando semántica, timing, tono y fluidez"})]}):e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsxs("button",{onClick:()=>a(`/prepare/${t}`),disabled:y,className:"flex items-center gap-2 text-sm mb-8 transition-colors duration-200",style:{background:"none",border:"none",color:y?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.4)",cursor:y?"not-allowed":"pointer",padding:0},onMouseEnter:M=>{y||(M.currentTarget.style.color="white")},onMouseLeave:M=>{y||(M.currentTarget.style.color="rgba(255,255,255,0.65)")},"aria-label":"Volver a la preparación",children:[e.jsx("span",{"aria-hidden":"true",children:"â"})," Volver"]}),e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Grabación"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Interpreta el script con tus propias palabras. No necesitas leerlo literal."}),x&&e.jsxs("p",{className:"text-xs mt-1",style:{color:"rgba(0,229,160,0.6)"},children:["Script: ",x.title]})]}),v&&e.jsx("div",{className:"mb-8",children:e.jsx(Xt,{script:v,defaultExpanded:!1,annotations:(x==null?void 0:x.technique_annotations)||[]})}),u&&!A&&e.jsxs("div",{className:"rounded-xl border px-4 py-3 mb-4 text-sm text-center",style:{background:"rgba(255,184,0,0.07)",borderColor:"rgba(255,184,0,0.25)",color:"#FFB800"},role:"status",children:[u," ",e.jsx("button",{onClick:()=>a("/billing"),className:"underline",style:{background:"none",border:"none",color:"#FFB800",cursor:"pointer",padding:0},children:"Ver planes"})]}),A&&_===oa&&e.jsx(yi,{message:A,onRetry:oe,disabled:L==="analyzing"}),(A&&_!==oa||C)&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm text-center",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:_===oa?C:A||C}),e.jsx("div",{className:"mb-6 px-4",children:e.jsx(Ys,{isRecording:y,analyserRef:F})}),e.jsx("div",{className:"text-center mb-8 font-bold",style:{fontSize:52,fontFamily:"'JetBrains Mono', monospace",color:y?"#00E5A0":"rgba(255,255,255,0.15)",transition:"color 0.3s",letterSpacing:"-0.02em"},"aria-live":"polite","aria-label":`Tiempo de grabación: ${ca(j)}`,children:ca(j)}),e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[y?e.jsx("button",{onClick:ie,className:"transition-all duration-200 animate-glow-red",style:{width:88,height:88,borderRadius:"50%",background:"rgba(255,71,87,0.15)",border:"4px solid #FF4757",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",animation:"glowRed 2s infinite"},onMouseEnter:M=>M.currentTarget.style.transform="scale(1.1)",onMouseLeave:M=>M.currentTarget.style.transform="scale(1)","aria-label":"Detener grabación",children:e.jsx("div",{style:{width:24,height:24,borderRadius:4,background:"#FF4757"},"aria-hidden":"true"})}):e.jsx("button",{onClick:oe,disabled:L==="analyzing",className:"transition-all duration-200",style:{width:88,height:88,borderRadius:"50%",background:"linear-gradient(135deg, #FF4757, #FF6B81)",border:"4px solid rgba(255,71,87,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:M=>M.currentTarget.style.transform="scale(1.1)",onMouseLeave:M=>M.currentTarget.style.transform="scale(1)","aria-label":"Iniciar grabación",children:e.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:"white"},"aria-hidden":"true"})}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},"aria-live":"polite",children:y?"Pulsa para detener":"Pulsa para grabar"}),y&&j>5&&e.jsx("p",{className:"text-xs text-center max-w-xs",style:{color:"rgba(255,255,255,0.55)"},children:"MÃnimo recomendado: 30 segundos para una evaluación precisa"}),!y&&e.jsxs("button",{onClick:g,className:"flex items-center gap-2 text-xs px-3 py-1.5 rounded-lg transition-all duration-200 mt-2",style:{background:f?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.04)",border:f?"1px solid rgba(0,229,160,0.25)":"1px solid rgba(255,255,255,0.08)",color:f?"#00E5A0":"rgba(255,255,255,0.35)",cursor:"pointer"},title:"ActÃvalo si usas AirPods, auriculares con cancelación activa de ruido u otros micrófonos de alta calidad con hardware ANC.",children:[e.jsx("span",{children:f?"â":"â"}),"Mic ANC / alta calidad"]}
586)]}),e.jsxs("div",{className:"mt-10 flex items-center justify-center gap-3",style:{color:"rgba(255,255,255,0.45)"},children:[e.jsx(J,{icon:Fr[n.id]??_r,"aria-hidden":"true",style:{fontSize:18}}),e.jsx("span",{className:"text-xs",style:{fontFamily:"'JetBrains Mono', monospace"},children:n.name})]})]}):e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-4",style:{color:"rgba(255,255,255,0.6)"},children:"Técnica no encontrada"}),e.jsx("button",{onClick:()=>a("/"),className:"text-sm px-6 py-2 rounded-xl font-medium",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",cursor:"pointer"},children:"Volver a técnicas"})]})}function C2({score:t=0,size:a=140,strokeWidth:r=8,label:s}){const n=(a-r)/2,o=2*Math.PI*n,l=o-t/100*o,c=t>=80?"#00E5A0":t>=55?"#FFB800":"#FF4757";return e.jsxs("div",{className:"flex flex-col items-center",style:{gap:6},children:[e.jsxs("svg",{width:a,height:a,style:{transform:"rotate(-90deg)"},"aria-hidden":"true",children:[e.jsx("circle",{cx:a/2,cy:a/2,r:n,fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:r}),e.jsx("circle",{cx:a/2,cy:a/2,r:n,fill:"none",stroke:c,strokeWidth:r,strokeDasharray:o,strokeDashoffset:l,strokeLinecap:"round",style:{transition:"stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1), stroke 0.5s"}})]}),e.jsxs("div",{style:{position:"relative",marginTop:-(a-10),height:a-20,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},"aria-label":`Puntuación: ${t}${s?` ${s}`:""}`,children:[e.jsx("span",{style:{fontSize:a*.3,fontWeight:700,color:c,fontFamily:"'JetBrains Mono', monospace",lineHeight:1},children:t}),s&&e.jsx("span",{style:{fontSize:10,color:"rgba(255,255,255,0.65)",marginTop:2,textTransform:"uppercase",letterSpacing:1.5},children:s})]})]})}const oo={semantica:"Semántica",timing:"Timing / Pausas",tono:"Tono / Congruencia",fluidez:"Fluidez",tecnicas_aplicadas:"Técnicas Aplicadas"},_2={semantica:"â",timing:"â·",tono:"âª",fluidez:"ã°",tecnicas_aplicadas:"â¦"};function lo({name:t,data:a,index:r=0}){const s=a.score>=80?"#00E5A0":a.score>=55?"#FFB800":"#FF4757";return e.jsxs("div",{className:"rounded-xl border",style:{background:"rgba(255,255,255,0.03)",borderColor:"rgba(255,255,255,0.06)",padding:"16px 20px",animation:`fadeSlideUp 0.5s ${.2+r*.1}s both`},children:[e.jsxs("div",{className:"flex justify-between items-center mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{fontSize:14,opacity:.5},children:_2[t]}),e.jsx("span",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.85)"},children:oo[t]||t}),e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:["Ã",a.weight]})]}),e.jsx("span",{className:"text-lg font-bold",style:{color:s,fontFamily:"'JetBrains Mono', monospace"},"aria-label":`Puntuación ${oo[t]}: ${a.score}`,children:a.score})]}),e.jsx("div",{className:"mb-3 rounded-sm overflow-hidden",style:{height:4,background:"rgba(255,255,255,0.06)"},role:"progressbar","aria-valuenow":a.score,"aria-valuemin":0,"aria-valuemax":100,children:e.jsx("div",{style:{height:"100%",width:`${a.score}%`,background:s,borderRadius:2,transition:"width 1.2s cubic-bezier(0.4,0,0.2,1)"}})}),e.jsx("p",{className:"text-xs leading-relaxed m-0",style:{color:"rgba(255,255,255,0.75)",lineHeight:1.6},children:a.feedback})]})}const wa={preserved:"#00E5A0",partial:"#FFB800",lost:"#FF4757",hit:"#00E5A0",short:"#FFB800",missed:"#FF4757",natural:"rgba(255,255,255,0.55)"},io=t=>t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[.,!?;:'"¿¡()\-]/g," ").replace(/\s+/g," ").trim();function F2(t,a,r,s,n){const{command:o,timestamp:l}=t,d={ts:(s+1)/(n+1)*r,found:!1};if(a!=null&&a.length&&o&&r>0){const u=io(o).split(" ").filter(Boolean);if(u.length>0){const m=u.length;let p=0,x=null;for(let f=0;f<a.length;f++){let h=0;for(let y=0;y<m&&!(f+y>=a.length);y++){const j=io(a[f+y].word),F=u[y];(j===F||F.length>=4&&j.length>=4&&F.slice(0,4)===j.slice(0,4))&&h++}const g=h/m;g>p&&(p=g,x=a[f].start)}const v=m<=2?.75:.6;if(p>=v&&x!==null)return{ts:x,found:!0}}}return typeof l=="number"&&l>=0&&l<=r?{ts:l,found:!0}:d}function M2(t,a,r=[]){if(!(t!=null&&t.length))return[];if(!(a!=null&&a.length))return t.map(()=>"natural");const s={};for(const c of r){const d=c.word.toLowerCase().replace(/[.,!?;:'"¿¡]/g,"");
586s[d]||(s[d]=[]),s[d].push(c.start)}const n=a.map(c=>{if(c.verdict==="missed")return null;const d=(c.expected_at||"").toLowerCase().replace(/[.,!?;:'"¿¡]/g,"").split(/\s+/).filter(Boolean);for(const u of d){const m=s[u];if(m!=null&&m.length)return{pa:c,estimatedPos:Math.min(...m)}}return{pa:c,estimatedPos:null}}),o=new Set;return t.map(c=>{let d=-1,u=1/0;for(let m=0;m<n.length;m++){if(o.has(m)||!n[m])continue;const{estimatedPos:p}=n[m];if(p===null)continue;const x=Math.abs(c.position-p);x<u&&x<=2&&(u=x,d=m)}return d>=0?(o.add(d),n[d].pa.verdict):"natural"})}function T2(t,a){if(!(a!=null&&a.length)||!t)return null;const r=t.match(/['"]([^'"]+)['"]/);if(!r)return null;const s=r[1].toLowerCase();for(let n=a.length-1;n>=0;n--){const o=a[n].word.toLowerCase().replace(/[.,!?;:'"¿¡]/g,"");if(o.includes(s)||s.includes(o))return a[n].end}return null}const P2={preserved:"Preservado",partial:"Parcial: formulación con menor fuerza persuasiva",lost:"Sin efecto persuasivo detectado"},L2={hit:"Pausa correcta",short:"Pausa corta",missed:"Pausa no realizada",natural:"Pausa natural (no prevista en script)"};function R2({pct:t,command:a,status:r,foundInTranscript:s}){const n=wa[r]||wa.partial,o=s?"":" (posición estimada)",l=`"${a}" · ${P2[r]||r}${o}`,c=a.length>26?`"${a.slice(0,23)}â¦"`:`"${a}"`;return e.jsxs("div",{title:l,style:{position:"absolute",left:`${Math.min(97,Math.max(2,t*100))}%`,bottom:0,transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",pointerEvents:"auto",zIndex:2,opacity:s?1:.5},children:[e.jsx("div",{style:{fontSize:13,color:n,maxWidth:90,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginBottom:3,fontFamily:"'JetBrains Mono', monospace"},children:c}),e.jsx("div",{style:{width:10,height:10,borderRadius:"50%",background:s?n:"transparent",border:`1.5px solid ${n}`,boxShadow:s?`0 0 6px ${n}40`:"none"}}),e.jsx("div",{style:{width:1,height:10,background:n,opacity:.45}})]})}function Qt({color:t,label:a,shape:r}){let s;return r==="circle"?s=e.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:t,flexShrink:0}}):r==="circle-outline"?s=e.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:"transparent",border:`1.5px solid ${t}`,flexShrink:0}}):s=e.jsx("span",{style:{display:"inline-block",width:12,height:6,borderRadius:2,background:t,flexShrink:0}}),e.jsxs("span",{className:"flex items-center gap-1",style:{color:"rgba(255,255,255,0.65)",fontSize:12},children:[s,a]})}function B2({sessionId:t}){const[a,r]=i.useState(null),[s,n]=i.useState(!0),[o,l]=i.useState(null),[c,d]=i.useState(!1),[u,m]=i.useState(0),[p,x]=i.useState(0),v=i.useRef(null),f=i.useRef(null);i.useEffect(()=>{n(!0),Wo(t).then(B=>{r(B||null)}).finally(()=>n(!1))},[t]),i.useEffect(()=>{if(!(a!=null&&a.audioBlob))return;const B=URL.createObjectURL(a.audioBlob);return l(B),()=>URL.revokeObjectURL(B)},[a]);const h=i.useCallback(()=>{const B=v.current;B&&(c?(B.pause(),d(!1)):B.play().then(()=>d(!0)).catch(()=>{}))},[c]),g=i.useCallback(B=>{const K=v.current,V=f.current;if(!K||!V||!(a!=null&&a.duration))return;const P=V.getBoundingClientRect(),U=Math.max(0,Math.min(1,(B.clientX-P.left)/P.width))*a.duration;K.currentTime=U,m(U)},[a]),y=i.useCallback(()=>{var B;m(((B=v.current)==null?void 0:B.currentTime)??0)},[]),j=i.useCallback(()=>{d(!1),m(0)},[]),F=i.useCallback(()=>{var K;const B=(K=v.current)==null?void 0:K.duration;B&&isFinite(B)&&B>0&&x(B)},[]);if(s||!a||!o)return null;const{words:C=[],detectedPauses:N=[],duration:b=1,commandAnalysis:w=[],pauseAnalysis:L=[],storedAt:z}=a,A=p>0?p:b>0?b:1,S=Qi(z),_=w.map((B,K)=>F2(B,C,A,K,w.length)),D=M2(N,L,C),q=L.filter(B=>B.verdict==="missed").map(B=>{const K=T2(B.expected_at,C);return K!=null?K/A:null}).filter(B=>B!==null),H=w.length>0,ie=N.filter(B=>B.duration>=.4).length>0||q.length>0;return e.jsxs("section",{style:{animation:"fadeSlideUp 0.5s 0.55s both"},"aria-label":"LÃnea temporal de la grabación",children:[e.jsxs("div",{className:"rounded-xl border",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)",padding:"20px 20px 16px"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em",fontFamily:"'JetBrains Mono', monospace"},children:"LÃnea temporal"}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("a",{href:o,download:`neuralpitch-${t}.webm`,title:"Descargar audio",style:{fontSize:13,color:"rgba(255,255,255,0.45)",textDecoration:"none",fontFamily:"'JetBrains Mono', monospace",cursor:"pointer"},onMouseEnter:B=>B.currentTarget.style.color="rgba(255,255,255,0.85)",onMouseLeave:B=>B.currentTarget.style.color="rgba(255,255,255,0.45)",children:"â audio"}),S&&e.jsxs("span",{style:{fontSize:13,color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:["â± Disponible ",S]})]})]}),w.length>0&&e.jsx("div",{style:{position:"relative",height:60,marginBottom:0,overflow:"visible"},children:w.map((B,K)=>e.jsx(R2,{pct:_[K].ts/A,command:B.command,status:B.status,foundInTranscript:_[K].found},K))}),e.jsxs("div",{ref:f,onClick:g,style:{position:"relative",height:28,cursor:"pointer",userSelect:"none"},role:"slider","aria-label":"Posición de reproducción","aria-valuenow":Math.round(u),"aria-valuemin":0,"aria-valuemax":Math.round(A),children:[e.jsx("div",{style:{position:"absolute",top:10,left:0,right:0,height:8,background:"rgba(255,255,255,0.06)",borderRadius:4}}),e.jsx("div",{style:{position:"absolute",top:10,left:0,width:`${u/A*100}%`,height:8,background:"rgba(0,229,160,0.1)",borderRadius:4,pointerEvents:"none"}}
586),C.map((B,K)=>e.jsx("div",{title:B.word,style:{position:"absolute",left:`${B.start/A*100}%`,top:10,width:1,height:8,background:"rgba(255,255,255,0.18)",pointerEvents:"none"}},K)),N.map((B,K)=>{if(B.duration<.4)return null;const V=D[K]||"natural",P=wa[V],M=Math.max(0,B.position-B.duration),U=B.duration/A*100,X=B.duration<.8,T=V==="natural"?X?.5:.7:X?.55:.85,$=X?4:8,Y=X?12:10;return e.jsx("div",{title:`${B.duration.toFixed(1)}s â ${L2[V]||V} · "${B.context_before} ⦠${B.context_after}"`,style:{position:"absolute",left:`${M/A*100}%`,width:`max(2px, ${U}%)`,top:Y,height:$,background:P,borderRadius:2,opacity:T,pointerEvents:"none"}},K)}),q.map((B,K)=>e.jsx("div",{title:"Pausa esperada no realizada",style:{position:"absolute",left:`${Math.min(98,Math.max(1,B*100))}%`,top:18,transform:"translateX(-50%)",width:0,height:0,borderLeft:"5px solid transparent",borderRight:"5px solid transparent",borderTop:`6px solid ${wa.missed}`,opacity:.7,pointerEvents:"none"}},K)),w.map((B,K)=>e.jsx("div",{style:{position:"absolute",left:`${Math.min(97,Math.max(2,_[K].ts/A*100))}%`,top:0,width:1,height:10,background:wa[B.status]||wa.partial,opacity:_[K].found?.4:.2,transform:"translateX(-50%)",pointerEvents:"none"}},K)),e.jsx("div",{style:{position:"absolute",left:`${u/A*100}%`,top:4,width:2,height:20,background:"rgba(255,255,255,0.85)",borderRadius:1,transform:"translateX(-50%)",pointerEvents:"none",boxShadow:"0 0 4px rgba(255,255,255,0.3)"}})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-3",children:[e.jsx("button",{onClick:h,style:{width:32,height:32,borderRadius:"50%",background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,fontSize:13},"aria-label":c?"Pausar reproducción":"Reproducir",children:c?"â¸":"â¶"}),e.jsxs("span",{style:{fontSize:13,color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.03em"},children:[ca(u)," / ",ca(A)]})]}),(H||ie)&&e.jsxs("div",{className:"flex flex-col gap-2 mt-3",style:{borderTop:"1px solid rgba(255,255,255,0.04)",paddingTop:10},children:[H&&e.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1",children:[e.jsx("span",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em",textTransform:"uppercase",minWidth:72},children:"Comandos"}),e.jsx(Qt,{color:"#00E5A0",label:"Preservado",shape:"circle"}),e.jsx(Qt,{color:"#FFB800",label:"Parcial",shape:"circle"}),e.jsx(Qt,{color:"#FF4757",label:"Sin efecto",shape:"circle"}),e.jsx(Qt,{color:"rgba(255,255,255,0.55)",label:"Posición estimada",shape:"circle-outline"})]}),ie&&e.jsxs("div",{className:"flex items-center flex-wrap gap-x-3 gap-y-1",children:[e.jsx("span",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em",textTransform:"uppercase",minWidth:72},children:"Pausas"}),e.jsx(Qt,{color:"#00E5A0",label:"Correcta",shape:"rect"}),e.jsx(Qt,{color:"#FFB800",label:"Corta",shape:"rect"}),e.jsx(Qt,{color:"#FF4757",label:"Perdida",shape:"rect"}),N.some((B,K)=>B.duration>=.4&&D[K]==="natural")&&e.jsx(Qt,{color:"rgba(255,255,255,0.45)",label:"Natural",shape:"rect"})]})]})]}),e.jsx("audio",{ref:v,src:o,onTimeUpdate:y,onEnded:j,onLoadedMetadata:F,preload:"metadata","aria-hidden":"true"})]})}function co(t){if(!t)return t;const a=t.suggestion?{...t.suggestion,name:t.suggestion.name??t.suggestion.technique_name,id:t.suggestion.id??t.suggestion.technique_id}:t.suggestion,r=t.techniqueId??t.technique_id??null,s=!r;return{...t,overall:t.overall??t.overall_score,pillars:t.pillars??t.pillar_scores,coachingNote:t.coachingNote??t.coaching_note,techniqueName:t.techniqueName??t.technique_name,techniqueId:r,isCustom:s,detectedTechniques:t.detected_techniques??null,recordingDuration:t.recordingDuration??t.duration,modelInfo:t.modelInfo??t.model_info??{name:t.ai_model_used,version:t.ai_model_version},suggestion:a,milestones:t.milestones??null,score_delta:t.score_delta??null,transcript:t.transcript??null,customScriptText:t.customScriptText??t.custom_script_text??null,scriptId:t.scriptId??t.script_id??null}}const z2={high:"ALTO",medium:"MEDIO",low:"BAJO"},uo={high:{bg:"rgba(255,71,87,0.06)",border:"rgba(255,71,87,0.15)",badge:"rgba(255,71,87,0.15)",text:"#FF4757"},medium:{bg:"rgba(255,184,0,0.06)",border:"rgba(255,184,0,0.15)",badge:"rgba(255,184,0,0.15)",text:"#FFB800"},low:{bg:"rgba(255,255,255,0.02)",border:"rgba(255,255,255,0.06)",badge:"rgba(255,255,255,0.08)",text:"rgba(255,255,255,0.5)"}};function I2({milestones:t,scoreDelta:a}){const[r,s]=i.useState(!1);if(!t||!Array.isArray(t)||t.length===0||r)return null;let n=null;if(t.includes("first_gold")?n="first_gold":t.includes("personal_best")&&!t.includes("first_attempt")?n="personal_best":t.includes("first_attempt")&&(n="first_attempt"),!n)return null;const l={first_gold:{bg:"rgba(255,184,0,0.08)",border:"rgba(255,184,0,0.25)",color:"#FFB800",title:"¡Primera puntuación Oro en esta técnica!",sub:"Has alcanzado el nivel de dominio."},personal_best:{bg:"rgba(0,229,160,0.06)",border:"rgba(0,229,160,0.2)",color:"#00E5A0",title:"¡Nuevo récord personal!",sub:a!=null?`+${a} puntos respecto a tu última sesión`:"Has superado tu mejor marca."},first_attempt:{bg:"rgba(0,180,216,0.06)",border:"rgba(0,180,216,0.2)",color:"#00B4D8",title:"Primera vez con esta técnica",sub:"¡Cada práctica cuenta!"}}[n];return e.jsxs("div",{className:"rounded-xl border mb-8 px-5 py-4 flex items-start justify-between gap-4",style:{background:l.bg,borderColor:l.border,animation:"fadeSlideUp 0.4s both"},role:"status","aria-live":"polite",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-sm mb-0.5",style:{color:l.color},children:l.title}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:l.sub})]}),e.jsx("button",{onClick:()=>s(!0),"aria-label":"Cerrar",style:{background:"none",border:"none",color:"rgba(255,255,255,0.65)",cursor:"pointer",fontSize:18,lineHeight:1,padding:"2px 4px",flexShrink:0},children:"Ã"})]})}function D2({pillars:t}){if(!t)return null;const a=300,r=a/2,s=120,n=[{key:"tecnicas_aplicadas",label:"Técnicas",angle:-90},{key:"semantica",label:"Semántica",angle:-18},{key:"timing",label:"Timing",angle:54},{key:"tono",label:"Tono",angle:126},{key:"fluidez",label:"Fluidez",angle:198}];function o(u,m){const p=u*Math.PI/180;return{x:r+m*Math.cos(p),y:r+m*Math.sin(p)}}const l=n.map(u=>{var p;const m=((p=t[u.key])==null?void 0:p.score)??0;return o(u.angle,m/100*s)}),c=l.map((u,m)=>`${m===0?"M":"L"} ${u.x} ${u.y}`).join(" ")+" Z",d=20;return e.jsx("div",{className:"flex justify-center mb-6",style:{animation:"fadeSlideUp 0.5s 0.2s both"},children:e.jsxs("svg",{width:a+80,height:a+60,viewBox:`-40 -30 ${a+80} ${a+60}`,"aria-label":"Gráfico de pilares",children:[[.25,.5,.75,1].map(u=>{const p=n.map(x=>o(x.angle,s*u)).map((x,v)=>`${v===0?"M":"L"} ${x.x} ${x.y}`).join(" ")+" Z";return e.jsx("path",{d:p,fill:"none",stroke:"rgba(255,255,255,0.20)",strokeWidth:1},u)}),n.map(u=>{const m=o(u.angle,s);return e.jsx("line",{x1:r,y1:r,x2:m.x,y2:m.y,stroke:"rgba(255,255,255,0.25)",strokeWidth:1},u.key)}),e.jsx("path",{d:c,fill:"rgba(0,229,160,0.15)",stroke:"#00E5A0",strokeWidth:2,strokeLinejoin:"round"}),l.map((u,m)=>{var v;const p=((v=t[n[m].key])==null?void 0:v.score)??0,x=p>=80?"#00E5A0":p>=55?"#FFB800":"#FF4757";return e.jsx("circle",{cx:u.x,cy:u.y,r:4,fill:x,stroke:"#0A0A0F",strokeWidth:1.5},m)}),n.map((u,m)=>{var f;const p=o(u.angle,s+d),x=((f=t[u.key])==null?void 0:f.score)??0,v=x>=80?"#00E5A0":x>=55?"#FFB800":"#FF4757";return e.jsxs("g",{children:[e.jsx("text",{x:p.x,y:p.y-4,textAnchor:"middle",fill:"rgba(255,255,255,0.85)",fontSize:13,fontFamily:"Inter, sans-serif",children:u.label}),e.jsx("text",{x:p.x,y:p.y+12,textAnchor:"middle",fill:v,fontSize:14,fontFamily:"'JetBrains Mono', monospace",fontWeight:700,children:x})]},u.key)})]})})}function ji(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[.,!?;:'"¿¡()\-]/g,"")}function $2(t){const a=[],r=/\S+/g;let s;for(;(s=r.exec(t))!==null;){const n=ji(s[0]);n&&a.push({word:n,start:s.index,end:s.index+s[0].length})}return a}function O2(t,a){const r=ji(a).split(/\s+/).filter(u=>u.length>=3);if(!r.length)return null;const s=r.length,n=s<=2?.8:.6,o=s+5;let l=0,c=-1,d=-1;for(let u=0;u<t.length;u++){const m=Math.min(o,t.length-u);for(let p=Math.max(1,s-2);p<=m;p++){const x=t.slice(u,u+p),v=new Set;let f=0,h=x.length,g=-1;for(const j of r)for(let F=0;F<x.length;F++){if(v.has(F))continue;const C=x[F].word;if(j===C||j.length>=4&&C.length>=4&&j.slice(0,4)===C.slice(0,4)){f++,v.add(F),F<h&&(h=F),F>g&&(g=F);break}}const y=f/s;y>l&&g>
586=0&&(l=y,c=x[h].start,d=x[g].end)}}return l>=n?{start:c,end:d}:null}function q2(t,a){if(!(a!=null&&a.length))return[{text:t,status:null}];const r=t.toLowerCase(),s=$2(t),n=[];for(const u of a){if(!u.command)continue;const m=r.indexOf(u.command.toLowerCase());if(m!==-1){n.push({start:m,end:m+u.command.length,status:u.status});continue}const p=O2(s,u.command);p&&n.push({start:p.start,end:p.end,status:u.status})}n.sort((u,m)=>u.start-m.start);const o=[];let l=0;for(const u of n)u.start>=l&&(o.push(u),l=u.end);const c=[];let d=0;for(const u of o)u.start>d&&c.push({text:t.slice(d,u.start),status:null}),c.push({text:t.slice(u.start,u.end),status:u.status}),d=u.end;return d<t.length&&c.push({text:t.slice(d),status:null}),c}const mo={preserved:{bg:"rgba(0,229,160,0.15)",color:"#00E5A0"},partial:{bg:"rgba(255,184,0,0.15)",color:"#FFB800"},lost:{bg:"rgba(255,71,87,0.15)",color:"#FF4757"}};function U2({transcript:t,commandAnalysis:a}){if(!t)return null;const r=q2(t,a);return e.jsxs("section",{className:"mb-6",style:{animation:"fadeSlideUp 0.5s 0.55s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Transcripción · Análisis de comandos"}),e.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("div",{style:{maxHeight:160,overflowY:"auto",fontSize:13,lineHeight:1.7,color:"rgba(255,255,255,0.75)",fontFamily:"'JetBrains Mono', monospace",wordBreak:"break-word"},children:r.map((s,n)=>{if(!s.status)return e.jsx("span",{children:s.text},n);const o=mo[s.status]||mo.lost;return e.jsx("mark",{style:{background:o.bg,color:o.color,borderRadius:3,padding:"0 2px"},children:s.text},n)})}),e.jsxs("div",{className:"flex items-center gap-4 mt-3 flex-wrap",style:{fontSize:11,color:"rgba(255,255,255,0.45)"},children:[e.jsx("span",{style:{color:"#00E5A0"},children:"â Preservado"}),e.jsx("span",{style:{color:"rgba(255,255,255,0.55)"},children:"·"}),e.jsx("span",{style:{color:"#FFB800"},children:"â Parcial"}),e.jsx("span",{style:{color:"rgba(255,255,255,0.55)"},children:"·"}),e.jsx("span",{style:{color:"#FF4757"},children:"â No pronunciado"})]})]})]})}const po={applied:{color:"#00E5A0",label:"Aplicada",bg:"rgba(0,229,160,0.08)",border:"rgba(0,229,160,0.18)"},partial:{color:"#FFB800",label:"Parcial",bg:"rgba(255,184,0,0.08)",border:"rgba(255,184,0,0.18)"},missing:{color:"#FF4757",label:"No aplicada",bg:"rgba(255,71,87,0.08)",border:"rgba(255,71,87,0.18)"}};function W2({data:t}){var a;return(a=t==null?void 0:t.technique_analysis)!=null&&a.length?e.jsxs("section",{className:"mb-6",style:{animation:"fadeSlideUp 0.5s 0.35s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Desglose · Técnicas aplicadas"}),e.jsx("div",{className:"flex flex-col gap-2",children:t.technique_analysis.map((r,s)=>{const n=po[r.status]||po.missing;return e.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{background:n.bg,borderColor:n.border},children:[e.jsx("div",{className:"flex items-center justify-between gap-3 mb-1",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded",style:{background:n.bg,color:n.color,border:`1px solid ${n.border}`,fontFamily:"'JetBrains Mono', monospace"},children:n.label}),e.jsxs("span",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.9)"},children:[r.technique,r.is_primary&&e.jsx("span",{className:"ml-2 text-xs",style:{color:"rgba(255,255,255,0.4)",fontWeight:400},children:"· técnica principal"})]})]})}),r.evidence&&e.jsxs("p",{className:"text-xs mb-1 italic",style:{color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace"},children:['"',r.evidence,'"']}),e.jsx("p",{className:"text-xs leading-relaxed m-0",style:{color:"rgba(255,255,255,0.7)"},children:r.note})]},s)})})]}):null}function H2(){var j,F,C;const{sessionId:t}=da(),a=he(),{getTechniqueById:r}=Ut(),[s,n]=i.useState(null),[o,l]=i.useState(!0),[c,d]=i.useState(null),[u,m]=i.useState(null);if(i.useEffect(()=>{async function N(){l(!0),d(null);const b=sessionStorage.getItem(`session_${t}`);if(b)try{n(co(JSON.parse(b))),l(!1);return}catch{}try{const w=await R.get(`/api/sessions/${t}`);
586n(co(w))}catch(w){d(w.message||"No se pudo cargar la sesión.")}finally{l(!1)}}N()},[t]),i.useEffect(()=>{const N=s==null?void 0:s.techniqueId;N&&R.get(`/api/techniques/${N}`).then(b=>{var w;((w=b==null?void 0:b.scripts)==null?void 0:w.length)>0&&m(b.scripts)}).catch(()=>{})},[s==null?void 0:s.techniqueId]),o)return e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx("div",{className:"w-10 h-10 rounded-full",style:{border:"3px solid rgba(0,229,160,0.2)",borderTop:"3px solid #00E5A0",animation:"rotate 1s linear infinite"},"aria-label":"Cargando resultados..."})});if(c)return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",style:{color:"#FF4757"},children:"Error al cargar los resultados"}),e.jsx("p",{className:"text-sm mb-6",style:{color:"rgba(255,255,255,0.65)"},children:c}),e.jsx("button",{onClick:()=>a("/"),className:"text-sm px-6 py-2 rounded-xl font-medium",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"white",cursor:"pointer"},children:"Volver a técnicas"})]});if(!s)return null;const p=r(s.techniqueId||s.technique_id),x=(F=(j=s.pillars)==null?void 0:j.semantica)==null?void 0:F.command_analysis,v=u||(p==null?void 0:p.scripts)||[],f=s.scriptId?v.find(N=>N.id===s.scriptId):v[0],h=(f==null?void 0:f.script)??(p==null?void 0:p.script),g=s.customScriptText||h||null,y=s.customScriptText?[]:(f==null?void 0:f.technique_annotations)||[];return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsx(I2,{milestones:s.milestones,scoreDelta:s.score_delta}),e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Resultados del Análisis"}),e.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[s.isCustom&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-semibold",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"script propio"}),e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:[s.isCustom?"Script personalizado":s.techniqueName||(p==null?void 0:p.name)||"â",s.recordingDuration?` · ${ca(s.recordingDuration)} de grabación`:""]})]})]}),e.jsxs("div",{className:"flex flex-col items-center mb-12",children:[e.jsx(C2,{score:s.overall,size:180,strokeWidth:12,label:"Global"}),s.score_delta!=null&&e.jsxs("div",{className:"mt-3 flex items-center gap-1.5",children:[e.jsxs("span",{style:{color:s.score_delta>=0?"#00E5A0":"#FF4757",fontFamily:"'JetBrains Mono', monospace",fontSize:14,fontWeight:700},children:[s.score_delta>=0?"+":"",s.score_delta," pts"]}),e.jsx("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:12},children:"vs. tu sesión anterior"})]})]}),e.jsx(D2,{pillars:s.pillars}),s.pillars&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[Object.entries(s.pillars).filter(([N])=>N!=="tecnicas_aplicadas").map(([N,b],w)=>e.jsx(lo,{name:N,data:b,index:w},N)),s.pillars.tecnicas_aplicadas&&e.jsx("div",{className:"sm:col-span-2",children:e.jsx(lo,{name:"tecnicas_aplicadas",data:s.pillars.tecnicas_aplicadas,index:4})})]}),e.jsx(W2,{data:(C=s.pillars)==null?void 0:C.tecnicas_aplicadas}),s.isCustom&&s.detectedTechniques&&s.detectedTechniques.length>0&&e.jsxs("div",{className:"rounded-xl border mb-6 px-5 py-4",style:{background:"rgba(0,229,160,0.03)",borderColor:"rgba(0,229,160,0.1)",animation:"fadeSlideUp 0.5s 0.5s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"#00E5A0",letterSpacing:"0.15em"},children:"Técnicas detectadas en tu script"}),e.jsx("div",{className:"flex flex-col gap-2",children:s.detectedTechniques.map((N,b)=>e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium",style:{color:"rgba(255,255,255,0.85)"},children:N.technique_name}),N.notes&&e.jsx("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.55)"},children:N.notes})]}),e.jsxs("span",{className:"text-xs font-bold shrink-0",style:{color:(N.confidence||0)>=.7?"#00E5A0":(N.confidence||0)>=.4?"#FFB800":"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:[Math.round((N.confidence||0)*100),"%"]})]},b))})]}),e.jsx("div",{className:"mb-6",children:e.jsx(B2,{sessionId:t})}),g&&e.jsx("div",{className:"mb-6",style:{animation:"fadeSlideUp 0.5s 0.5s both"},children:e.jsx(Xt,{script:g,defaultExpanded:!1,annotations:y})}),e.jsx(U2,{transcript:s.transcript,commandAnalysis:x}),s.errors&&s.errors.length>0&&e.jsxs("section",{className:"mb-6",style:{animation:"fadeSlideUp 0.5s 0.6s both"},"aria-label":"Errores detectados",children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Errores detectados"}),e.jsx("div",{className:"flex flex-col gap-2",children:s.errors.map((N,b)=>{const w=N.severity||"low",L=uo[w]||uo.low;return e.jsxs("div",{className:"rounded-xl flex items-start gap-3",style:{background:L.bg,border:`1px solid ${L.border}`,padding:"12px 16px"},children:[e.jsx("span",{className:"flex-shrink-0 mt-0.5 text-xs font-bold rounded px-1.5 py-0.5",style:{background:L.badge,color:L.text,fontFamily:"'JetBrains Mono', monospace"},children:z2[w]||w.toUpperCase()}),e.jsx("span",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.8)"},children:N.detail})]},b)})})]}),s.coachingNote&&e.jsxs("div",{className:"rounded-xl border mb-6 px-5 py-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",animation:"fadeSlideUp 0.5s 0.7s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-2",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Nota del coach"}),e.jsx("p",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.8)"},children:s.coachingNote})]}),s.suggestion&&e.jsxs("div",{className:"rounded-xl border mb-8",style:{background:"rgba(0,180,216,0.04)",borderColor:"rgba(0,180,216,0.12)",padding:"20px 24px",animation:"fadeSlideUp 0.5s 0.8s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"#00B4D8",letterSpacing:"0.15em"},children:"Técnica complementaria sugerida"}),e.jsx("p",{className:"text-base font-bold mb-2",style:{color:"rgba(255,255,255,0.9)"},children:s.suggestion.name}),e.jsx("p",{className:"text-sm leading-relaxed mb-4",style:{color:"rgba(255,255,255,0.75)"},children:s.suggestion.reason}),e.jsxs(Se,{to:`/prepare/${s.suggestion.id}`,className:"inline-block text-sm font-semibold px-5 py-2 rounded-lg transition-all duration-200",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8"},onMouseEnter:N=>{N.currentTarget.style.background="rgba(0,180,216,0.2)"},onMouseLeave:N=>{N.currentTarget.style.background="rgba(0,180,216,0.1)"},children:["Practicar ",s.suggestion.name," â"]})]}),e.jsxs("div",{className:"rounded-xl border mb-8 px-5 py-4",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.04)",animation:"fadeSlideUp 0.5s 0.9s both"},"aria-label":"Información sobre el modelo de IA utilizado",children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-2",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.15em"},children:"Transparencia IA · Ley de IA de la UE"}),e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.5)"},children:["Esta evaluación ha sido generada automáticamente por un sistema de inteligencia artificial. Los resultados son orientativos y no constituyen una evaluación profesional definitiva. Conforme al Reglamento de IA (UE) 2024/1689 (Ley de IA de la UE)."," ",e.jsx(Se,{to:"/privacy",className:"underline",style:{color:"rgba(255,255,255,0.6)"},children:"Más información"}),"."]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[e.jsx("button",{onClick:()=>
586{if(s.customScriptText){const N={script:s.customScriptText,...s.techniqueId?{technique_id:s.techniqueId,technique_name:s.techniqueName}:{}};a("/custom-practice",{state:N})}else a(`/record/${s.techniqueId||(p==null?void 0:p.id)}`)},className:"px-7 py-3.5 rounded-xl font-bold text-sm transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:"pointer"},onMouseEnter:N=>N.currentTarget.style.transform="scale(1.03)",onMouseLeave:N=>N.currentTarget.style.transform="scale(1)",children:s.customScriptText?"Repetir script":"Repetir técnica"}),e.jsx("button",{onClick:()=>a("/"),className:"px-7 py-3.5 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.7)",cursor:"pointer"},onMouseEnter:N=>{N.currentTarget.style.background="rgba(255,255,255,0.1)",N.currentTarget.style.color="white"},onMouseLeave:N=>{N.currentTarget.style.background="rgba(255,255,255,0.05)",N.currentTarget.style.color="rgba(255,255,255,0.7)"},children:s.isCustom?"Practicar técnicas":"Elegir otra técnica"}),e.jsx(Se,{to:"/history",className:"px-7 py-3.5 rounded-xl font-semibold text-sm text-center transition-all duration-200",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.5)"},onMouseEnter:N=>{N.currentTarget.style.background="rgba(255,255,255,0.06)",N.currentTarget.style.color="rgba(255,255,255,0.8)"},onMouseLeave:N=>{N.currentTarget.style.background="rgba(255,255,255,0.03)",N.currentTarget.style.color="rgba(255,255,255,0.5)"},children:"Ver historial"})]})]})}function Ja(t){if(!t)return"â";try{return new Intl.DateTimeFormat("es-ES",{day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(t))}catch{return t}}function Mr(t){if(!t)return"â";const a=Math.floor(t/60),r=Math.floor(t%60);return`${String(a).padStart(2,"0")}:${String(r).padStart(2,"0")}`}function Ni(t){return t>=80?"#00E5A0":t>=55?"#FFB800":"#FF4757"}const V2=["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"];function wi(t){const a=t.getFullYear(),r=String(t.getMonth()+1).padStart(2,"0"),s=String(t.getDate()).padStart(2,"0");return`${a}-${r}-${s}`}function G2(t){const a=new Date;a.setHours(0,0,0,0);let r=0;const s=new Date(a);for(;;){const n=wi(s);if((t[n]??0)>0)r++,s.setDate(s.getDate()-1);else break}return r}function J2({calendarData:t}){if(!t)return null;const a={};if(Array.isArray(t))for(const f of t)a[f.date]=f.count;else typeof t=="object"&&Object.assign(a,t);const r=G2(a),s=new Date;s.setHours(0,0,0,0);const n=new Date(s);n.setDate(n.getDate()-90);const o=n.getDay(),l=o===0?1:o===1?0:-(o-1);n.setDate(n.getDate()+l);const c=[],d=new Date(n);for(;d<=s;){const f=[];for(let h=0;h<7;h++)d<=s?f.push(new Date(d)):f.push(null),d.setDate(d.getDate()+1);c.push(f)}const u=[];c.forEach((f,h)=>{f.forEach(g=>{g&&g.getDate()===1&&u.push({weekIndex:h,month:g.getMonth()})})});function m(f){return!f||f===0?"rgba(255,255,255,0.18)":f===1?"rgba(0,229,160,0.55)":f===2?"rgba(0,229,160,0.82)":"#00E5A0"}const p=14,v=p+3;return e.jsxs("div",{className:"rounded-2xl border px-5 py-4 mb-6",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.06)",animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-3 flex-wrap gap-2",children:[e.jsx("span",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.6)"},children:"Actividad · últimos 90 dÃas"}),e.jsxs("span",{className:"text-xs",style:{color:r>0?"#00E5A0":"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:["Racha actual: ",r," ",r===1?"dÃa":"dÃas"]})]}),e.jsx("div",{style:{overflowX:"auto"},children:e.jsxs("svg",{width:c.length*v+1,height:7*v+20,"aria-label":"Calendario de actividad",children:[u.map((f,h)=>e.jsx("text",{x:f.weekIndex*v,y:10,fill:"rgba(255,255,255,0.55)",fontSize:9,fontFamily:"Inter, sans-serif",children:V2[f.month]},h)),c.map((f,h)=>f.map((g,y)=>{if(!g)return null;const j=wi(g),F=a[j]??0;return e.jsx("rect",{x:h*v,y:y*v+18,width:p,height:p,rx:2,fill:m(F),"aria-label":`${j}: ${F} sesiones`,children:e.jsxs("title",{children:[j,": ",F," ",F===1?"sesión":"sesiones"]})},`${h}-${y}`)}))]})})]})}function Y2({scores:t}){if(!t||t.length===0)return null;const a=6,r=2,s=28,n=t.slice(-10);return e.jsx("svg",{width:n.length*(a+r),height:s,"aria-hidden":"true",children:n.map((o,l)=>{const c=Math.max(2,Math.round(o/100*s)),d=o>=80?"#00E5A0":o>=60?"#FFB800":"#FF4757";return e.jsx("rect",{x:l*(a+r),y:s-c,width:a,height:c,rx:1,fill:d,opacity:.8},l)})})}function K2(t){return t>
586=80?{label:"ORO",color:"#FFB800",bg:"rgba(255,184,0,0.12)",border:"rgba(255,184,0,0.3)",prefix:"â
"}:t>=60?{label:"PLATA",color:"rgba(200,200,220,0.9)",bg:"rgba(200,200,220,0.08)",border:"rgba(200,200,220,0.25)",prefix:"â"}:{label:"BRONCE",color:"rgba(205,127,50,0.9)",bg:"rgba(205,127,50,0.1)",border:"rgba(205,127,50,0.3)",prefix:"â"}}function X2({techniqueProgress:t}){const{getTechniqueById:a}=Ut();if(!t)return null;const r=Object.entries(t).filter(([,s])=>Array.isArray(s.scores)&&s.scores.length>=2).sort((s,n)=>(n[1].last_practiced??"")>(s[1].last_practiced??"")?1:-1).slice(0,6);return r.length===0?null:e.jsxs("div",{className:"mb-6",style:{animation:"fadeSlideUp 0.4s 0.1s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Progreso por técnica"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:r.map(([s,n])=>{const o=a(s),l=(o==null?void 0:o.name)??n.name??s,c=n.scores??[],d=n.best_score??Math.max(...c),u=c[0],m=c[c.length-1],p=m>u?"â":m<u?"â":"â",x=m>u?"#00E5A0":m<u?"#FF4757":"rgba(255,255,255,0.65)",v=K2(d);return e.jsxs("div",{className:"rounded-xl border px-4 py-3",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-2 gap-2",children:[e.jsx("span",{className:"text-xs font-medium leading-tight",style:{color:"rgba(255,255,255,0.8)"},children:l}),e.jsxs("span",{className:"text-xs font-bold shrink-0 px-1.5 py-0.5 rounded",style:{color:v.color,background:v.bg,border:`1px solid ${v.border}`,fontFamily:"'JetBrains Mono', monospace",fontSize:10},children:[v.prefix," ",v.label," · ",Math.round(d)]})]}),e.jsxs("div",{className:"flex items-end justify-between gap-2",children:[e.jsx(Y2,{scores:c}),e.jsx("span",{className:"text-base font-bold",style:{color:x,lineHeight:1},children:p})]})]},s)})})]})}function Q2({session:t}){function a(s){return s!=null?`${Math.round(s)}%`:"â"}function r(s){return s!=null?`${Math.round(s)}`:"â"}return e.jsx("div",{className:"rounded-xl border px-4 py-3 flex flex-col gap-2",style:{background:"rgba(0,180,216,0.03)",borderColor:"rgba(0,180,216,0.15)",animation:"fadeSlideUp 0.35s both"},children:e.jsxs("div",{className:"flex items-start justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(0,180,216,0.12)",color:"#00B4D8"},children:e.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:[e.jsx("path",{d:"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"}),e.jsx("path",{d:"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5H10.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold",style:{color:"#00B4D8"},children:"Entrenador de voz"}),e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.45)"},children:[Ja(t.created_at)," · ",Mr(t.duration_seconds)]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[t.wpm_avg!=null&&e.jsxs("span",{className:"text-xs font-mono px-2 py-0.5 rounded",style:{background:"rgba(0,229,160,0.08)",color:"#00E5A0",border:"1px solid rgba(0,229,160,0.2)"},children:[r(t.wpm_avg)," WPM"]}),t.wpm_optimal_pct!=null&&e.jsxs("span",{className:"text-xs font-mono px-2 py-0.5 rounded",style:{background:t.wpm_optimal_pct>=50?"rgba(0,229,160,0.08)":"rgba(255,184,0,0.08)",color:t.wpm_optimal_pct>=50?"#00E5A0":"#FFB800",border:`1px solid ${t.wpm_optimal_pct>=50?"rgba(0,229,160,0.2)":"rgba(255,184,0,0.2)"}`},children:[a(t.wpm_optimal_pct)," óptimo"]}),t.pause_count!=null&&t.pause_count>0&&e.jsxs("span",{className:"text-xs font-mono px-2 py-0.5 rounded",style:{background:"rgba(255,184,0,0.08)",color:"#FFB800",border:"1px solid rgba(255,184,0,0.2)"},children:[t.pause_count," pausa",t.pause_count!==1?"s":""]})]})]})})}const Z2={skeptic:"Escéptico",budget_constrained:"Presupuesto limitado",decisionmaker:"Director / CEO",friendly:"Receptivo",indecisive:"Indeciso",loyal_incumbent:"Ya tiene proveedor",analytical:"AnalÃtico",haggler:"Negociador",busy_distracted:"Ocupado y distraÃdo",guarded:"Reservado"};function em({session:t,onAbandoned:a}){var p;const r=he(),s=(p=t.evaluation)==null?void 0:p.overall,n=t.turn_count||0,o=Z2[t.persona]||t.persona,[l,c]=i.useState(!1),d=t.status==="completed",u=()=>r(`/sparring/result/${t.session_id}`),m=async x=>{x==null||x.stopPropagation(),c(!0);try{await R.delete(`/api/sparring/${t.session_id}`),a(t.session_id)}catch{c(!1)}};return e.jsx("div",{onClick:d?u:void 0,role:d?"button":void 0,tabIndex:d?0:void 0,onKeyDown:d?x=>{x.key==="Enter"&&u()}:void 0,className:"rounded-xl border px-4 py-3 flex flex-col gap-2 transition-colors",style:{background:"rgba(0,229,160,0.02)",borderColor:t.status==="active"?"rgba(255,184,0,0.2)":"rgba(0,229,160,0.12)",animation:"fadeSlideUp 0.35s both",cursor:d?"pointer":"default"},children:e.jsxs("div",{className:"flex items-start justify-between gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(0,229,160,0.1)",color:"#00E5A0"},children:e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M10 2a8 8 0 100 16A8 8 0 0010 2zM6.75 9.25a.75.75 0 000 1.5h4.59l-2.1 1.95a.75.75 0 001.02 1.1l3.5-3.25a.75.75 0 000-1.1l-3.5-3.25a.75.75 0 10-1.02 1.1l2.1 1.95H6.75z",clipRule:"evenodd"})})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-semibold",style:{color:"#00E5A0"},children:["Sparring · ",o]}),e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.45)"},children:[Ja(t.created_at)," · ",n," turno",n!==1?"s":"",t.duration_seconds?` · ${Mr(t.duration_seconds)}`:""]})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s!=null&&e.jsx("span",{className:"text-sm font-bold font-mono",style:{color:s>=75?"#00E5A0":s>=55?"#FFB800":"#FF4757"},children:s}),t.status==="active"?e.jsx("button",{onClick:m,disabled:l,className:"text-xs px-2 py-0.5 rounded font-semibold transition-opacity",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757",cursor:l?"wait":"pointer",opacity:l?.5:1},children:l?"...":"Cerrar"}):t.status==="abandoned"?e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.25)"},children:"abandonada"}):d?e.jsxs("span",{className:"text-xs flex items-center gap-1",style:{color:"rgba(0,229,160,0.6)"},children:["Ver report ",e.jsx("span",{"aria-hidden":"true",children:"âº"})]}):null]})]})})}const nr=10;function tm(){const t=he(),{isAuthenticated:a}=i.useContext(Bt),{getTechniqueById:r}=Ut(),[s,n]=i.useState([]),[o,l]=i.useState(!0),[c,d]=i.useState(null),[u,m]=i.useState(1),[p,x]=i.useState(0),[v,f]=i.useState(null),[h,g]=i.useState(null),[y,j]=i.useState(null),[F,C]=i.useState(!1),[N,b]=i.useState([]),[w,L]=i.useState([]);i.useEffect(()=>{async function S(){l(!0),d(null);try{const _=await R.get(`/api/sessions?page=${u}&page_size=${nr}`);Array.isArray(_)?(n(_),x(_.length)):(n(_.sessions||_.items||[]),x(_.total||0))}catch(_){n([]),x(0),_.code==="SESSION_EXPIRED"||_.status===401?d(null):d("No se pudo cargar el historial. Comprueba tu conexión e inténtalo de nuevo.")}finally{l(!1)}}S()},[u]),i.useEffect(()=>{a&&(R.get("/api/sessions/calendar?days=90").then(f).catch(()=>{}),R.get("/api/sessions/per-technique").then(g).catch(()=>{}),R.get("/api/voice-trainer/sessions?page=1&page_size=20").then(S=>b(S.sessions||[])).catch(()=>{}),R.get("/api/sparring").then(S=>L(S.sessions||[])).catch(()=>{}))},[a]);const z=async S=>{C(!0);try{await R.delete(`/api/sessions/${S}`),n(_=>_.filter(D=>D.id!==S)),x(_=>_-1)}catch{}finally{j(null),C(!1)}}
586,A=Math.ceil(p/nr);return e.jsxs("div",{id:"tour-history-content",className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Historial · Progreso"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Historial de sesiones"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Revisa tus evaluaciones anteriores y sigue tu progreso"})]}),c&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:c}),o&&e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx("div",{className:"w-10 h-10 rounded-full",style:{border:"3px solid rgba(0,229,160,0.2)",borderTop:"3px solid #00E5A0",animation:"rotate 1s linear infinite"},"aria-label":"Cargando sesiones..."})}),!o&&!c&&s.length===0&&e.jsxs("div",{className:"text-center py-20 rounded-2xl border",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.04)"},children:[e.jsx("p",{className:"text-4xl mb-4","aria-hidden":"true",children:"â"}),e.jsx("p",{className:"text-lg font-semibold mb-2",style:{color:"rgba(255,255,255,0.6)"},children:"Aún no tienes sesiones"}),e.jsx("p",{className:"text-sm mb-6",style:{color:"rgba(255,255,255,0.55)"},children:"Practica tu primera técnica y aparecerá aquÃ"}),e.jsx("button",{onClick:()=>t("/"),className:"text-sm px-6 py-2.5 rounded-xl font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",color:"#0A0A0F",cursor:"pointer"},children:"Empezar a practicar"})]}),v&&e.jsx(J2,{calendarData:v}),h&&e.jsx(X2,{techniqueProgress:h}),w.length>0&&e.jsxs("div",{className:"mb-6",style:{animation:"fadeSlideUp 0.4s 0.1s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Sesiones de sparring"}),e.jsx("div",{className:"flex flex-col gap-2",children:w.slice(0,5).map(S=>e.jsx(em,{session:S,onAbandoned:_=>L(D=>D.filter(q=>q.session_id!==_))},S.session_id))}),w.length>5&&e.jsxs("p",{className:"text-xs mt-2",style:{color:"rgba(255,255,255,0.35)"},children:["+ ",w.length-5," sesiones anteriores"]})]}),N.length>0&&e.jsxs("div",{className:"mb-6",style:{animation:"fadeSlideUp 0.4s 0.15s both"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Sesiones de entrenador de voz"}),e.jsx("div",{className:"flex flex-col gap-2",children:N.slice(0,5).map(S=>e.jsx(Q2,{session:S},S.id))}),N.length>5&&e.jsxs("p",{className:"text-xs mt-2",style:{color:"rgba(255,255,255,0.35)"},children:["+ ",N.length-5," sesiones anteriores"]})]}),!o&&s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col gap-3 sm:hidden",children:s.map((S,_)=>e.jsx(am,{session:S,onClick:()=>t(`/results/${S.id}`),deletingId:y,deleteInFlight:F,onDeleteRequest:D=>j(D),onDeleteCancel:()=>j(null),onDeleteConfirm:z,getTechniqueById:r},S.id||_))}),e.jsx("div",{className:"hidden sm:block rounded-2xl border overflow-hidden",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.06)"},children:e.jsxs("table",{className:"w-full text-sm","aria-label":"Historial de sesiones de entrenamiento",children:[e.jsx("thead",{children:e.jsx("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.05)",background:"rgba(255,255,255,0.02)"},children:["Fecha","Técnica","Puntuación","Duración","",""].map((S,_)=>e.jsx("th",{className:"px-5 py-3.5 text-left text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.1em"},scope:"col",children:S},_))})}),e.jsx("tbody",{children:s.map((S,_)=>{var D,q;return e.jsxs("tr",{className:"group transition-colors duration-150 cursor-pointer",style:{borderBottom:"1px solid rgba(255,255,255,0.03)"},onClick:()=>t(`/results/${S.id}`),onMouseEnter:H=>{H.currentTarget.style.background="rgba(255,255,255,0.03)"},onMouseLeave:H=>{H.currentTarget.style.background="transparent"},tabIndex:0,onKeyDown:H=>{H.key==="Enter"&&t(`/results/${S.id}`)},"aria-label":`Ver resultados de ${S.technique_id?S.technique_name||S.techniqueName||((D=r(S.technique_id))==null?void 0:D.name)||"â":"script propio"} del ${Ja(S.created_at||S.createdAt)}`,children:[e.jsx("td",{className:"px-5 py-4",style:{color:"rgba(255,255,255,0.7)"},children:Ja(S.created_at||S.createdAt)}),e.jsx("td",{className:"px-5 py-4",children:e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{style:{color:"rgba(255,255,255,0.85)",fontWeight:500},children:S.technique_id?S.technique_name||S.techniqueName||((q=r(S.technique_id))==null?void 0:q.name)||"â":"Script propio"}),!S.technique_id&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-semibold",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"propio"}),S.script_has_update&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-semibold",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8",fontFamily:"'JetBrains Mono', monospace"},title:"El guión de esta técnica ha sido mejorado desde tu sesión",children:"Nueva ver
586sión disponible"})]})}),e.jsx("td",{className:"px-5 py-4",children:e.jsx("span",{className:"font-bold",style:{color:Ni(S.overall_score||S.overall||0),fontFamily:"'JetBrains Mono', monospace",fontSize:16},children:S.overall_score||S.overall||"â"})}),e.jsx("td",{className:"px-5 py-4",style:{color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:Mr(S.duration||S.recordingDuration)}),e.jsx("td",{className:"px-5 py-4 text-right",children:e.jsx("span",{style:{color:"#00E5A0",fontSize:13},children:"Ver â"})}),e.jsx("td",{className:"px-3 py-4 text-right",onClick:H=>H.stopPropagation(),children:y===S.id?e.jsxs("span",{className:"flex items-center justify-end gap-1",children:[e.jsx("button",{onClick:()=>z(S.id),disabled:F,className:"text-xs px-2 py-1 rounded",style:{background:"rgba(255,71,87,0.15)",border:"1px solid rgba(255,71,87,0.4)",color:"#FF4757",cursor:F?"not-allowed":"pointer"},children:F?"â¦":"SÃ"}),e.jsx("button",{onClick:()=>j(null),disabled:F,className:"text-xs px-2 py-1 rounded",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:"No"})]}):e.jsx("button",{onClick:()=>j(S.id),className:"text-xs px-2 py-1 rounded opacity-0 group-hover:opacity-100 transition-opacity",style:{background:"transparent",border:"1px solid transparent",color:"rgba(255,71,87,0.5)",cursor:"pointer"},onMouseEnter:H=>{H.currentTarget.style.color="#FF4757",H.currentTarget.style.borderColor="rgba(255,71,87,0.3)",H.currentTarget.style.background="rgba(255,71,87,0.08)"},onMouseLeave:H=>{H.currentTarget.style.color="rgba(255,71,87,0.5)",H.currentTarget.style.borderColor="transparent",H.currentTarget.style.background="transparent"},"aria-label":"Eliminar sesión",title:"Eliminar sesión",children:"â"})})]},S.id||_)})})]})}),A>1&&e.jsxs("div",{className:"flex items-center justify-between mt-6 gap-4 flex-wrap",children:[e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.55)"},children:["Mostrando ",(u-1)*nr+1,"â",Math.min(u*nr,p)," de ",p," sesiones"]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Gr,{onClick:()=>m(S=>S-1),disabled:u===1,children:"â Anterior"}),Array.from({length:Math.min(A,5)},(S,_)=>{const D=_+1;return e.jsx(Gr,{onClick:()=>m(D),active:u===D,children:D},D)}),e.jsx(Gr,{onClick:()=>m(S=>S+1),disabled:u>=A,children:"Siguiente â"})]})]})]})]})}function am({session:t,onClick:a,deletingId:r,deleteInFlight:s,onDeleteRequest:n,onDeleteCancel:o,onDeleteConfirm:l,getTechniqueById:c}){var m;const d=t.overall_score||t.overall||0,u=r===t.id;return e.jsxs("div",{className:"rounded-xl border transition-all duration-200",style:{background:"rgba(255,255,255,0.02)",borderColor:u?"rgba(255,71,87,0.25)":"rgba(255,255,255,0.06)"},children:[e.jsxs("button",{onClick:a,className:"w-full text-left",style:{padding:"16px 20px 12px",cursor:"pointer",color:"white",background:"none",border:"none"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:"rgba(255,255,255,0.85)"},children:t.technique_id?t.technique_name||t.techniqueName||((m=c(t.technique_id))==null?void 0:m.name)||"â":"Script propio"}),!t.technique_id&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-semibold",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"propio"}),t.script_has_update&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded font-semibold",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8",fontFamily:"'JetBrains Mono', monospace"},title:"El guión de esta técnica ha sido mejorado desde tu sesión",children:"Nueva versión disponible"})]}),e.jsx("span",{className:"font-bold text-lg",style:{color:Ni(d),fontFamily:"'JetBrains Mono', monospace"},children:d||"â"})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:Ja(t.created_at||t.createdAt)}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace"},children:Mr(t.duration||t.recordingDuration)})]})]}),e.jsx("div",{className:"flex items-center justify-end px-4 pb-3 gap-2",style:{borderTop:"1px solid rgba(255,255,255,0.04)",paddingTop:10},children:u?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-xs mr-auto",style:{color:"rgba(255,71,87,0.8)"},children:"¿Eliminar esta sesión?"}),e.jsx("button",{onClick:()=>l(t.id),disabled:s,className:"text-xs px-3 py-1 rounded",style:{background:"rgba(255,71,87,0.15)",border:"1px solid rgba(255,71,87,0.4)",color:"#FF4757",cursor:s?"not-allowed":"pointer"},children:s?"â¦":"Eliminar"}),e.jsx("button",{onClick:o,className:"text-xs px-3 py-1 rounded",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:"Cancelar"})]}):e.jsx("button",{onClick:()=>n(t.id),className:"text-xs px-2 py-1 rounded",style:{background:"transparent",border:"1px solid transparent",color:"rgba(255,71,87,0.4)",cursor:"pointer"},onMouseEnter:p=>{p.currentTarget.style.color="#FF4757",p.currentTarget.style.borderColor="rgba(255,71,87,0.3)",p.currentTarget.style.background="rgba(255,71,87,0.08)"},onMouseLeave:p=>{p.currentTarget.style.color="rgba(255,71,87,0.4)",p.currentTarget.style.borderColor="transparent",p.currentTarget.style.background="transparent"},"aria-label":"Eliminar sesión",children:"â Eliminar"})})]})}function Gr({onClick:t,disabled:a,active:r,children:s}){return e.jsx("button",{onClick:t,disabled:a,className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-150",style:{background:r?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.04)",border:`1px solid ${r?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.06)"}`,color:r?"#00E5A0":a?"rgba(255,255,255,0.4)":"rgba(255,255,255,0.6)",cursor:a?"not-allowed":"pointer"},children:s})}function rm(){const{user:t,logout:a}=Ge(),r=he(),[s,n]=i.useState(()=>({gdpr:!0,ai_processing:!0,analytics:xc()})),[o,l]=i.useState(!1),[c,d]=i.useState(!1),[u,m]=i.useState(!1),[p,x]=i.useState(null),v=g=>{g!=="gdpr"&&n(y=>{const j={...y,[g]:!y[g]};return g==="analytics"&&(fc(j.analytics)?window.confirm("Has revocado el consentimiento de analÃtica. ¿Quieres recargar la página ahora para detener Microsoft Clarity por completo?")?window.location.reload():x({type:"info",message:"Microsoft Clarity dejará de cargarse en próximas visitas. Recarga esta pestaña cuando quieras detenerlo en la sesión actual."}):x({type:"success",message:j.analytics?"AnalÃtica activada. Microsoft Clarity comenzará a registrar tu sesión.":"AnalÃtica desactivada. No se cargará Clarity en próximas visitas."})),j})},f=async()=>
586{l(!0),x(null);try{const g=await R.download("/api/gdpr/export"),y=URL.createObjectURL(g),j=document.createElement("a");j.href=y,j.download=`neuralpitch-datos-${Date.now()}.json`,document.body.appendChild(j),j.click(),document.body.removeChild(j),URL.revokeObjectURL(y),x({type:"success",message:"Datos exportados correctamente."})}catch(g){x({type:"error",message:"No se pudieron exportar los datos: "+g.message})}finally{l(!1)}},h=async()=>{d(!0),x(null);try{await R.delete("/api/gdpr/delete-account"),await a(),r("/login")}catch(g){x({type:"error",message:"No se pudo eliminar la cuenta: "+g.message}),d(!1),m(!1)}};return e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-10",style:{animation:"fadeSlideUp 0.5s both"},children:[e.jsxs("div",{className:"mb-10",children:[e.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Privacidad y datos"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Gestiona tus consentimientos y datos personales conforme al RGPD (UE 2016/679)"})]}),p&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm",style:{background:p.type==="success"?"rgba(0,229,160,0.08)":"rgba(255,71,87,0.08)",borderColor:p.type==="success"?"rgba(0,229,160,0.2)":"rgba(255,71,87,0.2)",color:p.type==="success"?"#00E5A0":"#FF4757"},role:"alert",children:p.message}),t&&e.jsx(Pa,{title:"Tu cuenta",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full flex items-center justify-center text-lg font-bold flex-shrink-0",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},"aria-hidden":"true",children:(t.full_name||t.email||"U")[0].toUpperCase()}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold",children:t.full_name||"â"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:t.email})]})]})}),e.jsx(Pa,{title:"Consentimientos",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Jr,{id:"consent-gdpr",title:"Datos esenciales (RGPD)",description:"Necesario para el funcionamiento de la plataforma. Incluye autenticación, sesiones y almacenamiento de resultados de evaluación.",checked:s.gdpr,onChange:()=>v("gdpr"),disabled:!0,required:!0}),e.jsx(Jr,{id:"consent-ai",title:"Procesamiento por IA",description:"Permite que tus grabaciones de audio sean analizadas por nuestro sistema de inteligencia artificial para generar evaluaciones de entrenamiento.",checked:s.ai_processing,onChange:()=>v("ai_processing")}),e.jsx(Jr,{id:"consent-analytics",title:"AnalÃtica de uso",description:"Métricas agregadas y mapas de calor mediante Microsoft Clarity (Microsoft Corporation, EE. UU.) para entender cómo se usa la plataforma y mejorarla. Las contraseñas y campos sensibles se enmascaran. Solo se carga si aceptas el banner de cookies; puedes revocar el consentimiento en cualquier momento desde tu navegador.",checked:s.analytics,onChange:()=>v("analytics")})]})}),e.jsx(Pa,{title:"Información sobre IA (Ley de IA de la UE)",children:e.jsxs("div",{className:"rounded-xl border px-5 py-4",style:{background:"rgba(0,180,216,0.03)",borderColor:"rgba(0,180,216,0.1)"},children:[e.jsx("p",{className:"text-sm leading-relaxed mb-4",style:{color:"rgba(255,255,255,0.6)"},children:"NeuralPitch Simulator utiliza sistemas de inteligencia artificial para analizar tus grabaciones de audio y proporcionar retroalimentación sobre tus habilidades de ventas basadas en PNL."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[e.jsx(ya,{label:"Modelo",value:"NeuralPitch Evaluator"}),e.jsx(ya,{label:"Versión",value:"2.1.0"}),e.jsx(ya,{label:"CategorÃa de riesgo",value:"Bajo riesgo (EU AI Act)"}),e.jsx(ya,{label:"Propósito",value:"Evaluación de formación en ventas"}),e.jsx(ya,{label:"Datos procesados",value:"Audio de voz (temporal)"}),e.jsx(ya,{label:"Retención de audio",value:"72 horas máx."})]}),e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.6)"},children:["Conforme al Reglamento (UE) 2024/1689 (Ley de IA), tienes derecho a solicitar una revisión humana de cualquier evaluación automática. Para ejercer este derecho, contacta con"," ",e.jsx("a",{href:"mailto:[email protected]",className:"underline",style:{color:"rgba(255,255,255,0.5)"},children:"[email protected]"}),"."]})]})}),e.jsxs(Pa,{title:"Tus derechos (RGPD Art. 15-22)",children:[e.jsx("p",{className:"text-sm leading-relaxed mb-5",style:{color:"rgba(255,255,255,0.75)"},children:"Conforme al Reglamento General de Protección de Datos, tienes derecho de acceso, rectificación, supresión, portabilidad y oposición al tratamiento de tus datos personales."}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[e.jsx("button",{onClick:f,disabled:o,className:"flex items-center justify-center gap-2 px-5 py-3 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",cursor:o?"wait":"pointer"},onMouseEnter:g=>{o||(g.currentTarget.style.background="rgba(0,229,160,0.15)")},onMouseLeave:g=>{g.currentTarget.style.background="rgba(0,229,160,0.08)"},"aria-busy":o,children:o?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"inline-block w-4 h-4 rounded-full border-2 border-current border-t-transparent",style:{animation:"rotate 1s linear infinite"},"aria-hidden":"true"}),"Exportando..."]}):e.jsx(e.Fragment,{children:"Exportar mis datos"})}),e.jsx("button",{onClick:()=>m(!0),className:"flex items-center justify-center gap-2 px-5 py-3 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"rgba(255,71,87,0.06)",border:"1px solid rgba(255,71,87,0.15)",color:"#FF4757",cursor:"pointer"},onMouseEnter:g=>{g.currentTarget.style.background="rgba(255,71,87,0.12)"},onMouseLeave:g=>{g.currentTarget.style.background="rgba(255,71,87,0.06)"},children:"Eliminar mi cuenta"})]})]}),e.jsx(Pa,{title:"PolÃtica de privacidad",children:e.jsxs("div",{className:"rounded-xl border px-5 py-4 text-sm leading-relaxed",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.04)",color:"rgba(255,255,255,0.7)"},children:[e.jsxs("p",{className:"mb-3",children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Responsable del tratamiento:"})," ","Stradiax Executive S.L., [email protected]"]}),e.jsxs("p",{className:"mb-3",children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Finalidad:"})," ","Prestación del servicio de entrenamiento en técnicas de ventas con PNL mediante análisis de IA de grabaciones de voz."]}),e.jsxs("p",{className:"mb-3",children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Base legal:"})," ","Consentimiento explÃcito (RGPD Art. 6.1.a) y ejecución de contrato (Art. 6.1.b)."]}),e.jsxs("p",{className:"mb-3",children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Conservación:"})," ","Datos de cuenta: hasta baja voluntaria. Grabaciones de audio: máx. 72 horas. Resultados de evaluación: 2 años o hasta baja."]}),e.jsxs("p",{children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Contacto DPO:"})," ",e.jsx("a",{href:"mailto:[email protected]",className:"underline",style:{color:"rgba(255,255,255,0.6)"},children:"[email protected]"})]})]})}),u&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",style:{background:"rgba(0,0,0,0.7)",backdropFilter:"blur(4px)"},role:"dialog","aria-modal":"true","aria-labelledby":"delete-dialog-title",children:e.jsxs("div",{className:"w-full max-w-md rounded-2xl border p-8",style:{background:"#0F0F1A",borderColor:"rgba(255,71,87,0.2)",animation:"fadeSlideUp 0.3s both"},children:[e.jsx("h3",{id:"delete-dialog-title",className:"text-xl font-bold mb-3",style:{color:"#FF4757"},children:"Eliminar cuenta permanentemente"}),e.jsxs("p",{className:"text-sm leading-relaxed mb-6",style:{color:"rgba(255,255,255,0.6)"},children:["Esta acción es"," ",e.jsx("strong",{style:{color:"white"},children:"irreversible"}),". Se eliminarán todos tus datos personales, historial de sesiones y grabaciones conforme al Art. 17 del RGPD (derecho al olvido)."]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>m(!1),className:"flex-1 py-2.5 rounded-xl text-sm font-medium transition-colors duration-200",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.7)",cursor:"pointer"},children:"Cancelar"}
586),e.jsx("button",{onClick:h,disabled:c,className:"flex-1 py-2.5 rounded-xl text-sm font-bold transition-all duration-200",style:{background:"rgba(255,71,87,0.15)",border:"1px solid rgba(255,71,87,0.3)",color:"#FF4757",cursor:c?"wait":"pointer"},"aria-busy":c,children:c?"Eliminando...":"SÃ, eliminar cuenta"})]})]})})]})}function Pa({title:t,children:a}){return e.jsxs("section",{className:"mb-8","aria-labelledby":`section-${t.replace(/\s/g,"-")}`,children:[e.jsx("h3",{id:`section-${t.replace(/\s/g,"-")}`,className:"text-xs font-semibold uppercase tracking-widest mb-4",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:t}),e.jsx("div",{className:"rounded-xl border p-5",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:a})]})}function Jr({id:t,title:a,description:r,checked:s,onChange:n,disabled:o,required:l}){return e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("p",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.85)"},children:a}),l&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"rgba(0,229,160,0.1)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"Esencial"})]}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.65)"},children:r})]}),e.jsxs("label",{htmlFor:t,className:"relative flex-shrink-0 cursor-pointer mt-0.5","aria-label":`${a}: ${s?"activado":"desactivado"}`,children:[e.jsx("input",{id:t,type:"checkbox",checked:s,onChange:n,disabled:o,className:"sr-only","aria-label":a}),e.jsx("div",{className:"relative rounded-full transition-all duration-300",style:{width:44,height:24,background:s?o?"rgba(0,229,160,0.4)":"#00E5A0":"rgba(255,255,255,0.1)",cursor:o?"not-allowed":"pointer"},children:e.jsx("div",{className:"absolute top-0.5 rounded-full transition-transform duration-300",style:{width:20,height:20,background:"white",transform:s?"translateX(22px)":"translateX(2px)"}})})]})]})}function ya({label:t,value:a}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-wider mb-0.5",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.1em"},children:t}),e.jsx("p",{className:"text-sm font-medium",style:{color:"rgba(255,255,255,0.7)",fontFamily:"'JetBrains Mono', monospace"},children:a})]})}const sm={dpo:{src:"/assets/emails/dpo-stradiax.svg",label:"Email del DPO"},info:{src:"/assets/emails/info-stradiax.svg",label:"Email de contacto general"},neuralpitch:{src:"/assets/emails/neuralpitch-stradiax.svg",label:"Email de contacto NeuralPitch"},security:{src:"/assets/emails/security-stradiax.svg",label:"Email de seguridad"}};function Yr({variant:t,className:a=""}){const r=sm[t];return r?e.jsx("img",{src:r.src,alt:"",role:"img","aria-label":`${r.label}. Imagen anti-spam: escrÃbelo manualmente.`,title:"Imagen anti-spam. EscrÃbelo manualmente en tu cliente de correo.",className:`inline-block align-middle ${a}`,style:{height:"1.1em",width:"auto"}}):null}const Nt="https://neuralpitch.ai",fo=[{href:`${Nt}/#features`,label:"Funcionalidades"},{href:`${Nt}/#techniques`,label:"Técnicas"},{href:`${Nt}/#pricing`,label:"Individual"},{href:`${Nt}/#teams`,label:"Equipos"},{href:`${Nt}/#compliance`,label:"Cumplimiento"},{href:`${Nt}/#faq`,label:"FAQ"}],nm=[{href:`${Nt}/#features`,label:"Funcionalidades"},{href:`${Nt}/#pricing`,label:"Precios"},{href:`${Nt}/#teams`,label:"Para empresas"},{href:`${Nt}/privacy`,label:"Privacidad"},{href:`${Nt}/terms`,label:"Condiciones"}];function Qs(){const[t,a]=i.useState(!1),[r,s]=i.useState(!1);return i.useEffect(()=>{function n(){a(window.scrollY>50)}return window.addEventListener("scroll",n,{passive:!0}),()=>window.removeEventListener("scroll",n)},[]),e.jsxs("header",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${t?"bg-neuro-dark/95 backdrop-blur-xl border-b border-white/10":"bg-transparent"}`,children:[e.jsxs("nav",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-16 flex items-center justify-between",children:[e.jsxs("a",{href:Nt,className:"flex items-center gap-2 shrink-0","aria-label":"NeuralPitch Simulator",children:[e.jsx(ua,{size:34}),e.jsxs("div",{className:"hidden sm:block",children:[e.jsx("p",{className:"text-base font-bold leading-none tracking-tight text-white",children:"NeuralPitch"}),e.jsx("p",{className:"text-xs uppercase mt-0.5",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.15em"},children:"Simulator v2.1"})]})]}),e.jsx("div",{className:"hidden lg:flex items-center gap-4",children:fo.map(n=>e.jsx("a",{href:n.href,className:"text-sm whitespace-nowrap text-white/70 hover:text-white transition-colors duration-200",children:n.label},n.href))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:"/login",className:"hidden xl:inline-flex whitespace-nowrap text-sm text-white/70 hover:text-white transition-colors duration-200 px-3 py-1.5",children:"Iniciar sesión"}),e.jsx("a",{href:"/register",className:"flex items-center gap-2 px-4 py-2 rounded-lg bg-neuro-green text-neuro-dark text-sm font-semibold hover:bg-neuro-green/90 transition-all duration-200 shadow-lg shadow-neuro-green/20",children:"Crear cuenta"}),e.jsx("button",{className:"lg:hidden p-2 text-white/70 hover:text-white transition-colors",onClick:()=>s(!r),"aria-label":"Menú","aria-expanded":r,children:e.jsx(J,{icon:r?D0:r2,className:"w-5 h-5"})})]})]}),r&&e.jsx("div",{className:"lg:hidden border-t border-white/10 bg-neuro-dark/98 backdrop-blur-xl",children:e.jsxs("div",{className:"px-4 py-4 flex flex-col gap-1",children:[fo.map(n=>e.jsx("a",{href:n.href,className:"px-3 py-2.5 text-sm text-white/75 hover:text-white hover:bg-white/5 rounded-lg transition-all duration-200",children:n.label},n.href)),e.jsx("a",{href:"/login",className:"px-3 py-2.5 text-sm text-white/70 hover:text-white hover:bg-white/5 rounded-lg transition-all duration-200",children:"Iniciar sesión"})]})})]})}function Zs(){return e.jsx("footer",{className:"border-t border-white/6 bg-neuro-dark-2 py-10 px-4",children:e.jsxs("div",{className:"max-w-7xl mx-auto flex flex-col gap-8",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ua,{size:28}),e.jsx("p",{className:"text-base font-bold leading-none tracking-tight text-white",children:"NeuralPitch"})]}),e.jsx("nav",{className:"flex flex-wrap gap-x-6 gap-y-2",children:nm.map(t=>e.jsx("a",{href:t.href,className:"text-white/60 text-sm hover:text-white transition-colors duration-200",children:t.label},t.href))})]}),e.jsxs("div",{className:"border-t border-white/5 pt-6",children:[e.jsx("p",{className:"text-white/55 text-xs leading-relaxed text-center mb-4",children:"Desarrollado por Stradiax Executive, S.L., firma de Strategic Technology Advisory con sede en Madrid (fundada en 2007, capital 100% español)."}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-2",children:[e.jsxs("p",{className:"text-white/55 text-xs",children:["© ",new Date().getFullYear()," NeuralPitch Simulator · Stradiax Executive, S.L. · Madrid, España"]}),e.jsx("p",{className:"text-white/55 text-xs",children:"Sin tracking de terceros · RGPD · EU AI Act"})]})]})]})})}function om(){return e.jsxs("div",{style:{background:"#0A0A0F",minHeight:"100vh",color:"rgba(255,255,255,0.85)"},children:[e.jsx(Qs,{}),e.jsx("main",{className:"pt-24 pb-20 px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsx("h1",{className:"text-white font-bold text-3xl mb-2",children:"PolÃtica de privacidad"}),e.jsx("p",{className:"text-white/55 text-sm mb-4",children:"Ãltima actualización: abril de 2026"}),e.jsxs("p",{className:"text-sm leading-relaxed mb-8 p-4 rounded-xl border",style:{color:"rgba(255,255,255,0.6)",borderColor:"rgba(0,229,160,0.2)",background:"rgba(0,229,160,0.04)"},children:["Esta polÃtica describe el tratamiento de datos personales dentro de ",e.jsx("strong",{className:"text-white/80",children:"NeuralPitch Simulator"})," (la aplicación en app.neuralpitch.ai) y aplica a cualquier persona que se registre o use la plataforma. Para el tratamiento realizado por el sitio web de marketing (neuralpitch.ai y dominios asociados) consulta la"," ",e.jsx("a",{href:`${Nt}/privacy`,className:"text-neuro-green hover:underline",children:"polÃtica de la landing"}),"."]}),e.jsx(Tt,{heading:"1. Responsable del tratamiento",children:e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Empresa:"})," Stradiax Executive, S.L."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"CIF:"})," B85235844"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Domicilio:"})," Madrid, España"]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Contacto DPO:"})," ",e.jsx(Yr,{variant:"dpo",className:"text-neuro-green"})]})]})}),e.jsx(Tt,{heading:"2. Datos que tratamos",children:e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Datos de cuenta:"})," nombre, correo electrónico y contraseña almacenada como hash bcrypt."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Datos de organización"})," (planes de empresa / demo / equipo): nombre de la empresa, número de puestos contratados y miembros invitados."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Audio de tus ejercicios:"})," grabaciones que envÃas para evaluación. ",e.jsx("em",{children:"No se almacenan de forma persistente"}),"; se procesan en memoria, se analizan y se descartan al finalizar la evaluación (segundos a minutos)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Resultados de evaluación:"})," transcripción, puntuaciones por pilares (Semántica, Timing, Tono, Fluidez, Técnicas), notas de coaching, marca temporal y técnica practicada."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Datos de facturación"})," (si contratas plan de pago): gestionados Ãntegramente por Stripe; NeuralPitch solo conserva el identificador de cliente y el estado de suscripción."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Registros técnicos y de auditorÃa:"})," metadatos mÃnimos (fecha, IP hash, correlation ID) con fines de seguridad, trazabilidad y cumplimiento del Reglamento UE de IA."]})]})}),e.jsx(Tt,{heading:"3. Finalidad y base legal",children:e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Prestación del servicio de entrenamiento:"})," ejecución del contrato (RGPD Art. 6.1.b)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Análisis de tu voz por IA para evaluación pedagógica:"})," consentimiento explÃcito (RGPD Art. 6.1.a). Podrás revocarlo en cualquier momento desde tu perfil; al hacerlo, dejaremos de procesar nuevo audio."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Emisión de facturas y cobro:"})," obligación legal (Art. 6.1.c) y ejecución contractual (Art. 6.1.b)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Prevención de fraude, seguridad y auditorÃa:"})," interés legÃtimo (Art. 6.1.f)."]})]})}),e.jsx(Tt,{heading:"4. Plazos de conservación",children:e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Audio:"})," no se almacena; el buffer se libera al terminar la evaluación."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Cuenta de usuario:"})," hasta que solicites la baja. Tras la baja, los registros que deban conservarse por cumplimiento contable o contra abusos se anonimizan (máximo 6 años para facturación según LGT)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Resultados de evaluación:"})," hasta 2 años desde su generación, salvo baja voluntaria anterior."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Registros de auditorÃa IA (EU AI Act):"})," hasta 2 años, exportables por el usuario."]})]})}),e.jsxs(Tt,{heading:"5. Encargados de tratamiento y terceros",children:[e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed mb-3",children:["Para prestar el servicio utilizamos los siguientes proveedores como ",e.jsx("strong",{className:"text-white/80",children:"encargados de tratamiento"}),":"]}),e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-2",children:[e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Deepgram, Inc."})," (EE. UU.): transcripción y detección de pausas en el audio. Sin almacenamiento persistente."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"OpenRouter / Anthropic"})," (EE. UU.): modelo de lenguaje que genera la evaluación pedagógica a partir de la transcripción."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Google Cloud Text-to-Speech"})," (UE): generación de audios de ejemplo de las técnicas."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Stripe Payments Europe Ltd."})," (Irlanda / EE. UU.): procesamiento de pagos y facturación recurrente."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Amazon Web Services (Lightsail, eu-west-3)"}),": infraestructura de alojamiento en la región de ParÃs (UE)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Google Worksp
586ace (Gmail)"}),": envÃo de correos transaccionales (verificación de email, avisos, recuperación de contraseña)."]}),e.jsxs("li",{children:[e.jsx("strong",{className:"text-white/80",children:"Microsoft Corporation (Clarity, EE. UU.)"}),": analÃtica de comportamiento (métricas agregadas, mapas de calor y reproducciones de sesión seudonimizadas) ",e.jsx("strong",{className:"text-white/80",children:"solo si aceptas las cookies analÃticas"})," en el banner. Las contraseñas y otros campos sensibles se enmascaran. Cobertura por las Cláusulas Contractuales Tipo y la adhesión de Microsoft al EU-U.S. Data Privacy Framework."]})]}),e.jsx("p",{className:"text-white/65 text-sm leading-relaxed mt-3",children:"Para las transferencias a terceros paÃses fuera del EEE (principalmente EE. UU.) se aplican las Cláusulas Contractuales Tipo aprobadas por la Comisión Europea (Decisión 2021/914)."})]}),e.jsxs(Tt,{heading:"6. Tus derechos",children:[e.jsx("p",{className:"text-white/65 text-sm leading-relaxed mb-3",children:"Conforme al RGPD y la LOPDGDD, puedes ejercer en cualquier momento:"}),e.jsxs("ul",{className:"list-disc list-inside text-white/65 text-sm leading-relaxed space-y-2",children:[e.jsx("li",{children:"Acceso, rectificación y supresión («derecho al olvido», Art. 17)."}),e.jsx("li",{children:"Limitación del tratamiento y oposición."}),e.jsx("li",{children:"Portabilidad: exportar tus datos en JSON desde tu perfil una vez registrado."}),e.jsx("li",{children:"Revocación del consentimiento prestado, sin que afecte a la licitud del tratamiento previo."}),e.jsxs("li",{children:["Reclamación ante la Agencia Española de Protección de Datos (",e.jsx("a",{href:"https://www.aepd.es",target:"_blank",rel:"noopener noreferrer",className:"text-neuro-green hover:underline",children:"www.aepd.es"}),")."]})]}),e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed mt-3",children:["Canal de ejercicio de derechos: ",e.jsx(Yr,{variant:"dpo",className:"text-neuro-green"}),". Responderemos en un plazo máximo de 30 dÃas."]})]}),e.jsxs(Tt,{heading:"7. Transparencia sobre la IA (Reglamento UE de IA)",children:[e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed mb-3",children:["NeuralPitch clasifica su sistema de IA como de ",e.jsx("strong",{className:"text-white/80",children:"riesgo limitado"})," (Art. 6 del Reglamento). No toma decisiones con efectos jurÃdicos, no procesa datos biométricos con fines de identificación y no evalúa la idoneidad de personas para empleo, crédito u otros servicios."]}),e.jsx("p",{className:"text-white/65 text-sm leading-relaxed mb-3",children:"Cumpliendo el Art. 13, registramos junto a cada evaluación: versión del modelo, proveedor, identificador de petición y marca temporal. Estos datos son exportables desde tu perfil."}),e.jsx("p",{className:"text-white/65 text-sm leading-relaxed",children:"Las decisiones de la IA son puramente formativas: puntuaciones indicativas sobre cómo has ejecutado la técnica practicada, sin repercusión contractual ni laboral. Puedes solicitar revisión humana en cualquier momento contactando con el DPO."})]}),e.jsxs(Tt,{heading:"8. Cookies",children:[e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed mb-3",children:["La aplicación usa ",e.jsx("strong",{className:"text-white/80",children:"cookies técnicas"})," imprescindibles para mantener tu sesión autenticada (cookies ",e.jsx("em",{children:"HttpOnly"})," con tokens JWT firmados por el backend). Estas son siempre necesarias y no requieren consentimiento previo."]}),e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed",children:["De forma opcional, si aceptas el banner de privacidad, cargamos ",e.jsx("strong",{className:"text-white/80",children:"Microsoft Clarity"})," para análisis estadÃstico de uso (cookies ",e.jsx("code",{children:"_clck"}),", ",e.jsx("code",{children:"_clsk"}),", ",e.jsx("code",{children:"MUID"}),", ",e.jsx("code",{children:"ANONCHK"}),", ",e.jsx("code",{children:"SM"}),"). Si declinas o eliges «Solo esenciales», Clarity no se inicializa y no se instalan cookies de terceros. Puedes revocar el consentimiento eliminando la clave ",e.jsx("code",{children:"neuralpitch_consent_given"})," del almacenamiento local de tu navegador. No se emplean cookies publicitarias ni de rastreo entre sitios."]})]}),e.jsx(Tt,{heading:"9. Seguridad",children:e.jsx("p",{className:"text-white/65 text-sm leading-relaxed",children:"Aplicamos cifrado en tránsito (TLS 1.3), separación de redes, rotación de claves JWT, hashing de contraseñas con bcrypt, lÃmites de tasa, filtrado de inyección de prompts en las peticiones al modelo, auditorÃa de acciones administrativas y registros estructurados con correlación. La base de datos reside en la UE (región AWS eu-west-3, ParÃs) y solo es accesible desde el backend mediante conexión cifrada."})}),e.jsx(Tt,{heading:"10. Modificaciones",children:e.jsx("p",{className:"text-white/65 text-sm leading-relaxed",children:"Podemos actualizar esta polÃtica para reflejar cambios legales o funcionales. La versión vigente estará siempre disponible en esta URL, y cualquier cambio sustancial se comunicará por correo electrónico a las cuentas activas."})}),e.jsx(Tt,{heading:"11. Contacto",children:e.jsxs("p",{className:"text-white/65 text-sm leading-relaxed",children:["Para cualquier cuestión relacionada con el tratamiento de datos personales: ",e.jsx("strong",{className:"text-white/80",children:"Stradiax Executive, S.L."}),", DPO:"," ",e.jsx(Yr,{variant:"dpo",className:"text-neuro-green"}),"."]})})]})}),e.jsx(Zs,{})]})}function Tt({heading:t,children:a}){return e.jsxs("section",{children:[e.jsx("h2",{className:"text-white font-semibold text-lg mb-3 mt-8",children:t}),a]})}const en='<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>',tn='</title><path d="',an='"/></svg>
586',lm={title:"Claude",slug:"claude",get svg(){return en+"Claude"+tn+this.path+an},path:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.
5860182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z",source:"https://claude.ai",hex:"D97757"},im={title:"Google Gemini",slug:"googlegemini",get svg(){return en+"Google Gemini"+tn+this.path+an},path:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81",source:"https://gemini.google.com",hex:"8E75B2"},cm={title:"OpenAI",slug:"openai",get svg(){return en+"OpenAI"+tn+this.path+an},path:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z",source:"https://openai.com/brand",hex:"412991",guidelines:"https://openai.com/brand"},dm={claude:{icon:lm,label:"Claude"},chatgpt:{icon:cm,label:"ChatGPT"},gemini:{icon:im,label:"Gemini"}},ws={claude:"Claude",chatgpt:"ChatGPT",gemini:"Gemini",copilot:"Microsoft 365 Copilot",otro:"Otros"};function um({size:t,color:a}){const r=t*.44,s=t*.12,n=(t-(2*r+s))/2;return e.jsx("svg",{width:t,height:t,viewBox:`0 0 ${t} ${t}`,"aria-hidden":"true",children:[[0,0],[1,0],[0,1],[1,1]].map(([o,l])=>e.jsx("rect",{x:n+o*(r+s),y:n+l*(r+s),width:r,height:r,fill:a},`${o}${l}`))})}function ki({provider:t,size:a=28,color:r="currentColor"}){if(t==="copilot")return e.jsx(um,{size:a,color:r});const s=dm[t];return s?e.jsx("svg",{width:a,height:a,viewBox:"0 0 24 24",role:"img","aria-label":s.label,children:e.jsx("path",{d:s.icon.path,fill:r})}):e.jsx("span",{style:{width:a,height:a,borderRadius:8,background:"rgba(255,255,255,0.08)",display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:a*.4,fontWeight:700},children:"?"})}const mm={skill:"Skills de IA",pack:"Packs",otro:"Otros recursos"};function Si(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function Ai({value:t,compact:a=!1}){const[r,s]=i.useState(!1),n=async()=>{try{await navigator.clipboard.writeText(t),s(!0),setTimeout(()=>s(!1),1500)}catch{}};return e.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-widest",style:{color:"rgba(255,255,255,0.4)"},children:"SHA-256"}),e.jsx("code",{className:"block font-mono text-[11px] break-all",style:{color:"rgba(255,255,255,0.65)"},children:a?`${t.slice(0,16)}â¦${t.slice(-8)}`:t})]}),e.jsx("button",{onClick:n,className:"shrink-0 p-1.5 rounded-md hover:bg-white/5 transition-colors",title:"Copiar hash","aria-label":"Copiar hash",children:e.jsx(J,{icon:r?Va:Y0,className:"w-3.5 h-3.5",style:{color:r?"#00E5A0":"rgba(255,255,255,0.55)"}})})]})}function pm({family:t,selected:a,onDone:r}){const[s,n]=i.useState(""),[o,l]=i.useState(!1),[c,d]=i.useState(""),[u,m]=i.useState("idle"),[p,x]=i.useState(""),v=i.useMemo(()=>Ms(),[]),f=async h=>{if(h.preventDefault(),a.length===0){x("Elige al menos una versión pulsando en su logo.");return}if(!o){x("Para recibir la descarga tienes que aceptar recibir nuestros correos.");return}m("sending"),x("");
586try{await R.post("/api/lead-magnets/request",{asset_slugs:a,email:s.trim(),marketing_opt_in:!0,website:c,...v}),m("sent"),r==null||r()}catch(g){m("error"),x((g==null?void 0:g.message)||"No hemos podido enviar el correo ahora mismo. Inténtalo en unos minutos.")}};return u==="sent"?e.jsxs("div",{className:"rounded-xl p-5 border",style:{borderColor:"rgba(0,229,160,0.25)",background:"rgba(0,229,160,0.05)"},children:[e.jsxs("p",{className:"text-white font-semibold flex items-center gap-2",children:[e.jsx(J,{icon:Ws,style:{color:"#00E5A0"}})," Revisa tu correo"]}),e.jsxs("p",{className:"text-sm mt-2",style:{color:"rgba(255,255,255,0.7)"},children:["Si la dirección es válida, en unos minutos recibirás ",a.length>1?`los ${a.length} enlaces de descarga`:"el enlace de descarga"," de ",e.jsx("strong",{className:"text-white/90",children:t.title}),". Cada enlace es personal, caduca en siete dÃas y admite cinco descargas. Mira también la carpeta de correo no deseado."]})]}):e.jsxs("form",{onSubmit:f,className:"space-y-3",children:[e.jsxs("label",{className:"block",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)"},children:"Tu correo"}),e.jsxs("div",{className:"mt-1.5 relative",children:[e.jsx(J,{icon:n0,className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4",style:{color:"rgba(255,255,255,0.35)"}}),e.jsx("input",{type:"email",required:!0,autoComplete:"email",value:s,onChange:h=>n(h.target.value),placeholder:"[email protected]",className:"w-full rounded-lg pl-10 pr-3 py-2.5 text-sm text-white outline-none focus:ring-2 focus:ring-neuro-green/40",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)"}})]})]}),e.jsx("div",{"aria-hidden":"true",style:{position:"absolute",left:"-9999px",top:0,height:0,overflow:"hidden"},children:e.jsxs("label",{children:["Sitio web ",e.jsx("input",{tabIndex:-1,autoComplete:"off",value:c,onChange:h=>d(h.target.value)})]})}),e.jsxs("label",{className:"flex items-start gap-3 text-sm cursor-pointer",style:{color:"rgba(255,255,255,0.7)"},children:[e.jsx("input",{type:"checkbox",checked:o,onChange:h=>l(h.target.checked),className:"mt-1 accent-[#00E5A0]"}),e.jsxs("span",{children:["Acepto recibir de vez en cuando correos de NeuralPitch sobre ventas y comunicación persuasiva. Puedo darme de baja en cualquier momento. Trato de datos según la ",e.jsx("a",{href:"/politica-privacidad",className:"text-neuro-green hover:underline",children:"polÃtica de privacidad"}),"."]})]}),p&&e.jsx("p",{className:"text-sm",style:{color:"#FF4757"},children:p}),e.jsxs("button",{type:"submit",disabled:u==="sending",className:"w-full inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg bg-neuro-green text-neuro-dark text-sm font-semibold hover:bg-neuro-green/90 transition-all disabled:opacity-60",children:[e.jsx(J,{icon:Gs,className:"w-4 h-4"}),u==="sending"?"Enviandoâ¦":a.length>1?`Enviarme ${a.length} enlaces de descarga`:"Enviarme el enlace de descarga"]})]})}const xo=["claude","chatgpt","gemini","copilot","otro"],fm=(t,a)=>{var r,s;return xo.indexOf(((r=t.providers)==null?void 0:r[0])||"otro")-xo.indexOf(((s=a.providers)==null?void 0:s[0])||"otro")};function xm({variants:t,selected:a,onChange:r}){const s=[...t].sort(fm),n=s.map(c=>c.slug),o=a.length===n.length,l=c=>r(a.includes(c)?a.filter(d=>d!==c):[...a,c]);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 mb-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)"},children:"Elige tu asistente"}),e.jsx("button",{type:"button",onClick:()=>r(o?[]:n),className:"text-xs text-neuro-green hover:underline",children:o?"Quitar todas":"Todas"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:s.map(c=>{var m;const d=((m=c.providers)==null?void 0:m[0])||"otro",u=a.includes(c.slug);return e.jsxs("button",{type:"button",onClick:()=>l(c.slug),"aria-pressed":u,title:`${ws[d]||d} · ${Si(c.size_bytes)}`,className:"flex flex-col items-center gap-2 rounded-xl px-2 py-3 transition-all",style:{border:`1px solid ${u?"#00E5A0":"rgba(255,255,255,0.1)"}`,background:u?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.02)",color:u?"#FFFFFF":"rgba(255,255,255,0.55)",boxShadow:u?"0 0 0 3px rgba(0,229,160,0.12)":"none"},children:[e.jsx(ki,{provider:d,size:30}),e.jsx("span",{className:"text-[11px] font-semibold leading-tight text-center",children:ws[d]||d}),e.jsx("span",{className:"text-[10px] leading-none",style:{color:u?"#00E5A0":"rgba(255,255,255,0.35)"},children:u?"elegida":"elegir"})]},c.slug)})})]})}function gm({family:t,open:a,onOpen:r}){const[s,n]=i.useState([]),o=t.variants,l=o.length===1;i.useEffect(()=>{l&&n([o[0].slug])},[l,o]);const c=o.filter(d=>s.includes(d.slug));return e.jsxs("article",{className:"rounded-2xl border p-6",style:{borderColor:"rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.02)"},children:[e.jsx("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:e.jsxs("span",{className:"text-[11px]",style:{color:"rgba(255,255,255,0.45)"},children:["v",t.version," · ",o.length," ",o.length===1?"versión":"versiones"," · zip"]})}),e.jsx("h3",{className:"text-white font-bold text-xl",style:{fontFamily:"Playfair Display, serif"},children:t.title}),e.jsx("p",{className:"text-sm mt-2 leading-relaxed whitespace-pre-line max-w-3xl",style:{color:"rgba(255,255,255,0.65)"},children:t.description}),e.jsxs("div",{className:"mt-5 grid md:grid-cols-[1fr_280px] gap-6 items-start",children:[e.jsxs("div",{children:[!l&&e.jsx(xm,{variants:o,selected:s,onChange:n}),c.length>0&&e.jsx("div",{className:"mt-4 space-y-2",children:c.map(d=>{var u,m;return e.jsxs("div",{className:"flex items-center gap-3 text-xs",style:{color:"rgba(255,255,255,0.55)"},children:[e.jsx(ki,{provider:((u=d.providers)==null?void 0:u[0])||"otro",size:16}),e.jsxs("span",{className:"shrink-0",children:[ws[(m=d.providers)==null?void 0:m[0]]||d.slug," · ",Si(d.size_bytes)]}),e.jsx(Ai,{value:d.sha256,compact:!0})]},d.slug)})})]}),e.jsx("div",{children:a?e.jsx(pm,{family:t,selected:s}):e.jsxs("button",{onClick:r,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg bg-neuro-green text-neuro-dark text-sm font-semibold hover:bg-neuro-green/90 transition-all",children:[e.jsx(J,{icon:Gs,className:"w-4 h-4"})," Quiero descargarla"]})})]})]})}function bm(){const[t,a]=i.useState(null),[r,s]=i.useState(""),[n,o]=i.useState(null),[l]=vr();i.useEffect(()=>
586{Qo(),R.get("/api/lead-magnets").then(a).catch(()=>s("No hemos podido cargar los descargables. Prueba de nuevo en un momento."))},[]),i.useEffect(()=>{const d=l.get("skill");d&&o(d)},[l]);const c=i.useMemo(()=>{const d=new Map;for(const u of t||[])d.has(u.category)||d.set(u.category,[]),d.get(u.category).push(u);return[...d.entries()]},[t]);return e.jsxs("div",{style:{background:"#0A0A0F",minHeight:"100vh",color:"rgba(255,255,255,0.85)"},children:[e.jsx(Qs,{}),e.jsx("main",{className:"pt-24 pb-20 px-4",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-2",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Descargables"}),e.jsx("h1",{className:"text-white font-bold text-3xl",style:{fontFamily:"Playfair Display, serif"},children:"Skills de NeuralPitch para tu asistente de IA"}),e.jsx("p",{className:"mt-3 text-sm leading-relaxed max-w-2xl",style:{color:"rgba(255,255,255,0.65)"},children:"Métodos de NeuralPitch empaquetados para instalarlos en Claude, ChatGPT, Gemini o Copilot. Cada descarga es un zip con la guÃa de instalación dentro. Te pedimos el correo porque el enlace de descarga es personal: llega por email, caduca a los siete dÃas y sirve solo para ti."}),e.jsxs("div",{className:"mt-5 flex items-start gap-3 rounded-xl p-4 border text-sm",style:{borderColor:"rgba(0,229,160,0.2)",background:"rgba(0,229,160,0.04)",color:"rgba(255,255,255,0.65)"},children:[e.jsx(J,{icon:di,className:"w-4 h-4 mt-0.5",style:{color:"#00E5A0"}}),e.jsx("span",{children:"Cada fichero lleva su hash SHA-256. Compáralo con el que aparece en el correo y en la página de descarga para comprobar que el zip es exactamente el que publicamos."})]}),r&&e.jsx("p",{className:"mt-8 text-sm",style:{color:"#FF4757"},children:r}),t===null&&!r&&e.jsx("p",{className:"mt-8 text-sm",style:{color:"rgba(255,255,255,0.5)"},children:"Cargandoâ¦"}),t&&t.length===0&&e.jsx("p",{className:"mt-8 text-sm",style:{color:"rgba(255,255,255,0.5)"},children:"TodavÃa no hay descargables publicados."}),c.map(([d,u])=>e.jsxs("section",{className:"mt-10",children:[e.jsx("h2",{className:"text-white font-semibold text-lg mb-4",children:mm[d]||d}),e.jsx("div",{className:"space-y-4",children:u.map(m=>e.jsx(gm,{family:m,open:n===m.family_slug,onOpen:()=>o(m.family_slug)},m.family_slug))})]},d))]})}),e.jsx(Zs,{})]})}function hm(t){return t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(2)} MB`}function ym(){const{token:t}=da(),[a,r]=i.useState(null),[s,n]=i.useState(""),[o,l]=i.useState(0);i.useEffect(()=>{let d=!1;return(async()=>{try{const u=await R.get(`/api/lead-magnets/download/${encodeURIComponent(t)}/info`);d||r(u)}catch(u){d||(n((u==null?void 0:u.message)||"Enlace no válido"),l((u==null?void 0:u.status)||0))}})(),()=>{d=!0}},[t]);const c=`${Lt}/api/lead-magnets/download/${encodeURIComponent(t)}`;return e.jsxs("div",{style:{background:"#0A0A0F",minHeight:"100vh",color:"rgba(255,255,255,0.85)"},children:[e.jsx(Qs,{}),e.jsx("main",{className:"pt-24 pb-20 px-4",children:e.jsxs("div",{className:"max-w-xl mx-auto",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-2",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Tu descarga"}),!a&&!s&&e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.5)"},children:"Comprobando el enlaceâ¦"}),s&&e.jsxs("div",{className:"rounded-2xl border p-6",style:{borderColor:"rgba(255,71,87,0.3)",background:"rgba(255,71,87,0.05)"},children:[e.jsxs("p",{className:"text-white font-semibold flex items-center gap-2",children:[e.jsx(J,{icon:Hs,style:{color:"#FF4757"}})," ",o===410?"Este enlace ya no sirve":"Enlace no válido"]}),e.jsx("p",{className:"text-sm mt-2",style:{color:"rgba(255,255,255,0.7)"},children:s}),e.jsx(Se,{to:"/skills",className:"inline-flex items-center gap-2 mt-4 text-sm text-neuro-green hover:underline",children:"Volver a pedir la descarga"})]}),a&&e.jsxs("div",{className:"rounded-2xl border p-6",style:{borderColor:"rgba(255,255,255,0.08)",background:"rgba(255,255,255,0.02)"},children:[e.jsx("h1",{className:"text-white font-bold text-2xl",style:{fontFamily:"Playfair Display, serif"},children:a.title}),e.jsxs("p",{className:"text-sm mt-1",style:{color:"rgba(255,255,255,0.55)"},children:["v",a.version," · ",hm(a.size_bytes)," · zip"]}),e.jsx("div",{className:"mt-5",children:e.jsx(Ai,{value:a.sha256})}),e.jsxs("a",{href:c,className:"mt-6 inline-flex items-center gap-2 px-5 py-2.5 rounded-lg bg-neuro-green text-neuro-dark text-sm font-semibold hover:bg-neuro-green/90 transition-all",children:[e.jsx(J,{icon:Gs,className:"w-4 h-4"})," Descargar ",a.slug,"-v",a.version,".zip"]}),e.jsxs("p",{className:"text-xs mt-4 leading-relaxed",style:{color:"rgba(255,255,255,0.45)"},children:["Te quedan ",a.downloads_left," descargas con este enlace, válido hasta el ",new Date(a.expires_at).toLocaleStr
586ing("es-ES",{dateStyle:"long",timeStyle:"short"}),". Dentro del zip encontrarás la guÃa de instalación para cada asistente."]})]})]})}),e.jsx(Zs,{})]})}function or({label:t,id:a,type:r="text",value:s,onChange:n,disabled:o,autoComplete:l}){return e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("label",{htmlFor:a,style:{fontSize:13,color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.1em",textTransform:"uppercase"},children:t}),e.jsx("input",{id:a,type:r,value:s,onChange:n,disabled:o,autoComplete:l,className:"w-full px-4 py-3 rounded-xl text-sm outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:o?"rgba(255,255,255,0.45)":"rgba(255,255,255,0.9)",fontFamily:"'JetBrains Mono', monospace"},onFocus:c=>{o||(c.target.style.borderColor="rgba(0,229,160,0.4)")},onBlur:c=>{c.target.style.borderColor="rgba(255,255,255,0.08)"}})]})}function La({type:t,message:a}){if(!a)return null;const r=t==="error";return e.jsx("p",{role:r?"alert":"status",style:{fontSize:13,color:r?"#FF4757":"#00E5A0",fontFamily:"'JetBrains Mono', monospace",marginTop:4},children:a})}function lr({title:t,children:a}){return e.jsxs("div",{className:"rounded-xl border p-6 flex flex-col gap-5",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("h2",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace",letterSpacing:"0.15em"},children:t}),a]})}function vm(t,a){return!t||t==="free"||t==="canceled"||t==="inactive"?"Gratuito":a==="annual"?"Premium Anual":"Premium Mensual"}function jm(t){if(!t)return null;try{return new Date(t).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"})}catch{return null}}function Nm(){var de;const{user:t,updateProfile:a,changePassword:r,refreshUser:s}=Ge(),n=he(),l=((de=Ct().state)==null?void 0:de.consentJustAccepted)===!0,[c,d]=i.useState(null),[u,m]=i.useState(null),[p,x]=i.useState(!1),[v,f]=i.useState({type:null,message:""}),[h,g]=i.useState(""),[y,j]=i.useState(!1),[F,C]=i.useState({type:null,message:""}),[N,b]=i.useState([]),[w,L]=i.useState(!1),[z,A]=i.useState({type:null,message:""});i.useEffect(()=>{R.get("/api/billing/status").then(d).catch(()=>{}),R.get("/api/consent/status").then(m).catch(()=>{}),R.get("/api/team/mine").then(re=>b(re.teams||[])).catch(()=>{})},[]);const[S,_]=i.useState((t==null?void 0:t.full_name)||""),[D,q]=i.useState({type:null,message:""}),[H,oe]=i.useState(!1),ie=async re=>{re.preventDefault();const ye=S.trim();if(!(!ye||ye===(t==null?void 0:t.full_name))){oe(!0),q({type:null,message:""});try{await a({full_name:ye}),q({type:"success",message:"Nombre actualizado correctamente."})}catch(fe){q({type:"error",message:(fe==null?void 0:fe.message)||"No se pudo actualizar el nombre."})}finally{oe(!1)}}},[B,K]=i.useState(""),[V,P]=i.useState(""),[M,U]=i.useState(""),[X,T]=i.useState({type:null,message:""}),[$,Y]=i.useState(!1),ae=async re=>{if(re.preventDefault(),T({type:null,message:""}),V.length<8){T({type:"error",message:"La nueva contraseña debe tener al menos 8 caracteres."});return}if(V!==M){T({type:"error",message:"Las contraseñas no coinciden."});return}Y(!0);try{await r(B,V),K(""),P(""),U(""),T({type:"success",message:"Contraseña cambiada correctamente."})}catch(ye){const fe=(ye==null?void 0:ye.message)||"",pe=fe.includes("incorrecta")?"La contraseña actual es incorrecta.":fe||"No se pudo cambiar la contraseña.";T({type:"error",message:pe})}finally{Y(!1)}};return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 flex flex-col gap-6",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Mi perfil"}),e.jsx("p",{className:"text-sm mt-1",style:{color:"rgba(255,255,255,0.65)"},children:t==null?void 0:t.email})]}),e.jsx(lr,{title:"Nombre",children:e.jsxs("form",{onSubmit:ie,className:"flex flex-col gap-4",children:[e.jsx(or,{label:"Nombre completo",id:"full-name",value:S,onChange:re=>{_(re.target.value),q({type:null,message:""})},disabled:H,autoComplete:"name"}),e.jsx(La,{...D}),e.jsx("button",{type:"submit",disabled:H||!S.trim()||S.trim()===(t==null?void 0:t.full_name),className:"self-start px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",opacity:H||!S.trim()||S.trim()===(t==null?void 0:t.full_name)?.4:1,cursor:H||!S.trim()||S.trim()===(t==null?void 0:t.full_name)?"not-allowed":"pointer"},children:H?"Guardandoâ¦":"Guardar nombre"})]})}),e.jsx(lr,{title:"Suscripción",children:c?e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-white",children:vm(c.subscription_status,c.subscription_plan)}),c.is_premium&&c.subscription_expires_at&&e.jsxs("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.65)"},children:["Renovación: ",jm(c.subscription_expires_at)]}),!c.is_premium&&e.jsxs("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.65)"},children:[c.monthly_eval_count??0," de ",c.monthly_eval_limit??10," evaluaciones usadas este mes"]})]}),e.jsx("span",{className:"text-xs font-semibold px-2.5 py-1 rounded-full flex-shrink-0",style:{background:c.is_premium?"rgba(0,229,160,0.1)":"rgba(255,255,255,0.05)",border:`1px solid ${c.is_premium?"rgba(0,229,160,0.2)":"rgba(255,255,255,0.08)"}`,color:c.is_premium?"#00E5A0":"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:c.is_premium?"Premium":"Gratuito"})]}),e.jsx("button",{onClick:()=>n("/billing"),className:"self-start px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:c.is_premium?"rgba(255,255,255,0.06)":"linear-gradient(135deg, #00E5A0, #00B4D8)",border:c.is_premium?"1px solid rgba(255,255,255,0.1)":"none",color:c.is_premium?"rgba(255,255,255,0.8)":"#0A0A0F",cursor:"pointer"},children:c.is_premium?"Gestionar suscripción":"Actualizar a Premium"})]}):e.jsx("button",{onClick:()=>n("/billing"),className:"self-start px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",cursor:"pointer",border:"none"},children:"Ver planes"})}),e.jsx(lr,{title:"Mis datos vocales",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[l&&e.jsxs("div",{className:"flex items-start gap-3 rounded-xl px-4 py-3",style:{background:"rgba(0,229,160,0.07)",border:"1px solid rgba(0,229,160,0.2)"},children:[e.jsx(J,{icon:Ws,style:{color:"#00E5A0",fontSize:16,marginTop:1,flexShrink:0}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#00E5A0"},children:"Consentimiento de voz activado"}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.55)"},children:["La compartición con tu equipo es independiente y está ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.8)"},children:"desactivada por defecto"}),". Puedes activarla abajo en «Compartir con mi equipo»; tu responsable solo verÃa métricas agregadas y anónimas, sin poder identificarte."]})]})]}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-white/80 font-medium",children:"Consentimiento de procesamiento de voz"}),e.jsx("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.55)"},children:u!=null&&u.consent_up_to_date?`Activo desde ${new Date(u.voice_consent_given_at).toLocaleDateString("es-ES")} · versión ${u.voice_consent_version}`:"No has aceptado el procesamiento de voz todavÃa."})]}),e.jsx("span",{className:"text-xs font-semibold px-2.5 py-1 rounded-full flex-shrink-0",style:{background:u!=null&&u.consent_up_to_date?"rgba(0,229,160,0.1)":"rgba(255,71,87,0.1)",border:`1px solid ${u!=null&&u.consent_up_to_date?"rgba(0,229,160,0.2)":"rgba(255,71,87,0.2)"}`,color:u!=null&&u.consent_up_to_date?"#00E5A0":"#FF4757",fontFamily:"'JetBrains Mono', monospace"},children:u!=null&&u.consent_up_to_date?"Activo":"Inactivo"})]}),e.jsx(La,{...v}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[!(u!=null&&u.consent_up_to_date)&&e.jsx("button",{onClick:()=>n("/voice-consent",{state:{from:"/profile"}}),className:"px-4 py-2 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",cursor:"pointer",border:"none"},children:"Activar consentimiento de voz"}),e.jsx("a",{href:"/api/gdpr/export",target:"_blank",rel:"noopener noreferrer",className:"px-4 py-2 rounded-xl text-sm font-medium transition-all duration-200",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8",cursor:"pointer"},children:"Exportar mis datos"}),(u==null?void 0:u.consent_up_to_date)&&e.jsx("button",{disabled:p,onClick:async()=>
586{if(window.confirm("¿Revocar el consentimiento de procesamiento de voz? No podrás hacer evaluaciones hasta que vuelvas a aceptar.")){x(!0),f({type:null,message:""});try{await R.post("/api/consent/revoke",{}),await s(),m(re=>({...re,consent_up_to_date:!1,voice_consent_version:null})),f({type:"success",message:"Consentimiento revocado. Ya no se procesará tu voz."})}catch(re){f({type:"error",message:(re==null?void 0:re.message)||"Error al revocar."})}finally{x(!1)}}},className:"px-4 py-2 rounded-xl text-sm font-medium transition-all duration-200",style:{background:"rgba(255,183,0,0.08)",border:"1px solid rgba(255,183,0,0.2)",color:"#FFB700",cursor:p?"not-allowed":"pointer",opacity:p?.5:1},children:p?"Revocandoâ¦":"Revocar consentimiento"})]}),N.length>0&&e.jsxs("div",{className:"border-t pt-4 mt-2",style:{borderColor:"rgba(0,180,216,0.15)"},children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#00B4D8"},children:"Compartir con mi equipo"}),e.jsxs("p",{className:"text-xs mt-1 mb-3",style:{color:"rgba(255,255,255,0.5)"},children:["Opcional y desactivado por defecto. Tu responsable solo verá métricas ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"agregadas y anónimas"})," del equipo (volumen de práctica y técnicas más usadas; las medias de puntuación, solo a partir de 5 personas). Nunca podrá identificarte ni ver tus puntuaciones, grabaciones o conversaciones individuales."]}),(()=>{var fe;const re=(fe=u==null?void 0:u.data_ownership)==null?void 0:fe.find(pe=>pe.data_type==="session_result"),ye=(re==null?void 0:re.shareable_to_team)===!0;return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("button",{disabled:w,onClick:async()=>{L(!0),A({type:null,message:""});try{const pe=!ye;await R.post(`/api/consent/share-with-team?data_type=session_result&shareable=${pe}`,{}),m(Qe=>({...Qe,data_ownership:(Qe.data_ownership||[]).map(Je=>Je.data_type==="session_result"?{...Je,shareable_to_team:pe}:Je)})),A({type:"success",message:pe?"Datos compartidos con el equipo.":"Dejaste de compartir datos."})}catch(pe){A({type:"error",message:(pe==null?void 0:pe.message)||"Error al cambiar la preferencia."})}finally{L(!1)}},className:"self-start flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium transition-all duration-200",style:{background:ye?"rgba(0,229,160,0.12)":"rgba(255,255,255,0.05)",border:`1px solid ${ye?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.12)"}`,color:ye?"#00E5A0":"rgba(255,255,255,0.6)",cursor:w?"not-allowed":"pointer",opacity:w?.6:1},children:[e.jsx(J,{icon:ye?Va:ii,style:{fontSize:13},"aria-hidden":"true"}),w?"Guardandoâ¦":ye?"Compartiendo con el equipo":"No compartiendo"]}),!(u!=null&&u.consent_up_to_date)&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:"Activa el consentimiento de voz para que tus sesiones futuras aparezcan en las métricas del equipo."})]})})(),e.jsx(La,{...z})]}),e.jsxs("div",{className:"border-t pt-4 mt-2",style:{borderColor:"rgba(255,71,87,0.2)"},children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"#FF4757"},children:"Zona de peligro"}),e.jsx("p",{className:"text-xs mt-1 mb-3",style:{color:"rgba(255,255,255,0.55)"},children:"Eliminar tu cuenta borra permanentemente todos tus datos, sesiones y evaluaciones."}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("input",{type:"text",placeholder:"Escribe BORRAR para confirmar",value:h,onChange:re=>{g(re.target.value),C({type:null,message:""})},className:"px-4 py-2 rounded-xl text-sm outline-none",style:{background:"rgba(255,71,87,0.04)",border:"1px solid rgba(255,71,87,0.2)",color:"rgba(255,255,255,0.8)",fontFamily:"'JetBrains Mono', monospace",maxWidth:280}}),e.jsx(La,{...F}),e.jsx("button",{disabled:h!=="BORRAR"||y,onClick:async()=>{j(!0);try{await R.delete("/api/gdpr/delete-account"),window.location.href="/login"}catch(re){C({type:"error",message:(re==null?void 0:re.message)||"Error al eliminar la cuenta."}),j(!1)}},className:"self-start px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:h==="BORRAR"&&!y?"rgba(255,71,87,0.15)":"rgba(255,71,87,0.05)",border:"1px solid rgba(255,71,87,0.3)",color:h==="BORRAR"&&!y?"#FF4757":"rgba(255,71,87,0.4)",cursor:h==="BORRAR"&&!y?"pointer":"not-allowed"},children:y?"Eliminandoâ¦":"Eliminar cuenta y datos"})]})]})]})}),e.jsx(lr,{title:"Cambiar contraseña",children:e.jsxs("form",{onSubmit:ae,className:"flex flex-col gap-4",children:[e.jsx(or,{label:"Contraseña actual",id:"current-password",type:"password",value:
586B,onChange:re=>{K(re.target.value),T({type:null,message:""})},disabled:$,autoComplete:"current-password"}),e.jsx(or,{label:"Nueva contraseña",id:"new-password",type:"password",value:V,onChange:re=>{P(re.target.value),T({type:null,message:""})},disabled:$,autoComplete:"new-password"}),e.jsx(or,{label:"Confirmar nueva contraseña",id:"confirm-password",type:"password",value:M,onChange:re=>{U(re.target.value),T({type:null,message:""})},disabled:$,autoComplete:"new-password"}),e.jsx(La,{...X}),e.jsx("button",{type:"submit",disabled:$||!B||!V||!M,className:"self-start px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",opacity:$||!B||!V||!M?.4:1,cursor:$||!B||!V||!M?"not-allowed":"pointer"},children:$?"Cambiandoâ¦":"Cambiar contraseña"})]})})]})}function wm({value:t,size:a=56}){const r=(a-8)/2,s=2*Math.PI*r,n=t/100*s,o=t>=80?"#00E5A0":t>=55?"#FFB800":"#FF4757";return e.jsxs("svg",{width:a,height:a,"aria-label":`Puntuación: ${t}`,children:[e.jsx("circle",{cx:a/2,cy:a/2,r,fill:"none",stroke:"rgba(255,255,255,0.06)",strokeWidth:4}),e.jsx("circle",{cx:a/2,cy:a/2,r,fill:"none",stroke:o,strokeWidth:4,strokeDasharray:`${n} ${s-n}`,strokeDashoffset:s/4,strokeLinecap:"round",style:{transition:"stroke-dasharray 1s cubic-bezier(0.4,0,0.2,1)"}}),e.jsx("text",{x:a/2,y:a/2+5,textAnchor:"middle",fill:o,style:{fontSize:14,fontFamily:"'JetBrains Mono', monospace",fontWeight:700},children:t})]})}function km({tech:t,index:a}){const r=Math.round((t.confidence||0)*100),s=r>=70?"#00E5A0":r>=40?"#FFB800":"rgba(255,255,255,0.4)";return e.jsxs("div",{className:"rounded-xl border p-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",animation:`fadeSlideUp 0.4s ${.1+a*.08}s both`},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[e.jsx("span",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.9)"},children:t.technique_name}),e.jsxs("span",{className:"text-xs font-bold shrink-0",style:{color:s,fontFamily:"'JetBrains Mono', monospace"},children:[r,"%"]})]}),t.evidence&&e.jsxs("p",{className:"text-xs italic mb-2",style:{color:"rgba(255,255,255,0.5)",borderLeft:"2px solid rgba(0,229,160,0.3)",paddingLeft:8},children:["«",t.evidence,"»"]}),t.notes&&e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.65)"},children:t.notes})]})}function Sm({imp:t,priorityColor:a,onApply:r}){const[s,n]=i.useState("idle"),o=async()=>{if(!(s!=="idle"||!r)){n("loading");try{await r(t),n("done")}catch{n("error"),setTimeout(()=>n("idle"),3e3)}}},l=s==="loading"?"Generandoâ¦":s==="done"?"â Añadido":s==="error"?"Error, reintentar":"+ Añadir al script",c=s==="loading"||s==="done";return e.jsxs("div",{className:"rounded-xl border p-4",style:{background:"rgba(255,255,255,0.02)",borderColor:s==="done"?"rgba(0,229,160,0.2)":"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1.5",children:[e.jsxs("div",{className:"flex items-start gap-2 flex-1 min-w-0",children:[e.jsx("span",{className:"text-xs uppercase font-semibold shrink-0 mt-0.5",style:{color:a,fontFamily:"'JetBrains Mono', monospace"},children:t.priority}),e.jsx("span",{className:"text-sm font-medium",style:{color:"rgba(255,255,255,0.85)"},children:t.issue})]}),r&&e.jsx("button",{onClick:o,disabled:c,className:"shrink-0 text-xs px-3 py-1 rounded-lg transition-all duration-200",style:{background:s==="done"?"rgba(0,229,160,0.08)":s==="error"?"rgba(255,71,87,0.08)":"rgba(255,255,255,0.05)",border:s==="done"?"1px solid rgba(0,229,160,0.3)":s==="error"?"1px solid rgba(255,71,87,0.3)":"1px solid rgba(255,255,255,0.1)",color:s==="done"?"#00E5A0":s==="error"?"#FF4757":s==="loading"?"rgba(255,255,255,0.4)":"rgba(255,255,255,0.6)",cursor:c?"default":"pointer",whiteSpace:"nowrap"},children:l})]}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.65)"},children:t.suggestion})]})}const Ei=[{key:"embedded_commands",label:"Comandos Encubiertos",weight:"25%"},{key:"presuppositions",label:"Presuposiciones",weight:"20%"},{key:"pacing_leading",label:"Acompasamiento",weight:"15%"},{key:"sensory_language",label:"Lenguaje Sensorial",weight:"10%"},{key:"technique_execution",label:"Ejecución Técnica",weight:"15%"},{key:"rapport_naturalness",label:"Rapport y Naturalidad",weight:"15%"}],Am=new Set(Ei.map(t=>t.key)),go={naturalness:"Naturalidad",pacing_rapport:"Acompasamiento y Rapport",permissive_language:"Lenguaje Permisivo",change_arc:"Arco de Cambio",sensory_richness:"Riqueza Sensorial",induction_depth:"Profundidad de Inducción",warmth_authenticity:"Calidez y Autenticidad",emotional_depth:"Profundidad Emocional",non_transactional:"Ausencia de Presión"};function Em(t){return t>=80?"#00E5A0":t>=55?"#FFB800":"#FF4757"}function Cm({breakdown:t}){if(!t||Object.keys(t).length===0)return null;const a=Ei.filter(o=>t[o.key]!==void 0),r=Object.entries(t).filter(([o])=>!Am.has(o)&&go[o]);if(!(a.length>0||r.length>0))return null;const n=(o,l,c,d)=>{const u=Em(c);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.75)",fontFamily:"'JetBrains Mono', monospace"},children:l}),e.jsxs("div",{className:"flex items-center gap-2",children:[d&&e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace",fontSize:"10px"},children:d}),e.jsx("span",{className:"text-xs font-bold",style:{color:u,fontFamily:"'JetBrains Mono', monospace",minWidth:28,textAlign:"right"},children:c})]})]}),e.jsx("div",{className:"w-full rounded-full overflow-hidden",style:{height:5,background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{style:{width:`${c}%`,height:"100%",background:u,borderRadius:9999,transition:"width 0.8s cubic-bezier(0.4,0,0.2,1)"}})})]},o)};return e.jsxs("div",{className:"rounded-xl border p-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-4",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"}
586,children:"Desglose de calidad"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[a.map(o=>n(o.key,o.label,t[o.key],o.weight)),r.map(([o,l])=>n(o,go[o]||o,l,null))]})]})}function _m({analysis:t,analysisVersion:a=0,onReanalyze:r,analyzing:s,onApplySuggestion:n}){if(!t)return null;const{detected_techniques:o=[],overall_quality:l=0,strengths:c=[],improvements:d=[],coaching_note:u,quality_breakdown:m}=t;return e.jsxs("div",{className:"flex flex-col gap-5",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(wm,{value:l}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-0.5",style:{color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:"Calidad del script"}),e.jsx("p",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.85)"},children:o.length===0?"Sin técnicas detectadas":`${o.length} técnica${o.length>1?"s":""} detectada${o.length>1?"s":""}`})]})]}),e.jsx("button",{onClick:r,disabled:s,className:"text-xs px-4 py-2 rounded-xl transition-all duration-200",style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.2)",color:s?"rgba(0,229,160,0.4)":"#00E5A0",cursor:s?"not-allowed":"pointer"},children:s?"Analizandoâ¦":"Re-analizar"})]}),o.length>0&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"},children:"Técnicas detectadas"}),o.map((p,x)=>e.jsx(km,{tech:p,index:x},p.technique_id||x))]}),e.jsx(Cm,{breakdown:m}),c.length>0&&e.jsxs("div",{className:"rounded-xl border p-4",style:{background:"rgba(0,229,160,0.04)",borderColor:"rgba(0,229,160,0.15)"},children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"Puntos fuertes"}),e.jsx("ul",{className:"flex flex-col gap-1.5",children:c.map((p,x)=>e.jsxs("li",{className:"flex items-start gap-2 text-sm",style:{color:"rgba(255,255,255,0.8)"},children:[e.jsx("span",{style:{color:"#00E5A0",marginTop:2},children:"â"}),p]},x))})]}),d.length>0&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("p",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"},children:"Mejoras sugeridas"}),d.map((p,x)=>{const v=p.priority==="high"?"#FF4757":p.priority==="medium"?"#FFB800":"rgba(255,255,255,0.4)";return e.jsx(Sm,{imp:p,priorityColor:v,onApply:n},`${a}-${x}`)})]}),u&&e.jsxs("div",{className:"rounded-xl border p-4",style:{background:"rgba(0,180,216,0.04)",borderColor:"rgba(0,180,216,0.15)"},children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-2",style:{color:"#00B4D8",fontFamily:"'JetBrains Mono', monospace"},children:"Nota del coach"}),e.jsx("p",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.8)"},children:u})]})]})}const Fm=`Escribe tu script aquÃ... 587 588O simplemente escribe el diálogo que vas a practicar. 589Usa los botones de marcadores para insertar pausas y comandos.`;function Mm(t,a,r,s){const n=t.selectionStart,o=t.selectionEnd,l=t.value,c=l.substring(0,n),m=(c.length>0&&!c.endsWith(` 590`)?` 591`:"")+a,p=c+m+l.substring(o);r(p);const x=n+m.length-(s||0);requestAnimationFrame(()=>{t.focus(),t.setSelectionRange(x,x)})}const Tm=[{label:"[PAUSA 1s]",title:"Pre-comando â va en la lÃnea inmediatamente ANTES de [BAJAR TONO â COMANDO]",text:`[PAUSA 1s] 592`,color:"#FFB800",bg:"rgba(255,184,0,0.08)",border:"rgba(255,184,0,0.2)"},{label:"[PAUSA 2s]",title:"Post-comando â va en la lÃnea inmediatamente DESPUÃS de [BAJAR TONO â COMANDO]",text:`[PAUSA 2s] 593`,color:"#FFB800",bg:"rgba(255,184,0,0.08)",border:"rgba(255,184,0,0.2)"},{label:'[BAJAR TONO] "comando"',title:"Insertar comando encubierto. El cursor queda entre las comillas para que escribas el texto",text:'[BAJAR TONO â COMANDO] ""',color:"#FF4757",bg:"rgba(255,71,87,0.08)",border:"rgba(255,71,87,0.2)",afterInsertOffset:1}];function Pm({textareaRef:t,setScript:a}){return e.jsxs("div",{className:"rounded-t-xl border-x border-t px-3 py-2 flex items-center gap-2 flex-wrap",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.08)"},"aria-label":"Marcadores de script",children:[e.jsx("span",{className:"text-xs mr-1 shrink-0",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:"Insertar:"}),Tm.map(r=>e.jsx("button",{type:"button",title:r.title,onClick:()=>{t.current&&Mm(t.current,r.text,a,r.afterInsertOffset??0)},className:"text-xs px-2.5 py-1 rounded-lg transition-all duration-150 shrink-0",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color,fontFamily:"'JetBrains Mono', monospace",cursor:"pointer",whiteSpace:"nowrap"},onMouseEnter:s=>{s.currentTarget.style.opacity="0.75"},onMouseLeave:s=>{s.currentTarget.style.opacity="1"},children:r.label},r.label))]})}const Lm=[{marker:"[PAUSA 1s]",color:"#FFB800",role:"Pre-comando: vacÃo de atención",when:"Ãnicamente en la lÃnea inmediatamente ANTES de un [BAJAR TONO â COMANDO]. El segundo de silencio desactiva el factor crÃtico y prepara al inconsciente para recibir la directiva.",tips:["Solo va antes de BAJAR TONO. Cualquier otra pausa natural se representa con una lÃnea en blanco.","El inconsciente del oyente 'anticipa' sin saber qué viene: ese es el momento de insertar la directiva.","No uses más de 3 comandos por script o el patrón se vuelve predecible."]},{marker:"[PAUSA 2s]",color:"#FFB800",role:"Post-comando: absorción",when:"Ãnicamente en la lÃnea inmediatamente DESPUÃS de un [BAJAR TONO â COMANDO]. Los 2 segundos permiten que la directiva se ancle sin interferencia consciente.",tips:["Solo va después de BAJAR TONO. No la uses en ningún otro lugar del script.","Durante esta pausa mantén contacto visual tranquilo y no rellenes el silencio con movimiento.","Retoma la narrativa con naturalidad después, como si nada especial hubiera ocurrido."]},{marker:'[BAJAR TONO â COMANDO] "â¦"',color:"#FF4757",role:"Marca analógica: comando encubierto",when:"El texto entre comillas es la directiva que debe procesar el inconsciente del oyente. El cambio de tono lo diferencia sin que sea percibido conscientemente.",tips:["Baja el pitch un 10â15% y el volumen ligeramente: más Ãntimo, no más débil.","Habla más despacio durante el comando: 70â80% de tu velocidad normal.","El comando debe estar en infinitivo o modo imperativo suave: 'decidir ahora', 'sentir que encaja', 'dar el siguiente paso'.","Nunca uses negaciones: 'no tengas miedo' activa 'miedo'. Di 'sentir seguridad' en su lugar.","Encapsula el comando dentro de una frase subordinada: 'mientras escuchas esto, puedes [COMANDO]'."]}];function Rm(){const[t,a]=i.useState(!1),[r,s]=i.useState(null);return e.jsxs("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(255,255,255,0.07)",background:"rgba(255,255,255,0.015)"},children:[e.jsxs("button",{type:"button",onClick:()=>a(n=>!n),className:"w-full flex items-center justify-between px-4 py-3 transition-colors duration-150",style:{background:"none",border:"none",cursor:"pointer",textAlign:"left"},"aria-expanded":t,"aria-controls":"best-practices-content",onMouseEnter:n=>{n.currentTarget.style.background="rgba(255,255,255,0.03)"},onMouseLeave:n=>{n.currentTarget.style.background="transparent"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{fontSize:13,color:"#00B4D8"},children:"?"}),e.jsx("span",{className:"text-xs font-semibold",style:{color:"rgba(255,255,255,0.65)"},children:"GuÃa de marcadores · buenas prácticas PNL"})]}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"rgba(255,255,255,0.55)"},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),t&&e.jsx("div",{id:"best-practices-content",className:"flex flex-col border-t",style:{borderColor:"rgba(255,255,255,0.05)"},children:Lm.map((n,o)=>{const l=r===o;return e.jsxs("div",{className:"border-b last:border-b-0",style:{borderColor:"rgba(255,255,255,0.04)"},children:[e.jsxs("button",{type:"button",onClick:()=>s(l?null:o),className:"w-full flex items-center justify-between px-4 py-3 transition-colors duration-150",style:{background:"none",border:"none",cursor:"pointer",textAlign:"left"},"aria-expanded":l,onMouseEnter:c=>{c.currentTarget.style.background="rgba(255,255,255,0.02)"},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs font-bold",style:{color:n.color,fontFamily:"'JetBrains Mono', monospace"},children:n.marker}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.5)"},children:n.role})]}),e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:{transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"rgba(255,255,255,0.25)",flexShrink:0},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),l&&e.jsxs("div",{className:"px-4 pb-4 flex flex-col gap-3",style:{animation:"fadeSlideUp 0.2s both"},children:[e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.65)"},children:n.when}),e.jsx("ul",{className:"flex flex-col gap-1.5",children:n.tips.map((c,d)=>e.jsxs("li",{className:"flex items-start gap-2 text-xs",style:{color:"rgba(255,255,255,0.5)"},children:[e.jsx("span",{style:{color:n.color,marginTop:1,flexShrink:0},children:"·"}),c]},d))})]})]},o)})})]})}const Bm=[{id:"persuasion",label:"Persuasión",desc:"Influir en una decisión",color:"#00E5A0"},{id:"session",label:"Sesión",desc:"Facilitar un cambio",color:"#00B4D8"},{id:"relation",label:"Relación",desc:"Conversación cercana",color:"#FFB800"}];function zm({mode:t,setMode:a}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-sm font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.12em"},children:"¿Qué quieres practicar?"}
593),e.jsx("div",{className:"flex rounded-xl p-1 gap-1",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},role:"radiogroup","aria-label":"Modo de práctica",children:Bm.map(r=>{const s=t===r.id;return e.jsxs("button",{type:"button",role:"radio","aria-checked":s,onClick:()=>a(r.id),className:"flex-1 flex flex-col items-center gap-0.5 px-2 py-2 rounded-lg transition-all duration-200",style:{background:s?`${r.color}18`:"transparent",border:s?`1px solid ${r.color}40`:"1px solid transparent",cursor:"pointer"},children:[e.jsx("span",{className:"text-sm font-semibold",style:{color:s?r.color:"rgba(255,255,255,0.45)"},children:r.label}),e.jsx("span",{className:"text-sm text-center leading-tight",style:{color:s?"rgba(255,255,255,0.6)":"rgba(255,255,255,0.25)"},children:r.desc})]},r.id)})})]})}const sa=["#A78BFA","#FB923C","#38BDF8","#F472B6"];function Im(t,a){if(!a)return null;let r=t.indexOf(a);if(r!==-1)return{start:r,end:r+a.length};const s=u=>u.normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase(),n=s(t),o=s(a);if(r=n.indexOf(o),r!==-1)return{start:r,end:r+a.length};const l=o.split(/\s+/).filter(Boolean);if(l.length<3)return null;const c=.6,d=a.length;for(let u=0;u<=n.length-Math.floor(d*.5);u++){const m=n.slice(u,u+Math.floor(d*1.5)),p=new Set(m.split(/\s+/).filter(Boolean));if(l.filter(v=>p.has(v)).length/l.length>=c)return{start:u,end:Math.min(u+d,t.length)}}return null}function Dm(t,a,r){if(!t)return null;const s=a||[],n=[];s.forEach(d=>{if(!d.text_snippet)return;const u=(d.technique_name||d.technique_id||"").toLowerCase(),m=Im(t,d.text_snippet);m&&n.push({...m,techniqueKey:u})});const o=t.split(` 594`),l=[];let c=0;return o.forEach((d,u)=>{u>0&&(l.push(` 595`),c+=1);const m=c,p=c+d.length;c=p;const x=d.trim();if(!x){l.push(d);return}if(x.startsWith("[PAUSA")){l.push(e.jsx("span",{style:{color:"#FFB800"},children:d},`l${u}`));return}if(/^\[(NOTA|FASE|VISUAL|AUDITIVO|CINESTÃSICO)/.test(x)){l.push(e.jsx("span",{style:{color:"#00B4D8",fontStyle:"italic",opacity:.85},children:d},`l${u}`));return}if(x.startsWith("[BAJAR TONO")){const y=x.indexOf('"'),j=d.match(/^(\s*)/)[1];y!==-1?l.push(e.jsxs("span",{children:[j,e.jsx("span",{style:{color:"#FF4757"},children:x.slice(0,y)}),e.jsx("span",{style:{color:"#00E5A0",fontWeight:700},children:x.slice(y)})]},`l${u}`)):l.push(e.jsx("span",{style:{color:"#FF4757"},children:d},`l${u}`));return}const v=n.filter(y=>y.start<p&&y.end>m).map(y=>({start:Math.max(y.start,m)-m,end:Math.min(y.end,p)-m,techniqueKey:y.techniqueKey})).sort((y,j)=>y.start-j.start);if(!v.length){l.push(e.jsx("span",{style:{color:"rgba(255,255,255,0.9)"},children:d},`l${u}`));return}const f=[v[0]];for(let y=1;y<v.length;y++){const j=f[f.length-1];v[y].start<=j.end?j.end=Math.max(j.end,v[y].end):f.push(v[y])}const h=[];let g=0;f.forEach(y=>{y.start>g&&h.push({text:d.slice(g,y.start),annotated:!1}),h.push({text:d.slice(y.start,y.end),annotated:!0,color:r[y.techniqueKey]??sa[0]}),g=y.end}),g<d.length&&h.push({text:d.slice(g),annotated:!1}),l.push(e.jsx("span",{style:{color:"rgba(255,255,255,0.9)"},children:h.map((y,j)=>y.annotated?e.jsx("span",{style:{textDecoration:"underline",textDecorationColor:y.color,textDecorationStyle:"solid",textUnderlineOffset:"3px",textDecorationThickness:"2px",color:"rgba(255,255,255,0.95)"},children:y.text},j):y.text)},`l${u}`))}),l}function $m({onUseScript:t,mode:a,isPremium:r,onOpenChange:s}){var U,X;const n=he(),{techniques:o}=Ut(),[l,c]=i.useState(!1),[d,u]=i.useState("auto"),[m,p]=i.useState(""),[x,v]=i.useState(""),[f,h]=i.useState(""),[g,y]=i.useState([]),[j,F]=i.useState([]),[C,N]=i.useState(!1),[b,w]=i.useState(null),[L,z]=i.useState(null),[A,S]=i.useState(!1),[_,D]=i.useState(!1),[q,H]=i.useState(null);i.useEffect(()=>{r&&R.get("/api/progress").then(T=>F((T==null?void 0:T.practiced_technique_ids)??[])).catch(()=>{})},[r]);const oe=(o||[]).filter(T=>j.includes(T.id)),ie=i.useCallback(T=>{y($=>$.includes(T)?$.filter(Y=>Y!==T):$.length>=4?$:[...$,T])},[]),B=i.useCallback(async()=>{if(!(!m.trim()||m.trim().length<10)){N(!0),z(null),w(null),D(!1),H(null);try{const T={prompt:m.trim(),mode:a};d==="manual"&&g.length>0&&(T.requested_technique_ids=g),x.trim()&&(T.context_product=x.trim()),f.trim()&&(T.context_client=f.trim());const $=await R.post("/api/generate-script",T);w($)}catch(T){z((T==null?void 0:T.message)||"Error al generar el script.")}finally{N(!1)}}},[m,a,g,x,f]),K=i.useCallback(async()=>
595{if(!(!(b!=null&&b.script)||A||_)){S(!0),H(null);try{await R.post("/api/scripts/save",{script_text:b.script,mode:a,script_type:"ai_generated",technique_id:b.technique_id,technique_name:b.technique_name,commands_used:b.commands_used,approach_notes:b.approach_notes}),D(!0)}catch(T){H((T==null?void 0:T.message)||"Error al guardar el script.")}finally{S(!1)}}},[b,a,A,_]),V=i.useCallback(()=>{b!=null&&b.script&&(t(b.script,b.commands_used||[]),c(!1),w(null),p(""))},[b,t]);if(!r)return e.jsxs("div",{className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(255,184,0,0.15)",background:"rgba(255,184,0,0.02)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{fontSize:13,color:"rgba(0,180,216,0.35)"},children:"â¦"}),e.jsx("span",{className:"text-xs font-semibold",style:{color:"rgba(255,255,255,0.6)"},children:"Generar script con IA"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{icon:_a,style:{color:"#FFB800",fontSize:11},"aria-hidden":"true"}),e.jsxs("button",{type:"button",onClick:()=>n("/billing"),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-bold transition-all duration-200",style:{background:"rgba(255,184,0,0.09)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",cursor:"pointer"},onMouseEnter:T=>{T.currentTarget.style.background="rgba(255,184,0,0.16)"},onMouseLeave:T=>{T.currentTarget.style.background="rgba(255,184,0,0.09)"},children:[e.jsx(J,{icon:er,style:{fontSize:10},"aria-hidden":"true"}),"Premium"]})]})]}),e.jsx("div",{className:"px-4 pb-3 border-t",style:{borderColor:"rgba(255,184,0,0.08)"},children:e.jsx("p",{className:"text-xs mt-2.5",style:{color:"rgba(255,255,255,0.6)"},children:"La generación de scripts con IA está disponible para usuarios Premium. Con Premium puedes crear scripts NLP completos desde cualquier situación, practicar todas las técnicas avanzadas y acceder a evaluaciones ilimitadas."})})]});const P={};d==="manual"&&g.forEach((T,$)=>{const Y=oe.find(ae=>ae.id===T);Y&&(P[Y.name.toLowerCase()]=sa[$%sa.length])}),b!=null&&b.annotations&&b.annotations.forEach(T=>{var Y;const $=(Y=T.technique_name)==null?void 0:Y.toLowerCase();$&&!P[$]&&(P[$]=sa[Object.keys(P).length%sa.length])});const M=b!=null&&b.script?Dm(b.script,b.annotations,P):null;return e.jsxs("div",{id:"tour-script-generator",className:"rounded-xl border overflow-hidden",style:{borderColor:"rgba(0,180,216,0.2)",background:"rgba(0,180,216,0.03)"},children:[e.jsxs("button",{type:"button",onClick:()=>c(T=>{const $=!T;return s==null||s($),$}),className:"w-full flex items-center justify-between px-4 py-3 transition-colors duration-150",style:{background:"none",border:"none",cursor:"pointer",textAlign:"left"},"aria-expanded":l,"aria-controls":"script-generator-content",onMouseEnter:T=>{T.currentTarget.style.background="rgba(0,180,216,0.04)"},onMouseLeave:T=>{T.currentTarget.style.background="transparent"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{style:{fontSize:13,color:"#00B4D8"},children:"â¦"}),e.jsx("span",{className:"text-xs font-semibold",style:{color:"rgba(255,255,255,0.75)"},children:"Generar script con IA"}),e.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded",style:{background:"rgba(0,180,216,0.12)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8",fontFamily:"'JetBrains Mono', monospace"},children:"Premium"})]}),e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",style:{transform:l?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"rgba(0,180,216,0.5)"},children:e.jsx("path",{d:"M2 4l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),l&&e.jsxs("div",{id:"script-generator-content",className:"px-4 pb-4 flex flex-col gap-4 border-t",style:{borderColor:"rgba(0,180,216,0.1)",animation:"fadeSlideUp 0.2s both"},children:[e.jsx("p",{className:"text-xs mt-3",style:{color:"rgba(255,255,255,0.55)"},children:"Describe la situación que quieres trabajar. La IA generará un script completo con las técnicas PNL seleccionad
595as y marcadores listos para practicar."}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.55)"},children:"Técnicas a aplicar"}),e.jsx("div",{className:"flex gap-2",children:[{key:"auto",label:"Selección automática"},{key:"manual",label:"Elegir manualmente"}].map(({key:T,label:$})=>e.jsx("button",{type:"button",onClick:()=>{u(T),y([])},className:"text-xs px-3 py-1.5 rounded-lg transition-all duration-150 font-medium",style:{background:d===T?"rgba(0,180,216,0.15)":"rgba(255,255,255,0.04)",border:`1px solid ${d===T?"rgba(0,180,216,0.4)":"rgba(255,255,255,0.1)"}`,color:d===T?"#00B4D8":"rgba(255,255,255,0.45)",cursor:"pointer"},children:$},T))}),d==="auto"&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"La IA elige las técnicas más adecuadas para tu situación y contexto."}),d==="manual"&&oe.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:["Solo aparecen técnicas que has practicado · hasta 4",e.jsxs("span",{style:{color:g.length===4?"#FB923C":"rgba(255,255,255,0.35)",marginLeft:6},children:["(",g.length,"/4)"]})]}),g.length>0&&e.jsx("button",{type:"button",onClick:()=>y([]),className:"text-xs transition-colors",style:{color:"rgba(255,255,255,0.35)",background:"none",border:"none",cursor:"pointer"},onMouseEnter:T=>{T.currentTarget.style.color="rgba(255,255,255,0.6)"},onMouseLeave:T=>{T.currentTarget.style.color="rgba(255,255,255,0.35)"},children:"Limpiar"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:oe.map(T=>{const $=g.includes(T.id),Y=g.indexOf(T.id),ae=$?sa[Y%sa.length]:null,de=!$&&g.length>=4;return e.jsx("button",{type:"button",onClick:()=>!de&&ie(T.id),className:"text-xs px-2.5 py-1 rounded-lg transition-all duration-150",style:{background:$?`${ae}18`:"rgba(255,255,255,0.04)",border:`1px solid ${$?ae+"55":"rgba(255,255,255,0.1)"}`,color:$?ae:"rgba(255,255,255,0.5)",cursor:de?"not-allowed":"pointer",opacity:de?.4:1,fontWeight:$?600:400},children:T.name},T.id)})})]}),d==="manual"&&oe.length===0&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"TodavÃa no has practicado ninguna técnica. Completa al menos una sesión para poder seleccionarlas aquÃ."})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.7)"},children:"Situación *"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:m,onChange:T=>{p(T.target.value),z(null)},onKeyDown:T=>{T.key==="Enter"&&!C&&B()},placeholder:"Ej: cerrar una venta con un cliente que dice que es caroâ¦",maxLength:500,className:"flex-1 px-3 py-2.5 rounded-xl text-sm outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(0,180,216,0.4)",color:"rgba(255,255,255,0.9)",fontFamily:"'JetBrains Mono', monospace",fontSize:13},onFocus:T=>{T.target.style.borderColor="#00B4D8",T.target.style.background="rgba(255,255,255,0.11)"},onBlur:T=>{T.target.style.borderColor="rgba(0,180,216,0.4)",T.target.style.background="rgba(255,255,255,0.08)"},"aria-label":"Descripción de la situación",disabled:C}),e.jsx("button",{type:"button",onClick:B,disabled:C||m.trim().length<10,className:"px-4 py-2.5 rounded-xl text-xs font-semibold transition-all duration-200 shrink-0",style:{background:"linear-gradient(135deg, #00B4D8, #0096B7)",color:"white",border:"none",opacity:C||m.trim().length<10?.4:1,cursor:C||m.trim().length<10?"not-allowed":"pointer"},children:C?"Generandoâ¦":"Generar"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Pedir una subida de sueldo","Cerrar venta con objeción de precio","Convencer al equipo de un cambio"].map(T=>e.jsx("button",{type:"button",onClick:()=>p(T),className:"text-xs px-2 py-0.5 rounded transition-all duration-150",style:{background:"rgba(0,180,216,0.05)",border:"1px solid rgba(0,180,216,0.12)",color:"rgba(255,255,255,0.45)",cursor:"pointer"},onMouseEnter:$=>{$.currentTarget.style.color="rgba(255,255,255,0.75)",$.currentTarget.style.borderColor="rgba(0,180,216,0.3)"},onMouseLeave:$=>{$.currentTarget.style.color="rgba(255,255,255,0.45)",$.currentTarget.style.borderColor="rgba(0,180,216,0.12)"},children:T},T))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.6)"},children:"Producto / servicio"}),e.jsx("input",{type:"text",value:x,onChange:T=>v(T.target.value),placeholder:"Ej: software de RRHH",maxLength:200,className:"px-3 py-2 rounded-xl text-xs outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"rgba(255,255,255,0.85)",fontFamily:"'JetBrains Mono', monospace"},onFocus:T=>{T.target.style.borderColor="rgba(0,180,216,0.5)",T.target.style.background="rgba(255,255,255,0.11)"},onBlur:T=>{T.target.style.borderColor="rgba(255,255,255,0.18)",T.target.style.background="rgba(255,255,255,0.08)"},disabled:C})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"rgba(255,255,255,0.6)"},children:"Perfil del interlocutor"}),e.jsx("input",{type:"text",value:f,onChange:T=>h(T.target.value),placeholder:"Ej: director de operaciones",maxLength:200,className:"px-3 py-2 rounded-xl text-xs outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,255,255,0.18)",color:"rgba(255,255,255,0.85)",fontFamily:"'JetBrains Mono', monospace"},onFocus:T=>{T.target.style.borderColor="rgba(0,180,216,0.5)",T.target.style.background="rgba(255,255,255,0.11)"},onBlur:T=>{T.target.style.borderColor="rgba(255,255,255,0.18)",T.target.style.background="rgba(255,255,255,0.08)"},disabled:C})]})]}),L&&e.jsx("p",{className:"text-xs",style:{color:"#FF4757"},role:"alert",children:L}),b&&e.jsxs("div",{className:"flex flex-col gap-3 rounded-xl border p-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(0,229,160,0.15)",animation:"fadeSlideUp 0.3s both"},children:[b.technique_name&&e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded self-start",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:b.technique_name}),b.approach_notes&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.5)"},children:b.approach_notes})]}),M&&e.jsxs("div",{children:[e.jsx("div",{className:"rounded-xl overflow-auto",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)",padding:"14px 16px",fontFamily:"'JetBrains Mono', monospace",fontSize:13,lineHeight:1.7,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:320,overflowY:"auto"},children:M}),e.jsx("div",{className:"mt-2 flex flex-col gap-1.5",children:Object.keys(P).length>0?e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(P).map(([T,$])=>e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded flex items-center gap-1.5",style:{background:`${$}15`,border:`1px solid ${$}40`,color:$,fontFamily:"'JetBrains Mono', monospace"},children:[e.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:$,display:"inline-block"}}),T.charAt(0).toUpperCase()+T.slice(1)]},T))}):((U=b==null?void 0:b.annotations)==null?void 0:U.length)>0&&e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.3)"},children:[b.annotations.length," técnica(s) anotadas"]})})]}),((X=b.commands_used)==null?void 0:X.length)>0&&e.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:"Comandos:"}),b.commands_used.map((T,$)=>e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded",style:{background:"rgba(0,229,160,0.07)",border:"1px solid rgba(0,229,160,0.15)",color:"rgba(0,229,160,0.8)",fontFamily:"'JetBrains Mono', monospace"},children:['"',T,'"']},$))]}),e.jsxs("div",{className:"flex gap-2 pt-1 flex-wrap",children:[e.jsx("button",{type:"button",onClick:V,className:"px-4 py-2 rounded-xl text-xs font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:"pointer"},onMouseEnter:T=>{T.currentTarget.style.transform="scale(1.03)"},onMouseLeave:T=>{T.currentTarget.style.transform="scale(1)"},children:"Usar este script"}),e.jsx("button",{type:"button",onClick:K,disabled:A||_,className:"px-4 py-2 rounded-xl text-xs font-semibold transition-all duration-200",style:{background:_?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.04)",border:_?"1px solid rgba(0,229,160,0.3)":"1px solid rgba(255,255,255,0.12)",color:_?"#00E5A0":"rgba(255,255,255,0.65)",cursor:A||_?"not-allowed":"pointer",opacity:A?.6:1},"aria-label":"Guardar en biblioteca",children:_?"Guardado":A?"Guardandoâ¦":"Guardar en biblioteca"}),e.jsx("button",{type:"button",onClick:B,disabled:C,className:"px-4 py-2 rounded-xl text-xs transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.55)",cursor:C?"not-allowed":"pointer",opacity:C?.4:1},children:C?"Generandoâ¦":"Regenerar"})]}),q&&e.jsx("p",{className:"text-xs",style:{color:"#FF4757"},role:"alert",children:q})]})]})]})}
595function Om(t){const a=t.split(` 596`),r=[];return a.forEach((s,n)=>{n>0&&r.push(` 597`);const o=s.trim();if(!o){r.push(s);return}if(o.startsWith("[PAUSA")){r.push(e.jsx("span",{style:{color:"#FFB800"},children:s},n));return}if(/^\[(NOTA|FASE|VISUAL|AUDITIVO|CINESTÃSICO)/.test(o)){r.push(e.jsx("span",{style:{color:"#00B4D8",fontStyle:"italic",opacity:.85},children:s},n));return}if(o.startsWith("[BAJAR TONO")){const l=o.indexOf('"');if(l!==-1){const c=s.match(/^(\s*)/)[1],d=o.slice(0,l),u=o.slice(l);r.push(e.jsxs("span",{children:[c,e.jsx("span",{style:{color:"#FF4757"},children:d}),e.jsx("span",{style:{color:"#00E5A0",fontWeight:700},children:u})]},n))}else r.push(e.jsx("span",{style:{color:"#FF4757"},children:s},n));return}r.push(e.jsx("span",{style:{color:"rgba(255,255,255,0.9)"},children:s},n))}),r}function qm({value:t,onChange:a,textareaRef:r,placeholder:s,rows:n,maxLength:o,onFocus:l,onBlur:c}){const d=i.useRef(null),u={fontFamily:"'JetBrains Mono', monospace",fontSize:13,lineHeight:1.7,padding:"16px 20px 36px",whiteSpace:"pre-wrap",wordBreak:"break-word",overflowWrap:"break-word"},m=()=>{d.current&&r.current&&(d.current.scrollTop=r.current.scrollTop)};return e.jsxs("div",{className:"relative",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)",borderTop:"none",borderRadius:"0 0 12px 12px",overflow:"hidden"},children:[e.jsxs("div",{ref:d,"aria-hidden":"true",style:{...u,position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden",color:"transparent"},children:[Om(t),` 598`]}),e.jsx("textarea",{ref:r,value:t,onChange:a,onScroll:m,placeholder:s,rows:n,maxLength:o,className:"script-editor w-full outline-none resize-none transition-colors duration-200 relative",style:{...u,background:"transparent",border:"none",display:"block",width:"100%",zIndex:1},onFocus:p=>{var v;p.target.closest(".relative").style.borderColor="rgba(0,229,160,0.3)";const x=(v=p.target.closest(".flex.flex-col"))==null?void 0:v.querySelector("[aria-label='Marcadores de script']");x&&(x.style.borderColor="rgba(0,229,160,0.3)"),l==null||l(p)},onBlur:p=>{var v;p.target.closest(".relative").style.borderColor="rgba(255,255,255,0.08)";const x=(v=p.target.closest(".flex.flex-col"))==null?void 0:v.querySelector("[aria-label='Marcadores de script']");x&&(x.style.borderColor="rgba(255,255,255,0.08)"),c==null||c(p)},"aria-label":"Script personalizado"})]})}function Ci({onSave:t,saving:a,saved:r,saveError:s,disabledReason:n}){const o=a||r||!!n;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:t,disabled:o,title:n||void 0,className:"px-5 py-2.5 rounded-xl text-sm transition-all duration-200",style:{background:r?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.04)",border:r?"1px solid rgba(0,229,160,0.3)":"1px solid rgba(255,255,255,0.1)",color:r?"#00E5A0":n?"rgba(255,255,255,0.25)":"rgba(255,255,255,0.65)",cursor:o?"default":"pointer"},"aria-label":"Guardar en biblioteca",children:r?"â Guardado":a?"Guardandoâ¦":"Guardar en biblioteca"}),s&&e.jsx("span",{className:"text-xs",style:{color:"#FF4757"},children:s})]})}function Um({script:t,setScript:a,onAnalyze:r,analyzing:s,analyzeDisabledReason:n,onSkip:o,mode:l,setMode:c,onSave:d,saving:u,saved:m,saveError:p,saveDisabledReason:x,isPremium:v,loadedFromLibrary:f,libraryTechniqueName:h,onSetGeneratedCommands:g}){const y=i.useRef(null),j=t.trim().length,[F,C]=i.useState(!1),N=i.useCallback((b,w)=>{a(b),g&&g(w||[]),C(!1),requestAnimationFrame(()=>{var L;return(L=y.current)==null?void 0:L.scrollIntoView({behavior:"smooth",block:"center"})})},[a,g]);return e.jsxs("div",{id:"tour-custom-editor",className:"flex flex-col gap-5",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsx("div",{children:f?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Práctica · Script de Biblioteca"}),e.jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Script de Biblioteca"}),h&&e.jsxs("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:["Técnica: ",e.jsx("span",{style:{color:"#00E5A0"},children:h}),". Graba directamente o edita antes de practicar."]})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Práctica · Script Propio"}),e.jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Script propio"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Escribe tu script de ventas o discurso. La IA detectará las técnicas que uses."})]})}),f&&t&&e.jsx(Xt,{script:t,defaultExpanded:!0,annotations:[]}),v&&e.jsx(zm,{mode:l,setMode:c}),e.jsx($m,{onUseScript:N,mode:l,isPremium:v,onOpenChange:C}),e.jsxs("div",{className:"flex flex-col",style:{display:F?"none":void 0},children:[e.jsx(Pm,{textareaRef:y,setScript:a}),e.jsxs("div",{className:"relative",children:[e.jsx(qm,{value:t,onChange:b=>a(b.target.value),textareaRef:y,placeholder:Fm,rows:14,maxLength:1e4}),e.jsxs("span",{className:"absolute bottom-3 right-4 text-xs",style:{color:"rgba(255,255,255,0.25)",fontFamily:"'JetBrains Mono', monospace",zIndex:2,pointerEvents:"none"},children:[j,"/10000"]})]})]}),!F&&e.jsx(Rm,{}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",style:{display:F?"none":void 0},children:[e.jsx("button",{onClick:r,disabled:s||j<200||!!n,title:n||void 0,className:"px-6 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",opacity:s||j<200||n?.4:1,cursor:s||j<200||n?"not-allowed":"pointer"},children:s?"Analizandoâ¦":"Analizar script"}),e.jsx("button",{onClick:o,className:"px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.3)",color:"#FF4757",cursor:"pointer"},onMouseEnter:b=>{b.currentTarget.style.background="rgba(255,71,87,0.18)"},onMouseLeave:b=>{b.currentTarget.style.background="rgba(255,71,87,0.1)"},children:"Grabar directamente"}),n?e.jsx("p",{className:"text-xs",style:{color:"rgba(255,184,0,0.7)"},children:n}):e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:"MÃnimo 200 caracteres para analizar"})]}),!F&&j>=200&&e.jsx(Ci,{onSave:d,saving:u,saved:m,saveError:p,disabledReason:x})]})}function Wm({script:t,analysis:a,analysisVersion:r,analyzing:s,onReanalyze:n,onEditScript:o,onRecord:l,onApplySuggestion:c,onSave:d,saving:u,saved:m,saveError:p,saveDisabledReason:x}){return e.jsxs("div",{className:"flex flex-col gap-6",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Práctica · Análisis"}),e.jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Análisis del script"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Revisa el análisis y, cuando estés listo, grábate."})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx(Ci,{onSave:d,saving:u,saved:m,saveError:p,disabledReason:x}),e.jsx("button",{onClick:o,className:"text-xs px-4 py-2 rounded-xl transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.55)",cursor:"pointer"},children:"â Editar script"})]})]}),t&&e.jsx(Xt,{script:t,defaultExpanded:!1}),a&&e.jsx(_m,{analysis:a,analysisVersion:r,onReanalyze:n,analyzing:s,onApplySuggestion:c}),e.jsxs("div",{className:"rounded-xl border p-6 flex flex-col items-center gap-4 text-center",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Cuando estés listo, pulsa para grabar tu interpretación."}),e.jsx("button",{onClick:l,className:"px-8 py-3 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #FF4757, #FF6B81)",color:"white",border:"none",cursor:"pointer"},onMouseEnter:v=>{v.currentTarget.style.transform="scale(1.03)"},onMouseLeave:v=>{v.currentTarget.style.transform="scale(1)"},children:"Empezar a grabar"})]})]})}function Hm({script:t,isRecording:a,recordingTime:r,analyserRef:s,phase:n,error:o,errorCode:l,recorderError:c,onStart:d,onStop:u,onConfirm:m,onRetry:p,hqMic:x,onToggleHqMic:v}){return n==="confirm"?e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[60vh]",style:{animation:"fadeSlideUp 0.3s both"},children:e.jsxs("div",{className:"rounded-2xl p-8 max-w-sm w-full mx-4 text-center",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)"},children:[e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Grabación completada"}),e.jsx("p",{className:"text-sm mb-8",style:{color:"rgba(255,255,255,0.55)"},children:"¿Quieres ver el análisis o prefieres volver a grabar?"}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("button",{onClick:m,className:"w-full py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:"pointer"},onMouseEnter:f=>f.currentTarget.style.opacity="0.88",onMouseLeave:f=>f.currentTarget.style.opacity="1",children:"Ver resultados"}),e.jsx("button",{onClick:p,className:"w-full py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.75)",cursor:"pointer"},onMouseEnter:f=>f.currentTarget.style.background="rgba(255,255,255,0.1)",onMouseLeave:f=>f.currentTarget.style.background="rgba(255,255,255,0.06)",children:"Volver a grabar"})]})]})}):n==="analyzing"?e.jsxs("div",{className:"flex flex-col items-center justify-center min-h-[60vh]",style:{animation:"fadeSlideUp 0.5s both"},"aria-live":"polite","aria-busy":"true",children:[e.jsx("div",{className:"w-12 h-12 rounded-full mb-6",style:{border:"3px solid rgba(0,229,160,0.2)",borderTop:"3px solid #00E5A0",animation:"rotate 1s linear infinite"},"aria-hidden":"true"}),e.jsx("h2",{className:"text-xl font-bold mb-2",children:"Analizando tu interpretaciónâ¦"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Evaluando semántica, timing, tono y fluidez"})]}):e.jsxs("div",{className:"flex flex-col gap-8",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Grabación"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Interpreta tu script. No tienes que leerlo literalmente."})]}),t&&e.jsx(Xt,{script:t,defaultExpanded:!1}),o&&l===oa&&e.jsx(yi,{message:o,onRetry:d}),(o&&l!==oa||c)&&e.jsx("div",{className:"rounded-xl border px-4 py-3 text-sm text-center",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:l===oa?c:o||c}),e.jsx("div",{className:"px-4",children:e.jsx(Ys,{isRecording:a,analyserRef:s})}),e.jsx("div",{className:"text-center font-bold",style:{fontSize:52,fontFamily:"'JetBrains Mono', monospace",color:a?"#00E5A0":"rgba(255,255,255,0.15)",transition:"color 0.3s",letterSpacing:"-0.02em"},"aria-live":"polite","aria-label":`Tiempo de grabación: ${ca(r)}`,children:ca(r)}),e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[a?e.jsx("button",{onClick:u,className:"transition-all duration-200",style:{width:88,height:88,borderRadius:"50%",background:"rgba(255,71,87,0.15)",border:"4px solid #FF4757",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",animation:"glowRed 2s infinite"},onMouseEnter:f=>f.currentTarget.style.transform="scale(1.1)",onMouseLeave:f=>f.currentTarget.style.transform="scale(1)","aria-label":"Detener grabación",children:e.jsx("div",{style:{width:24,height:24,borderRadius:4,background:"#FF4757"},"aria-hidden":"true"})}):e.jsx("button",{onClick:d,disabled:n==="analyzing",className:"transition-all duration-200",style:{width:88,height:88,borderRadius:"50%",background:"linear-gradient(135deg, #FF4757, #FF6B81)",border:"4px solid rgba(255,71,87,0.3)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},onMouseEnter:f=>f.currentTarget.style.transform="scale(1.1)",onMouseLeave:f=>f.currentTarget.style.transform="scale(1)","aria-label":"Iniciar grabación",children:e.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:"white"},"aria-hidden":"true"})}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},"aria-live":"polite",children:a?"Pulsa para detener":"Pulsa para grabar"}),a&&r>5&&e.jsx("p",{className:"text-xs text-center max-w-xs",style:{color:"rgba(255,255,255,0.55)"},children:"MÃnimo recomendado: 30 segundos para una evaluación precisa"}),!a&&e.jsxs("button",{onClick:v,className:"flex items-center gap-2 text-xs px-3 py-1.5 rounded-lg transition-all duration-200 mt-2",style:{background:x?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.04)",border:x?"1px solid rgba(0,229,160,0.25)":"1px solid rgba(255,255,255,0.08)",color:x?"#00E5A0":"rgba(255,255,255,0.35)",cursor:"pointer"},title:"ActÃvalo si usas AirPods, auriculares con cancelación activa de ruido u otros micrófonos de alta calidad con hardware ANC.",children:[e.jsx("span",{children:x?"â":"â"}),"Mic ANC / alta calidad"]}
598)]})]})}function Vm(){var lt,zt,Ie,vt,jt,St;const t=he(),a=Ct(),{isAuthenticated:r}=i.useContext(Bt);Ks();const s=Ia(((lt=a.state)==null?void 0:lt.script)||""),n=((zt=a.state)==null?void 0:zt.commands)||[],o=((Ie=a.state)==null?void 0:Ie.source)==="library"||((vt=a.state)==null?void 0:vt.source)==="community",l=((jt=a.state)==null?void 0:jt.technique_id)||"",c=((St=a.state)==null?void 0:St.technique_name)||"",[d,u]=i.useState("editor"),[m,p]=i.useState(!1);i.useEffect(()=>{r&&R.get("/api/billing/access").then(Q=>p((Q==null?void 0:Q.is_premium)??!1)).catch(()=>{})},[r]);const[x,v]=i.useState("persuasion"),[f,h]=i.useState(s),[g,y]=i.useState(null),[j,F]=i.useState(0),[C,N]=i.useState(!1),[b,w]=i.useState(null),[L,z]=i.useState(null),[A,S]=i.useState(null),[_,D]=i.useState("idle"),[q,H]=i.useState(null),[oe,ie]=i.useState(!1),[B,K]=i.useState(!1),[V,P]=i.useState(null),[M,U]=i.useState([]),[X,T]=i.useState(()=>localStorage.getItem("neuralpitch_hq_mic")==="1"),$=()=>{T(Q=>{const ue=!Q;return localStorage.setItem("neuralpitch_hq_mic",ue?"1":"0"),ue})},{isRecording:Y,recordingTime:ae,analyserRef:de,error:re,startRecording:ye,stopRecording:fe,resetRecorder:pe}=hi({hqMic:X}),Qe=i.useCallback(Q=>{h(Q),K(!1),P(null)},[]),Je=i.useCallback(async()=>{if(!(!f.trim()||f.trim().length<200)){N(!0),w(null);try{const Q=await R.post("/api/analyze-script",{script:Ia(f.trim()),mode:x});y(Q),F(ue=>ue+1),u("analysis")}catch(Q){w((Q==null?void 0:Q.message)||"Error al analizar el script.")}finally{N(!1)}}},[f,x]),st=i.useCallback(async()=>{if(f.trim()){N(!0);try{const Q=await R.post("/api/analyze-script",{script:Ia(f.trim()),mode:x});y(Q),F(ue=>ue+1)}catch{}finally{N(!1)}}},[f,x]),ce=i.useCallback(async Q=>{const ue=await R.post("/api/suggest-script-addition",{script:Ia(f.trim()),issue:Q.issue,suggestion:Q.suggestion,mode:x}),mt=((ue==null?void 0:ue.addition)||"").trim();mt&&(h(De=>{var Ee;const $e=De.trimEnd(),ke=(Ee=ue==null?void 0:ue.insert_after)==null?void 0:Ee.trim();if(ke){const xt=$e.lastIndexOf(ke);if(xt!==-1){const Oe=xt+ke.length;return $e.slice(0,Oe)+` 599`+mt+` 600`+$e.slice(Oe)}}return $e+` 601 602`+mt}),K(!1),P(null))},[f,x]),Ae=(()=>{if(!o||!s)return!1;if(f===s)return!0;const Q=s.length;if(Q===0)return!1;let ue=Math.abs(f.length-Q);const mt=Math.min(f.length,Q);for(let De=0;De<mt;De++)f[De]!==s[De]&&ue++;return ue/Q<.05})(),Ye=i.useCallback(async()=>{if(!(!f.trim()||oe||B||Ae)){ie(!0),P(null);try{await R.post("/api/scripts/save",{script_text:f.trim(),mode:x,script_type:"manual",title:(g==null?void 0:g.title)||null,quality_score:(g==null?void 0:g.overall_quality)??null}),K(!0)}catch(Q){P((Q==null?void 0:Q.message)||"Error al guardar.")}finally{ie(!1)}}},[f,x,oe,B,g]),nt=i.useCallback(()=>{u("record")},[]),Te=i.useCallback(()=>{u("record")},[]),kt=i.useCallback(async()=>{z(null),S(null),await ye(),D("recording")},[ye]),ot=i.useCallback(async()=>{const Q=await fe();if(ae<15){pe(),D("idle");return}H(Q),D("confirm")},[fe,ae,pe]),we=i.useCallback(async Q=>{var ue,mt,De,$e;D("analyzing");try{let ke;if(Q){const Ee=new FormData;Ee.append("audio",Q,"recording.webm");const xt=f.toLowerCase(),Oe=((g==null?void 0:g.suggested_commands)||[]).filter(gt=>xt.includes(gt.toLowerCase())),Ke=M!=null&&M.length?M:Oe.length?Oe:n;l?(Ee.append("technique_id",l),Ee.append("script",f.trim()),Ee.append("commands",JSON.stringify(Ke))):(Ee.append("technique_id",""),Ee.append("custom_script",f.trim()),Ee.append("detected_techniques_json",JSON.stringify((g==null?void 0:g.detected_techniques)||[])),Ee.append("suggested_commands_json",JSON.stringify(Ke)));const Le=await R.upload("/api/evaluate",Ee);ke=Le.session_id||Le.id,await Cs(ke,{audioBlob:Q,words:Le.words||[],detectedPauses:Le.detected_pauses||[],duration:Le.duration||0,commandAnalysis:((mt=(ue=Le.pillars)==null?void 0:ue.semantica)==null?void 0:mt.command_analysis)||[],pauseAnalysis:(($e=(De=Le.pillars)==null?void 0:De.timing)==null?void 0:$e.pause_analysis)||[]})}ke&&t(`/results/${ke}`)}catch(ke){if((ke==null?void 0:ke.status)===451){D("idle"),pe();return}S(Xs(ke)),z(vi(ke)),D("idle"),pe()}},[f,g,M,n,l,t,pe]),Pe=i.useCallback(()=>{const Q=q;H(null),we(Q)},[q,we]),Ze=i.useCallback(()=>{H(null),pe(),D("idle")},[pe]);return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("button",{onClick:()=>{d==="editor"?t("/"):u(d==="analysis"?"editor":"analysis")},disabled:Y,className:"flex items-center gap-2 text-sm mb-8 transition-colors duration-200",style:{background:"none",border:"none",color:Y?"rgba(255,255,255,0.15)":"rgba(255,255,255,0.4)",cursor:Y?"not-allowed":"pointer",padding:0},onMouseEnter:Q=>{Y||(Q.currentTarget.style.color="white")},onMouseLeave:Q=>{Y||(Q.currentTarget.style.color="rgba(255,255,255,0.65)")},children:[e.jsx("span",{"aria-hidden":"true",children:"â"})," Volver"]}),e.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[["editor","analysis","record"].map((Q,ue)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full transition-all duration-300",style:{background:d===Q?"#00E5A0":["editor","analysis","record"].indexOf(d)>ue?"rgba(0,229,160,0.4)":"rgba(255,255,255,0.12)"}}),ue<2&&e.jsx("div",{className:"w-8 h-px",style:{background:"rgba(255,255,255,0.08)"}})]},Q)),e.jsx("span",{className:"text-xs ml-2",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"},children:d==="editor"?"1/3 Editar":d==="analysis"?"2/3 Analizar":"3/3 Grabar"})]}),b&&e.jsx("div",{className:"rounded-xl border px-4 py-3 mb-6 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:b}),d==="editor"&&e.jsx(Um,{script:f,setScript:Qe,onAnalyze:Je,analyzing:C,analyzeDisabledReason:Ae?"Modifica al menos un 5% del script para analizarlo":null,onSkip:nt,mode:x,setMode:v,onSave:Ye,saving:oe,saved:B,saveError:V,saveDisabledReason:Ae?"Modifica al menos un 5% del script para guardarlo como tuyo":void 0,isPremium:m,loadedFromLibrary:o,libraryTechniqueName:c,onSetGeneratedCommands:U}),d==="analysis"&&e.jsx(Wm,{script:f,analysis:g,analysisVersion:j,analyzing:C,onReanalyze:st,onEditScript:()=>u("editor"),onRecord:Te,onApplySuggestion:ce,onSave:Ye,saving:oe,saved:B,saveError:V,saveDisabledReason:Ae?"Modifica al menos un 5% del script para guardarlo como tuyo":void 0}),d==="record"&&e.jsx(Hm,{script:f,isRecording:Y,recordingTime:ae,analyserRef:de,phase:_,error:L,errorCode:A,recorderError:re,onStart:kt,onStop:ot,onConfirm:Pe,onRetry:Ze,hqMic:X,onToggleHqMic:$})]})}const Gm={persuasion:{label:"Persuasión",color:"#00E5A0",bg:"rgba(0,229,160,0.1)",border:"rgba(0,229,160,0.2)"},session:{label:"Sesión",color:"#00B4D8",bg:"rgba(0,180,216,0.1)",border:"rgba(0,180,216,0.2)"}
602,relation:{label:"Relación",color:"#FFB800",bg:"rgba(255,184,0,0.1)",border:"rgba(255,184,0,0.2)"}};function Jm({mode:t}){const a=Gm[t]||{label:t||"â",color:"rgba(255,255,255,0.65)",bg:"rgba(255,255,255,0.05)",border:"rgba(255,255,255,0.1)"};return e.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-semibold",style:{background:a.bg,border:`1px solid ${a.border}`,color:a.color,fontFamily:"'JetBrains Mono', monospace"},children:a.label})}function Ym({score:t}){if(t==null)return null;const a=t>=80?"#00E5A0":t>=55?"#FFB800":"#FF4757";return e.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-bold",style:{background:`${a}18`,border:`1px solid ${a}40`,color:a,fontFamily:"'JetBrains Mono', monospace"},children:t})}function _i({item:t,onPracticar:a,isPremiumLocked:r=!1}){const s=he(),n=(t.script_text||"").slice(0,100),o=(t.script_text||"").length>100,l=t.created_at?new Date(t.created_at).toLocaleDateString("es-ES"):null;return e.jsxs("div",{className:"rounded-xl border flex flex-col gap-3 p-4 transition-all duration-200",style:{background:r?"rgba(255,184,0,0.02)":"rgba(255,255,255,0.02)",borderColor:r?"rgba(255,184,0,0.12)":"rgba(255,255,255,0.07)",opacity:r?.85:1},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex flex-col gap-1 flex-1 min-w-0",children:[t.title&&e.jsx("span",{className:"text-sm font-bold truncate",style:{color:"rgba(255,255,255,0.95)"},children:t.title}),e.jsx("span",{className:"text-sm font-semibold truncate",style:{color:t.title?"rgba(255,255,255,0.5)":"rgba(255,255,255,0.9)",filter:r?"blur(4px)":"none",userSelect:r?"none":"auto",pointerEvents:r?"none":"auto"},"aria-hidden":r?"true":void 0,children:t.technique_name||"Script manual"}),t.category_name&&e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.65)"},children:t.category_name})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r&&e.jsx(J,{icon:_a,style:{color:"#FFB800",fontSize:13},"aria-label":"Premium"}),t.quality_score!=null&&e.jsx(Ym,{score:t.quality_score}),t.mode&&e.jsx(Jm,{mode:t.mode}),l&&e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:l})]})]}),n&&e.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.5)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"pre-wrap",wordBreak:"break-word",filter:r?"blur(4px)":"none",userSelect:r?"none":"auto",pointerEvents:r?"none":"auto"},"aria-hidden":r?"true":void 0,children:[n,o&&"â¦"]}),e.jsx("div",{className:"pt-1",children:r?e.jsxs("button",{type:"button",onClick:()=>s("/billing"),className:"flex items-center gap-2 px-4 py-2 rounded-xl text-xs font-bold transition-all duration-200",style:{background:"rgba(255,184,0,0.09)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.background="rgba(255,184,0,0.16)"},onMouseLeave:c=>{c.currentTarget.style.background="rgba(255,184,0,0.09)"},"aria-label":"Desbloquear script Premium",children:[e.jsx(J,{icon:er,style:{fontSize:11},"aria-hidden":"true"}),"Desbloquear"]}):e.jsx("button",{type:"button",onClick:()=>a(t),className:"px-4 py-2 rounded-xl text-xs font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:"pointer"},onMouseEnter:c=>{c.currentTarget.style.transform="scale(1.03)"},onMouseLeave:c=>{c.currentTarget.style.transform="scale(1)"},children:"Practicar"})})]})}function Fi(){return e.jsx("div",{className:"flex flex-col gap-4","aria-label":"Cargando scripts",role:"status",children:[1,2,3].map(t=>e.jsxs("div",{className:"rounded-xl border p-4 flex flex-col gap-3",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex justify-between gap-3",children:[e.jsx("div",{className:"h-4 rounded",style:{width:"40%",background:"rgba(255,255,255,0.06)",animation:"pulse 1.5s ease-in-out infinite"}}),e.jsx("div",{className:"h-4 rounded",style:{width:"15%",background:"rgba(255,255,255,0.04)",animation:"pulse 1.5s ease-in-out infinite"}})]}),e.jsx("div",{className:"h-12 rounded",style:{background:"rgba(255,255,255,0.04)",animation:"pulse 1.5s ease-in-out infinite"}})]},t))})}function Km({onPracticar:t}){const[a,r]=i.useState([]),[s,n]=i.useState(!0),[o,l]=i.useState(null);return i.useEffect(()=>{let c=!1;return n(!0),l(null),R.get("/api/scripts").then(d=>{c||r((d==null?void 0:d.scripts)??[])}).catch(d=>{c||l((d==null?void 0:d.message)||"Error al cargar tus scripts.")}).finally(()=>{c||n(!1)}),()=>{c=!0}},[]),s?e.jsx(Fi,{}):o?e.jsx("div",{className:"rounded-xl border px-4 py-3 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:o}):a.length===0?e.jsx("div",{className:"rounded-xl border p-8 text-center",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)"},"data-testid":"empty-state",children:e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"}
602,children:"Aún no has guardado ningún script. Genera uno con IA en la práctica personalizada."})}):e.jsx("div",{className:"flex flex-col gap-4",children:a.map((c,d)=>e.jsx(_i,{item:c,onPracticar:t},c.id??d))})}const Xm=[{id:"all",label:"Todos"},{id:"persuasion",label:"Persuasión"},{id:"session",label:"Sesión"},{id:"relation",label:"Relación"}],bo=20;function Qm({onPracticar:t,isPremium:a}){const[r,s]=i.useState([]),[n,o]=i.useState(null),[l,c]=i.useState("all"),[d,u]=i.useState("recent"),[m,p]=i.useState(!1),[x,v]=i.useState([]),[f,h]=i.useState(0),[g,y]=i.useState(1),[j,F]=i.useState(!0),[C,N]=i.useState(!1),[b,w]=i.useState(null);i.useEffect(()=>{R.get("/api/community/categories").then(S=>s(Array.isArray(S)?S:[])).catch(()=>{})},[]),i.useEffect(()=>{let S=!1;F(!0),w(null),y(1);const _=new URLSearchParams({page:1,page_size:bo,sort_by:d});return l!=="all"&&_.set("mode",l),n&&_.set("category_id",n),R.get(`/api/community?${_}`).then(D=>{S||(v((D==null?void 0:D.scripts)??[]),h((D==null?void 0:D.total)??0))}).catch(D=>{S||w((D==null?void 0:D.message)||"Error al cargar los scripts de la comunidad.")}).finally(()=>{S||F(!1)}),()=>{S=!0}},[n,l,d]);const L=i.useCallback(async()=>{const S=g+1;N(!0);try{const _=new URLSearchParams({page:S,page_size:bo,sort_by:d});l!=="all"&&_.set("mode",l),n&&_.set("category_id",n);const D=await R.get(`/api/community?${_}`);v(q=>[...q,...(D==null?void 0:D.scripts)??[]]),y(S)}catch{}finally{N(!1)}},[g,l,n,d]),z=x.length<f,A=m?x.filter(S=>(S.technique_difficulty??1)<2):x;return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-1",style:{scrollbarWidth:"none"}
602,role:"group","aria-label":"Filtrar por categorÃa",children:[e.jsxs("button",{type:"button",onClick:()=>o(null),className:"shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-all duration-200 whitespace-nowrap",style:{background:n===null?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.05)",border:`1px solid ${n===null?"rgba(0,229,160,0.35)":"rgba(255,255,255,0.1)"}`,color:n===null?"#00E5A0":"rgba(255,255,255,0.5)",cursor:"pointer"},"aria-pressed":n===null,children:["Todas",f>0&&n===null&&e.jsx("span",{style:{color:"rgba(0,229,160,0.7)",marginLeft:4},children:f})]}),r.map(S=>{const _=n===S.id;return e.jsxs("button",{type:"button",onClick:()=>o(_?null:S.id),className:"shrink-0 px-3 py-1.5 rounded-full text-xs font-semibold transition-all duration-200 whitespace-nowrap",style:{background:_?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.05)",border:`1px solid ${_?"rgba(0,229,160,0.35)":"rgba(255,255,255,0.1)"}`,color:_?"#00E5A0":"rgba(255,255,255,0.5)",cursor:"pointer"},"aria-pressed":_,children:[S.name,e.jsx("span",{style:{color:_?"rgba(0,229,160,0.7)":"rgba(255,255,255,0.25)",marginLeft:4},children:S.count})]},S.id)})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("div",{className:"flex flex-1 rounded-xl p-1 gap-1",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},role:"group","aria-label":"Filtrar por modo",children:Xm.map(S=>{const _=l===S.id;return e.jsx("button",{type:"button",onClick:()=>c(S.id),className:"flex-1 px-2 py-1.5 rounded-lg text-xs font-semibold transition-all duration-200",style:{background:_?"rgba(0,229,160,0.12)":"transparent",border:_?"1px solid rgba(0,229,160,0.25)":"1px solid transparent",color:_?"#00E5A0":"rgba(255,255,255,0.45)",cursor:"pointer"},"aria-pressed":_,children:S.label},S.id)})}),!a&&e.jsx("button",{type:"button",onClick:()=>p(S=>!S),className:"flex items-center gap-1.5 shrink-0 px-3 py-2 rounded-xl text-xs font-semibold transition-all duration-200",style:{background:m?"rgba(0,229,160,0.12)":"rgba(255,255,255,0.04)",border:`1px solid ${m?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.1)"}`,color:m?"#00E5A0":"rgba(255,255,255,0.5)",cursor:"pointer",whiteSpace:"nowrap"},"aria-pressed":m,children:"Solo gratis"}),e.jsxs("select",{value:d,onChange:S=>u(S.target.value),"aria-label":"Ordenar scripts",className:"rounded-xl text-xs font-semibold px-3 py-2 outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",appearance:"none",paddingRight:"1.75rem",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='rgba(255,255,255,0.3)'/%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 0.6rem center"},children:[e.jsx("option",{value:"recent",children:"Más recientes"}),e.jsx("option",{value:"top_rated",children:"Mejor puntuados"})]})]}),!j&&!b&&f>0&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:m?`${A.length} gratuito${A.length!==1?"s":""}`:`${x.length} de ${f} script${f!==1?"s":""}`}),j&&e.jsx(Fi,{}),!j&&b&&e.jsx("div",{className:"rounded-xl border px-4 py-3 text-sm",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},role:"alert",children:b}),!j&&!b&&x.length===0&&e.jsx("div",{className:"rounded-xl border p-8 text-center",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)"},"data-testid":"comunidad-empty",children:e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"No hay scripts disponibles para este filtro."})}),!j&&!b&&A.length>0&&e.jsx("div",{className:"flex flex-col gap-4",children:A.map((S,_)=>e.jsx(_i,{item:S,onPracticar:t,isPremiumLocked:!a&&S.technique_difficulty>=2},S.id??_))}),!j&&!b&&A.length===0&&x.length>0&&e.jsx("div",{className:"rounded-xl border p-8 text-center",style:{background:"rgba(255,255,255,0.015)",borderColor:"rgba(255,255,255,0.06)"},children:e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"No hay scripts gratuitos para este filtro."})}),!j&&!b&&z&&e.jsx("button",{type:"button",onClick:L,disabled:C,className:"w-full py-2.5 rounded-xl text-xs font-semibold transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:C?"rgba(255,255,255,0.45)":"rgba(255,255,255,0.6)",cursor:C?"not-allowed":"pointer"},children:C?"Cargandoâ¦":`Cargar más (${f-x.length} restantes)`})]})}const Zm=[{id:"mis-scripts",label:"Mis scripts"},{id:"comunidad",label:"Comunidad"}];function ep(){const t=he(),{isAuthenticated:a}=i.useContext(Bt),[r,s]=i.useState("mis-scripts"),[n,o]=i.useState(!1);i.useEffect(()=>{a&&R.get("/api/billing/access").then(c=>o((c==null?void 0:c.is_premium)??!1)).catch(()=>{})},[a]);const l=i.useCallback(c=>{t("/custom-practice",{state:{script:c.script_text,commands:c.commands_used||[],source:"library",technique_id:c.technique_id||null,technique_name:c.technique_name||null}})},[t]);return e.jsxs("div",{id:"tour-biblioteca-grid",className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Scripts · Comunidad"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Biblioteca"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Scripts guardados y comunidad de practicantes."})]}),e.jsx("div",{className:"flex rounded-xl p-1 gap-1 mb-6",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)"},role:"tablist","aria-label":"Secciones de la biblioteca",children:Zm.map(c=>{const d=r===c.id;return e.jsx("button",{type:"button",role:"tab","aria-selected":d,onClick:()=>s(c.id),className:"flex-1 px-4 py-2 rounded-lg text-sm font-semibold transition-all duration-200",style:{background:d?"rgba(0,229,160,0.1)":"transparent",border:d?"1px solid rgba(0,229,160,0.2)":"1px solid transparent",color:d?"#00E5A0":"rgba(255,255,255,0.45)",cursor:"pointer"},children:c.label},c.id)})}),e.jsxs("div",{role:"tabpanel",children:[r==="mis-scripts"&&e.jsx(Km,{onPracticar:l}),r==="comunidad"&&e.jsx(Qm,{onPracticar:l,isPremium:n})]})]})}function tp({score:t}){if(t==null)return e.jsx("span",{style:{color:"rgba(255,255,255,0.55)",fontSize:12},children:"Sin puntuación"});const a=t>=85?"#00E5A0":t>=70?"#FFB800":"#FF4757";return e.jsxs("span",{style:{background:`${a}22`,border:`1px solid ${a}55`,color:a,borderRadius:6,padding:"2px 10px",fontSize:13,fontWeight:700,fontFamily:"'JetBrains Mono', monospace"},children:[t,"/100"]})}const ap={persuasion:"Persuasión",session:"Sesión",relation:"Relación"},rp={persuasion:"#00B4D8",session:"#00E5A0",relation:"#FFB800"};function sp({mode:t}){const a=rp[t]||"rgba(255,255,255,0.5)";return e.jsx("span",{style:{background:`${a}22`,border:`1px solid ${a}55`,color:a,borderRadius:6,padding:"2px 8px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:ap[t]||t})}function np({script:t,categories:a,onConfirm:r,onClose:s,loading:n}){var m;const[o,l]=i.useState(((m=t.suggested_category)==null?void 0:m.id)||""),[c,d]=i.useState(""),u=p=>{if(p.preventDefault(),!o)return;const x=c.split(",").map(v=>
602v.trim()).filter(Boolean);r(o,x)};return e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:20},onClick:p=>p.target===p.currentTarget&&s(),children:e.jsxs("div",{style:{background:"#13131A",border:"1px solid rgba(255,255,255,0.1)",borderRadius:16,padding:28,width:"100%",maxWidth:480},children:[e.jsx("h3",{style:{color:"#00E5A0",fontSize:16,fontWeight:700,marginBottom:20},children:"Aprobar script"}),e.jsxs("form",{onSubmit:u,children:[e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{color:"rgba(255,255,255,0.6)",fontSize:12,display:"block",marginBottom:6},children:"CategorÃa *"}),e.jsxs("select",{value:o,onChange:p=>l(p.target.value),required:!0,style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,color:"white",padding:"8px 12px",fontSize:13},children:[e.jsx("option",{value:"",children:"Selecciona categorÃaâ¦"}),a.map(p=>e.jsx("option",{value:p.id,children:p.name},p.id))]})]}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{color:"rgba(255,255,255,0.6)",fontSize:12,display:"block",marginBottom:6},children:"Tags de situación (opcional, separados por coma)"}),e.jsx("input",{type:"text",value:c,onChange:p=>d(p.target.value),placeholder:"ej: reunión, primer contacto, negociación",style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,color:"white",padding:"8px 12px",fontSize:13}})]}),e.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",onClick:s,style:{background:"none",border:"1px solid rgba(255,255,255,0.15)",borderRadius:8,color:"rgba(255,255,255,0.6)",padding:"8px 18px",cursor:"pointer",fontSize:13},children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:!o||n,style:{background:"#00E5A0",border:"none",borderRadius:8,color:"#0A0A0F",padding:"8px 20px",cursor:!o||n?"not-allowed":"pointer",fontSize:13,fontWeight:700,opacity:!o||n?.6:1},children:n?"Aprobandoâ¦":"Aprobar y publicar"})]})]})]})})}function op({onConfirm:t,onClose:a,loading:r}){const[s,n]=i.useState(""),o=l=>{l.preventDefault(),s.trim()&&t(s.trim())};return e.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:20},onClick:l=>l.target===l.currentTarget&&a(),children:e.jsxs("div",{style:{background:"#13131A",border:"1px solid rgba(255,255,255,0.1)",borderRadius:16,padding:28,width:"100%",maxWidth:480},children:[e.jsx("h3",{style:{color:"#FF4757",fontSize:16,fontWeight:700,marginBottom:20},children:"Rechazar script"}),e.jsxs("form",{onSubmit:o,children:[e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{color:"rgba(255,255,255,0.6)",fontSize:12,display:"block",marginBottom:6},children:"Motivo del rechazo *"}),e.jsx("textarea",{value:s,onChange:l=>n(l.target.value),required:!0,rows:4,placeholder:"Describe por qué se rechaza este scriptâ¦",style:{width:"100%",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,color:"white",padding:"8px 12px",fontSize:13,resize:"vertical"}})]}),e.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end"},children:[e.jsx("button",{type:"button",onClick:a,style:{background:"none",border:"1px solid rgba(255,255,255,0.15)",borderRadius:8,color:"rgba(255,255,255,0.6)",padding:"8px 18px",cursor:"pointer",fontSize:13},children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:!s.trim()||r,style:{background:"rgba(255,71,87,0.15)",border:"1px solid rgba(255,71,87,0.4)",borderRadius:8,color:"#FF4757",padding:"8px 20px",cursor:!s.trim()||r?"not-allowed":"pointer",fontSize:13,fontWeight:700,opacity:!s.trim()||r?.6:1},children:r?"Rechazandoâ¦":"Rechazar"})]})]})]})})}function lp({script:t,categories:a,onAction:r}){const[s,n]=i.useState(!1),[o,l]=i.useState(!1),[c,d]=i.useState(!1),[u,m]=i.useState(null),p=i.useCallback(async(f,h)=>{d(!0),m(null);try{await R.post(`/api/admin/scripts/${t.id}/approve`,{category_id:f,situation_tags:h}
602),n(!1),r(t.id)}catch(g){m((g==null?void 0:g.message)||"Error al aprobar")}finally{d(!1)}},[t.id,r]),x=i.useCallback(async f=>{d(!0),m(null);try{await R.post(`/api/admin/scripts/${t.id}/reject`,{reason:f}),l(!1),r(t.id)}catch(h){m((h==null?void 0:h.message)||"Error al rechazar")}finally{d(!1)}},[t.id,r]),v=new Date(t.created_at).toLocaleDateString("es-ES",{day:"2-digit",month:"short",year:"numeric"});return e.jsxs("div",{style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.07)",borderRadius:14,padding:24,marginBottom:16},children:[e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,marginBottom:16,flexWrap:"wrap"},children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{color:"white",fontWeight:700,fontSize:15,marginBottom:6},children:t.title||e.jsx("span",{style:{color:"rgba(255,255,255,0.55)",fontStyle:"italic"},children:"Sin tÃtulo"})}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap",alignItems:"center"},children:[e.jsx(sp,{mode:t.mode}),t.script_type==="ai_generated"&&e.jsx("span",{style:{background:"rgba(0,180,216,0.12)",border:"1px solid rgba(0,180,216,0.3)",color:"#00B4D8",borderRadius:6,padding:"2px 8px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:"IA"}),t.technique_name&&e.jsx("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:12},children:t.technique_name}),t.suggested_category&&e.jsx("span",{style:{background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",borderRadius:6,padding:"2px 8px",fontSize:11},children:t.suggested_category.name})]})]}),e.jsxs("div",{style:{textAlign:"right",flexShrink:0},children:[e.jsx(tp,{score:t.quality_score}),e.jsx("div",{style:{color:"rgba(255,255,255,0.55)",fontSize:11,marginTop:4},children:v})]})]}),t.quality_score!=null&&e.jsx("div",{style:{marginBottom:16},children:e.jsx("div",{style:{height:4,background:"rgba(255,255,255,0.06)",borderRadius:4,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${t.quality_score}%`,background:t.quality_score>=85?"linear-gradient(90deg, #00E5A0, #00B4D8)":t.quality_score>=70?"linear-gradient(90deg, #FFB800, #FF8C00)":"linear-gradient(90deg, #FF4757, #FF6B81)",borderRadius:4,transition:"width 0.5s ease"}})})}),t.commands_used&&t.commands_used.length>0&&e.jsxs("div",{style:{marginBottom:14},children:[e.jsxs("div",{style:{color:"rgba(255,255,255,0.6)",fontSize:11,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:6},children:["Comandos encubiertos (",t.commands_used.length,")"]}),e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:t.commands_used.map((f,h)=>e.jsxs("span",{style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",borderRadius:6,padding:"3px 8px",fontSize:12,fontFamily:"'JetBrains Mono', monospace",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:f,children:['"',f,'"']},h))})]}),t.approach_notes&&e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("div",{style:{color:"rgba(255,255,255,0.6)",fontSize:11,textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:6},children:"Notas de análisis"}),e.jsx("div",{style:{background:"rgba(0,180,216,0.05)",border:"1px solid rgba(0,180,216,0.15)",borderRadius:8,padding:"10px 14px",color:"rgba(255,255,255,0.65)",fontSize:13,lineHeight:1.6},children:t.approach_notes})]}),e.jsx("div",{style:{marginBottom:16},children:e.jsx(Xt,{script:t.script_text,defaultExpanded:!1})}),u&&e.jsx("div",{style:{color:"#FF4757",fontSize:13,marginBottom:12},children:u}),e.jsxs("div",{style:{display:"flex",gap:10,justifyContent:"flex-end"},children:[e.jsx("button",{onClick:()=>l(!0),style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.3)",borderRadius:8,color:"#FF4757",padding:"8px 18px",cursor:"pointer",fontSize:13,fontWeight:600},children:"Rechazar"}),e.jsx("button",{onClick:()=>n(!0),style:{background:"#00E5A0",border:"none",borderRadius:8,color:"#0A0A0F",padding:"8px 20px",cursor:"pointer",fontSize:13,fontWeight:700},children:"Aprobar"})]}),s&&e.jsx(np,{script:t,categories:a,onConfirm:p,onClose:()=>n(!1),loading:c}),o&&e.jsx(op,{onConfirm:x,onClose:()=>l(!1),loading:c})]})}function ip(){const{user:t}=Ge(),[a,r]=i.useState([]),[s,n]=i.useState([]),[o,l]=i.useState(0),[c,d]=i.useState(1),[u,m]=i.useState(!0),[p,x]=i.useState(null),v=10;if(t&&t.role!=="admin")return e.jsx(yr,{to:"/",replace:!0});const f=i.useCallback(async y=>{m(!0),x(null);try{const[j,F]=await Promise.all([R.get(`/api/admin/scripts/pending?page=${y}&page_size=${v}`),R.get("/api/admin/categories")]);r(j.scripts||[]),l(j.total||0),n(F||[])}catch(j){x((j==null?void 0:j.message)||"Error al cargar los datos")}finally{m(!1)}},[]);i.useEffect(()=>{f(c)},[c,f]);const h=i.useCallback(y=>{r(j=>j.filter(F=>F.id!==y)),l(j=>Math.max(0,j-1))},[]),g=Math.ceil(o/v);return e.jsxs("div",{style:{maxWidth:860,margin:"0 auto",padding:"32px 16px"},children:[e.jsxs("div",{style:{marginBottom:28},children:[e.jsx("h1",{style:{color:"white",fontSize:22,fontWeight:700,marginBottom:4},children:"Cola de revisión"}),e.jsx("p",{style:{color:"rgba(255,255,255,0.65)",fontSize:14},children:o>0?`${o} script${o!==1?"s":""} pendiente${o!==1?"s":""} de revisión`:"No hay scripts pendientes"})]}),u&&e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:60},children:e.jsx("div",{className:"w-10 h-10 rounded-full border-[3px] border-neuro-green/20 border-t-neuro-green animate-rotate","aria-label":"Cargandoâ¦"})}),!u&&p&&e.jsx("div",{style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.3)",borderRadius:10,padding:"16px 20px",color:"#FF4757",fontSize:14},children:p}),!u&&!p&&a.length===0&&e.jsx("div",{style:{textAlign:"center",padding:"60px 0",color:"rgba(255,255,255,0.55)",fontSize:15},children:"No hay scripts pendientes de revisión"}),!u&&!p&&a.map(y=>e.jsx(lp,{script:y,categories:s,onAction:h},y.id)),!u&&g>1&&e.jsxs("div",{style:{display:"flex",justifyContent:"center",gap:8,marginTop:24},children:[e.jsx("button",{onClick:()=>d(y=>Math.max(1,y-1)),disabled:c===1,style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:c===1?"rgba(255,255,255,0.25)":"white",padding:"6px 14px",cursor:c===1?"not-allowed":"pointer",fontSize:13},children:"Anterior"}),e.jsxs("span",{style:{color:"rgba(255,255,255,0.65)",fontSize:13,padding:"6px 4px"},children:[c," / ",g]}),e.jsx("button",{onClick:()=>d(y=>Math.min(g,y+1)),disabled:c===g,style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:c===g?"rgba(255,255,255,0.25)":"white",padding:"6px 14px",cursor:c===g?"n
602ot-allowed":"pointer",fontSize:13},children:"Siguiente"})]})]})}function cp(){var V,P;const{techniqueId:t,scriptIndex:a}=da(),r=he(),s=parseInt(a,10),[n,o]=i.useState(null),[l,c]=i.useState(null),[d,u]=i.useState(!0),[m,p]=i.useState([]),[x,v]=i.useState(""),[f,h]=i.useState(!1),[g,y]=i.useState(!1),[j,F]=i.useState(!1),[C,N]=i.useState(null),[b,w]=i.useState(!1),[L,z]=i.useState(!1),[A,S]=i.useState("guion"),_=i.useRef(null),{getTechniqueById:D}=Ut(),q=D(t);i.useEffect(()=>{t&&(u(!0),R.get(`/api/techniques/${t}`).then(M=>{const U=(M==null?void 0:M.scripts)||[],X=U[s]||U[0]||null;X&&(o(X),c(X.version||1))}).catch(()=>N("No se pudo cargar el guión actual.")).finally(()=>u(!1)))},[t,s]),i.useEffect(()=>{var M;(M=_.current)==null||M.scrollIntoView({behavior:"smooth"})},[m]);const H=async()=>{const M=x.trim();if(!M||f)return;const U={role:"user",content:M},X=[...m,U];p(X),v(""),h(!0),N(null),window.innerWidth<1024&&S("chat");try{const T=await R.post("/api/admin/technique-scripts/enhance",{technique_id:t,script_index:s,messages:X}),$={role:"assistant",content:"__proposal__",proposal:T.proposal,validation_errors:T.validation_errors||[]};p(Y=>[...Y,$])}catch(T){N((T==null?void 0:T.detail)||"Error al generar la propuesta. Inténtalo de nuevo."),p($=>$.slice(0,-1)),v(M)}finally{h(!1)}},oe=async M=>{if(!(g||j)){y(!0),N(null);try{const U=await R.post("/api/admin/technique-scripts/approve",{technique_id:t,script_index:s,script:M.script,commands:M.commands,pause_markers:M.pause_markers,enhancement_notes:M.changes_summary,technique_annotations:M.technique_annotations||[]});o({id:U.id,title:U.title,scenario:{client:U.scenario_client,objective:U.scenario_objective},script:U.script,commands:U.commands||[],pause_markers:U.pause_markers||[]}),c(U.version),F(!0)}catch(U){N((U==null?void 0:U.detail)||"Error al aprobar el guión. Inténtalo de nuevo.")}finally{y(!1)}}},ie=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),H())},B=async()=>{if(!(b||!n)){w(!0),z(!1),N(null);try{const M=await R.post("/api/admin/technique-scripts/reannotate",{technique_id:t,script_index:s});o(U=>({...U,technique_annotations:M.annotations})),z(!0)}catch(M){N((M==null?void 0:M.detail)||"Error al re-anotar el guión.")}finally{w(!1)}}},K=(q==null?void 0:q.name)||t;return e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"flex items-start justify-between mb-6 gap-4 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("button",{onClick:()=>r(`/prepare/${t}`),className:"text-sm mb-2 flex items-center gap-2",style:{background:"none",border:"none",color:"rgba(255,255,255,0.6)",cursor:"pointer",padding:0},children:"â Volver a preparación"}),e.jsxs("h2",{className:"text-xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:["Mejorar guión: ",K]}),e.jsxs("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.5)"},children:["Script ",s+1," · Versión actual: v",l??"â¦"]})]}),j&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 rounded-xl text-sm",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.25)",color:"#00E5A0"},children:[e.jsx(J,{icon:Va}),"Versión ",l," publicada"]})]}),C&&e.jsxs("div",{className:"rounded-xl border px-4 py-3 mb-4 text-sm flex items-center gap-2",style:{background:"rgba(255,71,87,0.08)",borderColor:"rgba(255,71,87,0.2)",color:"#FF4757"},children:[e.jsx(J,{icon:Hs}),C]}),e.jsx("div",{className:"flex gap-2 mb-4 lg:hidden",children:["guion","chat"].map(M=>e.jsx("button",{onClick:()=>S(M),className:"px-4 py-2 rounded-xl text-xs font-semibold uppercase tracking-widest",style:{background:A===M?"rgba(255,184,0,0.12)":"rgba(255,255,255,0.04)",border:`1px solid ${A===M?"rgba(255,184,0,0.3)":"rgba(255,255,255,0.06)"}`,color:A===M?"#FFB800":"rgba(255,255,255,0.5)",cursor:"pointer"},children:M==="guion"?"Guión actual":"Conversación"},M))}),e.jsxs("div",{className:"lg:grid lg:grid-cols-5 lg:gap-6 flex flex-col gap-4",children:[e.jsx("div",{className:`lg:col-span-2 ${A!=="guion"?"hidden lg:block":""}`,children:e.jsxs("div",{className:"rounded-2xl border",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"px-5 py-4 border-b flex items-start justify-between gap-3",style:{borderColor:"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.8)"},children:["Guión actual · v",l??"â¦"]}),(n==null?void 0:n.title)&&e.jsx("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.5)"},children:n.title})]}),e.jsx("button",{onClick:B,disabled:b||!n,title:"Re-ejecutar anotaciones de técnicas con IA",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-medium transition-all duration-200 shrink-0",style:{background:L?"rgba(0,229,160,0.1)":b?"rgba(255,255,255,0.04)":"rgba(0,180,216,0.1)",border:`1px solid ${L?"rgba(0,229,160,0.25)":b?"rgba(255,255,255,0.06)":"rgba(0,180,216,0.25)"}`,color:L?"#00E5A0":b?"rgba(255,255,255,0.35)":"#00B4D8",cursor:b||!n?"not-allowed":"pointer"},children:b?e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{width:10,height:10,borderRadius:"50%",border:"2px s
602olid rgba(255,255,255,0.15)",borderTop:"2px solid rgba(255,255,255,0.5)",animation:"rotate 0.8s linear infinite"}}),"Anotandoâ¦"]}):L?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:Va,style:{fontSize:10}})," Anotado"]}):e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:mi,style:{fontSize:10}})," Re-anotar"]})})]}),e.jsx("div",{className:"p-4",children:d?e.jsx("div",{className:"space-y-2 py-4",children:[...Array(8)].map((M,U)=>e.jsx("div",{className:"rounded",style:{height:12,width:`${50+Math.random()*45}%`,background:"rgba(255,255,255,0.06)",animation:"pulse 1.5s ease-in-out infinite"}},U))}):n?e.jsxs(e.Fragment,{children:[n.scenario&&e.jsxs("div",{className:"mb-3 text-xs",style:{color:"rgba(255,255,255,0.55)"},children:[e.jsx("strong",{style:{color:"rgba(255,255,255,0.7)"},children:"Cliente:"})," ",n.scenario.client]}),e.jsx(Xt,{script:n.script,annotations:n.technique_annotations||[],defaultExpanded:!0}),((V=n.technique_annotations)==null?void 0:V.length)>0&&e.jsx(Js,{annotations:n.technique_annotations}),((P=n.commands)==null?void 0:P.length)>0&&e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"text-xs mb-1.5",style:{color:"rgba(255,255,255,0.5)"},children:"Comandos:"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.commands.map((M,U)=>e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"rgba(0,229,160,0.08)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:['"',M,'"']},U))})]})]}):e.jsx("p",{className:"text-sm text-center py-6",style:{color:"rgba(255,255,255,0.4)"},children:"No se pudo cargar el guión. Ejecuta la migración de datos."})})]})}),e.jsx("div",{className:`lg:col-span-3 flex flex-col ${A!=="chat"?"hidden lg:flex":""}`,style:{minHeight:500},children:e.jsxs("div",{className:"rounded-2xl border flex flex-col",style:{background:"rgba(255,255,255,0.01)",borderColor:"rgba(255,255,255,0.06)",flex:1},children:[e.jsxs("div",{className:"px-5 py-4 border-b",style:{borderColor:"rgba(255,255,255,0.06)"},children:[e.jsx("h3",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.8)"},children:"Conversación con Claude Opus"}),e.jsx("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.45)"},children:"Describe qué quieres mejorar del guión"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-4",style:{maxHeight:500},children:[m.length===0&&e.jsx("p",{className:"text-sm text-center py-8",style:{color:"rgba(255,255,255,0.35)"},children:"Escribe tu observación sobre el guión para empezar"}),m.map((M,U)=>e.jsx("div",{children:M.role==="user"?e.jsx("div",{className:"flex justify-end",children:e.jsx("div",{className:"max-w-sm rounded-2xl rounded-tr-sm px-4 py-3 text-sm",style:{background:"rgba(0,180,216,0.12)",border:"1px solid rgba(0,180,216,0.2)",color:"rgba(255,255,255,0.85)"},children:M.content})}):M.content==="__proposal__"?e.jsx(dp,{proposal:M.proposal,validationErrors:M.validation_errors,approved:j,approveLoading:g,onApprove:()=>oe(M.proposal)}):e.jsx("div",{className:"max-w-sm rounded-2xl rounded-tl-sm px-4 py-3 text-sm",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.75)"},children:M.content})},U)),f&&e.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"rgba(255,255,255,0.4)"},children:[e.jsx("div",{className:"w-4 h-4 rounded-full",style:{border:"2px solid rgba(255,184,0,0.2)",borderTop:"2px solid #FFB800",animation:"rotate 0.8s linear infinite"}}),"Claude está analizandoâ¦"]}),e.jsx("div",{ref:_})]}),e.jsxs("div",{className:"px-4 py-3 border-t",style:{borderColor:"rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex gap-2 items-end",children:[e.jsx("textarea",{value:x,onChange:M=>v(M.target.value),onKeyDown:ie,placeholder:"Describe qué quieres mejorar⦠(Enter para enviar)",rows:2,disabled:f||j,className:"flex-1 rounded-xl px-4 py-2.5 text-sm resize-none",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)",color:"white",outline:"none",fontFamily:"Inter, sans-serif",opacity:j?.5:1}}),e.jsxs("button",{onClick:H,disabled:!x.trim()||f||j,className:"px-4 py-2.5 rounded-xl flex items-center gap-2 text-sm font-medium transition-all duration-200",style:{background:!x.trim()||f||j?"rgba(255,255,255,0.05)":"rgba(255,184,0,0.15)",border:`1px solid ${!x.trim()||f||j?"rgba(255,255,255,0.06)":"rgba(255,184,0,0.3)"}`,color:!x.trim()||f||j?"rgba(255,255,255,0.3)":"#FFB800",cursor:!x.trim()||f||j?"not-allowed":"pointer"},children:[e.jsx(J,{icon:y0,style:{fontSize:13}}),"Enviar"]})]}),j&&e.jsx("p",{className:"text-xs mt-2",style:{color:"rgba(0,229,160,0.7)"},children:"Versión aprobada. Navega a otra técnica para seguir mejorando."})]})]})})]})]})}function dp({proposal:t,validationErrors:a,approved:r,approveLoading:s,onApprove:n}){const[o,l]=i.useState(!1),c=t.technique_annotations||[];return e.jsxs("div",{className:"rounded-2xl border",style:{background:"rgba(255,184,0,0.04)",borderColor:"rgba(255,184,0,0.15)"},children:[e.jsx("div",{className:"px-4 py-3 border-b",style:{borderColor:"rgba(255,184,0,0.1)"},children:e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:"#FFB800"},children:"Propuesta de mejora"})}),e.jsxs("div",{className:"px-4 py-3",children:[t.changes_summary&&e.jsx("p",{className:"text-xs mb-3 leading-relaxed whitespace-pre-wrap",style:{color:"rgba(255,255,255,0.75)"},children:t.changes_summary}),(a==null?void 0:a.length)>0&&e.jsxs("div",{className:"rounded-xl px-3 py-2 mb-3",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.15)"},children:[e.jsx("p",{className:"text-xs font-semibold mb-1",style:{color:"#FFB800"},children:"Avisos de validación (no crÃticos):"}),a.map((d,u)=>e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:["[",d.rule,"] ",d.detail]},u))]}),e.jsxs("button",{onClick:()=>l(d=>!d),className:"text-xs mb-3 flex items-center gap-1.5",style:{color:"rgba(255,255,255,0.5)",background:"none",border:"none",cursor:"pointer",padding:0},children:[o?"â²":"â¼"," ",o?"Ocultar":"Ver"," guión propuesto"]}),o&&e.jsxs("div",{className:"mb-3",children:[e.jsx(Xt,{script:t.script,annotations:c,defaultExpanded:!0}),e.jsx(Js,{annotations:c})]}),e.jsx("button",{onClick:n,disabled:s||r,className:"w-full py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:r?"rgba(0,229,160,0.12)":s?"rgba(255,184,0,0.08)":"rgba(255,184,0,0.15)",border:`1px solid ${r?"rgba(0,229,160,0.3)":"rgba(255,184,0,0.3)"}`,color:r?"#00E5A0":"#FFB800",cursor:s||r?"not-allowed":"pointer"},children:r?e.jsxs(e.Fragment,{children:[e.jsx(J,{icon:Va,style:{marginRight:6}}),"Versión aprobada"]}):s?"Publicandoâ¦":"Aprobar esta versión"})]})]})}const up=["Técnicas de Nivel 2, 3 y 4 · MaestrÃa (técnicas avanzadas)","Evaluaciones ilimitadas al mes","Acceso prioritario a nuevas técnicas","Biblioteca de scripts ilimitada"];function mp(t,a){return!t||t==="free"||t==="canceled"||t==="inactive"?"Gratuito":{monthly:"Premium Mensual",quarterly:"Premium Trimestral",program:"Premium Programa 6 meses",premium_monthly:"Premium Mensual",premium_quarterly:"Premium Trimestral",premium_program:"Premium Programa 6 meses",team_monthly:"Teams Mensual",team_quarterly:"Teams Trimestral",team_annual:"Teams Anual"}[a]||"Premium Mensual"}function pp(t){if(!t)return null;try{return new Date(t).toLocaleDateString("es-ES",{year:"numeric",month:"long",day:"numeric"})}catch{return null}}function ho({type:t,children:a}){if(!a)return null;const r=t==="success";return e.jsxs("div",{role:"status",className:"rounded-xl px-5 py-4 mb-8 flex items-start gap-3",style:{background:r?"rgba(0,229,160,0.06)":"rgba(0,180,216,0.06)",border:`1px solid ${r?"rgba(0,229,160,0.2)":"rgba(0,180,216,0.2)"}`},children:[e.jsx(J,{icon:r?Cr:d2,style:{color:r?"#00E5A0":"#00B4D8",marginTop:2,flexShrink:0},"aria-hidden":"true"}),e.jsx("p",{className:"text-sm",style:{color:r?"#00E5A0":"#00B4D8"},children:a})]})}function fp({message:t}){return t?e.jsx("div",{role:"alert",className:"rounded-xl px-5 py-4 mb-6",style:{background:"rgba(255,71,87,0.06)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757",fontSize:14},children:t}):null}function xp({used:t,limit:a}){const r=a>0?Math.min(100,Math.round(t/a*100)):0,s=r>=80;return e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"text-sm",style:{color:"rgba(255,255,255,0.7)"},children:"Evaluaciones este mes"}),e.jsxs("span",{className:"text-sm font-mono font-semibold",style:{color:s?"#F
602F4757":"rgba(255,255,255,0.9)"},children:[t," / ",a]})]}),e.jsx("div",{className:"rounded-full overflow-hidden",style:{height:6,background:"rgba(255,255,255,0.07)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${r}%`,background:s?"linear-gradient(90deg, #FFB800, #FF4757)":"linear-gradient(90deg, #00E5A0, #00B4D8)"}})})]})}function Kr({title:t,price:a,period:r,subtitle:s,highlighted:n,loading:o,onSubscribe:l,ctaLabel:c,children:d}){return e.jsxs("div",{className:"flex-1 rounded-2xl p-6 flex flex-col gap-4",style:{background:n?"rgba(0,229,160,0.05)":"rgba(255,255,255,0.02)",border:`1px solid ${n?"rgba(0,229,160,0.25)":"rgba(255,255,255,0.07)"}`,position:"relative"},children:[n&&e.jsx("div",{className:"absolute -top-3 left-1/2 text-xs font-bold px-3 py-1 rounded-full",style:{transform:"translateX(-50%)",background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"nowrap"},children:"RECOMENDADO"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-2",style:{color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:t}),e.jsxs("div",{className:"flex items-end gap-1",children:[e.jsx("span",{className:"text-4xl font-bold",style:{fontFamily:"'Playfair Display', serif",color:n?"#00E5A0":"white"},children:a}),e.jsxs("span",{className:"text-sm mb-1.5",style:{color:"rgba(255,255,255,0.65)"},children:["EUR/",r]})]}),s&&e.jsx("p",{className:"text-xs mt-1",style:{color:"#FFB800"},children:s})]}),d,e.jsx("button",{onClick:l,disabled:o,className:"w-full py-3 rounded-xl text-sm font-bold transition-all duration-200 mt-auto",style:{background:n?o?"rgba(0,229,160,0.3)":"linear-gradient(135deg, #00E5A0, #00B4D8)":o?"rgba(255,255,255,0.05)":"rgba(255,255,255,0.07)",border:n?"none":"1px solid rgba(255,255,255,0.1)",color:n?"#0A0A0F":"rgba(255,255,255,0.85)",cursor:o?"not-allowed":"pointer",opacity:o?.7:1},children:o?"Redirigiendoâ¦":c||"Suscribirse"})]})}function gp({pending:t,onComplete:a,loading:r}){if(!(t!=null&&t.has_pending))return null;const s=["team_monthly","team_quarterly","team_annual"].includes(t.plan),o={premium_monthly:"Premium Mensual",premium_quarterly:"Premium Trimestral",premium_program:"Premium Programa 6 meses",team_monthly:"Teams Mensual",team_quarterly:"Teams Trimestral",team_annual:"Teams Anual"}[t.plan]||t.plan;return e.jsxs("div",{role:"alert",className:"rounded-2xl px-6 py-5 flex flex-col sm:flex-row sm:items-center justify-between gap-4",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.25)"},children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(J,{icon:b0,style:{color:"#FFB800",fontSize:16,marginTop:2,flexShrink:0},"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-bold",style:{color:"#FFB800"},children:["Suscripción pendiente: ",o]}),s&&t.org_name&&e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.65)"},children:["Organización: ",e.jsx("span",{style:{color:"rgba(255,255,255,0.85)"},children:t.org_name}),t.seat_count?` · ${t.seat_count} asientos`:""]}),t.days_remaining!=null&&e.jsxs("p",{className:"text-xs mt-1 flex items-center gap-1.5",style:{color:"rgba(255,184,0,0.8)"},children:[e.jsx(J,{icon:Vs,style:{fontSize:10},"aria-hidden":"true"}),t.days_remaining>0?`Tu periodo de prueba vence en ${t.days_remaining} dÃa${t.days_remaining!==1?"s":""}.`:"Tu periodo de prueba ha vencido."," ","Completa el pago para no perder el acceso."]})]})]}),e.jsxs("button",{onClick:a,disabled:r,className:"flex-shrink-0 flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold transition-all duration-200",style:{background:r?"rgba(255,184,0,0.2)":"linear-gradient(135deg, #FFB800, #FF8C00)",color:r?"rgba(255,255,255,0.4)":"#0A0A0F",border:"none",cursor:r?"not-allowed":"pointer",opacity:r?.7:1,whiteSpace:"nowrap"},children:[r?"Redirigiendoâ¦":"Completar mi suscripción",!r&&e.jsx(J,{icon:Za,style:{fontSize:11},"aria-hidden":"true"})]})]})}function bp(){const{user:t}=Ge(),a=he(),[r]=vr(),[s,n]=i.useState(null),[o,l]=i.useState(!0),[c,d]=i.useState(null),[u,m]=i.useState(!1),[p,x]=i.useState(null),[v,f]=i.useState(null),h=r.get("success"),g=r.get("canceled");i.useEffect(()=>{l(!0),Promise.all([R.get("/api/billing/status").catch(()=>null),R.get("/api/billing/pending-checkout").catch(()=>null)]).then(([A,S])=>{n(A),f(S)}).finally(()=>l(!1))},[h]);const y=(s==null?void 0:s.is_premium)??(t==null?void 0:t.is_premium)??!1,j=async()=>
602{if(v!=null&&v.has_pending){x(null),d("pending");try{const A=v.plan,S=["team_monthly","team_quarterly","team_annual"].includes(A);let _;S?_=(await R.post("/api/billing/create-org-checkout",{plan:A,seat_count:v.seat_count||5,org_name:v.org_name||"",success_url:`${window.location.origin}/billing?success=true`,cancel_url:`${window.location.origin}/billing?canceled=true`})).checkout_url:_=(await R.post("/api/billing/create-checkout-session",{plan:{premium_monthly:"monthly",premium_quarterly:"quarterly",premium_program:"program"}[A]||"monthly",success_url:`${window.location.origin}/billing?success=true`,cancel_url:`${window.location.origin}/billing?canceled=true`})).checkout_url,window.location.href=_}catch(A){x((A==null?void 0:A.message)||"No se pudo iniciar el proceso de pago. Inténtalo de nuevo."),d(null)}}},F=async A=>{x(null),d(A);try{const{checkout_url:S}=await R.post("/api/billing/create-checkout-session",{plan:A,success_url:`${window.location.origin}/billing?success=true`,cancel_url:`${window.location.origin}/billing?canceled=true`});window.location.href=S}catch(S){x((S==null?void 0:S.message)||"No se pudo iniciar el proceso de pago. Inténtalo de nuevo."),d(null)}},C=async()=>{x(null),m(!0);try{const{portal_url:A}=await R.post("/api/billing/portal",{});window.location.href=A}catch(A){x((A==null?void 0:A.message)||"No se pudo acceder al portal de facturación."),m(!1)}},N=pp(s==null?void 0:s.subscription_expires_at),b=(s==null?void 0:s.monthly_eval_count)??0,w=(s==null?void 0:s.monthly_eval_limit)??10,L=s==null?void 0:s.subscription_status,z=s==null?void 0:s.subscription_plan;return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 flex flex-col gap-6",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Cuenta · Facturación"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Facturación"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Gestiona tu plan y suscripción"})]}),!o&&(v==null?void 0:v.has_pending)&&h!=="true"&&e.jsx(gp,{pending:v,onComplete:j,loading:c==="pending"}),h==="true"&&e.jsx(ho,{type:"success",children:"Bienvenido a Premium. Tus técnicas de Nivel 2, 3 y 4 · MaestrÃa están ahora disponibles."}),g==="true"&&e.jsx(ho,{type:"info",children:"El proceso de pago fue cancelado. Puedes suscribirte cuando quieras."}),e.jsx(fp,{message:p}),o?e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.6)"},children:"Cargando información de tu planâ¦"}):y?e.jsx("div",{className:"flex flex-col gap-4",children:e.jsxs("div",{className:"rounded-2xl p-6 flex flex-col gap-4",style:{background:"rgba(0,229,160,0.04)",border:"1px solid rgba(0,229,160,0.15)"},children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-1",style:{color:"rgba(255,255,255,0.65)",fontFamily:"'JetBrains Mono', monospace"},children:"Plan actual"}),e.jsx("p",{className:"text-lg font-bold",style:{color:"white"},children:mp(L,z)})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx(J,{icon:_a,style:{color:"#FFB800",fontSize:14},"aria-hidden":"true"}),e.jsx("span",{className:"text-xs font-bold px-2.5 py-1 rounded-full",style:{background:"rgba(0,229,160,0.12)",border:"1px solid rgba(0,229,160,0.25)",color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:"Activo"})]})]}),N&&e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.5)"},children:["Próxima renovación:"," ",e.jsx("span",{style:{color:"rgba(255,255,255,0.8)"},children:N})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{icon:v0,style:{color:"#00E5A0",fontSize:13},"aria-hidden":"true"}),e.jsx("span",{className:"text-sm",style:{color:"#00E5A0"},children:"Evaluaciones ilimitadas"})]}),s!=null&&s.can_manage_billing?e.jsxs("button",{onClick:C,disabled:u,className:"self-start flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:u?"rgba(255,255,255,0.04)":"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",color:u?"rgba(255,255,255,0.35)":"rgba(255,255,255,0.8)",cursor:u?"not-allowed":"pointer"},children:[e.jsx(J,{icon:c0,"aria-hidden":"true"}),u?"Redirigiendoâ¦":"Gestionar suscripción"]}):s!=null&&s.organization_id?e.jsxs("p",{className:"text-sm self-start",style:{color:"rgba(255,255,255,0.6)"},children:["Tu plan está gestionado por tu organización",s!=null&&s.org_name?e.jsxs("span",{style:{color:"rgba(255,255,255,0.85)",fontWeight:600},children:[" ",s.org_name]}):null,". Contacta con el responsable de tu equipo para cualquier cambio de facturación."]}):e.jsx("p",{className:"text-sm self-start",style:{color:"rgba(255,255,255,0.6)"},children:"Tu plan Premium está activo. No requiere gestión de pago."})]})}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{className:"rounded-2xl p-6 flex flex-col gap-4",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-1",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"},children:"Plan actual"}),e.jsx("p",{className:"text-base font-bold",children:"Gratuito"})]}),e.jsx("span",{className:"text-xs font-semibold px-2.5 py-1 rounded-full",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:"Gratuito"})]}),e.jsx(xp,{used:b,limit:w})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.6)",fontFamily:"'JetBrains Mono', monospace"},children:"Con Premium obtienes"}),e.jsx("ul",{className:"flex flex-col gap-2",children:up.map(A=>e.jsxs("li",{className:"flex items-center gap-3 text-sm",style:{color:"rgba(255,255,255,0.7)"},children:[e.jsx(J,{icon:Cr,style:{color:"#00E5A0",fontSize:13,flexShrink:0},"aria-hidden":"true"}),A]},A))})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mt-2",children:[e.jsx(Kr,{title:"Mensual",price:"99",period:"mes",highlighted:!1,loading:c==="monthly",onSubscribe:()=>F("monthly"),ctaLabel:"Suscribirse al plan mensual"}),e.jsx(Kr,{title:"Trimestral",price:"237,60",period:"3 meses",subtitle:"79,20 â¬/mes equivalente · 20% de descuento",highlighted:!1,loading:c==="quarterly",onSubscribe:()=>F("quarterly"),ctaLabel:"Suscribirse al plan trimestral"}),e.jsx(Kr,{title:"Programa 6 meses",price:"420",period:"6 meses",subtitle:"70 â¬/mes equivalente · 29% de descuento",highlighted:!0,loading:c==="program",onSubscribe:()=>F("program"),ctaLabel:"Empezar el programa de 6 meses"})]}),e.jsxs("div",{className:"flex items-center gap-3 rounded-xl px-4 py-3",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.05)"},children:[e.jsx(J,{icon:er,style:{color:"rgba(255,255,255,0.55)",fontSize:13},"aria-hidden":"true"}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.65)"},children:"Las técnicas de Nivel 2, 3 y 4 (MaestrÃa) están bloqueadas en el plan Gratuito. Actualiza para desbloquearlas."})]}),e.jsxs("div",{className:"flex items-center gap-3 mt-2","aria-hidden":"true",children:[e.jsx("div",{className:"flex-1 h-px",style:{background:"rgba(255,255,255,0.06)"}}),e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.3)",fontFamily:"'JetBrains Mono', monospace",whiteSpace:"nowrap"},children:"Para equipos"}),e.jsx("div",{className:"flex-1 h-px",style:{background:"rgba(255,255,255,0.06)"}})]}),e.jsxs("div",{className:"rounded-2xl p-6 flex flex-col sm:flex-row sm:items-center justify-between gap-5",style:{background:"rgba(0,180,216,0.04)",border:"1px solid rgba(0,180,216,0.15)"},children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)"},children:e.jsx(J,{icon:Ha,style:{color:"#00B4D8",fontSize:16},"aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",style:{color:"white"},children:"NeuralPitch Teams"}),e.jsx("p",{className:"text-xs mt-1",style:{color:"rgba(255,255,255,0.55)"},children:"Gestiona el entrenamiento de tu equipo de ventas."}),e.jsx("p",{className:"text-xs mt-1 font-semibold",style:{color:"#00B4D8"},children:"Desde 89 ⬠/ asiento / mes · mÃnimo 5 asientos"})]})]}),e.jsxs(Se,{to:"/create-organization",className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-bold transition-all duration-200 flex-shrink-0",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.25)",color:"#00B4D8",textDecoration:"none"},onMouseEnter:A=>{A.currentTarget.style.background="rgba(0,180,216,0.18)"},onMouseLeave:A=>{A.currentTarget.style.background="rgba(0,180,216,0.1)"}
602,children:["Crear mi organización",e.jsx(J,{icon:Za,style:{fontSize:12},"aria-hidden":"true"})]})]})]}),e.jsx("button",{onClick:()=>a("/"),className:"self-start text-sm mt-2 transition-colors duration-150",style:{background:"none",border:"none",color:"rgba(255,255,255,0.6)",cursor:"pointer",padding:0},onMouseEnter:A=>{A.currentTarget.style.color="rgba(255,255,255,0.7)"},onMouseLeave:A=>{A.currentTarget.style.color="rgba(255,255,255,0.35)"},children:"Volver a técnicas"})]})}const hp=new Set(["premium_monthly","premium_quarterly","team_monthly","team_quarterly"]);function yp(){const[t]=vr(),a=he(),{setUser:r}=vp(),[s,n]=i.useState("verifying"),[o,l]=i.useState(""),[c,d]=i.useState(!1);return i.useEffect(()=>{const u=t.get("token");if(!u){n("error"),l("El enlace de verificación no es válido.");return}let m=!1;return R.get(`/api/auth/verify-email?token=${encodeURIComponent(u)}`).then(p=>{var h;if(m)return;p!=null&&p.user&&r(p.user);const x=(h=p==null?void 0:p.user)==null?void 0:h.pending_checkout_plan,v=x&&hp.has(x);d(v),n("success");const f=v?"/billing":"/tecnicas";setTimeout(()=>a(f,{replace:!0}),2500)}).catch(p=>{if(m)return;const x=p.message||"";x.includes("ya utilizado")||x.includes("inválido")?n("already_verified"):(n("error"),l(x||"El enlace no es válido o ha caducado."))}),()=>{m=!0}},[]),e.jsxs("div",{className:"min-h-screen flex items-center justify-center px-4 py-12",style:{background:"#0A0A0F"},children:[e.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{backgroundImage:"radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0)",backgroundSize:"40px 40px"},"aria-hidden":"true"}),e.jsxs("div",{className:"relative w-full max-w-md rounded-2xl border text-center",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.06)",padding:"48px 32px",animation:"fadeSlideUp 0.5s both",zIndex:1},children:[e.jsx("div",{className:"flex flex-col items-center mb-6",children:e.jsx(ua,{size:48,className:"mb-4"})}),s==="verifying"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"inline-block w-10 h-10 rounded-full border-2 border-t-transparent animate-spin mb-6",style:{borderColor:"rgba(0,229,160,0.5)",borderTopColor:"transparent"},"aria-hidden":"true"}),e.jsx("h2",{className:"text-lg font-semibold mb-2",style:{color:"#ffffff"},children:"Verificando tu correo..."}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.5)"},children:"Un momento, por favor."})]}),s==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center mx-auto mb-6 rounded-full",style:{width:64,height:64,background:"rgba(0,229,160,0.1)",border:"2px solid rgba(0,229,160,0.4)"},children:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M5 13l4 4L19 7",stroke:"#00E5A0",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"text-xl font-bold mb-3",style:{color:"#ffffff"},children:"¡Correo verificado!"}),e.jsxs("p",{className:"text-sm mb-6",style:{color:"rgba(255,255,255,0.65)",lineHeight:1.6},children:["Tu cuenta está activa."," ",c?"Redirigiendo a Facturación para completar tu suscripciónâ¦":"Redirigiendo a la plataformaâ¦"]}),e.jsx("div",{className:"inline-block w-1.5 h-1.5 rounded-full animate-bounce",style:{background:"#00E5A0"},"aria-hidden":"true"})]}),s==="already_verified"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center mx-auto mb-6 rounded-full",style:{width:64,height:64,background:"rgba(0,229,160,0.08)",border:"2px solid rgba(0,229,160,0.3)"},children:e.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:e.jsx("path",{d:"M5 13l4 4L19 7",stroke:"#00E5A0",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),e.jsx("h2",{className:"text-xl font-bold mb-3",style:{color:"#ffffff"},children:"Cuenta ya verificada"}),e.jsx("p",{className:"text-sm mb-8",style:{color:"rgba(255,255,255,0.65)",lineHeight:1.6},children:"Tu correo ya fue verificado anteriormente. Puedes iniciar sesión directamente."}),e.jsx(Se,{to:"/login",className:"inline-block text-sm font-semibold py-3 px-6 rounded-xl transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},children:"Iniciar sesión"})]}),s==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center mx-auto mb-6 rounded-full",style:{width:64,height:64,background:"rgba(255,71,87,0.08)",border:"2px s
602olid rgba(255,71,87,0.3)"},children:e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[e.jsx("path",{d:"M12 8v5M12 16h.01",stroke:"#FF4757",strokeWidth:"2.5",strokeLinecap:"round"}),e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"#FF4757",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("h2",{className:"text-xl font-bold mb-3",style:{color:"#ffffff"},children:"Enlace no válido"}),e.jsx("p",{className:"text-sm mb-8",style:{color:"rgba(255,255,255,0.65)",lineHeight:1.6},children:o}),e.jsx(Se,{to:"/login",className:"inline-block text-sm font-semibold py-3 px-6 rounded-xl transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},children:"Ir a inicio de sesión"})]})]})]})}function vp(){const{refreshUser:t}=Ge();return{setUser:()=>{t().catch(()=>{})}}}const yt={SYLLABLES_PER_WORD:2,MIN_ONSET_MS:120,WPM_ISI_MAX_MS:1500,YIN_THRESHOLD:.2,VOICING_CONF:.8,RISE_COEFF:.35,FALL_COEFF:.75,PEAK_RATIO:.35,PEAK_DECAY:.995,NOISE_MULT:3,MIN_SPEECH_MULT:4,MIN_RISE_RATIO:1.8};function yo(t,a,r=yt.YIN_THRESHOLD){const s=Math.floor(t.length/2),n=Math.floor(a/600),o=Math.min(Math.floor(a/75),s-1),l=new Float32Array(s);for(let y=1;y<s;y++){let j=0;for(let F=0;F<s;F++){const C=t[F]-t[F+y];j+=C*C}l[y]=j}const c=new Float32Array(s);c[0]=1;let d=0;for(let y=1;y<s;y++)d+=l[y],c[y]=d>0?l[y]*y/d:1;let u=-1;for(let y=n;y<=o;y++)if(c[y]<r){for(;y+1<=o&&c[y+1]<c[y];)y++;u=y;break}if(u<1)return{f0:null,confidence:0};const m=u>0?c[u-1]:c[u],p=c[u],x=u+1<s?c[u+1]:c[u],v=2*(m-2*p+x),f=v!==0?u+(m-x)/v:u,h=a/f,g=1-p;return{f0:h,confidence:g}}function vo(t,a){if(t.push(a),t.length>3&&t.shift(),t.length<3)return a;const[r,s,n]=t;return r<=s?s<=n?s:r<=n?n:r:r<=n?r:s<=n?n:s}function Xr(t){if(t.length===0)return 0;const a=[...t].sort((s,n)=>s-n),r=Math.floor(a.length/2);return a.length%2===0?(a[r-1]+a[r])/2:a[r]}function ks(t){return t<70?"too_slow":t<100?"slow":t<=150?"optimal":t<=200?"fast":"too_fast"}function Ss(t){return t<.7?"muy_bajo":t<.88?"bajo":t<=1.15?"normal":"alto"}function jo(){let t=null;return{filter(a,r){return t=t==null?a:r*a+(1-r)*t,t},reset(){t=null}}}function No(t,a){return 1/(1+1/(2*Math.PI*t)/a)}function wo({minCutoff:t=1,beta:a=0,dCutoff:r=1}={}){const s=jo(),n=jo();let o=null,l=null;return{filter(c,d){if(o==null||l==null)return o=d,l=c,s.filter(c,1),c;let u=(d-o)/1e3;u>0||(u=1/60),u>.1&&(u=.1);const m=(c-l)/u,p=n.filter(m,No(r,u)),x=t+a*Math.abs(p),v=s.filter(c,No(x,u));return o=d,l=c,v},reset(){s.reset(),n.reset(),o=null,l=null}}}function jp(t,a){if(!Array.isArray(t)||t.length===0)return[];if(t.length<=a)return t.slice();const r=t.length/a,s=[];for(let n=0;n<a;n++){const o=Math.floor(n*r),l=Math.floor((n+1)*r);let c=0,d=0,u=0,m=0,p=0,x=0,v=0;for(let f=o;f<l;f++){const h=t[f];h&&(m++,c+=h.t,h.wpm!=null&&(d+=h.wpm,p++),h.pitch!=null&&(u+=h.pitch,x++),h.voiced&&v++)}m!==0&&s.push({t:c/m,wpm:p?d/p:null,pitch:x?u/x:null,voiced:v>m/2})}return s}function Np({hqMic:t=!1,onFrame:a}={}){const[r,s]=i.useState(!1),[n,o]=i.useState(null),[l,c]=i.useState(0),[d,u]=i.useState(0),[m,p]=i.useState(null),[x,v]=i.useState(!1),[f,h]=i.useState(null),[g,y]=i.useState(null),j=i.useRef(a);i.useEffect(()=>{j.current=a},[a]);const F=i.useRef({wpm:null,wpmCategory:null,pitchRatio:null,pitchLabel:null,activePause:!1,lastPauseDuration:null,pauseCount:0,energy:0,hasSpoken:!1}),C=i.useRef([]),N=i.useRef([]),b=i.useRef(null),w=i.useRef(null),L=i.useRef(null),z=i.useRef(null),A=i.useRef(null),S=i.useRef(0),_=i.useRef(!1),D=i.useRef(0),q=i.useRef(0),H=i.useRef(!1),oe=i.useRef(0),ie=i.useRef(0),B=i.useRef(0),K=i.useRef(!0),V=i.useRef(1/0),P=i.useRef([]),M=i.useRef(0),U=i.useRef(0),X=i.useRef(0),T=i.useRef(0),$=i.useRef([]),Y=i.useRef(null),ae=i.useRef(null),de=i.useRef(null),re=i.useRef(0),ye=i.useRef([]),fe=i.useRef(null),pe=i.useRef(!1),Qe=i.useRef(null),Je=i.useRef(null),st=i.useRef([]),ce=i.useRef(null),Ae=i.useRef(0),Ye=i.useRef([]),nt=i.useRef(null),Te=i.useRef(null),kt=i.useRef(null),ot=i.useRef([]),we=i.useRef({too_slow:0,slow:0,optimal:0,fast:0,too_fast:0}),Pe=i.useRef([]),Ze=i.useRef({muy_bajo:0,bajo:0,normal:0,alto:0}),lt=i.useRef([]),zt=5e3,Ie=5,vt=3e3,jt=400,St=1,Q=5e3,ue=15e3,mt=100,De=36e3,$e={minCutoff:1.4,beta:1.2,dCutoff:1},ke={minCutoff:.9,beta:.012,dCutoff:1},Ee=i.useCallback(()=>{A.current&&(cancelAnimationFrame(A.current),A.current=null),b.current&&(b.current.getTracks().forEac
602h(me=>me.stop()),b.current=null),w.current&&(w.current.close().catch(()=>{}),w.current=null),L.current=null,z.current=null,S.current=0,_.current=!1,D.current=0,q.current=0,H.current=!1,oe.current=0,ie.current=0,B.current=0,K.current=!0,V.current=1/0,P.current=[],M.current=0,U.current=0,X.current=0,T.current=0,$.current=[],Y.current=null,ae.current=null,de.current=null,re.current=0,ye.current=[],fe.current=null,pe.current=!1,Ye.current=[],nt.current=null,Qe.current=null,Je.current=null,st.current=[],ce.current=null,Ae.current=0,Te.current=null},[]);i.useEffect(()=>()=>Ee(),[Ee]);function xt(me){Qe.current=me,Je.current=Date.now(),o(me),c(0)}function Oe(){const me=F.current;me.wpm=null,me.wpmCategory=null,me.pitchRatio=null,me.pitchLabel=null,me.activePause=!1,me.lastPauseDuration=null,me.pauseCount=0,me.energy=0,me.hasSpoken=!1}function Ke(me,Re,We){const ve=new Float32Array(me.fftSize),Ce=new Uint8Array(Re.fftSize),_e=()=>{A.current=requestAnimationFrame(_e);try{S.current+=1;const se=Date.now(),et=Qe.current,it=se-(Je.current??se),je=F.current;if(me.getFloatTimeDomainData(ve),S.current%4===0){let le=0;for(let Ue=0;Ue<ve.length;Ue++)le+=ve[Ue]*ve[Ue];const ge=Math.sqrt(le/ve.length),Fe=Math.min(ge*8,1);je.energy=Fe,(et==="noise"||et==="speech")&&u(Fe)}if(et==="noise"){S.current%4===0&&c(Math.min(100,Math.round(it/Q*100))),Re.getByteTimeDomainData(Ce);let le=0;for(let ge=0;ge<Ce.length;ge++){const Fe=(Ce[ge]-128)/128;le+=Fe*Fe}if(st.current.push(Math.sqrt(le/Ce.length)),it>=Q){const ge=st.current;X.current=ge.length>0&&Xr(ge)||.002,T.current=30,xt("speech")}return}if(et==="speech"){S.current%4===0&&c(Math.min(100,Math.round(it/ue*100)));const le=yo(ve,We);le.confidence>yt.VOICING_CONF&&le.f0&&Ye.current.push(le.f0),it>=ue&&(nt.current=Ye.current.length>=5?Xr(Ye.current):150,xt("ready"),setTimeout(()=>{Qe.current=null,o(null)},1500));return}if(et==="ready")return;ce.current==null&&(ce.current=se,Ae.current=se);const _t=yo(ve,We);if(_t.confidence>yt.VOICING_CONF?(D.current++,q.current=0,D.current>=St&&(_.current=!0,oe.current=se)):(D.current=0,q.current++,q.current>=3&&_.current&&(_.current=!1)),_.current&&_t.f0&&nt.current){let le=_t.f0/nt.current;if(le>1.8&&(le=le/2),le>=.45&&le<=1.8){const ge=vo(ye.current,le);Pe.current.push(ge);const Fe=Ss(ge);Ze.current[Fe]=(Ze.current[Fe]||0)+1,fe.current||(fe.current=wo($e));const Ue=fe.current.filter(ge,se);je.pitchRatio=parseFloat(Ue.toFixed(2)),je.pitchLabel=Ss(Ue)}}Re.getByteTimeDomainData(Ce);let ct=0;for(let le=0;le<Ce.length;le++){const ge=(Ce[le]-128)/128;ct+=ge*ge}const Ft=Math.sqrt(ct/Ce.length),ft=ie.current,tt=Ft>ft?ft+yt.RISE_COEFF*(Ft-ft):ft*yt.FALL_COEFF;ie.current=tt,tt>B.current&&(B.current=tt),B.current*=yt.PEAK_DECAY;const k=X.current*yt.NOISE_MULT,W=Math.max(B.current*yt.PEAK_RATIO,k),te=X.current*yt.MIN_SPEECH_MULT;tt<W&&(K.current=!0),K.current&&tt<V.current&&(V.current=tt);const Be=V.current>.001?tt/V.current>yt.MIN_RISE_RATIO:!0;K.current&&tt>W&&Ft>te&&Be&&_.current&&se-M.current>yt.MIN_ONSET_MS&&(K.current=!1,V.current=1/0,P.current.push(se),M.current=se,H.current||(H.current=!0,je.hasSpoken=!0,v(!0)),U.current+=1);const bt=se-zt;P.current=P.current.filter(le=>le>=bt);const xe=P.current.slice(-Ie);if(xe.length>2){const le=[];for(let ge=1;ge<xe.length;ge++){const Fe=xe[ge]-xe[ge-1];Fe<yt.WPM_ISI_MAX_MS&&le.push(Fe)}if(le.length>=2){const ge=Xr(le);if(ge>0){const Fe=Math.round(6e4/ge/yt.SYLLABLES_PER_WORD),Ue=vo($.current,Fe);if(Ue>0&&Ue<500){Y.current=Ue,ae.current=Ue;const Wt=ks(Ue);se-re.current>=1e3&&(re.current=se,ot.current.push(Ue)),we.current[Wt]=(we.current[Wt]||0)+1}}}}if(M.current>0&&se-M.current>yt.WPM_ISI_MAX_MS&&(Y.current=null,ae.current=null,$.current=[],de.current=null,je.wpm=null,je.wpmCategory=null),Y.current!=null){de.current||(de.current=wo(ke));const le=Math.round(de.current.filter(Y.current,se));je.wpm=le,je.wpmCategory=ks(le)}if(oe.current>0&&se-oe.current<=vt?pe.current=!1:H.current&&!pe.current&&(pe.current=!0,je.wpm=null,je.wpmCategory=null,je.pitchRatio=null,je.pitchLabel=null,de.current=null,fe.current=null,$.current=[],ye.current=[],Y.current=null,ae.current=null),H.
602current){if(!_.current)Te.current?se-Te.current>=jt&&(je.activePause=!0):Te.current=se;else if(Te.current){const le=se-Te.current;le>=jt&&(je.lastPauseDuration=parseFloat((le/1e3).toFixed(1)),je.pauseCount+=1,lt.current.push(le),ce.current!=null&&(N.current.push({startT:Te.current-ce.current,endT:se-ce.current,durMs:le}),N.current.length>5e3&&N.current.shift())),Te.current=null,je.activePause=!1}}se-Ae.current>=mt&&(Ae.current=se,C.current.push({t:se-ce.current,wpm:je.wpm,pitch:je.pitchRatio,voiced:_.current}),C.current.length>De&&C.current.shift()),j.current&&j.current(je)}catch(se){console.warn("[VoiceTrainer] analysis frame error:",se)}};A.current=requestAnimationFrame(_e)}function Le(me){const Re=new Date().toISOString(),We=ce.current,ve=We!=null?Math.max(0,Date.now()-We):Date.now()-me.getTime(),Ce=Math.max(1,Math.round(ve/1e3)),_e=ot.current,se=_e.length>0?parseFloat((_e.reduce((xe,He)=>xe+He,0)/_e.length).toFixed(1)):null,et=_e.length>0?Math.min(..._e):null,it=_e.length>0?Math.max(..._e):null,je=Object.values(we.current).reduce((xe,He)=>xe+He,0),_t=je>0?parseFloat((we.current.optimal/je*100).toFixed(1)):null,ct=Pe.current,Ft=ct.length>0?parseFloat((ct.reduce((xe,He)=>xe+He,0)/ct.length).toFixed(3)):null,ft=Object.values(Ze.current).reduce((xe,He)=>xe+He,0),tt=ft>0?parseFloat((Ze.current.bajo/ft*100).toFixed(1)):null,k=ft>0?parseFloat((Ze.current.normal/ft*100).toFixed(1)):null,W=lt.current,te=W.length,Be=W.length>0?parseFloat((W.reduce((xe,He)=>xe+He,0)/W.length/1e3).toFixed(2)):null,qe=W.filter(xe=>xe>=1e3).length,bt=W.length>0?parseFloat((qe/W.length*100).toFixed(1)):null;return{started_at:me.toISOString(),ended_at:Re,duration_seconds:Ce,wpm_avg:se,wpm_min:et,wpm_max:it,wpm_optimal_pct:_t,pitch_avg_ratio:Ft,pitch_bajo_pct:tt,pitch_normal_pct:k,pause_count:te,pause_avg_duration:Be,pause_good_pct:bt,total_syllables:U.current||null}}const gt=i.useCallback(async()=>{p(null),o(null),c(0),u(0),h(null),y(null),v(!1),Oe();const me=new Date;kt.current=me,ot.current=[],we.current={too_slow:0,slow:0,optimal:0,fast:0,too_fast:0},Pe.current=[],Ze.current={muy_bajo:0,bajo:0,normal:0,alto:0},lt.current=[],U.current=0,st.current=[],Ye.current=[],nt.current=null,C.current=[],N.current=[],ce.current=null,Ae.current=0,pe.current=!1,de.current=null,fe.current=null,re.current=0;try{const Re=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!t,noiseSuppression:!t,autoGainControl:!1,sampleRate:48e3,channelCount:1}});b.current=Re;const We=window.AudioContext||window.webkitAudioContext,ve=new We;w.current=ve;const Ce=ve.createMediaStreamSource(Re),_e=ve.createAnalyser();_e.fftSize=2048,_e.smoothingTimeConstant=0,Ce.connect(_e),L.current=_e;const se=ve.createAnalyser();se.fftSize=256,se.smoothingTimeConstant=0,Ce.connect(se),z.current=se,xt("noise"),Ke(_e,se,ve.sampleRate),s(!0)}catch(Re){const We=Re.name==="NotAllowedError"?"Se necesita permiso de micrófono. ActÃvalo en la configuración del navegador.":Re.name==="NotFoundError"?"No se encontró ningún micrófono. Conecta uno e inténtalo de nuevo.":"No se pudo acceder al micrófono: "+Re.message;p(We),Ee()}},[t,Ee]),pt=i.useCallback(()=>{if(s(!1),o(null),Qe.current=null,Te.current&&H.current){const Ce=Date.now()-Te.current;Ce>=jt&&(lt.current.push(Ce),ce.current!=null&&N.current.push({startT:Te.current-ce.current,endT:Date.now()-ce.current,durMs:Ce})),Te.current=null}const me=ce.current,Re=me!=null?Math.max(0,Date.now()-me):0,We=C.current.slice(),ve=N.current.slice();if(kt.current){const Ce=Le(kt.current);h(Ce),kt.current=null}We.length>0&&y({samples:We,pauses:ve,durationMs:Re}),Ee()},[Ee]),It=i.useCallback(()=>{h(null),y(null)},[]),At=i.useCallback(()=>{pt(),p(null),h(null),y(null),v(!1),u(0),Oe()},[pt]);return{isListening:r,analyserRef:L,liveMetricsRef:F,timelineRef:C,calibPhase:n,calibProgress:l,energy:d,error:m,hasSpoken:x,sessionStats:f,sessionTimeline:g,startListening:gt,stopListening:pt,resetSession:At,clearSessionStats:It}}const Qr=0,ko=250,Zr=.5,So=1.5,wp="rgba(255,255,255,0.10)",Ao="rgba(255,255,255,0.45)",kp="rgba(255,255,255,0.6)";function Sp(t){const a=ks(t);return a==="optimal"?"#00E5A0":a==="slow"||a==="fast"?"#FFB800":"#FF4757"}function Ap(t){const a=Ss(t);return a==="bajo"?"#00E5A0":a==="normal"?"#00B4D8":a==="muy_bajo"?"#FFB800":"#FF4757"}const Eo=(t,a,r)=>t<a?a:t>r?r:t;function Ep(t){const a=Math.max(0,Math.round(t/1e3));return`${Math.floor(a/60)}:${String(a%60).padStart(2,"0")}`}function Co({mode:t,timelineRef:a,active:r=!1,samples:s=null,pauses:n=null,durationMs:o=0,windowMs:l=2e4,height:c=200}){const d=i.useRef(null),u=i.useRef(null),m=i.useRef(0),p=i.useRef(0);function x(f,h,g,y,j,F,C){f.clearRect(0,0,h,g);const N=34,b=12,w=16,L=18,z=26,A=h-N-b,S=(g-w-L-z)/2,_=w,D=w+S,q=D+z,H=q+S,oe=V=>N+(V-j)/(F-j||1)*A,ie=V=>D-(Eo(V,Qr,ko)-Qr)/(ko-Qr)*S,B=V=>H-(Eo(V,Zr,So)-Zr)/(So-Zr)*S;if(f.fillStyle="rgba(0,229,160,0.08)",f.fillRect(N,ie(150),A,ie(100)-ie(150)),f.fillStyle="rgba(0,229,160,0.08)",f.fillRect(N,B(.88),A,B(.7)-B(.88)),f.fillStyle="rgba(0,180,216,0.05)",f.fillRect(N,B(1.15),A,B(.88)-B(1.15)),C&&C.length)for(const V of C){if(V.endT<j||V.startT>F)continue;const P=oe(Math.max(V.startT,j)),M=Math.max(2,oe(Math.min(V.endT,F))-P);f.fillStyle="rgba(255,184,0,0.10)",f.fillRect(P,_,M,H-_),f.fillStyle="rgba(255,184,0,0.55)",f.fillRect(P,_,1.5,H-_)}f.strokeStyle=wp,f.lineWidth=1,f.font="10px 'JetBrains Mono', monospace",f.fillStyle=Ao,f.textBaseline="middle";for(const V of[100,150]){const P=ie(V)+.5;f.beginPath(),f.moveTo(N,P),f.lineTo(h-b,P),f.stroke(),f.textAlign="right",f.fillText(String(V),N-4,ie(V))}for(const V of[1]){const P=B(V)+.5;f.beginPath(),f.moveTo(N,P),f.lineTo(h-b,P),f.stroke(),f.textAlign="right",f.fillText(V.toFixed(1),N-4,B(V))}f.font="9px 'JetBrains Mono', monospace",f.fillStyle=kp,f.textAlign="left",f.textBaseline="top",f.fillText("VELOCIDAD · wpm",N+2,_-12),f.fillText("TONO · Ãbase",N+2,q-12),f.fillStyle=Ao,f.textBaseline="bottom",t==="live"?(f.textAlign="left",f.fillText(`â${Math.round(l/1e3)}s`,N,g),f.textAlign="right",f.fillText("ahora",h-b,g)):(f.textAlign="left",f.fillText("0:00",N,g),f.textAlign="right",f.fillText(Ep(F),h-b,g));const K=(V,P,M)=>{f.lineWidth=2,f.lineJoin="round",f.lineCap="round";let U=null;for(const X of y){if(!X||X.t<j||X.t>F){U=null;continue}const T=V(X);if(T==null){U=null;continue}const $=oe(X.t),Y=P(T);U?(f.beginPath(),f.strokeStyle=M(T),f.moveTo(U.x,U.y),f.lineTo($,Y),f.stroke()):(f.fillStyle=M(T),f.beginPath(),f.arc($,Y,1.4,0,Math.PI*2),f.fill()),U={x:$,y:Y}}};K(V=>V.wpm,ie,Sp),K(V=>V.pitch,B,Ap)}function v(f){const h=window.devicePixelRatio||1,g=f.clientWidth||600,y=c,j=Math.round(g*h),F=Math.round(y*h);(f.width!==j||f.height!==F)&&(f.width=j,f.height=F);const C=f.getContext("2d");return C.setTransform(h,0,0,h,0,0),{ctx:C,W:g,H:y}}return i.useEffect(()=>{if(t!=="live")return;const f=d.current;if(!f)return;const h=()=>
602{if(u.current=requestAnimationFrame(h),!r)return;const g=(a==null?void 0:a.current)||[],{ctx:y,W:j,H:F}=v(f);let C;if(g.length){const w=g[g.length-1].t;w!==m.current&&(m.current=w,p.current=performance.now());const L=Math.min(performance.now()-p.current,250);C=w+L}else C=l,m.current=0;const N=C-l;x(y,j,F,g,N,C,null)};return h(),()=>{u.current&&cancelAnimationFrame(u.current)}},[t,r,a,l,c]),i.useEffect(()=>{if(t!=="session")return;const f=d.current;if(!f||!s||s.length===0)return;const h=()=>{var w;if(!f.clientWidth)return;const{ctx:y,W:j,H:F}=v(f),C=o>0?o:((w=s[s.length-1])==null?void 0:w.t)||1,N=Math.max(60,Math.min(600,Math.round(j-46))),b=jp(s,N);x(y,j,F,b,0,C,n)};h();const g=new ResizeObserver(h);return g.observe(f),()=>g.disconnect()},[t,s,n,o,c]),e.jsx("canvas",{ref:d,className:"w-full rounded-lg block",style:{height:c,background:"rgba(0,0,0,0.25)"},"aria-label":t==="live"?"Evolución en tiempo real de velocidad y tono":"Historia de velocidad y tono de la sesión"})}function rn({feature:t,description:a,bullets:r=[]}){const s=he();return e.jsx("div",{className:"flex flex-col items-center justify-center min-h-[70vh] px-4 py-16",children:e.jsxs("div",{className:"w-full max-w-md flex flex-col items-center text-center rounded-2xl p-8 md:p-10",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.07)"},children:[e.jsx("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center mb-6",style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.15)"},children:e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"#00E5A0",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),e.jsx("span",{className:"text-xs font-mono font-semibold uppercase tracking-widest mb-4 px-3 py-1 rounded-full",style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",letterSpacing:"0.15em"},children:"Funcionalidad Premium"}),e.jsx("h1",{className:"text-2xl md:text-3xl font-bold text-white mb-3",style:{fontFamily:"'Playfair Display', serif"},children:t}),e.jsx("p",{className:"text-sm leading-relaxed mb-6",style:{color:"rgba(255,255,255,0.55)"},children:a}),r.length>0&&e.jsx("ul",{className:"w-full flex flex-col gap-2.5 mb-8 text-left",children:r.map((n,o)=>e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"#00E5A0",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"mt-0.5 shrink-0","aria-hidden":"true",children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),e.jsx("span",{className:"text-sm",style:{color:"rgba(255,255,255,0.7)"},children:n})]},o))}),e.jsx("button",{onClick:()=>s("/billing"),className:"w-full py-3 rounded-xl font-semibold text-sm mb-3 transition-opacity duration-200 hover:opacity-90",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F"},children:"Activar Premium"}),e.jsx("button",{onClick:()=>s(-1),className:"text-sm transition-colors duration-200",style:{color:"rgba(255,255,255,0.35)"},onMouseEnter:n=>{n.currentTarget.style.color="rgba(255,255,255,0.6)"},onMouseLeave:n=>{n.currentTarget.style.color="rgba(255,255,255,0.35)"},children:"â Volver"})]})})}const _o=[{icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-6 h-6","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.5l3-3m0 0l3 3m-3-3v7.5M21 10.5l-3 3m0 0l-3-3m3 3V3"})}),title:"Velocidad",highlight:"100â150 WPM",explanation:"El ritmo pausado mantiene la mente consciente ocupada mientras la inconsciente asimila las sugerencias. Demasiado rápido y no procesa; demasiado lento, pierde el hilo.",color:"#00E5A0"},{icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-6 h-6","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9l10.5-3m0 0l3 10.5M19.5 6L8.25 17.25 3 12"})}),title:"Bajada de tono",highlight:"â25â30% en comandos",explanation:"La marca analógica tonal señala el comando al inconsciente y sortea el filtro crÃtico. Baja el tono solo en el comando; el resto del discurso permanece natural.",color:"#00B4D8"},{icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-6 h-6","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})}),title:"Pausas",highlight:"1s antes · 2s después",explanation:"El silencio amplifica la directiva. La pausa antes crea vacÃo atencional; la de después deja que el comando se instale.",color:"#FFB800"},{icon:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-6 h-6","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.275 2.903 2.846 2.903h.26c1.247 0 2.407-.633 3.094-1.689l.448-.681c.383-.582 1.043-.933 1.75-.933s1.367.35 1.75.933l.448.681c.687 1.056 1.847 1.689 3.094 1.689h.26c1.57 0 2.846-1.302 2.846-2.902V8.25c0-2.485-2.015-4.5-4.5-4.5H6.75c-2.485 0-4.5 2.015-4.5 4.5v5.01z"})}),title:"Comandos encubiertos",highlight:"Infinitivo subordinado",explanation:"El comando se inserta en una cláusula subordinada para eludir la resistencia consciente. El inconsciente lo procesa como directiva directa.",color:"#FF4757"}],Cp={too_slow:"Demasiado lento: el cliente se desconecta",slow:"Un poco lento, acelera ligeramente",optimal:"Ritmo hipnótico â",fast:"Rápido, baja el ritmo y deja que llegue",too_fast:"Demasiado rápido: el cliente no puede procesar"},_p={muy_bajo:"Muy grave, sube un poco",bajo:"Tono de comando â",normal:"Normal. Baja para comandos encubiertos",alto:"Demasiado agudo: pierdes autoridad hipnótica"};function es(t){return t?t==="optimal"?"#00E5A0":t==="slow"||t==="fast"?"#FFB800":"#FF4757":"rgba(255,255,255,0.2)"}function ts(t){return t?t==="bajo"?"#00E5A0":t==="normal"?"#00B4D8":t==="muy_bajo"?"#FFB800":"#FF4757":"rgba(0,180,216,0.35)"}function Fp(t){return t?Math.min(t/250*100,100):0}function Mp(t){return t==null?50:Math.min(Math.max(t/2*100,0),100)}const Tp=[{pos:0,width:28,bg:"#FF4757"}
602,{pos:28,width:12,bg:"#FFB800"},{pos:40,width:20,bg:"#00E5A0"},{pos:60,width:20,bg:"#FFB800"},{pos:80,width:20,bg:"#FF4757"}];function Pp(){const{user:t}=Ge();return t!=null&&t.is_premium?e.jsx(Lp,{}):e.jsx(rn,{feature:"Entrenador de Voz",description:"Calibra tu velocidad, tono y pausas en tiempo real antes de grabar. Métricas en directo sin consumir evaluaciones.",bullets:["WPM en directo para mantener el ritmo persuasivo óptimo (100â150 ppm)","Análisis de tono que detecta cuándo baja tu pitch y en qué momento","Detección de pausas para practicar la pausa dramática antes del comando","Historial de sesiones de entrenamiento vocal"]})}function Lp(){const[t,a]=i.useState(()=>{try{return localStorage.getItem("neuralpitch_hq_mic")==="true"}catch{return!1}}),r=()=>{a(P=>{const M=!P;try{localStorage.setItem("neuralpitch_hq_mic",String(M))}catch{}return M})},s=i.useRef(null),n=i.useRef(null),o=i.useRef(null),l=i.useRef(null),c=i.useRef(null),d=i.useRef(null),u=i.useRef(null),m=i.useRef(null),p=i.useRef(null),x=i.useRef(null),v={muy_bajo:"Muy grave",bajo:"Bajo â",normal:"Normal",alto:"Agudo"},f=i.useCallback(P=>{s.current&&(s.current.style.width=`${Fp(P.wpm)}%`,s.current.style.background=P.wpmCategory?es(P.wpmCategory):"rgba(255,255,255,0.2)"),n.current&&(n.current.textContent=P.wpm!=null?`${P.wpm} wpm`:"â",n.current.style.color=P.wpmCategory?es(P.wpmCategory):"rgba(255,255,255,0.45)"),o.current&&(o.current.textContent=P.wpmCategory?Cp[P.wpmCategory]:"",o.current.style.color=P.wpmCategory?es(P.wpmCategory):"transparent"),l.current&&(l.current.style.width=`${Mp(P.pitchRatio)}%`,l.current.style.background=P.pitchLabel?ts(P.pitchLabel):"rgba(0,180,216,0.35)"),c.current&&(c.current.textContent=P.pitchLabel?v[P.pitchLabel]:"â",c.current.style.color=P.pitchLabel?ts(P.pitchLabel):"rgba(255,255,255,0.45)"),d.current&&(d.current.textContent=P.pitchLabel?_p[P.pitchLabel]:"",d.current.style.color=P.pitchLabel?ts(P.pitchLabel):"transparent"),x.current&&(x.current.style.width=`${(P.energy||0)*100}%`);const M=u.current,U=m.current,X=p.current;if(M&&U&&X){const T=P.lastPauseDuration!=null&&P.lastPauseDuration>=.8&&P.lastPauseDuration<=3,$=P.activePause,Y=$?"#FFB800":T?"#00E5A0":"rgba(255,255,255,0.4)";M.style.background=$?"rgba(255,184,0,0.12)":T?"rgba(0,229,160,0.1)":"rgba(255,255,255,0.04)",M.style.borderColor=$?"rgba(255,184,0,0.35)":T?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.08)",M.style.color=$?"#FFB800":T?"#00E5A0":"rgba(255,255,255,0.5)",U.style.width=$?"10px":"8px",U.style.height=$?"10px":"8px",U.style.background=Y,U.style.boxShadow=$?"0 0 6px #FFB800":"none",U.style.animation=$?"pulse 1s infinite":"none";const ae=$?"En pausaâ¦":P.lastPauseDuration!=null?`${P.lastPauseDuration}s ${T?"â":", ajusta la duración"}`:"Sin pausas aún",de=P.pauseCount>0?` (${P.pauseCount} pausa${P.pauseCount!==1?"s":""})`:"";X.textContent=ae+de}},[]),{isListening:h,analyserRef:g,timelineRef:y,calibPhase:j,calibProgress:F,energy:C,error:N,hasSpoken:b,sessionStats:w,sessionTimeline:L,startListening:z,stopListening:A,resetSession:S,clearSessionStats:_}=Np({hqMic:t,onFrame:f}),D=j!=null,[q,H]=i.useState(!1),[oe,ie]=i.useState(null),[B,K]=i.useState(!1),V=i.useRef(null);return i.useEffect(()=>()=>A(),[A]),i.useEffect(()=>{if(!h)return;const P=setInterval(()=>{window.dispatchEvent(new CustomEvent("neuralpitch:user-active"))},3e4);return()=>clearInterval(P)},[h]),i.useEffect(()=>{w&&w!==V.current&&(V.current=w,!(w.duration_seconds<10||!w.total_syllables)&&(ie(null),K(!1),R.post("/api/voice-trainer/sessions",w).then(P=>ie(P)).catch(()=>K(!0))))},[w]),e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 space-y-10",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Fundamentos · PNL en Ventas"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Entrenador de Voz"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Practica los cuatro pilares de la hipnosis conversacional y recibe retroalimentación en tiempo real sin consumir cuota de evaluación."})]}),e.jsxs("section",{"aria-label":"Fundamentos de PNL",children:[e.jsxs("button",{onClick:()=>H(P=>!P),className:"w-full flex items-center justify-between px-5 py-3.5 transition-all duration-200",style:{background:q?"rgba(255,255,255,0.03)":"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.07)",borderRadius:q?"16px 16px 0 0":"16px",borderBottom:q?"1px solid rgba(255,255,255,0.04)":void 0,cursor:"pointer"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center flex-shrink-0",style:{background:"rgba(0,229,160,0.1)"},children:e.jsx("svg",{viewBox:"0 0 20 20",fill:"#00E5A0",className:"w-3.5 h-3.5","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})})}),e.jsx("span",{className:"text-sm font-medium",style:{color:"rgba(255,255,255,0.7)"},children:"Instrucciones: los 4 pilares"}),!q&&e.jsx("div",{className:"hidden md:flex items-center gap-1.5 ml-2",children:_o.map(P=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded font-mono",style:{background:`${P.color}10`,color:`${P.color}bb`},children:P.highlight},P.title))})]}),e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4 flex-shrink-0 transition-transform duration-300",style:{color:"rgba(255,255,255,0.3)",transform:q?"rotate(180deg)":"rotate(0deg)"},"aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})]}),q&&e.jsx("div",{className:"px-4 pb-5 pt-4",style:{background:"rgba(255,255,255,0.03)",borderLeft:"1px solid rgba(255,255,255,0.07)",borderRight:"1px solid rgba(255,255,255,0.07)",borderBottom:"1px solid rgba(255,255,255,0.07)",borderRadius:"0 0 16px 16px"},children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:_o.map(P=>e.jsxs("div",{className:"rounded-xl flex flex-col",style:{background:"rgba(255,255,255,0.025)",border:"1px solid rgba(255,255,255,0.06)",overflow:"hidden"},children:[e.jsx("div",{style:{height:"2px",background:`linear-gradient(90deg, ${P.color}, ${P.color}55)`}}),e.jsxs("div",{className:"p-4 flex flex-col gap-3 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:`linear-gradient(135deg, ${P.color}18, ${P.color}08)`,border:`1px solid ${P.color}20`,color:P.color},children:P.icon}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold text-white leading-tight",children:P.title}),e.jsx("p",{className:"text-xs font-mono leading-tight mt-0.5",style:{color:P.color},children:P.highlight})]})]}),e.jsx("p",{className:"text-xs leading-relaxed",style:{color:"rgba(255,255,255,0.65)"},children:P.explanation})]})]},P.title))})})]}),e.jsxs("section",{className:"rounded-2xl p-6 space-y-6",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.07)"},"aria-label":"Entrenador en vivo",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsx("h2",{className:"text-base font-semibold tracking-wide uppercase",style:{color:"rgba(255,255,255,0.7)",letterSpacing:"0.12em"},children:"Entrenador en vivo"}),e.jsxs("button",{onClick:r,className:"flex items-center gap-2 px-3 py-1.5 rounded-lg text-xs font-medium transition-all duration-200",style:{background:t?"rgba(0,180,216,0.15)":"rgba(255,255,255,0.05)",border:t?"1px solid rgba(0,180,216,0.4)":"1px solid rgba(255,255,255,0.08)",color:t?"#00B4D8":"rgba(255,255,255,0.5)",cursor:"pointer"},"aria-pressed":t,title:"Activar para AirPods Pro, Sony WH-1000XM u otros auriculares con ANC por hardware",children:[e.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-3.5 h-3.5","aria-hidden":"true",children:[e.jsx("path",{d:"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"}),e.jsx("path",{d:"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5H10.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"})]}),"Mic ANC"]})]}),N&&e.jsx("div",{className:"rounded-lg px-4 py-3 text-sm",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.25)",color:"#FF4757"},role:"alert",children:N}),e.jsx("div",{className:"rounded-xl p-3",style:{background:"rgba(0,0,0,0.3)"},children:e.jsx(Ys,{isRecording:h,analyserRef:g})}),D?e.jsx("div",{className:"rounded-xl py-8 px-6",style:{background:j==="noise"?"rgba(0,180,216,0.04)":"rgba(0,229,160,0.04)",border:`1px solid ${j==="noise"?"rgba(0,180,216,0.15)":"rgba(0,229,160,0.15)"}`},"aria-live":"polite",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 max-w-md mx-auto text-center",children:[e.jsx("div",{className:"flex items-center gap-0",children:[{key:"noise",num:1,label:"Silencio"},{key:"speech",num:2,label:"Habla"},{key:"ready",num:3,label:"Listo"}].map((P,M)=>{const U=["noise","speech","ready"],X=U.indexOf(j),T=U.indexOf(P.key),$=T===X,Y=T<X,ae=P.key==="noise"?"#00B4D8":"#00E5A0";return e.jsxs("div",{className:"flex items-center",children:[M>0&&e.jsx("div",{className:"h-px",style:{width:"32px",background:Y?"rgba(0,229,160,0.5)":"rgba(255,255,255,0.1)"}}),e.jsxs("div",{className:"flex flex-col items-center gap-1",children:[e.jsx("div",{className:"flex items-center justify-center rounded-full text-xs font-bold transition-all duration-300",style:{width:$?"36px":"28px",height:$?"36px":"28px",background:Y?"rgba(0,229,160,0.2)":$?`${ae}22`:"rgba(255,255,255,0.05)",border:`2px solid ${Y?"#00E5A0":$?ae:"rgba(255,255,255,0.12)"}`,color:Y?"#00E5A0":$?ae:"rgba(255,255,255,0.3)"},children:Y?e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M12.416 3.376a.75.75 0 01.208 1.04l-5 7.5a.75.75 0 01-1.154.114l-3-3a.75.75 0 011.06-1.06l2.353 2.353 4.493-6.74a.75.75 0 011.04-.207z"})}):P.num}),e.jsx("span",{className:"text-xs whitespace-nowrap",style:{color:Y?"rgba(0,229,160,0.6)":$?ae:"rgba(255,255,255,0.3)",fontWeight:$?600:400},children:P.label})]})]},P.key)})}
602),e.jsxs("div",{className:"w-14 h-14 rounded-full flex items-center justify-center mt-2",style:{background:j==="noise"?"rgba(0,180,216,0.12)":"rgba(0,229,160,0.12)"},children:[j==="noise"&&e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00B4D8",strokeWidth:1.5,className:"w-7 h-7","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})}),j==="speech"&&e.jsxs("svg",{viewBox:"0 0 20 20",fill:"#00E5A0",className:"w-7 h-7","aria-hidden":"true",children:[e.jsx("path",{d:"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"}),e.jsx("path",{d:"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5H10.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"})]}),j==="ready"&&e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00E5A0",strokeWidth:2.5,className:"w-7 h-7","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})})]}),e.jsxs("h3",{className:"text-base font-semibold",style:{color:j==="noise"?"#00B4D8":"#00E5A0"},children:[j==="noise"&&"Calibrando ruido de fondo",j==="speech"&&"Calibrando tu voz",j==="ready"&&"Calibración completa"]}),e.jsxs("p",{className:"text-sm leading-relaxed",style:{color:"rgba(255,255,255,0.6)"},children:[j==="noise"&&"Mantén silencio unos segundos. Estamos midiendo el ruido ambiental de tu entorno para filtrar sonidos que no son tu voz.",j==="speech"&&"Habla con tu tono natural durante unos segundos. Lee algo en voz alta o cuenta lo que quieras. Necesitamos calibrar tu frecuencia base.",j==="ready"&&"Los medidores se activan ahora. Habla con normalidad y observa tu velocidad, tono y pausas en tiempo real."]}),(j==="noise"||j==="speech")&&e.jsxs("div",{className:"w-full max-w-xs mt-1",children:[e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-500 ease-out",style:{width:`${F}%`,background:j==="noise"?"linear-gradient(90deg, #00B4D8, #00B4D8cc)":"linear-gradient(90deg, #00E5A0, #00E5A0cc)"}})}),e.jsxs("div",{className:"flex justify-between mt-1.5",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:j==="noise"?"Silencio · 5 segundos":"Habla natural · 15 segundos"}),e.jsxs("span",{className:"text-xs font-mono font-medium",style:{color:j==="noise"?"#00B4D8":"#00E5A0"},children:[F,"%"]})]})]}),j==="speech"&&e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Volumen"}),e.jsx("div",{className:"w-24 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full transition-all duration-100",style:{width:`${C*100}%`,background:"rgba(0,229,160,0.6)"}})}),C>.05&&e.jsx("span",{className:"text-xs",style:{color:"rgba(0,229,160,0.6)"},children:"Detectando voz"})]})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-semibold tracking-wider uppercase",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.1em"},children:"Velocidad (WPM)"}),e.jsx("span",{ref:n,className:"text-xs font-mono",style:{color:"rgba(255,255,255,0.45)"},children:"â"})]}),e.jsxs("div",{className:"relative h-3 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:[Tp.map(P=>e.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${P.pos}%`,width:`${P.width}%`,background:P.bg,opacity:.25}},P.pos)),e.jsx("div",{ref:s,className:"absolute left-0 top-0 bottom-0 rounded-full",style:{width:"0%",background:"rgba(255,255,255,0.2)"}})]})]}),e.jsx("p",{ref:o,className:"text-xs",style:{color:"transparent",minHeight:"1rem"}}),h&&!b&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Habla unos segundos para calcular el ritmoâ¦"}),e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:[{label:"<70",color:"#FF4757"},{label:"70â99",color:"#FFB800"},{label:"100â150 â",color:"#00E5A0"},{label:"151â200",color:"#FFB800"},{label:">200",color:"#FF4757"}].map(P=>e.jsxs("span",{className:"text-xs flex items-center gap-1",style:{color:P.color},children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{background:P.color}}),P.label]},P.label))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-semibold tracking-wider up
602percase",style:{color:"rgba(255,255,255,0.55)",letterSpacing:"0.1em"},children:"Tono (relativo)"}),e.jsx("span",{ref:c,className:"text-xs font-mono",style:{color:"rgba(255,255,255,0.45)"},children:"â"})]}),e.jsx("div",{className:"relative h-3 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{ref:l,className:"absolute left-0 top-0 bottom-0 rounded-full",style:{width:"50%",background:"rgba(0,180,216,0.35)"}})})]}),e.jsx("p",{ref:d,className:"text-xs",style:{color:"transparent",minHeight:"1rem"}}),h&&!b&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Habla para detectar tu tonoâ¦"}),e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:[{label:"Muy grave",color:"#FFB800"},{label:"Bajo â",color:"#00E5A0"},{label:"Normal",color:"#00B4D8"},{label:"Agudo",color:"#FF4757"}].map(P=>e.jsxs("span",{className:"text-xs flex items-center gap-1",style:{color:P.color},children:[e.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-sm",style:{background:P.color}}),P.label]},P.label))})]})]}),h&&e.jsx("div",{className:"rounded-xl p-3",style:{background:"rgba(0,0,0,0.2)"},children:e.jsx(Co,{mode:"live",timelineRef:y,active:h,height:180})})]}),!D&&e.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[e.jsxs("div",{ref:u,className:"flex items-center gap-2 px-4 py-2 rounded-full text-sm font-medium",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)"},"aria-live":"polite","aria-label":"Indicador de pausa",children:[e.jsx("span",{ref:m,className:"rounded-full flex-shrink-0",style:{width:"8px",height:"8px",background:"rgba(255,255,255,0.4)"}}),e.jsx("span",{ref:p,children:"Sin pausas aún"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-32",children:[e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Vol"}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{ref:x,className:"h-full rounded-full",style:{width:"0%",background:"rgba(0,229,160,0.6)"}})})]})]}),e.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[h?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:A,className:"flex items-center gap-2 px-6 py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"rgba(255,71,87,0.15)",border:"1px solid rgba(255,71,87,0.4)",color:"#FF4757",cursor:"pointer"},children:[e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:e.jsx("rect",{x:"4",y:"4",width:"12",height:"12",rx:"2"})}),"Detener"]}),e.jsx("button",{onClick:S,className:"flex items-center gap-2 px-4 py-3 rounded-xl text-sm transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.5)",cursor:"pointer"},children:"Reiniciar"})]}):e.jsxs("button",{onClick:z,className:"flex items-center gap-2 px-6 py-3 rounded-xl font-semibold text-sm transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",cursor:"pointer"},children:[e.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:[e.jsx("path",{d:"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"}),e.jsx("path",{d:"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5H10.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"})]}),"Empezar"]}),h&&e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",style:{color:"#00E5A0"},"aria-live":"polite",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-current",style:{animation:"pulse 1.5s infinite"}}),D?"Calibrandoâ¦":"Analizando"]})]})]}),w&&!h&&e.jsxs("section",{ref:P=>{P&&P.scrollIntoView({behavior:"smooth",block:"start"})},className:"rounded-2xl py-8 px-6",style:{background:"rgba(0,229,160,0.04)",border:"1px solid rgba(0,229,160,0.15)",animation:"fadeSlideUp 0.4s both"},"aria-label":"Resumen de sesión",children:[e.jsxs("div",{className:"max-w-lg mx-auto flex flex-col items-center gap-5 text-center",children:[e.jsx("div",{className:"w-14 h-14 roun
602ded-full flex items-center justify-center",style:{background:"rgba(0,229,160,0.12)"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00E5A0",strokeWidth:2,className:"w-7 h-7","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z"})})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold",style:{color:"#00E5A0"},children:"Resumen de sesión"}),e.jsxs("p",{className:"text-sm mt-1",style:{color:"rgba(255,255,255,0.55)"},children:["Duración: ",e.jsxs("span",{className:"font-mono text-white",children:[Math.floor(w.duration_seconds/60),":",String(w.duration_seconds%60).padStart(2,"0")]}),w.total_syllables>0&&e.jsxs("span",{className:"ml-2",children:["· ",e.jsx("span",{className:"font-mono text-white",children:w.total_syllables})," sÃlabas"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 mt-6",children:[e.jsxs("div",{className:"rounded-xl p-5 flex flex-col items-center gap-3 text-center",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"rgba(0,229,160,0.1)"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00E5A0",strokeWidth:1.5,className:"w-5 h-5","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.5l3-3m0 0l3 3m-3-3v7.5M21 10.5l-3 3m0 0l-3-3m3 3V3"})})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.5)",letterSpacing:"0.1em"},children:"Velocidad"}),w.wpm_avg!=null?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-3xl font-bold font-mono",style:{color:"#00E5A0"},children:Math.round(w.wpm_avg)}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:"WPM"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-xs font-mono",style:{color:"rgba(255,255,255,0.45)"},children:[e.jsxs("span",{children:["mÃn ",e.jsx("span",{style:{color:"#FFB800"},children:w.wpm_min})]}),e.jsxs("span",{children:["máx ",e.jsx("span",{style:{color:"#FFB800"},children:w.wpm_max})]})]}),w.wpm_optimal_pct!=null&&e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"rgba(255,255,255,0.4)"},children:[e.jsx("span",{children:"Zona óptima"}),e.jsxs("span",{style:{color:w.wpm_optimal_pct>=50?"#00E5A0":"#FFB800"},children:[Math.round(w.wpm_optimal_pct),"%"]})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(w.wpm_optimal_pct,100)}%`,background:w.wpm_optimal_pct>=50?"linear-gradient(90deg, #00E5A0, #00E5A0cc)":"linear-gradient(90deg, #FFB800, #FFB800cc)"}})})]})]}):e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Sin datos suficientes"})]}),e.jsxs("div",{className:"rounded-xl p-5 flex flex-col items-center gap-3 text-center",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"rgba(0,180,216,0.1)"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00B4D8",strokeWidth:1.5,className:"w-5 h-5","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9l10.5-3m0 0l3 10.5M19.5 6L8.25 17.25 3 12"})})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.5)",letterSpacing:"0.1em"},children:"Tono"}),w.pitch_avg_ratio!=null?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsxs("span",{className:"text-3xl font-bold font-mono",style:{color:"#00B4D8"},children:["x",w.pitch_avg_ratio.toFixed(2)]}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:"vs. base"})]}),(w.pitch_bajo_pct!=null||w.pitch_normal_pct!=null)&&e.jsxs("div",{className:"w-full space-y-2",children:[w.pitch_bajo_pct!=null&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"rgba(255,255,255,0.4)"},children:[e.jsx("span",{children:"Tono bajo"}),e.jsxs("span",{style:{color:"#00E5A0"},children:[Math.round(w.pitch_bajo_pct),"%"]})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(w.pitch_bajo_pct,100)}%`,background:"linear-gradient(90deg, #00E5A0, #00E5A0cc)"}})})]}),w.pitch_normal_pct!=null&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"rgba(255,255,255,0.4)"},children:[e.jsx("span",{children:"Tono normal"}),e.jsxs("span",{style:{color:"#00B4D8"},children:[Math.round(w.pitch_normal_pct),"%"]})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(w.pitch_normal_pct,100)}%`,background:"linear-gradient(90deg, #00B4D8, #00B4D8cc)"}})})]})]})]}):e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Sin datos de tono"})]}),e.jsxs("div",{className:"rounded-xl p-5 flex flex-col items-center gap-3 text-center",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("div",{className:"w-10 h-10 rounded-full flex items-center justify-center",style:{background:"rgba(255,184,0,0.1)"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#FFB800",strokeWidth:1.5,className:"w-5 h-5","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})})}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.5)",letterSpacing:"0.1em"},children:"Pausas"}),e.jsxs("div",{className:"flex items-baseline gap-1.5",children:[e.jsx("span",{className:"text-3xl font-bold font-mono",style:{color:"#FFB800"},children:w.pause_count}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:"pausas"})]}),w.pause_avg_duration!=null&&e.jsxs("p",{className:"text-xs font-mono",style:{color:"rgba(255,255,255,0.45)"},children:["Media: ",e.jsxs("span",{style:{color:"rgba(255,255,255,0.8)"},children:[w.pause_avg_duration,"s"]})]}),w.pause_good_pct!=null&&e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:"flex justify-between text-xs mb-1",style:{color:"rgba(255,255,255,0.4)"}
602,children:[e.jsx("span",{children:"Calidad (⥠1s)"}),e.jsxs("span",{style:{color:w.pause_good_pct>=60?"#00E5A0":"#FFB800"},children:[Math.round(w.pause_good_pct),"%"]})]}),e.jsx("div",{className:"h-2 rounded-full overflow-hidden",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.min(w.pause_good_pct,100)}%`,background:w.pause_good_pct>=60?"linear-gradient(90deg, #00E5A0, #00E5A0cc)":"linear-gradient(90deg, #FFB800, #FFB800cc)"}})})]}),w.pause_count===0&&e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:"Practica pausas de 1â2s antes de los comandos"})]})]}),L&&L.samples.length>1&&e.jsxs("div",{className:"mt-6 rounded-xl p-4",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest mb-3",style:{color:"rgba(255,255,255,0.5)",letterSpacing:"0.12em"},children:"Evolución de la sesión"}),e.jsx(Co,{mode:"session",samples:L.samples,pauses:L.pauses,durationMs:L.durationMs,height:200}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap mt-3 text-xs",style:{color:"rgba(255,255,255,0.45)"},children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block w-3",style:{height:2,background:"#00E5A0"}}),"en zona"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block w-3",style:{height:2,background:"#FFB800"}}),"ajustar"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block w-3",style:{height:2,background:"#FF4757"}}),"fuera de zona"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"inline-block w-2 h-3 rounded-sm",style:{background:"rgba(255,184,0,0.3)"}}),"pausa"]})]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3 mt-6",children:[oe&&e.jsxs(Se,{to:"/history",className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",textDecoration:"none"},children:[e.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:e.jsx("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm.75-13a.75.75 0 00-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 000-1.5h-3.25V5z",clipRule:"evenodd"})}),"Ver en historial"]}),B&&e.jsx("span",{className:"text-xs",style:{color:"rgba(255,71,87,0.8)"},children:"No se pudo guardar la sesión"}),e.jsxs("button",{onClick:z,className:"flex items-center gap-2 px-5 py-2.5 rounded-xl text-sm font-medium transition-all duration-200",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer"},children:[e.jsxs("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4","aria-hidden":"true",children:[e.jsx("path",{d:"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"}),e.jsx("path",{d:"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5H10.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"})]}),"Nueva sesión"]}),e.jsx("button",{onClick:_,className:"flex items-center gap-1.5 px-3 py-2.5 rounded-xl text-xs transition-all duration-200",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.35)",cursor:"pointer"},children:"Cerrar"})]})]})]})}function Rp(){var u;const{refreshUser:t}=Ge(),[a,r]=i.useState(!1),[s,n]=i.useState(""),o=he(),c=((u=Ct().state)==null?void 0:u.from)||sessionStorage.getItem("neuralpitch_consent_return")||"/",d=async()=>{r(!0),n("");try{await R.post("/api/consent/voice-processing",{}),await t(),sessionStorage.removeItem("neuralpitch_consent_return"),o(c,{replace:!0,state:c==="/profile"?{consentJustAccepted:!0}:void 0})}catch{n("Error al guardar el consentimiento. Inténtalo de nuevo."),r(!1)}};return e.jsx("div",{className:"min-h-screen bg-[#0A0A0F] flex items-center justify-center px-4",children:e.jsxs("div",{className:"max-w-2xl w-full",children:[e.jsxs("div",{className:"text-center mb-8",children:[e.jsx("div",{className:"text-4xl mb-4",children:"ðï¸"}),e.jsx("h1",{className:"text-2xl font-bold text-white mb-2",children:"Cómo procesamos tu voz"}),e.jsx("p",{className:"text-white/60 text-sm",children:"Antes de tu primera evaluación, necesitamos tu consentimiento explÃcito sobre cómo procesamos tus grabaciones de voz."})]}),e.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-xl p-6 space-y-5",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-[#00E5A0] font-semibold mb-3 text-sm uppercase tracking-wide",children:"Qué analizamos"}),e.jsxs("ul",{className:"space-y-2 text-white/70 text-sm",children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#00E5A0]",children:"â"}),"Transcripción del texto que dices, para evaluar fidelidad al script"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#00E5A0]",children:"â"}),"Tono y variaciones de voz, para evaluar la marca analógica (bajada en comandos)"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#00E5A0]",children:"â"}),"Pausas y silencios, para evaluar el timing de la técnica de PNL"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#00E5A0]",children:"â"}),"Velocidad del habla, para evaluar el ritmo conversacional"]})]})]}),e.jsx("hr",{className:"border-white/10"}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-[#FF4757] font-semibold mb-3 text-sm uppercase tracking-wide",children:"Lo que NO hacemos"}),e.jsxs("ul",{className:"space-y-2 text-white/70 text-sm",children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#FF4757]",children:"â"}),"No detectamos emociones ni estados psicológicos"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#FF4757]",children:"â"}),"No almacenamos el audio: se descarta inmediatamente tras el análisis"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#FF4757]",children:"â"}),"No compartimos tus resultados individuales sin tu permiso explÃcito"]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{className:"text-[#FF4757]",children:"â"}),"No hacemos evaluaciones de personalidad ni diagnósticos clÃnicos"]})]})]}),e.jsx("hr",{className:"border-white/10"}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-[#00B4D8] font-semibold mb-3 text-sm uppercase tracking-wide",children:"Base legal y tus derechos"}),e.jsxs("div",{className:"space-y-2 text-white/70 text-sm",children:[e.jsx("p",{children:"Tu consentimiento es la base legal para el procesamiento de datos biométricos de voz (RGPD Art. 9 + EU AI Act)."}),e.jsxs("p",{children:["Puedes revocar este consentimiento en cualquier momento desde tu"," ",e.jsx("strong",{className:"text-white",children:"Perfil â Mis datos vocales"}),". La revocación impide nuevas evaluaciones hasta que vuelvas a aceptar."]}),e.jsxs("p",{children:["Tus evaluaciones históricas se conservan según nuestra"," ",e.jsx("a",{href:"/privacy",className:"text-[#00B4D8] underline",children:"PolÃtica de Privacidad"})," ","y puedes solicitar su eliminación en cualquier momento."]})]})]})]}),e.jsx("p",{className:"text-white/40 text-xs text-center mt-4 px-4",children:"Las evaluaciones de NeuralPitch son herramientas formativas, no cientÃficas. No representan una medición definitiva de tus capacidades ni deben usarse como criterio de decisiones laborales."}),s&&e.jsx("div",{className:"mt-4 bg-red-500/10 border border-red-500/30 rounded-lg p-3 text-red-400 text-sm text-center",children:s}),e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3",children:[e.jsx("button",{onClick:()=>o(-1),className:"flex-1 px-6 py-3 rounded-lg border border-white/20 text-white/60 hover:text-white hover:border-white/40 transition-colors text-sm",disabled:a,children:"Cancelar"}),e.jsx("button",{onClick:d,disabled:a,className:"flex-[2] px-8 py-3 rounded-lg bg-[#00E5A0] text-black font-semibold hover:bg-[#00E5A0]/90 transition-colors disabled:opacity-50 text-sm",children:a?"Guardando...":"Acepto el procesamiento de mi voz"})]}),e.jsx("p",{className:"text-white/25 text-xs text-center mt-4",children:"Versión de consentimiento 1.0 · EU AI Act compliant"})]})})}function Bp(){const[t,a]=i.useState(null),[r,s]=i.useState(!0);return i.useEffect(()=>{R.get("/api/transparency/ai-system-info").then(a).catch(()=>{}).finally(()=>s(!1))},[]),r?e.jsx("div",{className:"min-h-screen bg-[#0A0A0F] flex items-center justify-center",children:e.jsx("div",{className:"text-white/40",children:"Cargando información..."})}):t?e.jsx("div",{className:"min-h-screen bg-[#0A0A0F] px-4 py-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto
602space-y-8",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:t.system_name}),e.jsxs("p",{className:"text-white/40 text-sm",children:["Información de transparencia del sistema de IA · Versión"," ",t.version," · Actualizado ",t.last_updated]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(t.regulatory_compliance||[]).map(n=>e.jsx("span",{className:"px-2 py-1 bg-[#00E5A0]/10 border border-[#00E5A0]/30 text-[#00E5A0] text-xs rounded-full",children:n},n))})]}),e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-[#00E5A0] font-semibold mb-4",children:"Qué analiza este sistema"}),e.jsx("ul",{className:"space-y-2",children:(t.what_it_analyzes||[]).map((n,o)=>e.jsxs("li",{className:"flex gap-2 text-white/70 text-sm",children:[e.jsx("span",{className:"text-[#00E5A0] mt-0.5",children:"â"}),n]},o))})]}),e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-[#FF4757] font-semibold mb-4",children:"Lo que este sistema NO hace"}),e.jsx("ul",{className:"space-y-2",children:(t.what_it_does_not_do||[]).map((n,o)=>e.jsxs("li",{className:"flex gap-2 text-white/70 text-sm",children:[e.jsx("span",{className:"text-[#FF4757] mt-0.5",children:"â"}),n]},o))})]}),e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-[#00B4D8] font-semibold mb-4",children:"Componentes de IA utilizados"}),e.jsx("div",{className:"space-y-4",children:(t.ai_components||[]).map((n,o)=>e.jsxs("div",{className:"border border-white/10 rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-white font-medium text-sm",children:n.name}),e.jsx("span",{className:"text-white/40 text-xs",children:n.provider})]}),e.jsx("p",{className:"text-white/60 text-sm",children:n.purpose}),!n.data_retained&&e.jsx("span",{className:"mt-2 inline-block text-[#00E5A0] text-xs",children:"â No almacena datos"})]},o))})]}),t.human_oversight&&e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-white font-semibold mb-3",children:"Supervisión humana"}),e.jsx("p",{className:"text-white/70 text-sm",children:t.human_oversight.description}),e.jsxs("p",{className:"text-white/40 text-sm mt-2",children:["Tiempo de respuesta estimado: ",t.human_oversight.response_time]})]}),t.data_retention&&e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-white font-semibold mb-4",children:"Retención de datos"}),e.jsx("dl",{className:"space-y-3",children:Object.entries(t.data_retention).map(([n,o])=>e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsx("dt",{className:"text-white/40 text-sm capitalize",children:n.replace(/_/g," ")}),e.jsx("dd",{className:"col-span-2 text-white/70 text-sm",children:o})]},n))})]}),e.jsxs("section",{className:"bg-white/5 border border-white/10 rounded-xl p-6",children:[e.jsx("h2",{className:"text-white font-semibold mb-4",children:"Tus derechos"}),e.jsx("ul",{className:"space-y-2",children:(t.user_rights||[]).map((n,o)=>e.jsxs("li",{className:"text-white/70 text-sm flex gap-2",children:[e.jsx("span",{className:"text-[#00B4D8]",children:"â"}),n]},o))})]}),e.jsx("div",{className:"border border-[#FFB800]/30 bg-[#FFB800]/5 rounded-xl p-4",children:e.jsx("p",{className:"text-[#FFB800] text-sm",children:t.evaluation_disclaimer})}),e.jsxs("p",{className:"text-white/30 text-sm text-center",children:["Contacto: ",t.contact," · Desarrollado por ",t.developer]})]})}):e.jsx("div",{className:"min-h-screen bg-[#0A0A0F] flex items-center justify-center",children:e.jsx("div",{className:"text-white/40",children:"No se pudo cargar la información de transparencia."})})}const Mi="neuralpitch_manager_tour_v1",As="neuralpitch:manager-tour-restart",Ra=[{el:null,title:"Tu panel de equipo",desc:"Como manager gestionas desde aquà la <b>suscripción</b>, los <b>asientos</b> y los <b>miembros</b> de tu equipo, y ves su rendimiento agregado. Te lo enseño en menos de un minuto.",nextLabel:"Empezar â"},{el:"#mtour-subscription",title:"Suscripción y asientos",desc:"Aquà ves tu plan, la fecha de renovación y los <b>asientos en uso</b>. Con <b>Gestionar suscripción</b> abres el portal de Stripe (método de pago, facturas, cancelar) y con <b>Añadir asientos</b> amplÃas el cupo del equipo al instante."},{el:"#mtour-metrics",title:"Métricas del equipo",desc:"Rendimiento <b>agregado y anónimo</b> â nunca datos individuales de cada persona. Verás puntuaciones por pilar, técnicas más practicadas, evolución y actividad. Las puntuaciones aparecen cuando al menos <b>5 miembros comparten sus datos</b> (mÃnimo de cohorte, EU AI Act)."},{el:"#mtour-members",title:"Gestión de miembros",desc:"Invita a gente nueva con <b>Añadir miembro</b>. En cada fila puedes <b>transferir su asiento</b> a otra persona, designarla como manager, restablecer su contraseña o <b>quitarla del equipo</b> â al quitarla se libera su asiento para otro miembro."},{el:"#mtour-management",optional:!0,title:"Equipos de la organización",desc:"Si tu organización tiene varios equipos, aquà los <b>creas, renombras</b> y mueves miembros entre ellos. Cada equipo puede tener su propio manager."},{el:null,title:"¡Listo!",desc:"Eso es todo. Puedes repetir este recorrido cuando quieras con <b>Repetir tour</b> en la cabecera del panel.",nextLabel:"Finalizar â"}];function zp(){try{return localStorage.getItem(Mi)==="done"}catch{return!1}}function Ip(){const[t,a]=i.useState(!1),[r,s]=i.useState(0),[n,o]=i.useState({}),l=i.useRef(null);i.useEffect(()=>{if(zp())return;let j=null;const F=()=>{try{return!!localStorage.getItem("neuralpitch_consent_given")}catch{return!0}},C=()=>{j=setTimeout(()=>a(!0),700)};if(F())return C(),()=>clearTimeout(j);const N=()=>C();return window.addEventListener("neuralpitch:consent-decided",N),()=>{window.removeEventListener("neuralpitch:consent-decided",N),j&&clearTimeout(j)}},[]),i.useEffect(()=>{const j=()=>{s(0),a(!0)};return window.addEventListener(As,j),()=>window.removeEventListener(As,j)},[]);const c=Ra[r],d=()=>{l.current&&(l.current.removeAttribute("data-tour-active"),l.current=null)},u=i.useCallback(()=>{d();try{localStorage.setItem(Mi,"done")}catch{}a(!1)},[]);i.useEffect(()=>{if(!t||!c)return;d();const j=window.innerWidth<640;let F=null,C=null;return c.el?F=setTimeout(()=>{const N=document.querySelector(c.el);if(N){N.setAttribute("data-tour-active","true"),l.current=N;const b=N.getBoundingClientRect().height>window.innerHeight*.7;N.scrollIntoView({behavior:"auto",block:b?"start":"center"}),b&&window.scrollBy(0,-88),C=setTimeout(()=>{const w=document.querySelector(c.el);w&&o(ka(w,j))},90)}else o(ka(null,j))},250):o(ka(null,j)),()=>{clearTimeout(F),clearTimeout(C)}},[t,r]),i.useEffect(()=>{if(!t||!c||!c.optional||!c.el)return;const j=setTimeout(()=>{document.querySelector(c.el)||(r+1>=Ra.length?u():s(F=>F+1))},400);return()=>clearTimeout(j)},[t,r,u]),i.useEffect(()=>()=>d(),[]);const m=i.useCallback(()=>{s(j=>j+1>=Ra.length?(u(),j):j+1)},[u]),p=i.useCallback(()=>s(j=>Math.max(0,j-1)),[]);if(!t||!c)return null;const x=typeof window<"u"&&window.innerWidth<640,v=r===0,f=r===Ra.length-1,h=c.nextLabel||"Siguiente â",g=Ra.length,y=e.jsxs(e.Fragment,{children:[e.jsx("div",{"aria-hidden":"true",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:9e3},onClick:u}),e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":c.title,style:{...n,zIndex:9001,background:"#0e0e18",border:"1px solid rgba(0,229,160,0.25)",borderRadius:x?"20px 20px 0 0":14,boxShadow:"0 20px 60px rgba(0,0,0,0.8), 0 0 0 1px rgba(0,229,160,0.08)",padding:x?"20px 20px calc(20px + env(safe-area-inset-bottom, 0px))":"22px 24px",boxSizing:"border-box",fontFamily:"'Inter', sans-serif"},children:[e.jsx("div",{style:{height:3,background:"rgba(255,255,255,0.08)",borderRadius:2,marginBottom:16,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${(r+1)/g*100}%`,background:"linear-gradient(90deg, #00E5A0, #00B4D8)",borderRadius:2,transition:"width 0.3s ease"}})}),e.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:12,color:"rgba(255,255,255,0.45)",marginBottom:8,letterSpacing:"0.05em"},children:[r+1," / ",g]}),e.jsx("h3",{style:{fontSize:x?19:17,fontWeight:700,color:"#00E5A0",margin:"0 0 10px 0",lineHeight:1.3},children:c.title}),e.jsx("p",{style:{fontSize:x?15:14,color:"rgba(255,255,255,0.88)",lineHeight:1.7,margin:"0 0 20px 0"},children:e.jsx(Jo,{html:c.desc})}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[!v&&e.jsx("button",{onClick:p,style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,color:"rgba(255,255,255,0.6)",fontSize:13,fontWeight:600,padding:"8px 16px",cursor:"pointer",fontFamily:"'Inter', sans-serif"},children:"â Anterior"}),e.jsx("button",{onClick:m,style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",border:"none",borderRadius:8,color:"#0A0A0F",fontSize:13,fontWeight:700,padding:"8px 18px",cursor:"pointer",fontFamily:"'Inter', sans-serif",flexShrink:0},children:f?"Finalizar â":h}),e.jsx("button",{onClick:u,style:{background:"none",border:"none",color:"rgba(255,255,255,0.35)",fontSize:12,cursor:"pointer",fontFamily:"'Inter', sans-serif",marginLeft:"auto",padding:"7px 4px"},children:"Salir"})]})]})]});return Ya.createPortal(y,document.body)}function Dp(t){if(!t||!t.startsWith("#"))return"255,255,255";const a=t.replace("#",""),r=a.length===3?a.split("").map(l=>l+l).join(""):a,s=parseInt(r.substring(0,2),16),n=parseInt(r.substring(2,4),16),o=parseInt(r.substring(4,6),16);return`${s},${n},${o}`}function $p({data:t}){if(!t||t.length===0)return null;const a=t.length===1?[t[0],t[0]]:t,r=a.map(v=>v.sessions),s=280,n=64,o=0,l=6,c=Math.min(...r),u=Math.max(...r)-c||1,m=r.map((v,f)=>{const h=o+f/(r.length-1)*(s-o*2),g=a.length===1?n/2:l+(1-(v-c)/u)*(n-l*2);return[h,g]}),p=m.map(([v,f],h)=>`${h===0?"M":"L"} ${v},${f}`).join(" "),x=`${p} L ${m[m.length-1][0]},${n} L ${m[0][0]},${n} Z`;return e.jsxs("svg",{viewBox:`0 0 ${s} ${n}`,className:"w-full",style:{height:64},"aria-hidden":"true",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"spark-fill-team",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#00E5A0",stopOpacity:"0.25"}),e.jsx("stop",{offset:"100%",stopColor:"#00E5A0",stopOpacity:"0"})]})}),e.jsx("path",{d:x,fill:"url(#spark-fill-team)"}),e.jsx("path",{d:p,fill:"none",stroke:"#00E5A0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:m[m.length-1][0],cy:m[m.length-1][1],r:"3",fill:"#00E5A0"})]})}const Fo=[{key:"tecnicas",label:"Técnicas",color:"#00E5A0"},{key:"semantica",label:"Semántica",color:"#00B4D8"},{key:"timing",label:"Timing",color:"#FFB800"},{key:"tono",label:"Tono",color:"#FF6B6B"},{key:"fluidez",label:"Fluidez",color:"rgba(255,255,255,0.5)"}];function Ti(t,a){if(!t)return"";try{const r=new Date(t);return a==="daily"?r.toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit"}):r.toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit"})}catch{return t}}function Op({scoreTrend:t,period:a}){const r=t&&t.trend.length>0,s=r?t.trend:[],n=600,o=140,l=36,c=16,d=n-l*2,u=o-c*2,m=h=>
602s.length===1?l+d/2:l+h/(s.length-1)*d,p=h=>c+(1-h/100)*u,x=[25,50,75],v=(()=>{const h=s.length;return h<=5?s.map((g,y)=>y):[0,Math.floor(h/4),Math.floor(h/2),Math.floor(3*h/4),h-1]})(),f=h=>{var g;return Ti((g=s[h])==null?void 0:g.bucket,t==null?void 0:t.granularity)};return e.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.12em"},children:"Evolución de puntuaciones por pilar"}),e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.25)"},children:["Ãltimos ",a,"d"]})]}),r?e.jsxs(e.Fragment,{children:[e.jsxs("svg",{viewBox:`0 0 ${n} ${o}`,className:"w-full",style:{height:140},"aria-hidden":"true",children:[x.map(h=>e.jsxs("g",{children:[e.jsx("line",{x1:l,x2:n-l,y1:p(h),y2:p(h),stroke:"rgba(255,255,255,0.06)",strokeWidth:"1"}),e.jsx("text",{x:l-4,y:p(h)+4,textAnchor:"end",fontSize:"9",fill:"rgba(255,255,255,0.25)",children:h})]},h)),Fo.map(({key:h,color:g})=>{const y=[];let j="";return s.forEach((F,C)=>{const N=F[h];if(N==null){j&&(y.push(j),j="");return}const b=m(C),w=p(N);j+=`${j?"L":"M"} ${b},${w} `}),j&&y.push(j),y.map((F,C)=>e.jsx("path",{d:F,fill:"none",stroke:g,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.9"},`${h}-${C}`))}),v.map(h=>e.jsx("text",{x:m(h),y:o-2,textAnchor:"middle",fontSize:"9",fill:"rgba(255,255,255,0.25)",children:f(h)},h))]}),e.jsx("div",{className:"flex flex-wrap gap-3 mt-2",children:Fo.map(({key:h,label:g,color:y})=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{background:y}}),e.jsx("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.5)"},children:g})]},h))})]}):e.jsx("p",{className:"text-sm py-6 text-center",style:{color:"rgba(255,255,255,0.3)"},children:"No hay sesiones evaluadas en este perÃodo con datos compartidos."})]})}function qp({label:t,score:a,color:r}){return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs w-24 shrink-0",style:{color:"rgba(255,255,255,0.55)"},children:t}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-1.5 rounded-full",style:{width:`${Math.min(a??0,100)}%`,background:r,transition:"width 1s ease"}})}),e.jsx("span",{className:"text-xs font-mono font-bold w-7 text-right",style:{color:r},children:a??"â"})]})}function Up({name:t,sessions:a,maxSessions:r}){const s=r>0?a/r*100:0;return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs w-40 shrink-0 truncate",style:{color:"rgba(255,255,255,0.65)"},title:t,children:t}),e.jsx("div",{className:"flex-1 h-1.5 rounded-full",style:{background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-1.5 rounded-full",style:{width:`${s}%`,background:"rgba(0,180,216,0.7)"}})}),e.jsx("span",{className:"text-xs font-mono w-8 text-right",style:{color:"rgba(255,255,255,0.4)"},children:a})]})}function Wp({orgInfo:t,setOrgInfo:a}){const[r,s]=i.useState(!1),[n,o]=i.useState(0),[l,c]=i.useState(!1),[d,u]=i.useState("");if(!t)return null;const m=()=>{o((t.seat_count||5)+1),u(""),s(!0)},p=async()=>{c(!0),u("");try{const y=await R.post("/api/billing/portal",{});if(y!=null&&y.portal_url){window.location.href=y.portal_url;return}u("No se pudo abrir el portal de facturación.")}catch(y){u((y==null?void 0:y.message)||"No se pudo abrir el portal de facturación.")}c(!1)},x=async()=>{c(!0),u("");try{await R.post(`/api/billing/org/${t.org_id}/seats`,{seat_count:Number(n)});const y=await R.get("/api/team/org-info");y&&a&&a(y),s(!1)}catch(y){u((y==null?void 0:y.message)||"No se pudieron actualizar los asientos.")}finally{c(!1)}},v=t.subscription_plan==="team_monthly"?"Mensual por equipo":t.subscription_plan==="team_quarterly"?"Trimestral por equipo":t.subscription_plan||"â",f=(()=>{switch(t.subscription_status){case"active":return{label:"Activo",color:"#00E5A0",bg:"rgba(0,229,160,0.1)",border:"rgba(0,229,160,0.25)"};
602case"past_due":return{label:"Pago pendiente",color:"#FFB800",bg:"rgba(255,184,0,0.1)",border:"rgba(255,184,0,0.25)"};case"canceled":return{label:"Cancelado",color:"#FF4757",bg:"rgba(255,71,87,0.1)",border:"rgba(255,71,87,0.25)"};default:return{label:t.subscription_status||"â",color:"rgba(255,255,255,0.4)",bg:"rgba(255,255,255,0.05)",border:"rgba(255,255,255,0.1)"}}})(),h=t.seat_count>0?Math.round(t.seats_used/t.seat_count*100):0,g=(()=>{if(!t.subscription_expires_at)return"â";try{return new Date(t.subscription_expires_at).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return"â"}})();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-xl p-4",style:{background:"rgba(0,180,216,0.04)",border:"1px solid rgba(0,180,216,0.12)"},children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx("span",{className:"text-xs font-semibold px-2.5 py-1 rounded-lg",style:{background:"rgba(0,180,216,0.12)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8"},children:v}),e.jsx("span",{className:"text-xs font-semibold px-2.5 py-1 rounded-lg",style:{background:f.bg,border:`1px solid ${f.border}`,color:f.color},children:f.label}),e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:["Renovación:"," ",e.jsx("span",{style:{color:"rgba(255,255,255,0.65)"},children:g})]})]}),e.jsxs("div",{className:"flex flex-col items-end gap-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:p,disabled:l,className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-all",style:{background:"transparent",border:"1px solid rgba(0,180,216,0.35)",color:"#00B4D8",cursor:l?"wait":"pointer"},children:"Gestionar suscripción"}),e.jsx("button",{type:"button",onClick:m,disabled:l,className:"px-3 py-1.5 rounded-lg text-xs font-semibold transition-all",style:{background:"rgba(0,229,160,0.12)",border:"1px solid rgba(0,229,160,0.3)",color:"#00E5A0",cursor:l?"wait":"pointer"},children:"Añadir asientos"})]}),d&&!r&&e.jsx("span",{className:"text-xs",style:{color:"#FF4757"},children:d})]})]}),e.jsxs("div",{className:"mt-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs",style:{color:"rgba(255,255,255,0.45)"},children:[t.seats_used," / ",t.seat_count," asientos ·"," ",e.jsxs("span",{style:{color:"#00E5A0"},children:[t.seats_available," disponibles"]})]}),e.jsxs("span",{className:"text-xs font-mono",style:{color:"rgba(255,255,255,0.35)"},children:[h,"%"]})]}),e.jsx("div",{className:"h-1.5 rounded-full w-full",style:{background:"rgba(255,255,255,0.07)"},children:e.jsx("div",{className:"h-1.5 rounded-full transition-all",style:{width:`${Math.min(h,100)}%`,background:h>=90?"#FF4757":h>=70?"#FFB800":"#00E5A0"}})})]})]}),r&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.6)"},onClick:()=>!l&&s(!1),children:e.jsxs("div",{className:"rounded-xl p-5 w-full max-w-sm",style:{background:"#12121a",border:"1px solid rgba(255,255,255,0.1)"},onClick:y=>y.stopPropagation(),children:[e.jsx("h3",{className:"text-base font-bold mb-1",children:"Añadir asientos"}),e.jsxs("p",{className:"text-xs mb-4",style:{color:"rgba(255,255,255,0.55)"},children:["Asientos actuales: ",e.jsx("strong",{children:t.seat_count}),". Se cobrará la diferencia prorrateada en tu suscripción."]}),e.jsx("label",{className:"text-xs",style:{color:"rgba(255,255,255,0.6)"},children:"Nuevo total de asientos"}),e.jsx("input",{type:"number",min:t.seat_count,value:n,onChange:y=>o(y.target.value),className:"w-full mt-1 mb-3 px-3 py-2 rounded-lg text-sm",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",color:"white"}}),d&&e.jsx("p",{className:"text-xs mb-3",style:{color:"#FF4757"},children:d}),e.jsxs("div",{className:"flex gap-2 justify-end",children:[e.jsx("button",{type:"button",onClick:()=>s(!1),disabled:l,className:"px-3 py-1.5 rounded-lg text-xs font-semibold",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.7)",cursor:l?"wait":"pointer"},children:"Cancelar"}),e.jsx("button",{type:"button",onClick:x,disabled:l||Number(n)<=t.seat_count,className:"px-3 py-1.5 rounded-lg text-xs font-bold",style:{background:"#00E5A0",color:"#0A0A0F",border:"none",cursor:l?"wait":"pointer",opacity:l||Number(n)<=t.seat_count?.6:1},children:l?"Procesandoâ¦":"Confirmar"})]})]})})]})}function Hp({message:t,ok:a,onDismiss:r}){return i.useEffect(()=>{const s=setTimeout(r,4e3);return()=>clearTimeout(s)},[r]),e.jsx("div",{className:"fixed bottom-6 right-6 z-50 px-4 py-3 rounded-xl text-sm font-medium shadow-lg",style:{background:a?"rgba(0,229,160,0.15)":"rgba(255,71,87,0.15)",border:`1px solid ${a?"rgba(0,229,160,0.35)":"rgba(255,71,87,0.35)"}`,color:a?"#00E5A0":"#FF4757",maxWidth:340},children:t})}function Vp(){var At,me,Re,We,ve,Ce,_e,se,et,it,je,_t,ct,Ft,ft,tt;const[t,a]=i.useState([]),[r,s]=i.useState(null),[n,o]=i.useState(null),[l,c]=i.useState(null),[d,u]=i.useState(!0),[m,p]=i.useState(!1),[x,v]=i.useState(30),[f,h]=i.useState(null),[g,y]=i.useState(null),[j,F]=i.useState(null),[C,N]=i.useState(null),[b,w]=i.useState(!1),[L,z]=i.useState(""),[A,S]=i.useState("member"),[_,D]=i.useState(!1),[q,H]=i.useState(null),[oe,ie]=i.useState(null),[B,K]=i.useState(null),[V,P]=i.useState("existing"),[M,U]=i.useState(""),[X,T]=i.useState(""),[$,Y]=i.useState(!1),[ae,de]=i.useState(null),[re,ye]=i.useState(""),[fe,pe]=i.useState(!1),[Qe,Je]=i.useState(null),[st,ce]=i.useState(""),[Ae,Ye]=i.useState(!1),[nt,Te]=i.useState(null),[kt,ot]=i.useState({}),we=i.useCallback((k,W=!0)=>{N({message:k,ok:W})},[]);i.useEffect(()=>{R.get("/api/team/mine").then(k=>{a(k.teams||[]);const W=(k.teams||[]).find(te=>te.is_manager);W?s(W.team_id):(k.teams||[]).length>0&&s(k.teams[0].team_id)}).catch(()=>
602h("No se pudo cargar la información del equipo.")).finally(()=>u(!1))},[]),i.useEffect(()=>{var te;if(!r)return;p(!0),o(null),F(null);const k=(te=t.find(Be=>Be.team_id===r))==null?void 0:te.is_manager,W=[R.get(`/api/team/${r}/dashboard?period_days=${x}`),k?R.get(`/api/team/${r}/members`).catch(()=>null):Promise.resolve(null),k?R.get("/api/team/org-info").catch(()=>null):Promise.resolve(null),k?R.get(`/api/team/${r}/score-trend?period_days=${x}`).catch(()=>null):Promise.resolve(null)];Promise.all(W).then(([Be,qe,bt,xe])=>{o(Be),qe&&c(qe),bt&&y(bt),xe&&F(xe)}).catch(()=>h("Error al cargar los datos del equipo.")).finally(()=>p(!1))},[r,x]);const Pe=(At=t.find(k=>k.team_id===r))==null?void 0:At.is_manager,Ze=i.useCallback(()=>{!r||!Pe||R.get(`/api/team/${r}/members`).then(k=>c(k)).catch(()=>{})},[r,Pe]),lt=i.useCallback(()=>{Pe&&R.get("/api/team/org-info").then(k=>y(k)).catch(()=>{})},[Pe]),zt=i.useCallback((k=null)=>{R.get("/api/team/mine").then(W=>{const te=W.teams||[];if(a(te),k&&r===k){const Be=te.find(qe=>qe.team_id!==k);s(Be?Be.team_id:null),o(null),c(null),y(null),F(null)}}).catch(()=>{})},[r]),Ie=async k=>{if(k.preventDefault(),!!L.trim()){D(!0),H(null);try{await R.post(`/api/team/${r}/invite?email=${encodeURIComponent(L.trim())}&role=${A}`,{}),H({ok:!0,message:`Invitación enviada a ${L.trim()}.`}),z("")}catch(W){H({ok:!1,message:(W==null?void 0:W.detail)||"No se pudo enviar la invitación."})}finally{D(!1)}}},vt=async k=>{if(window.confirm("¿Eliminar este miembro del equipo?")){ie(k);try{await R.delete(`/api/team/${r}/members/${k}`),Ze()}catch(W){h((W==null?void 0:W.detail)||"No se pudo eliminar al miembro.")}finally{ie(null)}}},jt=async k=>{if(k.preventDefault(),!!B){Y(!0),de(null);try{if(V==="existing"){if(!M)return;await R.post(`/api/team/${r}/members/${B.user_id}/transfer-seat?to_user_id=${M}`,{}),de({ok:!0,message:"Asiento transferido correctamente."})}else{if(!X.trim())return;await R.post(`/api/team/${r}/invite?email=${encodeURIComponent(X.trim())}&role=member&revoke_seat_from_user_id=${B.user_id}`,{}),de({ok:!0,message:`Invitación enviada a ${X.trim()}. El asiento de ${B.display_name} ha sido liberado; se asignará al nuevo miembro cuando acepte la invitación.`})}Ze()}catch(W){de({ok:!1,message:(W==null?void 0:W.detail)||"No se pudo completar la transferencia."})}finally{Y(!1)}}},St=async k=>{if(window.confirm(`¿Designar a ${k.display_name} como nuevo manager del equipo? Perderás el rol de manager.`))try{await R.post(`/api/team/${r}/designate-manager?user_id=${k.user_id}`,{}),we(`${k.display_name} es ahora el manager del equipo.`,!0),Ze()}catch(W){we((W==null?void 0:W.detail)||"No se pudo designar al manager.",!1)}},Q=async k=>{if(window.confirm(`¿Enviar email de restablecimiento de contraseña a ${k.display_name}?`))try{await R.post(`/api/team/${r}/members/${k.user_id}/reset-password`,{}),we(`Email de restablecimiento enviado a ${k.display_name}.`,!0)}catch(W){we((W==null?void 0:W.detail)||"No se pudo enviar el email.",!1)}},ue=async(k,W)=>{if(W)try{await R.post(`/api/team/${r}/members/${k.user_id}/move-team?target_team_id=${W}`,{}),we(`${k.display_name} movido al nuevo equipo.`,!0),ot(te=>({...te,[k.user_id]:""})),Ze(),lt()}catch(te){we((te==null?void 0:te.detail)||"No se pudo mover al miembro.",!1)}},mt=async k=>{k.preventDefault();const W=re.trim();if(W){pe(!0);try{await R.post(`/api/team/org/teams?name=${encodeURIComponent(W)}`,{}),ye(""),we(`Equipo "${W}" creado.`,!0),lt()}catch(te){we((te==null?void 0:te.detail)||"No se pudo crear el equipo.",!1)}finally{pe(!1)}}},De=async k=>{const W=st.trim();if(W){Ye(!0);try{await R.put(`/api/team/${k}?name=${encodeURIComponent(W)}`,{}),we("Equipo renombrado.",!0),Je(null),ce(""),lt()}catch(te){we((te==null?void 0:te.detail)||"No se pudo renombrar el equipo.",!1)}finally{Ye(!1)}}},$e=async k=>{if(window.confirm(`¿Eliminar el equipo "${k.name}"? Esta acción no se puede deshacer.`)){Te(k.id);try{await R.delete(`/api/team/${k.id}`),we(`Equipo "${k.name}" eliminado.`,!0),zt(k.id),lt()}catch(W){we((W==null?void 0:W.detail)||"No se pudo eliminar el equipo.",!1)}finally{Te(null)}}};function ke(k){if(!k||k.length<2)return null;const W=Math.floor(k.length/2),te=k.slice(0,W),Be=k.slice(W),qe=te.reduce((xe,He)=>xe+He.sessions,0)/te.length,bt=Be.reduce((xe,He)=>xe+He.sessions,0)/Be.length;return qe===0?null:Math.round((bt-qe)/qe*100)}if(d)return e.jsx("div",{className:"flex items-center justify-center min-h-64",children:e.jsx("div",{className:"text-sm",style:{color:"rgba(255,255,255,0.4)"},children:"Cargando equipoâ¦"})});if(t.length===0)return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-16 text-center space-y-4",children:[e.jsx("div",{className:"w-14 h-14 roun
602ded-2xl mx-auto flex items-center justify-center",style:{background:"rgba(0,180,216,0.1)",border:"1px solid rgba(0,180,216,0.2)"},children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"#00B4D8",strokeWidth:1.5,className:"w-7 h-7",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 003.741-.479 3 3 0 00-4.682-2.72m.94 3.198l.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0112 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 016 18.719m12 0a5.971 5.971 0 00-.941-3.197m0 0A5.995 5.995 0 0012 12.75a5.995 5.995 0 00-5.058 2.772m0 0a3 3 0 00-4.681 2.72 8.986 8.986 0 003.74.477m.94-3.197a5.971 5.971 0 00-.94 3.197M15 6.75a3 3 0 11-6 0 3 3 0 016 0zm6 3a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0zm-13.5 0a2.25 2.25 0 11-4.5 0 2.25 2.25 0 014.5 0z"})})}),e.jsx("h2",{className:"text-lg font-bold",children:"No perteneces a ningún equipo"}),e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.5)"},children:["Tu manager debe invitarte al equipo de NeuralPitch de tu empresa. Comparte tus métricas desde"," ",e.jsx(Se,{to:"/profile",className:"underline",style:{color:"#00E5A0"},children:"Mi perfil"})," ","cuando seas añadido."]})]});const Ee=n?[{label:"Activos en perÃodo",value:n.active_users,color:"#00E5A0",icon:Ha,sub:`de ${(l==null?void 0:l.total_members)??"?"} miembros`},{label:"Sesiones",value:n.total_sessions,color:"#00B4D8",icon:w0,sub:((me=n.trend_vs_previous)==null?void 0:me.sessions)!=null?`+${n.trend_vs_previous.sessions} vs perÃodo anterior`:"en el perÃodo",delta:(Re=n.trend_vs_previous)==null?void 0:Re.sessions},{label:"Puntuación media",value:n.scores_available?(We=n.avg_scores)==null?void 0:We.overall:null,color:"#00E5A0",icon:oi,sub:n.scores_available&&((ve=n.trend_vs_previous)==null?void 0:ve.overall)!=null?`+${n.trend_vs_previous.overall} este perÃodo`:"puntos generales",delta:n.scores_available?(Ce=n.trend_vs_previous)==null?void 0:Ce.overall:null},{label:"Compartiendo",value:n.consenting_users,color:"#FFB800",icon:H0,sub:`de ${(l==null?void 0:l.total_members)??n.active_users} miembros`}]:[],xt=n!=null&&n.scores_available?[{label:"Técnicas",score:(_e=n.avg_scores)==null?void 0:_e.tecnicas,color:"#00E5A0"},{label:"Semántica",score:(se=n.avg_scores)==null?void 0:se.semantica,color:"#00B4D8"},{label:"Timing",score:(et=n.avg_scores)==null?void 0:et.timing,color:"#00E5A0"},{label:"Tono",score:(it=n.avg_scores)==null?void 0:it.tono,color:"#00B4D8"},{label:"Fluidez",score:(je=n.avg_scores)==null?void 0:je.fluidez,color:"#00E5A0"}]:[],Oe=(n==null?void 0:n.consenting_users)??0,Ke=(_t=n==null?void 0:n.percentile_distribution)==null?void 0:_t.p25;(ct=n==null?void 0:n.percentile_distribution)==null||ct.p50;const Le=(Ft=n==null?void 0:n.percentile_distribution)==null?void 0:Ft.p75,gt=n!=null&&n.scores_available&&Ke!=null&&Le!=null?[{label:"Top 25%",range:Le!=null?`>= ${Le}`:"â",color:"#00E5A0",bg:"rgba(0,229,160,0.1)",count:Math.round(Oe*.25)},{label:"Rango medio",range:Ke!=null&&Le!=null?`${Ke}â${Le}`:"â",color:"#00B4D8",bg:"rgba(0,180,216,0.1)",count:Math.round(Oe*.5)},{label:"En progreso",range:Ke!=null?`< ${Ke}`:"â",color:"rgba(255,255,255,0.35)",bg:"rgba(255,255,255,0.04)",count:Math.round(Oe*.25)}]:null,pt=ke(n==null?void 0:n.sessions_per_week),It=((g==null?void 0:g.teams)||[]).filter(k=>k.id!==r);return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 space-y-8",children:[e.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00B4D8",letterSpacing:"0.18em"},children:"B2B · Equipo"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Dashboard de Equipo"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Métricas agregadas. Los datos individuales nunca son visibles."})]}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[t.length>1&&e.jsx("select",{value:r||"",onChange:k=>s(k.target.value),className:"px-3 py-2 rounded-lg text-sm",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.8)",cursor:"pointer"},children:t.map(k=>e.jsx("option",{value:k.team_id,children:k.team_name},k.team_id))}),[7,30,90].map(k=>e.jsxs("button",{onClick:()=>v(k),className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-all",style:{background:x===k?"rgba(0,180,216,0.15)":"rgba(255,255,255,0.04)",border:x===k?"1px solid rgba(0,180,216,0.3)":"1px solid rgba(255,255,255,0.07)",color:x===k?"#00B4D8":"rgba(255,255,255,0.5)",cursor:"pointer"},children:[k,"d"]},k)),Pe&&e.jsx("button",{onClick:()=>window.dispatchEvent(new Event(As)),className:"px-3 py-1.5 rounded-lg text-xs font-medium transition-all",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)",color:"rgba(255,255,255,0.5)",cursor:"pointer"},title:"Volver a ver el recorrido del panel",children:"Repetir tour"})]})]}),f&&e.jsx("div",{className:"rounded-lg px-4 py-3 text-sm",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757"},children:f}),Pe&&g&&e.jsx("div",{id:"mtour-subscription",children:e.jsx(Wp,{orgInfo:g,setOrgInfo:y})}),m&&e.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"rgba(255,255,255,0.4)"},children:[e.jsxs("svg",{className:"w-4 h-4 animate-spin",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:.25}),e.jsx("path",{strokeLinecap:"round",d:"M12 2a10 10 0 0110 10"})]}),"Calculando métricasâ¦"]}),n&&!m&&e.jsxs("div",{id:"mtour-metrics",className:"flex flex-col gap-5",children:[!n.activity_available&&e.jsxs("div",{className:"rounded-xl p-6 text-center space-y-3",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.2)"},children:[e.jsx("div",{className:"w-12 h-12 rounded-xl mx-auto flex items-center justify-center",style:{background:"rgba(255,184,0,0.1)"},children:e.jsx(J,{icon:Ha,style:{color:"#FFB800",fontSize:20}})}),e.jsx("h3",{className:"font-semibold",style:{color:"#FFB800"},children:"Ningún miembro ha activado el uso compartido"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.6)"},children:'Los miembros pueden activar el uso compartido desde su perfil â "Mis datos vocales".'})]}),n.activity_available&&e.jsxs(e.Fragment,{children:[!n.scores_available&&e.jsxs("div",{className:"rounded-lg px-4 py-3 flex items-start gap-3",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.18)"},children:[e.jsx(J,{icon:P0,style:{color:"#FFB800",fontSize:14,marginTop:2,flexShrink:0}}),e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:[e.jsx("strong",{style:{color:"#FFB800"},children:"Puntuaciones pendientes."})," ","Se necesitan al menos"," ",e.jsx("strong",{style:{color:"#FFB800"},children:n.required})," ","miembros con datos compartidos para mostrar métricas de IA. Actualmente:"," ",e.jsx("strong",{style:{color:"#FFB800"},children:n.consenting_users}),". La actividad del equipo sà está disponible."]})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3",children:Ee.map((k,W)=>e.jsxs("div",{className:"flex flex-col gap-1 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.45)"},children:k.label}),e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center text-xs",style:{background:`rgba(${Dp(k.color)},0.12)`,color:k.color},children:e.jsx(J,{icon:k.icon})})]}),e.jsx("p",{className:"font-mono font-bold text-2xl",style:{color:k.color}
602,children:k.value!=null?k.value:"â"}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:k.sub})]},W))}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.12em"},children:"Puntuaciones por pilar"}),n.scores_available?e.jsx("div",{className:"flex flex-col gap-3",children:xt.map(k=>e.jsx(qp,{label:k.label,score:k.score,color:k.color},k.label))}):e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.35)"},children:["Se necesitan ",n.required," miembros compartiendo datos para ver puntuaciones."]})]}),e.jsxs("div",{className:"flex flex-col gap-4 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.12em"},children:"Técnicas más practicadas"}),((ft=n.top_techniques)==null?void 0:ft.length)>0?e.jsx("div",{className:"flex flex-col gap-3",children:n.top_techniques.map(k=>e.jsx(Up,{name:k.technique_name||k.technique_id,sessions:k.session_count,maxSessions:n.top_techniques[0].session_count},k.technique_id))}):e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.35)"},children:"Sin datos de técnicas en este perÃodo."})]})]}),Pe&&e.jsx(Op,{scoreTrend:j,period:x}),e.jsxs("div",{className:"grid md:grid-cols-5 gap-4",children:[e.jsxs("div",{className:"md:col-span-3 flex flex-col gap-3 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.12em"},children:"Actividad del equipo"}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.25)"},children:["Ãltimos ",x," dÃas"]})]}),pt!=null&&e.jsxs("span",{className:"text-xs font-mono",style:{color:pt>=0?"#00E5A0":"#FF4757"},children:[pt>=0?"+":"",pt,"% ",pt>=0?"â":"â"]})]}),((tt=n.sessions_per_week)==null?void 0:tt.length)>0?e.jsxs(e.Fragment,{children:[e.jsx($p,{data:n.sessions_per_week}),e.jsx("div",{className:"flex justify-between text-xs",style:{color:"rgba(255,255,255,0.25)"},children:n.sessions_per_week.map((k,W)=>{const te=n.sessions_per_week.length,Be=Ti(k.week,n.granularity);return te<=5?e.jsx("span",{children:Be},W):[0,Math.floor(te/3),Math.floor(2*te/3),te-1].includes(W)?e.jsx("span",{children:Be},W):null})})]}):e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.35)"},children:"Sin sesiones en este perÃodo."})]}),e.jsxs("div",{className:"md:col-span-2 flex flex-col gap-3 p-4 rounded-xl",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.12em"},children:"Distribución"}),gt?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-2 rounded-full overflow-hidden gap-px",children:[e.jsx("div",{style:{width:"25%",background:"#00E5A0",opacity:.7}}),e.jsx("div",{style:{width:"50%",background:"#00B4D8",opacity:.7}}),e.jsx("div",{style:{width:"25%",background:"rgba(255,255,255,0.3)",opacity:.5}})]}),e.jsx("div",{className:"flex flex-col gap-2.5",children:gt.map((k,W)=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:k.color}}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium",style:{color:k.color},children:k.label}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.3)"},children:k.range})]})]}),e.jsx("span",{className:"font-mono text-sm font-bold",style:{color:k.color},children:k.count})]},W))})]}):e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.35)"},children:"Disponible cuando haya puntuaciones agregadas."})]})]}),e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 rounded-xl",style:{background:"rgba(0,180,216,0.06)",border:"1px solid rgba(0,180,216,0.12)"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#00B4D8",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:"shrink-0",children:e.jsx("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})}),e.jsxs("p",{className:"text-xs",style:{color:"rgba(0,180,216,0.8)"},children:[n.consenting_users," de"," ",(l==null?void 0:l.total_members)??n.active_users," miembros comparten sus datos con el equipo · Resultados agregados, sin datos individuales identificables · EU AI Act compliant"]})]})]})]}),Pe&&l&&e.jsxs("div",{id:"mtour-members",className:"rounded-2xl overflow-hidden",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b",style:{borderColor:"rgba(255,255,255,0.05)"},children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.15em"},children:"Miembros del equipo"}),e.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded-full",style:{background:"rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.4)",border:"1px solid rgba(255,255,255,0.08)"},children:l.total_members})]}),e.jsxs("button",{onClick:()=>{w(!0),H(null)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.25)",color:"#00E5A0",cursor:"pointer"},children:[e.jsx(J,{icon:A0,className:"text-xs"}),"Añadir miembro"]})]}),l.members.length>0&&e.jsxs("div",{className:"hidden md:grid px-5 py-2 text-xs font-semibold uppercase tracking-wider",style:{gridTemplateColumns:"1fr 70px 90px 85px 168px",columnGap:"8px",color:"rgba(255,255,255,0.3)",letterSpacing:"0.08em",borderBottom:"1px solid rgba(255,255,255,0.04)"},children:[e.jsx("span",{children:"Miembro"}),e.jsx("span",{className:"text-center",children:"Unido"}),e.jsx("span",{className:"text-center",children:"Datos"}),e.jsx("span",{className:"text-center",children:"Asiento"}),e.jsx("span",{className:"text-right",children:"Acciones"})]}),e.jsxs("div",{children:[l.members.map((k,W)=>{const te=k.pending_demotion??!1,Be=e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold flex-shrink-0",style:{background:k.is_manager?"rgba(0,180,216,0.15)":"rgba(255,255,255,0.06)",color:k.is_manager?"#00B4D8":"rgba(255,255,255,0.4)",border:k.is_manager?"1px solid rgba(0,180,216,0.25)":"1px solid rgba(255,255,255,0.07)"},children:(k.display_name||"?")[0].toUpperCase()}),qe=e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx("p",{className:"text-xs font-semibold truncate",style:{color:"rgba(255,255,255,0.85)"},children:k.display_name}),k.is_manager&&e.jsx("span",{className:"px-1.5 py-0.5 rounded font-bold flex-shrink-0",style:{background:"rgba(0,180,216,0.12)",color:"#00B4D8",border:"1px solid rgba(0,180,216,0.2)",fontSize:9,letterSpacing:"0.06em"},children:"MANAGER"}),te&&e.jsx("span",{className:"px-1.5 py-0.5 rounded flex-shrink-0",style:{background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.3)",border:"1px solid rgba(255,255,255,0.08)",fontSize:9},children:"Salida pendiente"})]}),e.jsx("p",{className:"text-xs mt-0.5 truncate",style:{color:"rgba(255,255,255,0.3)"},children:k.email_masked})]}),bt=e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.35)"},children:new Date(k.joined_at).toLocaleDateString("es-ES",{day:"2-digit",month:"2-digit",year:"2-digit"})}),xe=e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full flex items-center gap-1",style:{background:k.sharing_enabled?"rgba(0,229,160,0.08)":"rgba(255,255,255,0.04)",border:`1px solid ${k.sharing_enabled?"rgba(0,229,160,0.15)":"rgba(255,255,255,0.07)"}`,color:k.sharing_enabled?"#00E5A0":"rgba(255,255,255,0.3)"},children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:k.sharing_enabled?"#00E5A0":"rgba(255,255,255,0.2)"}}),k.sharing_enabled?"Activo":"No"]}),He=e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:k.has_seat?"rgba(0,180,216,0.08)":"rgba(255,255,255,0.04)",border:`1px solid ${k.has_seat?"rgba(0,180,216,0.2)":"rgba(255,255,255,0.07)"}`,color:k.has_seat?"#00B4D8":"rgba(255,255,255,0.3)"},children:k.has_seat?"Premium":"Free"}),le=e.jsxs("div",{className:"flex items-center gap-1.5",children:[!k.is_manager&&It.length>0&&(kt[k.user_id]==="picking"?e.jsxs("select",{autoFocus:!0,defaultValue:"",onChange:Fe=>{const Ue=Fe.target.value;ot(Wt=>({...Wt,[k.user_id]:Ue})),Ue?ue(k,Ue):ot(Wt=>({...Wt,[k.user_id]:void 0}))},onBlur:()=>ot(Fe=>({...Fe,[k.user_id]:void 0})),className:"text-xs rounded-lg px-1 py-0.5",style:{background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.15)",color:"rgba(255,255,255,0.7)",cursor:"pointer",fontSize:11,width:90},children:[e.jsx("option",{value:"",children:"Mover aâ¦"}),It.map(Fe=>e.jsx("option",{value:Fe.id,children:Fe.name},Fe.id))]}):e.jsx("button",{onClick:()=>ot(Fe=>({...Fe,[k.user_id]:"picking"})),title:"Mover a otro equipo",className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.35)",cursor:"pointer"},children:e.jsx(J,{icon:ci,style:{fontSize:9}})}
602)),!k.is_manager&&!te&&e.jsx("button",{onClick:()=>St(k),title:"Designar como manager",className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all",style:{background:"rgba(124,58,237,0.1)",border:"1px solid rgba(124,58,237,0.25)",color:"#7C3AED",cursor:"pointer"},children:e.jsx(J,{icon:_a,style:{fontSize:10}})}),!k.is_manager&&e.jsx("button",{onClick:()=>Q(k),title:"Enviar email de restablecimiento",className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all",style:{background:"rgba(255,184,0,0.08)",border:"1px solid rgba(255,184,0,0.2)",color:"#FFB800",cursor:"pointer"},children:e.jsx(J,{icon:m0,style:{fontSize:10}})}),k.has_seat&&!k.is_manager&&e.jsx("button",{onClick:()=>{K(k),U(""),de(null)},title:"Transferir asiento",className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all",style:{background:"rgba(0,180,216,0.08)",border:"1px solid rgba(0,180,216,0.2)",color:"#00B4D8",cursor:"pointer"},children:e.jsx(J,{icon:I0,style:{fontSize:10}})}),!k.is_manager&&e.jsx("button",{onClick:()=>vt(k.user_id),disabled:oe===k.user_id,title:"Eliminar del equipo",className:"w-7 h-7 rounded-lg flex items-center justify-center transition-all",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.15)",color:"#FF4757",cursor:oe===k.user_id?"not-allowed":"pointer",opacity:oe===k.user_id?.5:1},children:e.jsx(J,{icon:G0,style:{fontSize:10}})})]}),ge=W<l.members.length-1?"1px solid rgba(255,255,255,0.03)":"none";return e.jsxs("div",{children:[e.jsxs("div",{className:"block md:hidden px-4 py-3",style:{borderBottom:ge},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[Be,qe]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[xe,He]})]}),e.jsxs("div",{className:"flex items-center justify-between mt-2 gap-2",children:[e.jsx("div",{className:"flex-shrink-0",children:bt}),Pe&&e.jsx("div",{className:"flex-shrink-0",children:le})]})]}),e.jsxs("div",{className:"hidden md:grid items-center px-5 py-3",style:{gridTemplateColumns:"1fr 70px 90px 85px 168px",columnGap:"8px",borderBottom:ge},children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[Be,qe]}),e.jsx("div",{className:"flex justify-center",children:bt}),e.jsx("div",{className:"flex justify-center",children:xe}),e.jsx("div",{className:"flex justify-center",children:He}),e.jsx("div",{className:"flex items-center justify-end",children:Pe?le:null})]})]},k.user_id)}),l.members.length===0&&e.jsx("p",{className:"text-sm text-center py-8",style:{color:"rgba(255,255,255,0.35)"},children:'Aún no hay miembros. Usa "Añadir miembro" para invitar a tu equipo.'})]}),e.jsx("div",{className:"px-5 py-3 border-t",style:{borderColor:"rgba(255,255,255,0.04)"},children:e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.22)"},children:"Los miembros sin datos compartidos no aparecen en las métricas. Asientos Premium cubiertos por la suscripción de la organización."})})]}),Pe&&g&&e.jsxs("div",{id:"mtour-management",className:"rounded-2xl overflow-hidden",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b",style:{borderColor:"rgba(255,255,255,0.05)"},children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.15em"},children:"Gestión de equipos"}),e.jsxs("form",{onSubmit:mt,className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:re,onChange:k=>ye(k.target.value),placeholder:"Nombre del equipo",maxLength:60,className:"text-xs px-3 py-1.5 rounded-lg",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.8)",outline:"none",width:160}}),e.jsx("button",{type:"submit",disabled:fe||!re.trim(),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-semibold transition-all",style:{background:fe||!re.trim()?"rgba(0,229,160,0.06)":"rgba(0,229,160,0.12)",border:"1px solid rgba(0,229,160,0.25)",color:fe||!re.trim()?"rgba(0,229,160,0.4)":"#00E5A0",cursor:fe||!re.trim()?"not-allowed":"pointer"},children:fe?"Creandoâ¦":"Nuevo equipo"})]})]}),e.jsx("div",{children:(g.teams||[]).length===0?e.jsx("p",{className:"text-sm text-center py-6",style:{color:"rgba(255,255,255,0.35)"},children:"No hay equipos en la organización."}):(g.teams||[]).map((k,W)=>e.jsxs("div",{className:"flex items-center gap-4 px-5 py-3",style:{borderBottom:W<(g.teams||[]).length-1?"1px solid rgba(255,255,255,0.03)":"none"},children:[e.jsx("div",{className:"flex-1 min-w-0",children:Qe===k.id?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"text",value:st,onChange:te=>ce(te.target.value),maxLength:60,autoFocus:!0,className:"text-xs px-2 py-1 rounded-lg",style:{background:"rgba(255,255,255,0.07)",border:"1px solid rgba(255,255,255,0.15)",color:"#fff",outline:"none",width:160},onKeyDown:te=>
602{te.key==="Enter"&&De(k.id),te.key==="Escape"&&(Je(null),ce(""))}}),e.jsx("button",{onClick:()=>De(k.id),disabled:Ae||!st.trim(),className:"text-xs px-2 py-1 rounded-lg",style:{background:"rgba(0,229,160,0.12)",border:"1px solid rgba(0,229,160,0.25)",color:"#00E5A0",cursor:"pointer"},children:Ae?"â¦":"Guardar"}),e.jsx("button",{onClick:()=>{Je(null),ce("")},className:"text-xs px-2 py-1 rounded-lg",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.4)",cursor:"pointer"},children:"Cancelar"})]}):e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.85)"},children:k.name}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.35)"},children:[k.member_count," miembro",k.member_count!==1?"s":""," ·"," ",k.manager_name?`Manager: ${k.manager_name}`:"Sin manager asignado"]})]})}),Qe!==k.id&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>{Je(k.id),ce(k.name)},title:"Renombrar equipo",className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all",style:{background:"rgba(255,184,0,0.08)",border:"1px solid rgba(255,184,0,0.2)",color:"#FFB800",cursor:"pointer"},children:[e.jsx(J,{icon:k0,style:{fontSize:10}}),"Renombrar"]}),e.jsxs("button",{onClick:()=>$e(k),disabled:nt===k.id,title:"Eliminar equipo",className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg text-xs font-medium transition-all",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.15)",color:"#FF4757",cursor:nt===k.id?"not-allowed":"pointer",opacity:nt===k.id?.5:1},children:[e.jsx(J,{icon:f0,style:{fontSize:10}}),nt===k.id?"Eliminandoâ¦":"Eliminar"]})]})]},k.id))})]}),b&&(()=>{const k=(g==null?void 0:g.seats_available)??null,W=k!==null&&k<=0;return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.7)"},onClick:te=>{te.target===te.currentTarget&&w(!1)},children:e.jsxs("div",{className:"w-full max-w-md rounded-2xl p-8 space-y-6",style:{background:"rgba(14,14,24,0.98)",border:"1px solid rgba(255,255,255,0.1)"},children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold",children:"Invitar al equipo"}),e.jsx("p",{className:"text-sm mt-1",style:{color:"rgba(255,255,255,0.5)"},children:W?"No quedan asientos disponibles en la organización.":"El invitado recibirá un email para crear su cuenta y unirse directamente."})]}),W?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-xl px-4 py-4 text-sm space-y-3",style:{background:"rgba(255,71,87,0.07)",border:"1px solid rgba(255,71,87,0.2)",color:"rgba(255,255,255,0.75)"},children:[e.jsxs("p",{children:["Todos los ",e.jsx("strong",{children:g.seat_count})," asientos están ocupados (",g.seats_used," en uso)."]}),e.jsx("p",{children:"Para añadir un nuevo miembro con acceso Premium, tienes dos opciones:"}),e.jsxs("ul",{className:"space-y-1.5 list-none",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{style:{color:"#00B4D8",flexShrink:0},children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Transferir un asiento"}),": libera el de un miembro existente y asÃgnalo al nuevo. Usa el botón"," ",e.jsx("span",{style:{color:"#00B4D8"},children:"â"})," en la tabla de miembros."]})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx("span",{style:{color:"#00E5A0",flexShrink:0},children:"â"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Comprar más asientos"}),": amplÃa el plan desde la facturación."]})]})]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{type:"button",onClick:()=>w(!1),style:{flex:1,padding:"11px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"rgba(255,255,255,0.6)",cursor:"pointer",fontSize:14},children:"Cerrar"}),e.jsx("a",{href:"/billing",style:{flex:2,padding:"11px",background:"linear-gradient(135deg,#00E5A0,#00B4D8)",borderRadius:10,color:"#0A0A0F",fontWeight:700,fontSize:14,textAlign:"center",textDecoration:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:"Ir a facturación"})]})]}):e.jsxs("form",{onSubmit:Ie,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.08em"},children:"Email"}),e.jsx("input",{type:"email",value:L,onChange:te=>z(te.target.value),placeholder:"[email protected]",required:!0,autoFocus:!0,style:{width:"100%",padding:"11px 14px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"#fff",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.08em"},children:"Rol"}),e.jsxs("select",{value:A,onChange:te=>S(te.target.value),style:{width:"100%",padding:"11px 14px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"#fff",fontSize:14,outline:"none",cursor:"pointer",boxSizing:"border-box"},children:[e.jsx("option",{value:"member",children:"Miembro"}),e.jsx("option",{value:"manager",children:"Manager"})]})]}),k!==null?e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg px-3 py-2.5 text-xs",style:{background:"rgba(0,229,160,0.06)",border:"1px solid rgba(0,229,160,0.2)",color:"rgba(0,229,160,0.9)"},children:[e.jsx("span",{className:"shrink-0 mt-px",children:"â"}),e.jsxs("span",{children:["Hay ",e.jsx("strong",{children:k})," asiento",k!==1?"s":""," disponible",k!==1?"s":"",". El nuevo miembro recibirá acceso Premium ",e.jsx("strong",{children:"sin cargo adicional"}),"."]})]}):e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg px-3 py-2.5 text-xs",style:{background:"rgba(255,184,0,0.06)",border:"1px solid rgba(255,184,0,0.2)",color:"rgba(255,184,0,0.85)"},children:[e.jsx("span",{className:"shrink-0 mt-px",children:"â "}),e.jsxs("span",{children:["Añadir un miembro con asiento supondrá un"," ",e.jsx("strong",{children:"cargo prorrateado"})," hasta la próxima renovación de la suscripción."]})]}),q&&e.jsx("p",{className:"text-sm",style:{color:q.ok?"#00E5A0":"#FF4757"},children:q.message}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsx("button",{type:"button",onClick:()=>w(!1),style:{flex:1,padding:"11px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"rgba(255,255,255,0.6)",cursor:"pointer",fontSize:14},children:"Cerrar"}),e.jsx("button",{type:"submit",disabled:_,style:{flex:2,padding:"11px",background:_?"rgba(0,229,160,0.4)":"linear-gradient(135deg,#00E5A0,#00B4D8)",border:"none",borderRadius:10,color:"#0A0A0F",fontWeight:700,cursor:_?"not-allowed":"pointer",fontSize:14},children:_?"Enviandoâ¦":"Enviar invitación"})]})]})]})})})(),B&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",style:{background:"rgba(0,0,0,0.75)"},onClick:k=>{k.target===k.currentTarget&&(K(null),de(null))},children:e.jsxs("div",{className:"w-full max-w-md rounded-2xl p-8 space-y-5",style:{background:"rgba(14,14,24,0.98)",border:"1px solid rgba(255,255,255,0.1)"},children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold",children:"Transferir asiento"}),e.jsxs("p",{className:"text-sm mt-1",style:{color:"rgba(255,255,255,0.5)"},children:["El asiento Premium de"," ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.85)"},children:B.display_name})," ","se liberará. El receptor obtendrá el plan Premium sin cambio de coste de suscripción."]})]}),e.jsx("div",{className:"flex rounded-xl overflow-hidden",style:{border:"1px solid rgba(255,255,255,0.08)"},children:[{key:"existing",label:"Miembro del equipo"},{key:"new",label:"Nuevo miembro"}].map(k=>e.jsx("button",{type:"button",onClick:()=>{P(k.key),de(null),U(""),T("")},className:"flex-1 py-2.5 text-xs font-semibold transition-all",style:{background:V===k.key?"rgba(0,180,216,0.15)":"rgba(255,255,255,0.03)",color:V===k.key?"#00B4D8":"rgba(255,255,255,0.4)",border:"none",cursor:"pointer"},children:k.label},k.key))}),e.jsxs("form",{onSubmit:jt,className:"space-y-4",children:[V==="existing"?e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.08em"},children:"Transferir a"}),e.jsxs("select",{value:M,onChange:k=>U(k.target.value),required:!0,style:{width:"100%",padding:"11px 14px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:M?"#fff":"rgba(255,255,255,0.35)",fontSize:14,outline:"none",cursor:"pointer",boxSizing:"border-box"},children:[e.jsx("option",{value:"",children:"Seleccionar miembro sin asientoâ¦"}
602),((l==null?void 0:l.members)||[]).filter(k=>!k.has_seat&&k.user_id!==B.user_id).map(k=>e.jsxs("option",{value:k.user_id,children:[k.display_name," (",k.email_masked,")"]},k.user_id))]}),((l==null?void 0:l.members)||[]).filter(k=>!k.has_seat&&k.user_id!==B.user_id).length===0&&e.jsx("p",{className:"text-xs mt-2",style:{color:"rgba(255,255,255,0.35)"},children:'Todos los miembros actuales ya tienen asiento. Usa "Nuevo miembro" para invitar a alguien.'})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs uppercase tracking-wider mb-2",style:{color:"rgba(255,255,255,0.45)",letterSpacing:"0.08em"},children:"Email del nuevo miembro"}),e.jsx("input",{type:"email",value:X,onChange:k=>T(k.target.value),placeholder:"[email protected]",required:!0,autoFocus:!0,style:{width:"100%",padding:"11px 14px",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"#fff",fontSize:14,outline:"none",boxSizing:"border-box"}})]}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg px-3 py-2.5 text-xs",style:{background:"rgba(0,180,216,0.06)",border:"1px solid rgba(0,180,216,0.15)",color:"rgba(0,180,216,0.8)"},children:[e.jsx("span",{className:"shrink-0 mt-px",children:"â¹"}),e.jsxs("span",{children:["El asiento de"," ",e.jsx("strong",{children:B.display_name})," se liberará de inmediato. El nuevo miembro lo recibirá al aceptar la invitación."]})]})]}),ae&&e.jsx("p",{className:"text-sm",style:{color:ae.ok?"#00E5A0":"#FF4757"},children:ae.message}),e.jsxs("div",{className:"flex gap-3 pt-1",children:[e.jsx("button",{type:"button",onClick:()=>{K(null),de(null)},style:{flex:1,padding:"11px",background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,color:"rgba(255,255,255,0.6)",cursor:"pointer",fontSize:14},children:"Cancelar"}),e.jsx("button",{type:"submit",disabled:$||(V==="existing"?!M:!X.trim()),style:{flex:2,padding:"11px",background:$||(V==="existing"?!M:!X.trim())?"rgba(0,180,216,0.3)":"linear-gradient(135deg,#00B4D8,#0077B6)",border:"none",borderRadius:10,color:"#fff",fontWeight:700,cursor:$||(V==="existing"?!M:!X.trim())?"not-allowed":"pointer",fontSize:14},children:$?"Procesandoâ¦":V==="existing"?"Confirmar transferencia":"Invitar y liberar asiento"})]})]})]})}),e.jsx("p",{className:"text-xs text-center",style:{color:"rgba(255,255,255,0.2)"},children:"Las métricas son agregadas y anónimas (EU AI Act ArtÃculo 13). MÃnimo de 5 usuarios consentidos requerido."}),C&&e.jsx(Hp,{message:C.message,ok:C.ok,onDismiss:()=>N(null)}),Pe&&g&&n&&l&&e.jsx(Ip,{})]})}function Mo(t){const a=t||0;return a>=75?"#00E5A0":a>=55?"#FFB800":"#FF4757"}function Pi({evaluation:t,turns:a=[],sessionId:r,onReplay:s,replayIdx:n}){const[o,l]=i.useState(null);return i.useEffect(()=>{if(!r)return;let c=null,d=!1;return Wo(r).then(u=>{d||!(u!=null&&u.audioBlob)||(c=URL.createObjectURL(u.audioBlob),l(c))}).catch(()=>{}),()=>{d=!0,c&&URL.revokeObjectURL(c)}},[r]),e.jsxs(e.Fragment,{children:[o&&e.jsxs("div",{className:"p-4 rounded-xl mb-6",style:{background:"rgba(0,180,216,0.05)",border:"1px solid rgba(0,180,216,0.18)"},children:[e.jsx("p",{className:"text-xs font-semibold mb-2",style:{color:"rgba(255,255,255,0.45)"},children:"GRABACIÃN DE LA CONVERSACIÃN"}),e.jsx("audio",{controls:!0,src:o,preload:"metadata",className:"w-full",style:{height:40}}),e.jsx("p",{className:"text-xs mt-2",style:{color:"rgba(255,255,255,0.3)"},children:"Guardada en este navegador (se borra a las 72 h o al cerrar sesión)."})]}),t?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"p-6 rounded-2xl mb-6 text-center",style:{background:"rgba(0,229,160,0.06)",border:"1px solid rgba(0,229,160,0.15)"},children:[e.jsx("p",{className:"text-5xl font-bold mb-1",style:{color:"#00E5A0"},children:t.overall??"--"}),e.jsx("p",{style:{color:"rgba(255,255,255,0.55)",fontSize:13},children:"Puntuación global"})]}),t.coaching_note&&e.jsxs("div",{className:"p-4 rounded-xl mb-6",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold mb-2",style:{color:"rgba(255,255,255,0.4)"},children:"COACHING"}),e.jsx("p",{style:{color:"rgba(255,255,255,0.75)",fontSize:14,lineHeight:1.6},children:t.coaching_note})]}),t.pillars&&e.jsx("div",{className:"grid grid-cols-2 gap-3 mb-6",children:Object.entries(t.pillars).map(([c,d])=>e.jsxs("div",{className:"p-4 rounded-xl",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"rgba(255,255,255,0.4)",letterSpacing:"0.08em"},children:c.replace(/_/g," ")}),e.jsx("p",{className:"text-lg font-bold",style:{color:Mo(d.score)},children:d.score??"--"})]}),e.jsx("div",{className:"w-full rounded-full",style:{height:4,background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${d.score||0}%`,background:Mo(d.score),transition:"width 0.6s ease"}})}),d.feedback&&e.jsx("p",{className:"mt-2 text-xs",style:{color:"rgba(255,255,255,0.45)",lineHeight:1.5},children:d.feedback})]},c))})]}):e.jsx("div",{className:"p-6 rounded-xl mb-6 text-center",style:{background:"rgba(255,255,255,0.03)"},children:e.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:14},children:"No se pudo generar evaluación"})}),a.length>0&&e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-sm font-semibold mb-3",style:{color:"rgba(255,255,255,0.4)"},children:"CONVERSACIÃN"}),e.jsx("div",{className:"flex flex-col gap-3",children:a.map((c,d)=>{var u;return e.jsx("div",{className:`flex ${c.role==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:"px-4 py-3 rounded-2xl text-sm max-w-xs",style:{background:c.role==="user"?"rgba(0,229,160,0.12)":"rgba(255,255,255,0.04)",border:c.role==="user"?"1px solid rgba(0,229,160,0.2)":"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.8)",lineHeight:1.5},children:[c.text,s&&c.role==="prospect"&&((u=c.audio)==null?void 0:u.length)>0&&e.jsx("button",{onClick:()=>s(d,c.audio),className:"mt-1.5 flex items-center gap-1 text-xs",style:{background:"none",border:"none",color:n===d?"#00E5A0":"rgba(255,255,255,0.4)",cursor:"pointer",padding:0},children:n===d?"â Parar":"â¶ Reescuchar"})]})},d)})})]})]})}function Li(t){let a=0;for(const n of t)a+=n.length;const r=new Float32Array(a);let s=0;for(const n of t)r.set(n,s),s+=n.length;return r}function To(t,a,r){if(!t.length||a===r)return t;const s=a/r,n=Math.max(1,Math.round(t.length/s)),o=new Float32Array(n);for(let l=0;l<n;l++){const c=l*s,d=Math.floor(c),u=Math.min(d+1,t.length-1),m=c-d;o[l]=t[d]*(1-m)+t[u]*m}return o}function Gp(t,a){const r=t.length,s=new ArrayBuffer(44+r*2),n=new DataView(s),o=(c,d)=>{for(let u=0;u<d.length;
602u++)n.setUint8(c+u,d.charCodeAt(u))};o(0,"RIFF"),n.setUint32(4,36+r*2,!0),o(8,"WAVE"),o(12,"fmt "),n.setUint32(16,16,!0),n.setUint16(20,1,!0),n.setUint16(22,1,!0),n.setUint32(24,a,!0),n.setUint32(28,a*2,!0),n.setUint16(32,2,!0),n.setUint16(34,16,!0),o(36,"data"),n.setUint32(40,r*2,!0);let l=44;for(let c=0;c<r;c++){let d=t[c];d=d<-1?-1:d>1?1:d,n.setInt16(l,d<0?d*32768:d*32767,!0),l+=2}return s}function Ri(t,a){return new Blob([Gp(t,a)],{type:"audio/wav"})}function Jp(t,a,r){const s=new Float32Array(r),n=(a-r+t.length)%t.length;for(let o=0;o<r;o++)s[o]=t[(n+o)%t.length];return s}async function Yp(t,a){const r=atob(a),s=new Uint8Array(r.length);for(let d=0;d<r.length;d++)s[d]=r.charCodeAt(d);const n=await t.decodeAudioData(s.buffer);if(n.numberOfChannels===1)return n.getChannelData(0).slice();const o=n.getChannelData(0),l=n.getChannelData(1),c=new Float32Array(o.length);for(let d=0;d<o.length;d++)c[d]=(o[d]+l[d])*.5;return c}async function Kp(t,a=16e3){if(!t||!t.length)return null;const r=window.AudioContext||window.webkitAudioContext,s=new r;try{const n=[];for(const o of t)if(o.role==="user"&&o.pcm&&o.pcm.length)n.push(To(o.pcm,o.rate||a,a));else if(o.role==="prospect"&&o.mp3b64s&&o.mp3b64s.length)for(const l of o.mp3b64s)try{const c=await Yp(s,l);n.push(To(c,s.sampleRate,a))}catch{}return n.length?Ri(Li(n),a):null}finally{s.close().catch(()=>{})}}const ra=[{id:"skeptic",label:"Escéptico",description:"Cuestiona todo. Exige pruebas. Ha visto muchos vendedores.",color:"#FF4757",bg:"rgba(255,71,87,0.08)",border:"rgba(255,71,87,0.2)"},{id:"budget_constrained",label:"Presupuesto limitado",description:"Le interesa pero siempre vuelve al precio y el ROI.",color:"#FFB800",bg:"rgba(255,184,0,0.08)",border:"rgba(255,184,0,0.2)"},{id:"decisionmaker",label:"Director / CEO",description:"Muy ocupado. Directo. Quiere impacto estratégico.",color:"#00B4D8",bg:"rgba(0,180,216,0.08)",border:"rgba(0,180,216,0.2)"},{id:"friendly",label:"Receptivo",description:"Amable, curioso, reflexivo. No es un cierre fácil.",color:"#00E5A0",bg:"rgba(0,229,160,0.08)",border:"rgba(0,229,160,0.2)"},{id:"indecisive",label:"Indeciso",description:"Le cuesta decidir. Da largas. «Me lo tengo que pensar.»",color:"#A78BFA",bg:"rgba(167,139,250,0.08)",border:"rgba(167,139,250,0.2)"},{id:"loyal_incumbent",label:"Ya tiene proveedor",description:"Cómodo con su proveedor actual. ¿Por qué cambiar?",color:"#2DD4BF",bg:"rgba(45,212,191,0.08)",border:"rgba(45,212,191,0.2)"},{id:"analytical",label:"AnalÃtico",description:"Decide con datos. Pide cifras, comparativas y pruebas.",color:"#818CF8",bg:"rgba(129,140,248,0.08)",border:"rgba(129,140,248,0.2)"},{id:"haggler",label:"Negociador",description:"Regatea por sistema. Presiona el precio y las condiciones.",color:"#FB923C",bg:"rgba(251,146,60,0.08)",border:"rgba(251,146,60,0.2)"},{id:"busy_distracted",label:"Ocupado y distraÃdo",description:"Mil cosas a la vez. «Mándamelo por email y ya miro.»",color:"#F472B6",bg:"rgba(244,114,182,0.08)",border:"rgba(244,114,182,0.2)"},{id:"guarded",label:"Reservado",description:"Cortante y difÃcil de leer. Hay que ganarse su confianza.",color:"#94A3B8",bg:"rgba(148,163,184,0.08)",border:"rgba(148,163,184,0.2)"}],Xp=18e4,Qp=400,Zp=.3,ef=16e3,Et=40,Po="neuralpitch_sparring_mode",tf=3.2,af=1.5,rf=.18,sf=.997,Lo=.014,nf=130,of=2500;function Ba(t){const a=(t&&t.message?t.message:String(t||"")).trim();return/HTTP 405|Method Not Allowed/i.test(a)?"No se pudo contactar con el servidor de sparring. Recarga la página e inténtalo de nuevo.":/HTTP 401|credentials|Not authenticated|No autenticado|Sesión expirada/i.test(a)?"Tu sesión ha caducado. Vuelve a iniciar sesión.":/HTTP 409|finaliz|LÃmite de \d+ turnos/i.test(a)?"Esta sesión ya ha terminado. Empieza una nueva.":/HTTP 413|grande/i.test(a)?"El audio es demasiado largo. Habla en turnos más cortos.":/HTTP 429|lÃmite de .* sesiones/i.test(a)?a:/HTTP 503|no está disponible|prospecto simulado|asistente/i.test(a)?"El servicio de IA no está disponible ahora mismo. Inténtalo en unos segundos.":/Failed to fetch|NetworkError|network/i.test(a)?"Sin conexión con el servidor. Comprueba tu red.":a||"Ha ocurrido un error inesperado."}function as(t){return t.split(/(\*\*[^*]+\*\*)/g).map((r,s)=>r.startsWith("**")&&r.endsWith("**")?e.jsx("strong",{style:{color:"rgba(255,255,255,0.92)",fontWeight:700},children:r.slice(2,-2)},s):r)}function lf({text:t}){if(!t)return null;const a=t.split(` 603`).filter(r=>r.trim());return e.jsx("div",{style:{fontSize:13,lineHeight:1.65,color:"rgba(255,255,255,0.72)"},children:a.map((r,s)=>{const n=r.match(/^\*\*([^*:]+):\*\*\s*(.*)/);return n?e.jsxs("p",{style:{marginBottom:6},children:[e.jsx("span",{style:{color:"#00E5A0",fontWeight:700,fontFamily:"'JetBrains Mono', monospace",fontSize:11,letterSpacing:"0.06em"},children:n[1].toUpperCase()}),n[2]?e.jsxs("span",{style:{color:"rgba(255,255,255,0.75)"},children:[" ",as(n[2])]}):null]},s):/^\d+\./.test(r)?e.jsx("p",{style:{marginBottom:3,paddingLeft:12,color:"rgba(255,255,255,0.65)"},children:as(r)},s):e.jsx("p",{style:{marginBottom:5},children:as(r)},s)})})}function Ro(t,a="audio/mpeg"){const r=atob(t),s=new Uint8Array(r.length);for(let n=0;n<r.length;n++)s[n]=r.charCodeAt(n);return new Blob([s],{type:a})}function Bo(t,a){return new Promise(r=>{const s=URL.createObjectURL(t),n=new Audio(s);let o=!1;const l=()=>{o||(o=!0,URL.revokeObjectURL(s),r())};n.onended=l,n.onerror=l,n.onpause=()=>{n.ended||l()},a==null||a(n),n.play().catch(()=>l())})}function rs({mode:t,onChange:a}){const r=[{id:"auto",label:"Manos libres"},{id:"ptt",label:"Pulsar para hablar"}];return e.jsx("div",{className:"inline-flex rounded-lg p-0.5",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)"},children:r.map(s=>e.jsx("button",{onClick:()=>
603a(s.id),className:"rounded-md font-semibold transition-all px-3 py-1.5 text-xs",style:{background:t===s.id?"rgba(0,229,160,0.15)":"transparent",color:t===s.id?"#00E5A0":"rgba(255,255,255,0.5)",border:"none",cursor:"pointer"},children:s.label},s.id))})}function cf(){const{user:t}=Ge();return t!=null&&t.is_premium?e.jsx(df,{}):e.jsx(rn,{feature:"Sparring con IA",description:"Conversa en tiempo real con una IA que actúa como tu cliente. Practica objeciones, cierres y técnicas de persuasión sin el coste de equivocarte en una reunión real.",bullets:["10 perfiles de cliente realistas: escéptico, indeciso, negociador, analÃtico, ocupado y más","Modo manos libres (detección de voz automática) o pulsar-para-hablar: tú eliges","Respuesta de audio del cliente simulado en menos de 1 segundo","Evaluación final de la conversación con puntuación por pilares"]})}function df(){var dn;const{user:t}=Ge(),a=he(),{techniques:r}=Ut();Ks();const[s,n]=i.useState("skeptic"),[o,l]=i.useState(""),[c,d]=i.useState(!1),[u,m]=i.useState(null),[p,x]=i.useState("setup"),[v,f]=i.useState([]),[h,g]=i.useState(!1),[y,j]=i.useState(null),[F,C]=i.useState(null),[N,b]=i.useState(!1),[w,L]=i.useState(""),z=i.useRef(null),[A,S]=i.useState("idle"),[_,D]=i.useState(null),[q,H]=i.useState([]),[oe,ie]=i.useState(""),[B,K]=i.useState(null),[V,P]=i.useState(""),[M,U]=i.useState(!1),[X,T]=i.useState(!1),[$,Y]=i.useState(null),[ae,de]=i.useState(()=>{try{return localStorage.getItem(Po)==="ptt"?"ptt":"auto"}catch{return"auto"}}),[re,ye]=i.useState(null),[fe,pe]=i.useState(null),[Qe,Je]=i.useState(!1),st=i.useRef(null),ce=i.useRef("setup"),Ae=i.useRef(!1),Ye=i.useRef(!1),nt=i.useRef([]),Te=i.useRef(null),kt=i.useRef("skeptic"),ot=i.useRef(""),we=i.useRef(null),Pe=i.useRef(null),Ze=i.useRef(null),lt=i.useRef(null),zt=i.useRef(null),Ie=i.useRef(!1),vt=i.useRef(null),jt=i.useRef(null),St=i.useRef(0),Q=i.useRef(0),ue=i.useRef([]),mt=i.useRef(48e3),De=i.useRef([]),$e=i.useRef([]),ke=i.useRef(!1),Ee=i.useRef(null),xt=i.useRef(ae),Oe=i.useRef(0),Ke=i.useRef(0),Le=i.useRef(0),gt=i.useRef(.01),pt=i.useRef(null),It=i.useRef(null),At=i.useRef(!1),me=i.useRef(!1),Re=i.useRef(!1),We=i.useRef(!1),ve=i.useRef(!1),Ce=i.useRef("idle"),_e=i.useRef(!1);i.useEffect(()=>{st.current=_},[_]),i.useEffect(()=>{xt.current=ae;try{localStorage.setItem(Po,ae)}catch{}},[ae]),i.useEffect(()=>{ce.current=p},[p]),i.useEffect(()=>{Ye.current=h},[h]),i.useEffect(()=>{nt.current=v},[v]),i.useEffect(()=>{Te.current=y},[y]),i.useEffect(()=>{kt.current=s},[s]),i.useEffect(()=>{ot.current=o},[o]),i.useEffect(()=>{Ce.current=A},[A]),i.useEffect(()=>{_e.current=q.filter(E=>E.role==="user").length>=Et},[q]),i.useEffect(()=>{var E;(E=Ee.current)==null||E.scrollIntoView({behavior:"smooth"})},[q]),i.useEffect(()=>{var E;(E=z.current)==null||E.scrollIntoView({behavior:"smooth"})},[v]);const se=i.useCallback(()=>{if(me.current||ke.current||ve.current)return;Ae.current=!1,gt.current=.01,Oe.current=0,Ke.current=0,Le.current=0;const E=ce.current;(E==="sparring"||E==="briefing"&&!Ye.current)&&S("listening")},[]),et=i.useCallback(E=>{E&&H(I=>{const G=[...I],Z=G[G.length-1];return(Z==null?void 0:Z.role)==="prospect"&&(G[G.length-1]={...Z,text:Z.text?Z.text+" "+E:E}),G})},[]),it=i.useCallback(()=>{H(E=>{const I=[...E],G=I[I.length-1];return(G==null?void 0:G.role)==="prospect"&&G.streaming&&(I[I.length-1]={...G,streaming:!1}),I})},[]),je=i.useCallback(async()=>{if(!ke.current){ke.current=!0,Ae.current=!0;try{for(;$e.current.length>0&&!At.current;){const E=$e.current.shift();if(et(E.text),E.b64){try{await Bo(Ro(E.b64),I=>{pt.current=I})}catch{}pt.current=null}}}finally{ke.current=!1,pt.current=null,$e.current=[],Re.current&&(Re.current=!1,it()),se()}}},[se,et,it]),_t=i.useCallback(()=>{At.current=!0;const E=$e.current;$e.current=[];for(const G of E)et(G.text);const I=pt.current;if(I)try{I.pause()}catch{}Re.current=!1,it()},[et,it]),ct=i.useCallback(E=>{if(At.current){et(E.text);return}$e.current.push(E),ke.current||je()},[je,et]),Ft=i.useCallback((E,I)=>{if(ve.current){ve.current=!1;const G=It.current;if(G)try{G.pause()}catch{}return}!(I!=null&&I.length)||ke.current||me.current||(async()=>{ve.current=!0,Ae.current=!0,pe(E);try{for(const G of I){if(!ve.current)break;try{await Bo(Ro(G),Z=>{It.current=Z})}catch{}It.current=null}}finally{ve.current=!1,It.current=null,pe(null),se()}})()},[se]),ft=i.useCallback(async E=>{const I=E.body.getReader(),G=new TextDecoder;let Z="",ze=!1;try{for(;;){const{done:Dt,value:ma}=await I.read();if(Dt)break;Z+=G.decode(ma,{stream:!0});const dt=Z.split(` 604`);Z=dt.pop()??"";for(const ut of dt){if(!ut.startsWith("data: "))continue;let Ve;try{Ve=JSON.parse(ut.slice(6))}catch{continue}if(Ve.event==="user_transcript")H(ht=>[...ht,{role:"user",text:Ve.text}]);else if(Ve.event==="prospect_chunk"){S("ai_speaking");const ht=Ve.audio_b64,Ii=!ze;if(ze?ht&&H(aa=>{const Ht=[...aa],Fa=Ht[Ht.length-1];return(Fa==null?void 0:Fa.role)==="prospect"&&(Ht[Ht.length-1]={...Fa,audio:[...Fa.audio||[],ht]}),Ht}):(ze=!0,H(aa=>[...aa,{role:"prospect",text:"",streaming:!0,audio:ht?[ht]:[]}])),ct({b64:ht,text:Ve.text}),ht&&ce.current==="sparring"){const aa=De.current,Ht=aa[aa.length-1];Ii||!Ht||Ht.role!=="prospect"?aa.push({role:"prospect",mp3b64s:[ht]}):Ht.mp3b64s.push(ht)}}else Ve.event==="done"?(Re.current=!0,!ke.current&&$e.current.length===0&&(Re.current=!1,it())):Ve.event==="error"&&K(Ve.detail||"Error generando respuesta")}}}finally{I.releaseLock()}},[ct,it]),tt=i.useCallback(async E=>{const I=st.current;if(I){At.current=!1,Re.current=!1,me.current=!0,Ae.current=!0,S("processing"),K(null);try{const G=await cr(`/api/sparring/${I}/turn`,{method:"POST",body:E});if(!G.ok){const Z=await G.json().catch(()=>({detail:G.statusText}));throw new Error(Z.detail||`HTTP ${G.status}`)}await ft(G)}catch(G){K(Ba(G))}finally{me.current=!1,se()}}},[ft,se]),k=i.useCallback(()=>
604{if(Ie.current||!vt.current)return;Ie.current=!0,S("speaking");const E=jt.current;ue.current=E&&Q.current>0?[Jp(E,St.current,Q.current)]:[],we.current=setTimeout(()=>{Ie.current&&W()},Xp)},[]),W=i.useCallback(()=>{if(!Ie.current)return;Ie.current=!1,Ae.current=!0,clearTimeout(we.current),we.current=null;const E=mt.current,I=Li(ue.current);if(ue.current=[],I.length<E*Zp){Ae.current=!1,S("listening");return}const G=Ri(I,E);if(ce.current==="briefing"){const Z=new FormData;Z.append("audio",G,"brief.wav"),Z.append("persona",kt.current),ot.current&&Z.append("technique_id",ot.current),Z.append("history",JSON.stringify(nt.current)),Te.current&&Z.append("current_scenario_context",Te.current),bt(Z)}else{De.current.push({role:"user",pcm:I,rate:E});const Z=new FormData;Z.append("audio",G,"turn.wav"),tt(Z)}},[tt]),te=i.useCallback(()=>{const E=()=>{Pe.current=requestAnimationFrame(E);const I=ce.current;if(!(I==="sparring"||I==="briefing"&&!Ye.current)||xt.current!=="auto"||Ae.current||_e.current)return;const Z=zt.current;if(!Z)return;const ze=Date.now(),Dt=new Uint8Array(Z.fftSize);Z.getByteTimeDomainData(Dt);let ma=0;for(let ut=0;ut<Dt.length;ut++){const Ve=(Dt[ut]-128)/128;ma+=Ve*Ve}const dt=Math.sqrt(ma/Dt.length);if(Ie.current){Le.current=dt>Le.current?dt:Le.current*sf;const ut=Math.max(gt.current*af,Le.current*rf,Lo*.6);dt>ut?Ke.current=ze:Ke.current&&ze-Ke.current>=of&&W()}else{const ut=gt.current;gt.current=dt<ut?dt:ut*.999+dt*.001;const Ve=Math.max(gt.current*tf,Lo);dt>Ve?(Oe.current||(Oe.current=ze),ze-Oe.current>=nf&&(Ke.current=ze,Le.current=dt,k())):Oe.current=0}};cancelAnimationFrame(Pe.current),Pe.current=requestAnimationFrame(E)},[k,W]),Be=i.useCallback(async()=>{try{const E=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!1}});Ze.current=E;const I=new AudioContext,G=I.createMediaStreamSource(E),Z=I.createAnalyser();Z.fftSize=512,G.connect(Z),lt.current=I,zt.current=Z,mt.current=I.sampleRate,jt.current=new Float32Array(Math.max(1,Math.round(I.sampleRate*(Qp/1e3)))),St.current=0,Q.current=0,ue.current=[];const ze=I.createScriptProcessor(4096,1,1);ze.onaudioprocess=ma=>{const dt=ma.inputBuffer.getChannelData(0),ut=jt.current;if(ut){let Ve=St.current;for(let ht=0;ht<dt.length;ht++)ut[Ve]=dt[ht],Ve=(Ve+1)%ut.length;St.current=Ve,Q.current=Math.min(ut.length,Q.current+dt.length)}Ie.current&&ue.current.push(new Float32Array(dt))};const Dt=I.createGain();Dt.gain.value=0,G.connect(ze),ze.connect(Dt),Dt.connect(I.destination),vt.current=ze,Je(!0),S("listening"),gt.current=.01,Oe.current=0,Ke.current=0,Le.current=0,te()}catch(E){throw Je(!1),ce.current==="briefing"?C("No se pudo acceder al micrófono. Usa el campo de texto o reintenta."):K("No se pudo acceder al micrófono. Usa el campo de texto o reintenta."),E}},[te]),qe=i.useCallback(()=>{var E,I;if(cancelAnimationFrame(Pe.current),Pe.current=null,clearTimeout(we.current),we.current=null,vt.current){try{vt.current.disconnect(),vt.current.onaudioprocess=null}catch{}vt.current=null}ue.current=[],jt.current=null,St.current=0,Q.current=0,(E=Ze.current)==null||E.getTracks().forEach(G=>G.stop()),Ze.current=null,(I=lt.current)==null||I.close().catch(()=>{}),lt.current=null,zt.current=null,Ie.current=!1,$e.current=[],ke.current=!1,me.current=!1,Ae.current=!1,At.current=!1,ve.current=!1;for(const G of[pt,It]){const Z=G.current;if(Z)try{Z.pause()}catch{}G.current=null}gt.current=.01,Oe.current=0,Ke.current=0,Le.current=0,Je(!1)},[]);i.useEffect(()=>()=>{const E=st.current;if(E&&ce.current==="sparring"&&!We.current){try{sessionStorage.setItem("neuralpitch_sparring_abandoned",E)}catch{}try{fetch(`${Lt}/api/sparring/${E}`,{method:"DELETE",credentials:"include",keepalive:!0})}catch{}}qe()},[qe]),i.useEffect(()=>{let E=!1;return(async()=>{try{const I=await R.get("/api/sparring");if(E)return;let G=null;try{G=sessionStorage.getItem("neuralpitch_sparring_abandoned")}catch{}const Z=(I.sessions||[]).find(ze=>ze.status==="active"&&ze.session_id!==G);Z&&ye(Z)}catch{}})(),()=>{E=!0}},[]),i.useEffect(()=>{if(p==="setup"||p==="ended"||ae!=="ptt")return;const E=Z=>{const ze=Z.target;return ze&&(ze.tagName==="INPUT"||ze.tagName==="TEXTAREA"||ze.isContentEditable)},I=Z=>{Z.code!=="Space"||Z.repeat||E(Z)||Ce.current!=="listening"||_e.current||(Z.preventDefault(),k())},G=Z=>{Z.code!=="Space"||E(Z)||Ie.current&&(Z.preventDefault(),W())};return window.addEventListener("keydown",I),window.addEventListener("keyup",G),()=>{window.removeEventListener("keydown",I),window.removeEventListener("keyup",G)}},[p,ae,k,W]),i.useEffect(()=>{if(p==="setup"||p==="ended")return;const E=setInterval(()=>{window.dispatchEvent(new CustomEvent("neuralpitch:user-active"))},3e4);return()=>clearInterval(E)},[p]);const bt=i.useCallback(async E=>{At.current=!1,Ae.current=!0,S("processing"),C(null);try{const I=await cr("/api/sparring/brief",{method:"POST",body:E});if(!I.ok){const Z=await I.json().catch(()=>({detail:I.statusText}));throw new Error(Z.detail||`HTTP ${I.status}`)}const G=await I.json();G.user_transcript&&f(Z=>[...Z,{role:"user",text:G.user_transcript}]),f(Z=>[...Z,{role:"assistant",text:G.reply}]),G.ready&&G.scenario_context&&(j(G.scenario_context),g(!0),Ye.current=!0),G.reply_audio_b64&&G.reply_audio_b64.length>0?(S("ai_speaking"),ct({b64:G.reply_audio_b64,text:null})):se()}catch(I){C(Ba(I)),se()}},[ct,se]),xe=async()=>{const E=w.trim();if(!E)return;L(""),b(!1);const I=new FormData;I.append("message",E),I.append("persona",s),o&&I.append("technique_id",o),I.append("history",JSON.stringify(nt.current)),Te.current&&I.append("current_scenario_context",Te.current),await bt(I)},He=async()=>{x("briefing"),ce.current="briefing",C(null);try{await Be()}catch{C("No se pudo acceder al micrófono. Comprueba los permisos."),x("setup"),ce.current="setup";return}Ae.current=!0,S("processing");try{const E=new FormData;E.append("message","Empezar briefing"),E.append("persona",s),o&&E.append("technique_id",o),E.append("history","[]"),At.current=!1;const I=await cr("/api/sparring/brief",{method:"POST",body:E});if(!I.ok)throw new Error((await I.json().catch(()=>({}))).detail||`HTTP ${I.status}`);const G=await I.json();f([{role:"assistant",text:G.reply}]),G.reply_audio_b64&&G.reply_audio_b64.length>0?(S("ai_speaking"),ct({b64:G.reply_audio_b64,text:null})):se()}catch(E){C(Ba(E)),se()}},le=async()=>{d(!0),m(null);try{const E=await R.post("/api/sparring/start",{persona:s,technique_id:o||null,scenario_context:y||null});D(E.session_id),st.current=E.session_id,ie(E.persona_label),De.current=E.greeting_audio_b64?[{role:"prospect",mp3b64s:[E.greeting_audio_b64]}]:[],H([{role:"user",text:"Hola, buenas, ¿tienes un momento?"},{role:"prospect",text:E.greeting,audio:E.greeting_audio_b64?[E.greeting_audio_b64]:[]}]),x("sparring"),ce.current="sparring",S("ai_speaking"),Ae.current=!0,
604ct({b64:E.greeting_audio_b64,text:null}),te()}catch(E){m(Ba(E))}finally{d(!1)}},ge=async()=>{T(!0),We.current=!0,qe();try{try{const I=await Kp(De.current,ef);I&&I.size>200&&await Cs(_,{audioBlob:I,kind:"sparring"})}catch{}const E=await R.post(`/api/sparring/${_}/end`,{});Y(E.evaluation),x("ended"),ce.current="ended"}catch(E){K(Ba(E)),We.current=!1}finally{T(!1)}},Fe=async()=>{var I;const E=re;if(E){ye(null),D(E.session_id),st.current=E.session_id,n(E.persona),kt.current=E.persona,ie(((I=ra.find(G=>G.id===E.persona))==null?void 0:I.label)||E.persona),l(E.technique_id||""),ot.current=E.technique_id||"",j(E.scenario_context||null),Te.current=E.scenario_context||null,H((E.turns||[]).map(G=>({role:G.role,text:G.text}))),Y(null),De.current=[],x("sparring"),ce.current="sparring",S("idle");try{await Be()}catch{}}},Ue=async()=>{const E=re;if(ye(null),E)try{await R.delete(`/api/sparring/${E.session_id}`)}catch{}},Wt=async()=>{const E=V.trim();if(!E||M||_e.current)return;U(!0),P("");const I=new FormData;I.append("text",E),await tt(I),U(!1)},sn=()=>{_e.current||A!=="processing"&&A!=="ai_speaking"&&k()},Tr=()=>{Ie.current&&W()},nn=()=>{xt.current==="ptt"&&A==="listening"&&k()},Pr=()=>{Ie.current&&W()},on=ra.find(E=>E.id===s)||ra[0],Mt=q.filter(E=>E.role==="user").length,Bi=()=>{g(!1),Ye.current=!1,f(E=>[...E,{role:"assistant",text:"Claro, dime qué quieres corregir o añadir al escenario."}]),S("listening")},zi=A==="speaking"?{background:"#00E5A0",boxShadow:"0 0 48px 16px rgba(0,229,160,0.45)",animation:"orbPulse 0.7s ease-in-out infinite"}:A==="ai_speaking"?{background:"#00B4D8",boxShadow:"0 0 48px 16px rgba(0,180,216,0.4)",animation:"orbPulse 1.1s ease-in-out infinite"}:A==="processing"?{background:"rgba(0,180,216,0.25)",boxShadow:"0 0 24px 4px rgba(0,180,216,0.2)",animation:"rotate 1.2s linear infinite"}:A==="listening"?{background:"rgba(0,229,160,0.12)",boxShadow:"0 0 16px 2px rgba(0,229,160,0.08)",animation:"orbBreath 3.5s ease-in-out infinite"}:{background:"rgba(255,255,255,0.04)",boxShadow:"none",animation:"none"},ln=ae==="auto"?"Escuchándoteâ¦":"Grabando⦠suelta para enviar",cn=p==="briefing"?{idle:"Iniciando micrófono...",listening:ae==="auto"?"Te escucho â responde cuando quieras":"Mantén pulsado para hablar",speaking:ln,processing:"Procesando...",ai_speaking:"Coach respondiendo..."}[A]||"":{idle:"",listening:ae==="auto"?"Te escucho â habla cuando quieras":"Mantén el botón (o Espacio) para hablar",speaking:ln,processing:"Procesando...",ai_speaking:"Prospecto respondiendo..."}[A]||"";if(p==="setup")return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Práctica · Sparring IA"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Sparring Mode"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Practica en tiempo real con un prospecto simulado por IA. Habla directamente o escribe."})]}),re&&e.jsxs("div",{className:"mb-6 px-4 py-3 rounded-xl flex items-center justify-between gap-3 flex-wrap",style:{background:"rgba(0,180,216,0.08)",border:"1px solid rgba(0,180,216,0.25)"},children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold",style:{color:"#00B4D8"},children:"Tienes una sesión sin terminar"}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.5)"},children:["Con ",((dn=ra.find(E=>E.id===re.persona))==null?void 0:dn.label)||re.persona," · ",re.turn_count," turno",re.turn_count!==1?"s":""]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:Ue,className:"px-3 py-1.5 rounded-lg text-xs font-semibold",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer"},children:"Descartar"}),e.jsx("button",{onClick:Fe,className:"px-3 py-1.5 rounded-lg text-xs font-bold",style:{background:"#00B4D8",color:"#0A0A0F",border:"none",cursor:"pointer"},children:"Continuar â"})]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-sm font-semibold mb-3",style:{color:"rgba(255,255,255,0.6)"},children:"Perfil del prospecto"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:ra.map(E=>e.jsxs("button",{onClick:()=>n(E.id),className:"text-left p-4 rounded-xl transition-all duration-200",style:{background:s===E.id?E.bg:"rgba(255,255,255,0.02)",border:`1px solid ${s===E.id?E.border:"rgba(255,255,255,0.06)"}`,cursor:"pointer"},children:[e.jsx("p",{className:"font-semibold text-sm mb-1",style:{color:s===E.id?E.color:"rgba(255,255,255,0.8)"},children:E.label}),e.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:12},children:E.description})]},E.id))})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-sm font-semibold mb-2",style:{color:"rgba(255,255,255,0.6)"},children:"Técnica a practicar (opcional)"}),e.jsxs("select",{value:o,onChange:E=>l(E.target.value),className:"w-full px-4 py-3 rounded-xl text-sm",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:o?"rgba(255,255,255,0.85)":"rgba(255,255,255,0.35)",outline:"none"},children:[e.jsx("option",{value:"",children:"Sin técnica especÃfica (conversación libre)"}),r.map(E=>
604e.jsx("option",{value:E.id,children:E.name},E.id))]})]}),e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-sm font-semibold mb-2",style:{color:"rgba(255,255,255,0.6)"},children:"Modo de interacción"}),e.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[e.jsx(rs,{mode:ae,onChange:de}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)"},children:ae==="auto"?"Habla cuando quieras: detecto cuándo empiezas y terminas.":"Mantén el botón (o la barra espaciadora) para hablar."})]})]}),u&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-xl text-sm",style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757"},children:u}),e.jsx("button",{onClick:He,className:"w-full py-3.5 rounded-xl text-sm font-bold transition-all duration-200",style:{background:"#00E5A0",color:"#0A0A0F",border:"none",cursor:"pointer"},children:"Preparar escenario â"}),e.jsx("p",{className:"mt-4 text-center text-xs",style:{color:"rgba(255,255,255,0.3)"},children:"El asistente te hará unas preguntas rápidas para que el rol sea lo más realista posible."})]});if(p==="briefing"){const E=ra.find(I=>I.id===s)||ra[0];return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsx("style",{children:"@keyframes orbBreath { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }"}),e.jsxs("div",{className:"mb-6",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Sparring IA · Briefing"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Prepara tu escenario"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"El coach te hará unas preguntas. Mantén pulsado el micrófono para responder."})]}),e.jsxs("div",{className:"mb-5 flex items-center gap-2",children:[e.jsx("span",{className:"text-xs px-3 py-1 rounded-full font-semibold",style:{background:E.bg,color:E.color,border:`1px solid ${E.border}`},children:E.label}),e.jsx("button",{onClick:()=>{qe(),x("setup"),ce.current="setup",f([]),g(!1),Ye.current=!1,j(null)},className:"text-xs",style:{color:"rgba(255,255,255,0.35)",background:"none",border:"none",cursor:"pointer"},children:"â Cambiar configuración"}),e.jsx("div",{className:"ml-auto",children:e.jsx(rs,{mode:ae,onChange:de})})]}),e.jsxs("div",{className:"flex flex-col items-center mb-6 select-none",children:[e.jsx("button",{onMouseDown:nn,onMouseUp:Pr,onTouchStart:I=>{I.preventDefault(),nn()},onTouchEnd:I=>{I.preventDefault(),Pr()},onMouseLeave:()=>{Ie.current&&Pr()},disabled:A==="processing"||A==="ai_speaking"||A==="idle",className:"rounded-full transition-all duration-200 select-none flex items-center justify-center",style:{width:88,height:88,background:A==="speaking"?"#00E5A0":A==="listening"?"rgba(0,229,160,0.12)":"rgba(255,255,255,0.03)",border:`2px solid ${A==="speaking"?"#00E5A0":A==="listening"?"rgba(0,229,160,0.35)":"rgba(255,255,255,0.06)"}`,boxShadow:A==="speaking"?"0 0 40px rgba(0,229,160,0.45)":"none",cursor:A==="listening"?"pointer":"default",userSelect:"none",WebkitUserSelect:"none"},children:e.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{opacity:A==="listening"?.7:A==="speaking"?1:.2},children:[e.jsx("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3",fill:A==="speaking"?"#0A0A0F":"#00E5A0"}),e.jsx("path",{d:"M5 10a7 7 0 0 0 14 0",stroke:A==="speaking"?"#0A0A0F":"#00E5A0",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("line",{x1:"12",y1:"17",x2:"12",y2:"21",stroke:A==="speaking"?"#0A0A0F":"#00E5A0",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("line",{x1:"9",y1:"21",x2:"15",y2:"21",stroke:A==="speaking"?"#0A0A0F":"#00E5A0",strokeWidth:"2",strokeLinecap:"round"})]})}),e.jsx("p",{className:"mt-3 text-sm",style:{color:"rgba(255,255,255,0.45)",minHeight:20},children:cn}),A==="ai_speaking"&&e.jsx("button",{onClick:_t,className:"mt-2 text-xs px-3 py-1 rounded-lg",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.6)",cursor:"pointer"},children:"â Saltar audio"})]}),e.jsx("div",{className:"rounded-xl border mb-4",style:{background:"rgba(255,255,255,0.02)",borderColor:"rgba(255,255,255,0.07)",minHeight:200,maxHeight:380,overflowY:"auto"},children:e.jsxs("div",{className:"flex flex-col gap-3 p-4",children:[v.map((I,G)=>e.jsx("div",{className:`flex ${I.role==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:"max-w-[82%] px-4 py-2.5 text-sm leading-relaxed",style:I.role==="user"?{background:"rgba(0,229,160,0.12)",color:"rgba(255,255,255,0.88)",borderRadius:"18px 18px 4px 18px"}:{background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.78)",borderRadius:"18px 18px 18px 4px"},children:[I.role==="assistant"&&e.jsx("span",{className:"block text-xs mb-1 font-semibold",style:{color:"#00E5A0",opacity:.7},children:"Coach"}),I.text]})},G)),A==="processing"&&e.jsx("div",{className:"flex justify-start",children:e.jsx("div",{className:"px-4 py-2.5 rounded-2xl text-sm",style:{background:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.35)",borderRadius:"18px 18px 18px 4px"},children:"···"})}),e.jsx("div",{ref:z})]})}),F&&e.jsx("div",{className:"mb-3 px-4 py-2 rounded-xl text-sm",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757"},children:F}),h&&e.jsxs(e.Fragment,{children:[y&&e.jsxs("div",{className:"mb-4 px-4 py-4 rounded-xl",style:{background:"rgba(0,229,160,0.04)",border:"1px solid rgba(0,229,160,0.18)"},children:[e.jsx("p",{className:"text-xs font-bold mb-3",style:{color:"#00E5A0",letterSpacing:"0.1em",textTransform:"uppercase"},children:"Escenario confirmado"}),e.jsx(lf,{text:y})]}),u&&e.jsx("p",{className:"mb-3 text-sm text-center",style:{color:"#FF4757"},children:u}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:Bi,className:"py-3.5 rounded-xl text-sm font-semibold transition-all flex-shrink-0",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"rgba(255,255,255,0.6)",cursor:"pointer",paddingLeft:20,paddingRight:20},children:"⺠Refinar"}
604),e.jsx("button",{onClick:le,disabled:c,className:"flex-1 py-3.5 rounded-xl text-sm font-bold transition-all",style:{background:c?"rgba(0,229,160,0.4)":"#00E5A0",color:"#0A0A0F",border:"none",cursor:c?"wait":"pointer"},children:c?"Iniciando...":"â¶ Comenzar sparring"})]})]}),!h&&e.jsx("div",{className:"mt-4 text-center",children:N?e.jsxs("div",{className:"flex gap-2 mt-2",children:[e.jsx("input",{value:w,onChange:I=>L(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),xe())},placeholder:"Escribe tu respuesta...",className:"flex-1 px-4 py-2.5 rounded-xl text-sm",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.88)",outline:"none"}}),e.jsx("button",{onClick:xe,disabled:!w.trim(),className:"px-4 py-2.5 rounded-xl text-sm font-bold",style:{background:w.trim()?"#00E5A0":"rgba(0,229,160,0.2)",color:"#0A0A0F",border:"none",cursor:w.trim()?"pointer":"default"},children:"Enviar"})]}):e.jsx("button",{onClick:()=>b(!0),className:"text-xs",style:{color:"rgba(255,255,255,0.25)",background:"none",border:"none",cursor:"pointer"},children:"¿No funciona el micrófono? Escribe tu respuesta â"})}),e.jsx("p",{className:"mt-5 text-center text-xs",style:{color:"rgba(255,255,255,0.2)"},children:"El audio se procesa en tiempo real y no se almacena (EU AI Act)."})]})}return p==="ended"?e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Sparring · Resultados"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Resultados del sparring"}),e.jsxs("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:["Con: ",oe," · ",Mt," turnos"]})]}),e.jsx(Pi,{evaluation:$,turns:q,sessionId:_,onReplay:Ft,replayIdx:fe}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>{x("setup"),ce.current="setup",H([]),D(null),Y(null),S("idle")},className:"flex-1 py-3 rounded-xl text-sm font-semibold",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.7)",cursor:"pointer"},children:"Nueva sesión"}),e.jsx("button",{onClick:()=>a("/history"),className:"flex-1 py-3 rounded-xl text-sm font-semibold",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",cursor:"pointer"},children:"Ver historial"})]})]}):X?e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10 flex flex-col items-center justify-center text-center",style:{minHeight:"60vh"},children:[e.jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg) } }"}),e.jsx("div",{className:"w-16 h-16 rounded-full mb-6",style:{border:"3px solid rgba(0,229,160,0.18)",borderTopColor:"#00E5A0",animation:"spin 0.9s linear infinite"}}),e.jsx("h2",{className:"text-2xl font-bold mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Generando tu evaluaciónâ¦"}),e.jsxs("p",{className:"text-sm max-w-md",style:{color:"rgba(255,255,255,0.55)",lineHeight:1.6},children:["Estamos analizando toda tu conversación para darte la puntuación por pilares y el coaching. Puede tardar unos segundos â"," ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.85)"},children:"no cierres la página"}),"."]})]}):e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-6 flex flex-col",style:{minHeight:"calc(100vh - 80px)"},children:[e.jsx("style",{children:` 605 @keyframes orbPulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.14);opacity:0.85} } 606 @keyframes orbBreath { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} } 607 `}),e.jsxs("div",{className:"flex items-center justify-between mb-4 pb-4",style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm font-semibold",style:{color:"rgba(255,255,255,0.92)"},children:[on&&e.jsx("span",{style:{color:on.color,marginRight:6},children:"â"}),oe]}),e.jsxs("p",{style:{color:"rgba(255,255,255,0.4)",fontSize:12},children:[e.jsxs("span",{style:{color:Mt>=Et?"#FFB800":"rgba(255,255,255,0.4)"},children:[Mt,"/",Et," turnos"]}),y&&e.jsx("span",{style:{marginLeft:6,color:"rgba(0,229,160,0.5)"},title:y,children:"· escenario activo"})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"hidden sm:block",children:e.jsx(rs,{mode:ae,onChange:de})}),(()=>{const E=X||A==="processing"||A==="ai_speaking";return e.jsx("button",{onClick:ge,disabled:E,title:E&&!X?"Espera a que termine el turno actual":void 0,className:"px-3 py-1.5 rounded-lg text-xs font-semibold",style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757",cursor:E?"not-allowed":"pointer",opacity:E?.5:1},children:X?"...":"Terminar"})})()]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto mb-4 pr-1",style:{maxHeight:"42vh"},children:e.jsxs("div",{className:"flex flex-col gap-3",children:[q.map((E,I)=>{var G;return e.jsx("div",{className:`flex ${E.role==="user"?"justify-end":"justify-start"}`,children:e.jsxs("div",{className:"px-4 py-3 rounded-2xl text-sm",style:{maxWidth:"80%",background:E.role==="user"?"rgba(0,229,160,0.12)":"rgba(255,255,255,0.04)",border:E.role==="user"?"1px solid rgba(0,229,160,0.2)":"1px solid rgba(255,255,255,0.06)",color:"rgba(255,255,255,0.85)",lineHeight:1.6,wordBreak:"break-word"},children:[E.text||e.jsx("span",{style:{opacity:.4},children:"â¦"}),E.streaming&&e.jsx("span",{style:{opacity:.6,marginLeft:2},children:"â"}),E.role==="prospect"&&((G=E.audio)==null?void 0:G.length)>0&&!E.streaming&&e.jsx("button",{onClick:()=>Ft(I,E.audio),className:"mt-1.5 flex items-center gap-1 text-xs",style:{background:"none",border:"none",color:fe===I?"#00E5A0":"rgba(255,255,255,0.4)",cursor:"pointer",padding:0},children:fe===I?"â Parar":"â¶ Reescuchar"})]})},I)}),e.jsx("div",{ref:Ee})]})}),Mt>=Et&&e.jsxs("div",{className:"mb-3 px-4 py-2.5 rounded-xl text-sm flex items-center justify-between gap-2 flex-wrap",style:{background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800"}
607,children:[e.jsxs("span",{children:["Has alcanzado el máximo de ",Et," turnos."]}),e.jsx("button",{onClick:ge,disabled:X,className:"px-3 py-1 rounded-lg text-xs font-bold",style:{background:"#FFB800",color:"#0A0A0F",border:"none",cursor:X?"wait":"pointer"},children:"Ver evaluación â"})]}),B&&e.jsxs("div",{className:"mb-3 px-4 py-2 rounded-xl text-sm",style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757"},children:[B,e.jsx("button",{onClick:()=>K(null),style:{float:"right",background:"none",border:"none",color:"inherit",cursor:"pointer"},children:"â"})]}),e.jsxs("div",{className:"flex flex-col items-center gap-2 py-4",children:[e.jsx("div",{className:"w-20 h-20 rounded-full transition-colors duration-300",style:zi}),e.jsx("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.4)",minHeight:16},children:cn}),!Qe&&e.jsx("button",{onClick:()=>{Be().catch(()=>{})},className:"mt-1 px-5 py-2.5 rounded-xl text-sm font-bold",style:{background:"rgba(0,229,160,0.15)",border:"1px solid rgba(0,229,160,0.35)",color:"#00E5A0",cursor:"pointer"},children:"ð¤ Activar micrófono"}),Qe&&A==="ai_speaking"&&e.jsx("button",{onClick:_t,className:"text-xs px-3 py-1.5 rounded-lg",style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.12)",color:"rgba(255,255,255,0.6)",cursor:"pointer"},children:"â Saltar audio"}),Qe&&ae==="ptt"&&A!=="ai_speaking"&&e.jsx("button",{onMouseDown:sn,onMouseUp:Tr,onTouchStart:E=>{E.preventDefault(),sn()},onTouchEnd:E=>{E.preventDefault(),Tr()},onMouseLeave:()=>{Ie.current&&Tr()},disabled:A==="processing"||Mt>=Et,className:"mt-1 px-8 py-3 rounded-xl text-sm font-bold select-none",style:{background:A==="speaking"?"rgba(255,71,87,0.2)":"rgba(0,229,160,0.12)",border:`1px solid ${A==="speaking"?"rgba(255,71,87,0.4)":"rgba(0,229,160,0.3)"}`,color:A==="speaking"?"#FF4757":"#00E5A0",cursor:A==="processing"||Mt>=Et?"not-allowed":"pointer",userSelect:"none",WebkitUserSelect:"none",opacity:A==="processing"||Mt>=Et?.5:1},children:A==="speaking"?"Suelta para enviar":"Mantén para hablar"})]}),e.jsxs("div",{className:"flex gap-2 pt-2",style:{borderTop:"1px solid rgba(255,255,255,0.05)"},children:[e.jsx("input",{value:V,onChange:E=>P(E.target.value),onKeyDown:E=>{E.key==="Enter"&&!E.shiftKey&&(E.preventDefault(),Wt())},placeholder:Mt>=Et?"LÃmite de turnos alcanzado":"O escribe tu respuesta...",className:"flex-1 px-4 py-2.5 rounded-xl text-sm",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.8)",outline:"none"},disabled:M||A==="processing"||A==="ai_speaking"||Mt>=Et}),e.jsx("button",{onClick:Wt,disabled:!V.trim()||M||A==="processing"||A==="ai_speaking"||Mt>=Et,className:"px-4 py-2.5 rounded-xl text-sm font-bold",style:{background:V.trim()&&!M?"#00E5A0":"rgba(0,229,160,0.15)",color:"#0A0A0F",border:"none",cursor:V.trim()&&!M&&A!=="processing"&&A!=="ai_speaking"&&Mt<Et?"pointer":"not-allowed"},children:"â"})]})]})}const uf={skeptic:"Escéptico",budget_constrained:"Presupuesto limitado",decisionmaker:"Director / CEO",friendly:"Receptivo",indecisive:"Indeciso",loyal_incumbent:"Ya tiene proveedor",analytical:"AnalÃtico",haggler:"Negociador",busy_distracted:"Ocupado y distraÃdo",guarded:"Reservado"};function mf(){const{sessionId:t}=da(),a=he(),[r,s]=i.useState(null),[n,o]=i.useState(!0),[l,c]=i.useState(null);i.useEffect(()=>{let p=!1;return o(!0),c(null),R.get(`/api/sparring/${t}/result`).then(x=>{p||s(x)}).catch(x=>{p||c(x.message||"No se pudo cargar la sesión")}).finally(()=>{p||o(!1)}),()=>{p=!0}},[t]);const d=()=>e.jsx("button",{onClick:()=>a("/history"),className:"text-xs mb-4",style:{color:"rgba(255,255,255,0.4)",background:"none",border:"none",cursor:"pointer"},children:"â Volver al historial"});if(n)return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsx(d,{}),e.jsx("p",{style:{color:"rgba(255,255,255,0.5)",fontSize:14},children:"Cargando resultadosâ¦"})]});if(l||!r)return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsx(d,{}),e.jsx("div",{className:"p-6 rounded-xl text-center",style:{background:"rgba(255,71,87,0.08)",border:"1px solid rgba(255,71,87,0.2)"},children:e.jsx("p",{style:{color:"#FF4757",fontSize:14},children:l||"No se encontró la sesión."})})]});const u=uf[r.persona]||r.persona,m=r.turn_count||0;return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx(d,{}),e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Sparring · Resultados"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Resultados del sparring"}),e.jsxs("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:["Con: ",u," · ",m," turno",m!==1?"s":"",r.status==="abandoned"?" · sesión abandonada":""]})]}),e.jsx(Pi,{evaluation:r.evaluation,turns:r.turns||[],sessionId:t}),e.jsx("button",{onClick:()=>a("/history"),className:"w-full py-3 rounded-xl text-sm font-semibold",style:{background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.2)",color:"#00E5A0",cursor:"pointer"},children:"Ver historial"})]})}const ss=100,pf=3e3,zo={processing:"Analizando...",done:"Completado",error:"Error"},va={processing:"#FFB800",done:"#00E5A0",error:"#FF4757"};function ff(){const{user:t}=Ge();if(!(t!=null&&t.is_premium))return e.jsx(rn,{feature:"Análisis de Llamadas Reales",description:"Sube una grabación de una reunión de ventas real y obtén un análisis completo: qué técnicas de persuasión usaste, cuáles oportunidades perdiste y cómo mejorar en la siguiente reunión.",bullets:["Diarización automática que identifica quién habla en cada momento","Análisis de técnicas NLP aplicadas por el vendedor","Detección de oportunidades de persuasión no aprovechadas","Sin almacenamiento de audio: cumple el EU AI Act y el RGPD"]});const[a,r]=i.useState(!1),[s,n]=i.useState(!1),[o,l]=i.useState(null),[c,d]=i.useState(null),[u,m]=i.useState(null),[p,x]=i.useState([]),[v,f]=i.useState(!0),h=i.useRef(null),g=i.useRef(null);i.useEffect(()=>{R.get("/api/calls").then(b=>x(b.calls||[])).catch(()=>{}).finally(()=>f(!1))},[]),i.useEffect(()=>{if(!c||(u==null?void 0:u.status)==="done"||(u==null?void 0:u.status)==="error"){clearInterval(g.current);return}return g.current=setInterval(async()=>{try{const b=await R.get(`/api/calls/${c}`);m(b),(b.status==="done"||b.status==="error")&&(clearInterval(g.current),R.get("/api/calls").then(w=>
607x(w.calls||[])).catch(()=>{}))}catch{clearInterval(g.current)}},pf),()=>clearInterval(g.current)},[c,u==null?void 0:u.status]);const y=async b=>{var S;if(!b)return;l(null);const w=["audio/mpeg","audio/mp3","audio/wav","audio/x-wav","audio/mp4","audio/x-m4a","audio/m4a","audio/ogg","audio/webm"],L=(S=b.name.split(".").pop())==null?void 0:S.toLowerCase(),z=["mp3","wav","m4a","mp4","ogg","webm","mpeg"];if(!w.includes(b.type)&&!z.includes(L)){l("Formato no soportado. Usa MP3, WAV, M4A, OGG o WebM.");return}if(b.size>ss*1024*1024){l(`El archivo es demasiado grande (máximo ${ss}MB)`);return}n(!0);const A=new FormData;A.append("audio",b,b.name);try{const _=await R.postForm("/api/calls/analyze",A);d(_.id),m({id:_.id,status:"processing",filename_original:b.name})}catch(_){l(_.message||"Error subiendo el archivo")}finally{n(!1)}},j=b=>{b.preventDefault(),r(!1);const w=b.dataTransfer.files[0];w&&y(w)},F=async b=>{try{await R.delete(`/api/calls/${b}`),x(w=>w.filter(L=>L.id!==b)),c===b&&(d(null),m(null))}catch{}},C=b=>{d(b.id),m(b)},N=b=>b?e.jsxs("div",{className:"mt-6",children:[b.overall!==void 0&&e.jsxs("div",{className:"p-5 rounded-2xl mb-4 text-center",style:{background:"rgba(0,229,160,0.06)",border:"1px solid rgba(0,229,160,0.15)"},children:[e.jsx("p",{className:"text-4xl font-bold mb-1",style:{color:"#00E5A0"},children:b.overall}),e.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:13},children:"Puntuación global del vendedor"})]}),b.diarization&&e.jsxs("div",{className:"p-4 rounded-xl mb-4",style:{background:"rgba(0,180,216,0.06)",border:"1px solid rgba(0,180,216,0.12)"},children:[e.jsx("p",{className:"text-xs font-semibold mb-1",style:{color:"#00B4D8"},children:"DIARIZACIÃN"}),e.jsxs("p",{style:{color:"rgba(255,255,255,0.6)",fontSize:13},children:[b.diarization.total_speakers," interlocutores detectados · Vendedor identificado como interlocutor #",b.diarization.salesperson_speaker]})]}),b.coaching_note&&e.jsxs("div",{className:"p-4 rounded-xl mb-4",style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsx("p",{className:"text-xs font-semibold mb-2",style:{color:"rgba(255,255,255,0.4)"},children:"COACHING"}),e.jsx("p",{style:{color:"rgba(255,255,255,0.75)",fontSize:14,lineHeight:1.6},children:b.coaching_note})]}),b.pillars&&e.jsx("div",{className:"grid grid-cols-2 gap-3",children:Object.entries(b.pillars).map(([w,L])=>e.jsxs("div",{className:"p-4 rounded-xl",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.06)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("p",{className:"text-xs font-semibold uppercase",style:{color:"rgba(255,255,255,0.4)",letterSpacing:"0.08em"},children:w.replace(/_/g," ")}),e.jsx("p",{className:"text-lg font-bold",style:{color:(L.score||0)>=75?"#00E5A0":(L.score||0)>=55?"#FFB800":"#FF4757"},children:L.score??"--"})]}),e.jsx("div",{className:"w-full rounded-full",style:{height:4,background:"rgba(255,255,255,0.06)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${L.score||0}%`,background:(L.score||0)>=75?"#00E5A0":(L.score||0)>=55?"#FFB800":"#FF4757"}})}),L.feedback&&e.jsx("p",{className:"mt-2 text-xs",style:{color:"rgba(255,255,255,0.45)",lineHeight:1.5},children:L.feedback})]},w))})]}):null;return e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("p",{className:"text-xs font-bold tracking-widest uppercase mb-1",style:{color:"#00E5A0",letterSpacing:"0.18em"},children:"Análisis · Llamadas Reales"}),e.jsx("h1",{className:"text-3xl font-bold",style:{fontFamily:"'Playfair Display', serif"},children:"Analizador de llamadas"}),e.jsx("p",{className:"mt-2 text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Sube una grabación de una llamada de ventas real. El sistema identifica al vendedor y evalúa las técnicas PNL aplicadas."})]}),e.jsxs("div",{onDragOver:b=>{b.preventDefault(),r(!0)},onDragLeave:()=>r(!1),onDrop:j,onClick:()=>{var b;return!s&&((b=h.current)==null?void 0:b.click())},className:"rounded-2xl mb-6 flex flex-col items-center justify-center gap-3 transition-all duration-200",style:{padding:"48px 24px",border:`2px dashed ${a?"#00E5A0":"rgba(255,255,255,0.1)"}`,background:a?"rgba(0,229,160,0.04)":"rgba(255,255,255,0.02)",cursor:s?"wait":"pointer"},role:"button",tabIndex:0,onKeyDown:b=>{var w;return b.key==="Enter"&&((w=h.current)==null?void 0:w.click())},"aria-label":"Subir grabación de llamada",children:[e.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none","aria-hidden":"true",children:[e.jsx("rect",{x:"4",y:"4",width:"32",height:"32",rx:"8",fill:"rgba(0,229,160,0.08)"}),e.jsx("path",{d:"M20 26V14M20 14l-4 4M20 14l4 4",stroke:"#00E5A0",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12 28h16",stroke:"rgba(0,229,160,0.4)",strokeWidth:"2",strokeLinecap:"round"})]}),s?e.jsx("p",{style:{color:"#00E5A0",fontSize:14,fontWeight:600},children:"Subiendo archivo..."}):e.jsxs(e.Fragment,{children:[e.jsx("p",{style:{color:"rgba(255,255,255,0.7)",fontSize:14,fontWeight:500},children:"Arrastra aquà o haz clic para seleccionar"}),e.jsxs("p",{style:{color:"rgba(255,255,255,0.35)",fontSize:12},children:["MP3, WAV, M4A, OGG · Máximo ",ss,"MB"]})]}),e.jsx("input",{ref:h,type:"file",accept:"audio/*,.mp3,.wav,.m4a,.ogg,.webm",onChange:b=>y(b.target.files[0]),style:{display:"none"},"aria-hidden":"true"})]}),o&&e.jsx("div",{className:"mb-4 px-4 py-3 rounded-xl text-sm",style:{background:"rgba(255,71,87,0.1)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757"},children:o}),u&&e.jsxs("div",{className:"p-5 rounded-2xl mb-6",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.07)"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"font-semibold text-sm",style:{color:"rgba(255,255,255,0.85)"},children:u.filename_original||"Grabación de llamada"}),e.jsx("span",{className:"text-xs font-bold px-2 py-0.5 rounded-full",style:{background:`${va[u.status]}18`,color:va[u.status],border:`1px solid ${va[u.status]}33`},children:zo[u.status]||u.status})]}),u.status==="processing"&&e.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[e.jsx("div",{className:"w-4 h-4 rounded-full animate-ping",style:{background:"#FFB800"}}),e.jsx("p",{style:{color:"rgba(255,255,255,0.45)",fontSize:13},children:"Transcribiendo y analizando la llamada... esto puede tardar unos minutos."})]}),u.status==="error"&&e.jsx("p",{className:"mt-2 text-sm",style:{color:"#FF4757"},children:u.error_detail||"Error al procesar el archivo"}),u.status==="done"&&N(u.evaluation),u.status==="done"&&u.transcript&&e.jsxs("details",{className:"mt-4",children:[e.jsx("summary",{className:"text-xs font-semibold cursor-pointer",style:{color:"rgba(255,255,255,0.4)"},children:"VER TRANSCRIPCIÃN COMPLETA"}),e.jsx("div",{className:"mt-3 p-4 rounded-xl text-sm",style:{background:"rgba(255,255,255,0.02)",color:"rgba(255,255,255,0.6)",lineHeight:1.7,whiteSpace:"pre-wrap",maxHeight:300,overflowY:"auto"},children:u.transcript})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold mb-3",style:{color:"rgba(255,255,255,0.4)"},children:"HISTORIAL DE LLAMADAS"}),v&&e.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:13},children:"Cargando..."}),!v&&p.length===0&&e.jsx("div",{className:"py-8 text-center rounded-xl",style:{background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.04)"},children:e.jsx("p",{style:{color:"rgba(255,255,255,0.3)",fontSize:13},children:"Aún no has analizado ninguna llamada"})}),e.jsx("div",{className:"flex flex-col gap-2",children:p.map(b=>{var w;return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 rounded-xl transition-all duration-150",style:{background:c===b.id?"rgba(0,229,160,0.05)":"rgba(255,255,255,0.02)",border:c===b.id?"1p
607x solid rgba(0,229,160,0.12)":"1px solid rgba(255,255,255,0.05)"},children:[e.jsxs("button",{onClick:()=>C(b),className:"flex-1 text-left",style:{background:"none",border:"none",cursor:"pointer",padding:0},children:[e.jsx("p",{className:"text-sm font-medium",style:{color:"rgba(255,255,255,0.8)"},children:b.filename_original||"Grabación"}),e.jsxs("p",{className:"text-xs mt-0.5",style:{color:"rgba(255,255,255,0.35)"},children:[b.created_at?new Date(b.created_at).toLocaleString("es-ES",{day:"2-digit",month:"short",hour:"2-digit",minute:"2-digit"}):""," ",b.duration_seconds?`· ${Math.round(b.duration_seconds/60)} min`:""]})]}),e.jsxs("div",{className:"flex items-center gap-3 ml-4",children:[((w=b.evaluation)==null?void 0:w.overall)!==void 0&&e.jsx("span",{className:"text-sm font-bold",style:{color:b.evaluation.overall>=75?"#00E5A0":b.evaluation.overall>=55?"#FFB800":"#FF4757"},children:b.evaluation.overall}),e.jsx("span",{className:"text-xs font-semibold px-2 py-0.5 rounded-full",style:{background:`${va[b.status]||"#888"}18`,color:va[b.status]||"rgba(255,255,255,0.4)",border:`1px solid ${va[b.status]||"#888"}33`},children:zo[b.status]||b.status}),e.jsx("button",{onClick:()=>F(b.id),className:"p-1 rounded",style:{background:"none",border:"none",color:"rgba(255,71,87,0.5)",cursor:"pointer"},onMouseEnter:L=>L.currentTarget.style.color="#FF4757",onMouseLeave:L=>L.currentTarget.style.color="rgba(255,71,87,0.5)","aria-label":"Eliminar análisis",children:e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"currentColor",children:e.jsx("path",{d:"M2 4h10M5 4V3a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v1M6 7v4M8 7v4M3 4l.9 7.1A1 1 0 0 0 4.9 12h4.2a1 1 0 0 0 1-.9L11 4"})})})]})]},b.id)})})]}),e.jsx("p",{className:"mt-6 text-center text-xs",style:{color:"rgba(255,255,255,0.25)"},children:"El audio se procesa en memoria y no se almacena permanentemente (EU AI Act Art. 13). Solo se guardan la transcripción y los resultados."})]})}function xf(){var _,D;const{token:t}=da(),a=he(),{refreshUser:r}=Ge(),[s,n]=i.useState("loading"),[o,l]=i.useState(null),[c,d]=i.useState(""),[u,m]=i.useState(""),[p,x]=i.useState(""),[v,f]=i.useState(""),[h,g]=i.useState(!1),[y,j]=i.useState({}),[F,C]=i.useState(!1),[N,b]=i.useState(!1),[w,L]=i.useState(null),z=async q=>{C(q),b(!0),L(null);try{await R.post(`/api/consent/share-with-team?data_type=session_result&shareable=${q}`,{}),L({ok:!0,text:q?"Activado. Gracias por ayudar a tu equipo.":"Desactivado."})}catch{C(!q),L({ok:!1,text:"No se pudo guardar ahora; podrás activarlo desde tu perfil."})}finally{b(!1)}};i.useEffect(()=>{R.get(`/api/invitations/${t}`).then(q=>{l(q),n("form")}).catch(q=>{d((q==null?void 0:q.detail)||"Esta invitación no es válida, ya fue utilizada o ha caducado."),n("error")})},[t]);const A=()=>{const q={};return u.trim()||(q.fullName="El nombre es obligatorio."),p.length<8&&(q.password="MÃnimo 8 caracteres."),p!==v&&(q.confirmPassword="Las contraseñas no coinciden."),j(q),Object.keys(q).length===0},S=async q=>{if(q.preventDefault(),!!A()){g(!0),d("");try{const H=await R.post(`/api/invitations/${t}/accept`,{full_name:u.trim(),password:p});await(r==null?void 0:r()),l(oe=>({...oe,...H})),n("success")}catch(H){d((H==null?void 0:H.detail)||"Error al unirse al equipo. Por favor, inténtalo de nuevo.")}finally{g(!1)}}};return e.jsx("div",{style:{minHeight:"100vh",background:"#0A0A0F",display:"flex",alignItems:"center",justifyContent:"center",padding:"24px 16px"},children:e.jsxs("div",{style:{width:"100%",maxWidth:440,background:"rgba(255,255,255,0.02)",border:"1px solid rgba(255,255,255,0.07)",borderRadius:20,padding:"40px 36px"},children:[e.jsxs("div",{style:{textAlign:"center",marginBottom:32},children:[e.jsx(ua,{size:40}),e.jsx("p",{style:{margin:"12px 0 0",fontSize:18,fontWeight:700,color:"#fff"},children:"NeuralPitch"}),e.jsx("p",{style:{margin:"4px 0 0",fontSize:11,letterSpacing:"0.12em",textTransform:"uppercase",color:"rgba(255,255,255,0.4)"},children:"Invitación de equipo"})]}),s==="loading"&&e.jsx("p",{style:{color:"rgba(255,255,255,0.5)",textAlign:"center"},children:"Verificando invitaciónâ¦"}),s==="error"&&e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:56,height:56,borderRadius:"50%",background:"rgba(255,71,87,0.12)",border:"1px solid rgba(255,71,87,0.25)",marginBottom:20},children:e.jsx("span",{style:{fontSize:24},children:"â"})}),e.jsx("p",{style:{color:"#FF4757",fontSize:15,marginBottom:16},children:c}),e.jsx("button",{onClick:()=>a("/login"),style:{background:"rgba(255,255,255,0.06)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:10,padding:"10px 24px",color:"rgba(255,255,255,0.7)",cursor:"pointer",fontSize:14},children:"Ir al inicio de sesión"})]}),s==="form"&&o&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{background:"rgba(0,229,160,0.05)",border:"1px solid rgba(0,229,160,0.15)",borderRadius:12,padding:"16px 20px",marginBottom:28},children:[e.jsxs("p",{style:{margin:0,fontSize:13,color:"rgba(255,255,255,0.55)"},children:[e.jsx("strong",{style:{color:"#fff"},children:o.inviter_name})," ","te invita a unirte al equipo"]}),e.jsx("p",{style:{margin:"6px 0 0",fontSize:18,fontWeight:700,color:"#00E5A0"},children:o.team_name}),e.jsx("p",{style:{margin:"2px 0 0",fontSize:13,color:"rgba(255,255,255,0.45)"},children:o.org_name})]}),e.jsxs("p",{style:{margin:"0 0 20px",fontSize:13,color:"rgba(255,255,255,0.55)"},children:["Crea tu contraseña para activar tu cuenta con el email"," ",e.jsx("strong",{style:{color:"#00E5A0"},children:o.email})]}),e.jsxs("form",{onSubmit:S,children:[e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"rgba(255,255,255,0.5)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Nombre completo"}),e.jsx("input",{type:"text",value:u,onChange:q=>m(q.target.value),placeholder:"Tu nombre",autoFocus:!0,style:{width:"100%",padding:"12px 14px",background:"rgba(255,255,255,0.04)",border:`1px solid ${y.fullName?"#FF4757":"rgba(255,255,255,0.1)"}`,borderRadius:10,color:"#fff",fontSize:14,outline:"none",boxSizing:"border-box"}}),y.fullName&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"#FF4757"},children:y.fullName})]}),e.jsxs("div",{style:{marginBottom:16},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"rgba(255,255,255,0.5)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Contraseña"}),e.jsx("input",{type:"password",value:p,onChange:q=>x(q.target.value),placeholder:"MÃnimo 8 caracteres",style:{width:"100%",padding:"12px 14px",background:"rgba(255,255,255,0.04)",border:`1px solid ${y.password?"#FF4757":"rgba(255,255,255,0.1)"}`,borderRadius:10,color:"#fff",fontSize:14,outline:"none",boxSizing:"border-box"}}),y.password&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"#FF4757"},children:y.password})]}),e.jsxs("div",{style:{marginBottom:24},children:[e.jsx("label",{style:{display:"block",fontSize:12,color:"rgba(255,255,255,0.5)",marginBottom:6,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Confirmar contraseña"}
607),e.jsx("input",{type:"password",value:v,onChange:q=>f(q.target.value),placeholder:"Repite la contraseña",style:{width:"100%",padding:"12px 14px",background:"rgba(255,255,255,0.04)",border:`1px solid ${y.confirmPassword?"#FF4757":"rgba(255,255,255,0.1)"}`,borderRadius:10,color:"#fff",fontSize:14,outline:"none",boxSizing:"border-box"}}),y.confirmPassword&&e.jsx("p",{style:{margin:"4px 0 0",fontSize:12,color:"#FF4757"},children:y.confirmPassword})]}),c&&e.jsx("p",{style:{margin:"0 0 16px",fontSize:13,color:"#FF4757",textAlign:"center"},children:c}),e.jsx("button",{type:"submit",disabled:h,style:{width:"100%",padding:"14px",background:h?"rgba(0,229,160,0.4)":"linear-gradient(135deg,#00E5A0,#00B4D8)",border:"none",borderRadius:12,color:"#0A0A0F",fontWeight:700,fontSize:15,cursor:h?"not-allowed":"pointer"},children:h?"Uniéndomeâ¦":"Unirme al equipo"})]}),e.jsxs("p",{style:{margin:"20px 0 0",textAlign:"center",fontSize:12,color:"rgba(255,255,255,0.3)"},children:["¿Ya tienes cuenta?"," ",e.jsx("a",{href:"/login",style:{color:"rgba(0,229,160,0.7)",textDecoration:"none"},children:"Inicia sesión"})," ","y la invitación se aplicará automáticamente."]})]}),s==="success"&&e.jsxs("div",{style:{textAlign:"center"},children:[e.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:64,height:64,borderRadius:"50%",background:"rgba(0,229,160,0.1)",border:"1px solid rgba(0,229,160,0.3)",marginBottom:20,fontSize:28},children:"â"}),e.jsx("h2",{style:{margin:"0 0 8px",fontSize:20,fontWeight:700,color:"#fff"},children:"¡Bienvenido al equipo!"}),e.jsx("p",{style:{margin:"0 0 4px",fontSize:15,color:"#00E5A0",fontWeight:600},children:(o==null?void 0:o.team_name)||((_=o==null?void 0:o.user)==null?void 0:_.team_name)}),e.jsx("p",{style:{margin:"0 0 24px",fontSize:13,color:"rgba(255,255,255,0.5)"},children:(o==null?void 0:o.org_name)||((D=o==null?void 0:o.user)==null?void 0:D.org_name)}),e.jsx("div",{style:{textAlign:"left",background:"rgba(0,180,216,0.05)",border:"1px solid rgba(0,180,216,0.18)",borderRadius:12,padding:"16px 18px",marginBottom:24},children:e.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:10,cursor:N?"wait":"pointer"},children:[e.jsx("input",{type:"checkbox",checked:F,disabled:N,onChange:q=>z(q.target.checked),style:{marginTop:2,width:18,height:18,accentColor:"#00B4D8",cursor:"inherit",flexShrink:0}}),e.jsxs("span",{children:[e.jsxs("span",{style:{display:"block",fontSize:14,fontWeight:600,color:"#fff",marginBottom:4},children:["Compartir mis estadÃsticas con el equipo"," ",e.jsx("span",{style:{color:"rgba(255,255,255,0.4)",fontWeight:400},children:"(opcional)"})]}),e.jsxs("span",{style:{display:"block",fontSize:12.5,color:"rgba(255,255,255,0.55)",lineHeight:1.55},children:["Tu responsable solo verá métricas"," ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.8)"},children:"agregadas y anónimas"})," del equipo (volumen de práctica y técnicas más usadas; las medias de puntuación, solo a partir de 5 personas). ",e.jsx("strong",{style:{color:"rgba(255,255,255,0.8)"},children:"No puede identificarte"})," ","ni ver tus puntuaciones, grabaciones ni conversaciones individuales. Puedes cambiarlo cuando quieras desde tu perfil."]}),w&&e.jsx("span",{style:{display:"block",marginTop:8,fontSize:12,color:w.ok?"#00E5A0":"#FF4757"},children:w.text})]})]})}),e.jsx("button",{onClick:()=>a("/"),style:{background:"linear-gradient(135deg,#00E5A0,#00B4D8)",border:"none",borderRadius:12,padding:"13px 32px",color:"#0A0A0F",fontWeight:700,fontSize:15,cursor:"pointer"},children:"Empezar a entrenar"})]})]})})}const gf=["gmail.com","googlemail.com","yahoo.com","yahoo.es","hotmail.com","hotmail.es","outlook.com","live.com","icloud.com","me.com","mac.com","aol.com","protonmail.com","proton.me"],qa=[{value:"team_monthly",label:"Mensual",pricePerSeat:39.9,period:"mes",periodShort:"mes"},{value:"team_quarterly",label:"Trimestral",pricePerSeat:119.7,period:"3 meses",periodShort:"trim."}];function fr(t){return t.toLocaleString("es-ES",{minimumFractionDigits:2,maximumFractionDigits:2})}function bf(t){var r;if(!t)return!1;const a=((r=t.split("@")[1])==null?void 0:r.toLowerCase())??"";return gf.includes(a)}function hf({current:t,total:a}){return e.jsx("div",{className:"flex items-center gap-2 mb-8",children:Array.from({length:a},(r,s)=>{const n=s+1,o=n<t,l=n===t;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-bold transition-all duration-300",style:{background:o?"#00E5A0":l?"linear-gradient(135deg, #00E5A0, #00B4D8)":"rgba(255,255,255,0.06)",border:l||o?"none":"1px solid rgba(255,255,255,0.12)",color:o||l?"#0A0A0F":"rgba(255,255,255,0.35)",fontFamily:"'JetBrains Mono', monospace"},children:o?e.jsx(J,{icon:Cr,style:{fontSize:12}}):n}),n<a&&e.jsx("div",{className:"h-px w-8",style:{background:o?"#00E5A0":"rgba(255,255,255,0.1)",transition:"background 0.3s"}})]},n)})})}function yf({message:t}){return t?e.jsxs("div",{role:"alert",className:"rounded-xl px-5 py-4 mb-6 flex items-start gap-3",style:{background:"rgba(255,71,87,0.06)",border:"1px solid rgba(255,71,87,0.2)",color:"#FF4757",fontSize:14},children:[e.jsx(J,{icon:Vs,style:{marginTop:2,flexShrink:0},"aria-hidden":"true"}),e.jsx("span",{children:t})]}):null}function vf({email:t,onContinue:a}){const r=bf(t);return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Comprueba tu email corporativo"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Las cuentas de organización requieren un email corporativo."})]}),e.jsxs("div",{className:"rounded-xl px-5 py-4 flex items-center gap-3",style:{background:"rgba(255,255,255,0.025)",border:"1px solid rgba(255,255,255,0.08)"},children:[e.jsx(J,{icon:C0,style:{color:"rgba(255,255,255,0.4)",flexShrink:0},"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs mb-0.5",style:{color:"rgba(255,255,255,0.45)"},children:"Tu email actual"}),e.jsx("p",{className:"text-sm font-semibold",style:{color:"white"},children:t})]})]}),r?e.jsxs("div",{className:"rounded-xl px-5 py-5 flex flex-col gap-3",style:{background:"rgba(255,184,0,0.05)",border:"1px solid rgba(255,184,0,0.2)"},children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(J,{icon:Vs,style:{color:"#FFB800",marginTop:2,flexShrink:0},"aria-hidden":"true"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-semibold mb-1",style:{color:"#FFB800"},children:"Email personal detectado"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:"Para crear una organización necesitas un email corporativo (sin gmail, yahoo, hotmail, etc.). Por favor, contacta con soporte para vincular tu email corporativo a tu cuenta."})]})]}),e.jsx("a",{href:"mailto:[email protected]?subject=Solicitud%20cuenta%20corporativa",className:"self-start text-sm font-semibold px-4 py-2 rounded-lg transition-colors duration-200",style:{background:"rgba(255,184,0,0.1)",border:"1px solid rgba(255,184,0,0.25)",color:"#FFB800",textDecoration:"none"},children:"Contactar soporte"})]}):e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"rounded-xl px-5 py-4 flex items-center gap-3",style:{background:"rgba(0,229,160,0.04)",border:"1px solid rgba(0,229,160,0.15)"},children:[e.jsx(J,{icon:Cr,style:{color:"#00E5A0",flexShrink:0},"aria-hidden":"true"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.75)"},children:"Tu email parece corporativo. Puedes continuar con la creación de la organización."})]}),e.jsxs("button",{onClick:a,className:"flex items-center justify-center gap-2 w-full py-3 rounded-xl text-sm font-bold transition-all duration-200",style:{background:"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:"pointer"},children:["Continuar",e.jsx(J,{icon:Za,style:{fontSize:12},"aria-hidden":"true"})]})]})]})}function jf({form:t,onChange:a,onContinue:r,onBack:s}){const n=qa.find(d=>d.value===t.plan)??qa[0],o=Math.max(2,parseInt(t.seat_count,10)||2),l=n.pricePerSeat*o,c=d=>{d.preventDefault(),t.org_name.trim()&&r()};return e.jsxs("form",{onSubmit:c,className:"flex flex-col gap-6",noValidate:!0,children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Configura tu organización"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Introduce los datos de tu empresa y elige el plan que mejor se adapte a tu equipo."})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{htmlFor:"org_name",className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:"Nombre de la empresa"}),e.jsx("input",{id:"org_name",type:"text",required:!0,value:t.org_name,onChange:d=>
607a("org_name",d.target.value),placeholder:"Acme S.L.",className:"w-full px-4 py-3 rounded-xl text-sm outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontFamily:"inherit"},onFocus:d=>{d.currentTarget.style.border="1px solid rgba(0,229,160,0.35)"},onBlur:d=>{d.currentTarget.style.border="1px solid rgba(255,255,255,0.1)"}})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("label",{htmlFor:"plan",className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:"Plan"}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-3",children:qa.map(d=>{const u=t.plan===d.value;return e.jsxs("button",{type:"button",onClick:()=>a("plan",d.value),className:"flex-1 rounded-xl px-4 py-4 text-left transition-all duration-200",style:{background:u?"rgba(0,229,160,0.06)":"rgba(255,255,255,0.025)",border:`1px solid ${u?"rgba(0,229,160,0.3)":"rgba(255,255,255,0.08)"}`,cursor:"pointer"},children:[e.jsx("p",{className:"text-sm font-bold mb-0.5",style:{color:u?"#00E5A0":"rgba(255,255,255,0.85)"},children:d.label}),e.jsxs("p",{className:"text-xs",style:{color:"rgba(255,255,255,0.5)"},children:[fr(d.pricePerSeat)," ⬠/ miembro / ",d.period]})]},d.value)})})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("label",{htmlFor:"seat_count",className:"text-xs font-semibold uppercase tracking-widest",style:{color:"rgba(255,255,255,0.55)",fontFamily:"'JetBrains Mono', monospace"},children:["Número de miembros",e.jsx("span",{className:"ml-2 normal-case font-normal",style:{color:"rgba(255,255,255,0.35)",fontFamily:"inherit",fontSize:11},children:"(incluido el responsable)"})]}),e.jsx("input",{id:"seat_count",type:"number",min:2,max:500,required:!0,value:t.seat_count,onChange:d=>a("seat_count",d.target.value),className:"w-full px-4 py-3 rounded-xl text-sm outline-none transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",color:"white",fontFamily:"'JetBrains Mono', monospace"},onFocus:d=>{d.currentTarget.style.border="1px solid rgba(0,229,160,0.35)"},onBlur:d=>{d.currentTarget.style.border="1px solid rgba(255,255,255,0.1)"}})]}),e.jsxs("div",{className:"rounded-xl px-5 py-4 flex items-center justify-between",style:{background:"rgba(0,229,160,0.04)",border:"1px solid rgba(0,229,160,0.12)"},children:[e.jsxs("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.65)"},children:[o," miembro",o!==1?"s":""," à ",fr(n.pricePerSeat)," â¬"]}),e.jsxs("p",{className:"text-lg font-bold",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:[fr(l)," ⬠/ ",n.period]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-2 px-5 py-3 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.6)",cursor:"pointer"},children:[e.jsx(J,{icon:ui,style:{fontSize:12},"aria-hidden":"true"}),"Volver"]}),e.jsxs("button",{type:"submit",disabled:!t.org_name.trim()||o<2,className:"flex-1 flex items-center justify-center gap-2 py-3 rounded-xl text-sm font-bold transition-all duration-200",style:{background:!t.org_name.trim()||o<2?"rgba(0,229,160,0.2)":"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:!t.org_name.trim()||o<2?"not-allowed":"pointer",opacity:!t.org_name.trim()||o<2?.6:1},children:["Continuar",e.jsx(J,{icon:Za,style:{fontSize:12},"aria-hidden":"true"})]})]})]})}function Nf({form:t,loading:a,error:r,onPay:s,onBack:n}){const o=qa.find(d=>d.value===t.plan)??qa[0],l=Math.max(2,parseInt(t.seat_count,10)||2),c=o.pricePerSeat*l;return e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold mb-2",style:{fontFamily:"'Playfair Display', serif"},children:"Revisa y confirma"}),e.jsx("p",{className:"text-sm",style:{color:"rgba(255,255,255,0.55)"},children:"Serás redirigido a Stripe para completar el pago de forma segura."})]}),e.jsx(yf,{message:r}),e.jsx("div",{className:"rounded-2xl p-6 flex flex-col gap-4",style:{background:"rgba(255,255,255,0.025)",border:"1px solid rgba(255,255,255,0.08)"},children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:"Organización"}),e.jsx("span",{className:"text-sm font-semibold",style:{color:"white"},children:t.org_name})]}),e.jsx("div",{className:"h-px",style:{background:"rgba(255,255,255,0.05)"}}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:"Plan"}),e.jsxs("span",{className:"text-sm font-semibold",style:{color:"white"},children:["Teams ",o.label]})]}),e.jsx("div",{className:"h-px",style:{background:"rgba(255,255,255,0.05)"}}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:"Miembros"}),e.jsx("span",{className:"text-sm font-semibold",style:{color:"white",fontFamily:"'JetBrains Mono', monospace"},children:l})]}),e.jsx("div",{className:"h-px",style:{background:"rgba(255,255,255,0.05)"}}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-xs uppercase tracking-widest",style:{color:"rgba(255,255,255,0.45)",fontFamily:"'JetBrains Mono', monospace"},children:"Total"}),e.jsxs("span",{className:"text-xl font-bold",style:{color:"#00E5A0",fontFamily:"'JetBrains Mono', monospace"},children:[fr(c)," ⬠/ ",o.period]})]})]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("button",{type:"button",onClick:n,disabled:a,className:"flex items-center gap-2 px-5 py-3 rounded-xl text-sm font-semibold transition-all duration-200",style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",color:"rgba(255,255,255,0.6)",cursor:a?"not-allowed":"pointer",opacity:a?.5:1},children:[e.jsx(J,{icon:ui,style:{fontSize:12},"aria-hidden":"true"}),"Volver"]}),e.jsxs("button",{onClick:s,disabled:a,className:"flex-1 flex items-center justify-center gap-2 py-3 rounded-xl text-sm font-bold transition-all duration-200",style:{background:a?"rgba(0,229,160,0.3)":"linear-gradient(135deg, #00E5A0, #00B4D8)",color:"#0A0A0F",border:"none",cursor:a?"not-allowed":"pointer",opacity:a?.7:1},children:[a?"Redirigiendo a Stripeâ¦":"Pagar con Stripe",!a&&e.jsx(J,{icon:Za,style:{fontSize:12},"aria-hidden":"true"})]})]}),e.jsx("p",{className:"text-xs text-center",style:{color:"rgba(255,255,255,0.3)"},children:"Pago seguro gestionado por Stripe. NeuralPitch no almacena datos de tarjeta."})]})}function wf(){const{user:t}=Ge(),a=he(),[r,s]=i.useState(1),[n,o]=i.useState({org_name:"",plan:"team_monthly",seat_count:"5"}),[l,c]=i.useState(!1),[d,u]=i.useState(null),m=(x,v)=>{o(f=>({...f,[x]:v}))},p=async()=>{u(null),c(!0);const x=Math.max(2,parseInt(n.seat_count,10)||2);try{const v=await R.post("/api/billing/create-org-checkout",{plan:n.plan,seat_count:x,org_name:n.org_name.trim(),success_url:`${window.location.origin}/team?org_created=1`,cancel_url:`${window.location.origin}/create-organization`});window.location.href=v.checkout_url}catch(v){const f=(v==null?void 0:v.message)??"";f.toLowerCase().includes("email")||(v==null?void 0:v.status)===422?u("El email asociad
607o a tu cuenta no es un email corporativo válido. Por favor, contacta con soporte en [email protected] para vincular tu email corporativo."):u(f||"No se pudo iniciar el proceso de pago. Inténtalo de nuevo."),c(!1)}};return e.jsxs("div",{className:"max-w-xl mx-auto px-4 py-8 flex flex-col gap-6",style:{animation:"fadeSlideUp 0.4s both"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center flex-shrink-0",style:{background:"rgba(0,229,160,0.08)",border:"1px solid rgba(0,229,160,0.2)"},children:e.jsx(J,{icon:Ha,style:{color:"#00E5A0",fontSize:16},"aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",style:{fontFamily:"'Playfair Display', serif"},children:"Crear organización"}),e.jsx("p",{className:"text-sm mt-0.5",style:{color:"rgba(255,255,255,0.45)"},children:"NeuralPitch Teams para equipos de ventas"})]})]}),e.jsx(hf,{current:r,total:3}),e.jsxs("div",{className:"rounded-2xl p-6",style:{background:"rgba(255,255,255,0.025)",border:"1px solid rgba(255,255,255,0.08)"},children:[r===1&&e.jsx(vf,{email:(t==null?void 0:t.email)??"",onContinue:()=>s(2)}),r===2&&e.jsx(jf,{form:n,onChange:m,onContinue:()=>s(3),onBack:()=>s(1)}),r===3&&e.jsx(Nf,{form:n,loading:l,error:d,onPay:p,onBack:()=>s(2)})]}),e.jsx("button",{onClick:()=>a("/billing"),className:"self-start text-sm mt-2 transition-colors duration-150",style:{background:"none",border:"none",color:"rgba(255,255,255,0.35)",cursor:"pointer",padding:0},onMouseEnter:x=>{x.currentTarget.style.color="rgba(255,255,255,0.7)"},onMouseLeave:x=>{x.currentTarget.style.color="rgba(255,255,255,0.35)"},children:"Volver a facturación"})]})}function kf(){const t=he(),a=Ct();return i.useEffect(()=>{function r(){t("/voice-consent",{state:{from:a.pathname},replace:!1})}return window.addEventListener("neuralpitch:consent-required",r),()=>window.removeEventListener("neuralpitch:consent-required",r)},[t,a.pathname]),null}function Sf(){return i.useEffect(()=>{_s()},[]),e.jsx(ac,{children:e.jsx(rc,{children:e.jsxs(sc,{children:[e.jsx(Yo,{}),e.jsx(kf,{}),e.jsx(gc,{}),e.jsxs(Di,{children:[e.jsx(Ne,{path:"/login",element:e.jsx(bc,{})}),e.jsx(Ne,{path:"/register",element:e.jsx(jc,{})}),e.jsx(Ne,{path:"/verify-email",element:e.jsx(yp,{})}),e.jsx(Ne,{path:"/transparencia",element:e.jsx(Bp,{})}),e.jsx(Ne,{path:"/invite/:token",element:e.jsx(xf,{})}),e.jsx(Ne,{path:"/politica-privacidad",element:e.jsx(om,{})}),e.jsx(Ne,{path:"/skills",element:e.jsx(bm,{})}),e.jsx(Ne,{path:"/skills/d/:token",element:e.jsx(ym,{})}),e.jsx(Ne,{path:"/",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(v2,{})})})}),e.jsx(Ne,{path:"/prepare/:id",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(w2,{})})})}),e.jsx(Ne,{path:"/record/:id",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(E2,{})})})}),e.jsx(Ne,{path:"/results/:sessionId",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(H2,{})})})}),e.jsx(Ne,{path:"/history",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(tm,{})})})}),e.jsx(Ne,{path:"/privacy",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(rm,{})})})}),e.jsx(Ne,{path:"/profile",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(Nm,{})})})}),e.jsx(Ne,{path:"/custom-practice",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(Vm,{})})})}),e.jsx(Ne,{path:"/biblioteca",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(ep,{})})})}),e.jsx(Ne,{path:"/entrenador",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(Pp,{})})})}),e.jsx(Ne,{path:"/billing",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(bp,{})})})}),e.jsx(Ne,{path:"/admin/review",element:e.jsx(pn,{children:e.jsx(Xe,{children:e.jsx(ip,{})})})}),e.jsx(Ne,{path:"/admin/enhance/:techniqueId/:scriptIndex",element:e.jsx(pn,{children:e.jsx(Xe,{children:e.jsx(cp,{})})})}),e.jsx(Ne,{path:"/team",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(Vp,{})})})}),e.jsx(Ne,{path:"/sparring",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(cf,{})})})}),e.jsx(Ne,{path:"/sparring/result/:sessionId",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(mf,{})})})}),e.jsx(Ne,{path:"/llamadas",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(ff,{})})})}),e.jsx(Ne,{path:"/create-organization",element:e.jsx(at,{children:e.jsx(Xe,{children:e.jsx(wf,{})})})}),e.jsx(Ne,{path:"/voice-consent",element:e.jsx(at,{children:e.jsx(Rp,{})})}),e.jsx(Ne,{path:"*",element:e.jsx(yr,{to:"/",replace:!0})})]})]})})})}Oo(document.getElementById("root")).render(e.jsx(i.StrictMode,{children:e.jsx($i,{children:e.jsx(Sf,{})})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.