PageSourceSearch

https://donodozap.com.br/assets/admin.site-B4bOB6Zi.js

js donodozap.com.br collected 2026-10-06 04:45:33 UTC 27,770 bytes, 1 lines download raw bytes

1import{a as B,e as M,b as V,r as w,t as T,j as e,C as E,B as u,Q as k,_ as ae,g as oe,S as ie,T as re,D as le}from"./index-DpB6CMz4.js";import{u as Q}from"./useMutation-BspQ9VNU.js";import{I as m}from"./input-BchsV92G.js";import{L as l}from"./label-DU2NRwHV.js";import{T as R}from"./textarea-SrVK-eKT.js";import{S as U}from"./switch-BI0NwolV.js";import{S as K,a as $,b as W,c as J,d as L}from"./select-Deb1w68r.js";import{u as X}from"./use-supabase-token-P5lrOYRP.js";import{u as ne}from"./ConfirmDialog-CunLsLmS.js";import{g as te,a as ce}from"./my-reports.functions-eyk_xxrw.js";import{L as P}from"./loader-circle-CVNQt2KF.js";import{S as A}from"./save-CL0Sqc7d.js";import{G as de}from"./globe-BA74zj9-.js";import{U as F}from"./upload-BqKpCQi9.js";import{R as q}from"./rotate-ccw-DwQ7Vu5Z.js";import{P as D}from"./plus-DPoFii7T.js";import{A as G,a as O}from"./arrow-up-CNWaW4UV.js";import{T as _}from"./trash-2-BKyEyhHc.js";import"./index-D_5yL6Dp.js";import"./index-CcgKKF6L.js";import"./index-BN5G0vX4.js";import"./index-abL7Q9bm.js";import"./index-BorF29gS.js";import"./chevron-down-A73DE0iE.js";import"./check-mUcHQcpO.js";import"./alert-dialog-x0HU9YyH.js";import"./index-DRxN6Y5t.js";import"./index-mnAFqTs_.js";import"./triangle-alert-fGbAvdUJ.js";const I=["10","15","20","30"];function pe(){const{token:t,ready:p}=X(),j=B(te),h=B(ce),b=M(),v=V({queryKey:["admin","report-availability"],queryFn:()=>j(),enabled:p&&!!t}),[y,f]=w.useState("30"),[a,x]=w.useState("");w.useEffect(()=>{if(!v.data)return;const c=String(v.data.days);I.includes(c)?f(c):(f("custom"),x(c))},[v.data]);const g=Q({mutationFn:c=>h({data:{days:c}}),onSuccess:()=>{T.success("Configuração atualizada com sucesso ✅"),b.invalidateQueries({queryKey:["admin","report-availability"]})},onError:c=>T.error(c?.message??"Erro ao salvar")});function o(){const c=Number(y==="custom"?a:y);if(!Number.isInteger(c)||c<1||c>3650){T.error("Informe uma quantidade de dias válida (número inteiro maior que zero).");return}g.mutate(c)}const N=v.data?.days;return e.jsxs(E,{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-lg",children:"Disponibilidade dos Relatórios"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Defina por quanto tempo os clientes poderão acessar novamente os relatórios comprados."})]}),e.jsxs("div",{className:"text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:"Configuração atual: "}),e.jsx("strong",{children:N==null?"…":`${N} dias${I.includes(String(N))?"":" — Personalizado"}`})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{children:"Tempo de disponibilidade"}),e.jsxs(K,{value:y,onValueChange:f,children:[e.jsx($,{children:e.jsx(W,{})}),e.jsxs(J,{children:[I.map(c=>e.jsxs(L,{value:c,children:[c," dias"]},c)),e.jsx(L,{value:"custom",children:"Personalizado"})]})]})]}),y==="custom"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{children:"Quantidade de dias"}),e.jsx(m,{inputMode:"numeric",placeholder:"45",value:a,onChange:c=>x(c.target.value.replace(/\D/g,"")),maxLength:4})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A alteração vale apenas para relatórios gerados a partir de agora. Relatórios já existentes mantêm o prazo original."}),e.jsxs(u,{onClick:o,disabled:g.isPending||!v.data,children:[g.isPending?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(A,{className:"w-4 h-4 mr-2"}),"SALVAR CONFIGURAÇÕES"]})]})}const me=["image/png","image/jpeg","image/webp","image/svg+xml","image/x-icon","image/vnd.microsoft.icon"];async function ue(t,p){if(!me.includes(t.type))throw new Error("Formato não suportado. Use PNG, JPG, WEBP, SVG ou ICO.");if(t.size>5*1024*1024)throw new Error("Imagem muito grande (máx. 5 MB).");const{supabase:j}=await ae(async()=>{const{supabase:y}=await import("./index-DpB6CMz4.js").then(f=>f.aK);return{supabase:y}},[]),h=(t.name.split(".").pop()||"png").toLowerCase().replace(/[^a-z0-9]/g,""),b=`seo/${p}-${Date.now()}.${h}`,{error:v}=await j.storage.from("email-assets").upload(b,t,{cacheControl:"31536000",upsert:!1,contentType:t.type});if(v)throw v;return j.storage.from("email-assets").getPublicUrl(b).data.publicUrl}function xe({seo:t,onChange:p,onSave:j,saving:h}){const[b,v]=w.useState(null),y=w.useRef(null),f=w.useRef(null),a=t.description.length,x=a>=150&&a<=160?"text-primary":a>160?"text-destructive":"text-muted-foreground";async function g(o,N){if(N){v(o);try{const c=await ue(N,o);p(o==="favicon"?{faviconUrl:c}:{ogImageUrl:c}),T.success("Imagem enviada. Clique em Salvar configurações de SEO para aplicar.")}catch(c){T.error(c.message)}finally{v(null)}}}return e.jsxs(E,{className:"p-5 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-lg",children:"SEO / Google"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Descrição, ícone e imagem de compartilhamento usados pelo Google, navegadores e redes sociais."})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Nome do site"}),e.jsx(m,{value:t.siteName,onChange:o=>p({siteName:o.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Título do site"}),e.jsx(m,{value:t.title,onChange:o=>p({title:o.target.value})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Meta Description do Site"}),e.jsx(R,{rows:3,maxLength:400,value:t.description,onChange:o=>p({description:o.target.value})}),e.jsxs("p",{className:`text-xs ${x}`,children:[a," caracteres — recomendado entre 150 e 160."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(l,{children:"Prévia no Google"}),e.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-7 h-7 rounded-full bg-muted flex items-center justify-center overflow-hidden",children:t.faviconUrl?e.jsx("img",{src:t.faviconUrl,alt:"",className:"w-5 h-5 object-contain"}):e.jsx(de,{className:"w-4 h-4 text-muted-foreground"})}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("div",{className:"text-sm text-foreground",children:t.siteName||k.siteName}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"https://donodozap.com.br"})]})]}),e.jsx("div",{className:"text-lg text-primary font-medium line-clamp-1",children:t.title||k.title}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.description||k.description})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"O Google pode modificar automaticamente o título, a descrição ou outros elementos exibid
1os nos resultados de pesquisa."})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"rounded-xl border border-border/60 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx(l,{className:"text-base",children:"Imagem do site nos mecanismos de busca — Favicon / Ícone"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG ou SVG quadrado, recomendado 512×512 px (mín. 48×48)."})]}),e.jsx("div",{className:"h-24 flex items-center justify-center rounded-lg bg-muted",children:t.faviconUrl&&e.jsx("img",{src:t.faviconUrl,alt:"Favicon atual",className:"h-16 w-16 object-contain"})}),e.jsx("input",{ref:y,type:"file",accept:"image/*,.ico",hidden:!0,onChange:o=>g("favicon",o.target.files?.[0])}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(u,{type:"button",variant:"outline",size:"sm",disabled:b!==null,onClick:()=>y.current?.click(),children:[b==="favicon"?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(F,{className:"w-4 h-4 mr-2"}),"Enviar / substituir"]}),e.jsxs(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>p({faviconUrl:k.faviconUrl}),children:[e.jsx(q,{className:"w-4 h-4 mr-2"})," Restaurar padrão"]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx(l,{className:"text-base",children:"Imagem padrão de SEO / Compartilhamento"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"JPG, PNG ou WEBP, 1200×630 px, até ~300 KB (WhatsApp ignora arquivos grandes)."})]}),e.jsx("div",{className:"h-24 flex items-center justify-center rounded-lg bg-muted overflow-hidden",children:t.ogImageUrl&&e.jsx("img",{src:t.ogImageUrl,alt:"Imagem de compartilhamento",className:"h-full w-full object-cover"})}),e.jsx("input",{ref:f,type:"file",accept:"image/png,image/jpeg,image/webp",hidden:!0,onChange:o=>g("og",o.target.files?.[0])}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(u,{type:"button",variant:"outline",size:"sm",disabled:b!==null,onClick:()=>f.current?.click(),children:[b==="og"?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(F,{className:"w-4 h-4 mr-2"}),"Enviar / substituir"]}),e.jsxs(u,{type:"button",variant:"ghost",size:"sm",onClick:()=>p({ogImageUrl:k.ogImageUrl}),children:[e.jsx(q,{className:"w-4 h-4 mr-2"})," Restaurar padrão"]})]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{onClick:j,disabled:h||b!==null,className:"bg-gradient-primary shadow-glow",children:[h?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(A,{className:"w-4 h-4 mr-2"}),"SALVAR CONFIGURAÇÕES DE SEO"]})})]})}function Ve(){const t=B(oe),p=ne(),j=B(ie),h=M(),b=re(),{token:v,ready:y}=X(),f=V({queryKey:["admin","site-settings"],queryFn:()=>t(),enabled:y&&!!v}),[a,x]=w.useState(null);w.useEffect(()=>{f.data&&!a&&x(f.data)},[f.data,a]);const g=Q({mutationFn:s=>j({data:s}),onSuccess:()=>{T.success("Configurações salvas com sucesso!"),h.invalidateQueries({queryKey:["site-settings"]}),h.invalidateQueries({queryKey:["admin","site-settings"]})},onError:s=>T.error(s?.message??"Erro ao salvar")});if(f.isLoading||!a)return e.jsx("div",{className:"py-20 text-center",children:e.jsx(P,{className:"w-6 h-6 animate-spin text-primary mx-auto"})});function o(s,r){x(i=>i&&{...i,[s]:{...i[s],...r}})}function N(s,r){x(i=>{if(!i)return i;const d=i.preview.fields.slice();return d[s]={...d[s],...r},{...i,preview:{...i.preview,fields:d}}})}function c(s,r){x(i=>{if(!i)return i;const d=i.preview.fields.slice(),C=s+r;return C<0||C>=d.length?i:([d[s],d[C]]=[d[C],d[s]],{...i,preview:{...i.preview,fields:d}})})}function H(s){x(r=>{if(!r)return r;const i=r.preview.fields.filter((d,C)=>C!==s);return{...r,preview:{...r.preview,fields:i}}})}function Y(){x(s=>{if(!s)return s;const r=`campo_${Date.now()}`;return{...s,preview:{...s.preview,fields:[...s.preview.fields,{key:r,label:"Novo campo",enabled:!0,mode:"locked"}]}}})}function Z(s,r){x(i=>{if(!i)return i;const d=i.loading.messages.slice();return d[s]=r,{...i,loading:{...i.loading,messages:d}}})}function z(s,r){x(i=>{if(!i)return i;const d=i.loading.messages.slice(),C=s+r;return C<0||C>=d.length?i:([d[s],d[C]]=[d[C],d[s]],{...i,loading:{...i.loading,messages:d}})})}function ee(s){x(r=>r&&{...r,loading:{...r.loading,messages:r.loading.messages.filter((i,d)=>d!==s)}})}function se(){x(s=>s&&{...s,loading:{...s.loading,messages:[...s.loading.messages,"Nova mensagem..."]}})}return e.jsxs("div",{className:"space-y-6 max-w-4xl",children:[e.jsx(pe,{}),e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl md:text-3xl font-bold",children:"Site"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Edite os textos, campos e cores da tela de carregamento e da prévia da consulta."})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(u,{variant:"outline",onClick:()=>x(le),disabled:g.isPending,children:[e.jsx(q,{className:"w-4 h-4 mr-2"})," Restaurar padrão"]}),e.jsxs(u,{onClick:()=>a&&g.mutate(a),disabled:g.isPending,className:"bg-gradient-primary shadow-glow",children:[g.isPending?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(A,{className:"w-4 h-4 mr-2"}),"Salvar alterações"]})]})]}),e.jsx(xe,{seo:a.seo,onChange:s=>o("seo",s),saving:g.isPending,onSave:()=>a&&g.mutate(a,{onSuccess:()=>{T.success("Configurações de SEO atualizadas com sucesso."),b.invalidate()}})}),e.jsxs(E,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-bold text-lg",children:"Tela de carregamento"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Título principal"}),e.jsx(m,{value:a.loading.title,onChange:s=>o("loading",{title:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Subtítulo"}),e.jsx(m,{value:a.loading.subtitle,onChange:s=>o("loading",{subtitle:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(l,{children:"Texto de apoio"}),e.jsx(R,{rows:2,value:a.loading.supportText,onChange:s=>o("loading",{supportText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Duração da barra (segundos)"}),e.jsx(m,{type:"number",min:3,max:120,value:a.loading.durationSeconds,onChange:s=>o("loading",{durationSeconds:Number(s.target.value)||20})})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(l,{children:"Mensagens exibidas durante o carregamento"}),e.jsxs(u,{size:"sm",variant:"outline",onClick:se,children:[e.jsx(D,{className:"w-3.5 h-3.5 mr-1"})," Adicionar"]})]}),e.jsx("div",{className:"space-y-2",children:a.loading.messages.map((s,r)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-xs text-muted-foreground w-6 shrink-0",children:[r+1,"."]}),e.jsx(m,{value:s,onChange:i=>Z(r,i.target.value)}),e.jsx(u,{size:"icon",variant:"ghost",onClick:()=>z(r,-1),disabled:r===0,children:e.jsx(G,{className:"w-4 h-4"})}),e.jsx(u,{size:"icon",variant:"ghost",onClick:()=>z(r,1),disabled:r===a.loading.messages.length-1,children:e.jsx(O,{className:"w-4 h-4"})}),e.jsx(u,{size:"icon",variant:"ghost",className:"text-destructive",onClick:async()=>{const i=a.loading.messages[r];await p({title:"Excluir mensagem?",description:e.jsxs(e.Fragment,{children:["A mensagem ",e.jsxs("strong",{children:['"',i,'"']})," será removida da lista. A alteração só é efetivada ao salvar."]}),confirmText:"Excluir"})&&ee(r)},children:e.jsx(_,{className:"w-4 h-4"})})]},r))})]})]}),e.jsxs(E,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-bold text-lg",children:"Página de prévia"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsxs(l,{children:["Texto do topo (use ","{numero}"," para o número)"]}),e.jsx(m,{value:a.preview.topText,onChange:s=>o("preview",{topText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(l,{children:"Texto abaixo do número"}),e.jsx(R,{rows:2,value:a.preview.subText,onChange:s=>o("preview",{subText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:'Título da tabela (use "A e B" ou "A | B")'}),e.jsx(m,{value:a.preview.tableTitle,onChange:s=>o("preview",{tableTitle:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Texto dos campos bloqueados"}),e.jsx(m,{value:a.preview.lockedText,onChange:s=>o("preview",{lockedText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Texto final"}),e.jsx(m,{value:a.preview.finalText,onChange:s=>o("preview",{finalText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Texto do botão principal"}),e.jsx(m,{value:a.preview.buttonText,onChange:s=>o("preview",{buttonText:s.target.value})})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(l,{children:"Link do botão (URL para liberar relatório)"}),e.jsx(m,{placeholder:"https://...",value:a.preview.buttonUrl,onChange:s=>o("preview",{buttonUrl:s.target.value})})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx(l,{children:"Campos da tabela"}),e.jsxs(u,{size:"sm",variant:"outline",onClick:Y,children:[e.jsx(D,{className:"w-3.5 h-3.5 mr-1"})," Adicionar campo"]})]}),e.jsx("div",{className:"space-y-2",children:a.preview.fields.map((s,r)=>e.jsx("div",{className:"border border-border rounded-lg p-3 space-y-2 bg-secondary/30",children:e.jsxs("div",{className:"grid md:grid-cols-[1fr,160px,1fr,auto] gap-2 items-end",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(l,{className:"text-xs",children:"Nome exibido"}),e.jsx(m,{value:s.label,onChange:i=>N(r,{label:i.target.value})})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(l,{className:"text-xs",children:"Modo"}),e.jsxs(K,{value:s.mode,onValueChange:i=>N(r,{mode:i}),children:[e.jsx($,{children:e.jsx(W,{})}),e.jsxs(J,{children:[e.jsx(L,{value:"masked",children:"Mascarado"}),e.jsx(L,{value:"locked",children:"Bloqueado"})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(l,{className:"text-xs",children:"Valor mascarado (se modo = mascarado)"}),e.jsx(m,{placeholder:"ex: ****G*** ***I***",value:s.maskedValue??"",onChange:i=>N(r,{maskedValue:i.target.value}),disabled:s.mode!=="masked"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(U,{checked:s.enabled,onCheckedChange:i=>N(r,{enabled:i})}),e.jsx(u,{size:"icon",variant:"ghost",onClick:()=>c(r,-1),disabled:r===0,children:e.jsx(G,{className:"w-4 h-4"})}),e.jsx(u,{size:"icon",variant:"ghost",onClick:()=>c(r,1),disabled:r===a.preview.fields.length-1,children:e.jsx(O,{className:"w-4 h-4"})}),e.jsx(u,{size:"icon",variant:"ghost",className:"text-destructive",onClick:async()=>{const i=a.preview.fields[r];await p({title:"Excluir campo?",description:e.jsxs(e.Fragment,{children:["O campo ",e.jsx("strong",{children:i?.label||"(sem rótulo)"})," será removido da prévia. A alteração só é efetivada ao salvar."]}),confirmText:"Excluir campo"})&&H(r)},children:e.jsx(_,{className:"w-4 h-4"})})]})]})},s.key+r))})]})]}),e.jsxs(E,{className:"p-5 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-lg",children:"Popups e modais"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Edite os textos de todos os popups do site."})]}),e.jsxs("div",{className:"space-y-3 border-l-4 border-primary/40 pl-4",children:[e.jsx("h3",{className:"font-semibold",children:"Popup de confirmação (página inicial)"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsx(n,{label:"Título",value:a.popups.confirm.title,onChange:s=>o("popups",{confirm:{...a.popups.confirm,title:s}})}),e.jsx(n,{label:"Rótulo do número",value:a.popups.confirm.numberLabel,onChange:s=>o("popups",{confirm:{...a.popups.confirm,numberLabel:s}})}),e.jsx(n,{label:"Rótulo da seção",value:a.popups.confirm.sectionLabel,onChange:s=>o("popups",{confirm:{...a.popups.confirm,sectionLabel:s}})}),e.jsx(n,{label:"Texto de apoio",value:a.popups.confirm.helperText,onChange:s=>o("popups",{confirm:{...a.popups.confirm,helperText:s}})}),e.jsx(n,{label:"Botão cancelar",value:a.popups.confirm.cancelButton,onChange:s=>o("popups",{confirm:{...a.popups.confirm,cancelButton:s}})}),e.jsx(n,{label:"Botão confirmar",value:a.popups.confirm.confirmButton,onChange:s=>o("popups",{confirm:{...a.popups.confirm,confirmButton:s}})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{label:"Rodapé (sigilo)",value:a.popups.confirm.footerText,onChange:s=>o("popups",{confirm:{...a.popups.confirm,footerText:s}})})})]})]}),e.jsxs("div",{className:"space-y-3 border-l-4 border-primary/40 pl-4",children:[e.jsx("h3",{className:"font-semibold",children:"Barra fixa mobile (prévia)"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{label:"Mensagem",value:a.popups.mobileBar.message,onChange:s=>o("popups",{mobileBar:{...a.popups.mobileBar,message:s}})})}),e.jsx(n,{label:"Texto do botão",value:a.popups.mobileBar.buttonText,onChange:s=>o("popups",{mobileBar:{...a.popups.mobileBar,buttonText:s}})})]})]}),e.jsxs("div",{className:"space-y-3 border-l-4 border-primary/40 pl-4",children:[e.jsx("h3",{className:"font-semibold",children:"Pagamento — Etap
1a 1: E-mail"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsx(n,{label:"Título",value:a.popups.payEmail.title,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,title:s}})}),e.jsx(n,{label:"Prefixo do número",value:a.popups.payEmail.numberPrefix,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,numberPrefix:s}})}),e.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[e.jsx(l,{children:"Descrição"}),e.jsx(R,{rows:2,value:a.popups.payEmail.description,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,description:s.target.value}})})]}),e.jsx(n,{label:"Rótulo do e-mail",value:a.popups.payEmail.emailLabel,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,emailLabel:s}})}),e.jsx(n,{label:"Placeholder do e-mail",value:a.popups.payEmail.emailPlaceholder,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,emailPlaceholder:s}})}),e.jsx(n,{label:"Texto do botão",value:a.popups.payEmail.buttonText,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,buttonText:s}})}),e.jsx(n,{label:"Rodapé",value:a.popups.payEmail.footerText,onChange:s=>o("popups",{payEmail:{...a.popups.payEmail,footerText:s}})})]})]}),e.jsxs("div",{className:"space-y-3 border-l-4 border-primary/40 pl-4",children:[e.jsx("h3",{className:"font-semibold",children:"Pagamento — Etapa 2: Confirmação"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsx(n,{label:"Título",value:a.popups.payConfirm.title,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,title:s}})}),e.jsx(n,{label:"Descrição",value:a.popups.payConfirm.description,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,description:s}})}),e.jsx(n,{label:"Rótulo do número",value:a.popups.payConfirm.numberLabel,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,numberLabel:s}})}),e.jsx(n,{label:"Rótulo do e-mail",value:a.popups.payConfirm.emailLabel,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,emailLabel:s}})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{label:"Texto de apoio",value:a.popups.payConfirm.helperText,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,helperText:s}})})}),e.jsx(n,{label:"Botão editar",value:a.popups.payConfirm.editButton,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,editButton:s}})}),e.jsx(n,{label:"Botão confirmar",value:a.popups.payConfirm.confirmButton,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,confirmButton:s}})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{label:"Rodapé (sigilo)",value:a.popups.payConfirm.footerText,onChange:s=>o("popups",{payConfirm:{...a.popups.payConfirm,footerText:s}})})})]})]}),e.jsxs("div",{className:"space-y-3 border-l-4 border-primary/40 pl-4",children:[e.jsx("h3",{className:"font-semibold",children:"Pagamento — Etapa 3: PIX"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[e.jsx(n,{label:"Título",value:a.popups.payPix.title,onChange:s=>o("popups",{payPix:{...a.popups.payPix,title:s}})}),e.jsx(n,{label:"Rótulo do código",value:a.popups.payPix.codeLabel,onChange:s=>o("popups",{payPix:{...a.popups.payPix,codeLabel:s}})}),e.jsxs("div",{className:"md:col-span-2 space-y-1.5",children:[e.jsx(l,{children:"Descrição"}),e.jsx(R,{rows:2,value:a.popups.payPix.description,onChange:s=>o("popups",{payPix:{...a.popups.payPix,description:s.target.value}})})]}),e.jsx(n,{label:"Texto do botão copiar",value:a.popups.payPix.copyButton,onChange:s=>o("popups",{payPix:{...a.popups.payPix,copyButton:s}})}),e.jsx(n,{label:"Texto de aguardando",value:a.popups.payPix.waitingText,onChange:s=>o("popups",{payPix:{...a.popups.payPix,waitingText:s}})}),e.jsx("div",{className:"md:col-span-2",children:e.jsx(n,{label:"Rodapé",value:a.popups.payPix.footerText,onChange:s=>o("popups",{payPix:{...a.popups.payPix,footerText:s}})})})]})]})]}),e.jsxs(E,{className:"p-5 space-y-4",children:[e.jsx("h2",{className:"font-bold text-lg",children:"Cores e visual"}),e.jsxs("div",{className:"grid sm:grid-cols-2 md:grid-cols-3 gap-4",children:[e.jsx(S,{label:"Cor principal (topo)",value:a.visual.primaryColor,onChange:s=>o("visual",{primaryColor:s})}),e.jsx(S,{label:"Cor dos textos",value:a.visual.textColor,onChange:s=>o("visual",{textColor:s})}),e.jsx(S,{label:"Cor dos botões",value:a.visual.buttonColor,onChange:s=>o("visual",{buttonColor:s})}),e.jsx(S,{label:'Cor dos links "Liberar"',value:a.visual.lockedLinkColor,onChange:s=>o("visual",{lockedLinkColor:s})}),e.jsx(S,{label:"Cor da barra de progresso",value:a.visual.progressColor,onChange:s=>o("visual",{progressColor:s})}),e.jsx(S,{label:"Cor de fundo da página",value:a.visual.pageBgColor,onChange:s=>o("visual",{pageBgColor:s})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:"Arredondamento (px)"}),e.jsx(m,{type:"number",min:0,max:48,value:a.visual.cardRadius,onChange:s=>o("visual",{cardRadius:Number(s.target.value)||0})})]})]})]}),e.jsxs(E,{className:"p-5 space-y-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-bold text-lg",children:"Regras de Popups"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Controle quando cada popup deve aparecer no fluxo de consulta. Quando desativado, o sistema pula o popup e segue direto para a próxima etapa."})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 p-4 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(l,{className:"text-base",children:"Popup de confirmação do número"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texto: “Você quer descobrir o dono desse Número de WhatsApp?”"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Quando ativado, aparece após o usuário clicar em ",e.jsx("strong",{children:"Consultar"}),", antes de iniciar a consulta."]})]}),e.jsx(U,{checked:a.rules.confirmPopupEnabled,onCheckedChange:s=>o("rules",{confirmPopupEnabled:s})})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 p-4 flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(l,{className:"text-base",children:"Popup de Aguarde"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Texto: “Aguarde! Estamos consultando...”"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Quando ativado, aparece durante o carregamento/consulta."})]}),e.jsx(U,{checked:a.rules.loadingPopupEnabled,onCheckedChange:s=>o("rules",{loadingPopupEnabled:s})})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(u,{onClick:()=>a&&g.mutate(a),disabled:g.isPending,className:"bg-gradient-primary shadow-glow",size:"lg",children:[g.isPending?e.jsx(P,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(A,{className:"w-4 h-4 mr-2"}),"Salvar alterações"]})})]})}function n({label:t,value:p,onChange:j}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:t}),e.jsx(m,{value:p,onChange:h=>j(h.target.value)})]})}function S({label:t,value:p,onChange:j}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(l,{children:t}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{type:"color",value:p,onChange:h=>j(h.target.value),className:"h-10 w-12 rounded-md border border-input cursor-pointer bg-transparent"}),e.jsx(m,{value:p,onChange:h=>j(h.target.value),className:"font-mono"})]})]})}export{Ve as component};

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.