1import{c as Z,aH as oe,r as l,s as b,j as e,B as j,L as y,_ as $,a as p,E as ie,C as le,b7 as ce,bF as de,bZ as me,b_ as pe,b$ as ue}from"./index-BAeayKEo.js";import{T as xe,a as he,b as S,c as I}from"./tabs-Dt_qKFYY.js";import{T as J}from"./textarea-IJubnkzB.js";import{C as ge}from"./checkbox-C_tWe5yX.js";import{C as fe,a as be,b as je}from"./collapsible-O-bqA43W.js";import{R as ve}from"./refresh-cw-BKJcW5vU.js";import{M as we}from"./message-square-C-MtTs6v.js";import{S as D}from"./sparkles-90C_D8zs.js";import{U}from"./user-CH9Ua-Ax.js";import{M as ye}from"./mic-WTUrwzS3.js";import{C as Ne}from"./circle-check-c-j_K_lR.js";import{S as _e}from"./square-BrarOVum.js";import{S as B}from"./send-lQa3Rz7o.js";import{C as K}from"./copy-Du9STXfp.js";import{I as ke}from"./info-D-wdRp-T.js";import{W as Ce}from"./wand-sparkles-BvN0uHDz.js";import{f as H}from"./formatDistanceToNow-BccEL8LZ.js";import{p as W}from"./pt-BR-DwObo8fb.js";import"./index-py67q4EF.js";import"./index-1BiNSb4P.js";/** 2 * @license lucide-react v0.462.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 Ae=Z("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Ee=Z("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),Se="[email protected]",Ie=a=>({pending:{label:"Processando",tone:"bg-muted text-muted-foreground"},needs_human:{label:"Aguardando você",tone:"bg-amber-100 text-amber-900 border-amber-200"},deleted_on_ig:{label:"Apagado no IG",tone:"bg-muted text-muted-foreground"},auto_replied:a?{label:"Respondida",tone:"bg-emerald-50 text-emerald-800 border-emerald-200"}:{label:"IA respondeu",tone:"bg-emerald-50 text-emerald-800 border-emerald-200"},replied_by_human:{label:"Você respondeu",tone:"bg-sky-50 text-sky-800 border-sky-200"},already_replied:{label:"Respondido no IG",tone:"bg-violet-50 text-violet-800 border-violet-200"},ignored:{label:"Ignorado",tone:"bg-zinc-100 text-zinc-600"}});function Q({name:a,brand:r}){const t=(a||"?").replace("@","").charAt(0).toUpperCase();return r?e.jsx("div",{className:"w-9 h-9 rounded-full bg-[#111111] text-white flex items-center justify-center text-sm font-black shrink-0 ring-2 ring-[#00AEEF]/30",children:"A"}):e.jsx("div",{className:"w-9 h-9 rounded-full bg-muted text-foreground flex items-center justify-center text-sm font-bold shrink-0 border border-border",children:t})}function Re({comment:a,onAction:r}){const[t,u]=l.useState(a.ai_suggested_reply??""),[x,h]=l.useState(!1),[c,n]=l.useState(!1);l.useEffect(()=>{a.ai_suggested_reply&&!t&&u(a.ai_suggested_reply)},[a.ai_suggested_reply]);const d=async g=>{h(!0);try{const{data:o,error:m}=await b.functions.invoke("train-instagram-reply",{body:{comment_id:a.id,reply_text:t,action:g}});if(m||!(o!=null&&o.success))throw new Error((o==null?void 0:o.error)??(m==null?void 0:m.message)??"Falha");p.success(g==="reply"?"Resposta publicada no Instagram":"Comentário ignorado"),r()}catch(o){p.error(o instanceof Error?o.message:"Erro")}finally{h(!1)}},w=async()=>{var g;n(!0);try{let o=a.ai_suggested_reply??"";if(!o){const{data:m,error:_}=await b.functions.invoke("reply-instagram-comment",{body:{ig_comment_id:a.ig_comment_id,generate_only:!0}});if(_||!(m!=null&&m.success))throw new Error((m==null?void 0:m.error)??(_==null?void 0:_.message)??"Falha ao gerar");if(o=((g=m==null?void 0:m.decision)==null?void 0:g.reply_text)??"",!o)throw new Error("IA não gerou resposta")}u(o),p.success("Sugestão da IA preenchida â revise e clique em Aprovar e publicar")}catch(o){p.error(o instanceof Error?o.message:"Erro")}finally{n(!1)}};return e.jsxs("div",{className:"ml-12 bg-white border border-border rounded-2xl shadow-sm p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold uppercase tracking-wide text-muted-foreground",children:[e.jsx(B,{className:"h-3 w-3"})," Sua resposta ",a.ai_suggested_reply&&e.jsx("span",{className:"text-[#00AEEF] normal-case font-medium",children:"(sugestão da IA já preenchida)"})]}),e.jsx(J,{value:t,onChange:g=>u(g.target.value),placeholder:"Escreva sua resposta...",rows:3,className:"bg-white resize-none"}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs(j,{size:"sm",onClick:()=>d("reply"),disabled:x||c||!t.trim(),children:[x?e.jsx(y,{className:"h-4 w-4 animate-spin mr-1"}):e.jsx(B,{className:"h-4 w-4 mr-1"}),"Aprovar e publicar"]}),e.jsxs(j,{size:"sm",variant:"outline",onClick:w,disabled:x||c,className:"border-[#00AEEF]/40 text-[#00AEEF] hover:bg-[#00AEEF]/10 hover:text-[#00AEEF]",children:[c?e.jsx(y,{className:"h-4 w-4 animate-spin mr-1"}):e.jsx(Ce,{className:"h-4 w-4 mr-1"}),"Responder com IA"]}),e.jsx(j,{size:"sm",variant:"ghost",onClick:()=>d("ignore"),disabled:x||c,children:"Ignorar"})]})]})}function ze({comment:a,onAction:r,showEditor:t,reviewerMode:u,selectable:x,selected:h,onToggleSelect:c}
11){const n=Ie(u)[a.status],d=a.status==="auto_replied",w=a.status==="replied_by_human"||a.status==="already_replied";return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex gap-3 px-1",children:[x&&e.jsx("div",{className:"pt-1.5",children:e.jsx(ge,{checked:!!h,onCheckedChange:()=>c==null?void 0:c(a.id),"aria-label":"Selecionar comentário"})}),e.jsx(Q,{name:a.from_username??"?"}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{className:"font-bold text-sm",children:["@",a.from_username??"anônimo"]}),e.jsx("span",{className:"text-xs text-muted-foreground",children:H(new Date(a.received_at),{addSuffix:!0,locale:W})}),n&&e.jsx(ce,{variant:"outline",className:`text-[10px] uppercase font-bold border ${n.tone} ml-auto`,children:n.label})]}),e.jsx("p",{className:"text-sm leading-relaxed text-foreground",children:a.comment_text}),!u&&a.ai_reasoning&&a.ai_category&&e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] uppercase tracking-wide font-bold text-[#00AEEF]",children:[e.jsx(D,{className:"h-3 w-3"})," ",a.ai_category]}),e.jsx(de,{delayDuration:150,children:e.jsxs(me,{children:[e.jsx(pe,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex items-center justify-center w-5 h-5 rounded-full hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":"Por que a IA não enviou",children:e.jsx(ke,{className:"h-3.5 w-3.5"})})}),e.jsx(ue,{side:"right",className:"max-w-xs text-xs leading-relaxed",children:a.ai_reasoning})]})})]})]})]}),a.posted_reply&&(d||w)&&e.jsxs("div",{className:"flex gap-3 flex-row-reverse px-1",children:[e.jsx(Q,{name:"A",brand:!0}),e.jsxs("div",{className:"flex-1 min-w-0 space-y-1.5 flex flex-col items-end",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:a.replied_at&&H(new Date(a.replied_at),{addSuffix:!0,locale:W})}),e.jsx("span",{className:"font-bold text-sm",children:"Adamantiun"}),!u&&e.jsx("span",{className:`text-[10px] uppercase font-bold tracking-wide ${d?"text-emerald-600":"text-sky-600"}`,children:d?"via IA":"manual"})]}),e.jsx("div",{className:"bg-[#111111] text-white rounded-2xl rounded-tr-sm px-4 py-2.5 text-sm leading-relaxed max-w-[85%]",children:a.posted_reply})]})]}),t&&e.jsx(Re,{comment:a,onAction:r})]})}function Fe({post:a,comments:r,onAction:t,showEditor:u,defaultOpen:x,reviewerMode:h,selectable:c,selectedIds:n,onToggleSelect:d}){const[w,g]=l.useState(!!x);return e.jsx(fe,{open:w,onOpenChange:g,asChild:!0,children:e.jsxs("section",{className:"border border-border rounded-2xl bg-white/40 overflow-hidden",children:[e.jsxs(be,{className:"w-full flex gap-4 items-center p-4 bg-muted/70 hover:bg-muted transition-colors text-left",children:[a.thumbnail&&e.jsx("img",{src:a.thumbnail,alt:"",className:"w-14 h-14 rounded-xl object-cover ring-1 ring-border shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] font-black uppercase tracking-wider text-muted-foreground",children:"Post Instagram"}),e.jsx("span",{className:"w-1 h-1 rounded-full bg-muted-foreground/40"}),e.jsxs("span",{className:"text-xs font-bold text-foreground",children:[r.length," ",r.length===1?"comentário":"comentários"]}),a.permalink&&e.jsxs("a",{href:a.permalink,target:"_blank",rel:"noopener",onClick:o=>o.stopPropagation(),className:"text-xs text-[#00AEEF] hover:underline ml-auto flex items-center gap-1 font-medium",children:["Abrir no Instagram ",e.jsx(ie,{className:"h-3 w-3"})]})]}),e.jsx("p",{className:"text-sm text-foreground/70 line-clamp-1",children:a.caption??"(sem legenda)"})]}),e.jsx(le,{className:`h-5 w-5 text-muted-foreground shrink-0 transition-transform ${w?"rotate-180":""}`})]}),e.jsx(je,{children:e.jsx("div",{className:"border-t border-border px-4 py-6 space-y-8 bg-background/30",children:r.map(o=>e.jsx(ze,{comment:o,onAction:t,showEditor:u,reviewerMode:h,selectable:c,selected:n==null?void 0:n.has(o.id),onToggleSelect:d},o.id))})})]})})}function Te(a){const r=new Map;for(const t of a)r.has(t.ig_media_id)||r.set(t.ig_media_id,{post:{id:t.
11ig_media_id,caption:t.ig_media_caption,permalink:t.ig_media_permalink,thumbnail:t.ig_media_thumbnail},comments:[]}),r.get(t.ig_media_id).comments.push(t);return Array.from(r.values()).sort((t,u)=>new Date(u.comments[0].received_at).getTime()-new Date(t.comments[0].received_at).getTime())}function as(){const{user:a}=oe(),r=(a==null?void 0:a.email)===Se,[t,u]=l.useState([]),[x,h]=l.useState(!0),[c,n]=l.useState(!1),[d,w]=l.useState(!1),[g,o]=l.useState(""),[m,_]=l.useState(!1),[E,R]=l.useState(new Set),[V,q]=l.useState(!1),[O,G]=l.useState(!1),X=s=>{R(i=>{const f=new Set(i);return f.has(s)?f.delete(s):f.add(s),f})},k=async()=>{h(!0);const{data:s,error:i}=await b.from("instagram_comments").select("*").order("received_at",{ascending:!1}).limit(500);!i&&s&&u(s),h(!1)},Y=async()=>{const{data:s}=await b.from("instagram_brand_voice").select("system_prompt").eq("id",!0).maybeSingle();s&&o(s.system_prompt)};l.useEffect(()=>{k(),Y();const s=b.channel("ig-comments").on("postgres_changes",{event:"*",schema:"public",table:"instagram_comments"},()=>k()).subscribe();return()=>{b.removeChannel(s)}},[]);const L=l.useMemo(()=>t.filter(s=>s.status==="needs_human"||s.status==="pending"),[t]),z=l.useMemo(()=>t.filter(s=>s.status==="auto_replied"),[t]),F=l.useMemo(()=>t.filter(s=>s.status==="replied_by_human"||s.status==="already_replied"),[t]),ee=async()=>{_(!0);const{error:s}=await b.from("instagram_brand_voice").update({system_prompt:g,updated_at:new Date().toISOString()}).eq("id",!0);_(!1),s?p.error("Erro ao salvar"):p.success("Guidelines salvos")},se=async()=>{n(!0);try{const{data:s,error:i}=await b.functions.invoke("poll-instagram-comments");if(i)throw i;p.success(`${(s==null?void 0:s.sent_to_ai)??0} novos · ${(s==null?void 0:s.skipped_existing)??0} já existentes`),k()}catch(s){p.error(s instanceof Error?s.message:"Erro")}finally{n(!1)}},ae=async()=>{w(!0);try{const s=new Date().toISOString(),i=`demo_${Date.now()}`,{error:f}=await b.from("instagram_comments").insert({ig_comment_id:i,ig_media_id:"demo_media",ig_media_permalink:"https://www.instagram.com/adamantiun_official/",ig_media_caption:"Demonstração â kit Adamantiun edição limitada",ig_media_thumbnail:null,from_username:"test_reviewer",comment_text:"Quanto custa esse kit? Vocês entregam em SP?",ai_suggested_reply:"Oi! O kit está R$ 1.299 e entregamos pro Brasil todo, com SP saindo em até 3 dias úteis ð",ai_reasoning:"Pergunta sobre preço e logÃstica â geramos sugestão para você revisar antes de publicar no Instagram.",ai_category:"duvida_produto",status:"needs_human",received_at:s});if(f)throw f;p.success("Demonstração criada â vá para 'Pendentes' e aprove"),k()}catch(s){p.error(s instanceof Error?s.message:"Erro")}finally{w(!1)}},te=async()=>{const s=L.filter(C=>{var v;return E.has(C.id)&&((v=C.ai_suggested_reply)==null?void 0:v.trim())});if(s.length===0){p.error("Selecione comentários com sugestão da IA já preenchida");return}if(!confirm(`Aprovar e publicar ${s.length} respostas no Instagram?`))return;q(!0);let i=0,f=0;for(const C of s)try{const{data:v,error:N}=await b.functions.invoke("train-instagram-reply",{body:{comment_id:C.id,reply_text:C.ai_suggested_reply,action:"reply"}});if(N||!(v!=null&&v.success))throw new Error((v==null?void 0:v.error)??(N==null?void 0:N.message)??"fail");i++}catch{f++}q(!1),R(new Set),p.success(`${i} publicadas · ${f} falharam`),k()},re=async()=>{if(confirm("Rodar a IA em TODOS os comentários pendentes e publicar automaticamente os simples (saudações, elogios, dúvidas básicas)? Os que a IA não tiver certeza ficam pendentes pra revisão.")){G(!0);try{const{data:s,error:i}=await b.functions.invoke("bulk-reply-instagram-comments",{body:{limit:200}});if(i||!(s!=null&&s.success))throw new Error((s==null?void 0:s.error)??(i==null?void 0:i.message)??"fail");p.success(`${s.total} processados · ${s.sent} publicados · ${s.skipped} ignorados · ${s.failed} falharam`),k()}catch(s){p.error(s instanceof Error?s.message:"Erro")}finally{G(!1)}}},M=(s,i,f,C)=>{if(x)return e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(y,{className:"h-6 w-6 animate-spin"})});if(s.length===0)return e.jsxs("div",{className:"text-center py-20 text-muted-foreground",children:[C??e.jsx(Ne,{className:"h-12 w-12 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:f})]});const v=Te(s),N=s.map(A=>A.id),P=i&&N.length>0&&N.every(A=>E.has(A));return e.jsxs("div",{className:"space-y-4",children:[i&&e.jsxs("div",{className:"sticky top-0 z-10 -mx-1 px-3 py-2 bg-background/95 backdrop-blur border border-border rounded-xl flex items-center gap-2 flex-wrap shadow-sm",children:[e.jsxs(j,{size:"sm",variant:"outline",onClick:()=>{R(P?new Set:new Set(N))},children:[P?e.jsx(Ee,{className:"h-4 w-4 mr-1"}):e.jsx(_e,{className:"h-4 w-4 mr-1"}
11),P?"Desmarcar todos":"Selecionar todos"]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.size," de ",s.length," selecionado",E.size===1?"":"s"]}),e.jsx("div",{className:"flex-1"}),e.jsxs(j,{size:"sm",onClick:te,disabled:V||E.size===0,children:[V?e.jsx(y,{className:"h-4 w-4 animate-spin mr-1"}):e.jsx(B,{className:"h-4 w-4 mr-1"}),"Aprovar selecionados"]}),e.jsxs(j,{size:"sm",variant:"outline",onClick:re,disabled:O,className:"border-[#00AEEF]/40 text-[#00AEEF] hover:bg-[#00AEEF]/10 hover:text-[#00AEEF]",children:[O?e.jsx(y,{className:"h-4 w-4 animate-spin mr-1"}):e.jsx(D,{className:"h-4 w-4 mr-1"}),"Responder simples com IA"]})]}),v.map((A,ne)=>e.jsx(Fe,{post:A.post,comments:A.comments,onAction:k,showEditor:i,defaultOpen:ne===0,reviewerMode:r,selectable:i,selectedIds:E,onToggleSelect:X},A.post.id))]})};return e.jsxs("div",{className:"space-y-8 max-w-5xl mx-auto pb-12",children:[e.jsxs("header",{className:"flex items-start justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-black tracking-tight",children:r?"Instagram Comment Replies":"Instagram Replies"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-2xl",children:r?"Internal tool for Adamantiun staff to review and reply to public comments on our Instagram Business account (@adamantiun_official). AI suggests a draft; a human approves and publishes.":"Conversa-thread por post. A IA sugere e publica respostas seguras automaticamente; o resto fica para você aprovar."})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs(j,{variant:"outline",size:"sm",onClick:se,disabled:c,children:[c?e.jsx(y,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(ve,{className:"h-4 w-4 mr-1"}),r?"Fetch now":"Buscar agora"]})})]}),r&&e.jsxs("div",{className:"rounded-2xl border-2 border-amber-300 bg-amber-50 p-5 flex flex-col sm:flex-row items-start sm:items-center gap-4 shadow-sm",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-bold text-amber-900 text-sm uppercase tracking-wide",children:"Start your test here"}),e.jsxs("p",{className:"text-sm text-amber-800 mt-1",children:["No live comments yet? Click the button to create a demo comment, then switch to the ",e.jsx("strong",{children:"Pending review"})," tab to approve and publish it."]})]}),e.jsxs(j,{size:"default",onClick:ae,disabled:d,className:"bg-[#111111] text-white hover:bg-[#37434F] shrink-0 shadow-md",children:[d?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(Ae,{className:"h-4 w-4 mr-2"}),"Create demo comment"]})]}),e.jsxs(xe,{defaultValue:"to-reply",children:[e.jsxs(he,{className:"h-auto p-1 bg-muted/60",children:[e.jsxs(S,{value:"to-reply",className:"gap-1.5 px-4 py-2",children:[e.jsx(we,{className:"h-4 w-4"})," ",r?"Pending review":"Responder",e.jsx("span",{className:"ml-1 text-xs font-bold bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded",children:L.length})]}),!r&&e.jsxs(S,{value:"by-ai",className:"gap-1.5 px-4 py-2",children:[e.jsx(D,{className:"h-4 w-4"})," Respondidos com IA",e.jsx("span",{className:"ml-1 text-xs font-bold bg-emerald-100 text-emerald-900 px-1.5 py-0.5 rounded",children:z.length})]}),e.jsxs(S,{value:"by-human",className:"gap-1.5 px-4 py-2",children:[e.jsx(U,{className:"h-4 w-4"})," ",r?`Replied (${F.length+z.length})`:"Respondidos manualmente",!r&&e.jsx("span",{className:"ml-1 text-xs font-bold bg-sky-100 text-sky-900 px-1.5 py-0.5 rounded",children:F.length})]}),!r&&e.jsxs(S,{value:"voice",className:"gap-1.5 px-4 py-2",children:[e.jsx(ye,{className:"h-4 w-4"})," Tom de voz"]}),!r&&e.jsxs(S,{value:"meta-review",className:"gap-1.5 px-4 py-2",children:[e.jsx($,{className:"h-4 w-4"})," Meta Review"]})]}),e.jsx(I,{value:"to-reply",className:"mt-6",children:M(L,!0,r?"No pending comments. Click 'Create demo comment' to test the approval flow.":"Tudo respondido por aqui â¨")}),!r&&e.jsx(I,{value:"by-ai",className:"mt-6",children:M(z,!1,"Nenhuma resposta automática ainda.",e.jsx(D,{className:"h-12 w-12 mx-auto mb-3 opacity-40"}))}),e.jsx(I,{value:"by-human",className:"mt-6",children:M(r?[...F,...z]:F,!1,r?"No replied comments yet.":"Nenhuma resposta manual registada ainda.",e.jsx(U,{className:"h-12 w-12 mx-auto mb-3 opacity-40"}))}),!r&&e.jsxs(I,{value:"voice",className:"mt-6 space-y-3",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Guidelines internos da equipa para manter consistência no tom das respostas."}),e.jsx(J,{value:g,onChange:s=>o(s.target.value),rows:20,className:"font-mono text-xs"}),e.jsx(j,{onClick:ee,disabled:m,children:m?e.jsx(y,{className:"h-4 w-4 animate-spin"}):"Salvar guidelines"})]}),!r&&e.jsx(I,{value:"meta-review",className:"mt-6",children:e.jsx(De,{})})]})]})}function De(){const[a,r]=l.useState(!1),[t,u]=l.useState(null),x=async()=>{r(!0);try{const{data:n,error:d}=await b.functions.invoke("create-meta-reviewer");if(d||!(n!=null&&n.success))throw new Error((n==null?void 0:n.error)??(d==null?void 0:d.message)??"Falha");u({email:n.email,password:n.password,login_url:n.login_url,target_url:n.target_url}),p.success("Usuário de revisão pronto")}catch(n){p.error(n instanceof Error?n.message:"Erro")}finally{r(!1)}},h=`This is an internal admin tool used by Adamantiun staff to reply to Instagram comments and DMs from our official Instagram Business account (@adamantiun_official). 12 13How to access: 141. Go to ${(t==null?void 0:t.login_url)??"https://adamantiun-new-site.lovable.app/auth"} 152. Log in with the test credentials below 163. After login, navigate to ${(t==null?void 0:t.target_url)??"https://adamantiun-new-site.lovable.app/admin/instagram-replies"} 174. On that page you can: 18 - View recent comments and DMs pulled from the Instagram Graph API 19 - Reply to them directly (uses instagram_manage_comments and instagram_manage_messages) 20 - Mark conversations as handled 21 22The app only acts on the Instagram Business account connected by the logged-in admin user via Facebook Login. No end-customer accounts are involved.`,c=(n,d)=>{navigator.clipboard.writeText(n),p.success(`${d} copiado`)};return e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-muted/30 p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx($,{className:"h-5 w-5 text-[#00AEEF] mt-0.5 shrink-0"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-bold text-foreground",children:"Credenciais para o analista da Meta"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Gera (ou reseta) um usuário admin dedicado para a revisão do app. Cole as credenciais no formulário "Solicitação de análise do app" > "Instruções para o analista" no Meta for Developers.'})]})]}),e.jsxs(j,{onClick:x,disabled:a,children:[a?e.jsx(y,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx($,{className:"h-4 w-4 mr-2"}),t?"Resetar credenciais":"Gerar credenciais de teste"]})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"rounded-2xl border border-border bg-white p-5 space-y-3",children:[e.jsx("h4",{className:"font-bold text-sm",children:"Credenciais (cole no campo accesscode-web-1)"}),e.jsxs("div",{className:"grid gap-2 font-mono text-sm",children:[e.jsx(T,{label:"Email",value:t.email,onCopy:()=>c(t.email,"Email")}),e.jsx(T,{label:"Senha",value:t.password,onCopy:()=>c(t.password,"Senha")}),e.jsx(T,{label:"URL login",value:t.login_url,onCopy:()=>c(t.login_url,"URL")}),e.jsx(T,{label:"URL alvo",value:t.target_url,onCopy:()=>c(t.target_url,"URL")})]})]}),e.jsxs("div",{className:"rounded-2xl border border-border bg-white p-5 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h4",{className:"font-bold text-sm",children:"Instruções (cole no campo instructions-web-2)"}),e.jsxs(j,{size:"sm",variant:"outline",onClick:()=>c(h,"Instruções"),children:[e.jsx(K,{className:"h-3.5 w-3.5 mr-1"})," Copiar"]})]}),e.jsx("pre",{className:"text-xs bg-muted/40 rounded p-3 whitespace-pre-wrap font-mono",children:h})]})]})]})}function T({label:a,value:r,onCopy:t}){return e.jsxs("div",{className:"flex items-center gap-2 border border-border rounded-lg px-3 py-2 bg-muted/20",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground w-20 shrink-0",children:a}),e.jsx("span",{className:"flex-1 truncate",children:r}),e.jsx(j,{size:"sm",variant:"ghost",onClick:t,className:"h-7 w-7 p-0",children:e.jsx(K,{className:"h-3.5 w-3.5"})})]})}export{as 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.