1import{r as n,j as e}from"./index-L9AYrVUw.js";import{f as j}from"./FloatingTopMenu-CIhwk2RR.js";import{p as H}from"./PlanAccessModal-P_W2GThH.js";import{n as S}from"./Trash.es-D2Zs5Rpt.js";import"./locale-Cctu0V3Y.js";import"./productFunnel-DiJFcMU2.js";import"./SnewLogo-Cg53XTnQ.js";const M=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H40a12,12,0,0,1,0-24H216A12,12,0,0,1,228,128ZM40,76H216a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24ZM216,180H40a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,64V192H40V64Z",opacity:"0.2"}),n.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM192,184H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Zm0-48H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Zm0-48H64a8,8,0,0,1,0-16H192a8,8,0,0,1,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H40a6,6,0,0,1,0-12H216A6,6,0,0,1,222,128ZM40,70H216a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12ZM216,186H40a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128ZM40,72H216a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16ZM216,184H40a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H40a4,4,0,0,1,0-8H216A4,4,0,0,1,220,128ZM40,68H216a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8ZM216,188H40a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Z"}))]]),h=n.forwardRef((a,o)=>n.createElement(H,{ref:o,...a,weights:M}));h.displayName="ListIcon";const A=h,u="studio:scheduled-posts",b=a=>{try{localStorage.setItem(u,JSON.stringify(a))}catch{}},E=()=>{try{const a=localStorage.getItem(u);return a?JSON.parse(a):[]}catch{return[]}},m={instagram:"",linkedin:"",whatsapp:""};function I(){const[a,o]=n.useState([]),[d,x]=n.useState("grid"),[r,g]=n.useState(new Date);n.useEffect(()=>{o(E())},[]),n.useEffect(()=>{b(a)},[a]);const f=new Date(r.getFullYear(),r.getMonth()+1,0).getDate(),y=new Date(r.getFullYear(),r.getMonth(),1).getDay(),F=t=>{const s=`${r.getFullYear()}-${String(r.getMonth()+1).padStart(2,"0")}-${String(t).padStart(2,"0")}`;return a.filter(l=>l.date===s)};return e.jsxs("div",{className:"page-content",style:{maxWidth:900,margin:"0 auto",padding:"24px 20px"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:20},children:[e.jsxs("div",{children:[e.jsx("h1",{style:{fontSize:22,fontWeight:700,color:"#1A1A1A",margin:0},children:"Calendário de posts"}),e.jsxs("p",{style:{fontSize:13,color:"#888",margin:"4px 0 0"},children:[a.length," post",a.length!==1?"s":""," agendado",a.length!==1?"s":""]})]}),e.jsx("div",{style:{display:"flex",gap:6},children:["grid","list"].map(t=>e.jsx("button",{onClick:()=>x(t),style:{width:32,height:32,borderRadius:6,border:`1.5px solid ${d===t?"#1A1A1A":"#E2E2E2"}`,background:d===t?"#1A1A1A":"#FFF",color:d===t?"#FFF":"#666",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",transition:"all 0.12s"},children:t==="grid"?e.jsx(j,{size:14}):e.jsx(A,{size:14})},t))})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16,fontSize:15,fontWeight:600,color:"#1A1A1A",marginBottom:16},children:[e.jsx("button",{onClick:()=>g(new Date(r.getFullYear(),r.getMonth()-1)),style:{background:"none",border:"none",fontSize:20,cursor:"pointer",color:"#666",padding:"0 4px"},children:"â¹"}),e.jsx("span",{style:{textTransform:"capitalize"},children:r.toLocaleDateString("pt-BR",{month:"long",year:"numeric"})}),e.jsx("button",{onClick:()=>g(new Date(r.getFullYear(),r.getMonth()+1)),style:{background:"none",border:"none",fontSize:20,cursor:"pointer",color:"#666",padding:"0 4px"},children:"âº"})]}),d==="grid"?e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:2},children:[["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"].map(t=>e.jsx("div",{style:{fontSize:11,fontWeight:700,color:"#888",textAlign:"center",padding:"6px 0",textTransform:"uppercase"},children:t},t)),Array.from({length:y}).map((t,s)=>e.jsx("div",{},`e${s}`)),Array.from({length:f}).map((t,s)=>{const l=s+1,i=F(l),p=new Date().getDate()===l&&new Date().getMonth()===r.getMonth()&&new Date().getFullYear()===r.getFullYear();return e.jsxs("div",{style:{minHeight:72,padding:6,border:`1px solid ${p?"#F0A030":"#F0F0F0"}`,borderRadius:6,background:p?"#FFF8F0":i.length>0?"#FFF":"#FAFAFA"},children:[e.jsx("span",{style:{fontSize:12,fontWeight:600,color:"#444",dis
1play:"block",marginBottom:4},children:l}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[i.slice(0,2).map(c=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:3,fontSize:10},title:c.legenda,children:[e.jsx("img",{src:c.imageUrl,alt:"",style:{width:16,height:16,borderRadius:3,objectFit:"cover"}}),e.jsx("span",{children:m[c.platform]})]},c.id)),i.length>2&&e.jsxs("span",{style:{fontSize:10,color:"#888"},children:["+",i.length-2]})]})]},l)})]}):e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[a.length===0&&e.jsx("div",{style:{textAlign:"center",color:"#AAA",fontSize:14,padding:"48px 0"},children:"Nenhum post agendado ainda."}),a.sort((t,s)=>`${t.date}${t.time}`>`${s.date}${s.time}`?1:-1).map(t=>{var s;return e.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:12,padding:12,borderRadius:10,border:"1px solid #F0F0F0",background:"#FFF"},children:[e.jsx("img",{src:t.imageUrl,alt:"",style:{width:56,height:56,borderRadius:8,objectFit:"cover",flexShrink:0}}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",gap:10,alignItems:"center",marginBottom:4},children:[e.jsxs("span",{style:{fontSize:12,fontWeight:600,color:"#333"},children:[m[t.platform]," ",t.platform]}),e.jsxs("span",{style:{fontSize:11,color:"#888"},children:[new Date(t.date+"T00:00:00").toLocaleDateString("pt-BR")," Ã s ",t.time]})]}),e.jsxs("p",{style:{fontSize:12,color:"#666",lineHeight:1.4,marginBottom:4,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:"0 0 4px"},children:[((s=t.legenda)==null?void 0:s.slice(0,100))||"(sem legenda)","..."]}),e.jsx("span",{style:{fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",padding:"2px 7px",borderRadius:4,background:t.status==="scheduled"?"#EEF2FF":t.status==="published"?"#ECFDF5":"#FEF2F2",color:t.status==="scheduled"?"#4F46E5":t.status==="published"?"#059669":"#DC2626"},children:t.status})]}),e.jsx("button",{onClick:()=>o(l=>l.filter(i=>i.id!==t.id)),style:{background:"none",border:"none",cursor:"pointer",color:"#CCC",padding:4},onMouseEnter:l=>l.currentTarget.style.color="#FF4444",onMouseLeave:l=>l.currentTarget.style.color="#CCC",children:e.jsx(S,{size:14})})]},t.id)})]})]})}export{I as default,E as loadScheduledPosts,b as saveScheduledPosts};
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.