PageSourceSearch

https://sohamrecruit.com/_next/static/chunks/app/admin/analytics/page-003865450826c5c5.js

js sohamrecruit.com collected 2026-10-02 00:56:56 UTC 6,342 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="a67f7acf-b8a1-4afe-9bb3-5b1da381a862",e._sentryDebugIdIdentifier="sentry-dbid-a67f7acf-b8a1-4afe-9bb3-5b1da381a862")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1093],{2257:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>h});var t=a(95155),l=a(12115),r=a(97086),i=a(27529),n=a(51159),c=a(73321),d=a(19215),o=a(13342),m=a(51268);let x=[{value:"24h",label:"Last 24 hours"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"all",label:"All time"}];function u({rows:e,labelKey:s}){let a=Math.max(1,...e.map(e=>Number(e.views)));return(0,t.jsx)("ul",{className:"space-y-1.5",children:e.map((e,l)=>{let r=String(e[s]),i=Number(e.views);return(0,t.jsxs)("li",{className:"flex items-center gap-2 text-sm",children:[(0,t.jsx)("span",{className:"w-40 shrink-0 truncate text-gray-700",title:r,children:r}),(0,t.jsx)("span",{className:"relative flex-1 h-4 rounded bg-gray-100 overflow-hidden",children:(0,t.jsx)("span",{className:"absolute inset-y-0 left-0 bg-navy/70 rounded",style:{width:`${i/a*100}%`}})}),(0,t.jsx)("span",{className:"w-12 shrink-0 text-right tabular-nums text-gray-600",children:i})]},l)})})}function h(){let e=(0,c.useRouter)(),{user:s,loading:a}=(0,n.A)(),{toast:h,show:y,dismiss:p}=(0,d.d)(),[g,f]=(0,l.useState)("7d"),[b,j]=(0,l.useState)(null),[N,w]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(!a){if(!s)return void e.push("/auth/login");"super_admin"!==s.role&&e.push("/dashboard")}},[a,s,e]);let v=(0,l.useCallback)(async()=>{w(!0);try{j(await i.ws.stats(g))}catch(e){y((0,m.Q)(e,"Failed to load analytics"),"error")}finally{w(!1)}},[g,y]);return(0,l.useEffect)(()=>{s?.role==="super_admin"&&v()},[s,v]),(0,t.jsx)(r.A,{children:(0,t.jsxs)("div",{className:"p-4 md:p-6 max-w-4xl space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,t.jsx)(o.A,{size:18,className:"text-gray-400"})," Site analytics"]}),(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"Cookieless page views — humans only (bots excluded). No cookies, no PII."})]}),(0,t.jsx)("select",{value:g,onChange:e=>f(e.target.value),className:"input w-44","data-testid":"analytics-window",children:x.map(e=>(0,t.jsx)("option",{value:e.value,children:e.label},e.value))})]}),h&&(0,t.jsx)(d.y,{message:h.message,type:h.type,onDismiss:p}),N&&!b?(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"Loading…"}):b?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"card","data-testid":"analytics-total",children:[(0,t.jsx)("p",{className:"text-xs uppercase tracking-wide text-gray-400",children:"Total views"}),(0,t.jsx)("p",{className:"text-3xl font-semibold text-navy",children:b.totalViews.toLocaleString()})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"card space-y-3",children:[(0,t.jsxs)("h2",{className:"text-sm font-medium text-gray-700",children:["Top referrers ",(0,t.jsx)("span",{className:"text-gray-400 font-normal",children:"— where traffic comes from"})]}),0===b.topReferrers.length?(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"No external referrers yet (all direct)."}):(0,t.jsx)(u,{rows:b.topReferrers,labelKey:"host"})]}),(0,t.jsxs)("div",{className:"card space-y-3",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-gray-700",children:"Top pages"}),0===b.topPaths.length?(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"No views in this window."}):(0,t.jsx)(u,{rows:b.topPaths,labelKey:"path"})]}),(0,t.jsxs)("div",{className:"card space-y-3",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-gray-700",children:"Top countries"}),0===b.topCountries.length?(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"No country data (site not behind a geo-aware CDN)."}):(0,t.jsx)(u,{rows:b.topCountries,labelKey:"country"})]}),(0,t.jsxs)("div",{className:"card space-y-3",children:[(0,t.jsx)("h2",{className:"text-sm font-medium text-gray-700",children:"Daily views"}),0===b.daily.length?(0,t.jsx)("p",{className:"text-sm text-gray-400",children:"No views in this window."}):(0,t.jsx)(u,{rows:b.daily.map(e=>({...e})),labelKey:"day"})]})]})]}):null]})})}},3461:(e,s,a)=>{Promise.resolve().then(a.bind(a,2257))},19215:(e,s,a)=>{"use strict";a.d(s,{d:()=>o,y:()=>d});var t=a(95155),l=a(12115),r=a(40980),i=a(52484),n=a(62791),c=a(33210);function d({message:e,type:s,onDismiss:a}){return(0,l.useEffect)(()=>{let e=setTimeout(a,4e3);return()=>clearTimeout(e)},[a]),(0,t.jsxs)("div",{className:(0,r.cn)("flex items-start gap-3 rounded-xl border px-4 py-3 text-sm shadow-sm","success"===s?"border-green-100 bg-green-50 text-green-800":"border-red-100 bg-red-50 text-red-800"),children:["success"===s?(0,t.jsx)(i.A,{size:16,className:"mt-0.5 shrink-0 text-green-600"}):(0,t.jsx)(n.A,{size:16,className:"mt-0.5 shrink-0 text-red-500"}),(0,t.jsx)("span",{className:"flex-1",children:e}),(0,t.jsx)("button",{onClick:a,"aria-label":"Dismiss",title:"Dismiss",className:"shrink-0 opacity-50 hover:opacity-100",children:(0,t.jsx)(c.A,{size:14})})]})}function o(){let[e,s]=(0,l.useState)(null);return{toast:e,show:(0,l.useCallback)((e,a="success")=>s({message:e,type:a}
1),[]),dismiss:(0,l.useCallback)(()=>s(null),[])}}},51268:(e,s,a)=>{"use strict";a.d(s,{Q:()=>l});var t=a(27529);function l(e,s){if(e instanceof t.hD){let s="string"==typeof e.data?.message?e.data.message.trim():"";if(s)return s;if(e.message&&!r.test(e.message))return e.message}return s}let r=/^[a-z0-9]+(?:_[a-z0-9]+)*$/},52484:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},62791:(e,s,a)=>{"use strict";a.d(s,{A:()=>t});let t=(0,a(78340).A)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])}},e=>{e.O(0,[8500,8437,9060,2917,7529,7086,9793,8441,2209,7358],()=>e(e.s=3461)),_N_E=e.O()}]);

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.