PageSourceSearch

https://postclick.ppc.io/assets/dashboard-C0dDeqMQ.js

js ppc.io collected 2026-10-03 19:53:34 UTC 11,527 bytes, 5 lines download raw bytes

1import{fn as b,j as e,L as S,fo as $,r as m,fp as A,u as P,fq as R,bg as C,aj as E,ak as D,ai as w,fr as O,an as q,O as N,bh as k,s as B}from"./index-V72ovg5l.js";import{b6 as xe}from"./index-V72ovg5l.js";import{u as I}from"./useRequireSession-CWMhv9pA.js";import{h as T}from"./audit-experience-client-C3K_5VD3.js";import{u as K,C as G}from"./CreditDrawer-DVhF0MyB.js";import"./index-CgVQRudc.js";import"./multi-audit-urls-CX7WtAXR.js";import"./roadmap-D9J5ZKPu.js";const U=[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],V=b("book-marked",U);const Y=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],J=b("house",Y);const Q=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],X=b("lock-keyhole",Q);const Z=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ee=b("settings",Z);function te({groups:t,plan:a,account:r,backTo:s,backLabel:o,contextLabel:p,footer:n,className:d}){return e.jsxs("aside",{className:`sticky top-0 hidden h-screen w-[236px] shrink-0 self-start lg:block ${d??""}`,style:{maxHeight:"100vh"},children:[e.jsxs("div",{className:"flex h-full flex-col px-3.5 py-5",style:{background:"var(--paper)",borderRight:"1px solid var(--pebble)"},children:[e.jsxs("div",{className:"px-2.5 pb-4",style:{fontFamily:"var(--font-display)",fontWeight:800,fontSize:21,letterSpacing:"-0.02em",color:"var(--ink)"},children:["PPC",e.jsx("span",{style:{color:"var(--ember)"},children:"."}),"io"]}),s&&e.jsxs(S,{to:s,className:"mb-1 inline-flex items-center gap-1.5 px-2.5 py-1 hover:text-ember",style:{fontFamily:"var(--font-body)",fontSize:13,color:"var(--ink-mute)"},children:[e.jsx($,{size:14})," ",o??"Back"]}),p&&e.jsx("div",{className:"mb-1 truncate px-2.5",style:{fontFamily:"var(--font-display)",fontSize:13,fontWeight:600,color:"var(--ink-faint)"},children:p}),e.jsx("nav",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsx("ul",{style:{display:"flex",flexDirection:"column",gap:2},children:t.map((c,l)=>e.jsxs("li",{style:{display:"contents"},children:[c.label&&e.jsx("div",{className:"px-2.5 pb-0.5 pt-3",style:{fontFamily:"var(--font-display)",fontSize:13,fontWeight:600,color:"var(--ink-faint)"},children:c.label}),c.items.map(i=>e.jsx(ae,{item:i},i.key))]},l))})}),n&&e.jsx("div",{className:"mt-2.5 shrink-0",children:n}),(a||r)&&e.jsx("div",{className:"mt-2.5 shrink-0 pt-1",children:r?e.jsx(se,{account:r,plan:a}):a&&e.jsx("div",{className:"rounded-[14px] px-3.5 py-3",style:{background:"var(--paper-warm)",border:"1.5px solid var(--pebble)"},children:e.jsx(z,{plan:a})})})]}),e.jsx("style",{children:ne})]})}function ae({item:t}){const{icon:a,state:r}=t,s=r==="active",o=r==="locked",p=r==="filed",n=r==="openable",d=r==="live",c=t.lockedHint?`rail-lock-hint-${t.key}`:void 0,l=e.jsxs(e.Fragment,{children:[e.jsx(a,{size:17,className:`${t.lockedHint&&o?"mt-0.5 self-start":""} ${s?"text-ember":o?"text-ink-faint":"text-ink-faint group-hover:text-ember"}`}),e.jsxs("span",{className:"min-w-0 flex-1 leading-tight",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-1.5 gap-y-0.5",style:{fontFamily:"var(--font-body)",fontWeight:s?700:500,fontSize:14},children:[e.jsx("span",{children:t.label}),o&&t.lockedHint&&e.jsxs("span",{"aria-hidden":!0,className:"inline-flex items-center gap-1 rounded-full px-1.5 py-0.5",style:{border:"1px solid var(--pebble)",fontSize:13,fontWeight:600},children:[e.jsx(X,{size:12,strokeWidth:2.5})," Coming next"]})]}),o&&t.lockedHint&&e.jsx("span",{id:c,className:"mt-0.5 block",style:{color:"var(--ink-faint)",fontFamily:"var(--font-body)",fontSize:13,lineHeight:1.35},children:t.lockedHint})]}
1),p&&e.jsx("span",{"aria-hidden":!0,className:"flex size-3.5 items-center justify-center rounded-full",style:{background:"var(--mint-deep)",color:"var(--ink)"},children:e.jsx("svg",{viewBox:"0 0 10 10",width:"7",height:"7","aria-hidden":!0,children:e.jsx("path",{d:"M2 5l2 2 4-4",stroke:"currentColor",strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}),n&&e.jsx("span",{"aria-hidden":!0,className:"inline-block size-2.5 rounded-full",style:{background:"var(--mint-deep)"}}),d&&e.jsx("span",{"aria-hidden":!0,className:"flex size-3.5 items-center justify-center rounded-full",style:{border:"1.8px solid var(--mint-deep)"},children:e.jsx("span",{className:"live-pulse",style:{width:6,height:6,background:"var(--mint-deep)"}})})]}),i=`group relative flex w-full items-center gap-2.5 rounded-[11px] px-2.5 py-1.5 text-left transition ${s?"bg-mint text-ink":o?"cursor-default text-ink-faint":"text-ink hover:bg-mint-soft"}`,h={fontSize:14,opacity:o?t.lockedHint?.78:.5:void 0};return t.to&&!o?e.jsx(S,{to:t.to,className:i,style:h,onClick:t.onSelect,children:l}):o?e.jsx("div",{role:"link","aria-disabled":"true","aria-describedby":c,className:i,style:h,title:t.lockedHint,children:l}):e.jsx("button",{type:"button",onClick:t.onSelect,className:i,style:h,children:l})}function z({plan:t,compact:a}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-baseline justify-between",children:[e.jsx("span",{style:{fontFamily:"var(--font-body)",fontWeight:600,fontSize:13,color:"var(--ink-mute)"},children:t.meterLabel}),e.jsxs("span",{style:{fontFamily:"var(--font-body)",fontWeight:600,fontSize:13,color:"var(--ink-faint)"},children:[Math.round(t.pct),"%"]})]}),e.jsx("div",{className:a?"mt-1.5 h-1 overflow-hidden rounded-full":"mt-2 h-1.5 overflow-hidden rounded-full",style:{background:"var(--paper-deep)"},children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.max(0,Math.min(100,t.pct))}%`,background:"linear-gradient(90deg, var(--mint-strong), var(--mint-deep))"}})})]})}function se({account:t,plan:a}){const[r,s]=m.useState(!1),o=m.useRef(null);m.useEffect(()=>{if(!r)return;const n=d=>{o.current&&!o.current.contains(d.target)&&s(!1)};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[r]);const p=t.menu&&t.menu.length>0;return e.jsxs("div",{ref:o,className:"relative",children:[p&&r&&e.jsx("div",{className:"absolute bottom-full left-0 right-0 mb-2 overflow-hidden rounded-[12px]",style:{background:"var(--paper)",border:"1.5px solid var(--ink)",boxShadow:"0 6px 0 -1px var(--ink)"},children:t.menu.map((n,d)=>e.jsx("button",{type:"button",onClick:()=>{s(!1),n.onClick()},className:"app-rail-menu-item flex w-full items-center px-3.5 py-2.5 text-left",style:{fontFamily:"var(--font-body)",fontWeight:600,fontSize:13.5,color:n.danger?"var(--alarm)":"var(--ink)",borderTop:d===0?"none":"1px solid var(--pebble)",cursor:"pointer"},children:n.label},d))}),e.jsxs("div",{className:"app-rail-acct overflow-hidden rounded-[14px]",style:{background:"var(--paper-warm)",border:"1.5px solid var(--pebble)"},children:[e.jsxs("button",{type:"button",onClick:()=>p?s(n=>!n):t.onClick?.(),className:"flex w-full items-center gap-2.5 px-3 py-2.5 text-left",style:{cursor:"pointer"},children:[e.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full",style:{background:"var(--mint)",border:"1.5px solid var(--ink)",fontFamily:"var(--font-display)",fontWeight:800,fontSize:13.5,color:"var(--ink)"},children:t.initials}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate",style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:14,color:"var(--ink)"},children:t.name}),e.jsx("div",{className:"truncate",style:{fontFamily:"var(--font-body)",fontSize:13,color:"var(--ink-faint)"},children:t.sub})]}),e.jsx(A,{size:16,strokeWidth:2.4,style:{color:"var(--ink-faint)",transform:r?"rotate(-90deg)":"none",transition:"transform .15s ease"}})]}),a&&e.jsx("div",{className:"px-3 pb-2.5 pt-2",style:{borderTop:"1px solid var(--pebble)"},children:e.jsx(z,{plan:a,compact:!0})})]})]})}const ne=`
2  .app-rail-acct { transition: background .13s ease, border-color .13s ease; }
3  .app-rail-acct:hover { background: var(--paper); border-color: var(--ink); }
4  .app-rail-menu-item:hover { background: var(--paper-warm); }
5`;function ue(){const t=P(),a=R({from:"/dashboard"}),s=C().pathname.replace(/\/+$/,"")||"/dashboard",o=T(s),[p,n]=m.useState(!1),{checked:d,email:c}=I({allowSignedOut:o}),l=E(!o),i=D(l.data?.id),[h]=m.useState(a.purchase),g=K({checkout:a.checkout,purchase:a.purchase,from:a.from,workspaceId:l.data?.id,plan:i.data?.plan,planStatus:i.data?.plan_status??l.data?.plan_status,grants:i.data?.grants,refetch:i.refetch,source:"dashboard_checkout_return"}),W=re(),M=s==="/dashboard"||s.startsWith("/dashboard/a")||s.startsWith("/dashboard/p")||s.startsWith("/dashboard/d"),u=i.data?.credits.available??null,v=i.data?.plan??l.data?.plan_key,_=typeof v=="string"&&v in w?v:"free",f=w[_],F=typeof u=="number"&&f.monthly_credits>0?Math.max(0,Math.min(100,Math.round(Math.min(u,f.monthly_credits)/f.monthly_credits*100))):void 0,x=l.data?.name??null,L=(x??c??"").split(/[\s@]+/).map(y=>
5y[0]).filter(Boolean).slice(0,2).join("").toUpperCase()||"AC",H=m.useMemo(()=>({email:c,workspaceName:x,creditsAvailable:u,checkoutState:g,checkoutPurchase:a.purchase??h,openCreditDrawer:()=>requestAnimationFrame(()=>n(!0))}),[h,g,u,c,a.purchase,x]),j=!o&&d&&l.isError?e.jsxs("div",{className:"paper-card-warm mx-auto mb-4 max-w-[1200px] px-4 py-3 text-sm text-ink",children:["We couldn’t reach your workspace just now.",e.jsx("button",{onClick:()=>l.refetch(),className:"ml-3 text-ember underline underline-offset-4",children:"Retry"})]}):null;return e.jsx(O.Provider,{value:H,children:e.jsxs("div",{className:"min-h-screen app-canvas text-ink",children:[e.jsx(q,{theme:"light",richColors:!0}),M?e.jsxs(e.Fragment,{children:[j,e.jsx(N,{})]}):e.jsxs("div",{className:"flex gap-0 pl-3",children:[e.jsx(te,{groups:W,plan:typeof u=="number"?{name:`${f.name} plan`,meterLabel:`${u.toLocaleString()} credits`,pct:F??0}:void 0,account:{name:x??c?.split("@")[0]??"Your account",sub:c??`${f.name} plan`,initials:L,menu:[{label:"Credits & billing",onClick:()=>n(!0)},{label:"Settings",onClick:()=>t({to:"/settings"})},{label:"Pricing",onClick:()=>t({href:k("drawer")})},{label:"Sign out",danger:!0,onClick:()=>{B.auth.signOut()}}]}}),e.jsxs("main",{className:"min-w-0 flex-1 px-2 pb-12 pt-4 md:px-4",children:[j,e.jsx(N,{})]})]}),e.jsx(G,{open:p,onClose:()=>n(!1),data:i.data,onNavigate:y=>{n(!1),t({href:y})},onUpgrade:()=>{n(!1),t({href:k("drawer")})},onTopup:()=>{n(!1),t({href:k("drawer")})}})]})})}function re(){const a=C().pathname,r=s=>a===s||s!=="/dashboard"&&a.startsWith(s)?"active":"openable";return[{items:[{key:"dashboard",label:"Dashboard",icon:J,state:a==="/dashboard"||a.startsWith("/dashboard/a")?"active":"openable",to:"/dashboard"},{key:"library",label:"Library",icon:V,state:r("/library"),to:"/library"},{key:"settings",label:"Settings",icon:ee,state:r("/settings"),to:"/settings"}]}]}export{ue as component,xe as useDashboardChrome,re as useWorkspaceRailGroups};

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.