PageSourceSearch

https://app.bellacia.com.br/_nuxt/TlTyZLoa.js

js bellacia.com.br collected 2026-10-04 08:02:46 UTC 7,856 bytes, 1 lines download raw bytes

1import{d as G,q as O,N as W,v as q,o as r,c as i,a as t,b as y,w as P,j as J,_ as K,F as b,h as v,n as M,l as o,t as u,T as Q,H as k,e as U,r as w,A as m,J as X}from"./SyGe6PDx.js";const Y={class:"min-h-screen bg-[#fefbfd]"},Z={class:"sticky top-0 z-20 bg-white border-b border-[#f0e0ea]"},ee={class:"max-w-xl mx-auto px-4 py-4 flex items-center justify-between"},te={class:"max-w-xl mx-auto p-4 space-y-3 pb-safe"},se={class:"rounded-2xl border border-[#f0e0ea] bg-white p-4 flex gap-3 items-start"},oe={class:"shrink-0 w-8 h-8 rounded-full bg-[#fde8f1] flex items-center justify-center"},ae={class:"flex gap-2"},le=["onClick"],ne={class:"bg-white rounded-2xl border border-[#f0e0ea] p-5 shadow-[0_4px_24px_-8px_rgba(0,0,0,0.06)]"},re={class:"mb-4"},ie={class:"text-xs text-[#8a7a83] font-medium uppercase tracking-wide mb-1"},ce={class:"text-3xl font-bold text-[#312733] font-['Poppins',sans-serif]"},de={class:"text-xs text-[#8a7a83] mt-0.5"},ue={key:0,class:"h-32 flex items-center justify-center"},pe={key:1,class:"relative"},fe={class:"h-8 flex items-center mb-1"},_e={key:0,class:"flex items-baseline gap-2"},xe={class:"text-lg font-bold text-[#312733] font-['Poppins',sans-serif]"},he={class:"text-xs text-[#8a7a83]"},ye={key:1,class:"text-xs text-[#b89fac]"},be={viewBox:"0 0 320 80",class:"w-full h-24",preserveAspectRatio:"none",style:{"touch-action":"none"}},ve={id:"bar-grad",x1:"0%",y1:"0%",x2:"0%",y2:"100%"},me=["x","y","width","height","fill","opacity","onClick"],ge=["x","width","onClick"],ke={class:"flex justify-between px-0.5 mt-1"},we={key:2,class:"h-24 flex items-center justify-center text-sm text-[#b89fac]"},$e={class:"flex gap-2 overflow-x-auto pb-1 scrollbar-hide"},Ce=["onClick"],Be={class:"grid grid-cols-2 gap-3"},Me=["onClick"],Se={class:"flex items-center gap-2 mb-2"},Ne={class:"text-xs text-[#8a7a83]"},ze={class:"text-xl font-bold text-[#312733] font-['Poppins',sans-serif]"},De=G({__name:"stats",setup(je){const z=O();new Date().toLocaleDateString("pt-BR",{day:"numeric",month:"long",year:"numeric"});const T=[{label:"7 dias",value:7},{label:"28 dias",value:28}],x=w(7),$=[{key:"profile_views",label:"Visualizações",icon:"solar:eye-bold",color:"#df3884"},{key:"story_views",label:"Stories",icon:"solar:gallery-bold",color:"#7c3aed"},{key:"whatsapp_clicks",label:"WhatsApp",icon:"solar:phone-bold",color:"#16a34a"},{key:"photo_clicks",label:"Fotos",icon:"solar:camera-bold",color:"#ea580c"},{key:"video_plays",label:"Vídeos",icon:"solar:play-circle-bold",color:"#0284c7"},{key:"card_impressions",label:"Impressões",icon:"solar:widget-bold",color:"#b45309"},{key:"followers",label:"Curtidas",icon:"solar:heart-bold",color:"#f43f5e"}],p=w("profile_views"),C=m(()=>$.find(s=>s.key===p.value)),c=w(null);W(p,()=>{c.value=null});const h=w([]),B=w(!0);let S=0;function D(s,l){const n=new Map;for(const e of s){const a=(typeof e.date=="string"?e.date:new Date(e.date).toISOString()).slice(0,10);n.set(a,e)}const d=[];for(let e=l-1;e>=0;e--){const a=new Date;a.setDate(a.getDate()-e);const _=a.toISOString().slice(0,10);d.push(n.get(_)??{date:_,profile_views:0,story_views:0,whatsapp_clicks:0,photo_clicks:0,video_plays:0,card_impressions:0,followers:0})}return d}async function j(){B.value=!0;try{const s=await z(`/ads/${S}/stats?days=${x.value}`,{method:"GET"});h.value=D(s?.data??[],x.value)}catch{h.value=D([],x.value)}finally{B.value=!1}}function R(s){x.value=s,c.value=null,j()}const I=m(()=>{const s={};for(const l of $)s[l.key]=h.value.reduce((n,d)=>n+(Number(d[l.key])||0),0);return s}),A=m(()=>I.value[p.value]??0),f=m(()=>{if(!h.value.length)return[];const s=p.value,l=h.value.map(g=>Number(g[s])||0),n=Math.max(...l,1),d=l.length,e=320,a=80,_=4,L=Math.floor((e-_*(d-1))/d);return l.map((g,V)=>{const F=Math.max(g>0?4:0,Math.round(g/n*(a-4)));return{x:V*(L+_),y:a-F,w:L,h:F,value:g,date:h.value[V]?.date??""}})}),E=m(()=>Math.max(...f.value.map(s=>s.value),0)),H=m(()=>{if(!f.value.length)return[];const s=f.value;if(s.length<=7)return s.map(n=>({label:N(n.date)}));const l=[0,Math.floor(s.length/2),s.length-1];return s.map((n,d)=>({label:l.includes(d)?N(n.date):""}))});function N(s){if(!s)return"";const n=(typeof s=="string"?s:new Date(s).toISOString()).slice(0,10).split("-");return n.length!==3?"":`${n[2]}/${n[1]}`}return q(async()=>{try{const s=await z("/profile/ad-summary",{method:"GET"});S=Number(s?.anuncio?.id||0),S&&await j()}catch{B.value=!1}}),(s,l)=>{const n=J,d=K;return r(),i("div",Y,[t("header",Z,[t("div",ee,[y(d,{to:"/profile",class:"w-10 h-10 rounded-full bg-gray-100 flex items-center justify-center hover:bg-gray-200 transition"},{default:P(()=>[y(n,{name:"solar:arrow-left-linear",size:"20",class:"text-[#312733]"})]),_:1}),l[0]||(l[0]=t("p",{class:"text-base font-semibold text-[#312733]"},"Estatísticas",-1)),l[1]||(l[1]=t("div",{class:"w-10"},null,-1))])]),t("div",te,[t("div",se,[t("div",oe,[y(n,{name:"solar:chart-2-bold",size:"16",class:"text-[#df3884]"})]),l[2]||(l[2]=t("p",{class:"text-xs text-[#61545e] leading-relaxed"}," Nova forma de visualizar estatísticas. ",-1))]),t("div",ae,[(r(),i(b,null,v(T,e=>t("button",{key:e.value,onClick:a=>R(e.value),class:M(["px-4 py-1.5 rounded-full text-sm font-medium transition-all",o(x)===e.value?"bg-[#312733] text-white":"bg-white text-[#61545e] border border-[#f0e0ea]"])},u(e.label),11,le)),64))]),t("div",ne,[t("div",re,[t("p",ie,u(o(C).label),1),t("p",ce,u(o(A).toLocaleStr
1ing("pt-BR")),1),t("p",de,"nos últimos "+u(o(x))+" dias",1)]),o(B)?(r(),i("div",ue,[...l[3]||(l[3]=[t("div",{class:"w-5 h-5 border-2 border-[#df3884] border-t-transparent rounded-full animate-spin"},null,-1)])])):o(f).length?(r(),i("div",pe,[t("div",fe,[y(Q,{name:"fade"},{default:P(()=>[o(c)!==null?(r(),i("div",_e,[t("span",xe,u(o(f)[o(c)]?.value.toLocaleString("pt-BR")),1),t("span",he,u(N(o(f)[o(c)]?.date)),1)])):(r(),i("span",ye,"Toque em uma barra para ver o valor"))]),_:1})]),(r(),i("svg",be,[t("defs",null,[t("linearGradient",ve,[t("stop",{offset:"0%",style:k(`stop-color:${o(C).color};stop-opacity:1`)},null,4),t("stop",{offset:"100%",style:k(`stop-color:${o(C).color};stop-opacity:0.6`)},null,4)])]),(r(!0),i(b,null,v(o(f),(e,a)=>(r(),i("rect",{key:a,x:e.x,y:e.y,width:e.w,height:e.h,rx:"3",fill:o(c)===a||e.value===o(E)&&e.value>0?"url(#bar-grad)":`${o(C).color}30`,opacity:o(c)!==null&&o(c)!==a?.5:1,style:{cursor:"pointer"},onClick:_=>c.value=o(c)===a?null:a},null,8,me))),128)),(r(!0),i(b,null,v(o(f),(e,a)=>(r(),i("rect",{key:`hit-${a}`,x:e.x,y:"0",width:e.w,height:"80",fill:"transparent",style:{cursor:"pointer"},onClick:_=>c.value=o(c)===a?null:a},null,8,ge))),128))])),t("div",ke,[(r(!0),i(b,null,v(o(H),(e,a)=>(r(),i("span",{key:a,class:M(["text-[10px] transition-colors",o(c)===a?"text-[#df3884] font-semibold":"text-[#b89fac]"])},u(e.label),3))),128))])])):(r(),i("div",we," Nenhum dado ainda para este período "))]),t("div",$e,[(r(),i(b,null,v($,e=>t("button",{key:e.key,onClick:a=>p.value=e.key,class:M(["shrink-0 flex items-center gap-1.5 px-3 py-2 rounded-xl text-xs font-medium border transition-all",o(p)===e.key?"border-transparent text-white":"bg-white border-[#f0e0ea] text-[#61545e]"]),style:k(o(p)===e.key?`background:${e.color}`:"")},[y(n,{name:e.icon,size:"14"},null,8,["name"]),U(" "+u(e.label),1)],14,Ce)),64))]),t("div",Be,[(r(),i(b,null,v($,e=>t("div",{key:e.key,onClick:a=>p.value=e.key,class:M(["bg-white rounded-2xl border p-4 cursor-pointer transition-all",o(p)===e.key?"border-[#df3884] shadow-[0_0_0_1px_#df3884]":"border-[#f0e0ea]"])},[t("div",Se,[t("div",{class:"w-7 h-7 rounded-full flex items-center justify-center",style:k(`background:${e.color}20`)},[y(n,{name:e.icon,size:"14",style:k(`color:${e.color}`)},null,8,["name","style"])],4),t("p",Ne,u(e.label),1)]),t("p",ze,u(o(I)[e.key].toLocaleString("pt-BR")),1)],10,Me)),64))])])])}}}),Le=X(De,[["__scopeId","data-v-f610fae0"]]);export{Le 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.