1/*! For license information please see 359.1a53fc55.chunk.js.LICENSE.txt */ 2"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[359],{7965(e,t,a){a.r(t),a.d(t,{default:()=>b});var s=a(5043),r=a(5271),i=a(9570),l=a(7104),c=a(7118),n=a(7784);const d=(0,n.A)("user-check",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]),o=(0,n.A)("user-x",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);var h=a(9292),p=a(2024),x=a(5327),y=a(2787),m=a(9748),u=a(579);const k={active:"bg-green-500/20 text-green-400",unsubscribed:"bg-white/5 text-white/25"},w={active:"Ativo",unsubscribed:"Cancelado"},b=()=>{const[e,t]=(0,s.useState)([]),[a,n]=(0,s.useState)(!0),[b,v]=(0,s.useState)(""),[f,g]=(0,s.useState)(""),[j,A]=(0,s.useState)(null),N=(0,s.useCallback)(async()=>{n(!0);let e=y.N.from("newsletter_subscribers").select("*").order("created_at",{ascending:!1});f&&(e=e.eq("status",f));const{data:a}=await e;a&&t(a),n(!1)},[f]);(0,s.useEffect)(()=>{N()},[N]);const M=e.filter(e=>{var t;return!b||(null===(t=e.email)||void 0===t?void 0:t.toLowerCase().includes(b.toLowerCase()))}),z=e.filter(e=>
2"active"===e.status).length,C=e.filter(e=>"active"!==e.status).length;return(0,u.jsxs)(m.A,{children:[(0,u.jsxs)("div",{className:"mb-6 flex items-start justify-between",children:[(0,u.jsxs)("div",{children:[(0,u.jsx)("h1",{className:"font-oswald text-2xl uppercase text-white mb-1",children:"Newsletter"}),(0,u.jsxs)("p",{className:"font-manrope text-sm text-white/25",children:[e.length," inscritos no total"]})]}),(0,u.jsxs)(r.P.button,{onClick:()=>{const e=M.map(e=>`"${e.email}","${w[e.status]||e.status}","${new Date(e.created_at).toLocaleDateString("pt-BR")}"`).join("\n"),t=new Blob(["Email,Status,Data de Inscri\xe7\xe3o\n"+e],{type:"text/csv;charset=utf-8;"}),a=URL.createObjectURL(t),s=document.createElement("a");s.href=a,s.download=`ibrc-newsletter-${(new Date).toISOString().slice(0,10)}.csv`,s.click(),URL.revokeObjectURL(a)},className:"flex items-center gap-2 h-9 px-4 bg-white/5 border border-white/10 text-white/50 hover:text-white hover:border-[#FFC107]/30 text-xs font-manrope uppercase tracking-wider transition-all",whileHover:{scale:1.02},whileTap:{scale:.98},children:[(0,u.jsx)(l.A,{size:14})," Exportar CSV"]})]}),(0,u.jsxs)("div",{className:"grid grid-cols-3 gap-3 mb-6",children:[(0,u.jsxs)("div",{className:"bg-[#141414] border border-white/5 p-4",children:[(0,u.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,u.jsx)(c.A,{size:16,className:"text-white/20"}),(0,u.jsx)("span",{className:"font-manrope text-[10px] uppercase tracking-wider text-white/25",children:"Total"})]}),(0,u.jsx)("p",{className:"font-oswald text-2xl text-white",children:e.length})]}),(0,u.jsxs)("div",{className:"bg-[#141414] border border-white/5 p-4",children:[(0,u.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,u.jsx)(d,{size:16,className:"text-green-400/60"}),(0,u.jsx)("span",{className:"font-manrope text-[10px] uppercase tracking-wider text-white/25",children:"Ativos"})]}),(0,u.jsx)("p",{className:"font-oswald text-2xl text-green-400",children:z})]}),(0,u.jsxs)("div",{className:"bg-[#141414] border border-white/5 p-4",children:[(0,u.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,u.jsx)(o,{size:16,className:"text-white/20"}),(0,u.jsx)("span",{className:"font-manrope text-[10px] uppercase tracking-wider text-white/25",children:"Cancelados"})]}),(0,u.jsx)("p",{className:"font-oswald text-2xl text-white/30",children:C})]})]}),(0,u.jsxs)("div",{className:"flex flex-wrap gap-3 mb-6",children:[(0,u.jsxs)("div",{className:"flex-1 min-w-[200px] relative",children:[(0,u.jsx)(h.A,{size:16,className:"absolute left-3 top-1/2 -translate-y-1/2 text-white/20"}),(0,u.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),placeholder:"Buscar por email...",className:"w-full bg-[#141414] border border-white/5 pl-10 pr-4 py-2.5 text-sm font-manrope text-white placeholder:text-white/20 outline-none focus:border-[#FFC107]/30 transition-colors"})]}),(0,u.jsxs)("select",{value:f,onChange:e=>g(e.target.value),className:"bg-[#141414] border border-white/5 px-4 py-2.5 text-sm font-manrope text-white/50 outline-none appearance-none cursor-pointer focus:border-[#FFC107]/30",children:[(0,u.jsx)("option",{value:"",children:"Todos os status"}),(0,u.jsx)("option",{value:"active",children:"Ativos"}),(0,u.jsx)("option",{value:"unsubscribed",children:"Cancelados"})]})]}),a?(0,u.jsx)("div",{className:"flex items-center justify-center py-20",children:(0,u.jsx)(p.A,{size:24,className:"text-white/20 animate-spin"})}):(0,u.jsxs)("div",{className:"bg-[#141414] border border-white/5 overflow-hidden",children:[(0,u.jsx)("div",{className:"overflow-x-auto",children:(0,u.jsxs)("table",{className:"w-full",children:[(0,u.jsx)("thead",{children:(0,u.jsxs)("tr",{className:"border-b border-white/5",children:[(0,u.jsx)("th",{className:"text-left py-3 px-4 font-manrope text-[10px] uppercase tracking-wider text-white/25",children:"Email"}),(0,u.jsx)("th",{className:"text-left py-3 px-4 font-manrope text-[10px] uppercase tracking-wider text-white/25 hidden sm:table-cell",children:"Status"}),(0,u.jsx)("th",{className:"text-left py-3 px-4 font-manrope text-[10px] uppercase tracking-wider text-white/25 hidden md:table-cell",children:"Data de Inscri\xe7\xe3o"}),(0,u.jsx)("th",{className:"py-3 px-4 w-24 text-right font-manrope text-[10px] uppercase tracking-wider text-white/25",children:"A\xe7\xe3o"})]})}),(0,u.jsxs)("tbody",{children:[(0,u.jsx)(i.N,{children:M.map(e=>(0,u.jsxs)(r.P.tr,{className:"border-b border-white/[0.03] hover:bg-white/[0.02] transition-colors",initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},layout:!0,children:[(0,u.jsx)("td",{className:"py-3 px-4",children:(0,u.jsxs)("div",{className:"flex items-center gap-2",children:[(0,u.jsx)(x.A,{size:13,className:"text-white/15 flex-shrink-0"}),(0,u.jsx)("span",{className:"font-manrope text-sm text-white/60 truncate",children:e.email})]})}),(0,u.jsx)("td",{className:"py-3 px-4 hidden sm:table-cell",children:(0,u.jsx)("span",{className:`inline-block px-2 py-0.5 text-[10px] font-manrope uppercase tracking-wider ${k[e.status]||"bg-white/5 text-white/30"}`,children:w[e.status]||e.status})}),(0,u.jsx)("td",{className:"py-3 px-4 hidden md:table-cell font-manrope text-xs text-white/20",children:e.created_at?new Date(e.created_at).toLocaleDateString("pt-BR"):"\u2014"}),(0,u.jsx)("td",{className:"py-3 px-4 text-right",children:(0,u.jsx)("button",{onClick:()=>(async e=>{A(e.id);const t="active"===e.status?"unsubscribed":"active";await y.N.from("newsletter_subscribers").update({status:t}).eq("id",e.id),await N(),A(null)})(e),disabled:j===e.id,className:"text-[10px] font-manrope uppercase tracking-wider px-3 py-1.5 border transition-all disabled:opacity-50 "+("active"===e.status?"border-white/10 text-white/30 hover:text-red-400 hover:border-red-400/30":"border-white/10 text-white/30 hover:text-green-400 hover:border-green-400/30"),children:j===e.id?(0,u.jsx)(p.A,{size:10,className:"animate-spin inline"}):"active"===e.status?"Cancelar":"Reativar"})})]},e.id))}),0===M.length&&(0,u.jsx)("tr",{children:(0,u.jsx)("td",{colSpan:4,className:"py-12 text-center font-manrope text-sm text-white/15",children:a?"Carregando...":"Nenhum inscrito encontrado."})})]})]})}),M.length>0&&(0,u.jsxs)("div",{className:"border-t border-white/5 px-4 py-3 flex items-center justify-between",children:[(0,u.jsxs)("p",{className:"font-manrope text-xs text-white/20",children:["Mostrando ",M.length," de ",e.length," inscritos"]}),b&&(0,u.jsx)("button",{onClick:()=>v(""),className:"font-manrope text-[10px] uppercase tracking-wider text-white/20 hover:text-white transition-colors",children:"Limpar busca"})]})]})]})}},4537(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},3639(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]])},7033(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},6210(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},4519(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("clapperboard",[["path",{d:"M20.2 6 3 11l-.9-2.4c-.3-1.1.3-2.2 1.3-2.5l13.5-4c1.1-.3 2.2.3 2.5 1.3Z",key:"1tn4o7"}],["path",{d:"m6.2 5.3 3.1 3.9",key:"iuk76l"}],["path",{d:"m12.4 3.4 3.1 4",key:"6hsd6n"}],["path",{d:"M3 11h18v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z",key:"ltgou9"}]])},2313(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},7104(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},1680(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},6784(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}
2]])},5731(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},67(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},2024(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},9493(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("log-out",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},5327(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},4669(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("message-square",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},929(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("newspaper",[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]])},7673(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]])},516(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},9292(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},6099(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])},4919(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("trending-up",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},73(e,t,a){a.d(t,{A:()=>s});const s=(0,a(7784).A)("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])}}]); 3//# sourceMappingURL=359.1a53fc55.chunk.js.map
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.