PageSourceSearch

https://pernambucorevista.com.br/assets/AdminHome-DXkD4PcI.js

js pernambucorevista.com.br collected 2026-10-02 11:42:45 UTC 75,596 bytes, 6 lines download raw bytes

1import{j as e}from"./vendor-motion-COWzbZXj.js";import{r as o,L as ee,h as as}from"./vendor-react-DabW9_xZ.js";import{u as ss,S as ta,a as ra,D as oa}from"./SortableList-BShIcrEK.js";import{c as ts,v as ia,z as rs,l as os,a as is,x as la,n as ls,U as xe,X as J,a2 as na,ai as ns,ad as ds,b as cs}from"./index-VlZpbbNi.js";import{l as ms}from"./agenda-Bma2H6SC.js";import{a as us}from"./autores-DBD0tyG5.js";import{c as xs,l as hs,a as ps,D as fs,d as gs,e as vs,f as bs,g as js,s as ys,h as Ns,i as Ss,j as Cs,k as _s,m as ua,n as ws}from"./homeColabore-f3KG9QSd.js";import{b as As,s as ks}from"./paginasConfig-CT6iQaD5.js";import{I as m,L as h,S as xa}from"./ui-p4zgnDPv.js";import{a as ha}from"./ImageUpload-DSf8DPxL.js";import{C as zs}from"./chevron-left-VdUhG656.js";import{C as Ts}from"./chevron-right-d3qK9T89.js";import{L as Is,R as Es,S as Se,C as da}from"./sliders-horizontal-BmcQihFA.js";import{F as Rs,P as ca}from"./puzzle-jmwUJ7oY.js";import{C as Q}from"./check-C4JEN0Qd.js";import{I as pa}from"./image-nGaUsZUZ.js";import{C as ma}from"./chevron-down-hi7sl9VQ.js";import{P as me}from"./pencil-CLtl7n-G.js";import{T as ue}from"./trash-2-Bd81rPFg.js";import{N as Ds}from"./newspaper-D3s2-RBw.js";import{E as qs}from"./eye-BCVyUdVF.js";import{S as Ps}from"./sparkles-CkX8sj4S.js";import{P as Ls}from"./plus-DQgGQ4QE.js";import{S as Ms}from"./save-TgH2RPUK.js";import{F as Os}from"./file-text-Dt2d8mTq.js";import{B as Fs}from"./book-marked-B-jeTSPl.js";import{T as Ws}from"./type-CzpXkR0T.js";import"./useUnsavedChangesStore-B_YPVePS.js";import"./react-D2rXhL_A.js";import"./core.esm-DGv0NeQL.js";import"./vendor-supabase-otNoK39h.js";/**
2 * @license lucide-react v0.546.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Bs=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],Hs=ts("megaphone",Bs);function fa({itens:r}){const[d,c]=o.useState(0),b=r.filter(t=>t.ativo);if(b.length===0)return e.jsx("div",{className:"adm-empty",style:{padding:"3rem"},children:e.jsx("p",{className:"adm-empty-text",children:"Nenhum slide ativo pra pré-visualizar."})});const j=d%b.length;return e.jsxs("div",{className:"assine-carousel !rounded-none !mt-0",style:{position:"relative"},children:[e.jsx("button",{"aria-label":"Slide anterior",className:"ac-arrow left !bg-white/10 hover:!bg-white/20 !text-white !border-none !rounded-full !w-12 !h-12 !left-4",onClick:()=>c(t=>(t-1+b.length)%b.length),children:e.jsx(zs,{size:24})}
6),e.jsx("button",{"aria-label":"Próximo slide",className:"ac-arrow right !bg-white/10 hover:!bg-white/20 !text-white !border-none !rounded-full !w-12 !h-12 !right-4",onClick:()=>c(t=>(t+1)%b.length),children:e.jsx(Ts,{size:24})}),e.jsx("div",{className:"ac-track",style:{transform:"translateX(-".concat(j*100,"%)")},children:b.map(t=>{var u,g;return e.jsx("div",{className:"ac-slide !flex !items-center !justify-center !px-12 !py-16 md:!px-32 !min-height-[600px]",style:{backgroundColor:t.bg_color},children:e.jsxs("div",{className:"max-w-6xl w-full grid grid-cols-1 md:grid-cols-[1fr_1.5fr] gap-12 items-center",children:[t.capa_url&&e.jsx("div",{className:"relative flex justify-center",children:e.jsx("div",{className:"w-full max-w-[340px] shadow-[0_30px_60px_-12px_rgba(0,0,0,0.5)]",children:e.jsx("img",{src:t.capa_url,alt:t.titulo,className:"w-full block ac-capa"})})}),e.jsxs("div",{className:"space-y-6",style:{color:t.text_color||"#ffffff"},children:[e.jsx("h2",{className:"hidden md:block text-4xl md:text-5xl font-black tracking-tight",children:t.titulo}),e.jsxs("div",{className:"hidden md:block space-y-4 max-w-2xl",children:[e.jsx("p",{className:"text-sm md:text-base leading-relaxed opacity-90",children:t.descricao}),t.obs&&e.jsx("p",{className:"text-sm md:text-base font-bold",children:t.obs})]}),t.preco&&e.jsx("p",{className:"hidden md:block text-3xl font-black opacity-90",children:t.preco}),t.mostrar_cta!==!1&&(t.link_url?e.jsx("a",{href:t.link_url,target:"_blank",rel:"noopener noreferrer",className:"compre-btn compre-btn-a !mt-8 !rounded-none !px-8",style:{textDecoration:"none",display:"inline-block",background:t.btn_bg_color||"var(--color-y)",color:t.btn_text_color||"var(--color-k)"},children:(u=t.btn_texto)!=null?u:"★ Assinar Sócio Digital →"}):e.jsx(ee,{to:"/checkout?tipo=socio&plano=anual",className:"compre-btn compre-btn-a !mt-8 !rounded-none !px-8",style:{textDecoration:"none",display:"inline-block",background:t.btn_bg_color||"var(--color-y)",color:t.btn_text_color||"var(--color-k)"},children:(g=t.btn_texto)!=null?g:"★ Assinar Sócio Digital →"})),t.mostrar_lojas_app&&e.jsxs("div",{className:"flex items-center gap-4 !mt-6",children:[e.jsx("a",{href:"https://apps.apple.com/br/app/revista-continente/id1205554261",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://editora.cepe.com.br/img/botao-apple.png",width:120,height:40,loading:"lazy",alt:"Baixar na App Store"})}),e.jsx("a",{href:"https://play.google.com/store/apps/details?id=br.com.cepe.revistacontinente",target:"_blank",rel:"noopener noreferrer",children:e.jsx("img",{src:"https://editora.cepe.com.br/img/botao-google.png",width:135,height:40,loading:"lazy",alt:"Disponível no Google Play"})})]})]})]})},t.id)})})]})}const Us=[{secao:"Hero & Destaques",icon:e.jsx(pa,{size:14}),campos:[{campo:"Título",limite:"60 caracteres",obs:"Aparece truncado acima de 60 car. no hero"},{campo:"Subtítulo / Chamada",limite:"120 caracteres",obs:"Exibido como deck abaixo do título"},{campo:"Imagem de capa",limite:"1200 × 800 px no upload",obs:'Exibida em caixa ≈16:9 na Home — ajuste o foco em "Home (destaques)" no editor da matéria'}]},{secao:"Página de Artigo",icon:e.jsx(Os,{size:14}),campos:[{campo:"Imagem hero (art-hero)",limite:"1200 × 800 px no upload",obs:'Exibida em caixa 4:3 na leitura da matéria — ajuste o foco em "Leitura da matéria" no editor da matéria'},{campo:"Resumo / SEO",limite:"160 caracteres",obs:"Usado em meta description e preview de links"}]},{secao:"Cabeçalho da edição",icon:e.jsx(Fs,{size:14}),campos:[{campo:"Capa da edição",limite:"400 × 533 px",obs:"Mín. 300 px de largura"},{campo:"Título da edição",limite:"80 caracteres",obs:""},{campo:"Tema / Subtema",limite:"60 caracteres",obs:""}]},{secao:"Conheça o Autor",icon:e.jsx(xe,{size:14}),campos:[{campo:"Foto do autor",limite:"480 × 640 px",obs:"A seção exibe em caixa 240×320 px (retrato) no desktop"},{campo:"Nome de exibição",limite:"30 caracteres",obs:"Aparece em maiúsculas, pode ter quebra de linha"},{campo:"Bio",limite:"200 caracteres",obs:"Texto curto abaixo do nome"},{campo:"Tag",limite:"40 caracteres",obs:'ex: "AUTOR EM DESTAQUE — ABR 2026"'}]},{secao:"Carousel de Assinatura",icon:e.jsx(Se,{size:14}),campos:[{campo:"Título",limite:"50 caracteres",obs:"Exibido em fonte bold grande"},{campo:"Descrição",limite:"400 caracteres",obs:"Texto descritivo do plano"},{campo:"Imagem de capa",limite:"340 × 480 px",obs:"Capa de revista. Mín. 200 px"}
6,{campo:"Preço",limite:"20 caracteres",obs:"ex: R$ 200,00"}]},{secao:"Caça Palavras",icon:e.jsx(Ws,{size:14}),campos:[{campo:"Palavra",limite:"20 caracteres",obs:"Sem acentos, maiúsculas. Grid máx. 15×15"},{campo:"Definição",limite:"120 caracteres",obs:"Exibida na legenda abaixo do grid"}]}],Gs={facil:[{word:"POESIA",def:"Gênero literário marcado pela expressão de emoções."},{word:"CORDEL",def:"Literatura popular em verso, típica do Nordeste."},{word:"LIVRO",def:"Objeto artístico que guarda o mundo das palavras."},{word:"CONTO",def:"Narrativa breve e concisa."},{word:"VERSO",def:"Linha que compõe um poema."},{word:"PROSA",def:"Texto não poético."},{word:"TEMA",def:"Assunto abordado numa obra."},{word:"ARTE",def:"Manifestação estética da sensibilidade humana."},{word:"RIMA",def:"Repetição de sons iguais ou semelhantes."},{word:"MUSA",def:"Divindade inspiradora das artes."},{word:"OBRA",def:"Criação artística ou literária."},{word:"SAGA",def:"Narrativa épica de grandes aventuras."},{word:"TESE",def:"Proposição que se defende num argumento."},{word:"ODES",def:"Poemas líricos de tom elevado."},{word:"BARDO",def:"Poeta ou trovador antigo."}],medio:[{word:"ROMANCE",def:"Narrativa longa com tramas complexas."},{word:"CRONICA",def:"Texto que observa o cotidiano com olhar crítico."},{word:"CULTURA",def:"Patrimônio intelectual e artístico de um povo."},{word:"TEATRO",def:"Arte que une texto, cenografia e representação."},{word:"LEITURA",def:"Ato de decifrar o mundo através da escrita."},{word:"SONETO",def:"Poema de forma fixa com 14 versos."},{word:"ENSAIO",def:"Texto de reflexão crítica sobre um tema."},{word:"ENREDO",def:"A trama ou sequência de eventos de uma história."},{word:"GENERO",def:"Classificação das obras literárias."},{word:"DRAMA",def:"Gênero que foca em conflitos intensos."},{word:"FABULA",def:"Narrativa curta com fundo moral."},{word:"IRONIA",def:"Expressar o contrário do que se pensa."},{word:"METAFORA",def:"Figura que substitui um termo por outro análogo."},{word:"NARRADOR",def:"Voz que conduz a narrativa literária."},{word:"ESTROFE",def:"Conjunto de versos numa composição poética."}],dificil:[{word:"MODERNISMO",def:"Movimento de renovação artística do século XX."},{word:"LITERATURA",def:"A arte da palavra escrita e da fabulação."},{word:"PERNAMBUCO",def:"Estado de rica efervescência cultural e literária."},{word:"DRUMMOND",def:"Carlos Drummond de Andrade, poeta essencial."},{word:"SIMBOLISMO",def:"Movimento focado no subjetivismo e misticismo."},{word:"REALISMO",def:"Retrata a realidade de forma objetiva."},{word:"ROMANTISMO",def:"Foco no sentimentalismo e individualidade."},{word:"CLASSICISMO",def:"Resgate dos ideais da antiguidade clássica."},{word:"HUMANISMO",def:"Valorização do ser humano e da razão."},{word:"ESTRUTURA",def:"A organização interna de um texto."},{word:"NARRATIVA",def:"O modo como uma história é contada."},{word:"EPIGRAFE",def:"Citação curta no início de uma obra."},{word:"PARALELISMO",def:"Repetição de estruturas sintáticas."},{word:"INTERTEXTO",def:"Referência de um texto a outro."},{word:"ALITERACAO",def:"Repetição de sons consonantais num verso."}]};function $s(r){return r<=6?"facil":r<=9?"medio":"dificil"}async function Vs(r){let d=[];try{d=await ds()}catch(u){}const c={facil:[],medio:[],dificil:[]};for(const u of d){const g=u.palavra.toUpperCase().replace(/\s+/g,"").normalize("NFD").replace(/[̀-ͯ]/g,"");if(g.length<4||g.length>15)continue;const y=$s(g.length);c[y].push({word:g,def:u.definicao})}const b={facil:8,medio:10,dificil:12};for(const u of["facil","medio","dificil"])if(c[u].length<b[u]){const g=b[u]-c[u].length,y=new Set(c[u].map(_=>_.word)),k=Gs[u].filter(_=>!y.has(_.word));c[u].push(...k.slice(0,g))}const j=u=>[...u].sort(()=>Math.random()-.5),t=[];for(const u of["facil","medio","dificil"])for(const{word:g,def:y}of j(c[u]).slice(0,b[u]))t.push({mes:r,dificuldade:u,palavra:g,definicao:y});return t}function Ne({status:r,itens:d}){return r==="carregando"?e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"0.375rem",fontSize:"0.75rem",color:"var(--adm-text-faint)"}
6,children:[e.jsx("span",{style:{width:"0.75rem",height:"0.75rem",borderRadius:"9999px",border:"2px solid var(--adm-border)",borderTopColor:"var(--adm-accent)",display:"inline-block",animation:"spin 0.7s linear infinite"}}),"Carregando"]}):r==="ok"&&d!==void 0?e.jsxs("span",{className:"adm-badge adm-badge-green",children:[d," ",d===1?"item":"itens"]}):r==="vazio"?e.jsx("span",{className:"adm-badge adm-badge-yellow",children:"Vazio"}):null}function Xs({item:r,autores:d,onClose:c,onSaved:b}){var w,D,q,H,F,U,W,G,$;const j=!(r!=null&&r.id),[t,u]=o.useState({autor_id:(w=r==null?void 0:r.autor_id)!=null?w:"",tag:(D=r==null?void 0:r.tag)!=null?D:"AUTOR EM DESTAQUE — "+new Date().toLocaleDateString("pt-BR",{month:"short",year:"numeric"}).toUpperCase(),nome_exibicao:(q=r==null?void 0:r.nome_exibicao)!=null?q:"",foto_url:(H=r==null?void 0:r.foto_url)!=null?H:"",bio:(F=r==null?void 0:r.bio)!=null?F:"",stat_artigos:(W=(U=r==null?void 0:r.stat_artigos)==null?void 0:U.toString())!=null?W:"",ativo:(G=r==null?void 0:r.ativo)!=null?G:!1}),[g,y]=o.useState(($=r==null?void 0:r.stat_artigos)!=null?$:null),[k,_]=o.useState(!1),[f,L]=o.useState(null);function N(x,n){u(A=>({...A,[x]:n}))}async function I(x){const n=d.find(A=>A.id===x);if(N("autor_id",x),n){t.nome_exibicao||N("nome_exibicao",n.nome.toUpperCase()),n.foto_url&&!t.foto_url&&N("foto_url",n.foto_url),n.bio&&!t.bio&&N("bio",n.bio.slice(0,200));const A=await cs(x);y(A),N("stat_artigos",String(A))}else y(null),N("stat_artigos","")}o.useEffect(()=>{if(t.autor_id)return;const x=t.nome_exibicao.trim();if(!x){y(null);return}const n=setTimeout(async()=>{const A=await ns(x);if(!A){y(null);return}y(A),N("stat_artigos",String(A))},400);return()=>clearTimeout(n)},[t.nome_exibicao,t.autor_id]);async function M(){if(!t.nome_exibicao.trim()){L("Nome de exibição é obrigatório.");return}if(!t.bio.trim()){L("Bio é obrigatória.");return}_(!0),L(null);try{await _s({...r!=null&&r.id?{id:r.id}:{},autor_id:t.autor_id||void 0,tag:t.tag,nome_exibicao:t.nome_exibicao,foto_url:t.foto_url||void 0,bio:t.bio,stat_artigos:t.stat_artigos?parseInt(t.stat_artigos):void 0,ativo:t.ativo}),b(),c()}catch(x){L(x.message)}finally{_(!1)}}const z=t.bio.length,E=t.tag.length,R=t.nome_exibicao.length;return e.jsx("div",{className:"adm-modal-overlay",children:e.jsxs("div",{className:"adm-modal",style:{maxWidth:"580px"},children:[e.jsxs("div",{className:"adm-modal-header",children:[e.jsx("h2",{className:"adm-modal-title",children:j?"Novo autor em destaque":"Editar autor destaque"}),e.jsx("button",{onClick:c,style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.25rem",color:"var(--adm-text-faint)"},children:e.jsx(J,{size:14})})]}),e.jsxs("div",{className:"adm-modal-body",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Autor"}),e.jsxs("select",{value:t.autor_id,onChange:x=>I(x.target.value),className:xa,children:[e.jsx("option",{value:"",children:"— Selecione um autor —"}),d.map(x=>e.jsx("option",{value:x.id,children:x.nome},x.id))]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Tag ",e.jsxs("span",{style:{fontWeight:400,color:E>40?"#ef4444":"var(--adm-text-faint)"},children:[E,"/40 car."]})]}),e.jsx("input",{type:"text",value:t.tag,onChange:x=>N("tag",x.target.value),className:m,placeholder:"AUTOR EM DESTAQUE — MAI 2026"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Nome de exibição * ",e.jsxs("span",{style:{fontWeight:400,color:R>30?"#ef4444":"var(--adm-text-faint)"},children:[R,"/30 car."]})]}),e.jsx("input",{type:"text",value:t.nome_exibicao,onChange:x=>N("nome_exibicao",x.target.value),className:m,placeholder:"CLARICE LISPECTOR"})]}),e.jsx(ha,{label:"Foto do autor (480×640 px)",value:t.foto_url,onChange:x=>N("foto_url",x),bucket:"media",folder:"autores",previewHeight:"6rem",previewAspect:"cover",aspect:3/4}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Bio * ",e.jsxs("span",{style:{fontWeight:400,color:z>200?"#ef4444":"var(--adm-text-faint)"},children:[z,"/200 car."]})]}),e.jsx("textarea",{value:t.bio,onChange:x=>N("bio",x.target.value),rows:3,className:m,style:{resize:"none"}
6,placeholder:"Nascida no Ucrânia, naturalizada brasileira…"})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Nº artigos publicados"}),g!==null?e.jsx("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",background:"#f0fdf4",border:"1px solid #bbf7d0",borderRadius:"var(--adm-radius)",fontSize:"0.875rem",fontWeight:600,color:"#15803d"},children:e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px"},children:[e.jsx(Q,{size:12})," ",g," artigos encontrados automaticamente"]})}):e.jsx("input",{type:"number",value:t.stat_artigos,onChange:x=>N("stat_artigos",x.target.value),className:m,placeholder:"Selecione um autor para calcular automaticamente",min:0,readOnly:!!t.autor_id})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsx("button",{type:"button",onClick:()=>N("ativo",!t.ativo),className:"adm-toggle ".concat(t.ativo?"adm-toggle-on":"adm-toggle-off"),children:e.jsx("span",{className:"adm-toggle-knob"})}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)"},children:"Exibir na home"})]})]}),f&&e.jsx("div",{className:"adm-alert adm-alert-error",style:{margin:"0 1.5rem 0.75rem"},children:f}),e.jsxs("div",{className:"adm-modal-footer",children:[e.jsx("button",{onClick:c,className:"adm-btn adm-btn-secondary",children:"Cancelar"}),e.jsx("button",{onClick:M,disabled:k,className:"adm-btn adm-btn-primary",children:k?"Salvando…":j?"Adicionar":"Salvar"})]})]})})}function Qs({item:r,proximaOrdem:d,onClose:c,onSaved:b}){var M,z,E,R,w,D,q,H,F,U,W,G,$,x;const j=!r,[t,u]=o.useState({titulo:(M=r==null?void 0:r.titulo)!=null?M:"",descricao:(z=r==null?void 0:r.descricao)!=null?z:"",obs:(E=r==null?void 0:r.obs)!=null?E:"",preco:(R=r==null?void 0:r.preco)!=null?R:"R$ 0,00",bg_color:(w=r==null?void 0:r.bg_color)!=null?w:"#960e2d",text_color:(D=r==null?void 0:r.text_color)!=null?D:"#ffffff",capa_url:(q=r==null?void 0:r.capa_url)!=null?q:"",link_url:(H=r==null?void 0:r.link_url)!=null?H:"",btn_texto:(F=r==null?void 0:r.btn_texto)!=null?F:"Assinar Sócio Digital →",btn_bg_color:(U=r==null?void 0:r.btn_bg_color)!=null?U:"#faebd7",btn_text_color:(W=r==null?void 0:r.btn_text_color)!=null?W:"#0a0a0a",mostrar_lojas_app:(G=r==null?void 0:r.mostrar_lojas_app)!=null?G:!1,mostrar_cta:($=r==null?void 0:r.mostrar_cta)!=null?$:!0,ativo:(x=r==null?void 0:r.ativo)!=null?x:!0}),[g,y]=o.useState(!1),[k,_]=o.useState(null);function f(n,A){u(ae=>({...ae,[n]:A}))}async function L(){var n;if(!t.titulo.trim()){_("Título é obrigatório.");return}y(!0),_(null);try{await ua({id:r==null?void 0:r.id,ordem:(n=r==null?void 0:r.ordem)!=null?n:d,titulo:t.titulo,descricao:t.descricao,obs:t.obs||void 0,preco:t.preco,bg_color:t.bg_color,text_color:t.text_color,capa_url:t.capa_url||void 0,link_url:t.link_url||void 0,btn_texto:t.btn_texto||void 0,btn_bg_color:t.btn_bg_color,btn_text_color:t.btn_text_color,mostrar_lojas_app:t.mostrar_lojas_app,mostrar_cta:t.mostrar_cta,ativo:t.ativo}),b(),c()}catch(A){_(A.message)}finally{y(!1)}}const N=t.titulo.length,I=t.descricao.length;return e.jsx("div",{className:"adm-modal-overlay",children:e.jsxs("div",{className:"adm-modal",style:{maxWidth:"580px"},children:[e.jsxs("div",{className:"adm-modal-header",children:[e.jsx("h2",{className:"adm-modal-title",children:j?"Novo slide":"Editar slide ".concat(r.ordem+1)}),e.jsx("button",{onClick:c,style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.25rem",color:"var(--adm-text-faint)"},children:e.jsx(J,{size:14})})]}),e.jsxs("div",{className:"adm-modal-body",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsx("div",{style:{height:"3rem",borderRadius:"var(--adm-radius)",background:t.bg_color,display:"flex",alignItems:"center",paddingLeft:"1rem"},children:e.jsx("span",{style:{color:t.text_color,fontSize:"0.875rem",fontWeight:700,opacity:.9},children:t.titulo||"Título do slide"})}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Título * ",e.jsxs("span",{style:{fontWeight:400,color:N>50?"#ef4444":"var(--adm-text-faint)"},children:[N,"/50 car."]})]}),e.jsx("input",{type:"text",value:t.titulo,onChange:n=>
6f("titulo",n.target.value),className:m,placeholder:"Assinatura Pernambuco (Anual)"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Descrição ",e.jsxs("span",{style:{fontWeight:400,color:I>400?"#ef4444":"var(--adm-text-faint)"},children:[I,"/400 car."]})]}),e.jsx("textarea",{value:t.descricao,onChange:n=>f("descricao",n.target.value),rows:4,className:m,style:{resize:"none"},placeholder:"Descrição do plano de assinatura…"})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Obs. complementar"}),e.jsx("input",{type:"text",value:t.obs,onChange:n=>f("obs",n.target.value),className:m,placeholder:"Frete grátis para todo o Brasil"})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Preço"}),e.jsx("input",{type:"text",value:t.preco,onChange:n=>f("preco",n.target.value),className:m,placeholder:"R$ 200,00"})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Cor de fundo"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:t.bg_color,onChange:n=>f("bg_color",n.target.value),style:{width:"2.5rem",height:"2rem",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",padding:"0.125rem",cursor:"pointer"}}),e.jsx("input",{type:"text",value:t.bg_color,onChange:n=>f("bg_color",n.target.value),className:m,style:{fontFamily:"monospace",fontSize:"0.75rem",flex:1},placeholder:"#960e2d"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Cor do texto"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:t.text_color,onChange:n=>f("text_color",n.target.value),style:{width:"2.5rem",height:"2rem",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",padding:"0.125rem",cursor:"pointer"}}),e.jsx("input",{type:"text",value:t.text_color,onChange:n=>f("text_color",n.target.value),className:m,style:{fontFamily:"monospace",fontSize:"0.75rem",flex:1},placeholder:"#ffffff"})]})]})]}),e.jsx(ha,{label:"Imagem de capa (340×480 px)",value:t.capa_url,onChange:n=>f("capa_url",n),bucket:"media",folder:"carousel",previewHeight:"8rem",previewAspect:"cover",aspect:3/4}),e.jsxs("div",{style:{borderTop:"1px solid var(--adm-border)",paddingTop:"1rem"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"0.75rem"},children:[e.jsx("p",{style:{fontSize:"0.6875rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--adm-text-faint)",margin:0},children:"Botão de ação (CTA)"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsx("button",{type:"button",onClick:()=>f("mostrar_cta",!t.mostrar_cta),className:"adm-toggle ".concat(t.mostrar_cta?"adm-toggle-on":"adm-toggle-off"),children:e.jsx("span",{className:"adm-toggle-knob"})}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)"},children:"Ativo / visível no site"})]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto do botão"}),e.jsx("input",{type:"text",value:t.btn_texto,onChange:n=>f("btn_texto",n.target.value),className:m,placeholder:"★ Assinar a revista →"})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"URL do botão"}),e.jsx("input",{type:"url",value:t.link_url,onChange:n=>f("link_url",n.target.value),className:m,placeholder:"https://… (vazio = /checkout do Sócio Digital anual)"})]})]}),e.jsx("p",{style:{fontSize:"0.6rem",color:"var(--adm-text-faint)",marginBottom:"0.75rem"},children:"Deixe a URL em branco para usar a página de assinatura padrão do site."}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Cor do botão"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:t.btn_bg_color,onChange:n=>
6f("btn_bg_color",n.target.value),style:{width:"2.5rem",height:"2rem",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",padding:"0.125rem",cursor:"pointer"}}),e.jsx("input",{type:"text",value:t.btn_bg_color,onChange:n=>f("btn_bg_color",n.target.value),className:m,style:{fontFamily:"monospace",fontSize:"0.75rem",flex:1},placeholder:"#faebd7"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Cor do texto do botão"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:t.btn_text_color,onChange:n=>f("btn_text_color",n.target.value),style:{width:"2.5rem",height:"2rem",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",padding:"0.125rem",cursor:"pointer"}}),e.jsx("input",{type:"text",value:t.btn_text_color,onChange:n=>f("btn_text_color",n.target.value),className:m,style:{fontFamily:"monospace",fontSize:"0.75rem",flex:1},placeholder:"#0a0a0a"})]})]})]}),e.jsx("div",{style:{marginTop:"0.75rem",display:"inline-flex",alignItems:"center",padding:"0.5rem 1rem",borderRadius:"var(--adm-radius)",background:t.btn_bg_color,color:t.btn_text_color,fontSize:"0.8125rem",fontWeight:700},children:t.btn_texto||"★ Assinar a revista →"}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer",marginTop:"0.75rem"},children:[e.jsx("button",{type:"button",onClick:()=>f("mostrar_lojas_app",!t.mostrar_lojas_app),className:"adm-toggle ".concat(t.mostrar_lojas_app?"adm-toggle-on":"adm-toggle-off"),children:e.jsx("span",{className:"adm-toggle-knob"})}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)"},children:"Mostrar botões de App Store / Google Play"})]}),t.mostrar_lojas_app&&e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem",marginTop:"0.5rem"},children:[e.jsx("img",{src:"https://editora.cepe.com.br/img/botao-apple.png",width:100,height:33,alt:"Apple Store"}),e.jsx("img",{src:"https://editora.cepe.com.br/img/botao-google.png",width:112,height:33,alt:"Google Play"})]})]}),e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsx("button",{type:"button",onClick:()=>f("ativo",!t.ativo),className:"adm-toggle ".concat(t.ativo?"adm-toggle-on":"adm-toggle-off"),children:e.jsx("span",{className:"adm-toggle-knob"})}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)"},children:"Ativo / visível no site"})]})]}),k&&e.jsx("div",{className:"adm-alert adm-alert-error",style:{margin:"0 1.5rem 0.75rem"},children:k}),e.jsxs("div",{className:"adm-modal-footer",children:[e.jsx("button",{onClick:c,className:"adm-btn adm-btn-secondary",children:"Cancelar"}),e.jsx("button",{onClick:L,disabled:g,className:"adm-btn adm-btn-primary",children:g?"Salvando…":"Salvar"})]})]})})}function Js({item:r,onClose:d,onAprovado:c}){const[b,j]=o.useState(!1),[t,u]=o.useState(null);async function g(){j(!0),u(null);try{await ua({id:r.id,ativo:!0}),c(),d()}catch(y){u(y.message)}finally{j(!1)}}return e.jsx("div",{className:"adm-modal-overlay",children:e.jsxs("div",{className:"adm-modal",style:{maxWidth:"1040px"},children:[e.jsxs("div",{className:"adm-modal-header",children:[e.jsxs("h2",{className:"adm-modal-title",children:["Pré-visualização — Slide ",r.ordem+1,!r.ativo&&e.jsx("span",{className:"adm-badge adm-badge-gray",style:{marginLeft:"0.625rem"},children:"Ainda inativo, só você está vendo"})]}),e.jsx("button",{onClick:d,style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.25rem",color:"var(--adm-text-faint)"},children:e.jsx(J,{size:14})})]}),e.jsx("div",{className:"adm-modal-body",style:{padding:0},children:e.jsx(fa,{itens:[{...r,ativo:!0}]})}),t&&e.jsx("div",{className:"adm-alert adm-alert-error",style:{margin:"0.75rem 1.5rem 0"},children:t}),e.jsxs("div",{className:"adm-modal-footer",children:[e.jsx("button",{onClick:d,className:"adm-btn adm-btn-secondary",children:"Fechar"}),!r.ativo&&e.jsxs("button",{onClick:g,disabled:b,className:"adm-btn adm-btn-primary",style:{display:"flex",alignItems:"center",gap:"0.375rem"},children:[e.jsx(Q,{size:14})," ",b?"Aprovando…":"Aprovar e ativar na home"]})]})]})})}function Ys({mes:r,item:d,onClose:c,onSaved:b}){var M,z,E,R;const j=!(d!=null&&d.id),[t,u]=o.useState({mes:(M=d==null?void 0:d.mes)!=null?M:r,dificuldade:(z=d==null?void 0:d.dificuldade)!=null?z:"facil",palavra:(E=d==null?void 0:d.palavra)!=null?E:"",definicao:(R=d==null?void 0:d.definicao)!=null?R:""}),[g,y]=o.useState(!1),[k,_]=o.useState(null);function f(w,D){u(q=>({...q,[w]:D}))}async function L(){if(!t.palavra.trim()){_("Palavra é obrigatória.");return}if(!t.definicao.trim()){_("Definição é obrigatória.");return}y(!0),_(null);try{await ws({...d!=null&&d.id?{id:d.id}:{},mes:t.mes,dificuldade:t.dificuldade,palavra:t.palavra.toUpperCase(),definicao:t.definicao}),b(),c()}catch(w){_(w.message)}finally{y(!1)}}const N=t.palavra.length,I=t.definicao.length;return e.jsx("div",{className:"adm-modal-overlay",children:e.jsxs("div",{className:"adm-modal",style:{maxWidth:"480px"},children:[e.jsxs("div",{className:"adm-modal-header",children:[e.jsx("h2",{className:"adm-modal-title",children:j?"Nova palavra":"Editar palavra"}),e.jsx("button",{onClick:c,style:{background:"none",border:"none",cursor:"pointer",fontSize:"1.25rem",color:"var(--adm-text-faint)"},children:e.jsx(J,{size:14})})]}),e.jsxs("div",{className:"adm-modal-body",style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Mês (AAAA-MM)"}),e.jsx("input",{type:"month",value:t.mes,onChange:w=>f("mes",w.target.value),className:m})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Dificuldade"}),e.jsxs("select",{value:t.dificuldade,onChange:w=>f("dificuldade",w.target.value),className:xa,children:[e.jsx("option",{value:"facil",children:"Fácil"}),e.jsx("option",{value:"medio",children:"Médio"}),e.jsx("option",{value:"dificil",children:"Difícil"})]})]})]}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Palavra * ",e.jsxs("span",{style:{fontWeight:400,color:N>20?"#ef4444":"var(--adm-text-faint)"},children:[N,"/20 car."]})]}),e.jsx("input",{type:"text",value:t.palavra,onChange:w=>f("palavra",w.target.value.toUpperCase()),className:m,placeholder:"LITERATURA",style:{fontFamily:"monospace",textTransform:"uppercase"}})]}),e.jsxs("div",{children:[e.jsxs("label",{className:h,style:{display:"flex",justifyContent:"space-between"},children:["Definição * ",e.jsxs("span",{style:{fontWeight:400,color:I>120?"#ef4444":"var(--adm-text-faint)"},children:[I,"/120 car."]})]}),e.jsx("textarea",{value:t.definicao,onChange:w=>f("definicao",w.target.value),rows:2,className:m,style:{resize:"none"},placeholder:"A arte da palavra escrita e da fabulação."})]})]}),k&&e.jsx("div",{className:"adm-alert adm-alert-error",style:{margin:"0 1.5rem 0.75rem"},children:k}),e.jsxs("div",{className:"adm-modal-footer",children:[e.jsx("button",{onClick:c,className:"adm-btn adm-btn-secondary",children:"Cancelar"}),e.jsx("button",{onClick:L,disabled:g,className:"adm-btn adm-btn-primary",children:g?"Salvando…":j?"Adicionar":"Salvar"})]})]})})}
6function zt(){const[r,d]=o.useState([]),[c,b]=o.useState(null),[j,t]=o.useState(""),[u,g]=o.useState(!1),[y,k]=o.useState(!1),[_,f]=o.useState([]),[L,N]=o.useState([]),[I,M]=o.useState([]),[z,E]=o.useState(0),[R,w]=o.useState(!0),[D,q]=o.useState(!0),[H,F]=o.useState(!0),[U,W]=o.useState(!0),[G,$]=o.useState([]),[x,n]=o.useState([]),[A,ae]=o.useState(!0),[Ce,se]=o.useState({aberto:!1,item:null}),[V,ga]=o.useState([]),[_e,we]=o.useState(!0),[Ae,Y]=o.useState({aberto:!1,item:null}),[ke,ze]=o.useState(null),Te=new Date().toISOString().slice(0,7),[T,va]=o.useState(Te),[B,ba]=o.useState([]),[ja,Ie]=o.useState(!0),[he,Ee]=o.useState(!1),[Re,te]=o.useState({aberto:!1,item:null}),[S,C]=o.useState(null),[ya,Na]=o.useState(!0),[De,qe]=o.useState(!1),[Sa,Pe]=o.useState(!1),[Le,pe]=o.useState(null),[p,O]=o.useState({hero_ids:[],destaque_ids:[]}),[fe,ge]=o.useState(null),[ve,Me]=o.useState([]),[Oe,be]=o.useState(!0),[X,Fe]=o.useState(!1),[We,Ca]=o.useState({}),[_a,wa]=o.useState(!0),[Be,He]=o.useState(!1),[Aa,Ue]=o.useState(!1),[re,ka]=o.useState(""),[oe,za]=o.useState(""),[ie,je]=o.useState(null),[le,ye]=o.useState(null),[Ta,Ge]=o.useState(!1),[Ia,$e]=o.useState(!1),ne=12;function Z(a){Ca(s=>{const i={...s};for(const l of a)i[l.id]=l;return i})}async function Ve(){Fe(!0);try{const a=await la(ne,ve.length);Me(s=>[...s,...a]),Z(a),be(a.length===ne)}catch(a){be(!1)}finally{Fe(!1)}}o.useEffect(()=>{if(!re.trim()){je(null);return}Ge(!0);const a=setTimeout(()=>{ia(re,20).then(s=>{je(s),Z(s)}).catch(()=>je([])).finally(()=>Ge(!1))},300);return()=>clearTimeout(a)},[re]),o.useEffect(()=>{if(!oe.trim()){ye(null);return}$e(!0);const a=setTimeout(()=>{ia(oe,20).then(s=>{ye(s),Z(s)}).catch(()=>ye([])).finally(()=>$e(!1))},300);return()=>clearTimeout(a)},[oe]);const[Ea,Ra]=as(),Xe=Ea.get("tab"),Da=["overview","hints","artigos","autor","carousel","caca","colabore"],[P,qa]=o.useState(Da.includes(Xe)?Xe:"overview");function Pa(a){qa(a),Ra(a==="overview"?{}:{tab:a},{replace:!0})}const La=o.useMemo(()=>fe!==null&&JSON.stringify(p)!==JSON.stringify(fe),[p,fe]),Qe=P==="artigos"&&La,Je="Você tem alterações não salvas em Home → Artigos em destaque. Sair mesmo assim?";ss(Qe,Je);function Ma(a){a!==P&&Qe&&!window.confirm(Je)||Pa(a)}const de=o.useCallback(async()=>{ae(!0);try{n(await xs())}catch(a){}finally{ae(!1)}},[]),ce=o.useCallback(async()=>{we(!0);try{ga(await hs())}catch(a){}finally{we(!1)}},[]),K=o.useCallback(async a=>{Ie(!0);try{ba(await ps(a))}catch(s){}finally{Ie(!1)}},[]);o.useEffect(()=>{rs().then(a=>{var i,l;d(a);const s=(i=a.find(v=>v.destaque))!=null?i:null;b(s),t((l=s==null?void 0:s.id)!=null?l:""),w(!1)}).catch(()=>w(!1)),os().then(({hero:a,destaques:s})=>{f(a),N(s),q(!1)}).catch(()=>q(!1)),ms(5).then(a=>{M(a),F(!1)}).catch(()=>F(!1)),is().then(a=>{E(a.length),W(!1)}).catch(()=>W(!1)),us().then($).catch(()=>{}),de(),ce(),K(Te),As("home_colabore").then(a=>C({...fs,...a})).catch(a=>pe(a.message)).finally(()=>Na(!1)),Promise.allSettled([gs(),la(ne,0)]).then(([a,s])=>{var i,l;if(a.status==="fulfilled"&&a.value){const v={hero_ids:(i=a.value.hero_ids)!=null?i:[],destaque_ids:(l=a.value.destaque_ids)!=null?l:[]};O(v),ge(v);const sa=[...v.hero_ids,...v.destaque_ids];sa.length&&ls(sa).then(es=>Z(es)).catch(()=>{})}else ge({hero_ids:[],destaque_ids:[]});s.status==="fulfilled"&&(Me(s.value),Z(s.value),be(s.value.length===ne)),wa(!1)})},[]),o.useEffect(()=>{K(T)},[T]);async function Oa(){var a;if(j){g(!0);try{for(const i of r.filter(l=>l.destaque))await na({id:i.id,destaque:!1});await na({id:j,destaque:!0});const s=(a=r.find(i=>i.id===j))!=null?a:null;b(s),k(!0),setTimeout(()=>k(!1),3e3)}catch(s){alert("Erro: "+s.message)}finally{g(!1)}}}async function Fa(a){try{await vs(a),de()}catch(s){alert("Erro: "+s.message)}}async function Wa(a){if(confirm('Excluir "'.concat(a.nome_exibicao,'"?')))try{await bs(a.id),de()}catch(s){alert("Erro: "+s.message)}}async function Ba(a){if(confirm('Excluir o slide "'.concat(a.titulo,'"?')))try{await js(a.id),ce()}catch(s){alert("Erro: "+s.message)}}async function Ha(){He(!0);try{await ys(p),ge(p),Ue(!0),setTimeout(()=>Ue(!1),3e3)}catch(a){alert("Erro: "+a.message)}finally{He(!1)}}async function Ua(){var a;if(S){qe(!0),pe(null);try{await ks("home_colabore",S),Pe(!0),setTimeout(()=>Pe(!1),3e3)}catch(s){pe((a=s.message)!=null?a:"Erro ao salvar.")}finally{qe(!1)}}}function Ga(a,s){C(i=>{if(!i)return i;const l=[...i.chips];return l[a]=s,{...i,chips:l}})}function $a(){C(a=>a&&{...a,chips:[...a.chips,""]})}function Va(a){C(s=>s&&{...s,chips:s.chips.filter((i,l)=>l!==a)})}function Ye(a){O(s=>{const i=s.hero_ids;return i.includes(a)?{...s,hero_ids:i.filter(l=>l!==a)}:i.length>=4?s:{...s,hero_ids:[...i,a]}})}function Ze(a){O(s=>{const i=s.destaque_ids;return i.includes(a)?{...s,destaque_ids:i.filter(l=>l!==a)}:i.length>=6?s:{...s,destaque_ids:[...i,a]}})}function Ke(a,s){O(i=>{const l=[...i.hero_ids],v=s==="up"?a-1:a+1;return v<0||v>
6=l.length?i:([l[a],l[v]]=[l[v],l[a]],{...i,hero_ids:l})})}function ea(a,s){O(i=>{const l=[...i.destaque_ids],v=s==="up"?a-1:a+1;return v<0||v>=l.length?i:([l[a],l[v]]=[l[v],l[a]],{...i,destaque_ids:l})})}async function aa(){if(!(B.length>0&&!confirm("Substituir as ".concat(B.length," palavras de ").concat(T," pelas geradas pela IA?")))){Ee(!0);try{B.length>0&&await Ns(T);const a=await Vs(T);await Ss(a),K(T)}catch(a){alert("Erro: "+a.message)}finally{Ee(!1)}}}async function Xa(a){try{await Cs(a.id),K(T)}catch(s){alert("Erro: "+s.message)}}const Qa=D?"carregando":_.length>0?"ok":"vazio",Ja=H?"carregando":I.length>0?"ok":"vazio",Ya=U?"carregando":z>0?"ok":"vazio",Za={facil:B.filter(a=>a.dificuldade==="facil"),medio:B.filter(a=>a.dificuldade==="medio"),dificil:B.filter(a=>a.dificuldade==="dificil")},Ka=[{key:"overview",label:"Visão Geral",icon:Is},{key:"artigos",label:"Hero & Destaques",icon:Rs},{key:"hints",label:"Guia de Tamanhos",icon:Es},{key:"autor",label:"Conheça o Autor",icon:xe},{key:"carousel",label:"Carousel",icon:Se},{key:"caca",label:"Caça Palavras",icon:ca},{key:"colabore",label:"Colabore",icon:Hs}];return e.jsxs("div",{className:"fi-page",children:[e.jsx("div",{className:"fi-page-header",children:e.jsxs("div",{children:[e.jsx("h1",{className:"fi-page-heading",children:"Configurar Home"}),e.jsx("p",{className:"fi-page-subheading",children:"Seções dinâmicas da página inicial"})]})}),e.jsx("div",{className:"fi-tabs",style:{marginBottom:"1.5rem"},children:Ka.map(a=>e.jsxs("button",{onClick:()=>Ma(a.key),className:"fi-tab ".concat(P===a.key?"fi-tab-active":""),style:{display:"flex",alignItems:"center",gap:"0.375rem"},children:[e.jsx(a.icon,{size:13,strokeWidth:1.75}),a.label]},a.key))}),P==="overview"&&e.jsxs("div",{className:"fi-sections",children:[e.jsxs("div",{className:"fi-section",children:[e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"fi-section-title",children:"Edição em destaque"}),e.jsx("p",{className:"fi-section-subtitle",children:"Aparece no popup da banca e no topo da home"})]}),e.jsx(ee,{to:"/admin/edicoes",style:{fontSize:"0.75rem",fontWeight:600,color:"var(--adm-text-muted)",textDecoration:"none"},onMouseEnter:a=>{a.currentTarget.style.color="var(--adm-accent)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--adm-text-muted)"},children:"Gerenciar edições →"})]}),e.jsx("div",{className:"fi-section-body",children:R?e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]}):e.jsxs("div",{style:{display:"flex",alignItems:"flex-end",gap:"1.5rem",flexWrap:"wrap"},children:[c?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.875rem",flex:1},children:[c.capa_url&&e.jsx("img",{src:c.capa_url,alt:c.titulo,style:{height:"4.5rem",width:"3.25rem",objectFit:"cover",border:"1px solid var(--adm-border)",borderRadius:"0.25rem",flexShrink:0}}),e.jsxs("div",{children:[e.jsxs("p",{style:{fontSize:"0.6875rem",fontFamily:"monospace",color:"var(--adm-text-faint)"},children:["Nº ",c.numero," · ",c.mes," ",c.ano]}),e.jsx("p",{style:{fontSize:"0.9375rem",fontWeight:600,color:"var(--adm-text)",marginTop:"0.125rem"},children:c.titulo}),c.tema&&e.jsx("p",{style:{fontSize:"0.75rem",color:"var(--adm-text-muted)",marginTop:"0.125rem"},children:c.tema})]})]}):e.jsx("p",{style:{flex:1,fontSize:"0.875rem",color:"var(--adm-text-faint)"},children:"Nenhuma edição em destaque."}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexShrink:0},children:[e.jsxs("select",{value:j,onChange:a=>t(a.target.value),style:{fontSize:"0.8125rem",border:"1px solid var(--adm-border)",padding:"0.5rem 0.75rem",borderRadius:"var(--adm-radius)",outline:"none",background:"white",color:"var(--adm-text)",maxWidth:"14rem"},children:[e.jsx("option",{value:"",children:"— Selecionar —"}),r.map(a=>e.jsxs("option",{value:a.id,children:["Nº ",a.numero," — ",a.titulo]},a.id))]}),e.jsx("button",{onClick:Oa,disabled:u||!j||j===(c==null?void 0:c.id),className:"adm-btn adm-btn-primary",children:u?"…":y?e.jsxs(e.Fragment,{children:[e.jsx(Q,{size:12,style:{display:"inline",verticalAlign:"middle",marginRight:"3px"}}),"Salvo"]}):"Aplicar"})]})]})})]}),e.jsxs("div",{className:"fi-section",children:[e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("h3",{className:"fi-section-title",children:"Hero & Destaques"}),e.jsx(Ne,{status:Qa,itens:_.length})]}),e.jsx("p",{className:"fi-section-subtitle",children:"Alimentado automaticamente pelos artigos mais recentes publicados"})]}),e.jsx(ee,{to:"/admin/artigos",style:{fontSize:"0.75rem",fontWeight:600,color:"var(--adm-text-muted)",textDecoration:"none"},onMouseEnter:a=>{a.currentTarget.style.color="var(--adm-accent)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--adm-text-muted)"},children:"Gerenciar matérias →"})]}),!D&&_.length>0&&e.jsxs("div",{className:"fi-section-body",children:[e.jsx("p",{className:"fi-group-label",style:{marginBottom:"0.75rem"},children:"Artigos no hero agora"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:_.slice(0,4).map((a,s)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[e.jsx("span",{style:{fontSize:"0.6875rem",fontFamily:"monospace",color:"var(--adm-text-faint)",width:"1rem",flexShrink:0},children:s+1}),a.imagem_capa&&e.jsx("img",{src:a.imagem_capa,alt:a.titulo,style:{width:"2.5rem",height:"1.75rem",objectFit:"cover",border:"1px solid var(--adm-border)",borderRadius:"0.25rem",flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text)",overflow:"hidden",
6whiteSpace:"nowrap",textOverflow:"ellipsis",flex:1},children:a.titulo}),e.jsx("span",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",textTransform:"capitalize",flexShrink:0},children:a.categoria})]},a.id))})]})]}),e.jsx("div",{className:"fi-section",children:e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("h3",{className:"fi-section-title",children:"Agenda Literária"}),e.jsx(Ne,{status:Ja,itens:I.length})]}),e.jsx("p",{className:"fi-section-subtitle",children:"Próximos eventos culturais exibidos na home"})]}),e.jsx(ee,{to:"/admin/agenda",style:{fontSize:"0.75rem",fontWeight:600,color:"var(--adm-text-muted)",textDecoration:"none"},onMouseEnter:a=>{a.currentTarget.style.color="var(--adm-accent)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--adm-text-muted)"},children:"Gerenciar agenda →"})]})}),e.jsx("div",{className:"fi-section",children:e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("h3",{className:"fi-section-title",children:"Palavras da Semana"}),e.jsx(Ne,{status:Ya,itens:z})]}),e.jsx("p",{className:"fi-section-subtitle",children:"3 citações exibidas no carrossel da home — renovadas toda semana"})]}),e.jsx(ee,{to:"/admin/frases",style:{fontSize:"0.75rem",fontWeight:600,color:"var(--adm-text-muted)",textDecoration:"none"},onMouseEnter:a=>{a.currentTarget.style.color="var(--adm-accent)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--adm-text-muted)"},children:"Gerenciar palavras →"})]})}),e.jsxs("div",{className:"fi-note",style:{marginTop:"0.5rem"},children:[e.jsx("p",{className:"fi-note-title",children:"Como a home funciona"}),e.jsxs("p",{children:["O ",e.jsx("strong",{children:"hero"})," e os ",e.jsx("strong",{children:"destaques"})," são preenchidos automaticamente pelos artigos mais recentes com status ",e.jsx("em",{children:"publicado"}),". Para mais detalhes de tamanhos consulte a aba ",e.jsx("strong",{children:"Guia de Tamanhos"}),"."]})]})]}),P==="artigos"&&e.jsx("div",{children:_a?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4rem"},children:e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fi-note",style:{marginBottom:"1.5rem"},children:[e.jsx("p",{className:"fi-note-title",children:"Como funciona"}),e.jsxs("p",{children:["Selecione manualmente quais matérias aparecem no ",e.jsx("strong",{children:"Hero"})," (até 4) e nos ",e.jsx("strong",{children:"Destaques"}
6)," (até 6). Os 2 primeiros destaques exibem foto + texto; os 4 restantes apenas texto. Se nenhum artigo for selecionado aqui, o site usa automaticamente os mais recentes publicados."]})]}),e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"1.5rem"},children:[e.jsxs("div",{className:"fi-section",children:[e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"fi-section-title",style:{display:"flex",alignItems:"center",gap:"0.375rem"},children:[e.jsx(pa,{size:14})," Hero"]}),e.jsx("p",{className:"fi-section-subtitle",children:"Carousel principal no topo da home · máx. 4"})]}),e.jsxs("span",{className:"adm-badge ".concat(p.hero_ids.length>0?"adm-badge-green":"adm-badge-gray"),children:[p.hero_ids.length,"/4"]})]}),e.jsxs("div",{className:"fi-section-body",style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[p.hero_ids.length>0&&e.jsx(ta,{ids:p.hero_ids,onReorder:a=>O(s=>({...s,hero_ids:a})),children:e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",marginBottom:"0.5rem"},children:p.hero_ids.map((a,s)=>{const i=We[a];return i?e.jsx(ra,{id:a,children:({attributes:l,listeners:v})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.375rem 0.75rem",background:"var(--adm-accent-light)",borderRadius:"var(--adm-radius)"},children:[e.jsx(oa,{attributes:l,listeners:v}),e.jsx("span",{style:{fontSize:"0.6875rem",fontFamily:"monospace",color:"var(--adm-accent)",fontWeight:700,width:"1rem"},children:s+1}),i.imagem_capa&&e.jsx("img",{src:i.imagem_capa,alt:"",style:{width:"2rem",height:"1.375rem",objectFit:"cover",flexShrink:0,borderRadius:"0.125rem"}}),e.jsx("span",{style:{fontSize:"0.75rem",color:"var(--adm-text)",flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:i.titulo}),e.jsxs("div",{style:{display:"flex",gap:"0.125rem",flexShrink:0},children:[e.jsx("button",{type:"button",onClick:()=>Ke(s,"up"),disabled:s===0,title:"Subir",style:{background:"none",border:"none",cursor:s===0?"default":"pointer",color:s===0?"var(--adm-border)":"var(--adm-text-faint)",padding:"0.125rem"},children:e.jsx(da,{size:14})}),e.jsx("button",{type:"button",onClick:()=>Ke(s,"down"),disabled:s===p.hero_ids.length-1,title:"Descer",style:{background:"none",border:"none",cursor:s===p.hero_ids.length-1?"default":"pointer",color:s===p.hero_ids.length-1?"var(--adm-border)":"var(--adm-text-faint)",padding:"0.125rem"},children:e.jsx(ma,{size:14})}),e.jsx("button",{type:"button",onClick:()=>Ye(a),title:"Remover",style:{background:"none",border:"none",cursor:"pointer",color:"var(--adm-text-faint)",fontSize:"0.875rem",lineHeight:1,padding:"0.125rem"},children:e.jsx(J,{size:14})})]})]})},a):null})})}),e.jsx("input",{type:"text",placeholder:"Buscar matéria…",value:re,onChange:a=>ka(a.target.value),className:m}),e.jsxs("div",{style:{maxHeight:"14rem",overflowY:"auto",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)"},children:[(ie!=null?ie:ve).map(a=>{const s=p.hero_ids.includes(a.id),i=!a.imagem_capa,l=!s&&(p.hero_ids.length>=4||i);return e.jsxs("button",{type:"button",onClick:()=>!l&&Ye(a.id),style:{display:"flex",alignItems:"center",gap:"0.625rem",width:"100%",padding:"0.5rem 0.75rem",border:"none",borderBottom:"1px solid var(--adm-border)",textAlign:"left",cursor:l?"not-allowed":"pointer",background:s?"var(--adm-accent-light)":"transparent",opacity:l?.4:1}
6,children:[e.jsx("span",{style:{width:"0.875rem",height:"0.875rem",borderRadius:"0.25rem",border:"2px solid ".concat(s?"var(--adm-accent)":"var(--adm-border)"),background:s?"var(--adm-accent)":"white",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"white"},children:s?e.jsx(Q,{size:9}):""}),a.imagem_capa&&e.jsx("img",{src:a.imagem_capa,alt:"",style:{width:"2rem",height:"1.375rem",objectFit:"cover",flexShrink:0,borderRadius:"0.125rem"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:"0.75rem",fontWeight:500,color:"var(--adm-text)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.titulo}),e.jsxs("p",{style:{fontSize:"0.625rem",color:"var(--adm-text-faint)"},children:[a.categoria," · ",a.status]})]}),i&&e.jsx("span",{style:{fontSize:"0.5rem",color:"#ef4444",fontFamily:"monospace",flexShrink:0},children:"sem imagem"})]},a.id)}),Ta&&e.jsx("p",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",padding:"0.5rem 0.75rem"},children:"Buscando…"}),!ie&&Oe&&e.jsx("button",{type:"button",onClick:Ve,disabled:X,style:{display:"block",width:"100%",padding:"0.5rem",border:"none",background:"none",cursor:X?"wait":"pointer",color:"var(--adm-accent)",fontSize:"0.75rem",fontWeight:600},children:X?"Carregando…":"Carregar mais"})]}),p.hero_ids.length>0&&e.jsx("button",{onClick:()=>O(a=>({...a,hero_ids:[]})),className:"adm-btn adm-btn-secondary adm-btn-sm",style:{alignSelf:"flex-start"},children:"Limpar seleção"})]})]}),e.jsxs("div",{className:"fi-section",children:[e.jsxs("div",{className:"fi-section-header",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"fi-section-title",children:"🗂 Destaques"}),e.jsx("p",{className:"fi-section-subtitle",children:"Grade abaixo do hero · máx. 6 (1ª e 2ª com foto)"})]}),e.jsxs("span",{className:"adm-badge ".concat(p.destaque_ids.length>0?"adm-badge-green":"adm-badge-gray"),children:[p.destaque_ids.length,"/6"]})]}),e.jsxs("div",{className:"fi-section-body",style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:[p.destaque_ids.length>0&&e.jsx(ta,{ids:p.destaque_ids,onReorder:a=>O(s=>({...s,destaque_ids:a})),children:e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem",marginBottom:"0.5rem"},children:p.destaque_ids.map((a,s)=>{const i=We[a];return i?e.jsx(ra,{id:a,children:({attributes:l,listeners:v})=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",padding:"0.375rem 0.75rem",background:s<2?"var(--adm-accent-light)":"#f8fafc",borderRadius:"var(--adm-radius)"},children:[e.jsx(oa,{attributes:l,listeners:v}),e.jsx("span",{style:{fontSize:"0.6875rem",fontFamily:"monospace",color:s<2?"var(--adm-accent)":"var(--adm-text-faint)",fontWeight:700,width:"1rem"},children:s+1}),s<2&&i.imagem_capa&&e.jsx("img",{src:i.imagem_capa,alt:"",style:{width:"2rem",height:"1.375rem",objectFit:"cover",flexShrink:0,borderRadius:"0.125rem"}}),e.jsx("span",{style:{fontSize:"0.75rem",color:"var(--adm-text)",flex:1,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:i.titulo}),s<2&&e.jsx("span",{style:{fontSize:"0.5625rem",fontWeight:700,color:"var(--adm-accent)",flexShrink:0},children:"foto"}),e.jsxs("div",{style:{display:"flex",gap:"0.125rem",flexShrink:0},children:[e.jsx("button",{type:"button",onClick:()=>ea(s,"up"),disabled:s===0,title:"Subir",style:{background:"none",border:"none",cursor:s===0?"default":"pointer",color:s===0?"var(--adm-border)":"var(--adm-text-faint)",padding:"0.125rem"},children:e.jsx(da,{size:14})}),e.jsx("button",{type:"button",onClick:()=>ea(s,"down"),disabled:s===p.destaque_ids.length-1,title:"Descer",style:{background:"none",border:"none",cursor:s===p.destaque_ids.length-1?"default":"pointer",color:s===p.destaque_ids.length-1?"var(--adm-border)":"var(--adm-text-faint)",padding:"0.125rem"},children:e.jsx(ma,{size:14})}),e.jsx("button",{type:"button",onClick:()=>Ze(a),title:"Remover",style:{background:"none",border:"none",cursor:"pointer",color:"var(--adm-text-faint)",fontSize:"0.875rem",lineHeight:1,padding:"0.125rem"},children:e.jsx(J,{size:14})})]})]})},a):null})})}),e.jsx("input",{type:"text",placeholder:"Buscar matéria…",value:oe,onChange:a=>za(a.target.value),className:m}),e.jsxs("div",{style:{maxHeight:"14rem",overflowY:"auto",border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)"},children:[(le!=null?le:ve).map(a=>{const s=p.destaque_ids.includes(a.id),i=!a.imagem_capa,l=!s&&(p.destaque_ids.length>=6||i),v=p.destaque_ids.indexOf(a.id);return e.jsxs("button",{type:"button",onClick:()=>!l&&Ze(a.id),style:{display:"flex",alignItems:"center",gap:"0.625rem",width:"100%",padding:"0.5rem 0.75rem",border:"none",borderBottom:"1px solid var(--adm-border)",textAlign:"left",cursor:l?"not-allowed":"pointer",background:s?"var(--adm-accent-light)":"transparent",opacity:l?.4:1}
6,children:[e.jsx("span",{style:{width:"0.875rem",height:"0.875rem",borderRadius:"0.25rem",border:"2px solid ".concat(s?"var(--adm-accent)":"var(--adm-border)"),background:s?"var(--adm-accent)":"white",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"white"},children:s?e.jsx(Q,{size:9}):""}),a.imagem_capa&&e.jsx("img",{src:a.imagem_capa,alt:"",style:{width:"2rem",height:"1.375rem",objectFit:"cover",flexShrink:0,borderRadius:"0.125rem"}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("p",{style:{fontSize:"0.75rem",fontWeight:500,color:"var(--adm-text)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.titulo}),e.jsxs("p",{style:{fontSize:"0.625rem",color:"var(--adm-text-faint)"},children:[a.categoria," · ",a.status]})]}),s&&!i&&e.jsxs("span",{style:{fontSize:"0.5625rem",fontWeight:700,color:v<2?"var(--adm-accent)":"var(--adm-text-faint)",flexShrink:0},children:["#",v+1,v<2?" foto":""]}),i&&e.jsx("span",{style:{fontSize:"0.5rem",color:"#ef4444",fontFamily:"monospace",flexShrink:0},children:"sem imagem"})]},a.id)}),Ia&&e.jsx("p",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",padding:"0.5rem 0.75rem"},children:"Buscando…"}),!le&&Oe&&e.jsx("button",{type:"button",onClick:Ve,disabled:X,style:{display:"block",width:"100%",padding:"0.5rem",border:"none",background:"none",cursor:X?"wait":"pointer",color:"var(--adm-accent)",fontSize:"0.75rem",fontWeight:600},children:X?"Carregando…":"Carregar mais"})]}),p.destaque_ids.length>0&&e.jsx("button",{onClick:()=>O(a=>({...a,destaque_ids:[]})),className:"adm-btn adm-btn-secondary adm-btn-sm",style:{alignSelf:"flex-start"},children:"Limpar seleção"})]})]})]}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:"1.5rem",gap:"0.75rem",alignItems:"center"},children:[p.hero_ids.length===0&&p.destaque_ids.length===0&&e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-faint)"},children:"Sem seleção → o site usa os artigos mais recentes automaticamente"}),e.jsx("button",{onClick:Ha,disabled:Be,className:"adm-btn adm-btn-primary",children:Be?"Salvando…":Aa?e.jsxs(e.Fragment,{children:[e.jsx(Q,{size:12,style:{display:"inline",verticalAlign:"middle",marginRight:"3px"}}),"Salvo"]}):"Salvar configuração"})]})]})}),P==="hints"&&e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1.25rem"},children:Us.map(a=>e.jsxs("div",{className:"fi-section",children:[e.jsx("div",{className:"fi-section-header",children:e.jsxs("h3",{className:"fi-section-title",style:{display:"flex",alignItems:"center",gap:"0.375rem"},children:[a.icon," ",a.secao]})}),e.jsx("div",{className:"fi-section-body",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"0"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 160px 1fr",gap:"0.75rem",padding:"0.375rem 0.75rem",background:"#f1f5f9",borderRadius:"var(--adm-radius) var(--adm-radius) 0 0",border:"1px solid var(--adm-border)",borderBottom:"none"},children:[e.jsx("span",{style:{fontSize:"0.625rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--adm-text-faint)"},children:"Campo"}),e.jsx("span",{style:{fontSize:"0.625rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--adm-text-faint)"},children:"Limite recomendado"}),e.jsx("span",{style:{fontSize:"0.625rem",fontWeight:700,textTransform:"uppercase",letterSpacing:"0.1em",color:"var(--adm-text-faint)"},children:"Observação"})]}),a.campos.map((s,i)=>e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 160px 1fr",gap:"0.75rem",padding:"0.5rem 0.75rem",border:"1px solid var(--adm-border)",borderTop:i===0?"1px solid var(--adm-border)":"none",background:i%2===0?"white":"#f8fafc",borderRadius:i===a.campos.length-1?"0 0 var(--adm-radius) var(--adm-radius)":0},children:[e.jsx("span",{style:{fontSize:"0.8125rem",fontWeight:500,color:"var(--adm-text)"},children:s.campo}),e.jsx("span",{style:{fontSize:"0.8125rem",fontFamily:"monospace",color:"var(--adm-accent-dark)",background:"var(--adm-accent-light)",padding:"0.125rem 0.5rem",borderRadius:"0.25rem",display:"inline-block",whiteSpace:"nowrap"},children:s.limite}),e.jsx("span",{style:{fontSize:"0.75rem",color:"var(--adm-text-faint)"},children:s.obs})]},s.campo))]})})]},a.secao))}),P==="autor"&&e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"1rem"},children:[e.jsxs("p",{style:{fontSize:"0.875rem",color:"var(--adm-text-faint)"},children:["Apenas 1 registro com ",e.jsx("strong",{children:"Exibir na home"})," ativo aparece no site."]}),e.jsx("button",{onClick:()=>se({aberto:!0,item:null}),className:"adm-btn adm-btn-primary adm-btn-sm",children:"+ Novo autor destaque"})]}),A?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4rem"},children:e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}):x.length===0?e.jsx("div",{className:"fi-section",children:e.jsxs("div",{className:"adm-empty",children:[e.jsx("div",{className:"adm-empty-icon",children:e.jsx(xe,{size:32,strokeWidth:1.5})}),e.jsx("p",{className:"adm-empty-text",children:"Nenhum autor destaque cadastrado."}),e.jsx("button",{onClick:()=>se({aberto:!0,item:null}),className:"adm-btn adm-btn-primary adm-btn-sm",style:{marginTop:"1rem"},children:"Cadastrar primeiro"})]})}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.625rem"},children:x.map(a=>e.jsx("div",{className:"fi-section fi-group",style:{borderColor:a.ativo?"rgba(99,102,241,0.3)":void 0},children:e.jsxs("div",{className:"fi-section-body",style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.foto_url?e.jsx("img",{src:a.foto_url,alt:a.nome_exibicao,style:{width:"3.5rem",height:"3.5rem",objectFit:"cover",borderRadius:"9999px",border:"2px s
6olid var(--adm-border)",flexShrink:0}}):e.jsx("div",{style:{width:"3.5rem",height:"3.5rem",borderRadius:"9999px",background:"var(--adm-accent-light)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,color:"var(--adm-accent)"},children:e.jsx(xe,{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:"0.9375rem",fontWeight:700,color:"var(--adm-text)"},children:a.nome_exibicao}),a.ativo&&e.jsx("span",{className:"adm-badge adm-badge-indigo",children:"Ativo na home"})]}),e.jsx("p",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",marginTop:"0.125rem"},children:a.tag}),e.jsx("p",{style:{fontSize:"0.75rem",color:"var(--adm-text-muted)",marginTop:"0.25rem",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:a.bio})]}),e.jsxs("div",{className:"fi-row-actions",children:[!a.ativo&&e.jsx("button",{onClick:()=>Fa(a.id),className:"fi-action-btn",title:"Ativar na home",style:{color:"var(--adm-accent)"},children:"★ Ativar"}),e.jsx("button",{onClick:()=>se({aberto:!0,item:a}),className:"fi-action-btn",title:"Editar",children:e.jsx(me,{size:14})}),e.jsx("button",{onClick:()=>Wa(a),className:"fi-action-btn fi-action-btn-danger",title:"Excluir",children:e.jsx(ue,{size:14})})]})]})},a.id))})]}),P==="carousel"&&e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"1rem",gap:"1rem",flexWrap:"wrap"},children:[e.jsxs("p",{style:{fontSize:"0.875rem",color:"var(--adm-text-faint)"},children:[V.length," slide",V.length!==1?"s":""," do carousel de assinatura exibidos na home. Clique em ",e.jsx(me,{size:11,style:{display:"inline",verticalAlign:"middle"}})," para editar cada um."]}),e.jsx("button",{onClick:()=>Y({aberto:!0,item:null}),className:"adm-btn adm-btn-primary adm-btn-sm",children:"+ Novo anúncio"})]}),_e?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4rem"},children:e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}):V.length===0?e.jsx("div",{className:"fi-section",children:e.jsxs("div",{className:"adm-empty",children:[e.jsx("div",{className:"adm-empty-icon",children:e.jsx(Se,{size:32,strokeWidth:1.5})}),e.jsx("p",{className:"adm-empty-text",children:"Nenhum item cadastrado ainda."}),e.jsx("button",{onClick:()=>Y({aberto:!0,item:null}),className:"adm-btn adm-btn-primary adm-btn-sm",style:{marginTop:"1rem"},children:"+ Novo anúncio"})]})}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem"},children:V.map(a=>e.jsx("div",{className:"fi-section fi-group",onClick:()=>Y({aberto:!0,item:a}),style:{borderLeft:"4px solid ".concat(a.bg_color),opacity:a.ativo?1:.5,cursor:"pointer"},children:e.jsxs("div",{className:"fi-section-body",style:{display:"flex",alignItems:"center",gap:"1rem"},children:[a.capa_url?e.jsx("img",{src:a.capa_url,alt:a.titulo,style:{width:"3rem",height:"4rem",objectFit:"cover",border:"1px solid var(--adm-border)",flexShrink:0}}):e.jsx("div",{style:{width:"3rem",height:"4rem",background:a.bg_color,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:"rgba(255,255,255,0.85)"},children:e.jsx(Ds,{size:20})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flexWrap:"wrap"},children:[e.jsxs("span",{style:{fontSize:"0.6875rem",fontFamily:"monospace",color:"var(--adm-text-faint)"},children:["Slide ",a.ordem+1]}),!a.ativo&&e.jsx("span",{className:"adm-badge adm-badge-gray",children:"Inativo"})]}),e.jsx("p",{style:{fontSize:"0.9375rem",fontWeight:700,color:"var(--adm-text)",marginTop:"0.125rem"},children:a.titulo}),e.jsx("p",{style:{fontSize:"0.75rem",color:"var(--adm-text-muted)",marginTop:"0.125rem",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},children:a.descricao}),a.preco&&e.jsx("p",{style:{fontSize:"0.75rem",fontWeight:700,color:"var(--adm-text)",marginTop:"0.25rem"},children:a.preco})]}),e.jsxs("div",{className:"fi-row-actions",onClick:s=>s.stopPropagation(),children:[e.jsx("button",{onClick:()=>ze(a),className:"fi-action-btn",title:"Visualizar",children:e.jsx(qs,{size:14})}),e.jsx("button",{onClick:()=>Y({aberto:!0,item:a}),className:"fi-action-btn",title:"Editar",children:e.jsx(me,{size:14})}),e.jsx("button",{onClick:()=>Ba(a),className:"fi-action-btn fi-action-btn-danger",title:"Excluir",children:e.jsx(ue,{size:14})})]})]})},a.id))}),!_e&&V.length>0&&e.jsxs("div",{style:{marginTop:"2rem"},children:[e.jsx("p",{className:"fi-group-label",style:{marginBottom:"0.75rem"},children:"Pré-visualização — exatamente como fica na Home"}),e.jsx("div",{style:{border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",overflow:"hidden"},children:e.jsx(fa,{itens:V})})]})]}),P==="caca"&&e.jsxs("div",{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem",marginBottom:"1rem",flexWrap:"wrap"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"},children:[e.jsx("label",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)",fontWeight:500},children:"Mês:"}),e.jsx("input",{type:"month",value:T,onChange:a=>va(a.target.value),className:m,style:{width:"9rem"}})]}),e.jsxs("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-faint)"},children:[B.length," palavras cadastradas"]}),e.jsxs("div",{style:{marginLeft:"auto",display:"flex",gap:"0.5rem"},children:[e.jsx("button",{onClick:()=>te({aberto:!0,item:null}),className:"adm-btn adm-btn-secondary adm-btn-sm",children:"+ Adicionar palavra"}),e.jsx("button",{onClick:aa,disabled:he,className:"adm-btn adm-btn-primary adm-btn-sm",children:he?"⌛ Gerando…":e.jsxs(e.Fragment,{children:[e.jsx(Ps,{size:13,style:{display:"inline",verticalAlign:"middle",marginRight:"4px"}}),"Gerar com IA"]})})]})]}),e.jsxs("div",{style:{background:"#fef3c7",border:"1px solid #fcd34d",borderRadius:"var(--adm-radius)",padding:"0.75rem 1rem",marginBottom:"1rem",fontSize:"0.8125rem",color:"#92400e"},children:[e.jsx("strong",{children:"Geração automática:"})," A IA gera um conjunto de palavras literárias por dificuldade para o mês selecionado. Você pode editar/remover individualmente ou regenerar a qualquer momento. As palavras ficam ativas no site a partir de 1º do mês correspondente."]}),ja?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"4rem"},children:e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}):B.length===0?e.jsx("div",{className:"fi-section",children:e.jsxs("div",{className:"adm-empty",children:[e.jsx("div",{className:"adm-empty-icon",children:e.jsx(ca,{size:32,strokeWidth:1.5})}),e.jsxs("p",{className:"adm-empty-text",children:["Nenhuma palavra para ",T,"."]}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",justifyContent:"center",marginTop:"1rem"},children:[e.jsx("button",{onClick:()=>te({aberto:!0,item:null}),className:"adm-btn adm-btn-secondary adm-btn-sm",children:"+ Adicionar"}),e.jsx("button",{onClick:aa,disabled:he,className:"adm-btn adm-btn-primary adm-btn-sm",children:"✨ Gerar com IA"})]})]})}):e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"1.25rem"},children:["facil","medio","dificil"].map(a=>{const s=Za[a];if(s.length===0)return null;const i={facil:e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",background:"#22c55e",marginRight:5,verticalAlign:"middle"}})," Fácil"]}),medio:e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",background:"#eab308",marginRight:5,verticalAlign:"middle"}})," Médio"]}),dificil:e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{display:"inline-block",width:10,height:10,borderRadius:"50%",background:"#ef4444",marginRight:5,verticalAlign:"middle"}})," Difícil"]})};return e.jsxs("div",{children:[e.jsxs("p",{className:"fi-group-label",style:{marginBottom:"0.5rem"},children:[i[a]," — ",s.length," palavra",s.length!==1?"s":""]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"0.25rem"},children:s.map(l=>e.jsx("div",{className:"fi-section fi-group",style:{padding:"0.5rem 0.875rem"},children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"1rem"},children:[e.jsx("span",{style:{fontFamily:"monospace",fontWeight:700,fontSize:"0.875rem",color:"var(--adm-text)",width:"10rem",flexShrink:0},children:l.palavra}),e.jsx("span",{style:{fontSize:"0.8125rem",color:"var(--adm-text-muted)",flex:1},children:l.definicao}),e.jsxs("div",{className:"fi-row-actions",children:[e.jsx("button",{onClick:()=>te({aberto:!0,item:l}),className:"fi-action-btn",title:"Editar",children:e.jsx(me,{size:14})}),e.jsx("button",{onClick:()=>Xa(l),className:"fi-action-btn fi-action-btn-danger",title:"Excluir",children:e.jsx(ue,{size:14})})]})]})},l.id))})]},a)})})]}),P==="colabore"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"1.25rem"},children:[e.jsx("p",{className:"fi-page-subheading",style:{margin:0},children:'Faixa de convite editorial exibida na Home, entre "Lançamentos" e "Agenda Literária" — leva pra /colabore.'}),Le&&e.jsx("div",{className:"adm-alert adm-alert-error",children:Le}),Sa&&e.jsx("div",{className:"adm-alert adm-alert-success",children:"Conteúdo salvo com sucesso!"}),ya||!S?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:"5rem 0"},children:e.jsxs("div",{className:"adm-dots",children:[e.jsx("span",{}),e.jsx("span",{}),e.jsx("span",{})]})}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"fi-section",children:[e.jsx("div",{className:"fi-section-header",children:e.jsx("h3",{className:"fi-section-title",children:"Textos"})}),e.jsxs("div",{className:"fi-section-body",style:{display:"flex",flexDirection:"column",gap:"0.875rem"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Chamada (eyebrow)"}),e.jsx("input",{className:m,value:S.eyebrow,onChange:a=>C(s=>s&&{...s,eyebrow:a.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Prazo"}),e.jsx("input",{className:m,value:S.prazo,onChange:a=>C(s=>s&&{...s,prazo:a.target.value})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Título"}),e.jsx("input",{className:m,value:S.titulo,onChange:a=>C(s=>s&&{...s,titulo:a.target.value})}),e.jsx("p",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",marginTop:"0.25rem"},children:"Aparece gigante, em letras minúsculas, na faixa."})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto de apoio"}),e.jsx("textarea",{className:m,rows:5,value:S.lede,onChange:a=>C(s=>s&&{...s,lede:a.target.value})}),e.jsx("p",{style:{fontSize:"0.6875rem",color:"var(--adm-text-faint)",marginTop:"0.25rem"},children:"Uma linha em branco separa parágrafos."})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto legal (rodapé da faixa)"}),e.jsx("textarea",{className:m,rows:3,value:S.legal,onChange:a=>C(s=>s&&{...s,legal:a.target.value})})]})]})]}),e.jsxs("div",{className:"fi-section",children:[e.jsx("div",{className:"fi-section-header",children:e.jsx("h3",{className:"fi-section-title",children:"Categorias em destaque"})}),e.jsxs("div",{className:"fi-section-body",style:{display:"flex",flexDirection:"column",gap:"0.5rem"},children:[S.chips.map((a,s)=>e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{className:m,style:{flex:1},value:a,onChange:i=>Ga(s,i.target.value)}),e.jsx("button",{onClick:()=>Va(s),className:"fi-action-btn fi-action-btn-danger",title:"Remover",children:e.jsx(ue,{size:14})})]},s)),e.jsxs("button",{onClick:$a,className:"adm-btn adm-btn-secondary adm-btn-sm",style:{alignSelf:"flex-start",display:"inline-flex",alignItems:"center",gap:"0.3rem"},children:[e.jsx(Ls,{size:13})," Adicionar"]})]})]}),e.jsxs("div",{className:"fi-section",children:[e.jsx("div",{className:"fi-section-header",children:e.jsx("h3",{className:"fi-section-title",children:"Botão"})}),e.jsxs("div",{className:"fi-section-body",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto do botão"}),e.jsx("input",{className:m,value:S.cta_texto,onChange:a=>C(s=>s&&{...s,cta_texto:a.target.value})})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Link do botão"}),e.jsx("input",{className:m,value:S.cta_link,onChange:a=>C(s=>s&&{...s,cta_link:a.target.value}),placeholder:"/colabore"})]})]})]}),e.jsxs("div",{className:"fi-section",children:[e.jsx("div",{className:"fi-section-header",children:e.jsx("h3",{className:"fi-section-title",children:"Cores"})}),e.jsxs("div",{className:"fi-section-body",style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"0.75rem"},children:[e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Fundo da faixa"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:S.cor_fundo,onChange:a=>C(s=>s&&{...s,cor_fundo:a.target.value}),style:{width:"2.5rem",height:"2.25rem",padding:0,border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",cursor:"pointer"}}),e.jsx("input",{className:m,style:{flex:1},value:S.cor_fundo,onChange:a=>C(s=>s&&{...s,cor_fundo:a.target.value})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Destaque (chamada e barra do topo)"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:S.cor_destaque,onChange:a=>C(s=>s&&{...s,cor_destaque:a.target.value}),style:{width:"2.5rem",height:"2.25rem",padding:0,border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",cursor:"pointer"}}),e.jsx("input",{className:m,style:{flex:1},value:S.cor_destaque,onChange:a=>C(s=>s&&{...s,cor_destaque:a.target.value})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto (título, texto de apoio, categorias)"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:S.cor_texto,onChange:a=>C(s=>s&&{...s,cor_texto:a.target.value}),style:{width:"2.5rem",height:"2.25rem",padding:0,border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",cursor:"pointer"}}),e.jsx("input",{className:m,style:{flex:1},value:S.cor_texto,onChange:a=>C(s=>s&&{...s,cor_texto:a.target.value})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Fundo do botão"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:S.cor_botao_fundo,onChange:a=>C(s=>s&&{...s,cor_botao_fundo:a.target.value}),style:{width:"2.5rem",height:"2.25rem",padding:0,border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",cursor:"pointer"}}),e.jsx("input",{className:m,style:{flex:1},value:S.cor_botao_fundo,onChange:a=>C(s=>s&&{...s,cor_botao_fundo:a.target.value})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:h,children:"Texto do botão"}),e.jsxs("div",{style:{display:"flex",gap:"0.5rem",alignItems:"center"},children:[e.jsx("input",{type:"color",value:S.cor_botao_texto,onChange:a=>C(s=>s&&{...s,cor_botao_texto:a.target.value}),style:{width:"2.5rem",height:"2.25rem",padding:0,border:"1px solid var(--adm-border)",borderRadius:"var(--adm-radius)",cursor:"pointer"}}),e.jsx("input",{className:m,style:{flex:1},value:S.cor_botao_texto,onChange:a=>C(s=>s&&{...s,cor_botao_texto:a.target.value})})]})]})]})]}),e.jsx("div",{style:{display:"flex",justifyContent:"flex-end"},children:e.jsxs("button",{onClick:Ua,disabled:De,className:"adm-btn adm-btn-primary",style:{display:"inline-flex",alignItems:"center",gap:"0.4rem"},children:[e.jsx(Ms,{size:14})," ",De?"Salvando…":"Salvar alterações"]})})]})]}),Ce.aberto&&e.jsx(Xs,{item:Ce.item,autores:G,onClose:()=>se({aberto:!1,item:null}),onSaved:de}),Ae.aberto&&e.jsx(Qs,{item:Ae.item,proximaOrdem:V.length,onClose:()=>Y({aberto:!1,item:null}),onSaved:ce}),ke&&e.jsx(Js,{item:ke,onClose:()=>ze(null),onAprovado:ce}),Re.aberto&&e.jsx(Ys,{mes:T,item:Re.item,onClose:()=>te({aberto:!1,item:null}),onSaved
6:()=>K(T)})]})}export{zt 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.