PageSourceSearch

https://k-e.ai/_next/static/chunks/app/onboarding/page-6619459bfd37a686.js

js k-e.ai collected 2026-10-05 12:16:38 UTC 44,176 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9566],{651:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>v});var t=i(5155),o=i(2115),s=i(63),r=i(1495),a=i(8200),l=i(5743),c=i(8900),d=i(9520),p=i(5113),x=i(1047);function f(){var e;let{required:n=!1,channelReady:i,platformMessage:s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[a,l]=(0,o.useState)(!1),[d,x]=(0,o.useState)(""),f=(0,r.n_)(c.FH.integrations.connections.startChannelLink),u=(0,r.IT)(c.FH.integrations.connections.channelLinkStatus,{provider:"whatsapp_keai_channel"}),h=async()=>{if(!0===i){x(""),l(!0);try{await f({provider:"whatsapp_keai_channel"})}catch(e){x(String(e instanceof Error?e.message:e).slice(0,160))}}},g=(null==u?void 0:u.status)==="active",m=a&&(null==u?void 0:u.status)==="pending"&&!0===i;return(0,t.jsxs)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:11px;padding:12px 13px;margin-bottom:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;gap:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:11px;min-width:0;"),children:[(0,t.jsx)("span",{style:(0,p.s)("width:30px;height:30px;border-radius:8px;background:#25d366;flex:none;display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;"),children:"W"}),(0,t.jsxs)("div",{style:(0,p.s)("min-width:0;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:7px;"),children:["WhatsApp con keai",!g&&!0===i&&(0,t.jsx)("span",{style:(0,p.s)("font-size:10px;font-weight:600;color:#8a6d1a;background:#faf3dd;padding:1px 6px;border-radius:5px;flex:none;"),children:n?"Requerida":"Recomendada"})]}),(0,t.jsx)("div",{style:(0,p.s)("font-size:12px;color:#8c887e;"),children:!1===i?null!=s?s:"Canal temporalmente no disponible":"Escribile a tu asistente por WhatsApp"})]})]}),g&&!0===i?(0,t.jsxs)("span",{style:(0,p.s)("display:flex;align-items:center;gap:6px;font-size:12px;color:#1fa463;font-weight:600;flex:none;"),children:[(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#1fa463",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m5 12 5 5 9-10"})}),"Vinculado",(null==u?void 0:u.peerNumber)?" \xb7 +".concat(u.peerNumber):""]}):!0!==i?(0,t.jsx)("span",{style:(0,p.s)("font-size:12px;color:#a06a16;font-weight:600;flex:none;white-space:nowrap;"),children:void 0===i?"Comprobando…":"No disponible"}):(0,t.jsx)("button",{onClick:h,style:(0,p.s)("background:#1d1c19;border:none;border-radius:9px;padding:8px 14px;font-size:13px;font-weight:500;color:#fff;cursor:pointer;white-space:nowrap;flex:none;"),children:"Vincular"})]}),m&&(0,t.jsxs)("div",{style:(0,p.s)("margin-top:12px;padding-top:12px;border-top:1px solid #f3f1eb;display:flex;flex-direction:column;gap:10px;"),children:[(null==u?void 0:u.keaiNumber)&&(null==u?void 0:u.code)&&(0,t.jsx)("a",{href:"https://wa.me/".concat(u.keaiNumber,"?text=").concat(encodeURIComponent(u.code)),target:"_blank",rel:"noopener noreferrer",style:(0,p.s)("align-self:flex-start;display:flex;align-items:center;gap:7px;background:#0e7a50;color:#fff;border-radius:10px;padding:9px 14px;font-size:13px;font-weight:600;text-decoration:none;"),children:"Abrir WhatsApp con el c\xf3digo listo →"}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:10px;flex-wrap:wrap;"),children:[(0,t.jsx)("span",{style:(0,p.s)("font-size:12px;color:#8c887e;"),children:(null==u?void 0:u.keaiNumber)?(0,t.jsxs)(t.Fragment,{children:["O escribile a ",(0,t.jsxs)("b",{children:["+",u.keaiNumber]})," este c\xf3digo:"]}):"Mand\xe1 este c\xf3digo al n\xfamero de keai:"}),(0,t.jsx)("span",{style:(0,p.s)("font-family:'Roboto Mono',monospace;font-size:17px;font-weight:700;letter-spacing:3px;background:#f4f3ee;border:1px solid #e7e5dd;border-radius:8px;padding:5px 10px;"),children:null!=(e=null==u?void 0:u.code)?e:"……"})]}),(0,t.jsx)("div",{style:(0,p.s)("font-size:11.5px;color:#a3a097;line-height:1.45;"),children:"El c\xf3digo prueba que el tel\xe9fono es tuyo. Esta tarjeta se actualiza sola cuando llegue tu mensaje."})]}),a&&!u&&!0===i&&(0,t.jsx)("div",{style:(0,p.s)("margin-top:10px;font-size:12px;color:#a3a097;"),children:"Preparando…"}),d&&(0,t.jsx)("div",{style:(0,p.s)("margin-top:8px;font-size:12px;color:#d6492f;"),children:d})]})}let u=[{value:"America/Bogota",label:"Am\xe9rica/Bogot\xe1"},{value:"America/Mexico_City",label:"Am\xe9rica/M\xe9xico"},{value:"America/Lima",label:"Am\xe9rica/Lima"},{value:"America/Santiago",label:"Am\xe9rica/Santiago"}],h=[{value:"directo, decidido y eficiente",label:"directo"},{value:"c\xe1lido y cercano",label:"c\xe1lido"},{value:"conciso y al grano",label:"conciso"},{value:"juguet\xf3n y con chispa",label:"juguet\xf3n"},{value:"anal\xedtico y meticuloso",label:"anal\xedtico"}],g={opening:0,connect:1,identity:2,profile:3,reveal:4},m=Object.fromEntries(Object.entries(g).map(e=>{let[n,i]=e;return[i,n]}));function y(e){var n,i,s,d;let{onComplete:y}=e,v=(0,x.a)(),[b,j]=(0,o.useState)(0),[w,k]=(0,o.useState)("Spok"),[z,C]=(0,o.useState)("America/Bogota"),[S,E]=(0,o.useState)(u),[L,_]=(0,o.useState)(h[0].value),A=(0,r.IT)(c.FH.users.users.me),I=(0,r.IT)(c.FH.integrations.connections.statusMine),T=(0,r.IT)(c.FH.integrations.connections.coreSourceStatusMine),H=(null!=I?I:[]).some(e=>"gmail"===e.provider&&"active"===e.status),M=(null!=I?I:[]).some(e=>"googlecalendar"===e.provider&&"active"===e.status),R=(null!=I?I:[]).some(e=>"outlook"===e.provider&&"active"===e.status),F=(null!=I?I:[]).some(e=>"outlook"===e.provider&&"active"===e.status&&!!e.verifiedAt),N=null!=(n=null==T?void 0:T.mail.ready)&&n,W=null!=(i=(0,r.IT)(c.FH.integrations.connections.hasAnyMine))&&i,U=null!=(s=null==T?void 0:T.ready)&&s;(0,o.useEffect)(()=>{U&&en("")},[U]);let B=[!(null==T?void 0:T.mail.ready)?"Correo":null,!(null==T?void 0:T.calendar.ready)?"Calendario":null].filter(
1Boolean),P=(0,r.IT)(c.FH.onboarding.profile.profileSummary),q=(0,r.y3)(c.FH.integrations.composio.startConnect),O=(0,r.y3)(c.FH.integrations.runner.syncAccounts),G=(0,r.y3)(c.FH.integrations.verify.verifyProvider),D=(0,r.y3)(c.FH.integrations.bridgeWatch.availability),Z=(0,r.y3)(c.FH.engines.profileBuilder.run),V=(0,r.y3)(c.FH.engines.feed.runIfFresh),K=(0,r.n_)(c.FH.onboarding.analytics.track),Q=(e,n,i)=>{K({step:e,event:n,meta:i}).catch(()=>{})},Y=(0,l.L4)(),{signOut:X}=(0,l.BG)();(0,o.useEffect)(()=>{try{let e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(!e)return;E(n=>n.some(n=>n.value===e)?n:[{value:e,label:e.replace(/_/g," ")},...n]),C(e)}catch(e){}},[]);let[J,$]=(0,o.useState)(""),[ee,en]=(0,o.useState)(""),[ei,et]=(0,o.useState)(""),[eo,es]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=!0,n=()=>{D().then(n=>{e&&es(n)}).catch(()=>{e&&es({estado:"no_disponible",bridgeReady:!1,channelReady:!1,mensaje:"WhatsApp est\xe1 temporalmente no disponible. Pod\xe9s continuar y conectarlo m\xe1s tarde."})})};n();let i=window.setInterval(n,6e4);return()=>{e=!1,window.clearInterval(i)}},[D]),(0,o.useEffect)(()=>{let e=new URLSearchParams(window.location.search);if("connected"===e.get("google")||e.get("connected")){let e=sessionStorage.getItem("ke_onb_step");j(e?Number(e):g.connect),sessionStorage.removeItem("ke_onb_step"),window.history.replaceState({},"",window.location.pathname)}},[]);let[er,ea]=(0,o.useState)(new Set);(0,o.useEffect)(()=>{let e=[];
1if(H&&!er.has("gmail")&&e.push("gmail"),M&&!er.has("googlecalendar")&&e.push("googlecalendar"),!R||F||er.has("outlook")||e.push("outlook"),e.length)for(let n of(ea(n=>new Set([...n,...e])),e))G({provider:n}).then(e=>{var i,t,o;if(e.ok)return void Q("connect","connect_verified",{provider:n,label:null!=(i=e.accountLabel)?i:null});en("La cuenta de ".concat(n," figura conectada, pero todav\xeda no pudimos leerla: ").concat(null!=(t=e.error)?t:"probe fallido")),Q("connect","connect_probe_error",{provider:n,error:null!=(o=e.error)?o:"probe fallido"}),setTimeout(()=>ea(e=>{let i=new Set(e);return i.delete(n),i}),1e4)}).catch(e=>{en("No pudimos verificar ".concat(n,": ").concat(String(e).slice(0,140))),setTimeout(()=>ea(e=>{let i=new Set(e);return i.delete(n),i}),1e4)})},[H,M,R,F,er]);let el=(0,o.useRef)(!1),ec=(0,o.useCallback)(()=>{if(!el.current){if((null==P?void 0:P.hasProfile)||(null==P?void 0:P.building)){el.current=!0;return}el.current=!0,Z({max:15,trigger:"onboarding"}).catch(()=>{}),V().catch(()=>{})}},[P]);async function ed(e){let n=function(e){let n=e.open("about:blank","_blank");return n&&(n.opener=null),{navigate(i){let t=new URL(i);if("https:"!==t.protocol)throw Error("El enlace de conexi\xf3n no es seguro.");return n&&!n.closed?(n.location.replace(t.href),"popup"):(e.location.assign(t.href),"redirect")},close(){n&&!n.closed&&n.close()}}}(window);$(e),en(""),et(""),Q("connect","connect_start",{provider:e});try{let i=await q({provider:e,callbackUrl:"".concat(window.location.origin,"/onboarding?connected=").concat(encodeURIComponent(e))});if(!(null==i?void 0:i.connectLinkUrl))throw Error("No recibimos el enlace para conectar. Volv\xe9 a intentarlo.");if(sessionStorage.setItem("ke_onb_step",String(g.connect)),"redirect"===n.navigate(i.connectLinkUrl))return;let t=!1;for(let n=0;n<20;n++){await new Promise(e=>setTimeout(e,3e3));try{let n=await O({provider:e});if(null==n?void 0:n.synced){t=!0;break}}catch(e){}}t?Q("connect","connect_ok",{provider:e}):et(e)}catch(t){n.close();let i=String(t instanceof a.ik?t.data:t instanceof Error?t.message:t).slice(0,220);en(i),Q("connect","connect_error",{provider:e,error:i})}finally{$("")}}(0,o.useEffect)(()=>{N&&ec()},[N,ec]),(0,o.useEffect)(()=>{b===g.profile&&W&&(null==A?void 0:A._id)&&ec()},[b,W,A,ec]);let[ep,ex]=(0,o.useState)(!1);async function ef(){if((null==eo?void 0:eo.bridgeReady)!==!0){var e;en(null!=(e=null==eo?void 0:eo.mensaje)?e:"Estamos comprobando WhatsApp — reintent\xe1 en unos segundos.");return}if(!Y)return void en("Sesi\xf3n no lista — reintent\xe1 en unos segundos.");ex(!0),en(""),Q("connect","connect_start",{provider:"whatsapp_personal_wacli"});try{let e=async e=>{var n;let i=await fetch("/api/integrations/whatsapp-personal/".concat(e),{method:"POST",headers:{authorization:"Bearer ".concat(Y)}}
1),t=await i.json().catch(()=>({}));if(!i.ok)throw Error(String(null!=(n=null==t?void 0:t.error)?n:"HTTP ".concat(i.status)));return t},n=await e("start");(null==n?void 0:n.connectLinkUrl)&&window.open(n.connectLinkUrl,"_blank","noopener,noreferrer");for(let n=0;n<20;n++){await new Promise(e=>setTimeout(e,3e3));try{let n=await e("sync");if(null==n?void 0:n.synced){Q("connect","connect_ok",{provider:"whatsapp_personal_wacli"});break}}catch(e){}}}catch(n){let e=String(n instanceof Error?n.message:n).slice(0,180);en(e),Q("connect","connect_error",{provider:"whatsapp_personal_wacli",error:e})}finally{ex(!1)}}let eu=e=>(null!=I?I:[]).some(n=>n.provider===e&&"active"===n.status),eh=e=>{var n,i;return null!=(i=null==(n=(null!=I?I:[]).find(n=>n.provider===e&&"active"===n.status))?void 0:n.accountLabel)?i:null};(0,o.useEffect)(()=>{J&&eu(J)&&($(""),et("")),ei&&eu(ei)&&et("")},[I,J,ei]);let eg=()=>(function(e){var n;if(b!==g.connect||U){if(Q(null!=(n=m[b])?n:String(b),"skip"===e?"step_skip":"step_next"),b>=g.reveal){Q("reveal","finish",{}),y({agentName:w,timezone:z,vibe:L});return}j(b+1)}})("next"),em=Array.from({length:5},(e,n)=>({bg:n<=b?"#1d1c19":"#d8d5cc"})),ey={[g.opening]:"",[g.connect]:"Conecta tus\nfuentes.",[g.identity]:"Conoce a tu\nasistente.",[g.profile]:"Esto es lo que\nsabemos de ti",[g.reveal]:""},ev={[g.connect]:"Aprende sobre Conexiones ↗",[g.identity]:"Aprende sobre tu asistente ↗",[g.profile]:"Aprende sobre Perfiles ↗"},eb={[g.opening]:"Empecemos",[g.connect]:U?"Continuar":"Te falta: ".concat(B.join(" \xb7 ")),[g.identity]:"Confirmar "+w,[g.profile]:"Continuar"},ej=b===g.connect&&!U,ew=b===g.reveal?"#e7ecdb":"#f3f2ec",ek=ey[b]||"",ez=ev[b]||"",eC=b===g.reveal,eS=b!==g.reveal,eE=eb[b]||"Continuar",eL=null!=(d=null==A?void 0:A.email)?d:null,e_=e=>(0,t.jsxs)("li",{children:["Por determinar.",e?(0,t.jsxs)("span",{style:(0,p.s)("font-style:italic;color:#8c887e;"),children:[" ",e]}):null]});return(0,t.jsxs)("div",{style:(0,p.s)("position:relative;min-height:100dvh;width:100%;background:".concat(ew,";overflow:hidden;")),children:[(0,t.jsx)("h1",{className:"eia-serif",style:(0,p.s)(v?"position:absolute;top:16px;left:18px;right:18px;margin:0;font-weight:600;font-size:24px;line-height:1.05;letter-spacing:-0.01em;color:#1d1c19;max-width:none;white-space:pre-line;z-index:2;":"position:absolute;top:34px;left:36px;margin:0;font-weight:600;font-size:40px;line-height:1.02;letter-spacing:-0.01em;color:#1d1c19;max-width:420px;white-space:pre-line;z-index:2;"),children:ek}),(0,t.jsxs)("div",{style:(0,p.s)("position:absolute;bottom:24px;left:36px;display:flex;align-items:center;gap:12px;font-size:13px;color:#8c887e;z-index:2;"),children:[eL&&(0,t.jsxs)("span",{children:["Entrando como ",(0,t.jsx)("strong",{style:(0,p.s)("font-weight:600;color:#5f5c54;"),children:eL})]}),(0,t.jsx)("button",{onClick:()=>{var e;Q(null!=(e=m[b])?e:String(b),"sign_out"),X()},style:(0,p.s)("background:none;border:none;padding:0;font-family:inherit;font-size:13px;color:#8c887e;cursor:pointer;text-decoration:underline;"),children:eL?"No sos vos? Cerr\xe1 sesi\xf3n ⏻":"Cerrar sesi\xf3n ⏻"})]}),(0,t.jsx)("div",{style:(0,p.s)("position:absolute;bottom:24px;left:50%;transform:translateX(-50%);font-size:13px;color:#a3a097;z-index:2;"),children:ez}),eC&&(0,t.jsxs)("div",{style:(0,p.s)("position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("position:relative;display:flex;align-items:center;justify-content:center;"),children:[(0,t.jsx)("img",{src:"/logo.png",alt:"",width:"300",height:"300",style:(0,p.s)("object-fit:contain;mix-blend-mode:multiply;")}),(0,t.jsx)("div",{className:"eia-serif",style:(0,p.s)("position:absolute;bottom:-6px;font-size:96px;font-weight:600;color:#1d1c19;letter-spacing:-0.01em;pointer-events:none;"),children:w})]}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;gap:10px;margin-top:60px;"),children:[(0,t.jsxs)("button",{style:(0,p.s)("display:flex;align-items:center;gap:7px;background:#fff;border:1px solid #e2dfd6;border-radius:22px;padding:10px 18px;font-size:14px;color:#1d1c19;cursor:pointer;"),children:[(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"18",cy:"5",r:"2.5"}),(0,t.jsx)("circle",{cx:"6",cy:"12",r:"2.5"}),(0,t.jsx)("circle",{cx:"18",cy:"19",r:"2.5"}),(0,t.jsx)("path",{d:"m8.2 10.7 7.6-4.4M8.2 13.3l7.6 4.4"})]}),"Compartir"]}),(0,t.jsxs)("button",{onClick:eg,style:(0,p.s)("display:flex;align-items:center;gap:7px;background:#1d1c19;border:none;border-radius:22px;padding:10px 20px;font-size:14px;color:#fff;cursor:pointer;"),children:["Continuar"," ",(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m9 6 6 6-6 6"})})]})]})]}),eS&&(0,t.jsx)("div",{style:(0,p.s)("position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:24px;"),children:(0,t.jsxs)("div",{style:(0,p.s)("width:380px;max-width:".concat(v?"94vw":"100%",";max-height:calc(100dvh - ").concat(v?80:48,"px);background:#fff;border:1px solid #ece9e1;border-radius:20px;box-shadow:0 34px 80px -44px rgba(40,36,28,0.5);display:flex;flex-direction:column;overflow:hidden;")),children:[(0,t.jsxs)("div",{style:(0,p.s)("flex:none;display:flex;align-items:center;padding:16px 18px 4px;position:relative;min-height:34px;"),children:[b>0&&(0,t.jsx)("svg",{onClick:function(){var e;Q(null!=(e=m[b])?e:String(b),"step_back"),j(Math.max(0,b-1))},style:(0,p.s)("cursor:pointer;color:#8c887e;position:absolute;
1left:16px;"),width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.9",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m15 6-6 6 6 6"})}),(0,t.jsx)("div",{style:(0,p.s)("display:flex;gap:6px;margin:0 auto;"),children:em.map((e,n)=>(0,t.jsx)("span",{style:(0,p.s)("width:5px;height:5px;border-radius:50%;background:".concat(e.bg,";"))},n))})]}),(0,t.jsxs)("div",{style:(0,p.s)("flex:1 1 auto;min-height:0;overflow-y:auto;padding:14px 26px 16px;"),children:[b===g.opening&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"eia-serif",style:(0,p.s)("font-size:26px;font-weight:600;margin:6px 0 8px;"),children:"Empecemos."}),(0,t.jsx)("p",{style:(0,p.s)("font-size:14px;color:#8c887e;margin:0 0 22px;line-height:1.5;"),children:"Lo haremos paso a paso. En unos minutos, KE\xb7ai conectar\xe1 tus fuentes, entender\xe1 qui\xe9n sos y empezar\xe1 a trabajar para vos."}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;flex-direction:column;gap:16px;margin-bottom:22px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:13px;font-size:14px;color:#3f3c36;"),children:[(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("circle",{cx:"12",cy:"10",r:"3"}),(0,t.jsx)("path",{d:"M6.5 19a6 6 0 0 1 11 0"})]}),"Aprende lo b\xe1sico de tu correo y calendario"]}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:13px;font-size:14px;color:#3f3c36;"),children:[(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("path",{d:"M4 6h10M4 12h7M4 18h13"}),(0,t.jsx)("circle",{cx:"18",cy:"6",r:"2"}),(0,t.jsx)("circle",{cx:"15",cy:"12",r:"2"})]}),"Activa las rutinas iniciales — las ajust\xe1s cuando quieras"]}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:13px;font-size:14px;color:#3f3c36;"),children:[(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M21 11.5 12.6 20a5 5 0 0 1-7-7l8.5-8.5a3.3 3.3 0 0 1 4.7 4.7l-8.5 8.5a1.7 1.7 0 0 1-2.4-2.4l7.8-7.8"})}),"Conecta apps extra y personaliza tu asistente"]}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:13px;font-size:14px;color:#3f3c36;"),children:[(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M12 3 5 6v5c0 4.5 3 8 7 10 4-2 7-5.5 7-10V6l-7-3Z"})}),"Nunca env\xeda un correo o mensaje sin tu aprobaci\xf3n"]})]}),(0,t.jsx)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:12px;overflow:hidden;margin-bottom:6px;"),children:(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;padding:13px 15px;"),children:[(0,t.jsxs)("span",{style:(0,p.s)("display:flex;align-items:center;gap:9px;font-size:14px;color:#3f3c36;"),children:[(0,t.jsxs)("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.7",children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,t.jsx)("path",{d:"M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"})]}),"Zona horaria"]}),(0,t.jsx)("select",{value:z,onChange:e=>C(e.target.value),style:(0,p.s)("border:none;background:transparent;font-size:14px;color:#1d1c19;text-align:right;cursor:pointer;outline:none;"),children:S.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]})})]}),b===g.connect&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"eia-serif",style:(0,p.s)("font-size:22px;font-weight:600;margin:2px 0 4px;"),children:"Conect\xe1 tus fuentes"}),(0,t.jsx)("p",{style:(0,p.s)("font-size:13.5px;color:#8c887e;margin:0 0 18px;"),children:"Correo y calendario son la base. Conect\xe1 Microsoft Outlook, o Gmail y Google Calendar. WhatsApp es por d\xf3nde te va a hablar — sumalo ac\xe1 o cuando quieras."}),[{provider:"outlook",title:"Microsoft Outlook",desc:"Correo y calendario en una sola conexi\xf3n",connected:F,pending:R&&!F,glyph:"O",badge:"Cubre ambas"},{provider:"gmail",title:"Gmail",desc:"Tu correo para que el asistente entienda tu trabajo",connected:H,pending:!1,glyph:"G",badge:(null==T?void 0:T.mail.ready)?null:"Alternativa"},{provider:"googlecalendar",title:"Google Calendar",desc:"Tus reuniones y prioridades",connected:M,pending:!1,glyph:"C",badge:(null==T?void 0:T.calendar.ready)?null:"Alternativa"}].map(e=>(0,t.jsxs)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:11px;padding:12px 13px;margin-bottom:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;gap:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:11px;min-width:0;"),children:[(0,t.jsx)("span",{style:(0,p.s)("width:30px;height:30px;border-radius:50%;background:#fff;border:1px solid #ece9e1;display:flex;align-items:center;justify-content:center;font-weight:700;color:#4285f4;flex:none;"),children:e.glyph}),(0,t.jsxs)("div",{style:(0,p.s)("min-width:0;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;display:flex;align-items:center;gap:7px;"),children:[e.title,!e.connected&&e.badge&&(0,t.jsx)("span",{style:(0,p.s)("font-size:10px;font-weight:600;color:#8a6d1a;background:#faf3dd;padding:1px 6px;border-radius:5px;flex:none;"),children:e.badge})]}),(0,t.jsx)("div",{style:(0,p.s)("font-size:12px;color:#8c887e;"),children:e.desc})]})]}),e.connected?(0,t.jsxs)("span",{style:(0,p.s)("display:flex;align-items:center;gap:6px;font-size:12px;
1color:#1fa463;font-weight:600;flex:none;max-width:46%;"),children:[(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#1fa463",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m5 12 5 5 9-10"})}),(0,t.jsx)("span",{style:(0,p.s)("white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"),children:eh(e.provider)?"Conectado como ".concat(eh(e.provider)):"Conectado"})]}):e.pending?(0,t.jsx)("button",{onClick:()=>ed(e.provider),disabled:!!J,style:(0,p.s)("background:#1d1c19;border:none;border-radius:9px;padding:8px 14px;font-size:13px;font-weight:500;color:#fff;cursor:pointer;white-space:nowrap;flex:none;"),children:J===e.provider?"Conectando…":"Reconectar"}):(0,t.jsx)("button",{onClick:()=>ed(e.provider),disabled:!!J,style:(0,p.s)("background:#1d1c19;border:none;border-radius:9px;padding:8px 14px;font-size:13px;font-weight:500;color:#fff;cursor:pointer;white-space:nowrap;flex:none;opacity:".concat(J?"0.6":"1",";")),children:J===e.provider?"Conectando…":"Conectar"})]}),ei===e.provider&&!e.connected&&(0,t.jsxs)("div",{style:(0,p.s)("margin-top:9px;font-size:12px;color:#8c887e;line-height:1.45;"),children:["No pudimos confirmar la conexi\xf3n todav\xeda — si completaste el permiso, se refleja ac\xe1 en un par de minutos. Tambi\xe9n pod\xe9s"," ",(0,t.jsx)("span",{onClick:()=>ed(e.provider),style:(0,p.s)("color:#2f6df0;cursor:pointer;"),children:"reintentar"}),"."]})]},e.provider)),ee&&(0,t.jsx)("div",{style:(0,p.s)("background:#fdf1ef;border:1px solid #f3d5cd;border-radius:10px;padding:10px 12px;font-size:12.5px;color:#b44228;line-height:1.5;margin-bottom:12px;"),children:ee}),(0,t.jsx)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;margin:18px 0 11px;"),children:(0,t.jsx)("span",{style:(0,p.s)("font-size:12.5px;font-weight:600;color:#5f5c54;"),children:"WhatsApp"})}),(null==eo?void 0:eo.estado)==="no_disponible"&&(0,t.jsx)("div",{style:(0,p.s)("background:#faf3dd;border:1px solid #ead9a5;border-radius:10px;padding:10px 12px;font-size:12.5px;color:#785d18;line-height:1.5;margin-bottom:10px;"),children:eo.mensaje}),(0,t.jsx)(f,{channelReady:null==eo?void 0:eo.channelReady,platformMessage:null==eo?void 0:eo.mensaje}),(0,t.jsxs)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:11px;padding:12px 13px;margin-bottom:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;gap:10px;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:11px;min-width:0;"),children:[(0,t.jsx)("span",{style:(0,p.s)("width:30px;height:30px;border-radius:8px;background:#128c7e;flex:none;display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;"),children:"W"}),(0,t.jsxs)("div",{style:(0,p.s)("min-width:0;"),children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;"),children:"Tu WhatsApp personal"}),(0,t.jsx)("div",{style:(0,p.s)("font-size:12px;color:#8c887e;"),children:"keai aprende de tus chats para entenderte mejor"})]})]}),(null==eo?void 0:eo.bridgeReady)!==!0?(0,t.jsx)("span",{style:(0,p.s)("font-size:12px;color:#a06a16;font-weight:600;flex:none;white-space:nowrap;"),children:eo?"No disponible":"Comprobando…"}):eu("whatsapp_personal_wacli")?(0,t.jsxs)("span",{style:(0,p.s)("display:flex;align-items:center;gap:6px;font-size:12px;color:#1fa463;font-weight:600;flex:none;"),children:[(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#1fa463",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m5 12 5 5 9-10"})}),"Conectado"]}):(0,t.jsx)("button",{onClick:ef,disabled:ep||(null==eo?void 0:eo.bridgeReady)!==!0,style:(0,p.s)("background:#fff;border:1px solid #e2dfd6;border-radius:8px;padding:6px 14px;font-size:13px;color:#1d1c19;cursor:pointer;flex:none;opacity:".concat(ep?"0.6":"1",";")),children:ep?"Escane\xe1 el QR…":"Conectar"})]}),ep&&(0,t.jsx)("div",{style:(0,p.s)("margin-top:9px;font-size:11.5px;color:#a3a097;line-height:1.45;"),children:"Se abri\xf3 una pesta\xf1a con el c\xf3digo QR — escanealo desde WhatsApp (Dispositivos vinculados). Esta tarjeta se actualiza sola."})]}),(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;margin:18px 0 11px;"),children:[(0,t.jsx)("span",{style:(0,p.s)("font-size:12.5px;font-weight:600;color:#5f5c54;"),children:"Apps (opcionales)"}),(0,t.jsx)("span",{style:(0,p.s)("font-size:12px;color:#a3a097;"),children:(null!=I?I:[]).filter(e=>"active"===e.status).length})]}
1),[{provider:"slack",name:"Slack",desc:"Dale acceso a tus canales de trabajo",tile:"#4a154b",glyph:"#"},{provider:"notion",name:"Notion",desc:"Dale acceso a tus documentos",tile:"#000000",glyph:"N"}].map(e=>{let n=eu(e.provider);return(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 0;border-bottom:1px solid #f3f1eb;"),children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:11px;min-width:0;"),children:[(0,t.jsx)("span",{style:(0,p.s)("width:30px;height:30px;border-radius:8px;background:".concat(e.tile,";flex:none;display:flex;align-items:center;justify-content:center;color:#fff;font-size:13px;font-weight:700;")),children:e.glyph}),(0,t.jsxs)("div",{style:(0,p.s)("min-width:0;"),children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;"),children:e.name}),(0,t.jsx)("div",{style:(0,p.s)("font-size:12px;color:#8c887e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"),children:e.desc})]})]}),n?(0,t.jsx)("span",{style:(0,p.s)("font-size:12px;color:#1fa463;font-weight:600;flex:none;"),children:"Conectado"}):(0,t.jsx)("button",{onClick:()=>ed(e.provider),disabled:!!J,style:(0,p.s)("background:#fff;border:1px solid #e2dfd6;border-radius:8px;padding:6px 14px;font-size:13px;color:#1d1c19;cursor:pointer;flex:none;opacity:".concat(J?"0.6":"1",";")),children:J===e.provider?"Abriendo…":"Conectar"})]},e.provider)})]}),b===g.profile&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"eia-serif",style:(0,p.s)("font-size:24px;font-weight:600;margin:2px 0 18px;"),children:w}),(!P||!P.hasConnection)&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:(0,p.s)("background:#faf9f5;border:1px solid #f0eee8;border-radius:10px;padding:14px;font-size:13.5px;color:#5f5c54;line-height:1.55;margin-bottom:14px;"),children:["Todav\xeda no sabemos nada de vos. Conect\xe1 tu correo y ",w," empezar\xe1 a entender tu voz, tus contactos y tus prioridades."]}),(0,t.jsx)("button",{onClick:()=>j(g.connect),style:(0,p.s)("background:#1d1c19;border:none;border-radius:9px;padding:9px 16px;font-size:13px;font-weight:500;color:#fff;cursor:pointer;"),children:"Conectar mi correo"})]}),P&&P.hasConnection&&P.building&&!P.hasProfile&&(0,t.jsxs)("div",{style:(0,p.s)("background:#faf9f5;border:1px solid #f0eee8;border-radius:10px;padding:14px;font-size:13.5px;color:#5f5c54;line-height:1.55;"),children:["Construyendo tu perfil… ",w," est\xe1 leyendo tu correo para entender tu voz, tus contactos y tus prioridades. Esto aparecer\xe1 solo."]}),P&&P.hasConnection&&!P.building&&!P.hasProfile&&(0,t.jsxs)("div",{style:(0,p.s)("background:#faf9f5;border:1px solid #f0eee8;border-radius:10px;padding:14px;font-size:13.5px;color:#5f5c54;line-height:1.55;"),children:["Conectaste tu correo. ",w," todav\xeda no termin\xf3 de armar tu perfil — se ir\xe1 llenando a medida que trabaje."]}),P&&P.hasProfile&&P.core&&(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;font-weight:600;margin-bottom:7px;"),children:"Identidad profesional"}),(0,t.jsx)("div",{style:(0,p.s)("background:#faf9f5;border:1px solid #f0eee8;border-radius:10px;padding:12px;font-size:13.5px;color:#3f3c36;line-height:1.55;margin-bottom:18px;"),children:P.core.summary}),P.core.priorities.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;font-weight:600;margin-bottom:7px;"),children:"Tus prioridades"}),(0,t.jsx)("ul",{style:(0,p.s)("margin:0 0 18px;padding-left:18px;color:#3f3c36;font-size:13.5px;line-height:1.6;"),children:P.core.priorities.map((e,n)=>(0,t.jsx)("li",{children:e},n))})]}),(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;font-weight:600;margin-bottom:7px;"),children:"Contactos clave"}),P.people.length>0?(0,t.jsx)("div",{style:(0,p.s)("display:flex;flex-direction:column;gap:8px;margin-bottom:18px;"),children:P.people.map(e=>(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:11px;background:#faf9f5;border-radius:10px;padding:10px;"),children:[(0,t.jsx)("span",{style:(0,p.s)("width:28px;height:28px;border-radius:50%;background:#3a3733;color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex:none;"),children:(e.name||"?").slice(0,1).toUpperCase()}),(0,t.jsxs)("div",{style:(0,p.s)("min-width:0;"),children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"),children:e.name}),(0,t.jsx)("div",{style:(0,p.s)("font-size:12px;color:#8c887e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
1"),children:[e.role,e.org,e.email].filter(Boolean).join(" \xb7 ")})]})]},e.id))}):(0,t.jsx)("div",{style:(0,p.s)("background:#faf9f5;border:1px solid #f0eee8;border-radius:10px;padding:12px;font-size:13px;color:#5f5c54;line-height:1.55;margin-bottom:18px;"),children:"A\xfan no encontramos colaboradores frecuentes en tu correo o calendario. Los iremos mostrando a medida que uses KE\xb7ai."}),(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;font-weight:600;margin-bottom:7px;"),children:"Estilo de comunicaci\xf3n"}),(0,t.jsx)("ul",{style:(0,p.s)("margin:0 0 18px;padding-left:18px;color:#3f3c36;font-size:13.5px;line-height:1.6;"),children:P.core.voice&&"Por determinar"!==P.core.voice?(0,t.jsx)("li",{children:P.core.voice}):e_()}),(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;font-weight:600;margin-bottom:7px;"),children:"Preferencias"}),(0,t.jsxs)("ul",{style:(0,p.s)("margin:0 0 4px;padding-left:18px;color:#3f3c36;font-size:13.5px;line-height:1.6;"),children:[P.core.decisionStyle&&"Por determinar"!==P.core.decisionStyle&&(0,t.jsxs)("li",{children:["Decide: ",P.core.decisionStyle]}),P.core.riskTolerance&&"Por determinar"!==P.core.riskTolerance&&(0,t.jsxs)("li",{children:["Riesgo: ",P.core.riskTolerance]}),(!P.core.decisionStyle||"Por determinar"===P.core.decisionStyle)&&(!P.core.riskTolerance||"Por determinar"===P.core.riskTolerance)&&e_("El perfil completo se actualizar\xe1 a medida que trabajes.")]})]})]}
1),b===g.identity&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:(0,p.s)("background:#eef3fb;border-radius:12px;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;"),children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:(0,p.s)("display:flex;align-items:center;gap:8px;"),children:[(0,t.jsx)("input",{value:w,onChange:e=>k(e.target.value),className:"eia-serif",style:(0,p.s)("border:none;background:transparent;outline:none;font-size:24px;font-weight:600;color:#1d1c19;width:120px;border-bottom:1px dashed #b9c6e0;padding-bottom:2px;")}),(0,t.jsx)("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"#8c887e",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"})})]}),(0,t.jsx)("div",{style:(0,p.s)("font-size:13px;color:#8c887e;margin-top:6px;"),children:"El primero en dar el salto."})]}),(0,t.jsx)("img",{src:"/logo.png",alt:"",width:"68",height:"68",style:(0,p.s)("object-fit:contain;mix-blend-mode:multiply;")})]}),(0,t.jsxs)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:12px;padding:14px 15px;margin-bottom:12px;"),children:[(0,t.jsx)("div",{style:(0,p.s)("font-size:13.5px;font-weight:600;margin-bottom:3px;"),children:"Personalidad"}),(0,t.jsxs)("div",{style:(0,p.s)("font-size:12.5px;color:#8c887e;margin-bottom:10px;"),children:[L.charAt(0).toUpperCase()+L.slice(1),"."]}),(0,t.jsx)("div",{style:(0,p.s)("display:flex;flex-wrap:wrap;gap:6px;"),children:h.map(e=>(0,t.jsx)("span",{onClick:()=>_(e.value),style:(0,p.s)("font-size:12px;border-radius:8px;padding:5px 10px;cursor:pointer;border:1px solid ".concat(L===e.value?"#1d1c19":"#e2dfd6",";background:").concat(L===e.value?"#1d1c19":"#fff",";color:").concat(L===e.value?"#fff":"#5f5c54",";")),children:e.label},e.value))})]}),eL&&(0,t.jsxs)("div",{style:(0,p.s)("border:1px solid #ece9e1;border-radius:12px;padding:14px 15px;"),children:[(0,t.jsx)("div",{style:(0,p.s)("display:flex;align-items:center;justify-content:space-between;"),children:(0,t.jsx)("span",{style:(0,p.s)("font-size:13.5px;font-weight:600;"),children:"Tu asistente por correo"})}),(0,t.jsxs)("p",{style:(0,p.s)("font-size:12.5px;color:#8c887e;line-height:1.5;margin:8px 0 0;"),children:["Reenviale lo que sea. Solo responder\xe1 a ",eL,". Nadie m\xe1s puede activar tu asistente por correo."]})]})]})]}),(0,t.jsxs)("div",{style:(0,p.s)("flex:none;display:flex;align-items:center;justify-content:space-between;padding:18px 22px 20px;gap:12px;border-top:1px solid #f3f1eb;"),children:[(0,t.jsx)("span",{}),(0,t.jsxs)("button",{onClick:eg,disabled:ej,style:(0,p.s)("display:flex;align-items:center;justify-content:center;gap:8px;background:".concat(ej?"#b7b4ab":"#1d1c19",";border:none;border-radius:10px;padding:12px 18px;font-size:14px;font-weight:500;color:#fff;cursor:").concat(ej?"default":"pointer",";white-space:nowrap;flex:").concat("1",";")),children:[eE," ",(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#fff",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"m9 6 6 6-6 6"})})]})]})]})})]})}function v(){let[e,n]=(0,o.useState)("");(0,o.useEffect)(()=>{var e,i;n(null!=(i=null==(e=new URLSearchParams(window.location.search).get("invite"))?void 0:e.trim())?i:"")},[]);let i=e?"/connect/".concat(encodeURIComponent(e)):"/home";return(0,t.jsx)(d.iq,{loading:(0,t.jsx)(j,{children:"Cargando…"}),unauthenticated:(0,t.jsx)(w,{invite:e}),children:(0,t.jsx)(b,{returnTo:i})})}function b(e){let{returnTo:n}=e,i=(0,s.useRouter)(),a=(0,r.n_)(c.FH.onboarding.finish),l=(0,r.n_)(c.FH.onboarding.analytics.track),d=(0,r.IT)(c.FH.onboarding.status);if((0,o.useEffect)(()=>{(null==d?void 0:d.onboarded)&&i.replace(n)},[d,i,n]),void 0===d)return(0,t.jsx)(j,{children:"Cargando…"});if(null==d?void 0:d.onboarded)return(0,t.jsx)(j,{children:"Entrando…"});async function p(e){await a(e),l({step:"home",event:"landed_home"}).catch(()=>{}),i.push(n)}return(0,t.jsx)(y,{onComplete:p})}function j(e){let{children:n}=e;return(0,t.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#f3f2ec",color:"#8c887e",fontSize:15},children:n})}function w(e){let{invite:n}=e,{signIn:i}=(0,l.BG)(),s=(0,r.IT)(c.FH.authAvailability.providers),[d,p]=(0,o.useState)(()=>"signup"===new URLSearchParams(window.location.search).get("mode")?"
1signUp":"signIn"),[x,f]=(0,o.useState)(""),[u,h]=(0,o.useState)(""),[g,m]=(0,o.useState)(!1),[y,v]=(0,o.useState)("");async function b(e){e.preventDefault(),m(!0),v("");try{await i("password",{email:x,password:u,flow:d})}catch(e){v(function(e,n){var i;let t=e instanceof a.ik?String(null!=(i=e.data)?i:""):"";if(t)return t;let o=e instanceof Error?e.message:String(null!=e?e:"");return/Invalid password/i.test(o)?"La contrase\xf1a necesita al menos 8 caracteres.":/already exists/i.test(o)?"Ese correo ya tiene una cuenta. Inici\xe1 sesi\xf3n en vez de crearla.":/InvalidAccountId/i.test(o)?"No encontramos una cuenta con contrase\xf1a para ese correo. Entr\xe1 con el proveedor con el que creaste la cuenta.":/InvalidSecret/i.test(o)?"Esa contrase\xf1a no coincide con la cuenta.":"signUp"===n?"No pudimos crear la cuenta. Prob\xe1 de nuevo en un momento.":"No pudimos iniciar sesi\xf3n. Prob\xe1 de nuevo en un momento."}(e,d))}finally{m(!1)}}return(0,o.useEffect)(()=>{"signup"===new URLSearchParams(window.location.search).get("mode")&&p("signUp")},[]),(0,t.jsx)("main",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",background:"#f3f2ec",padding:24},children:(0,t.jsxs)("div",{style:{width:380,maxWidth:"100%",background:"#fff",border:"1px solid #ece9e1",borderRadius:20,boxShadow:"0 34px 80px -44px rgba(40,36,28,0.5)",padding:"30px 30px 26px"},children:[(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",marginBottom:14},children:(0,t.jsx)("img",{src:"/keai-logo.webp",alt:"KE\xb7ai",style:{height:22,width:"auto",display:"block"}})}),(0,t.jsx)("h1",{className:"eia-serif",style:{fontSize:26,fontWeight:600,margin:"0 0 6px",textAlign:"center"},children:"signUp"===d?"Cre\xe1 tu cuenta":"Inici\xe1 sesi\xf3n"}),(0,t.jsx)("p",{style:{fontSize:14,color:"#8c887e",margin:"0 0 22px",textAlign:"center",lineHeight:1.5},children:(null==s?void 0:s.google)?"Entr\xe1 con Google o con tu correo. Despu\xe9s conect\xe1s Gmail o Microsoft Outlook.":"Entr\xe1 con tu correo y contrase\xf1a."}),(null==s?void 0:s.local)&&(0,t.jsx)("p",{role:"status",style:{fontSize:14,color:"#8c887e",margin:"0 0 22px",textAlign:"center",lineHeight:1.5},children:"Est\xe1s en la versi\xf3n local. Sus cuentas y datos son independientes de k-e.ai."}),(null==s?void 0:s.google)&&(0,t.jsxs)("button",{onClick:()=>i("google",{redirectTo:n?"/onboarding?invite=".concat(encodeURIComponent(n)):"/onboarding"}),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10,width:"100%",background:"#fff",border:"1px solid #e2dfd6",borderRadius:11,padding:"12px",fontFamily:"inherit",fontSize:15,fontWeight:500,color:"#1d1c19",cursor:"pointer"},children:[(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"#4285F4",d:"M22.5 12.2c0-.7-.1-1.4-.2-2H12v3.8h5.9a5 5 0 0 1-2.2 3.3v2.7h3.6c2.1-1.9 3.2-4.8 3.2-7.8Z"}),(0,t.jsx)("path",{fill:"#34A853",d:"M12 23c2.9 0 5.4-1 7.2-2.6l-3.6-2.7c-1 .7-2.3 1.1-3.6 1.1-2.8 0-5.1-1.9-6-4.4H2.3v2.8A11 11 0 0 0 12 23Z"}),(0,t.jsx)("path",{fill:"#FBBC04",d:"M6 14.4a6.6 6.6 0 0 1 0-4.2V7.4H2.3a11 11 0 0 0 0 9.8L6 14.4Z"}),(0,t.jsx)("path",{fill:"#EA4335",d:"M12 5.4c1.6 0 3 .5 4.1 1.6l3.1-3.1A11 11 0 0 0 2.3 7.4L6 10.2c.9-2.6 3.2-4.8 6-4.8Z"})]}),"Continuar con Google"]}),(null==s?void 0:s.microsoft)&&(0,t.jsxs)("button",{onClick:()=>i("microsoft-entra-id",{redirectTo:n?"/onboarding?invite=".concat(encodeURIComponent(n)):"/onboarding"}),style:{display:"flex",alignItems:"center",justifyContent:"center",gap:10,width:"100%",marginTop:10,background:"#fff",border:"1px solid #e2dfd6",borderRadius:11,padding:"12px",fontFamily:"inherit",fontSize:15,fontWeight:500,color:"#1d1c19",cursor:"pointer"},children:[(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 18 18","aria-hidden":"true",children:[(0,t.jsx)("path",{fill:"#f25022",d:"M0 0h8.5v8.5H0z"}),(0,t.jsx)("path",{fill:"#7fba00",d:"M9.5 0H18v8.5H9.5z"}),(0,t.jsx)("path",{fill:"#00a4ef",d:"M0 9.5h8.5V18H0z"}),(0,t.jsx)("path",{fill:"#ffb900",d:"M9.5 9.5H18V18H9.5z"})]}),"Continuar con Microsoft"]}),(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,margin:"18px 0",color:"#a3a097",fontSize:13},children:[(0,t.jsx)("span",{style:{flex:1,height:1,background:"#f0eee8"}})," o ",(0,t.jsx)("span",{style:{flex:1,height:1,background:"#f0eee8"}})]}),(0,t.jsxs)("form",{onSubmit:b,style:{display:"flex",flexDirection:"column",gap:10},children:[(0,t.jsx)("input",{type:"email",required:!0,value:x,onChange:e=>f(e.target.value),placeholder:"[email protected]",style:{border:"1px solid #d8d5cc",borderRadius:11,padding:"12px 13px",fontFamily:"inherit",fontSize:15,outline:"none"}}),(0,t.jsx)("input",{type:"password",required:!0,value:u,onChange:e=>h(e.target.value),placeholder:"Contrase\xf1a",style:{border:"1px solid #d8d5cc",borderRadius:11,padding:"12px 13px",fontFamily:"inherit",fontSize:15,outline:"none"}}),y&&(0,t.jsx)("div",{style:{color:"#d6492f",fontSize:13},children:y}),(0,t.jsx)("button",{type:"submit",disabled:g,style:{background:"#1d1c19",color:"#fff",border:"none",borderRadius:11,padding:12,fontFamily:"inherit",fontSize:15,fontWeight:500,cursor:g?"default":"pointer",opacity:g?.6:1},children:g?"Un momento…":"signUp"===d?"Crear cuenta":"Entrar"})]}),"signIn"===d&&(0,t.jsx)("p",{style:{textAlign:"center",marginTop:14,fontSize:12.5,color:"#8c887e",lineHeight:1.5},children:"\xbfOlvidaste la contrase\xf1a? Entr\xe1 con el proveedor que usaste al crear la cuenta."}),(0,t.jsxs)("div",{style:{textAlign:"center",marginTop:16,fontSize:14,color:"#5f5c54"},children:["signUp"===d?"\xbfYa ten\xe9s cuenta? ":"\xbfSos nuevo? ",(0,t.jsx)("span",{onClick:()=>p("signUp"===d?"signIn":"signUp"),style:{color:"#2f6df0",cursor:"pointer"},children:"signUp"===d?"Inici\xe1 sesi\xf3n":"Cre\xe1 tu cuenta"})]})]})})}},1047:(e,n,i)=>{"use strict";i.d(n,{a:()=>o});var t=i(2115);function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[n,i]=(0,t.useState)(!1);return(0,t.useEffect)(()=>{let n=window.matchMedia("(max-width: ".concat(e,"px)")),t=()=>i(n.matches);return t(),n.addEventListener?n.addEventListener("change",t):n.addListener(t),()=>{n.removeEventListener?n.removeEventListener("change",t):n.removeListener(t)}},[e]),n}},2689:(e,n,i)=>{Promise.resolve().then(i.bind(i,651))},5113:(e,n,i)=>{"use strict";function t(e){let n={};for(let i of e.split(";")){let e=i.trim();if(!e)continue;let t=e.indexOf(":");if(-1===t)continue;let o=e.slice(0,t).trim(),s=e.slice(t+1).trim();n[o.replace(/-([a-z])/g,(e,n)=>n.toUpperCase())]=s}return n}i.d(n,{s:()=>t})},8900:(e,n,i)=>{"use strict";i.d(n,{FH:()=>o});var t=i(9349);let o=t.dp;(0,t.Op)()},9520:(e,n,i)=>{"use strict";i.d(n,{iq:()=>a,jE:()=>l});var t=i(5155),o=i(2115),s=i(63),r=i(1495);function a(e){let{children:n,loading:i,unauthenticated:o,missingConfig:s}=e;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(r.n5,{children:i}),(0,t.jsx)(r.hE,{children:o}),(0,t.jsx)(r.Yz,{children:n})]})}function l(e){let{to:n="/onboarding",fallback:i}=e,r=(0,s.useRouter)();return(0,o.useEffect)(()=>{r.replace(n)},[r,n]),(0,t.jsx)(t.Fragment,{children:i})}}},e=>{e.O(0,[1996,5743,8441,1255,7358],()=>e(e.s=2689)),_N_E=e.O()}]);

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.