PageSourceSearch

https://sabhia.ai/assets/chat-v5-CoqEryL6.js

js sabhia.ai collected 2026-10-05 12:32:54 UTC 60,955 bytes, 68 lines download raw bytes

1import{j as e}from"./vendor-motion-CPxq9Xvn.js";import{r as i}from"./vendor-i18n-CO3kK2bH.js";import{dF as Ge,c as Qe,d as He,s as Je,b1 as Xe,b2 as Ye,dG as L,dH as Ke,aK as We,a_ as Ze,ap as _e,ay as ea,i as aa,a7 as de,C as ta,aa as sa,ab as oa,f as Ee,ae as ra,af as ia,ag as na,ah as la}from"./index-CFAvyuXu.js";import{A as ca}from"./arrow-left-DY50GvQQ.js";import{E as da}from"./ellipsis-vertical-0l79KCRs.js";import{M as pa}from"./maximize-2-BDHmjU2g.js";import"./vendor-react-CQmBMThG.js";const ua="/images/sabhia-icon.webp";let ce=null;function ma(){return ce||(ce=fetch("/api/stripe/publishable-key").then(r=>r.json()).then(r=>la(r.publishableKey))),ce}const xa={hook:2,collect_name:5,proof_market:10,proof_results:14,testimonials:18,awareness:22,problem_reveal:28,pain_amplify:34,solution_reveal:40,show_editorial:46,future_vision:52,value_stack:58,price_reveal:64,objection_handler:67,ready_to_start:70,branch_choice:71,collect_topic:72,collect_objective:75,collect_audience:78,collect_plan_whatsapp:79,generating_plan:80,collect_title:73,collect_summary:76,collect_author:79,show_plan:84,collect_email:86,confirm_email:88,collect_whatsapp:90,confirm_whatsapp:92,countdown:94,sending_plan:95,checkout_bumps:96,checkout_payment:97,checkout_processing:98,checkout_success:100};function T(){return new Date().toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function Ne(r){const d=r.replace(/\D/g,"").slice(0,11);return d.length<=2?d.length?`(${d}`:"":d.length<=7?`(${d.slice(0,2)}) ${d.slice(2)}`:`(${d.slice(0,2)}) ${d.slice(2,7)}-${d.slice(7)}`}function ha(){return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-testid":"typing-indicator","data-msg-row":!0,style:{animation:"waFadeIn .2s ease"},children:e.jsxs("div",{className:"relative bg-white rounded-[10px] rounded-bl-[4px] px-[12px] py-[8px]",style:{minWidth:56,boxShadow:"0 1px 3px rgba(11,20,26,0.08), 0 1px 1px rgba(11,20,26,0.06)"},children:[e.jsx("div",{className:"wa-tail-l"}),e.jsxs("div",{className:"flex gap-[5px] items-center",style:{height:17},children:[e.jsx("span",{className:"wa-dot",style:{animationDelay:"0ms"}}),e.jsx("span",{className:"wa-dot",style:{animationDelay:"200ms"}}),e.jsx("span",{className:"wa-dot",style:{animationDelay:"400ms"}})]})]})})}function ba({images:r,currentIndex:d,onClose:g,onNav:x}){return i.useEffect(()=>{const w=c=>{c.key==="ArrowRight"?x(1):c.key==="ArrowLeft"?x(-1):c.key==="Escape"&&g()};return window.addEventListener("keydown",w),()=>window.removeEventListener("keydown",w)},[x,g]),e.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-black/90",onClick:g,"data-testid":"image-lightbox",children:[e.jsx("button",{className:"absolute top-4 right-4 text-white text-3xl font-light w-10 h-10 flex items-center justify-center z-10",onClick:g,"data-testid":"lightbox-close",children:"×"}),e.jsxs("div",{className:"absolute top-4 left-1/2 -translate-x-1/2 text-white/70 text-sm z-10",children:[d+1," / ",r.length]}),r.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{className:"absolute left-3 top-1/2 -translate-y-1/2 w-11 h-11 rounded-full bg-black/50 flex items-center justify-center text-white text-2xl z-10 hover:bg-black/70 transition-colors",onClick:w=>{w.stopPropagation(),x(-1)},"data-testid":"lightbox-prev",children:"‹"}),e.jsx("button",{className:"absolute right-3 top-1/2 -translate-y-1/2 w-11 h-11 rounded-full bg-black/50 flex items-center justify-center text-white text-2xl z-10 hover:bg-black/70 transition-colors",onClick:w=>{w.stopPropagation(),x(1)},"data-testid":"lightbox-next",children:"›"})]}),e.jsx("img",{src:r[d],className:"max-w-[92vw] max-h-[85vh] object-contain rounded-lg",onClick:w=>w.stopPropagation(),alt:`Imagem ${d+1}`})]})}function ga({pages:r,currentIndex:d,onClose:g,onNav:x}){const w=i.useRef(0),c=i.useRef(null);return i.useEffect(()=>{const u=m=>{m.key==="ArrowRight"?x(1):m.key==="ArrowLeft"?x(-1):m.key==="Escape"&&g()};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[x,g]),i.useEffect(()=>{if(c.current){const u=c.current.children[d];u&&u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}},[d]),e.jsxs("div",{className:"fixed inset-0 z-[9999] flex flex-col",style:{background:"rgba(0,0,0,0.95)"},"data-testid":"document-viewer",children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white text-[14px] font-medium truncate",children:"Planejamento Editorial"}),e.jsxs("p",{className:"text-white/60 text-[12px]",children:["Página ",d+1," de ",r.length]})]}),e.jsx("button",{onClick:g,className:"w-[44px] h-[44px] flex items-center justify-center text-white text-3xl font-light","data-testid":"doc-viewer-close",children:"×"})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden cursor-pointer",onTouchStart:u=>{w.current=u.touches[0].clientX},onTouchEnd:u=>{const m=w.current-u.changedTouches[0].clientX;Math.abs(m)>50&&x(m>0?1:-1)},onClick:g,children:[d>0&&e.jsx("button",{className:"absolute left-2 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-full flex items-center justify-center text-white text-3xl z-10 transition-colors",style:{background:"rgba(255,255,255,0.15)"},onClick:u=>{u.stopPropagation(),x(-1)},"data-testid":"doc-viewer-prev",children:"‹"}),d<r.length-1&&e.jsx("button",{className:"absolute right-2 top-1/2 -translate-y-1/2 w-[48px] h-[48px] rounded-full flex items-center justify-center text-white text-3xl z-10 transition-colors",style:{background:"rgba(255,255,255,0.15)"},onClick:u=>{u.stopPropagation(),x(1)},"data-testid":"doc-viewer-next",children:"›"}),e.jsx("img",{src:r[d],className:"max-w-[92vw] max-h-[85vh] object-contain transition-opacity duration-200",alt:`Página ${d+1}`,draggable:!1,onClick:u=>u.stopPropagation()})]}),e.jsx("div",{className:"shrink-0 py-2 px-2",children:e.jsx("div",{ref:c,className:"flex gap-[6px] overflow-x-auto justify-center",style:{scrollbarWidth:"thin"},children:r.map((u,m)=>e.jsx("div",{className:"flex-shrink-0 cursor-pointer rounded-[3px] overflow-hidden transition-all",style:{width:36,height:50,border:m===d?"2px solid #25D366":"2px solid transparent",opacity:m===d?1:.5},onClick:()=>x(m-d),"data-testid":`doc-thumb-${m}`,children:e.jsx("img",{src:u,className:"w-full h-full object-cover",alt:`Miniatura ${m+1}`})},m))})})]})}function fa({msg:r,showTail:d,onImageClick:g,onDocClick:x}){const w=r.sender==="sabhia";if(r.isImageGroup&&r.images){const c=r.images,u=r.imageLayout==="pages",m=c.length===1&&!u,h=Math.min(c.length,6),E=c.length-h;return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .25s ease"},children:e.jsxs("div",{className:`relative ${m?"max-w-[85%] sm:max-w-[65%] w-full":"max-w-[280px] sm:max-w-[320px]"}`,"data-msg-images":!0,children:[d&&e.jsx("div",{className:"wa-tail-l"}),e.jsxs("div",{className:`bg-white ${d?"rounded-[10px] rounded-bl-[4px]":"rounded-[10px]"} overflow-hidden p-[3px]`,style:{boxShadow:"0 1px 3px rgba(11,20,26,0.08), 0 1px 1px rgba(11,20,26,0.06)"},"data-testid":`message-images-${r.id}`,children:[u?e.jsx("div",{className:"flex gap-[3px] overflow-x-auto pb-1",style:{scrollbarWidth:"thin"},children:c.map((D,k)=>e.jsx("div",{className:"relative cursor-pointer overflow-hidden rounded-[6px] flex-shrink-0 shadow-sm border border-gray-100",style:{width:"90px",height:"120px"},onClick:()=>x?.(c,k),children:e.jsx("img",{src:D,className:"w-full h-full object-cover",alt:`Página ${k+1}`})},k))}):m?e.jsx("div",{className:"cursor-pointer overflow-hidden rounded-[7px]",onClick:()=>g?.(c,0),children:e.jsx("img",{src:c[0],className:"w-full h-auto object-contain rounded-[7px]",alt:"Imagem",style:{maxHeight:400},loading:"eager"})}):e.jsx("div",{className:`grid ${c.length===2?"grid-cols-2":"grid-cols-3"} gap-[2px]`,children:c.slice(0,h).map((D,k)=>e.jsxs("div",{className:"relative cursor-pointer overflow-hidden rounded-[4px]",style:{aspectRatio:"1/1"},onClick:()=>g?.(c,k),children:[e.jsx("img",{src:D,className:"w-full h-full object-cover",alt:`Imagem ${k+1}`}),k===h-1&&E>0&&e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:e.jsxs("span",{className:"text-white text-2xl font-semibold",children:["+",E]})})]},k))}),e.jsxs("div",{className:`flex ${u?"justify-between":"justify-end"} px-[6px] py-[2px]`,children:[u&&e.jsx("span",{className:"text-[10px] font-medium",style:{color:"#10B981"},children:"Toque para ver"}),e.jsx("span",{className:"text-[11px]",style:{color:"#8696A0"},children:r.time})]})]})]})})}if(r.isCard&&r.cardData)return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .2s ease"},children:e.jsxs("div",{className:"relative max-w-[85%] sm:max-w-[65%]","data-msg-bubble":!0,children:[d&&e.jsx("div",{className:"wa-tail-l"}),e.jsxs("div",{className:`bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] ${d?"rounded-[7.5px] rounded-bl-[3px]":"rounded-[7.5px]"} overflow-hidden`,"data-testid":`message-card-${r.id}`,children:[e.jsx("div",{className:"h-[3px]",style:{background:"#25D366"}}),e.jsxs("div",{className:"px-[9px] py-[5px]",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-[6px]",children:[e.jsx(Ee,{className:"w-[13px] h-[13px]",style:{color:"#25D366"}}),e.jsx("span",{className:"text-[11.5px] font-semibold",style:{color:"#25D366"},children:"Resumo do seu livro"})]}
1),r.cardData.title&&e.jsxs("div",{className:"mb-[5px]",children:[e.jsx("p",{className:"text-[10.5px]",style:{color:"#667781"},children:"Título"}),e.jsx("p",{className:"text-[14.2px] font-semibold",style:{color:"#111B21"},children:r.cardData.title})]}),r.cardData.subtitle&&e.jsxs("div",{className:"mb-[5px]",children:[e.jsx("p",{className:"text-[10.5px]",style:{color:"#667781"},children:"Subtítulo"}),e.jsx("p",{className:"text-[13.5px]",style:{color:"#3B4A54"},children:r.cardData.subtitle})]}),r.cardData.summary&&e.jsxs("div",{className:"mb-[5px]",children:[e.jsx("p",{className:"text-[10.5px]",style:{color:"#667781"},children:"Sobre"}),e.jsx("p",{className:"text-[13.5px] leading-[1.35]",style:{color:"#3B4A54"},children:r.cardData.summary})]}),r.cardData.language&&e.jsxs("div",{className:"mb-[5px]",children:[e.jsx("p",{className:"text-[10.5px]",style:{color:"#667781"},children:"Idioma"}),e.jsx("p",{className:"text-[13.5px]",style:{color:"#3B4A54"},children:r.cardData.language})]}),r.cardData.author&&e.jsxs("div",{className:"mb-[3px]",children:[e.jsx("p",{className:"text-[10.5px]",style:{color:"#667781"},children:"Autor(a)"}),e.jsx("p",{className:"text-[13.5px]",style:{color:"#3B4A54"},children:r.cardData.author})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("span",{className:"text-[11px]",style:{color:"#667781"},children:r.time})})]})]})]})});if(r.isProofCard){const c=r.proofType==="ai_detected",u=c?72.57:0,m=c?"#E53E3E":"#38A169",h=c?"from-red-500/5 to-orange-500/5":"from-green-500/5 to-emerald-500/5",E=c?"border-red-400/30":"border-green-400/30",D=c?"stroke-red-500":"stroke-green-500",k=c?"stroke-red-100":"stroke-gray-200",$=c?"Seu texto soa automático/genérico":"Seu texto é escrito por humanos",ae=c?"#C53030":"#276749",U=Math.PI*38,M=U-u/100*U;return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waSlideUp .35s ease"},children:e.jsxs("div",{className:"relative max-w-[85%] sm:max-w-[65%] w-full","data-msg-bubble":!0,children:[d&&e.jsx("div",{className:"wa-tail-l"}),e.jsxs("div",{className:`bg-gradient-to-br ${h} border ${E} ${d?"rounded-[12px] rounded-bl-[4px]":"rounded-[12px]"} overflow-hidden`,style:{boxShadow:"0 2px 8px rgba(0,0,0,0.08)"},"data-testid":`proof-card-${r.id}`,children:[e.jsxs("div",{className:"px-4 py-4",children:[e.jsx("p",{className:"text-[13px] font-bold text-center mb-3",style:{color:ae},children:$}),e.jsx("div",{className:"flex justify-center mb-3",children:e.jsxs("div",{className:"relative w-[100px] h-[72px]",children:[e.jsxs("svg",{viewBox:"0 0 100 56",className:"w-full h-[56px]",children:[e.jsx("path",{d:"M 10 52 A 38 38 0 0 1 90 52",fill:"none",className:k,strokeWidth:"7",strokeLinecap:"round"}),e.jsx("path",{d:"M 10 52 A 38 38 0 0 1 90 52",fill:"none",className:D,strokeWidth:"7",strokeLinecap:"round",strokeDasharray:`${U}`,strokeDashoffset:`${M}`,style:{transition:"stroke-dashoffset 1.2s ease-out"}})]}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 flex flex-col items-center",children:[e.jsx("span",{className:"text-[18px] font-extrabold leading-none",style:{color:m},children:c?"72,57%":"0%"}),e.jsx("span",{className:"text-[9px] font-bold mt-0.5",style:{color:m},children:"Genérico*"})]})]})}),c?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{className:"text-[11px] font-semibold",style:{color:"#744210"},children:"Capítulo 5: O Encontro na Clareira"}),e.jsx("div",{className:"rounded-lg p-2.5 border border-yellow-300/50",style:{backgroundColor:"rgba(254,243,199,0.7)"},children:e.jsxs("p",{className:"text-[11px] leading-[1.45]",style:{color:"#92400E"},children:[e.jsx("span",{style:{backgroundColor:"#FDE68A",padding:"1px 0"},children:"A brisa suave da tarde carregava consigo o aroma das flores selvagens"}),", misturando-se ao som distante de um riacho. ",e.jsx("span",{style:{backgroundColor:"#FDE68A",padding:"1px 0"},children:"O céu, tingido de um azul profundo, começava a se despir de sua pureza"}),", dando lugar às primeiras estrelas..."]})}),e.jsx("p",{className:"text-[10px] text-center mt-1",style:{color:"#B7791F"},children:"Texto genérico detectado como automático pelas plataformas"})]}):e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"rounded-lg p-2.5 border border-green-300/30",style:{backgroundColor:"rgba(209,250,229,0.4)"},children:e.jsx("p",{className:"text-[11px] leading-[1.45]",style:{color:"#1C4532"},children:'As jornadas não são isentas de desafios. Em "Superando Desafios", armaremos você com estratég
1ias reais e práticas para lidar com questões como ansiedade e pressão cotidiana. O diálogo aberto e acolhedor é a melhor ferramenta que você pode oferecer...'})}),e.jsx("p",{className:"text-[10px] text-center mt-1",style:{color:"#276749"},children:"Texto 100% humano — indetectável pelas plataformas"})]})]}),e.jsx("div",{className:"flex justify-end px-3 pb-1.5",children:e.jsx("span",{className:"text-[11px]",style:{color:"#8696A0"},children:r.time})})]})]})})}return w?e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .25s ease"},children:e.jsxs("div",{className:`relative bg-white ${d?"rounded-[10px] rounded-bl-[4px]":"rounded-[10px]"} px-[11px] py-[7px] max-w-[85%] sm:max-w-[65%]`,style:{boxShadow:"0 1px 3px rgba(11,20,26,0.08), 0 1px 1px rgba(11,20,26,0.06)"},"data-testid":`message-${r.id}`,"data-msg-bubble":!0,children:[d&&e.jsx("div",{className:"wa-tail-l"}),e.jsx("span",{className:`text-[14.2px] leading-[20px] whitespace-pre-line ${r.isBold?"font-bold":""}`,style:{color:"#111B21"},children:r.text}),e.jsx("span",{className:"float-right mt-[3px] ml-[8px] text-[11px] leading-none whitespace-nowrap",style:{color:"#8696A0"},children:r.time})]})}):e.jsx("div",{className:"flex justify-end px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .25s ease"},children:e.jsxs("div",{className:`relative ${d?"rounded-[10px] rounded-br-[4px]":"rounded-[10px]"} px-[11px] py-[7px] max-w-[85%] sm:max-w-[65%]`,style:{background:"#D9FDD3",boxShadow:"0 1px 3px rgba(11,20,26,0.08), 0 1px 1px rgba(11,20,26,0.06)"},"data-testid":`message-${r.id}`,"data-msg-bubble":!0,children:[d&&e.jsx("div",{className:"wa-tail-r"}),e.jsx("span",{className:"text-[14.2px] leading-[20px]",style:{color:"#111B21"},children:r.text}),e.jsxs("span",{className:"float-right mt-[3px] ml-[8px] text-[11px] leading-none whitespace-nowrap",style:{color:"#8696A0"},children:[r.time,e.jsxs("svg",{className:"inline ml-[3px] -mt-[1px]",width:"18",height:"11",viewBox:"0 0 18 11",children:[e.jsx("path",{d:"M3.5 6.5L0.5 3.5l-1 1 4 4 8.5-8.5-1-1z",fill:"#53BDEB"}),e.jsx("path",{d:"M9.5 6.5L6.5 3.5l-1 1 4 4 8.5-8.5-1-1z",fill:"#53BDEB"})]})]})]})})}function wa({phase:r}){const d=[{icon:"🧠",text:"Analisando o tema..."},{icon:"📝",text:"Criando estrutura dos capítulos..."},{icon:"✨",text:"Finalizando planejamento editorial..."}];return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .2s ease"},children:e.jsxs("div",{className:"relative bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] rounded-bl-[3px] px-[9px] py-[6px] min-w-[200px]","data-testid":"generating-progress",children:[e.jsx("div",{className:"wa-tail-l"}),e.jsx("div",{className:"space-y-2",children:d.map((g,x)=>e.jsxs("div",{className:`flex items-center gap-2.5 transition-opacity duration-500 ${x<=r?"opacity-100":"opacity-30"}`,children:[x<r?e.jsx("div",{className:"w-[18px] h-[18px] rounded-full flex items-center justify-center",style:{background:"#25D366",animation:"waScaleIn .3s ease"},children:e.jsx(_e,{className:"w-[11px] h-[11px] text-white"})}):x===r?e.jsx("div",{className:"w-[18px] h-[18px] rounded-full border-2 border-t-transparent animate-spin",style:{borderColor:"#25D366",borderTopColor:"transparent"}}):e.jsx("div",{className:"w-[18px] h-[18px] rounded-full",style:{border:"1px solid #CCD0D5"}}),e.jsxs("span",{className:"text-[13px]",style:{color:"#3B4A54"},children:[g.icon," ",g.text]})]},x))}),e.jsx("div",{className:"flex justify-end mt-1",children:e.jsx("span",{className:"text-[11px]",style:{color:"#667781"},children:T()})})]})})}function va({number:r}){return e.jsx("div",{className:"flex px-[18px] sm:px-[63px] mb-[3px]","data-msg-row":!0,style:{animation:"waFadeIn .2s ease"},children:e.jsxs("div",{className:"relative bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] rounded-bl-[3px] px-[12px] py-[8px]","data-testid":`countdown-${r}`,children:[e.jsx("div",{className:"wa-tail-l"}),e.jsx("span",{className:"text-[28px] font-black",style:{color:"#10B981",animation:"waScaleIn .3s ease",display:"inline-block"},children:r}),e.jsx("span",{className:"float-right mt-[12px] ml-[8px] text-[11px] leading-none whitespace-nowrap",style:{color:"#667781"},children:T()})]})})}const ya={cover_ebook:{name:"Capa Personalizada Premium",shortDe
1sc:"Capa profissional exclusiva da SÁBHIA",emoji:"🎨"},publication_prep:{name:"Publicação na Amazon",shortDesc:"Metadados, SEO e descrição para Amazon KDP",emoji:"🌎"},marketing_kit:{name:"Kit Divulgação (6 peças)",shortDesc:"6 peças de conteúdo para redes sociais",emoji:"📢"},combo_publish:{name:'COMBO "Publique Já" - 30% OFF',shortDesc:"Capa + Amazon + Kit com 30% OFF",emoji:"🔥"}};function ja({onSuccess:r,onError:d}){const g=ra(),x=ia(),[w,c]=i.useState(!1),u=async()=>{if(!g||!x)return;c(!0);const{error:m}=await g.confirmPayment({elements:x,confirmParams:{return_url:window.location.href},redirect:"if_required"});m?(c(!1),d(m.message||"Erro ao processar pagamento.")):r()};return e.jsxs("div",{className:"space-y-3",children:[e.jsx(na,{options:{layout:"tabs",defaultValues:{billingDetails:{address:{country:"BR"}}}}}),e.jsx("button",{"data-testid":"button-chat-pay-card",onClick:u,disabled:w||!g,className:"w-full py-3 rounded-xl font-bold text-white text-[15px] transition-all flex items-center justify-center gap-2",style:{background:w?"#6B7280":"#10B981"},children:w?e.jsxs(e.Fragment,{children:[e.jsx(de,{className:"w-5 h-5 animate-spin"})," Processando..."]}):e.jsx(e.Fragment,{children:"Pagar agora"})})]})}function Da({mode:r="page",onClose:d,onExpand:g,variant:x="E"}){const w=i.useRef(null);if(!w.current&&r==="page")try{const t=sessionStorage.getItem("sabhia_chat_state_v5");t&&(w.current=JSON.parse(t),sessionStorage.removeItem("sabhia_chat_state_v5"))}catch{}const c=w.current,[u,m]=i.useState(c?.messages||[]),[h,E]=i.useState(c?.currentStep||"hook"),[D,k]=i.useState(!1),[$,ae]=i.useState(c?.sessionId||null),F=i.useRef($),U=t=>{F.current=t,ae(t)},[M,G]=i.useState(""),[Q,b]=i.useState(c?.choices||[]),[N,j]=i.useState(c?.inputConfig||null),[K,Se]=i.useState(c?.bookData||{}),n=i.useRef(K),_=t=>{Se(a=>{const s=typeof t=="function"?t(a):t;return n.current=s,s})},[Ce,H]=i.useState(-1),[pe,C]=i.useState(!1),[te,Ae]=i.useState(c?.planData||null),z=Ge(),[A,ka]=i.useState(c?.checkoutData||null),[J,Na]=i.useState(c?.availableBumps||[]),[I,Ie]=i.useState(new Set(c?.selectedBumps||[])),[V,ue]=i.useState(c?.checkoutPaymentMethod||null),[me,xe]=i.useState(null),[P,Oe]=i.useState(null),[De,he]=i.useState(!1),q=i.useRef(null),[be,ge]=i.useState(!1),[fe,Pe]=i.useState([]),[se,oe]=i.useState(null),[re,ie]=i.useState(null),we=i.useRef(null),W=i.useRef(null),B=i.useRef(c?.msgIdCounter||0),ve=i.useRef(!!c),v=i.useCallback(()=>{setTimeout(()=>{we.current?.scrollIntoView({behavior:"smooth"})},100)},[]),o=i.useCallback(async(t,a)=>{b([]),j(null);for(let s=0;s<t.length;s++){k(!0),v();const p=t[s],y=typeof p=="object",S=y?p.text:p,le=y?p.bold:!1,Le=S.length<30?400+Math.random()*300:S.length<80?600+Math.random()*500:800+Math.random()*600;await new Promise(Y=>setTimeout(Y,Le)),k(!1);const Ue=`msg-${++B.current}`;m(Y=>[...Y,{id:Ue,sender:"sabhia",text:S,time:T(),isBold:le}]),v(),s<t.length-1&&await new Promise(Y=>setTimeout(Y,200+Math.random()*200))}a?.()},[v]),Re=i.useCallback(t=>{const a=`msg-${++B.current}`;m(s=>[...s,{id:a,sender:"sabhia",text:"",isCard:!0,cardData:t,time:T()}]),v()},[v]),X=i.useCallback((t,a)=>{const s=`msg-${++B.current}`;m(p=>[...p,{id:s,sender:"sabhia",text:"",isImageGroup:!0,images:t,imageLayout:a||"grid",time:T()}]),v()},[v]),Z=i.useCallback(t=>{const a=`msg-${++B.current}`;m(s=>[...s,{id:a,sender:"sabhia",text:"",isImageGroup:!0,images:[t],imageLayout:"grid",time:T()}]),v()},[v]),ne=i.useCallback(t=>{const a=`msg-${++B.current}`;m(s=>[...s,{id:a,sender:"sabhia",text:"",isProofCard:!0,proofType:t,time:T()}]),v()},[v]),O=i.useCallback(t=>{const a=`msg-${++B.current}`;m(s=>[...s,{id:a,sender:"user",text:t,time:T()}]),v()},[v]),f=t=>new Promise(a=>setTimeout(a,t));i.useEffect(()=>{if(ve.current)return;ve.current=!0,Qe(),He().catch(()=>{}),Je();const t=new URLSearchParams(window.location.search),a={utmSource:t.get("utm_source")||void 0,utmMedium:t.get("utm_medium")||void 0,utmCampaign:t.get("utm_campaign")||void 0,utmContent:t.get("utm_content")||void 0,utmTerm:t.get("utm_term")||void 0},s=navigator.language||"pt-BR";fetch("/api/chat/session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...a,variant:x,locale:s})}).then(p=>p.json()).then(p=>{const y=p.sessionId||p.session?.id;y&&U(y)}).catch(()=>{}),l("hook")},[]);const R=i.useCallback(async(t,a)=>{if(F.current)try{await fetch("/api/chat/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:F.current,input:t,action:a})})}catch{}},[]),l=i.useCallback(async t=>{switch(E(t),t){case"hook":await o(["E se eu te dissesse que daqui a 1 hora você pode ter um livro completo, escrito do zero, pronto para vender na Amazon?"]),await f(1200),await o(["Parece impossível, né?","Mas não é.",{text:"Eu sou a Sábhia, e isso é exatamente o que eu faço. 📚",bold:!0}],()=>b(["COMO ASSIM?!","CONTA MAIS!"]));break;case"collect_name":await o(["Antes de te mostrar tudo, como posso te chamar?"],()=>{j({type:"text",placeholder:"Preencha seu nome..."})});break;case"proof_market":await o([`Prazer enorme, ${n.current.userName}! 💚`,"Deixa eu te mostrar algo que vai te surpreender...",{text:"Olha o que está acontecendo no YouTube agora:",bold:!0}]),Z("/images/proof-yt-5mil.png"),await f(600),await o(["Como ganhar R$5.000 por mês vendendo ebooks na Amazon..."]),Z("/images/proof-yt-40mil.png"),await f(600),await o(["Fature R$40 MIL com livros na Amazon..."]),Z("/images/proof-yt-270mil.png"),await f(600),await o(["R$270 MIL com ebook infantil na Amazon!",{text:"Pessoas comuns estão construindo verdadeiras fortunas vendendo ebooks.",bold:!0},"E sabe o que todas elas têm em comum?"],()=>b(["O QUÊ?","NÃO FAÇO IDEIA!"]));break;case"proof_results":await o([{text:"Elas precisaram de um livro para vender.",bold:!0},"E é exatamente isso que eu faço.","Olha só alguns dos livros que eu já escrevi 👇"],()=>{X(["/images/proof-bestseller-1.webp","/images/proof-bestseller-2.webp","/images/proof-bestseller-3.webp","/images/proof-bestseller-4.webp","/images/proof-bestseller-5.webp","/images/proof-bestseller-6.webp"]),setTimeout(async()=>{await o(["Esses são só ALGUNS dos mais de 100 MIL livros que eu escrevi n
1o meu primeiro ano. 🏆","Pastores, professores, empreendedores, donas de casa, aposentados...",{text:"Pessoas que tinham um sonho e eu transformei em realidade.",bold:!0}],()=>b(["INCRÍVEL!","QUERO ISSO PRA MIM!"]))},600)});break;case"testimonials":await o(["E não para por aí...",{text:"Olha só alguns dos autores que se tornaram BEST-SELLERS na Amazon com livros escritos pela Sábhia:",bold:!0}]),await f(400),X(["/images/author-valdinei.jpeg","/images/author-rui.jpeg","/images/author-rita.jpeg","/images/author-maria.jpeg","/images/author-jose-milaine.jpeg","/images/author-jailane.jpeg"]),await f(800),X(["/images/author-ferreira.jpeg","/images/author-carlos.jpeg","/images/author-robson.jpeg","/images/author-ana.jpeg","/images/author-adriano.jpeg","/images/author-alfredo.jpeg"]),await f(800),await o(["Pessoas comuns, como eu e você, que realizaram o sonho de se tornar autores best-sellers. 🏆",{text:`E agora é a SUA VEZ, ${n.current.userName}.`,bold:!0}],()=>b(["QUERO SER O PRÓXIMO!","INCRÍVEL!"]));break;case"awareness":await o([`Mas ${n.current.userName}, se é tão lucrativo...`,{text:"Por que tão poucas pessoas fazem isso?",bold:!0}]),await f(3e3),await o(["Consegue pensar no motivo?"],()=>b(["ACHO QUE SIM","NÃO SEI"]));break;case"problem_reveal":await o([{text:"A resposta é simples: ESCREVER O LIVRO.",bold:!0},"Semanas, meses, até ANOS para escrever um único livro.","E com tecnologia automatizada?"]),await f(800),await o(["Essa aqui é a nota de um texto padrão gerado de forma automática qualquer:"]),await f(400),ne("ai_detected"),await f(1200),await o(["Entende que só pedir para o GPT criar um livro para você NÃO FUNCIONA?","As plataformas como a Amazon já conseguem detectar e podem BLOQUEAR sua conta.",{text:"Resultado: a maioria DESISTE antes de começar.",bold:!0}],()=>b(["É VERDADE...","E COMO RESOLVER?"]));break;case"pain_amplify":await o([`E enquanto você pensa se vai ou não escrever, ${n.current.userName}...`,"Outras pessoas já estão publicando e faturando.",{text:"Cada dia que passa é um dia de vendas que você PERDE.",bold:!0},"Um livro na Amazon pode vender 24 horas por dia, 7 dias por semana, sem você precisar fazer nada.","Mas e se existisse uma forma de ter seu livro pronto HOJE?"],()=>b(["EXISTE?!","ME CONTA!"]));break;case"solution_reveal":await o([{text:"É exatamente por isso que eu existo. 💚",bold:!0},"Eu fui criada para escrever livros completos, com linguagem 100% humana."]),await f(600),await o(["Agora dá uma olhada em um texto escrito pela SÁBHIA, que foi altamente treinada para escrever como um humano..."]),await f(400),ne("human_passed"),await f(1200),await o(["É isso que você precisa, para vender ebooks nas plataformas...","Indetectável. 100% humano. Sem risco de plágio.","Em menos de 1 hora, seu livro está pronto. Com aproximadamente 100 a 130 páginas.","Sobre QUALQUER assunto que você quiser.","Quer ver como funciona na prática?"],()=>b(["QUERO VER!"]));break;case"show_editorial":await o(["Olha só 👇","Este é um exemplo de planejamento editorial que eu crio GRATUITAMENTE para você:"],()=>{const a=Array.from({length:10},(s,p)=>`/images/plan-pages/p${p+1}.webp`);X(a,"pages"),setTimeout(async()=>{await o([z?`Numa editora tradicional, só esse planejamento custa entre ${L(2e3)} e ${L(5e3)}.`:"Numa editora tradicional, só esse planejamento custa entre R$2.000 e R$5.000.",{text:"Aqui comigo? É DE GRAÇA.",bold:!0},"E o livro completo? Vou te contar já já..."],()=>b(["UAU!","IMPRESSIONANTE!"]))},800)});break;case"future_vision":await o([`Agora, ${n.current.userName}, fecha os olhos e imagina comigo...`]),await f(1500),await o(["Daqui a 1 hora, você abre seu e-mail e encontra seu livro completo. Escrito, estruturado, pronto.","Você publica na Amazon. Em poucos dias, começam as primeiras vendas.",{text:'Imagina mostrar para sua família: "Olha, eu sou autor(a) de um livro!"',bold:!0},"Imagina ver seu nome na capa de um livro na maior livraria do mundo. 🌍","Imagina acordar e ver notificações de vendas no celular.",{text:"Isso tudo pode acontecer HOJE.",bold:!0}],()=>b(["EU QUERO ISSO!","VAMOS FAZER!"]));break;case"value_stack":await o([`Perfeito, ${n.current.userName}! Então olha tudo que eu vou fazer por você:`,`✅ Planejamento editorial completo — DE GRAÇA
2✅ Livro completo de 100 a 130 páginas
3✅ Escrito do zero, sobre o tema que você escolher
4✅ 100% dos direitos autorais são SEUS
5✅ Conteúdo com linguagem humana, indetectável
6✅ Pronto em menos de 1 hora
7✅ Pode publicar na Amazon, Google Play, Apple Books`,z?`Uma editora profissional cobra de ${L(2e3)} a ${L(5e3)} para fazer isso.`:"Uma editora profissional cobra de R$2.000 a R$5.000 para fazer isso.",Ke("Algumas cobram até R$10.000.",1e4,z)]),await f(1e3),await o([{text:"Mas hoje, por tempo LIMITADO, eu estou com uma condição especial para você:",bold:!0},"Seu investimento hoje?"],()=>b(["QUANTO CUSTA?"]));break;case"price_reveal":await o([{text:z?`Apenas ${L(49.99)}.`:"Apenas R$49,99.",bold:!0}]),await f(800),await o([z?`Isso mesmo. Menos de ${L(50)}.`:"Isso mesmo. Menos de R$50.","Para ter um livro completo, profissional, pronto para publicar e começar a vender.","Menos que uma pizza. 🍕","Menos que um tanque de gasolina.",{text:"Para ter algo que pode mudar sua vida para sempre.",bold:!0}]),await f(600),await o(["⚠️ Esse valor é válido apenas para esta sessão.","Não sei até quando consigo manter esse preço.","Vamos começar?"],()=>b(["VAMOS! 🚀","AINDA TENHO DÚVIDAS"]));break;case"objection_handler":await o([`Fique tranquilo(a), ${n.current.userName}! Vou esclarecer tudo:`,{text:"📌 O livro é realmente meu?",bold:!0},"SIM! 100% dos direitos autorais são seus. Você é o(a) autor(a).",{text:"📌 E se eu não gostar do resultado?",bold:!0},"O planejamento editorial pode ser refeito quantas vezes você quiser, até ficar perfeito. E quando o planejamento fica perfeito, o livro sai perfeitíssimo — ele é a espinha dorsal de tudo.",{text:"📌 Funciona para qualquer tema?",bold:!0},"SIM! Qualquer assunto. Ficção, não-ficção, infantil, técnico, religioso...",{text:"📌 As plataformas não vão detectar?",bold:!0},"Não! Minha tecnologia escreve com linguagem 100% humana.","Agora sim, podemos começar? 😊"],()=>
7b(["AGORA SIM, VAMOS! 🚀"]));break;case"ready_to_start":await o([`Então vamos lá, ${n.current.userName}! 💪`,"Antes de começar, me conta uma coisa:"],()=>b(["JÁ TENHO MINHA IDEIA! 💡","QUERO AJUDA PARA PLANEJAR 🤝"]));break;case"branch_choice":await o(["Eu vou precisar de 3 informações rápidas para criar seu livro:",`1️⃣ O tema do livro
82️⃣ O objetivo do livro
93️⃣ O público-alvo`,"É bem rápido! Vamos para a primeira?"],()=>b(["VAMOS!"]));break;case"collect_title":await o(["Ótimo! Você já sabe o que quer! 💪","Qual o título do seu livro?"],()=>{j({type:"text",placeholder:"Digite o título do seu livro..."})});break;case"collect_summary":await o([`"${n.current.title}" — que título poderoso! 🔥`,"Agora me conte um breve resumo do conteúdo que você quer no livro.","Seja rico(a) em detalhes! Quanto mais informação, melhor vai ficar."],()=>{j({type:"textarea",placeholder:"Descreva o conteúdo, temas, capítulos, ideias que quer abordar..."})});break;case"collect_author":await o(["Maravilha! Esse livro vai ser incrível! 📚","Qual vai ser o nome do autor(a) na capa?"],()=>{j({type:"text",placeholder:n.current.userName||"Nome do autor(a)..."})});break;case"collect_topic":await o(["Sobre o que vai ser seu livro? Me conta! 📖","Pode ser qualquer assunto: autoajuda, receitas, ficção, negócios, infantil, religioso..."],()=>{j({type:"textarea",placeholder:"Ex: Como emagrecer em 30 dias sem dietas malucas..."})});break;case"collect_objective":await o(["Excelente tema! 💡","Agora, me diga: qual é o objetivo do seu livro?","O que você quer que o leitor aprenda ou sinta ao final da leitura?"],()=>{j({type:"textarea",placeholder:"Ex: Que o leitor aprenda a emagrecer de forma saudável e sustentável..."})});break;case"collect_audience":await o(["Entendi perfeitamente! 🎯","E para quem é esse livro?","Quem é o público-alvo ideal?"],()=>{j({type:"textarea",placeholder:"Ex: Mulheres acima de 30 anos que querem emagrecer..."})});break;case"collect_plan_whatsapp":await o(["Perfeito! Antes de eu criar seu planejamento, me passa seu WhatsApp? 📱","É por lá que eu te aviso quando tudo estiver pronto."],()=>{j({type:"tel",placeholder:"(00) 00000-0000"})});break;case"generating_plan":await o(["Que tema incrível! Deixa eu criar algo especial para você..."],()=>{C(!0),H(0)}),setTimeout(()=>H(1),3e3),setTimeout(()=>H(2),6e3);{let a=!1;try{const s=[n.current.topic,n.current.objective?`Objetivo: ${n.current.objective}`:"",n.current.audience?`Público-alvo: ${n.current.audience}`:""].filter(Boolean).join(". "),p=await fetch("/api/chat/generate-plan",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:F.current,topic:s,phone:n.current.phone})});if(p.ok){const y=await p.json();if(y.title||y.plan){const S=y.plan||y;Ae(S),n.current={...n.current,title:S.title,subtitle:S.subtitle,summary:S.summary,language:"Português"},_(le=>({...le,title:S.title,subtitle:S.subtitle,summary:S.summary,language:"Português"})),a=!0}}}catch{}await f(8e3),C(!1),H(-1),a?l("show_plan"):await o(["Ops, tive um probleminha técnico. Mas não se preocupe!","Me conta de novo sobre qual assunto você gostaria de escrever?"],()=>{j({type:"textarea",placeholder:"Ex: Quero um livro sobre como viver melhor depois dos 60 anos"}),E("collect_topic")})}break;case"show_plan":{const a=n.current;!!a.hasOwnIdea?await o(["Seu planejamento editorial está pronto! ✨",`O título: "${a.title||""}"`,a.author&&a.author!==a.userName?`Autor(a): ${a.author}`:"",{text:"O planejamento completo, com todos os capítulos e estrutura, vai estar disponível para você dentro da plataforma.",bold:!0}].filter(Boolean)):await o(["Prontinho! Seu planejamento editorial ficou incrível! ✨",`O título ficou: "${a.title||""}"`,{text:"O planejamento completo, em altíssimo nível, vai estar disponível para você dentro da plataforma.",bold:!0},"Lá você poderá ver todos os detalhes: capítulos, estrutura, sinopse e muito mais."]),await f(800),await o([{text:`Esse livro pode ser seu ainda hoje, ${a.userName||""}.`,bold:!0},"Posso avançar e preparar tudo para você?"],()=>b(["PODE SIM! 👍","QUERO COMEÇAR DO ZERO"]))}break;case"collect_email":await o(["Estamos quase lá! 🎉","Para eu gerar seu livro, preciso de alguns dados.","Qual seu melhor e-mail?"],()=>{j({type:"email",placeholder:"Preencha seu e-mail..."})});break;case"confirm_email":{const a=n.current.email;await o([`${a}`,"Está correto?"],()=>b(["SIM, ESTÁ CERTO!","PRECISO CORRIGIR"]))}break;case"collect_whatsapp":await o(["Perfeito! E qual seu WhatsApp? 📱"],()=>{j({type:"tel",placeholder:"(00) 00000-0000"})});break;case"confirm_whatsapp":{const a=Ne(n.current.phone||"");await o([`${a}`,"Correto?"],()=>
9b(["SIM, ESTÁ CERTO!","ERREI, PRECISO CORRIGIR"]))}break;case"countdown":await o(["Perfeito! Assim que receber, você poderá analisar se está de acordo com o que deseja.","Se já quiser que eu inicie a escrita, é só fazer o pagamento e já começo a escrever seu livro!",{text:"Seu livro está a um clique de se tornar realidade! 🚀",bold:!0},"Você tem um horário reservado exclusivo para finalizar seu pedido.","Estou te direcionando em:"]),ge(!0);for(let a=5;a>=1;a--)await f(800),Pe(s=>[...s,a]),v();await f(600),ge(!1),l("sending_plan");break;case"sending_plan":await o(["Preparando tudo para você..."],()=>{C(!0),H(0)});{const a=setTimeout(()=>{C(!1),console.error("[CHAT_V5] Safety timeout: generating overlay stuck for 30s")},3e4);try{if(n.current.hasOwnIdea&&n.current.title)try{await fetch("/api/chat/step",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:F.current,input:n.current.title,action:"set_title"})})}catch{}const s=await fetch("/api/chat/confirm-contact",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:F.current,email:n.current.email,userName:n.current.userName,phone:n.current.phone})});if(s.ok){const p=await s.json();try{Xe(n.current.email),Ye(n.current.email)}catch{}if(p.checkoutSessionId&&p.checkoutToken)setTimeout(()=>{clearTimeout(a),C(!1),window.location.href=`/checkout/${p.checkoutSessionId}?token=${p.checkoutToken}`},2500);else if(p.checkoutUrl)try{const y=new URL(p.checkoutUrl);setTimeout(()=>{clearTimeout(a),C(!1),window.location.href=y.pathname+y.search},2500)}catch{clearTimeout(a),C(!1),await o(["Ops, houve um problema ao abrir o checkout. Tente novamente."]),b(["TENTAR NOVAMENTE"]),E("countdown")}else clearTimeout(a),C(!1),console.error("[CHAT_V5] No checkout data in confirm-contact response:",JSON.stringify(p)),await o(["Ops, não conseguimos criar o checkout. Por favor, tente novamente."]),b(["TENTAR NOVAMENTE"]),E("countdown")}else{clearTimeout(a);const p=await s.json().catch(()=>({}));console.error("[CHAT_V5] confirm-contact failed:",s.status,JSON.stringify(p)),C(!1),await o([`Ops, algo deu errado: ${p?.message||"erro desconhecido"}. Tente novamente.`]),b(["TENTAR NOVAMENTE"]),E("countdown")}}catch(s){clearTimeout(a),console.error("[CHAT_V5] sending_plan error:",s),C(!1),await o(["Ops, algo deu errado. Tente novamente em alguns instantes."]),b(["TENTAR NOVAMENTE"]),E("countdown")}}break;case"checkout_bumps":J.length>0?await o(["Seu livro já está sendo preparado! 📚","Antes de pagar, veja o que mais posso fazer por você:"]):(await o(["Seu livro já está sendo preparado! 📚"]),l("checkout_payment"));break;case"checkout_payment":await o(["Como você prefere pagar?"]);break;case"checkout_processing":await o(["Aguardando a confirmação do seu pagamento..."]);break;case"checkout_success":await o(["Pagamento confirmado! ✅",`${n.current.userName}, parabéns! Você acaba de dar o primeiro passo para se tornar um(a) autor(a) publicado(a)! 🎉`,"Seu livro está sendo gerado agora mesmo!","Em breve você poderá acessá-lo na plataforma e publicar na Amazon.",{text:"Bem-vindo(a) ao clube dos autores! 📚✨",bold:!0}]);break}},[o,Re,X,Z,ne,v,$,K,te,z]),Te=i.useCallback(async t=>{switch(O(t),b([]),R(t,h),h){case"hook":l("collect_name");break;case"proof_market":l("proof_results");break;case"proof_results":l("testimonials");break;case"testimonials":l("awareness");break;case"awareness":l("problem_reveal");break;case"problem_reveal":l("pain_amplify");break;case"pain_amplify":l("solution_reveal");break;case"solution_reveal":l("show_editorial");break;case"show_editorial":l("future_vision");break;case"future_vision":l("value_stack");break;case"value_stack":l("price_reveal");break;case"price_reveal":t.includes("DÚVIDAS")||t.includes("dúvidas")?l("objection_handler"):l("ready_to_start");break;case"objection_handler":l("ready_to_start");break;case"ready_to_start":t.includes("MINHA IDEIA")||t.includes("minha ideia")?l("collect_title"):l("branch_choice");break;case"branch_choice":l("collect_topic");break;case"show_plan":t.includes("ZERO")||t.includes("zero")?(n.current={...n.current,hasOwnIdea:!1,title:void 0,subtitle:void 0,summary:void 0},_(a=>({...a,hasOwnIdea:!1,title:void 0,subtitle:void 0,summary:void 0})),l("collect_topic")):l("collect_email");break;case"confirm_email":t.includes("CORRIGIR")||t.includes("corrigir")?l
9("collect_email"):(n.current.phone||"").replace(/\D/g,"").length>=10?l("countdown"):l("collect_whatsapp");break;case"confirm_whatsapp":t.includes("CORRIGIR")||t.includes("corrigir")||t.includes("ERREI")?l("collect_whatsapp"):l("countdown");break;case"countdown":(t.includes("TENTAR")||t.includes("tentar"))&&l("sending_plan");break}},[h,O,l,R]),ee=i.useCallback(async t=>{const a=(t??M).trim();if(a){if(h==="collect_plan_whatsapp"){const s=a.replace(/\D/g,"");if(s.length<10||s.length>15){G(a),await o(["Hmm, esse número não parece completo. 🤔","Envie seu WhatsApp com DDD, por exemplo: (11) 91234-5678"],()=>{j({type:"tel",placeholder:"(00) 00000-0000"})});return}O(a),G(""),j(null),R(a,h),n.current={...n.current,phone:s},_(p=>({...p,phone:s})),l("generating_plan");return}switch(O(a),G(""),j(null),R(a,h),h){case"collect_name":n.current={...n.current,userName:a,author:a},_(s=>({...s,userName:a,author:a})),l("proof_market");break;case"collect_topic":n.current={...n.current,topic:a},_(s=>({...s,topic:a})),l("collect_objective");break;case"collect_objective":n.current={...n.current,objective:a},_(s=>({...s,objective:a})),l("collect_audience");break;case"collect_audience":n.current={...n.current,audience:a},_(s=>({...s,audience:a})),l("collect_plan_whatsapp");break;case"collect_title":n.current={...n.current,title:a,hasOwnIdea:!0},_(s=>({...s,title:a,hasOwnIdea:!0})),R(a,"collect_title"),l("collect_summary");break;case"collect_summary":n.current={...n.current,summary:a,topic:a},_(s=>({...s,summary:a,topic:a})),R(a,"collect_summary"),l("collect_author");break;case"collect_author":n.current={...n.current,author:a},_(s=>({...s,author:a})),R(a,"collect_author"),l("show_plan");break;case"collect_email":if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a)){await o(["Hmm, esse não parece ser um email válido. 🤔","Tente novamente com seu email correto, por exemplo: [email protected]"],()=>{j({type:"email",placeholder:"Preencha seu e-mail..."})});return}n.current={...n.current,email:a},_(s=>({...s,email:a})),l("confirm_email");break;case"collect_whatsapp":n.current={...n.current,phone:a},_(s=>({...s,phone:a})),l("confirm_whatsapp");break}}},[M,h,O,o,l,R]),$e=i.useCallback(t=>{Ie(a=>{const s=new Set(a);return t==="combo_publish"?s.has("combo_publish")?s.delete("combo_publish"):(s.clear(),s.add("combo_publish")):(s.delete("combo_publish"),s.has(t)?s.delete(t):s.add(t)),s})},[]),Fe=i.useCallback(()=>{O(I.size>0?`Selecionei ${I.size} produto(s) adicional(is)`:"Sem produtos adicionais"),l("checkout_payment")},[I,O,l]),ye=i.useCallback(async t=>{if(A){ue(t),O(t==="pix"?"Quero pagar com PIX":"Quero pagar com Cartão");try{const a=await fetch(`/api/checkout/${A.checkoutSessionId}/pay`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:A.checkoutToken,selectedBumps:Array.from(I),paymentMethod:t})});if(a.ok){const s=await a.json();xe(s.clientSecret),l("checkout_processing"),t==="pix"&&(q.current=setInterval(async()=>{try{const p=await fetch(`/api/checkout/${A.checkoutSessionId}/status?token=${A.checkoutToken}`);if(p.ok){const y=await p.json();if(y.status==="paid"){q.current&&clearInterval(q.current),l("checkout_success");return}y.pixData&&Oe(y.pixData)}}catch{}},3e3))}else await o(["Ops, houve um erro ao processar. Tente novamente."]),l("checkout_payment")}catch{await o(["Ops, houve um erro de conexão. Tente novamente."]),l("checkout_payment")}}},[A,I,O,l,o]),Me=i.useCallback(()=>{q.current&&clearInterval(q.current),l("checkout_success")},[l]),qe=i.useCallback(async t=>{await o([`Erro no pagamento: ${t}`,"Tente novamente ou escolha outro método."]),xe(null),ue(null),l("checkout_payment")},[o,l]),Be=i.useCallback(()=>{P?.qrCode&&(navigator.clipboard.writeText(P.qrCode),he(!0),setTimeout(()=>he(!1),3e3))},[P]);i.useEffect(()=>()=>{q.current&&clearInterval(q.current)},[]),i.useEffect(()=>{v()},[u,D,pe,Q,be,fe,v]),i.useEffect(()=>{N&&W.current&&setTimeout(()=>W.current?.focus(),300)},[N]);const je=i.useCallback(()=>{try{sessionStorage.setItem("sabhia_chat_state_v5",JSON.stringify({messages:u,currentStep:h,sessionId:$,choices:Q,inputConfig:N,bookData:K,planData:te,msgIdCounter:B.current,checkoutData:A,availableBumps:J,selectedBumps:Array.from(I),checkoutPaymentMethod:V}))}catch{}},[u,h,$,Q,N,K,te,A,J,I,V]);i.useEffect(()=>{h!=="hook"&&$&&je()},[h,u.length,I,V]);const ke=xa[h]||0,ze=t=>t===0?!0:u[t].sender!==u[t-1].sender,Ve=!!N;return e.jsxs("div",{className:`${r==="widget"?"h-full min-h-0":"h-[100dvh]"} flex flex-col overflow-hidden`,style:{background:"#ECE5DD"},"data-testid":"chat-page-v5","data-chat-mode":r,children:[se&&e.jsx(ba,{images:se.images,currentIndex:se.index,onClose:()=>oe(null),onNav:t=>oe(a=>a?{...a,index:(a.index+t+a.images.length)%a.images.length}:null)}),re&&e.jsx(ga,{pages:re.pages,currentIndex:re.index,onClose:()=>ie(null),onNav:t=>ie(a=>a?{...a,index:Math.max(0,Math.min(a.pages.length-1,a.index+t))}:null)}),e.jsx("style",{children:`
10        @keyframes waFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
11        @keyframes waScaleIn { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }
12        @keyframes waSlideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
13        @keyframes waDotPulse { 0%, 60%, 100% { opacity: 0.3; transform: scale(0.85); } 30% { opacity: 1; transform: scale(1.1); } }
14        @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
15        @keyframes pulseGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.3); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }
16        .wa-dot { width: 7px; height: 7px; border-radius: 50%; background: #9CA3AF; animation: waDotPulse 1.4s ease-in-out infinite; display: inline-block; }
17        .wa-tail-l { position: absolute; bottom: 0; left: -8px; width: 8px; height: 13px; }
18        .wa-tail-l::before { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 0; border-bottom: 0px solid transparent;
18 border-top: 13px solid transparent; border-right: 8px solid #FFFFFF; }
19        .wa-tail-r { position: absolute; bottom: 0; right: -8px; width: 8px; height: 13px; }
20        .wa-tail-r::before { content: ''; position: absolute; bottom: 0; right: 0; width: 0; height: 0; border-bottom: 0px solid transparent; border-top: 13px solid transparent; border-left: 8px solid #D9FDD3; }
21        .sabhia-choice-btn {
22          display: flex; align-items: center; justify-content: center; width: 100%;
23          padding: 15px 24px; border-radius: 16px;
24          background: linear-gradient(135deg, #FFFFFF 0%, #F0FDF9 100%);
25          border: 1.5px solid rgba(16,185,129,0.25); color: #065F46;
26          font-size: 15px; font-weight: 600; cursor: pointer;
27          transition: all 0.25s cubic-bezier(0.4,0,0.2,1); text-align: center;
28          box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(16,185,129,0.08); line-height: 1.3;
29          backdrop-filter: blur(8px); letter-spacing: 0.01em;
30          position: relative; overflow: hidden;
31        }
32        .sabhia-choice-btn::before {
33          content: ''; position: absolute; inset: 0; border-radius: 16px;
34          background: linear-gradient(135deg, transparent, rgba(16,185,129,0.06), transparent);
35          opacity: 0; transition: opacity 0.3s ease;
36        }
37        .sabhia-choice-btn:hover { background: linear-gradient(135deg, #F0FDF9 0%, #ECFDF5 100%); border-color: rgba(16,185,129,0.5); box-shadow: 0 4px 20px rgba(16,185,129,0.15), 0 2px 6px rgba(0,0,0,0.04); transform: translateY(-2px); }
38        .sabhia-choice-btn:hover::before { opacity: 1; }
39        .sabhia-choice-btn:active { transform: translateY(0) scale(0.98); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
40        .sabhia-input-wrap {
41          background: #FFFFFF;
42          border: 1.5px solid #E5E7EB;
43          border-radius: 14px;
44          transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
45          box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
46          overflow: hidden;
47        }
48        .sabhia-input-wrap:focus-within {
49          border-color: #10B981;
50          box-shadow: 0 0 0 3px rgba(16,185,129,0.1), 0 2px 12px rgba(16,185,129,0.08);
51        }
52        .sabhia-send-btn {
53          background: linear-gradient(135deg, #10B981, #059669);
54          color: white; font-weight: 700; font-size: 15px;
55          border: none; cursor: pointer; letter-spacing: 0.02em;
56          transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
57          box-shadow: 0 2px 8px rgba(16,185,129,0.3);
58          animation: pulseGlow 2.5s ease-in-out infinite;
59        }
60        .sabhia-send-btn:hover { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 4px 16px rgba(16,185,129,0.4); transform: translateY(-1px); }
61        .sabhia-send-btn:active { transform: translateY(0) scale(0.97); box-shadow: 0 1px 4px rgba(16,185,129,0.2); }
62        [data-chat-mode="widget"] [data-msg-row] { padding-left: 14px !important; padding-right: 14px !important; }
63        [data-chat-mode="widget"] [data-msg-bubble] { max-width: 85% !important; }
64        [data-chat-mode="widget"] [data-msg-images] { max-width: 85% !important; }
65        [data-chat-mode="widget"] .sabhia-choice-btn { padding: 12px 16px; font-size: 14px; }
66        [data-chat-mode="widget"] [data-choices-row] { padding-left: 14px !important; padding-right: 14px !important; }
67        [data-chat-mode="widget"] [data-inline-input] { padding-left: 14px !important; padding-right: 14px !important; }
68      `}),e.jsxs("div",{className:"shrink-0 relative",style:{background:"linear-gradient(135deg, #0F0F0F 0%, #1A1A2E 50%, #0F0F0F 100%)"},children:[e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[3px] overflow-hidden",style:{background:"rgba(255,255,255,0.03)"},children:e.jsx("div",{className:"h-full transition-all duration-700 ease-out rounded-full",style:{width:`${ke}%`,background:"linear-gradient(90deg, #10B981, #06B6D4, #8B5CF6)",backgroundSize:"200% 100%",animation:ke>0?"shimmer 3s linear infinite":"none"}})}),e.jsxs("div",{className:"max-w-[800px] mx-auto flex items-center gap-[12px] px-4 py-[12px]",children:[r==="page"&&e.jsx("a",{href:"/",className:"flex items-center transition-colors text-white/60 hover:text-white","data-testid":"chat-back-btn",children:e.jsx(ca,{className:"w-[22px] h-[22px]"})}),e.jsxs("div",{className:"relative",children:[e.jsx("img",{src:ua,alt:"Sábhia",className:"w-[42px] h-[42px] rounded-full object-cover shrink-0 ring-2 ring-emerald-500/30"}),e.jsx("div",{className:"absolute bottom-0 right-0 w-[11px] h-[11px] rounded-full border-2 border-[#111]",style:{background:"#10B981"}})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[16.5px] font-semibold text-white leading-tight tracking-tight",children:"Sábhia"}),e.jsx("p",{className:"text-[12.5px] leading-tight font-medium",style:{color:"#34D399"},children:"online agora"})]}),e.jsxs("div",{className:"flex items-center gap-5 text-white/40",children:[e.jsx(We,{className:"w-[20px] h-[20px]"}),e.jsx(Ze,{className:"w-[18px] h-[18px]"}),e.jsx(da,{className:"w-[20px] h-[20px]"}),r==="widget"&&g&&e.jsx("button",{onClick:()=>{je(),g()},className:"text-white/60 hover:text-white transition-colors","data-testid":"chat-expand-btn",children:e.jsx(pa,{className:"w-[18px] h-[18px]"})})]})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden py-3",style:{background:"linear-gradient(180deg, #F5F0EB 0%, #ECE5DD 30%, #ECE5DD 100%)"},children:e.jsxs("div",{className:"max-w-[800px] mx-auto flex flex-col",children:[e.jsx("div",{className:"flex justify-center mb-4 mt-1",children:e.jsx("div",{className:"px-4 py-[6px] rounded-[10px] text-[12px] font-medium tracking-wide",style:{background:"rgba(255,255,255,0.85)",color:"#8696A0",boxShadow:"0 1px 6px rgba(0,0,0,0.06)",backdropFilter:"blur(8px)"},children:"HOJE"})}),u.map((t,a)=>e.jsx(fa,{msg:t,showTail:ze(a),onImageClick:(s,p)=>oe({images:s,index:p}),onDocClick:(s,p)=>ie({pages:s,index:p})},t.id)),D&&e.jsx(ha,{}),pe&&e.jsx(wa,{phase:Ce}),be&&fe.map(t=>e.jsx(va,{number:t},t)),Q.length>0&&e.jsx("div",{className:"flex justify-end px-[18px] sm:px-[63px] mt-3 mb-2","data-choices-row":!0,style:{animation:"waSlideUp .35s cubic-bezier(0.4,0,0.2,1)"},children:e.jsx("div",{className:"w-full max-w-[85%] sm:max-w-[65%] flex flex-col gap-[10px]",children:Q.map((t,a)=>e.jsx("button",{onClick:()=>Te(t),className:"sabhia-choice-btn","data-testid":`choice-btn-${a}`,children:t},a))})}),h==="checkout_bumps"&&J.length>0&&e.jsxs("div",{className:"px-[18px] sm:px-[63px] mt-3 mb-2 flex flex-col gap-[10px]",style:{animation:"waFadeIn .3s ease"},children:[e.jsx("div",{className:"flex px-0 mb-[3px]",children:e.jsxs("div",{className:"relative bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] rounded-bl-[3px] overflow-hidden max-w-[85%] sm:max-w-[65%]",children:[e.jsx("div",{className:"wa-tail-l"}),e.jsx("div",{className:"h-[3px]",style:{background:"#10B981"}}),e.jsxs("div",{className:"px-[12px] py-[8px]",children:[e.jsx("p",{className:"text-[11px] font-semibold mb-2",style:{color:"#10B981"},children:"Geração do Livro — R$49,99"}),e.jsx("p",{className:"text-[12px]",style:{color:"#667781"},children:"Incluído no seu pedido"})]})]})}),J.map(t=>{const a=ya[t.type];if(!a)return null;const s=I.has(t.type);return e.jsx("div",{onClick:()=>$e(t.type),className:"cursor-pointer","data-testid":`bump-card-${t.type}`,children:e.jsx("div",{className:`bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] overflow-hidden transition-all ${s?"ring-2 ring-emerald-500":""}`,children:e.jsxs("div",{className:"px-[12px] py-[10px] flex items-start gap-3",children:[e.jsx("div",{className:`w-[22px] h-[22px] rounded-full border-2 flex items-center justify-center shrink-0 mt-0.5 transition-all ${s?"border-emerald-500 bg-emerald-500":"border-gray-300"}`,children:s&&e.jsx(_e,{className:"w-3 h-3 text-white"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{children:a.emoji}),e.jsx("span",{className:"text-[13.5px] font-semibold",style:{color:"#111B21"},children:a.name})]}),e.jsx("p",{className:"text-[12px] mt-0.5",style:{color:"#667781"},children:a.shortDesc}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[t.originalPrice&&e.jsxs("span",{className:"text-[11px] line-through",style:{color:"#999"},children:["R$",t.originalPrice.toFixed(2)]}),e.jsxs("span",{className:"text-[13px] font-bold",style:{color:"#10B981"},children:["R$",t.price.toFixed(2)]}),t.discountPercent&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-semibold bg-emerald-100 text-emerald-700",children:[t.discountPercent,"% OFF"]})]})]})]})})},t.type)}),e.jsx("button",{onClick:Fe,className:"sabhia-choice-btn",style:{background:"linear-gradient(135deg, #10B981, #059669)",color:"#fff",border:"none"},"data-testid":"checkout-proceed-payment",children:"Continuar para pagamento"})]}),h==="checkout_payment"&&!V&&e.jsx("div",{className:"flex justify-end px-[18px] sm:px-[63px] mt-3 mb-2",style:{animation:"waSlideUp .35s cubic-bezier(0.4,0,0.2,1)"},children:e.jsxs("div",{className:"w-full max-w-[85%] sm:max-w-[65%] flex flex-col gap-[10px]",children:[e.jsxs("button",{onClick:()=>ye("pix"),className:"sabhia-choice-btn flex items-center justify-center gap-2","data-testid":"checkout-pay-pix",children:[e.jsx(ea,{className:"w-5 h-5"})," PIX — Aprovação instantânea"]}),e.jsxs("button",{onClick:()=>ye("card"),className:"sabhia-choice-btn flex items-center justify-center gap-2","data-testid":"checkout-pay-card",children:[e.jsx(aa,{className:"w-5 h-5"})," Cartão de Crédito"]})]})}),h==="checkout_processing"&&V==="pix"&&e.jsx("div",{className:"px-[18px] sm:px-[63px] mt-3 mb-2",style:{animation:"waFadeIn .3s ease"},children:e.jsx("div",{className:"bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] overflow-hidden p-4",children:P?e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-[13px] font-semibold text-center",style:{color:"#111B21"},children:"Pagamento via PIX"}),P.imageUrl&&e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:P.imageUrl,alt:"PIX QR Code",className:"w-40 h-40 rounded-lg bg-white p-1 border","data-testid":"pix-qr-image"})}),e.jsx("p",{className:"text-[11px] text-center",style:{color:"#667781"},children:"Escaneie o QR Code ou copie o código abaixo:"}),P.qrCode&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg p-2",style:{background:"#F0F2F5"},children:[e.jsx("input",{type:"text",value:P.qrCode,readOnly:!0,className:"flex-1 bg-transparent text-[11px] truncate outline-none",style:{color:"#111B21"},"data-testid":"input-chat-pix-code"}),e.jsx("button",{onClick:Be,className:"flex items-center gap-1 px-2 py-1 rounded-lg text-white text-[11px] shrink-0",style:{background:"#10B981"},"data-testid":"button-chat-copy-pix",children:De?e.jsxs(e.Fragment,{children:[e.jsx(ta,{className:"w-3 h-3"})," Copiado!"]}):e.jsxs(e.Fragment,{children:[e.jsx(sa,{className:"w-3 h-3"})," Copiar"]})})]}),e.jsxs("div",{className:"flex items-center justify-center gap-2 text-[12px]",style:{color:"#667781"},children:[e.jsx(de,{className:"w-3 h-3 animate-spin"})," Aguardando pagamento..."]})]}):e.jsxs("div",{className:"flex flex-col items-center gap-3 py-4",children:[e.jsx(de,{className:"w-7 h-7 animate-spin",style:{color:"#10B981"}}),e.jsx("p",{className:"text-[13px]",style:{color:"#667781"},children:"Gerando cobrança PIX..."})]})})}),h==="checkout_processing"&&V==="card"&&me&&e.jsx("div",{className:"px-[18px] sm:px-[63px] mt-3 mb-2",style:{animation:"waFadeIn .3s ease"},children:e.jsxs("div",{className:"bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] overflow-hidden p-4",children:[e.jsx("p",{className:"text-[13px] font-semibold mb-3",style:{color:"#111B21"},children:"Pagamento com Cartão"}),e.jsx(oa,{stripe:ma(),options:{clientSecret:me,appearance:{theme:"stripe",variables:{colorPrimary:"#10B981"}}},children:e.jsx(ja,{onSuccess:Me,onError:qe})})]})}),h==="checkout_success"&&A&&e.jsx("div",{className:"px-[18px] sm:px-[63px] mt-3 mb-2",style:{animation:"waFadeIn .3s ease"},children:e.jsxs("div",{className:"bg-white shadow-[0_1px_0.5px_rgba(11,20,26,0.13)] rounded-[7.5px] overflow-hidden p-4 text-center",children:[e.jsx("div",{className:"text-[48px] mb-2",style:{animation:"waScaleIn .5s ease"},children:"🎊"}),e.jsx("p",{className:"text-[16px] font-bold mb-1",style:{color:"#111B21"},children:"Pagamento Confirmado!"}),e.jsx("p",{className:"text-[13px] mb-4",style:{color:"#667781"},children:"Seu livro está sendo gerado"}),e.jsxs("a",{href:`/book/${A.bookId}`,className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl font-bold text-white text-[15px]",style:{background:"#10B981"},"data-testid":"checkout-success-view-book",children:[e.jsx(Ee,{className:"w-5 h-5"})," Ver meu livro"]})]})}),Ve&&e.jsx("div",{className:"flex justify-end px-[18px] sm:px-[63px] mt-3 mb-3",style:{animation:"waSlideUp .35s cubic-bezier(0.4,0,0.2,1)"},"data-testid":"inline-input-card","data-inline-input":!0,children:e.jsx("div",{className:"w-full max-w-[85%] sm:max-w-[65%]",children:e.jsx("div",{className:"sabhia-input-wrap",children:N?.type==="textarea"?e.jsxs("div",{className:"flex items-end",children:[e.jsx("textarea",{ref:W,value:M,onChange:t=>{G(t.target.value);const a=t.target;a.style.height="auto",a.style.height=Math.min(a.scrollHeight,140)+"px"},onKeyDown:t=>{t.key==="Enter"&&!t.shiftKey&&(t.preventDefault(),ee())},placeholder:N.placeholder,rows:2,className:"flex-1 px-[16px] py-[14px] text-[15px] outline-none resize-none leading-[22px] bg-transparent",style:{color:"#111B21",maxHeight:140,minHeight:52,border:"none"},"data-testid":"chat-textarea"}),e.jsx("button",{onClick:()=>ee(),className:"sabhia-send-btn shrink-0 rounded-[10px] px-[20px] py-[12px] m-[6px]","data-testid":"send-btn",children:"Enviar"})]}):e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{ref:W,type:N?.type==="tel"?"tel":N?.type||"text",value:N?.type==="tel"?Ne(M):M,onChange:t=>G(N?.type==="tel"?t.target.value.replace(/\D/g,""):t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),ee())},placeholder:N?.placeholder,className:"flex-1 px-[16px] py-[14px] text-[15px] outline-none min-w-0 bg-transparent",style:{color:"#111B21",height:52,border:"none"},"data-testid":"chat-input"}),e.jsx("button",{onClick:()=>ee(),className:"sabhia-send-btn shrink-0 rounded-[10px] px-[20px] py-[12px] m-[6px]","data-testid":"send-btn",children:"Enviar"})]})})})}),e.jsx("div",{ref:we})]})})]})}export{Da as default};

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.