1import{j as e}from"./vendor-motion-CPxq9Xvn.js";import{r as u}from"./vendor-i18n-CO3kK2bH.js";import{a1 as ae,a3 as se,ai as te,ao as V,j as ie,aD as F,dJ as de,l as U,S as T,ap as re,a7 as R,C as S,J as ce,K,an as xe,az as me,u as O,ar as H,f as he,X as pe,aH as ue}from"./index-CFAvyuXu.js";import{f as ge,a as be,P as G,S as J}from"./publication-pipeline-DFwPsRBR.js";import{M as W}from"./mobile-pipeline-bar-wnI4Ws72.js";import{H as fe}from"./isbn-checkout-modal-_kHz7p1I.js";import{P as Y,a as je}from"./pdf-preview-DAjEMCVx.js";import{A as le}from"./arrow-left-DY50GvQQ.js";import{C as Ne}from"./circle-alert-CixghSwT.js";import{F as N}from"./file-text-DjkUcFVd.js";import{S as L}from"./stamp-BZO_gJDT.js";import{D as B}from"./download-B7FtiUYJ.js";import{C as q}from"./circle-x-DhBMAj3Y.js";import{F as we}from"./fingerprint-D5-6a3FO.js";import{B as Z}from"./book-marked-3-KNVwiq.js";import{C as ve}from"./cloud-upload-D4KUxAWd.js";import"./vendor-react-CQmBMThG.js";import"./alert-dialog-C9feqA9b.js";import"./select-B26x0xAv.js";import"./index-BdQq_4o_.js";import"./globe-D0MKCb1Y.js";import"./barcode-DlYH0ciP.js";import"./megaphone-CJoAWoYP.js";import"./pix-qr-image-D45mJvPS.js";import"./smartphone-B4uVuS8T.js";import"./maximize-2-BDHmjU2g.js";function M(a){const t=a?.trim()||"ficha-catalografica";return/\.[a-zA-Z0-9]{2,5}$/.test(t)?t:t+".pdf"}function ye(a,t){if(t)return{kind:"done",label:"Ficha pronta",title:"Sua Ficha Catalográfica está pronta!",subtitle:"Elaborada e assinada pela bibliotecária oficial da Sábhia (CRB). Baixe seu arquivo abaixo.",progress:1};if(a==="completed"||a==="delivered")return{kind:"done",label:"Ficha elaborada",title:"Ficha Catalográfica elaborada com sucesso!",subtitle:'Nossa bibliotecária concluiu sua ficha. O arquivo está sendo preparado para download â clique em "Atualizar" abaixo para verificar.',progress:1};switch(a){case"pending_submission":case"paid":return{kind:"paid",label:"Pagamento confirmado",title:"Pedido recebido com sucesso",subtitle:"A Equipe Sábhia já está organizando o envio do seu livro para a nossa bibliotecária.",progress:.15};case"submitted":return{kind:"queued",label:"Na fila da bibliotecária",title:"Entrou na fila da Equipe Sábhia",subtitle:"Seu livro já chegou para a bibliotecária oficial da Sábhia. Em breve ela inicia a catalogação.",progress:.35};case"in_progress":return{kind:"working",label:"Catalogação em andamento",title:"Bibliotecária elaborando sua ficha",subtitle:"Nossa bibliotecária (CRB) está montando a ficha catalográfica oficial do seu livro.",progress:.65};case"awaiting_author_review":case"review_ready":return{kind:"review",label:"Finalizando sua ficha",title:"Quase lá â assinando sua ficha",subtitle:"A bibliotecária está concluindo e assinando sua ficha. Seu arquivo aparece aqui para download automaticamente.",progress:.9};case"awaiting_revision_info":return{kind:"review",label:"Aguardando informação",title:"Precisamos de uma informação sua",subtitle:"A Equipe Sábhia precisa confirmar um detalhe para continuar. Verifique seus emails.",progress:.5};case"failed_to_submit":return{kind:"issue",label:"Reprocessando envio",title:"Reorganizando seu pedido",subtitle:"Houve um pequeno ajuste técnico no envio. A Equipe Sábhia vai retomar em instantes.",progress:.15};case"cancelled":case"refunded":return{kind:"issue",label:"Pedido cancelado",title:"Pedido cancelado",subtitle:"Esse pedido foi cancelado. Se foi engano, fale com nosso suporte.",progress:0};default:return{kind:"paid",label:a,title:"Pedido em andamento",subtitle:"A Equipe Sábhia está cuidando da sua ficha catalográfica.",progress:.2}}}const ee=[{key:"paid",label:"Pagamento confirmado",matches:()=>!0},{key:"queued",label:"Na fila da bibliotecária",matches:a=>a!=="paid"},{key:"working",label:"Catalogação em andamento",matches:a=>a==="working"||a==="review"||a==="done"},{key:"review",label:"Assinatura CRB",matches:a=>a==="review"||a==="done"},{key:"done",label:"Ficha entregue",matches:a=>a==="done"}];function P(a){if(!a)return"â";try{return new Date(a).toLocaleDateString("pt-BR",{day:"2-digit",month:"short",year:"numeric"})}catch{return"â"}}function ke(a){return!a||a<=0?"":a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(1)} KB`:`${(a/(1024*1024)).toFixed(1)} MB`}function Ce({order:a,book:t,awaitingIsbn:w}){const[,b]=ae(),{toast:h}=se(),f=te(),[r,j]=u.useState(!1),[o,d]=u.useState(null),g=a.deliverables||[],v=g.length>0,y=u.useMemo(()=>(a.deliverableFields||[]).filter(s=>{if(!s.valor)return!1;const i=(s.tipo||"").toUpperCase();return(i==="LINK"||i==="URL"||i==="FILE"||i==="FILE_LINK"||i==="DOWNLOAD"||/^https?:\/\//i.test(s.valor))&&/^https?:\/\//i.test(s.valor)}),[a.deliverableFields]),k=!!w&&!v,p=k?{kind:"paid",label:"Aguardando seu ISBN",title:"Pagamento confirmado â só falta o seu ISBN",subtitle:"Sua ficha já está paga e reservada. Assim que a Equipe Sábhia entregar o ISBN do seu livro, ela entra automaticamente na fila da nossa bibliotecária â você não precisa fazer mais nada.",progress:.1}
1:ye(a.status,v),c=p.kind==="done",m=p.kind==="issue",$=c||v,E=u.useMemo(()=>c&&a.completedAt?P(a.completedAt):P(a.slaDueAt),[c,a.completedAt,a.slaDueAt]),I=async()=>{if(!r){j(!0);try{const i=await(await xe("POST",`/api/human-services/${a.id}/resync`)).json();await Promise.all([f.invalidateQueries({queryKey:["/api/human-services"]}),f.invalidateQueries({queryKey:[`/api/human-services/${a.id}`]})]),h({title:i.updated?"Status atualizado":"Tudo certo",description:i.updated?"Acabamos de buscar o status mais recente do seu pedido.":"Seu pedido já está em sincronia com a Equipe Sábhia."})}catch(s){h({title:"Não foi possÃvel atualizar agora",description:s?.message||"Tente novamente em alguns instantes.",variant:"destructive"})}finally{j(!1)}}},_=a.status!=="cancelled"&&a.status!=="refunded"&&!!a.bookId&&!k,l=g[0]||null,C=l?g.filter(s=>s!==l):[],[A,z]=u.useState(!1);return u.useEffect(()=>{z(!1)},[l?.downloadUrl]),e.jsxs("div",{className:"min-h-screen",children:[e.jsx("div",{className:"sticky top-0 z-40 border-b border-white/10 bg-background/80 backdrop-blur-xl",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 flex items-center justify-between gap-3",children:[e.jsxs("button",{onClick:()=>b(a.bookId?`/book/${a.bookId}`:"/dashboard"),className:"flex items-center gap-2 text-muted-foreground hover:text-white transition-colors text-sm","data-testid":"button-back-book",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Voltar ao livro"}),e.jsx("span",{className:"sm:hidden",children:"Voltar"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[_&&e.jsxs("button",{onClick:I,disabled:r,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] font-semibold bg-white/[0.06] hover:bg-white/[0.10] border border-white/15 hover:border-white/25 text-white/85 hover:text-white transition-colors disabled:opacity-60 disabled:cursor-not-allowed","data-testid":"button-resync-status",title:"Buscar o status mais recente direto com a Equipe Sábhia",children:[e.jsx(V,{className:`w-3.5 h-3.5 ${r?"animate-spin":""}`}),e.jsx("span",{className:"hidden sm:inline",children:r?"Atualizando...":"Atualizar status"}),e.jsx("span",{className:"sm:hidden",children:r?"...":"Atualizar"})]}),e.jsx("span",{className:`px-3 py-1 rounded-full text-[11px] font-bold uppercase tracking-wider border ${c?"bg-emerald-500/15 border-emerald-400/30 text-emerald-300":m?"bg-rose-500/15 border-rose-400/30 text-rose-300":"bg-indigo-500/15 border-indigo-400/30 text-indigo-300"}`,children:c?"â
FICHA OFICIAL":m?"â ATENÃÃO":"ð FICHA EM ANDAMENTO"})]})]})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-8 sm:py-12 space-y-8 pb-32 md:pb-20",children:[e.jsxs("section",{className:`rounded-3xl p-6 sm:p-10 border-2 shadow-2xl space-y-6 ${c?"border-emerald-400/50 bg-gradient-to-br from-emerald-500/15 via-teal-500/10 to-emerald-500/5 shadow-emerald-500/20":m?"border-rose-500/40 bg-gradient-to-br from-rose-500/15 via-red-500/10 to-rose-500/5 shadow-rose-500/15":"border-indigo-400/40 bg-gradient-to-br from-indigo-500/15 via-violet-500/10 to-indigo-500/5 shadow-indigo-500/20"}`,"data-testid":"section-ficha-status-hero",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`w-14 h-14 rounded-2xl ring-1 flex items-center justify-center shrink-0 ${c?"bg-emerald-500/25 ring-emerald-400/40":m?"bg-rose-500/25 ring-rose-400/40":"bg-indigo-500/25 ring-indigo-400/40"}`,children:c?e.jsx(ie,{className:"w-7 h-7 text-emerald-300"}):m?e.jsx(Ne,{className:"w-7 h-7 text-rose-300"}):e.jsx(F,{className:"w-7 h-7 text-indigo-300 animate-pulse"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-[11px] font-bold uppercase tracking-widest mb-1 ${c?"text-emerald-300":m?"text-rose-300":"text-indigo-300"}`,children:p.label}),e.jsx("h1",{className:"text-2xl sm:text-3xl font-black text-white leading-tight mb-2","data-testid":"text-status-title",children:p.title}),e.jsx("p",{className:"text-sm sm:text-base text-white/75 leading-relaxed",children:p.subtitle}),a.lastRevisionReason&&(p.kind==="review"||m)&&e.jsxs("div",{className:"mt-3 rounded-xl bg-white/[0.04] border border-white/10 p-3 text-sm text-white/80",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-white/50 mb-1",children:"Mensagem da Equipe Sábhia"}),a.lastRevisionReason]})]})]}),!c&&!m&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"h-2 rounded-full bg-white/5 overflow-hidden",children:e.jsx("div",{className:"h-full bg-gradient-to-r from-indigo-400 to-violet-400 transition-all duration-700 shadow-lg shadow-indigo-500/30",style:{width:`${Math.round(p.progress*100)}%`},"data-testid":"bar-ficha-progress"})}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsxs("span",{className:"text-white/55 flex items-center gap-1.5",children:[e.jsx(de,{className:"w-3 h-3 text-indigo-300"}),"Previsão: ",e.jsx("span",{className:"text-white font-semibold",children:E})]}),e.jsxs("span",{className:"text-white/55 tabular-nums",children:[Math.round(p.progress*100),"%"]})]})]})]}),k&&e.jsxs("section",{className:"rounded-3xl border border-indigo-400/25 bg-gradient-to-br from-indigo-950/25 via-zinc-950/40 to-zinc-950/20 p-6 sm:p-8 space-y-4","data-testid":"section-ficha-awaiting-isbn",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-indigo-500/15 ring-1 ring-indigo-400/30 flex items-center justify-center",children:e.jsx(U,{className:"w-4 h-4 text-indigo-300"})}),e.jsx("h2",{className:"text-lg font-black text-white",children:"Aguardando a entrega do seu ISBN"})]}),e.jsxs("p",{className:"text-sm text-white/70 leading-relaxed",children:["Sua ficha catalográfica precisa do número do ISBN. Assim que a Equipe Sábhia concluir o registro do seu ISBN, ",e.jsx("strong",{className:"text-white",children:"sua ficha é enviada automaticamente"}
1)," para a nossa bibliotecária â sem nenhuma ação sua. à só aguardar; esta página se atualiza sozinha."]}),e.jsxs("button",{onClick:()=>b(a.bookId?`/isbn/${a.bookId}`:"/dashboard"),className:"inline-flex items-center gap-1.5 rounded-xl bg-indigo-500/15 hover:bg-indigo-500/25 ring-1 ring-indigo-400/30 px-4 py-2.5 text-sm font-bold text-indigo-200 transition-colors","data-testid":"button-go-isbn",children:[e.jsx(F,{className:"w-4 h-4"})," Acompanhar meu ISBN"]})]}),!$&&!k&&e.jsxs("section",{className:"rounded-3xl border border-white/10 bg-white/[0.02] p-6 sm:p-8 space-y-5","data-testid":"section-ficha-timeline",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-indigo-500/15 ring-1 ring-indigo-400/30 flex items-center justify-center",children:e.jsx(T,{className:"w-4 h-4 text-indigo-300"})}),e.jsx("h2",{className:"text-lg font-black text-white",children:"Acompanhamento da catalogação"})]}),e.jsx("div",{className:"space-y-1",children:ee.map((s,i)=>{const n=s.matches(p.kind),x=!n&&(i===0||ee[i-1].matches(p.kind));return e.jsxs("div",{className:`flex items-center gap-4 py-3 px-3 rounded-xl transition-colors ${x?"bg-indigo-500/5 ring-1 ring-indigo-400/20":""}`,"data-testid":`step-${s.key}`,children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-all ${n?"bg-emerald-500/25 ring-1 ring-emerald-400/40":x?"bg-indigo-500/25 ring-1 ring-indigo-400/40":"bg-white/5 ring-1 ring-white/10"}`,children:n?e.jsx(re,{className:"w-4 h-4 text-emerald-300"}):x?e.jsx(R,{className:"w-3.5 h-3.5 text-indigo-300 animate-spin"}):e.jsx("span",{className:"text-[10px] text-white/40 tabular-nums",children:i+1})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:`text-sm font-semibold ${n||x?"text-white":"text-white/45"}`,children:s.label})}),n&&e.jsx(S,{className:"w-4 h-4 text-emerald-400/60 shrink-0"})]},s.key)})})]}),$&&e.jsxs("section",{className:"rounded-3xl border border-indigo-400/25 bg-gradient-to-br from-indigo-950/20 via-zinc-950/40 to-zinc-950/20 p-6 sm:p-8 space-y-5","data-testid":"section-ficha-included",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-indigo-500/15 ring-1 ring-indigo-400/30 flex items-center justify-center",children:e.jsx(N,{className:"w-5 h-5 text-indigo-300"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-black text-white",children:"Sua Ficha Catalográfica"}),e.jsx("p",{className:"text-xs text-white/55",children:"Assinada pela bibliotecária oficial da Sábhia (CRB)"})]})]}),l?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 rounded-2xl border border-emerald-400/25 bg-emerald-950/15 p-4","data-testid":"included-ficha",children:[e.jsx(Y,{url:l.downloadUrl,label:"Abrir Ficha Catalográfica",initialRatio:.707,onLoadError:()=>z(!0),onOpen:()=>{A||d({url:l.downloadUrl,title:"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:"Catalogação na Publicação (CIP)",fileName:M(l.fileName)})},className:"mx-auto sm:mx-0 w-full max-w-[160px] sm:w-36","data-testid":"thumbnail-ficha"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-bold text-white flex items-center gap-2",children:[e.jsx(L,{className:"w-4 h-4 text-white/40 shrink-0"})," Ficha Catalográfica (CIP)",e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-bold text-emerald-300 ring-1 ring-emerald-400/30",children:[e.jsx(S,{className:"w-3 h-3"})," Pronto"]})]}),e.jsx("p",{className:"text-[12px] text-white/55 mt-0.5 break-words",children:"Elaborada e assinada por bibliotecária com registro CRB. Pronta para a página de créditos do seu livro."}),A?e.jsxs("div",{className:"mt-3 rounded-xl border border-emerald-400/20 bg-emerald-950/15 px-4 py-3.5 space-y-2.5",children:[e.jsxs("p",{className:"text-[12px] font-bold text-emerald-200 flex items-center gap-2",children:[e.jsx(S,{className:"w-3.5 h-3.5 shrink-0 text-emerald-400"}),"Sua ficha foi elaborada com sucesso!"]}),e.jsxs("p",{className:"text-[11px] text-white/55 leading-relaxed",children:["Nossa equipe está finalizando a preparação do arquivo para download no servidor. Isso costuma ser resolvido em até ",e.jsx("strong",{className:"text-white/70",children:"alguns minutos"}),'. Clique em "Verificar agora" para checar se já está disponÃvel.']}),e.jsxs("button",{type:"button",onClick:I,disabled:r,className:"inline-flex items-center gap-1.5 rounded-lg bg-emerald-500/15 hover:bg-emerald-500/25 ring-1 ring-emerald-400/30 px-3 py-1.5 text-[11px] font-bold text-emerald-200 transition-colors disabled:opacity-60","data-testid":"button-recover-ficha",children:[e.jsx(V,{className:`w-3 h-3 ${r?"animate-spin":""}`}),r?"Verificandoâ¦":"Verificar agora"]})]}):e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>d({url:l.downloadUrl,title:"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:"Catalogação na Publicação (CIP)",fileName:M(l.fileName)}),className:"inline-flex items-center gap-1.5 rounded-xl bg-emerald-500/15 hover:bg-emerald-500/25 ring-1 ring-emerald-400/30 px-3.5 py-2 text-xs font-bold text-emerald-200 transition-colors","data-testid":"open-ficha",children:[e.jsx(N,{className:"w-3.5 h-3.5"})," Visualizar"]}),e.jsxs("a",{href:l.downloadUrl,download:M(l.fileName),className:"inline-flex items-center gap-1.5 rounded-xl bg-white/[0.04] hover:bg-white/[0.08] ring-1 ring-white/10 px-3.5 py-2 text-xs font-bold text-white/80 transition-colors","data-testid":"download-ficha",children:[e.jsx(B,{className:"w-3.5 h-3.5"})," Baixar"]})]})]})]}):c&&y.length>0?e.jsx("div",{className:"space-y-3","data-testid":"ficha-from-link-campos",children:y.map((s,i)=>{const n=s.valor,x=s.label?`${s.label.replace(/[^a-z0-9]/gi,"_")}.pdf`:"ficha_catalografica.pdf";return e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 roun
1ded-2xl border border-emerald-400/25 bg-emerald-950/15 p-4","data-testid":`link-campo-file-${i}`,children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/15 ring-1 ring-emerald-400/30 flex items-center justify-center shrink-0",children:e.jsx(N,{className:"w-5 h-5 text-emerald-300"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-bold text-white flex items-center gap-2 flex-wrap",children:[e.jsx(L,{className:"w-4 h-4 text-white/40 shrink-0"}),s.label||"Ficha Catalográfica (CIP)",e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-bold text-emerald-300 ring-1 ring-emerald-400/30",children:[e.jsx(S,{className:"w-3 h-3"})," Pronto"]})]}),e.jsx("p",{className:"text-[12px] text-white/55 mt-0.5",children:"Elaborada e assinada por bibliotecária com registro CRB."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>d({url:n,title:s.label||"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:"Catalogação na Publicação (CIP)",fileName:x}),className:"inline-flex items-center gap-1.5 rounded-xl bg-emerald-500/15 hover:bg-emerald-500/25 ring-1 ring-emerald-400/30 px-3.5 py-2 text-xs font-bold text-emerald-200 transition-colors","data-testid":`open-link-campo-${i}`,children:[e.jsx(N,{className:"w-3.5 h-3.5"})," Visualizar"]}),e.jsxs("a",{href:n,download:x,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 rounded-xl bg-white/[0.04] hover:bg-white/[0.08] ring-1 ring-white/10 px-3.5 py-2 text-xs font-bold text-white/80 transition-colors","data-testid":`download-link-campo-${i}`,children:[e.jsx(B,{className:"w-3.5 h-3.5"})," Baixar"]})]})]})]},s.fieldId||`lc-${i}`)})}):c&&a.proxyDownloadUrl?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 rounded-2xl border border-emerald-400/25 bg-emerald-950/15 p-4","data-testid":"ficha-proxy-download",children:[e.jsx(Y,{url:a.proxyDownloadUrl,label:"Abrir Ficha Catalográfica",initialRatio:.707,onOpen:()=>d({url:a.proxyDownloadUrl,title:"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:"Catalogação na Publicação (CIP)",fileName:"ficha-catalografica.pdf"}),className:"mx-auto sm:mx-0 w-full max-w-[160px] sm:w-36","data-testid":"thumbnail-proxy-ficha"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm font-bold text-white flex items-center gap-2 flex-wrap",children:[e.jsx(L,{className:"w-4 h-4 text-white/40 shrink-0"}),"Ficha Catalográfica (CIP)",e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-bold text-emerald-300 ring-1 ring-emerald-400/30",children:[e.jsx(S,{className:"w-3 h-3"})," Pronta"]})]}),e.jsx("p",{className:"text-[12px] text-white/55 mt-0.5",children:"Elaborada e assinada por bibliotecária com registro CRB. Pronta para a página de créditos do seu livro."}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>d({url:a.proxyDownloadUrl,title:"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:"Catalogação na Publicação (CIP)",fileName:"ficha-catalografica.pdf"}),className:"inline-flex items-center gap-1.5 rounded-xl bg-emerald-500/15 hover:bg-emerald-500/25 ring-1 ring-emerald-400/30 px-3.5 py-2 text-xs font-bold text-emerald-200 transition-colors","data-testid":"open-proxy-ficha",children:[e.jsx(N,{className:"w-3.5 h-3.5"})," Visualizar"]}),e.jsxs("a",{href:a.proxyDownloadUrl,download:"ficha-catalografica.pdf",className:"inline-flex items-center gap-1.5 rounded-xl bg-white/[0.04] hover:bg-white/[0.08] ring-1 ring-white/10 px-3.5 py-2 text-xs font-bold text-white/80 transition-colors","data-testid":"download-proxy-ficha",children:[e.jsx(B,{className:"w-3.5 h-3.5"})," Baixar Ficha"]})]})]})]}):c?e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 rounded-2xl border border-amber-400/25 bg-amber-950/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx(R,{className:"w-4 h-4 text-amber-300 animate-spin shrink-0"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-white",children:"Preparando o arquivo para downloadâ¦"}),e.jsxs("p",{className:"text-xs text-white/55 mt-0.5 leading-relaxed",children:["Ficha concluÃda â o link de acesso está sendo gerado. Clique em ",e.jsx("span",{className:"text-white/75",children:'"Atualizar"'})," para verificar. Se persistir por mais de alguns minutos, a Equipe Sábhia já foi notificada."]})]})]}),e.jsxs("button",{type:"button",onClick:I,disabled:r,className:"inline-flex items-center gap-1.5 rounded-xl bg-amber-500/15 hover:bg-amber-500/25 ring-1 ring-amber-400/30 px-3.5 py-2 text-xs font-bold text-amber-200 transition-colors disabled:opacity-50 shrink-0","data-testid":"button-resync-get-file",children:[r?e.jsx(R,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(V,{className:"w-3.5 h-3.5"}),r?"Verificandoâ¦":"Atualizar"]})]}):e.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-white/10 bg-white/[0.03] p-4",children:[e.jsx(R,{className:"w-4 h-4 text-indigo-300 animate-spin shrink-0"}),e.jsx("span",{className:"text-sm text-white/70",children:"Sua ficha está sendo finalizada pela bibliotecáriaâ¦"})]}),C.length>0&&e.jsxs("div",{className:"pt-2 space-y-2.5",children:[e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-wider text-white/40",children:"Outros arquivos"}),C.map(s=>e.jsxs("a",{href:s.downloadUrl,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-4 roun
1ded-2xl border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] hover:border-emerald-400/30 p-4 transition-all","data-testid":`link-deliverable-${s.id}`,children:[e.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/15 ring-1 ring-emerald-400/30 flex items-center justify-center shrink-0 group-hover:bg-emerald-500/25 transition-colors",children:e.jsx(N,{className:"w-5 h-5 text-emerald-300"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-white truncate",children:s.fileName}),e.jsxs("p",{className:"text-[11px] text-white/50 mt-0.5",children:[s.mimeType?.includes("pdf")?"PDF":s.mimeType?.split("/")[1]?.toUpperCase()||"Arquivo",s.fileSize?e.jsxs(e.Fragment,{children:[" · ",ke(s.fileSize)]}):null,s.receivedAt?e.jsxs(e.Fragment,{children:[" · ",P(s.receivedAt)]}):null,s.version>1?e.jsxs(e.Fragment,{children:[" · v",s.version]}):null]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-emerald-300 font-semibold group-hover:translate-x-0.5 transition-transform",children:[e.jsx(B,{className:"w-3.5 h-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Baixar"})]})]},s.id))]})]}),e.jsx(je,{open:!!o,onOpenChange:s=>{s||d(null)},url:o?.url??null,title:o?.title??"",subtitle:o?.subtitle,fileName:o?.fileName}),(()=>{const s=(a.deliverableFields||[]).filter(i=>i.valor&&i.valor.trim()||i.valores&&i.valores.length>0);return s.length===0?null:e.jsxs("section",{className:"rounded-3xl border border-emerald-400/30 bg-gradient-to-br from-emerald-950/30 to-teal-950/10 p-6 sm:p-8 space-y-5","data-testid":"section-ficha-delivered-info",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-emerald-500/15 ring-1 ring-emerald-400/30 flex items-center justify-center",children:e.jsx(F,{className:"w-4 h-4 text-emerald-300"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-black text-white",children:"Informações entregues"}),e.jsx("p",{className:"text-xs text-white/55",children:"Registrado pela Equipe Sábhia"})]})]}),e.jsx("div",{className:"space-y-3",children:s.map((i,n)=>{const x=i.valor?.trim()||"",D=(i.tipo||"").toUpperCase(),Q=(D==="LINK"||D==="URL"||D==="FILE_LINK"||D==="DOWNLOAD")&&/^https?:\/\//i.test(x),ne=!Q&&/^https?:\/\//i.test(x)&&!x.includes(" "),oe=x||(i.valores||[]).join(", ");if(Q||ne){const X=i.label?`${i.label.replace(/[^a-z0-9]/gi,"_")}.pdf`:"arquivo.pdf";return e.jsxs("div",{className:"rounded-2xl border border-emerald-400/20 bg-white/[0.03] p-4 flex items-center gap-4","data-testid":`field-delivered-${i.fieldId||n}`,children:[e.jsx("div",{className:"w-9 h-9 rounded-xl bg-emerald-500/15 ring-1 ring-emerald-400/30 flex items-center justify-center shrink-0",children:e.jsx(N,{className:"w-4 h-4 text-emerald-300"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-emerald-300/80 mb-1",children:i.label||"Arquivo"}),e.jsxs("div",{className:"flex flex-wrap gap-2 mt-1",children:[e.jsxs("button",{type:"button",onClick:()=>d({url:x,title:i.label||"Ficha Catalográfica",subtitle:t?.title?`"${t.title}"`:void 0,fileName:X}),className:"inline-flex items-center gap-1 rounded-lg bg-emerald-500/15 hover:bg-emerald-500/25 ring-1 ring-emerald-400/30 px-3 py-1.5 text-xs font-bold text-emerald-200 transition-colors","data-testid":`open-field-file-${i.fieldId||n}`,children:[e.jsx(N,{className:"w-3 h-3"})," Visualizar"]}),e.jsxs("a",{href:x,download:X,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 rounded-lg bg-white/[0.04] hover:bg-white/[0.08] ring-1 ring-white/10 px-3 py-1.5 text-xs font-bold text-white/80 transition-colors","data-testid":`download-field-file-${i.fieldId||n}`,children:[e.jsx(B,{className:"w-3 h-3"})," Baixar"]})]})]})]},i.fieldId||`field-${n}`)}return e.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.03] p-4","data-testid":`field-delivered-${i.fieldId||n}`,children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-wider text-emerald-300/80 mb-1.5",children:i.label||"Informação"}),e.jsx("p",{className:"text-base sm:text-lg font-bold text-white tracking-wide break-words","data-testid":`text-field-value-${i.fieldId||n}`,children:oe})]},i.fieldId||`field-${n}`)})})]})})(),e.jsxs("section",{className:"rounded-3xl border border-white/10 bg-white/[0.02] p-6 sm:p-8 space-y-4","data-testid":"section-ficha-meta",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-2xl bg-white/5 ring-1 ring-white/10 flex items-center justify-center",children:e.jsx(F,{className:"w-4 h-4 text-white/60"})}),e.jsx("h2",{className:"text-lg font-black text-white",children:"Detalhes do pedido"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl bg-white/[0.03] border border-white/10 p-3",children:[e.jsx("p",{className:"text-[10px] text-white/45 uppercase tracking-wider font-semibold",children:"Livro"}),e.jsx("p",{className:"text-sm font-bold text-white truncate","data-testid":"text-book-title",children:t?.title||"â"})]}),e.jsxs("div",{className:"rounded-xl bg-white/[0.03] border border-white/10 p-3",children:[e.jsx("p",{className:"text-[10px] text-white/45 uppercase tracking-wider font-semibold",children:"Solicitado em"}),e.jsx("p",{className:"text-sm font-bold text-white",children:P(a.paymentConfirmedAt||a.createdAt)})]}),e.jsxs("div",{className:"rounded-xl bg-white/[0.03] border border-white/10 p-3",children:[e.jsx("p",{className:"text-[10px] text-white/45 uppercase tracking-wider font-semibold",children:"Previsão"}),e.jsxs("p",{className:"text-sm font-bold text-white flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3 h-3 text-indigo-300"})," ",E]})]}),e.jsxs("div",{className:"rounded-xl bg-white/[0.03] border border-white/10 p-3",children:[e.jsx("p",{className:"text-[10px] text-white/45 uppercase tracking-wider font-semibold",children:"Pedido"}),e.jsxs("p",{className:"text-sm font-bold text-white tabular-nums truncate",children:["#",a.id.slice(0,8).toUpperCase()]})]})]})]}),e.jsxs("section",{className:"rounded-3xl border border-indigo-400/20 bg-gradient-to-br from-indigo-950/20 to-violet-950/5 p-5 sm:p-6 flex items-center gap-4",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-indigo-500/15 ring-1 ring-indigo-400/30 flex items-center justify-center shrink-0",children:e.jsx(ce,{className:"w-5 h-5 text-indigo-300"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-white",children:"Alguma dúvida sobre sua ficha?"}),e.jsx("p",{className:"text-[12px] text-white/65 leading-relaxed",children:"Fale com nosso suporte aqui mesmo no canto da tela. A Equipe Sábhia responde rápido."})]}),e.jsx(K,{className:"w-5 h-5 text-indigo-300/40 shrink-0 hidden sm:block"})]}),m&&a.status==="cancelled"&&e.jsxs("section",{className:"rounded-2xl border border-rose-500/25 bg-rose-950/20 p-5 flex items-center gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0"}),e.jsxs("p",{className:"text-sm text-rose-100",children:["Esse pedido foi cancelado em ",e.jsx("strong",{children:P(a.cancelledAt)}),". Se foi engano, fale com o suporte."]})]})]})]})}const Se="/assets/ficha-open-book-CNTzyN7Z.png";function qe({bookId:a}){const{toast:t}=se(),w=te(),b=u.useRef(null),[h,f]=u.useState(null),[r,j]=u.useState(!1),o=async()=>
1{if(!(!h||!a)){j(!0);try{const d=new FormData;d.append("ficha",h);const g=await fetch(`/api/books/${a}/ficha/upload-ready`,{method:"POST",body:d,credentials:"include"}),v=await g.json().catch(()=>({}));if(!g.ok)throw new Error(v?.message||"Não consegui inserir a ficha. Tente novamente.");t({title:"Ficha inserida!",description:"Sua ficha já entra nos seus arquivos (PDF/EPUB/DOCX). Sem cobrança."}),f(null),b.current&&(b.current.value=""),await w.invalidateQueries({queryKey:["/api/human-services"]}),w.invalidateQueries({queryKey:[`/api/books/${a}`]})}catch(d){t({title:"Não deu pra inserir",description:d?.message||"Tente novamente em instantes.",variant:"destructive"})}finally{j(!1)}}};return e.jsxs("section",{className:"rounded-3xl border border-white/10 bg-white/[0.03] p-6 sm:p-8 space-y-4","data-testid":"section-ficha-upload-ready",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/15 border border-emerald-400/30 flex items-center justify-center shrink-0",children:e.jsx(ve,{className:"w-5 h-5 text-emerald-300"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base sm:text-lg font-black text-white",children:"Já tem sua ficha pronta?"}),e.jsxs("p",{className:"text-[13px] text-white/65 mt-1 leading-snug max-w-xl",children:["Se você já tem a ficha catalográfica (PDF ou imagem), insira aqui que ela entra direto no seu livro â ",e.jsx("strong",{className:"text-white",children:"sem cobrar nada"}),". Quiser trocar depois, é só enviar outra; vale sempre a mais recente."]})]})]}),e.jsx("input",{ref:b,type:"file",accept:"application/pdf,image/jpeg,image/png,image/webp",className:"hidden",onChange:d=>f(d.target.files?.[0]||null),"data-testid":"input-ficha-file"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:items-center",children:[e.jsx("button",{type:"button",onClick:()=>b.current?.click(),disabled:r,className:"px-4 py-2.5 rounded-xl text-sm font-bold text-white bg-white/10 border border-white/15 hover:bg-white/15 transition-colors disabled:opacity-50","data-testid":"button-choose-ficha",children:h?"Trocar arquivo":"Escolher arquivo"}),h&&e.jsx("span",{className:"text-[13px] text-white/70 truncate max-w-[220px]","data-testid":"text-ficha-filename",children:h.name}),e.jsx("button",{type:"button",onClick:o,disabled:!h||r,className:"sm:ml-auto px-6 py-2.5 rounded-xl text-sm font-black text-white bg-gradient-to-r from-emerald-500 to-teal-500 shadow-lg shadow-emerald-500/25 hover:scale-[1.02] transition-transform disabled:opacity-50 disabled:cursor-not-allowed inline-flex items-center justify-center gap-2","data-testid":"button-insert-ficha",children:r?e.jsxs(e.Fragment,{children:[e.jsx(R,{className:"w-4 h-4 animate-spin"})," Inserindoâ¦"]}):"Inserir no meu livro"})]}),e.jsx("p",{className:"text-[11px] text-white/40",children:"PDF, JPG, PNG ou WebP · até 10MB"})]})}function ea(){const[,a]=me("/ficha/:bookId"),t=a?.bookId||"",[,w]=ae(),[b,h]=u.useState(!1),f=O({queryKey:["/api/human-services/catalog"],enabled:!!t}),{data:r}=O({queryKey:[`/api/books/${t}`],enabled:!!t}),{data:j}=O({queryKey:["/api/human-services"],enabled:!!t,staleTime:15e3,refetchInterval:3e4}),o=(j||[]).find(s=>s?.bookId===t&&s?.serviceSlug==="ficha_catalografica"&&s?.status!=="pending_payment"&&s?.status!=="cancelled"&&s?.status!=="refunded")||null,g=ge(j,t)?.isbnNumber||null,v=be(j,t),y=g?"delivered":v?"in_progress":"none",k=!!o&&o.status==="pending_submission"&&!g,{data:p}=O({queryKey:[`/api/human-services/${o?.id}`],enabled:!!o?.id,staleTime:15e3,refetchInterval:3e4}),c=p??o,m=(r?.author||"").trim(),$=(()=>{if(!m)return"Sobrenome, Nome";const s=m.split(/\s+/);return s.length===1?s[0]:`${s[s.length-1]}, ${s.slice(0,-1).join(" ")}`})(),E=(r?.title||"TÃtulo do seu livro").trim(),I=g||"978-65-XXXXX-XXX-X",_=new Date().getFullYear(),l=f.data?.services.find(s=>s.slug==="ficha_catalografica")||null,C=l?.gate?.canPurchase??f.data?.gate.canPurchase??!1,A=u.useRef(null);u.useEffect(()=>{const s=o?.id??null;s&&A.current!==s&&(A.current=s,typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"}))},[o?.id]);const z=()=>{t&&h(!0)};
1return o?e.jsxs(H,{children:[e.jsx("div",{className:`min-h-screen ${t?"lg:pr-[316px]":""}`,children:e.jsx(Ce,{order:c,book:r,awaitingIsbn:k})}),t&&e.jsx("div",{className:"hidden md:block fixed right-4 top-20 w-[280px] max-h-[calc(100vh-6rem)] overflow-y-auto z-30",children:e.jsx(G,{bookId:t,currentStep:"ficha"})}),t&&e.jsx(W,{bookId:t,currentStep:"ficha"})]}):e.jsxs(H,{children:[e.jsxs("div",{className:`min-h-screen ${t?"lg:pr-[316px]":""}`,children:[e.jsx("div",{className:"sticky top-0 z-40 border-b border-white/10 bg-background/80 backdrop-blur-xl",children:e.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-3 flex items-center justify-between gap-3",children:[e.jsxs("button",{onClick:()=>w(t?`/book/${t}`:"/dashboard"),className:"flex items-center gap-2 text-muted-foreground hover:text-white transition-colors text-sm","data-testid":"button-back-book",children:[e.jsx(le,{className:"w-4 h-4"}),e.jsx("span",{className:"hidden sm:inline",children:"Voltar ao livro"}),e.jsx("span",{className:"sm:hidden",children:"Voltar"})]}),e.jsx("span",{className:"px-3 py-1 rounded-full bg-indigo-500/15 border border-indigo-400/30 text-[11px] font-bold text-indigo-300 uppercase tracking-wider",children:"ð Ficha Catalográfica"})]})}),e.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-8 sm:py-12 space-y-12 pb-32 md:pb-20",children:[e.jsxs("section",{className:"text-center space-y-5",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-gradient-to-r from-indigo-500/20 to-violet-500/20 border border-indigo-400/40",children:[e.jsx(F,{className:"w-3.5 h-3.5 text-indigo-300"}),e.jsx("span",{className:"text-xs font-bold text-indigo-200 uppercase tracking-wider",children:"Documento oficial â Bibliotecária CRB"})]}),e.jsxs("h1",{className:"text-3xl sm:text-5xl font-black text-white leading-tight tracking-tight",children:["Sem ficha catalográfica, seu livro ",e.jsx("span",{className:"bg-gradient-to-r from-indigo-300 via-violet-300 to-indigo-400 bg-clip-text text-transparent",children:"não é levado a sério."})]}),e.jsxs("p",{className:"text-base sm:text-lg text-white/75 max-w-2xl mx-auto leading-relaxed",children:["A ficha catalográfica é a ",e.jsx("strong",{className:"text-white",children:"identidade técnica do seu livro"}),' â aquela "plaquinha" na página de créditos que diz que ele foi catalogado por um profissional. à ',e.jsx("strong",{className:"text-white",children:"obrigatória por lei federal"})," e só pode ser assinada por um ",e.jsx("strong",{className:"text-white",children:"bibliotecário com registro CRB"}),". A Sábhia tem a bibliotecária oficial pra fazer a sua."]}),r?.title&&e.jsxs("p",{className:"text-sm text-white/55 pt-2",children:["Vamos catalogar: ",e.jsxs("span",{className:"text-white font-bold",children:['"',r.title,'"']})]})]}),e.jsxs("section",{className:"space-y-6","data-testid":"section-o-que-e-ficha",children:[e.jsxs("div",{className:"text-center space-y-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/5 border border-white/10 text-[11px] font-bold text-white/70 uppercase tracking-wider",children:[e.jsx(he,{className:"w-3.5 h-3.5 text-indigo-300"})," Pra você entender de vez"]}),e.jsx("h2",{className:"text-2xl sm:text-3xl font-black text-white leading-tight",children:"Afinal, o que é uma ficha catalográfica?"}),e.jsxs("p",{className:"text-sm sm:text-base text-white/70 max-w-2xl mx-auto leading-relaxed",children:["à aquele quadro técnico no ",e.jsx("strong",{className:"text-white",children:"verso da folha de rosto"})," â a",e.jsx("strong",{className:"text-white",children:' "certidão de nascimento" do seu livro'}),". Em linguagem de biblioteca, ela diz pro mundo quem escreveu, sobre o que é e onde a sua obra se encaixa nos acervos do paÃs inteiro."]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5 items-stretch",children:[e.jsxs("figure",{className:"relative rounded-3xl overflow-hidden border border-white/10 bg-black/40 min-h-[260px]",children:[e.jsx("img",{src:Se,alt:"Livro aberto com a ficha catalográfica destacada no verso da folha de rosto",className:"w-full h-full object-cover",loading:"lazy","data-testid":"img-open-book-ficha"}),e.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/90 via-black/45 to-transparent p-4 pt-12",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-[11px] sm:text-xs font-bold text-indigo-200",children:[e.jsx(T,{className:"w-3.5 h-3.5 shrink-0"}),"à este quadro em destaque â sempre no verso da folha de rosto"]})})]}),e.jsxs("div",{className:"rounded-3xl border border-indigo-400/25 bg-gradient-to-br from-indigo-950/40 to-slate-950/40 p-5 sm:p-6 flex flex-col",children:[e.jsxs("p",{className:"text-[11px] font-bold text-indigo-300 uppercase tracking-wider mb-3 flex items-center gap-1.5",children:[e.jsx(we,{className:"w-3.5 h-3.5"})," Exemplo real â é assim que a sua vai ficar"]}),e.jsxs("div",{className:"rounded-xl bg-[#f7f4ec] text-slate-800 p-4 sm:p-5 shadow-inner flex-1 flex flex-col justify-center","data-testid":"mockup-ficha",children:[e.jsx("p",{className:"text-center font-bold text-[10px] sm:text-[11px] mb-3 tracking-tight text-slate-700",children:"Dados Internacionais de Catalogação na Publicação (CIP)"}),e.jsxs("div",{className:"border border-slate-400 p-3 sm:p-4 font-mono text-[10px] sm:text-[11px] leading-relaxed space-y-2",children:[e.jsxs("p",{children:[e.jsx("span",{className:"inline-block w-10 align-top text-slate-500",children:"S586l"}),e.jsx("span",{className:"inline-block",children:$})]}),e.jsxs("p",{className:"pl-10 break-words",children:[E," / ",m||"Nome do Autor",". â ",_,"."]}),e.jsx("p",{className:"pl-10 text-slate-600",children:"120 p. ; 21 cm."}),e.jsxs("p",{className:"pl-10 pt-1",children:["ISBN ",I]}),e.jsx("p",{className:"pl-10 pt-1",children:"1. Assunto principal. 2. Tema. I. TÃtulo."}),e.jsx("p",{className:"text-right text-slate-600",children:"CDD 800"})]}),e.jsx("p",{className:"text-center text-[9px] sm:text-[10px] text-slate-500 mt-3 italic",children:"Elaborada e assinada por bibliotecária â CRB"})]}),e.jsx("p",{className:"text-[11px] text-white/50 mt-3 leading-snug",children:"Cada número e sigla (CDD, CIP, CRB) segue um padrão
1internacional que existe desde 1976. à isso que faz bibliotecas, universidades e editais reconhecerem o seu livro como obra séria."})]})]})]}),e.jsxs("section",{className:"rounded-3xl border border-rose-500/25 bg-gradient-to-br from-rose-950/40 via-red-950/20 to-transparent p-6 sm:p-8 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-rose-500/15 ring-1 ring-rose-400/30 flex items-center justify-center",children:e.jsx(pe,{className:"w-5 h-5 text-rose-300"})}),e.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white",children:"O detalhe que separa o amador do profissional"})]}),e.jsxs("p",{className:"text-sm sm:text-base text-white/80 leading-relaxed",children:["Você fez o ISBN, caprichou na capa, revisou tudo. Mas se o seu livro ",e.jsx("strong",{className:"text-white",children:"não tiver ficha catalográfica"}),":"]}),e.jsxs("ul",{className:"space-y-3 text-sm sm:text-base text-white/85",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-white",children:"Você está descumprindo a lei."})," A Lei do Livro (10.753/2003) torna a ficha obrigatória â para a versão fÃsica E a digital."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-white",children:"Bibliotecas não catalogam seu livro."})," Sem a ficha, ele não entra no acervo de escolas, universidades e bibliotecas públicas."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-white",children:"Universidades e ABNT exigem."})," Trabalhos acadêmicos, teses e livros técnicos sem ficha são recusados na avaliação."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-white",children:"Você perde o depósito legal e editais."})," Sem ficha, o livro não cumpre os requisitos de muitos editais e programas de compra pública."]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx(q,{className:"w-5 h-5 text-rose-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{className:"text-white",children:'A página de créditos fica "pela metade".'})," Todo livro profissional tem aquela ficha técnica. Sem ela, salta aos olhos que foi feito à s pressas."]})]})]}),e.jsx("div",{className:"rounded-2xl bg-rose-500/10 border border-rose-400/30 p-4 mt
1-4",children:e.jsxs("p",{className:"text-sm sm:text-base text-rose-100 font-semibold leading-relaxed",children:["Resumindo: o ISBN diz que o livro ",e.jsx("strong",{className:"text-white",children:"existe"}),". A ficha catalográfica prova que ele foi",e.jsx("strong",{className:"text-white",children:" feito com padrão profissional"}),". Um não substitui o outro â eles são um par."]})})]}),e.jsxs("section",{className:"rounded-3xl border border-emerald-500/25 bg-gradient-to-br from-emerald-950/40 via-teal-950/20 to-transparent p-6 sm:p-8 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/15 ring-1 ring-emerald-400/30 flex items-center justify-center",children:e.jsx(S,{className:"w-5 h-5 text-emerald-300"})}),e.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white",children:"Nossa bibliotecária faz. Você só recebe pronto."})]}),e.jsxs("p",{className:"text-sm sm:text-base text-white/80 leading-relaxed",children:["A ",e.jsx("strong",{className:"text-white",children:"bibliotecária oficial da Sábhia â registrada no CRB"})," â vai elaborar e",e.jsx("strong",{className:"text-white",children:" assinar pessoalmente"})," a ficha catalográfica do seu livro, seguindo o padrão AACR2/CDD usado por bibliotecas do mundo todo. Sem você entender de catalogação, sem formulário técnico, sem dor de cabeça."]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 pt-2",children:[e.jsxs("div",{className:"rounded-2xl bg-white/5 border border-white/10 p-4 text-center",children:[e.jsx(T,{className:"w-5 h-5 text-emerald-400 mx-auto mb-2"}),e.jsx("p",{className:"text-xs font-bold text-white mb-1",children:"Você não envia nada"}),e.jsx("p",{className:"text-[11px] text-white/55 leading-snug",children:"A gente usa o livro e o ISBN que já estão aqui na Sábhia"})]}),e.jsxs("div",{className:"rounded-2xl bg-white/5 border border-white/10 p-4 text-center",children:[e.jsx(K,{className:"w-5 h-5 text-emerald-400 mx-auto mb-2"}),e.jsx("p",{className:"text-xs font-bold text-white mb-1",children:"Assinada por CRB"}),e.jsx("p",{className:"text-[11px] text-white/55 leading-snug",children:"Válida juridicamente â só bibliotecário registrado pode emitir"})]}),e.jsxs("div",{className:"rounded-2xl bg-white/5 border border-white/10 p-4 text-center",children:[e.jsx(ie,{className:"w-5 h-5 text-emerald-400 mx-auto mb-2"}),e.jsx("p",{className:"text-xs font-bold text-white mb-1",children:"Pronta pra usar"}),e.jsx("p",{className:"text-[11px] text-white/55 leading-snug",children:"à só colocar na página de créditos do seu livro"})]})]})]}),e.jsxs("section",{className:"rounded-3xl border border-indigo-400/30 bg-gradient-to-br from-indigo-950/30 to-violet-950/10 p-6 sm:p-8 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-2xl bg-indigo-500/15 ring-1 ring-indigo-400/40 flex items-center justify-center",children:e.jsx(N,{className:"w-5 h-5 text-indigo-300"})}),e.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white",children:"O que você recebe"})]}),e.jsx("ul",{className:"space-y-3",children:(l?.deliverables||["Ficha catalográfica oficial (Catalogação na Publicação â CIP)","Elaborada e assinada por bibliotecária com registro CRB","Arquivo pronto para a página de créditos do seu livro (fÃsico e digital)"]).map((s,i)=>e.jsxs("li",{className:"flex items-start gap-3 text-sm sm:text-base text-white/90 bg-white/[0.03] border border-white/10 rounded-2xl p-4",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-emerald-500/20 ring-1 ring-emerald-400/40 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx(re,{className:"w-3.5 h-3.5 text-emerald-300"})}),e.jsx("span",{children:s})]},i))}),e.jsxs("div",{className:"rounded-2xl bg-white/[0.02] border border-white/10 p-4 text-[12px] text-white/55 leading-relaxed",children:[e.jsx("strong",{className:"text-white/80",children:"Importante:"})," esta oferta cobre ",e.jsx("strong",{className:"text-white/80",children:"somente a ficha catalográfica"}),". Não inclui registro de direito autoral nem geração de código de barras â são serviços diferentes."]})]}),e.jsxs("section",{className:"space-y-5",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white mb-2",children:"Onde a ficha faz toda a diferença"}),e.jsx("p",{className:"text-sm text-white/60",children:"O documento que abre portas pro seu livro no mundo institucional"})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-3",children:[{name:"Bibliotecas públicas",icon:"ðï¸"},{name:"Universidades & ABNT",icon:"ð"},{name:"Escolas & acervos",icon:"ð"},{name:"Editais & licitações",icon:"ð"},{name:"Depósito legal",icon:"âï¸"},{name:"Livro fÃsico & e-book",icon:"ð"}].map(s=>e.jsxs("div",{className:"rounded-2xl bg-white/[0.03] border border-white/10 p-4 text-center hover:border-indigo-400/30 transition-colors",children:[e.jsx("div",{className:"text-2xl mb-1",children:s.icon}),e.jsx("p",{className:"text-xs font-semibold text-white/85",children:s.name})]},s.name))}),e.jsxs("div",{className:"flex items-center justify-center gap-6 pt-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-white/60",children:[e.jsx(J,{className:"w-4 h-4 text-indigo-400"}),e.jsxs("span",{children:["Exigida pela ",e.jsx("strong",{className:"text-white",children:"Lei 10.753/2003"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-white/60",children:[e.jsx(ue,{className:"w-4 h-4 text-indigo-400"}),e.jsxs("span",{children:["Padrão ",e.jsx("strong",{className:"text-white",children:"ABNT (NBR 6029/14724)"})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-white/60",children:[e.jsx(L,{className:"w-4 h-4 text-indigo-400"}),e.jsxs("span",{children:["Assinatura ",e.jsx("strong",{className:"text-white",children:"CRB obrigatória"})]})]})]})]}),e.jsxs("section",{className:"rounded-3xl bg-gradient-to-br from-slate-900/80 via-slate-950/60 to-indigo-950/20 border border-indigo-400/20 p-6 sm:p-8 space-y-5",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-black text-white text-center",children:"Faz a conta com a gente."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-2xl border border-rose-500/25 bg-rose-950/20 p-5 space-y-3",children:[e.jsx("div",{className:"text-xs font-bold text-rose-300 uppercase tracking-wider",children:"ð« Contratando por fora"}),e.jsxs("ul",{className:"space-y-2 text-sm text-white/80",children:[e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Honorário do bibliotecário"}),e.jsx("span",{className:"text-white/60 line-through",children:"R$ 250,
100"})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Revisão & reenvios"}),e.jsx("span",{className:"text-white/60 line-through",children:"R$ 80,00"})]}),e.jsxs("li",{className:"flex justify-between text-xs text-white/40",children:[e.jsx("span",{children:"+ achar um CRB disponÃvel"}),e.jsx("span",{children:"+ semanas de espera"})]})]}),e.jsxs("div",{className:"border-t border-rose-500/20 pt-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-white",children:"Total"}),e.jsx("span",{className:"text-2xl font-black text-rose-300 line-through",children:"R$ 330+"})]})]}),e.jsxs("div",{className:"rounded-2xl border-2 border-indigo-400/50 bg-gradient-to-br from-indigo-500/15 to-violet-500/10 p-5 space-y-3 shadow-xl shadow-indigo-500/20 relative",children:[e.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 px-3 py-1 rounded-full bg-gradient-to-r from-indigo-400 to-violet-400 text-[10px] font-black text-slate-900 uppercase tracking-wider whitespace-nowrap",children:"â¡ Aqui na Sábhia"}),e.jsx("div",{className:"text-xs font-bold text-indigo-300 uppercase tracking-wider pt-2",children:"ð Com a Sábhia, tudo incluÃdo"}),e.jsxs("ul",{className:"space-y-2 text-sm text-white/90",children:[e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Bibliotecária CRB oficial"}),e.jsx("span",{className:"text-emerald-300 font-bold",children:"â Incluso"})]}),e.jsxs("li",{className:"flex justify-between",children:[e.jsx("span",{children:"Elaboração & assinatura"}),e.jsx("span",{className:"text-emerald-300 font-bold",children:"â A gente faz"})]}),e.jsxs("li",{className:"flex justify-between text-xs text-indigo-200/80",children:[e.jsx("span",{children:"+ Acompanhamento na plataforma"}),e.jsxs("span",{children:["+ ",l?.slaBusinessDays||5," dias úteis"]})]})]}),e.jsxs("div",{className:"border-t border-indigo-400/30 pt-3 flex items-center justify-between",children:[e.jsx("span",{className:"text-sm font-bold text-white",children:"Você paga apenas"}),e.jsx("span",{className:"text-3xl font-black text-indigo-300",children:l?.priceFormatted||"R$ 199,99"})]})]})]}),e.jsxs("p",{className:"text-center text-sm text-white/70 leading-relaxed pt-2",children:["Sem procurar bibliotecário, sem reenvio de arquivos, sem semanas de espera.",e.jsx("br",{}),e.jsx("strong",{className:"text-white",children:"A gente faz tudo. Você só coloca a ficha no seu livro."})]})]}),e.jsxs("section",{className:"rounded-3xl border-2 border-indigo-400/50 bg-gradient-to-br from-indigo-500/15 via-violet-500/10 to-indigo-500/5 p-6 sm:p-10 shadow-2xl shadow-indigo-500/20",children:[!C&&f.isFetched&&e.jsxs("div",{className:"text-center space-y-4 py-6",children:[e.jsx(T,{className:"w-10 h-10 text-indigo-400 mx-auto"}),e.jsx("h3",{className:"text-xl font-bold text-white",children:"Em breve disponÃvel pra você"}),e.jsx("p",{className:"text-sm text-white/70 max-w-md mx-auto",children:"Esse serviço está em beta fechado. Em breve liberado pra todos os autores Sábhia."})]}),C&&e.jsxs("div",{className:"space-y-6 text-center",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-bold text-indigo-300 uppercase tracking-wider",children:"Oferta direta da Sábhia"}),e.jsxs("h2",{className:"text-2xl sm:text-3xl font-black text-white leading-tight",children:["Quer sua ficha catalográfica oficial em ",l?.slaBusinessDays||5," dias úteis?"]}),e.jsxs("p",{className:"text-sm sm:text-base text-white/70 max-w-lg mx-auto",children:["Um único pagamento de ",e.jsx("strong",{className:"text-indigo-300",children:l?.priceFormatted||"R$ 199,99"})," e nossa bibliotecária CRB cuida de tudo."]})]}),y==="none"?e.jsxs("div",{className:"rounded-2xl bg-amber-500/10 border border-amber-400/30 p-5 max-w-md mx-auto text-left space-y-4","data-testid":"state-isbn-none",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Z,{className:"w-5 h-5 text-amber-300 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-white",children:"Primeiro você precisa do seu ISBN"}),e.jsx("p",{className:"text-[13px] text-white/70 mt-1 leading-snug",children:"A ficha catalográfica inclui o número do ISBN do seu livro â por isso ela só pode ser feita depois que o ISBN existe. Registre o ISBN aqui na Sábhia e a gente usa o número automaticamente na sua ficha, sem você precisar digitar nada."})]})]}),e.jsx("button",{onClick:()=>w(`/isbn/${t}`),className:"w-full px-6 py-3.5 rounded-2xl font-black text-white text-base bg-gradient-to-r from-amber-500 to-orange-500 shadow-xl shadow-amber-500/30 hover:scale-[1.02] transition-transform","data-testid":"button-register-isbn-first",children:"ð Registrar meu ISBN primeiro"})]}):y==="in_progress"?e.jsxs("div",{className:"rounded-2xl bg-indigo-500/10 border border-indigo-400/30 p-4 max-w-md mx-auto text-left flex items-start gap-3","data-testid":"state-isbn-in-progress",children:[e.jsx(U,{className:"w-5 h-5 text-indigo-300 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-white",children:"Seu ISBN está sendo registrado"}),e.jsxs("p",{className:"text-[13px] text-white/70 mt-1 leading-snug",children:["Você já pode contratar a ficha agora. Assim que seu ISBN for entregue, sua ficha entra",e.jsx("strong",{className:"text-white",children:" automaticamente"})," na fila da nossa bibliotecária â sem você precisar fazer mais nada."]})]})]}):e.jsxs("div",{className:"rounded-2xl bg-emerald-500/10 border border-emerald-400/30 p-4 max-w-md mx-auto text-left flex items-start gap-3","data-testid":"status-isbn-detected",children:[e.jsx(Z,{className:"w-5 h-5 text-emerald-300 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold text-white",children:"Vamos usar o ISBN que já registramos"}),e.jsx("p",{className:"text-[13px] text-emerald-200/90 tabular-nums tracking-wide mt-0.5","data-testid":"text-known-isbn",children:g}),e.jsx("p",{className:"text-[11px] text-white/55 mt-1",children:"A ficha catalográfica precisa do ISBN â e o seu já está pronto aqui na Sábhia."})]})]}),y!=="none"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center gap-4",children:e.jsxs("div",{className:"text-center",children:[e.jsx("p",{className:"text-xs text-white/50 line-through",children:"R$ 330+"}),e.jsx("p",{className:"text-4xl sm:text-5xl font-black bg-gradient-to-r from-indigo-300 to-violet-300 bg-clip-text text-transparent",children:l?.priceFormatted||"R$ 199,99"}),e.jsx("p",{className:"text-[11px] text-white/55 mt-1",children:"PIX ⢠Cartão ⢠Créditos"})]})}),e.jsx("button",{onClick:z,disabled:!t,className:"w-full sm:w-auto px-8 sm:px-14 py-4 rounded-2xl font-black text-white text-base sm:text-lg bg-gradient-to-r from-indigo-500 via-violet-500 to-indigo-500 bg-[length:200%_auto] shadow-2xl shadow-indigo-500/40 hover:bg-[position:right_center] hover:scale-[1.02] transition-all disabled:opacity-50 disabled:cursor-not-allowed","data-testid":"button-contratar-ficha",children:"ð QUERO MINHA FICHA AGORA"}),y==="in_progress"&&e.jsx("p",{className:"text-[11px] text-white/45","data-testid":"hint-isbn-in-progress",children:"Pode pagar agora â sua ficha começa assim que o ISBN chegar."})]}),e.jsxs("div",{className:"flex items-center justify-center gap-4 sm:gap-6 text-xs text-white/55 flex-wrap pt-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(U,{className:"w-3.5 h-3.5 text-indigo-400"}),e.jsxs("span",{children:[l?.slaBusinessDays||5," dias úteis"]})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(K,{className:"w-3.5 h-3.5 text-indigo-400"}),e.jsx("span",{children:"Assinada por CRB"})]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(J,{className:"w-3.5 h-3.5 text-indigo-400"}),e.jsx("span",{children:"Exigida por lei"})]})]})]})]}),t&&e.jsx(qe,{bookId:t}),C&&e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-black text-white text-center",children:"Dúvidas que todo autor tem"}),e.jsx("div",{className:"space-y-3",children:[{q:"Qual a diferença entre ISBN e ficha catalográfica?",a:"O ISBN é o número que identifica seu livro no comércio. A ficha catalográfica é o documento técnico, assinado por bibliotecário, que descreve o livro para bibliotecas e acervos. São complementares: o ISBN diz que o livro existe, a ficha prova que ele foi catalogado com padrão profissional."},{q:"Preciso mesmo ter ISBN antes?",a:"Sim. A ficha catalográfica inclui o número do ISBN, então ela só pode ser feita depois que o ISBN existe. Se você ainda não registrou seu ISBN, registre aqui na Sábhia â a gente usa o número automaticamente na sua ficha, sem você precisar digitar nada."},{q:"Quem assina a ficha?",a:"A bibliotecária oficial da Sábhia, registrada no Conselho Regional de Biblioteconomia (CRB). Por lei, só um bibliotecário com CRB pode emitir e assinar uma ficha catalográfica válida."},{q:"Quanto tempo leva?",a:`Em até ${l?.slaBusinessDays||5} dias úteis a ficha fica pronta e disponÃvel pra você baixar aqui na plataforma.`},{q:"Isso inclui direito autoral ou código de barras?",a:"Não. Esta oferta é exclusivamente da f
1icha catalográfica. Registro de direito autoral e código de barras são serviços separados."}].map((s,i)=>e.jsxs("details",{className:"group rounded-2xl border border-white/10 bg-white/[0.02] hover:border-indigo-400/30 transition-colors",children:[e.jsxs("summary",{className:"px-5 py-4 cursor-pointer text-sm font-bold text-white flex items-center justify-between gap-3 list-none",children:[e.jsx("span",{children:s.q}),e.jsx("span",{className:"text-indigo-400 group-open:rotate-45 transition-transform text-xl leading-none",children:"+"})]}),e.jsx("p",{className:"px-5 pb-4 text-sm text-white/70 leading-relaxed",children:s.a})]},i))})]})]})]}),t&&e.jsx("div",{className:"hidden md:block fixed right-4 top-20 w-[280px] max-h-[calc(100vh-6rem)] overflow-y-auto z-30",children:e.jsx(G,{bookId:t,currentStep:"ficha"})}),t&&e.jsx(W,{bookId:t,currentStep:"ficha"}),t&&e.jsx(fe,{open:b,onClose:()=>h(!1),bookId:t,serviceSlug:"ficha_catalografica"})]})}export{ea 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.