PageSourceSearch

https://shaon.net/_next/static/chunks/pages/user/analytics/profile-5386f1a1dc34e48b.js

js shaon.net collected 2026-09-25 22:49:44 UTC 11,569 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9358],{439:(e,l,t)=>{"use strict";t.r(l),t.d(l,{default:()=>b});var a=t(37876),n=t(77328),r=t.n(n),i=t(14232),s=t(2171),o=t(21639),d=t(11023),c=t(16495),u=t(83872);let A=e=>{let{selectedPeriod:l,handleTimeChange:t}=e;return(0,a.jsx)(d.A,{width:"w-36",position:"right",dropdownButton:(0,a.jsx)(o.Ay.CarbonOutline,{small:!0,iconRight:(0,a.jsx)(u.ChevronDownIcon,{size:16}),children:"Last ".concat(l.label)}),children:c.TIME_RANGE.map((e,n)=>(0,a.jsx)("li",{className:"list-none",children:(0,a.jsxs)(d.e.Item,{onClick:()=>t(c.TIME_RANGE[n]),selectedOption:e.label===l.label,children:["Last ","".concat(e.label)]})},"".concat(e.label,"-").concat(e.duration)))})};var x=t(28769),E=t(48230),S=t.n(E),m=t(54587),h=t.n(m),p=t(89311);let g=e=>{let{title:l="",subtext:t="",cta:n=null,children:r,className:i="",headerClassName:s="",padding:o="p-4",spacing:d="gap-4",inlineHeader:c=!0}=e;return(0,a.jsxs)("div",{className:"flex flex-col ".concat(d," bg-gray-00 border border-gray-200 rounded-2xl ").concat(i," ").concat(o),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 border-b border-gray-200 ".concat(s),children:[(0,a.jsxs)("div",{className:"flex gap-0.5 md:gap-1.5 ".concat(c?"md:items-center md:flex-row flex-col":"flex-col"),children:[(0,a.jsx)(p.default.SemiBoldText,{children:l}),(null==t?void 0:t.length)?(0,a.jsx)(p.default.NormalText,{xs:!0,textColor:"text-gray-500",children:t}):null]}),n]}),r]})};var N=t(78964),T=t(34321),_=t(68827),L=t(87156),I=t(70657),f=t(94296),v=t(48187),C=t(34217);let O=c.ANALYTICS_EMPTY_STATE.NEW_FOLLOWERS,j=e=>{let{setError:l=()=>{}}=e,[t,n]=(0,i.useState)([]),[r,s]=(0,i.useState)(!1),{isLoggedIn:d}=(0,L.A)(),A=async()=>{var e,t,a,r,i;s(!0);try{let l=(0,x.A)(new Date,c.TIME_RANGE[0].duration).getTime(),a=new Date().getTime(),r=await T.S9.getDetails({entity:c.ANALYTICS_CONSTANTS.ENTITIES.PROFILE,type:c.ANALYTICS_KEYS.PROFILE_FOLLOWERS,startAt:l,endAt:a,limit:5});n(null==r||null==(t=r.data)||null==(e=t.data)?void 0:e.profiles)}catch(e){l((null==e||null==(i=e.response)||null==(r=i.data)||null==(a=r.error)?void 0:a.message)||_.A.GLOBAL.wrong)}finally{s(!1)}};return(0,i.useEffect)(()=>{d&&A()},[d]),(0,a.jsx)(g,{title:"New followers",padding:"p-0",headerClassName:"px-4 pt-4",className:"overflow-hidden",spacing:"gap-2",cta:(0,a.jsx)(o.Ay.CarbonOutline,{small:!0,as:S(),href:c.APP_PATHS.network,iconRight:(0,a.jsx)(u.ArrowRightIcon,{size:14}),onClick:()=>{I.A.capture(f.Ay.CLICKED_ON_SEE_ALL_ON_NEW_FOLLOWERS)},children:"See All"}),children:(0,a.jsxs)("div",{className:"flex flex-col overflow-hidden",children:[r||(null==t?void 0:t.length)?null:(0,a.jsx)(C.A.EmptyState,{title:O.title,description:O.description,icon:(0,a.jsx)(h(),{src:O.image,width:120,height:120,className:"dark:invert",alt:"empty-state"})}),!r||(null==t?void 0:t.length)?null==t?void 0:t.map(e=>(0,a.jsx)(N.A.HorizontalUserSearchCard,{user:e,className:" md:px-4 px-3 rounded-none py-2",clampHeadline:!1,lineClamp:"line-clamp-1",showTimeStamp:!0},"new-follower-".concat(e.id))):[,,,,,].fill(0).map((e,l)=>(0,a.jsx)(v.A.UserProfileHorizontalCardSkeleton,{flexGrow:!1,className:"px-4"},"new-follower-skeleton-".concat(l+1)))]})})},y=c.ANALYTICS_EMPTY_STATE.VISITORS,w=e=>{let{setError:l=()=>{}}=e,[t,n]=(0,i.useState)([]),[r,s]=(0,i.useState)(!1),{isLoggedIn:d}=(0,L.A)(),A=async()=>{var e,t,a,r,i;s(!0);try{let l=(0,x.A)(new Date,c.TIME_RANGE[0].duration).getTime(),a=new Date().getTime(),r=await T.S9.getDetails({entity:c.ANALYTICS_CONSTANTS.ENTITIES.PROFILE,type:c.ANALYTICS_KEYS.PROFILE_VIEWS,startAt:l,endAt:a,limit:5});n(null==r||null==(t=r.data)||null==(e=t.data)?void 0:e.profiles)}catch(e){l((null==e||null==(i=e.response)||null==(r=i.data)||null==(a=r.error)?void 0:a.message)||_.A.GLOBAL.wrong)}finally{s(!1)}};return(0,i.useEffect)(()=>{d&&A()},[d]),(0,a.jsx)(g,{title:"Viewed your profile",subtext:"(last 7 days)",padding:"p-0",spacing:"gap-2",headerClassName:"px-4 pt-4",className:"overflow-hidden",cta:(0,a.jsx)(o.Ay.CarbonOutline,{small:!0,as:S(),href:c.APP_PATHS.profileVisitors,iconRight:(0,a.jsx)(u.ArrowRightIcon,{size:14}),onClick:()=>{I.A.capture(f.Ay.CLICKED_ON_SEE_ALL_ON_VIEWED_YOUR_PROFILE)},children:"See All"}),children:(0,a.jsxs)("div",{className:"flex flex-col",children:[r||(null==t?void 0:t.length)?null:(0,a.jsx)(C.A.EmptyState,{title:y.title,de
1scription:y.description,icon:(0,a.jsx)(h(),{src:y.image,width:120,height:120,className:"dark:invert"})}),!r||(null==t?void 0:t.length)?null==t?void 0:t.map(e=>(0,a.jsx)(N.A.HorizontalUserSearchCard,{user:e,className:"md:px-4 px-3 rounded-none py-2",clampHeadline:!1,lineClamp:"line-clamp-1",showTimeStamp:!0},"new-follower-".concat(e.id))):[,,,,,].fill(0).map((e,l)=>(0,a.jsx)(v.A.UserProfileHorizontalCardSkeleton,{flexGrow:!1,className:"px-4"},"visitor-skeleton-".concat(l+1)))]})})};var P=t(4040),R=t(57994);let b=(0,t(47553).A)(function(){let e=(0,s.useSelector)(e=>{var l;return null==(l=e.AppData.appData)?void 0:l.published}),[l,t]=(0,i.useState)(""),[n,o]=(0,i.useState)(c.TIME_RANGE[1]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(r(),{children:(0,a.jsx)("title",{children:"Profile Analytics"})}),(0,a.jsxs)(R.A.CenterTop,{internalPage:!0,children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(R.A.BackButton,{}),(0,a.jsx)(R.A.PageHeading,{children:"Analytics"})]}),(0,a.jsx)(A,{selectedPeriod:n,handleTimeChange:e=>{o(e),I.A.capture(e.event)}})]}),(0,a.jsx)("div",{className:"w-full mt-14 box-border mb-20 lg:mb-0",children:(0,a.jsxs)("div",{className:"md:p-6 p-4 flex flex-col gap-6",children:[l&&e?(0,a.jsx)(p.default.ErrorText,{children:l}):null,(0,a.jsx)(P.A,{selectedPeriod:n,setError:t,entity:c.ANALYTICS_CONSTANTS.ENTITIES.PROFILE}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,a.jsx)(w,{setError:t}),(0,a.jsx)(j,{setError:t})]})]})})]})})},4040:(e,l,t)=>{"use strict";t.d(l,{A:()=>j});var a=t(37876),n=t(14232),r=t(28769),i=t(54587),s=t.n(i),o=t(38234),d=t(21941),c=t(34321),u=t(16495),A=t(68827),x=t(78669),E=t(77e3),S=t(82669);let m=e=>{let{setError:l=()=>{},tabs:t=[],children:i,onTabClick:s=()=>{},currentTab:o=u.ANALYTICS_KEYS.PROFILE_VIEWS,entity:d=u.ANALYTICS_CONSTANTS.ENTITIES.PROFILE,selectedPeriod:m=u.TIME_RANGE[1],rightPanel:h=!1,currentCount:p=null}=e,[g,N]=(0,n.useState)(null),[T,_]=(0,n.useState)(!1),L=async()=>{var e,t,a,n;_(!0);try{let l=(0,r.A)(new Date,m.duration).getTime(),t=new Date().getTime(),a=await c.S9.getStats(d,l,t);N(null==a||null==(e=a.data)?void 0:e.data)}catch(e){l((null==e||null==(n=e.response)||null==(a=n.data)||null==(t=a.error)?void 0:t.message)||A.A.GLOBAL.wrong)}finally{_(!1)}};(0,n.useEffect)(()=>{L()},[d,m]);let I=t.length?t.map(e=>{var l,t;return{children:(0,a.jsx)(x.A,{label:u.analyticsKeysDisplayName[e],data:{...null==g?void 0:g[e],current:e!==o||!p||(null==g||null==(l=g[e])?void 0:l.current)?null==g||null==(t=g[e])?void 0:t.current:p},medium:!h,alignment:"items-start",loading:T}),label:"",link:e,isLink:!1}}):[];return(0,a.jsx)("div",{className:"flex flex-col gap-6",children:(0,a.jsxs)("div",{className:"flex flex-col gap-6 relative ".concat(h?"":"p-4 pt-1.5 rounded-2xl border border-gray-200 bg-gray-00"," "),children:[(0,a.jsx)(E.A,{navTabs:I,currentNavTab:o,marginAuto:!1,onClick:s,containerPadding:"",selectedBorderColor:"border-gray-1k",spacing:h?"gap-4":"md:gap-10 gap-6",buttonClassName:h?"pl-0 pr-4 pb-2":"pr-6 pl-2"}),i,T?(0,a.jsx)("div",{className:"absolute top-4 right-4",children:(0,a.jsx)(S.A,{})}):null]})})};var h=t(89311),p=t(63819),g=t(94296),N=t(70657),T=t(34217),_=t(11397);let L={[u.ANALYTICS_KEYS.PROFILE_VIEWS]:g.Ay.CLICKED_ON_PROFILE_VIEWS_STATS_ON_ANALYTICS,[u.ANALYTICS_KEYS.PROFILE_FOLLOWERS]:g.Ay.CLICKED_ON_NEW_FOLLOWERS_STATS_ON_ANALYTICS},I={[u.ANALYTICS_KEYS.PROFILE_VIEWS]:g.Ay.CLICKED_ON_PROFILE_VIEWS_STATS_ON_ANALYTICS_FROM_RIGHT_PANEL,[u.ANALYTICS_KEYS.PROFILE_FOLLOWERS]:g.Ay.CLICKED_ON_NEW_FOLLOWERS_STATS_ON_ANALYTICS_FROM_RIGHT_PANEL},f=[u.ANALYTICS_KEYS.PROFILE_VIEWS,u.ANALYTICS_KEYS.PROFILE_FOLLOWERS],v={[u.ANALYTICS_KEYS.PROFILE_VIEWS]:"View",[u.ANALYTICS_KEYS.PROFILE_FOLLOWERS]:"Follower"},C=["Fetching fresh stats…","Fetching facts and figures…","Digging through data mines…","Crunching numbers..","Math is hard..."],O=u.ANALYTICS_EMPTY_STATE.DEFAULT,j=e=>{let{selectedPeriod:l=u.TIME_RANGE[0],setError:t=()=>{}
1,entity:i=u.ANALYTICS_CONSTANTS.ENTITIES.PROFILE,rightPanel:x=!1}=e,[E,g]=(0,n.useState)(!0),[j,y]=(0,n.useState)(u.ANALYTICS_KEYS.PROFILE_VIEWS),[w,P]=(0,n.useState)({}),[R,b]=(0,n.useState)({}),[F,Y]=(0,n.useState)(!0),D=async function(){var e,a,n,s,o;let d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u.ANALYTICS_KEYS.PROFILE_VIEWS;if(null==R||null==(a=R[l.duration])||null==(e=a[d])||!e.length){g(!0);try{let e=(0,r.A)(new Date,l.duration).getTime(),t=new Date().getTime(),a=await c.S9.getMetrics({entity:i,type:d,startAt:e,endAt:t});b(e=>{var t,n,r;return{...e,[l.duration]:{...null==e?void 0:e[l.duration],[d]:null==a||null==(r=a.data)||null==(n=r.data)||null==(t=n.results)?void 0:t[d]}}}),P(e=>{var l,t;return{...e,[d]:null==a||null==(t=a.data)||null==(l=t.data)?void 0:l.totalCount}}),setTimeout(()=>{Y(!1)},500)}catch(e){t((null==e||null==(o=e.response)||null==(s=o.data)||null==(n=s.error)?void 0:n.message)||A.A.GLOBAL.wrong)}finally{g(!1)}}};(0,n.useEffect)(()=>{D(j)},[j,l]);let k=(0,n.useMemo)(()=>{var e,t;return null==(t=R[l.duration])||null==(e=t[j])?void 0:e.filter(e=>new Date(e.x)<=new Date)},[j,R,l]),W=(0,n.useMemo)(()=>C[Math.floor(Math.random()*C.length)]);return(0,n.useEffect)(()=>{var e,t;(null==R||null==(t=R[l.duration])||null==(e=t[j])?void 0:e.length)||Y(!0)},[j,R,l]),(0,a.jsxs)(m,{setError:t,tabs:f,currentTab:j,entity:i,onTabClick:e=>{N.A.capture(x?I[e.link]:L[e.link]),y(e.link)},selectedPeriod:l,rightPanel:x,currentCount:null==w?void 0:w[j],children:[E?(0,a.jsxs)("div",{className:"flex flex-col gap-6 items-center justify-center ".concat(x?"h-37.5":"h-70"),children:[(0,a.jsx)(S.A,{}),(0,a.jsx)(h.default.NormalText,{textColor:"text-gray-500",suppressHydrationWarning:!0,xs:x,sm:!x,children:W})]}):null,(null==k?void 0:k.length)||E?null:(0,a.jsx)("div",{className:"flex items-center justify-center ".concat(x?"h-37.5":"h-70"),children:(0,a.jsx)(T.A.EmptyState,{title:O.title,description:O.description,icon:(0,a.jsx)(s(),{src:O.image,width:x?80:120,height:x?80:120,className:"dark:invert"})})}),!E&&(null==k?void 0:k.length)?(0,a.jsx)(_.A,{chartLabel:"Views",height:x?"max-h-70":"h-70",data:null==k?void 0:k.slice(-1*l.duration),margin:{left:12*!x,right:12,top:4},xAxisProps:{tickFormatter:e=>e&&"auto"!==e?o.A.getFormattedDate(new Date(e||void 0),"dd"):"loading"},yAxisProps:{tickFormatter:e=>(0,d.ZV)(e)},showTooltip:!0,labelFormatter:(e,l)=>{var t;let n=null==l||null==(t=l[0])?void 0:t.value;return(0,a.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-0.5",children:[(0,a.jsx)(h.default.SemiBoldText,{xs:!0,textColor:"text-gray-00",children:n||0}),(0,a.jsx)(h.default.NormalText,{xs:!0,textColor:"text-gray-00",children:p.default.addPlural({word:v[j],count:n,considerZero:!0})})]}),e?(0,a.jsx)(h.default.SemiBoldText,{xxs:!0,textColor:"text-gray-400",className:"uppercase",children:o.A.getFormattedDate(new Date(e),"EEE • MMM dd, yyyy")}):null]})},areaProps:{animationDuration:F?500:150}}):null]})}},55508:(e,l,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/analytics/profile",function(){return t(439)}])}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=55508)),_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.