1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12786],{12786:function(e,s,l){l.r(s);var t=l(65724),a=l(22273),r=l(80710),i=l(34102),n=l(68125),o=l(2512),d=l(28266),c=l(43834),x=l(62134),h=l(76205);let m={Verified:e=>{let{className:s="w-[18px] h-[18px]"}=e;return(0,t.jsx)("svg",{viewBox:"0 0 22 22",fill:"currentColor",className:s,children:(0,t.jsx)("path",{d:"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z"})})},MoreHorizontal:e=>{let{className:s="w-[18px] h-[18px]"}=e;return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:s,children:(0,t.jsx)("path",{d:"M3 12c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2zm9 2c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm7 0c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})})},Promoted:e=>{let{className:s="w-4 h-4"}=e;return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:s,children:(0,t.jsx)("path",{d:"M19.498 3h-15c-1.381 0-2.5 1.12-2.5 2.5v13c0 1.38 1.119 2.5 2.5 2.5h15c1.381 0 2.5-1.12 2.5-2.5v-13c0-1.38-1.119-2.5-2.5-2.5zm-3.502 12h-2v-3.59l-5.293 5.3-1.414-1.42L12.581 10H8.996V8h7v7z"})})}},u=e=>{if(!e)return"";let s=e.trim().replace(/'::text/g,"").replace(/::text/g,"").replace(/^['"]|['"]$/g,"").replace(/^'?https:\/([^/])/,"https://$1"),l="SzuSp5K29QFsFnrI2fDbPQ";return l&&(s=s.replace(/^https?:\/\/(www\.)?instaloops\.com\/images\//,"https://imagedelivery.net/".concat(l,"/"))),s},p=()=>(0,t.jsxs)("aside",{"aria-label":"Upgrade your plan",role:"complementary",className:"mb-4 rounded-2xl bg-[rgb(247,249,249)] px-4 py-3",children:[(0,t.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,t.jsx)("h2",{className:"text-[20px] font-extrabold leading-6 text-[rgb(15,20,25)]",children:"Upgrade your plan"}),(0,t.jsx)("span",{className:"rounded bg-brand px-1.5 py-0.5 text-[12px] font-bold text-white",children:"14 days free"})]}),(0,t.jsx)("p",{className:"mb-3 text-[15px] leading-5 text-[rgb(15,20,25)]",children:"Unlimited communities, courses and live calls â and a smaller cut of every sale as you grow."}
1),(0,t.jsx)(n.default,{href:"/pricing",className:"hover:bg-[#0b0b0b]/85 inline-flex items-center justify-center rounded-full bg-[#0b0b0b] px-4 py-[7px] text-[15px] font-bold text-white transition-colors",children:"See plans"})]}),g=e=>{let{trendingPosts:s,isDataLoading:l}=e,[r,d]=(0,o.useState)(!0),c=(0,o.useMemo)(()=>s?s.slice(0,3).map((e,s)=>{var l,t;return{id:e.post_id||"news-".concat(s),title:e.title||(null===(l=e.description)||void 0===l?void 0:l.substring(0,80))||"Trending Post",timeAgo:(0,x.Sy)(e.created_at),category:"Trending",postCount:e.view_count||10*(e.love_count||0)||500,avatars:[(null===(t=e.posted_by)||void 0===t?void 0:t.profile_image)||""].filter(Boolean)}}):[],[s]);return r?(0,t.jsxs)("section",{className:"mb-4 overflow-hidden rounded-2xl bg-[rgb(247,249,249)]",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,t.jsx)("h2",{className:"text-[20px] font-extrabold text-[rgb(15,20,25)]",children:"Today's News"}),(0,t.jsx)("button",{onClick:()=>d(!1),className:"-m-2 rounded-full p-2 transition-colors hover:bg-gray-100","aria-label":"Close",children:(0,t.jsx)(a.Z,{className:"h-5 w-5 text-[rgb(15,20,25)]"})})]}),null!=l&&l?(0,t.jsx)("div",{className:"space-y-4 px-4 pb-4",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"animate-pulse",children:[(0,t.jsx)("div",{className:"mb-2 h-4 w-3/4 rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-1/2 rounded bg-gray-100"})]},e))}):c.length>0?(0,t.jsx)("div",{className:"divide-y divide-gray-100",children:c.map(e=>(0,t.jsxs)(n.default,{href:"/post/".concat(e.id),className:"block px-4 py-3 transition-colors hover:bg-gray-50",children:[(0,t.jsx)("h3",{className:"mb-1 line-clamp-2 text-[15px] font-bold leading-5 text-[rgb(15,20,25)]",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[e.avatars.length>0&&(0,t.jsx)("div",{className:"flex -space-x-2",children:e.avatars.slice(0,3).map((e,s)=>(0,t.jsx)("div",{className:"h-6 w-6 overflow-hidden rounded-full border-2 border-white bg-gray-200",children:e&&(0,t.jsx)(i.default,{src:u(e),alt:"",width:24,height:24,className:"h-full w-full object-cover"})},s))}),(0,t.jsxs)("span",{className:"text-[13px] text-[rgb(83,100,113)]",suppressHydrationWarning:!0,children:[e.timeAgo," \xb7 ",e.category," \xb7"," ",(0,x.CZ)(e.postCount)," posts"]})]})]},e.id))}):(0,t.jsx)("div",{className:"px-4 pb-4 text-[15px] text-[rgb(83,100,113)]",children:"No trending news at the moment."})]}):null},b=e=>{let{hashtags:s,isDataLoading:l}=e,a=null!=l&&l,r=(0,o.useMemo)(()=>s&&0!==s.length?s.map((e,s)=>({id:e.id||"trend-".concat(s),category:e.category||"Trending",title:e.name||e.hashtag||"#Trend".concat(s+1),postCount:e.count||e.post_count||0})):[],[s]);return a||0!==r.length?(0,t.jsxs)("section",{"aria-labelledby":"trends-heading",role:"region",className:"mb-4 overflow-hidden rounded-2xl bg-[rgb(247,249,249)]",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)("h2",{id:"trends-heading",className:"text-[20px] font-extrabold text-[rgb(15,20,25)]",children:"What's happening"})}),a?(0,t.jsx)("div",{className:"space-y-4 px-4 pb-4",children:[1,2,3,4].map(e=>(0,t.jsxs)("div",{className:"animate-pulse",children:[(0,t.jsx)("div",{className:"mb-1 h-3 w-1/3 rounded bg-gray-100"}),(0,t.jsx)("div",{className:"mb-1 h-4 w-2/3 rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-1/4 rounded bg-gray-100"})]},e))}):(0,t.jsxs)("div",{children:[r.map(e=>(0,t.jsxs)(n.default,{href:"/search?q=".concat(encodeURIComponent(e.title)),className:"flex items-start justify-between px-4 py-3 transition-colors hover:bg-gray-50",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("span",{className:"block text-[13px] text-[rgb(83,100,113)]",children:e.category}),(0,t.jsx)("span",{className:"block text-[15px] font-bold text-[rgb(15,20,25)]",children:e.title}),e.postCount&&(0,t.jsxs)("span",{className:"block text-[13px] text-[rgb(83,100,113)]",children:[(0,x.CZ)(e.postCount)," posts"]}),e.isPromoted&&(0,t.jsxs)("div",{className:"mt-0.5 flex items-center gap-1 text-[13px] text-[rgb(83,100,113)]",children:[(0,t.jsx)(m.Promoted,{className:"h-4 w-4"}),(0,t.jsxs)("span",{children:["Promoted by ",e.promotedBy]})]})]}),(0,t.jsx)("button",{onClick:e=>{e.preventDefault(),e.stopPropagation()},className:"group -m-2 rounded-full p-2 transition-colors hover:bg-brand/10","aria-label":"More options",children:(0,t.jsx)(m.MoreHorizontal,{className:"h-[18px] w-[18px] text-[rgb(83,100,113)] group-hover:text-brand"})})]},e.id)),(0,t.jsx)(n.default,{href:"/explore",className:"block px-4 py-3 text-[15px] text-brand transition-colors hover:bg-gray-50",children:"Show more"})]})]}):null},f=e=>{var s;let{suggestions:l,isDataLoading:a}=e,{communityUser:x,session:p}=(0,c.a)(),[g,b]=(0,o.useState)({}),[f,v]=(0,o.useState)({}),[j,N]=(0,o.useState)({}),w=(null==p?void 0:null===(s=p.user)||void 0===s?void 0:s.id)||(null==x?void 0:x.user_id
1),y=(0,o.useMemo)(()=>l?l.filter(e=>e.user_id!==w).slice(0,3):[],[l,w]);(0,o.useEffect)(()=>{if(0===y.length)return;let e={};y.forEach(s=>{var l;e[s.user_id]=null!==(l=s.isFollowing)&&void 0!==l&&l}),b(e)},[y]);let k=(0,o.useCallback)(async e=>{if(!w||f[e])return;v(s=>({...s,[e]:!0}));let s=g[e];b(l=>({...l,[e]:!s}));try{let l=await fetch("/api/v2/community/users/follow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})});if(!l.ok)throw Error("Failed to follow");let t=await l.json();if(!t.success)throw Error(t.message||"");b(l=>{var a,r;return{...l,[e]:null!==(r=null===(a=t.data)||void 0===a?void 0:a.isFollowing)&&void 0!==r?r:!s}})}catch(l){b(l=>({...l,[e]:s})),d.Am.error(s?"Couldn't unfollow":"Couldn't follow",{description:"Check your connection and try again."})}finally{v(s=>({...s,[e]:!1}))}},[w,g,f]);return(0,t.jsxs)("aside",{"aria-label":"Who to follow",role:"complementary",className:"mb-4 overflow-hidden rounded-2xl bg-[rgb(247,249,249)]",children:[(0,t.jsx)("div",{className:"px-4 py-3",children:(0,t.jsx)("h2",{className:"text-[20px] font-extrabold text-[rgb(15,20,25)]",children:"Who to follow"})}),null!=a&&a?(0,t.jsx)("div",{className:"space-y-4 px-4 pb-4",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"flex animate-pulse items-center gap-3",children:[(0,t.jsx)("div",{className:"h-10 w-10 rounded-full bg-gray-200"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"mb-1 h-4 w-24 rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-16 rounded bg-gray-100"})]}),(0,t.jsx)("div",{className:"h-8 w-20 rounded-full bg-gray-200"})]},e))}):y.length>0?(0,t.jsxs)("ul",{role:"list",children:[y.map(e=>{var s;let l="".concat(e.first_name||""," ").concat(e.last_name||"").trim()||"Anonymous",a=e.user_name||"user",o=u(e.profile_image),d=e.is_verified||(e.level||0)>=9,c=g[e.user_id],x=f[e.user_id],p=j[e.user_id];return(0,t.jsx)("li",{className:"px-4 py-3 transition-colors hover:bg-gray-50",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(n.default,{href:"/@".concat(a),className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"relative h-10 w-10 flex-shrink-0 overflow-hidden rounded-full bg-gradient-to-br from-sky-400 to-blue-500",children:o&&!p?(0,t.jsx)(i.default,{src:o,alt:l,width:40,height:40,className:"absolute inset-0 h-full w-full object-cover",onError:()=>N(s=>({...s,[e.user_id]:!0}))}):(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center text-sm font-bold text-white",children:(null===(s=l[0])||void 0===s?void 0:s.toUpperCase())||"?"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(n.default,{href:"/@".concat(a),className:"truncate text-[15px] font-bold text-[rgb(15,20,25)] hover:underline",children:l}),d&&(0,t.jsx)(m.Verified,{className:"h-[18px] w-[18px] flex-shrink-0 text-brand"})]}),(0,t.jsxs)(n.default,{href:"/@".concat(a),className:"block truncate text-[15px] text-[rgb(83,100,113)]",children:["@",a]})]}),w&&(0,t.jsx)("button",{onClick:()=>k(e.user_id),disabled:x,className:(0,h.cn)("min-w-[80px] rounded-full px-4 py-1.5 text-sm font-bold transition-all",c?"border border-gray-300 bg-transparent text-[#0b0b0b] hover:border-red-300 hover:bg-red-50 hover:text-red-600":"hover:bg-[#0b
10b0b]/85 bg-[#0b0b0b] text-white"),children:x?(0,t.jsx)(r.Z,{className:"mx-auto h-4 w-4 animate-spin"}):c?"Following":"Follow"})]})},e.user_id)}),(0,t.jsx)(n.default,{href:"/explore?tab=people",className:"block px-4 py-3 text-[15px] text-brand transition-colors hover:bg-gray-50",children:"Show more"})]}):(0,t.jsx)("div",{className:"px-4 pb-4 text-[15px] text-[rgb(83,100,113)]",children:"No suggestions available."})]})},v=e=>{let{trendingPosts:s,isDataLoading:l}=e,[a,r]=(0,o.useState)({}),c=null!=l&&l,h=(0,o.useMemo)(()=>s?s.slice(0,5).map(e=>{var s,l,t;let a="".concat((null===(s=e.posted_by)||void 0===s?void 0:s.first_name)||""," ").concat((null===(l=e.posted_by)||void 0===l?void 0:l.last_name)||"").trim()||"Community",r=e.description||"",i=r.split(/\s+/).length;return{id:e.post_id,title:e.title||r.substring(0,100)||"Untitled Post",sourceName:a,sourceIcon:u(null===(t=e.posted_by)||void 0===t?void 0:t.profile_image),thumbnailUrl:u(e.image_url),readTime:"".concat(Math.max(1,Math.ceil(i/200)),"m read"),likeCount:e.love_count||0,commentCount:e.comment_count||0}}):[],[s]),m=(0,o.useCallback)(e=>{r(s=>({...s,[e]:!s[e]})),fetch("/api/v2/community/posts/".concat(e,"/save"),{method:"POST"}).then(e=>{if(!e.ok)throw Error("Save failed")}).catch(()=>{r(s=>({...s,[e]:!s[e]})),d.Am.error("Couldn't save the post")})},[]);return c||0!==h.length?(0,t.jsxs)("section",{className:"mb-4 overflow-hidden rounded-2xl bg-[rgb(247,249,249)]",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,t.jsx)(n.default,{href:"/notifications",className:"text-[17px] font-semibold text-[rgb(15,20,25)] hover:underline",children:"Up next"}),(0,t.jsx)(n.default,{href:"/notifications",className:"text-[13px] font-medium text-[rgb(83,100,113)] transition-colors hover:text-[rgb(15,20,25)]",children:"See all"})]}),c?(0,t.jsx)("div",{className:"space-y-3 px-4 pb-3",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"flex animate-pulse gap-3",children:[(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"mb-2 h-3 w-20 rounded bg-gray-100"}),(0,t.jsx)("div",{className:"mb-1 h-4 w-full rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-24 rounded bg-gray-100"})]}),(0,t.jsx)("div",{className:"h-[32px] w-[60px] flex-shrink-0 rounded bg-gray-100"})]},e))}):(0,t.jsx)("div",{className:"divide-y divide-gray-50",children:h.map(e=>{var s,l;return(0,t.jsxs)(n.default,{href:"/post/".concat(e.id),className:"flex flex-col gap-2 px-4 py-3 transition-colors hover:bg-gray-50/80",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[e.sourceIcon&&(0,t.jsx)("div",{className:"h-4 w-4 flex-shrink-0 overflow-hidden rounded-sm bg-gray-100",children:(0,t.jsx)(i.default,{src:e.sourceIcon,alt:"",width:16,height:16,className:"h-full w-full object-cover"})}),(0,t.jsx)("span",{className:"truncate text-[13px] text-[rgb(83,100,113)]",children:e.sourceName})]}),(0,t.jsx)("button",{onClick:s=>{s.preventDefault(),s.stopPropagation(),m(e.id)},className:"-m-1 flex-shrink-0 rounded-full p-1 transition-colors hover:bg-gray-100","aria-label":"Bookmark",children:(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:"h-4 w-4 text-[rgb(83,100,113)]",children:a[e.id]?(0,t.jsx)("path",{fill:"currentColor",d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"}):(0,t.jsx)("path",{fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})})})]}),(0,t.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsx)("h3",{className:"line-clamp-2 text-[15px] font-medium leading-5 text-[rgb(15,20,25)]",children:e.title}),(0,t.jsxs)("div",{className:"mt-1 flex items-center gap-1",children:[(0,t.jsx)("span",{className:"text-[13px] text-[rgb(83,100,113)]",children:e.readTime}),(null!==(s=e.likeCount)&&void 0!==s?s:0)>0&&(0,t.jsxs)("span",{className:"text-[13px] text-[rgb(83,100,113)]",children:[" ","\xb7 ",(0,x.CZ)(e.likeCount)," likes"]}
1),(null!==(l=e.commentCount)&&void 0!==l?l:0)>0&&(0,t.jsxs)("span",{className:"text-[13px] text-[rgb(83,100,113)]",children:[" ","\xb7 ",e.commentCount," comments"]})]})]}),e.thumbnailUrl&&(0,t.jsx)("div",{className:"h-[32px] w-[60px] flex-shrink-0 overflow-hidden rounded-sm bg-gray-100",children:(0,t.jsx)(i.default,{src:e.thumbnailUrl,alt:"",width:60,height:32,className:"h-full w-full object-cover"})})]})]},e.id)})})]}):null},j=e=>{var s;let{suggestions:l,isDataLoading:a}=e,{session:x,communityUser:p}=(0,c.a)(),[g,b]=(0,o.useState)({}),[f,v]=(0,o.useState)({}),j=(null==x?void 0:null===(s=x.user)||void 0===s?void 0:s.id)||(null==p?void 0:p.user_id),N=null!=a&&a,w=(0,o.useMemo)(()=>l?l.filter(e=>e.user_id!==j).slice(3,8).map((e,s)=>{var l;return{rank:s+1,userId:e.user_id,name:"".concat(e.first_name||""," ").concat(e.last_name||"").trim()||"Anonymous",subtitle:e.bio||e.user_name||"".concat(e.first_name||"","'s Newsletter"),avatarUrl:u(e.profile_image),isVerified:e.is_verified||(e.level||0)>=9,isFollowing:null!==(l=e.isFollowing)&&void 0!==l&&l}}):[],[l,j]);(0,o.useEffect)(()=>{if(0===w.length)return;let e={};w.forEach(s=>{var l;e[s.userId]=null!==(l=s.isFollowing)&&void 0!==l&&l}),b(e)},[w]);let y=(0,o.useCallback)(async e=>{if(!j||f[e])return;v(s=>({...s,[e]:!0}));let s=g[e];b(l=>({...l,[e]:!s}));try{let l=await fetch("/api/v2/community/users/follow",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:e})});if(!l.ok)throw Error("Failed");let t=await l.json();if(!t.success)throw Error(t.message||"");b(l=>{var a,r;return{...l,[e]:null!==(r=null===(a=t.data)||void 0===a?void 0:a.isFollowing)&&void 0!==r?r:!s}})}catch(l){b(l=>({...l,[e]:s})),d.Am.error(s?"Couldn't unfollow":"Couldn't follow",{description:"Check your connection and try again."})}finally{v(s=>({...s,[e]:!1}))}},[j,g,f]);return N||0!==w.length?(0,t.jsxs)("section",{className:"mb-4 overflow-hidden rounded-2xl bg-[rgb(247,249,249)]",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 py-3",children:[(0,t.jsx)(n.default,{href:"/explore?tab=people",className:"text-[17px] font-semibold text-[rgb(15,20,25)] hover:underline",children:"New Bestsellers"}),(0,t.jsx)(n.default,{href:"/explore?tab=people",className:"text-[13px] font-medium text-[rgb(83,100,113)] transition-colors hover:text-[rgb(15,20,25)]",children:"See all"})]}),N?(0,t.jsx)("div",{className:"space-y-3 px-4 pb-3",children:[1,2,3].map(e=>(0,t.jsxs)("div",{className:"flex animate-pulse items-center gap-3",children:[(0,t.jsx)("div",{className:"h-4 w-5 rounded bg-gray-100"}),(0,t.jsx)("div",{className:"h-10 w-10 rounded-full bg-gray-100"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("div",{className:"mb-1 h-4 w-24 rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-16 rounded bg-gray-100"})]}),(0,t.jsx)("div",{className:"h-7 w-20 rounded-full bg-gray-100"})]},e))}):(0,t.jsx)("div",{children:w.map(e=>{var s;let l=g[e.userId],a=f[e.userId];return(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-sm px-4 py-2.5 transition-colors hover:bg-gray-50/80",children:[(0,t.jsx)("span",{className:"w-4 flex-shrink-0 text-center text-[12px] font-bold uppercase tracking-wide text-[rgb(15,20,25)]",children:e.rank}),(0,t.jsx)(n.default,{href:"/@".concat(e.name.toLowerCase().replace(/\s+/g,"")),className:"flex-shrink-0",children:(0,t.jsx)("div",{className:"h-10 w-10 overflow-hidden rounded-full bg-gradient-to-br from-sky-100 to-blue-200",children:e.avatarUrl?(0,t.jsx)(i.default,{src:e.avatarUrl,alt:e.name,width:40,height:40,className:"h-full w-full object-cover"}):(0,t.jsx)("div",{className:"flex h-full w-full items-center justify-center text-sm font-bold text-sky-600",children:(null===(s=e.name[0])||void 0===s?void 0:s.toUpperCase())||"?"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",style:{minWidth:"50%"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(n.default,{href:"/@".concat(e.name.toLowerCase().replace(/\s+/g,"")),className:"truncate text-[15px] font-medium text-[rgb(15,20,25)] hover:underline",children:e.name}),e.isVerified&&(0,t.jsx)(m.Verified,{className:"h-4 w-4 flex-shrink-0 text-brand"})]}),(0,t.jsx)("span",{className:"block truncate text-[13px] text-[rgb(83,100,113)]",children:e.subt
1itle})]}),j&&(0,t.jsx)("button",{onClick:()=>y(e.userId),disabled:a,className:(0,h.cn)("flex-shrink-0 rounded-full px-3 py-1 text-[13px] font-semibold transition-all",l?"border border-gray-300 bg-transparent text-[#0b0b0b] hover:border-red-300 hover:text-red-600":"border border-[#0b0b0b] bg-transparent text-[#0b0b0b] hover:bg-[#0b0b0b] hover:text-white",a&&"cursor-not-allowed opacity-50"),children:a?(0,t.jsx)(r.Z,{className:"mx-auto h-3 w-3 animate-spin"}):l?"Following":"Follow"})]},e.userId)})})]}):null},N=()=>(0,t.jsxs)("nav",{"aria-label":"Footer",role:"navigation",className:"px-4 pb-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-[13px] text-[rgb(83,100,113)]",children:[(0,t.jsx)(n.default,{href:"/terms",className:"hover:underline",children:"Terms of Service"}),(0,t.jsx)("span",{children:"|"}),(0,t.jsx)(n.default,{href:"/privacy",className:"hover:underline",children:"Privacy Policy"}),(0,t.jsx)("span",{children:"|"}),(0,t.jsx)(n.default,{href:"/cookies",className:"hover:underline",children:"Cookie Policy"}),(0,t.jsx)("span",{children:"|"}),(0,t.jsx)(n.default,{href:"/accessibility",className:"hover:underline",children:"Accessibility"}),(0,t.jsx)("span",{children:"|"}),(0,t.jsx)(n.default,{href:"/community/adsmanager",className:"hover:underline",children:"Ads info"})]}),(0,t.jsx)("p",{className:"mt-2 text-[13px] text-[rgb(83,100,113)]",children:"\xa9 2026 Instaloops Corp."})]}),w=()=>(0,t.jsx)("div",{className:"sticky top-0 z-10 bg-white pb-3 pt-2",children:(0,t.jsx)("form",{action:"/search",role:"search","aria-label":"Search Instaloops",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3.5",children:(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-[rgb(115,115,115)]",children:[(0,t.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,t.jsx)("path",{d:"m21 21-4.3-4.3"})]})}),(0,t.jsx)("input",{type:"text",placeholder:"Search Instaloops",className:"w-full rounded-lg border border-transparent bg-[rgb(240,240,240)] py-2.5 pl-10 pr-4 text-[15px] text-[rgb(15,20,25)] placeholder-[rgb(115,115,115)] transition-all focus:border-[rgb(200,200,200)] focus:bg-white focus:shadow-[0_0_0_1px_rgba(0,0,0,0.08)] focus:outline-none","aria-label":"Search query"})]})})});s.default=()=>{let{data:e,isLoading:s}=function(){let{session:e,isLoading:s}=(0,c.a)(),[l,t]=(0,o.useState)(null),[a,r]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{if(s||!e)return;let l=new AbortController;return(async()=>{try{let e=await fetch("/api/v2/community/sidebar/widgets",{signal:l.signal});if(e.ok){let s=await e.json();s.success&&s.data&&t(s.data)}}catch(e){"AbortError"!==e.name&&console.error("[XSidebar] Failed to fetch sidebar data:",e)}finally{r(!1)}})(),()=>l.abort()},[s,e]),{data:l,isLoading:a}}();return(0,t.jsxs)("div",{className:"flex w-full flex-col gap-4",children:[(0,t.jsx)(w,{}),(0,t.jsx)(v,{trendingPosts:null==e?void 0:e.trending,isDataLoading:s}),(0,t.jsx)(j,{suggestions:null==e?void 0:e.suggestions,isDataLoading:s}),(0,t.jsx)(p,{}),(0,t.jsx)(b,{hashtags:null==e?void 0:e.hashtags,isDataLoading:s}),(0,t.jsx)(f,{suggestions:null==e?void 0:e.suggestions,isDataLoading:s}),(0,t.jsx)(g,{trendingPosts:null==e?void 0:e.trending,isDataLoading:s}),(0,t.jsx)(N,{})]})}}}]);
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.