1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9358],{12295:function(e,n,t){var r=t(47568),o=t(26042),s=t(69396),a=t(828),i=t(20414),c=t(85893),u=t(60357),l=t.n(u),d=t(67294),f=t(11163),h=t(60253),v=t(36808),p=t.n(v),x=t(72091),b=t(17812),Z=t(22318),g=t(91910),j=t(48777),m=t(49384),w=t(61164),y=t(92674),k=t(40570);n.Z=function(e){var n=e.user,t=e.onUserUpdate,u=(0,f.useRouter)(),v=(0,h.$G)().t,I=(0,x.Ds)().enqueueSnackbar,D=(0,a.Z)((0,w.o)(),1)[0],C=D.auth,E=D.isIntersectionObserverEnabled,_=(0,y.Z)(),F=d.useRef(null),U=(0,a.Z)(d.useState(!1),2),S=U[0],P=U[1],N=(0,a.Z)(d.useState(),2),A=N[0],T=N[1],M=(0,a.Z)(d.useState(!1),2),B=M[0],G=M[1],O=(0,a.Z)(d.useState(!1),2),R=O[0],$=O[1],L=!(!C||!(null===A||void 0===A?void 0:A.length)),W=d.useMemo((function(){return!(C&&!A)&&((null===C||void 0===C?void 0:C.ID)!==(null===n||void 0===n?void 0:n.ID)&&!(null===n||void 0===n?void 0:n.DeletedAt))}),[C,A,null===n||void 0===n?void 0:n.DeletedAt,null===n||void 0===n?void 0:n.ID]),q=d.useCallback((function(e){e.isIntersecting&&($(!0),P(!0),(null===n||void 0===n?void 0:n.ID)?_("/auth/user/".concat(n.ID,"/follower"),{method:"GET"}).then((function(e){if(null===e)throw new Error("newFollowers is null");T(e)})).catch((function(e){(0,m.kg)(e)})).finally((function(){P(!1)})):(0,m.kg)("user.ID is undefined"))}),[_,null===n||void 0===n?void 0:n.ID]);d.useEffect((function(){if(C&&E&&!R){var e=F.current;if(e){var n=new IntersectionObserver((function(e){e.forEach(q)}),{root:null,rootMargin:"400px",threshold:0});return n.observe(e),function(){n.unobserve(e)}}}}),[C,q,R,E]);var z=d.useCallback((function(){return G(!0)}),[]),J=d.useCallback((function(){return G(!1)}),[]),H=d.useCallback((0,r.Z)((function(){var e,r;return(0,i.__generator)(this,(function(a){switch(a.label){case 0:P(!0),a.label=1;case 1:return a.trys.push([1,6,,7]),C?[3,3]:(p().set("return_to",u.asPath,{expires:1,secure:!0,sameSite:"lax"}),[4,u.push("/signup")]);case 2:return a.sent(),[2];case 3:return C.Unconfirmed?(p().set("return_to",u.asPath,{expires:1,secure:!0,sameSite:"lax"}),[4,u.push("/auth/unconfirmed")]):[3,5];case 4:return a.sent(),[2];case 5:return[3,7];case 6:return e=a.sent(),(0,m.kg)(e),I(v("failed-to-follow"),{variant:"error"}),P(!1),[2];case 7:if(a.trys.push([7,9,,10]),!(null===n||void 0===n?void 0:n.ID))throw new Error("user.ID is undefined");return[4,_("/auth/user/".concat(n.ID,"/follower"),{method:"POST"})];case 8:return a.sent(),T([{}]),null===t||void 0===t||t((0,s.Z)((0,o.Z)({},n),{FollowerCount:(n.FollowerCount||0)+1})),[3,10];case 9:return r=a.sent(),(0,m.kg)(r),I(v("failed-to-follow"),{variant:"error"}),P(!1),[2];case 10:return P(!1),[2]}}))})),[C,I,_,t,u,v,n]),K=d.useCallback((0,r.Z)((function(){var e;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:P(!0),r.label=1;case 1:if(r.trys.push([1,3,,4]),!(null===n||void 0===n?void 0:n.ID))throw new Error("user.ID is undefined");return[4,_("/auth/user/".concat(n.ID,"/follower"),{method:"DELETE"})];case 2:return r.sent(),T([]),null===t||void 0===t||t((0,s.Z)((0,o.Z)({},n),{FollowerCount:(n.FollowerCount||1)-1})),[3,4];case 3:return e=r.sent(),(0,m.kg)(e),I(v("failed-to-unfollow"),{variant:"error"}),P(!1),[2];case 4:return P(!1),[2]}}))})),[I,_,t,v,n]);return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("div",{ref:F,className:"jsx-e20212abf16b2b5 sm",children:[(0,c.jsx)(Z.Z,{component:"div",variant:"caption",style:{opacity:W?1:.38,marginBottom:"-8px",textAlign:"center"},children:v("follow")}),L&&(0,c.jsx)(b.Z,{disabled:S,onClick:K,children:(0,c.jsx)(g.Z,{style:{color:"#FFEB3B"}})}),!L&&(0,c.jsx)(b.Z,{disabled:S||!W,onClick:H,children:(0,c.jsx)(j.Z,{})})]}),(0,c.jsxs)("div",{ref:F,className:"jsx-e20212abf16b2b5 lg",children:[L&&(0,c.jsx)(k.Z,{color:B?"error":"default",disabled:S,variant:B?"contained":"outlined",style:{borderRadius:"18px"},onClick:K,onMouseEnter:z,onMouseLeave:J,children:v(B?"unfollow":"following")}),!L&&(0,c.jsx)(k.Z,{color:"primary",disabled:S||!W,variant:"contained",style:{borderRadius:"18px"},onClick:H,children:v("follow")})]}),(0,c.jsx)(l(),{id:"e20212abf16b2b5",children:".lg.jsx-e20212abf16b2b5{display:none}@media(min-width:360px){.sm.jsx-e20212abf16b2b5{display:none}.lg.jsx-e20212abf16b2b5{display:block}}"})]})}},63052:function(e,n,t){var r=t(828),o=t(85893),s=t(60357),a=t.n(s),i=t(67294),c=t(60253),u=t
1(49384),l=t(61164),d=t(92674);n.Z=function(e){var n=e.user,t=(0,c.$G)().t,s=(0,r.Z)((0,l.o)(),1)[0],f=s.auth,h=s.isIntersectionObserverEnabled,v=(0,d.Z)(),p=i.useRef(null),x=(0,r.Z)(i.useState(),2),b=x[0],Z=x[1],g=(0,r.Z)(i.useState(!1),2),j=g[0],m=g[1],w=i.useCallback((function(e){e.isIntersecting&&(m(!0),(null===n||void 0===n?void 0:n.ID)?v("/auth/user/".concat(n.ID,"/following-user"),{method:"GET"}).then((function(e){if(null===e)throw new Error("newFollowingUsers is null");Z(e)})).catch((function(e){(0,u.kg)(e)})):(0,u.kg)("user.ID is undefined"))}),[v,null===n||void 0===n?void 0:n.ID]);return i.useEffect((function(){if(f&&h&&!j){var e=p.current;if(e){var n=new IntersectionObserver((function(e){e.forEach(w)}),{root:null,rootMargin:"400px",threshold:0});return n.observe(e),function(){n.unobserve(e)}}}}),[f,w,j,h]),(null===b||void 0===b?void 0:b.length)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"jsx-1407cc0596a3aa55",children:t("is-following-you")}),(0,o.jsx)(a(),{id:"1407cc0596a3aa55",children:"span.jsx-1407cc0596a3aa55{background-color:#eee}"})]}):(0,o.jsx)("span",{ref:p})}},62319:function(e,n,t){var r=t(85893),o=t(60357),s=t.n(o),a=t(67294),i=t(60253),c=t(50998),u=t(96353),l=t(95757),d=t(90227),f=t(12295),h=t(63052),v=t(57308),p=t(13637);n.Z=function(e){var n=e.user,t=e.onUserUpdate,o=(0,i.$G)().t,x=a.useMemo((function(){return n.ID?"/user/".concat(n.ID.toString(36)):""}),[n.ID]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"jsx-671eda0c2536e770 container",children:[(0,r.jsx)(v.Z,{href:x,children:(0,r.jsxs)(c.Z,{alignItems:"flex-start",button:!0,children:[(0,r.jsx)(u.Z,{children:(0,r.jsx)("div",{className:"jsx-671eda0c2536e770 placeholder"})}),(0,r.jsx)(l.Z,{primary:n.Name||o("guest"),primaryTypographyProps:{noWrap:!0},secondary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h.Z,{user:n}),(null===n||void 0===n?void 0:n.Bio)&&(0,r.jsx)(p.Z,{lines:4,children:n.Bio})]}),secondaryTypographyProps:{component:"div"},style:{overflowWrap:"break-word"}}),(0,r.jsx)("div",{onClick:function(e){return e.preventDefault()},className:"jsx-671eda0c2536e770 follow",children:(0,r.jsx)(f.Z,{user:n,onUserUpdate:t})})]})}),(0,r.jsx)(d.Z,{user:n,onUserUpdate:t,style:{position:"absolute",top:"16px",left:"16px"}})]}),(0,r.jsx)(s(),{id:"671eda0c2536e770",children:".container.jsx-671eda0c2536e770{position:relative}.placeholder.jsx-671eda0c2536e770{display:inline-block;width:40px;height:40px}.follow.jsx-671eda0c2536e770{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;margin-left:8px}@media(min-width:360px){.follow.jsx-671eda0c2536e770{margin-top:10px}}"})]})}},92025:function(e,n,t){var r=t(47568),o=t(828),s=t(29815),a=t(20414),i=t(85893),c=t(67294),u=t(60253),l=t(62822),d=t(50998),f=t(96353),h=t(95757),v=t(96837),p=t(79895),x=t(58365),b=t(29549),Z=t(98530),g=t(49384),j=t(61164),m=t(13048),w=t(40570),y=t(57308),k=t(62319);n.Z=function(){var e=(0,o.Z)((0,j.o)(),1)[0].auth,n=(0,m.Z)(Z.Z.getPublicUsers({offset:0,auth:e})),t=n.data,I=n.mutate,D=(0,u.$G)().t,C=c.useMemo((function(){return t?t.slice(0,3):[]}),[t]),E=c.useCallback(function(){var e=(0,r.Z)((function(e){var n;return(0,a.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,I((function(n){if(!n)return n;for(var t=(0,s.Z)(n),r=0;r<t.length;r+=1)if(t[r].ID===e.ID){t.splice(r,1,e);break}return t}),!1)];case 1:return t.sent(),[3,3];case 2:return n=t.sent(),(0,g.kg)(n),[3,3];case 3:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),[I]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(p.Z,{children:[(0,i.jsxs)(l.Z,{component:"nav",subheader:(0,i.jsx)(v.Z,{component:"div",children:(0,i.jsx)(y.Z,{href:"/user",children:D("popular-users")})}),children:[!t&&Array.from(Array(3).keys()).map((function(e){return(0,i.jsxs)(d.Z,{button:!0,children:[(0,i.jsx)(f.Z,{children:(0,i.jsx)(x.Z,{variant:"circle",width:40,height:40})}),(0,i.jsx)(h.Z,{primary:(0,i.jsx)(x.Z,{width:120}),secondary:(0,i.jsx)(x.Z,{width:120})})]},e)})),C.map((function(e){return(0,i.jsx)(k.Z,{user:e,onUserUpdate:E},e.ID)}))]}),(0,i.jsx)("div",{style:{padding:"0 8px 8px"},children:(0,i.jsx)(y.Z,{href:"/user",children:(0,i.jsx)(w.Z,{color:"primary",startIcon:(0,i.jsx)(b.Z,{}),children:D("view-more-users")})})})]})})}},11173:function(e,n,t){var r=t(47568),o=t(26042),s=t(69396),a=t(20414),i=t(11163),c=t(20958),u=t(36808),l=t.n(u);n.Z=function(e,n,t){var u=(0,i.useRouter)().locale,d=function(){var e=(0,r.Z)((function(e,n){var r,i,c,u,d;return(0,a.__generator)(this,(function(a){switch(a.label){case 0:return r="".concat("https://api.baskadia.com").concat(e),i=(0,s.Z)((0,o.Z)({},t),{credentials:"omit",headers:(0,o.Z)({Accept:"application/json","Accept-Language":n,"Content-Type":"application/json"},null===t||void 0===t?void 0:t.headers)}),(c=l().get("auth._token.local"))&&(i=(0,s.Z)((0,o.Z)({},i),{credentials:"include",headers:(0,o.Z)({Authorization:c},i.headers)})),[4,fetch(r,i)];case 1:return[4,(u=a.sent()).text()];case 2:if(d=a.sent(),u.ok)try{return[2,JSON.parse(d)]}catch(f){return[2,null]}throw new Error(d)}}))}));return function(n,t){return e.apply(this,arguments)}}(),f=(0,o.Z)({},n);return(0,c.ZP)((function(n,t){var r=null===e||void 0===e?void 0:e(n,t);return r?[r,u||"en"]:null}),d,f)}}
1,98530:function(e,n){n.Z={getPublicUsers:function(e){var n=e.offset,t=e.auth,r="/user?offset=".concat(n);return(null===t||void 0===t?void 0:t.ID)&&(r+="&user=".concat(t.ID)),r},getPublicUser:function(e){var n=e.id,t=e.auth,r="/user/".concat(n);return t&&(r+="?auth=true"),r},getPublicContents:function(e){var n=e.type,t=e.sortBy,r=e.offset,o=e.lang,s="/content?type=".concat(n,"&date=any&sort_by=").concat(t,"&offset=").concat(r);return o&&(s+="&lang=".concat(o)),s},getPublicContent:function(e){var n=e.id,t=e.auth,r="/content/".concat(n);return t&&(r+="?auth=true"),r},getContentsFromContent:function(e){var n=e.id,t=e.offset;return"/content/".concat(n,"/content?offset=").concat(t)},getCommentsFromContent:function(e){var n=e.contentId,t=e.lastId,r=e.auth,o="/content/".concat(n,"/comment?last_id=").concat(t);return r&&(o+="&auth=true"),o},getTags:function(e){var n=e.offset,t=e.lang,r="/tag?offset=".concat(n);return t&&(r+="&lang=".concat(t)),r}}}}]);
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.