1import{e as P}from"./vendor-vue-BIDZeepx.js";import{A as x}from"./AsyncState-C1wY1NSf.js";import{E as A}from"./EmptyState-HBFSUaTT.js";import{W as B,k as S,_ as D}from"./index-BNPflmqD.js";import{a as E,f as N}from"./format-W5H20hG1.js";import{k as R,r as c,_ as V,z as o,K as t,J as n,H as l,G as m,Q as w,D as F,y as r,u as v,L as T,P as z,C as L}from"./vendor-misc-5pJBpqhN.js";import"./vendor-tanstack-B6ELLr_Q.js";import"./vendor-sentry-84cD2ryj.js";import"./vendor-utils-CxkvrZ9U.js";const M={class:"client-portal-page"},U={class:"client-portal-card","aria-live":"polite"},G={class:"client-portal-header"},H=["src"],I={class:"eyebrow"},J={class:"subtitle"},K={key:0},O={key:0,class:"portal-content"},Q={class:"summary-grid"},W={class:"money"},$={key:0},j={key:1},q={key:2},X={key:0,class:"portal-top"},Y={class:"money"},Z={class:"note"},ee=R({__name:"AgencyClientPortalPage",setup(te){const C=P(),e=c(null),s=c(!0),u=c(null);async function _(){const i=String(C.params.token??"").trim();if(!i){u.value="Portal link is invalid.",s.value=!1;return}s.value=!0,u.value=null;try{e.value=await B(i)}catch(a){e.value=null,u.value=S(a,"Client portal link is invalid or expired.")}finally{s.value=!1}}return V(()=>{_()}),(i,a)=>{var p,y,g,f,k,h;return r(),o("main",M,[t("section",U,[t("header",G,[(p=e.value)!=null&&p.logo_url?(r(),o("img",{key:0,src:e.value.logo_url,alt:"",class:"portal-logo"},null,8,H)):n("",!0),t("p",I,l(((y=e.value)==null?void 0:y.brand_name)||"Orolith"),1),t("h1",null,l(((g=e.value)==null?void 0:g.label)||"Client portal"),1),t("p",J,[a[0]||(a[0]=m(" Read-only portfolio snapshot ",-1)),(k=(f=e.value)==null?void 0:f.scope)!=null&&k.manager_filter?(r(),o("span",K," · scoped to "+l(e.value.scope.manager_filter),1)):n("",!0),m(" · "+l(((h=e.value)==null?void 0:h.timeframe_days)||30)+"d ",1)])]),w(x,{loading:s.value,error:u.value,onRetry:_},{default:F(()=>{var b;return[e.value?(r(),o("div",O,[t("dl",Q,[t("div",null,[a[1]||(a[1]=t("dt",null,"Agency",-1)),t("dd",null,l(e.value.organization_name),1)]),t("div",null,[a[2]||(a[2]=t("dt",null,"Active creators",-1)),t("dd",null,l(v(E)(e.value.summary.active_creator_count)),1)]),t("div",null,[t("dt",null,"Book net ("+l(e.value.timeframe_days)+"d)",1),t("dd",W,l(v(N)(e.value.summary.total_revenue??"0",e.value.summary.currency||"USD")),1)]),e.value.summary.revenue_change_percent!=null?(r(),o("div",$,[a[3]||(a[3]=t("dt",null,"Period change",-1)),t("dd",null,l(Number.isFinite(Number(e.value.summary.revenue_change_percent))?`${Number(e.value.summary.revenue_change_percent).toFixed(1)}%`:"â"),1)])):n("",!0),e.value.summary.needs_reconnect!=null?(r(),o("div",j,[a[4]||(a[4]=t("dt",null,"Needs reconnect",-1)),t("dd",null,l(e.value.summary.needs_reconnect),1)])):n("",!0),e.value.summary.revenue_slipping!=null?(r(),o("div",q,[a[5]||(a[5]=t("dt",null,"Revenue slipping",-1)),t("dd",null,l(e.value.summary.revenue_slipping),1)])):n("",!0)]),(b=e.value.top_creators_by_revenue)!=null&&b.length?(r(),o("div",X,[a[6]||(a[6]=t("h2",null,"Top book contributors",-1)),t("ol",null,[(r(!0),o(T,null,z(e.value.top_creators_by_revenue,d=>(r(),o("li",{key:d.rank},[m(" #"+l(d.rank)+" â ",1),t("span",Y,l(v(N)(d.revenue??"0",e.value.summary.currency||"USD")),1)]))),128))])])):!s.value&&Number(e.value.summary.active_creator_count||0)===0?(r(),L(A,{key:1,title:"No creators in this view",description:"This portal scope has no active Book rows yet.",compact:""})):n("",!0),t("p",Z,l(e.value.message),1)])):n("",!0)]}),_:1},8,["loading","error"])])])}}}),ce=D(ee,[["__scopeId","data-v-3e572464"]]);export{ce 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.