1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7715],{7601:function(e,t,o){"use strict";o.d(t,{c:function(){return f}});var i=o(85893),s=o(67294),l=o(93879),a=o(56469),n=o(54922),r=o(90457),d=o(71780),c=o.n(d),u=o(83038),p=o(11163),_=o(5233),m=o(7325),v=o(24345),x=o(87538),h=o(66248),g=o(54140),j=o(12452);let f={Ñнв:"ЯнваÑÑ",ÑевÑ:"ФевÑалÑ",маÑ:"ÐаÑÑ",апÑ:"ÐпÑелÑ",маÑ:"Ðай",иÑнÑ:"ÐÑнÑ",иÑлÑ:"ÐÑлÑ",авг:"ÐвгÑÑÑ",ÑенÑ:"СенÑÑбÑÑ",окÑ:"ÐкÑÑбÑÑ",ноÑб:"ÐоÑбÑÑ",дек:"ÐекабÑÑ"},b=(e,t,o,s)=>{var l,a,n,r,d,u,p,_;return(null===(a=e[o])||void 0===a?void 0:null===(l=a.date)||void 0===l?void 0:l.split(" ")[1])!==(null===(r=e[o-1])||void 0===r?void 0:null===(n=r.date)||void 0===n?void 0:n.split(" ")[1])||0===o?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("h2",{className:c().date,children:[f[null===(u=e[o])||void 0===u?void 0:null===(d=u.date)||void 0===d?void 0:d.split(" ")[1]]," ",null===(_=e[o])||void 0===_?void 0:null===(p=_.fullDate)||void 0===p?void 0:p.split(" ")[1]]}),(0,i.jsx)(g.Z,{...t,onFavoriteClick:s,showDate:!0})]}):(0,i.jsx)(g.Z,{...t,onFavoriteClick:s,showDate:!0})};t.Z=e=>{let{posts:t,total:o,limit:d,onFavoriteToggle:g,allFavorite:f,userId:y}=e,P=(0,p.useRouter)(),{t:k}=(0,_.$G)("catalog"),T=Number(P.query.page)||x.uS.DEFAULT_PAGE,[L,w]=(0,s.useState)(t||[]),[C,I]=(0,s.useState)(!1),N=Math.ceil(o/d)>T,S=(0,j.e)(L.map(e=>e.post_id),!!y),E=(0,s.useCallback)(async(e,t,o)=>{I(!0),t||window.scrollTo({top:0,behavior:"instant"});let i=new URLSearchParams({...e?{page:String(e)}:{},limit:String(x.uS.DEFAULT_POSTS_LIMIT)});try{let s=await (0,v.Z)("/content/catalog/posts?".concat(i.toString()),{},"",!1);if(!s.ok)throw Error("ÐÑибка HTTP: ".concat(s.status));let{list:l}=await s.json();if(w(e=>t?[...e,...l]:l),o)return;1===e?(0,m.r)(P,{page:void 0},!1,!t):(0,m.r)(P,{page:e},!1,!t)}catch(e){throw Error("ÐÑибка загÑÑзки поÑÑов: ".concat(e))}finally{I(!1)}},[P]),M=(0,s.useCallback)(e=>{e!==T&&E(e,!1)},[T,E]),A=(0,s.useCallback)(()=>{let e=T+1;(0,m.r)(P,{page:e},!1,!1),E(e,!0,!0)},[T,E,P]),F=(0,s.useMemo)(()=>L.map(e=>({date:e.date,fullDate:e.fullDate,title:e.post_title,href:"/".concat(e.project_url,"/").concat(e.post_id,"/").concat((0,u.H)(e.post_title),"/"),id:e.post_id,imgSrc:e.post_image||void 0,projectName:e.project_title,isFavorite:f,wasVisited:S.has(Number(e.post_id))})),[L,S,f]);return(0,i.jsx)("div",{className:c().postsContainer,children:(0,i.jsx)("div",{className:c().spinWrapper,children:(0,i.jsx)(l.Z,{size:"large",spinning:C,children:L.length?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Z,{onFavoriteToggle:g,listCount:d,items:F,renderItem:b,disableVirtualizedHeightRecompute:!0}),(0,i.jsxs)("div",{className:c().pagination,children:[N&&(0,i.jsx)(a.Z,{onClick:A,type:"primary",disabled:C,className:c().showMore,"data-testid":"catalog-show-more",children:k("ShowMore")}),(0,i.jsx)(h.Z,{current:T,total:o,pageSize:d,onChange:M,disabled:C,"data-testid":"catalog-pagination"})]})]}):(0,i.jsx)(n.Z,{className:c().emptyContainer,description:(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("p",{className:c().description,children:k("Plug.Posts.Description")})})})})})})}},5804:function(e,t,o){"use strict";o.d(t,{Z:function(){return eY}});var i,s,l=o(85893),a=o(54922),n=o(79115),r=o(21757),d=o(51685),c=o(67618),u=o(51211),p=o(24173),_=o(67294),m=o(18359),v=o(68523),x=o(62883),h=o(94184),g=o.n(h),j=o(5152),f=o.n(j),b=o(92353),y=o(85630),P=o(89770),k=o(58675),T=o.n(k),L=o(67452),w=o(55560),C=o(5233),I=o(23973),N=o(24513),S=o(72557),E=o(67784),M=o(96289),A=o.n(M),F=o(62071),Z=o(2538);let D=!1;function B(e){let{postPart:t,gallerySrcArg:o,imagesSrcsArg:i,postId:s,postTitle:a,videoPosters:n,onAttachmentClick:r}=e,[d,c]=(0,_.useState)(!1),p=(0,_.useRef)(new Set),v=(0,_.useRef)(new Map),x=(0,_.useRef)(null);(0,_.useEffect)(()=>{c(!0)},[]),(0,_.useEffect)(()=>{let e=x.current;if(!e)return;let t=e.closest('[id^="foldedPost"]');if(!t)for(t=e.parentElement;t&&!t.classList.contains("foldedPost")&&t.parentElement;)t=t.parentElement;if(!t)return;let o=o=>{let i=o.target.closest(".timecode-link");if(!i||!(e.contains(i)||t.contains(i)))return;if(D){o.preventDefault(),o.stopPropagation();return}o.preventDefault(),o.stopPropagation(),o.stopImmediatePropagation(),D=!0,setTimeout(()=>{D=!1},100);let s=i.getAttribute("data-time"),l=i.getAttribute("data-video-id");if(!s||!l)return;let a='iframe[src*="video_id='.concat(l,'"]'),n='iframe[data-url*="video_id='.concat(l,'"]'),r='iframe[src*="'.concat(I.cH,"/embed/").concat(l,'"]'),d=document.querySelector(a),c=document.querySelector(n),u=document.querySelector(r);if(d){(0,m.Sj)(null!=d?d:c,s);return}if(u||c){(0,m.Ab)(null!=u?u:c,s),(0,m.WX)(null!=u?u:c);return}v.current.set(l,s);
1let p='[data-video-poster][data-video-id="'.concat(l,'"]'),_=t.querySelector(p);_&&_.click()};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},[]);let h=(0,_.useCallback)(e=>(0,m.yA)(n,e),[n]),g=(0,_.useCallback)((e,t)=>{null==r||r(),p.current.add(e);let o=v.current.get(t);o&&setTimeout(()=>{let e='iframe[src*="video_id='.concat(t,'"]'),i='iframe[src*="'.concat(I.cH,"/embed/").concat(t,'"]'),s=document.querySelector(e),l=document.querySelector('iframe[data-url*="video_id='.concat(t,'"]')),a=document.querySelector(i);s?(0,m.Sj)(null!=s?s:l,o):(a||l)&&((0,m.Ab)(null!=a?a:l,o),(0,m.WX)(null!=a?a:l)),v.current.delete(t)},500)},[r]),j=(0,_.useMemo)(()=>{if(t.includes(F.Nq)){let e=t.match(/data-gallery[=\s]*['"]*(\d+)['"]*/)||t.match(/data-gallery=(\d+)/);return{type:"gallery",index:e?parseInt(e[1],10):0}}if(t.includes(F.Os)){let e=t.match(/data-postimage[=\s]*['"]*(\d+)['"]*/)||t.match(/data-postimage=(\d+)/);return{type:"image",index:e?parseInt(e[1],10):0}}return{type:"text"}},[t]),f=(0,_.useMemo)(()=>{if(!d)return{html:t,videoPosterReplacements:[]};try{let e=new DOMParser().parseFromString(t,"text/html"),o=[];return Array.from(e.querySelectorAll("div.post-video")).forEach((t,i)=>{let s;let l=t.querySelector("iframe"),a=(null==l?void 0:l.getAttribute("src"))||"",n=(null==l?void 0:l.getAttribute("data-url"))||"",r="";if(a.startsWith("/post/video/")||n.startsWith("/post/video/")){let e=n?n.match(Z.$F):a.match(Z.$F);r=e?e[1]:"video-".concat(i)}if(a.includes(I.cH)&&!n.startsWith("/post/video/")){let e=a.match(Z.x9);r=e?e[1]:"video-".concat(i)}if(a.includes("rutube.ru")){let e=a.match(Z.G1);r=e?e[1]:"video-".concat(i)}if(a.includes("youtube.com")||a.includes("youtu.be")){let e=a.match(Z.Rh);r=e?e[1]:"video-".concat(i)}if(r){let e=t.nextElementSibling;for(;e;){if("P"===e.tagName){let t=(e.textContent||"").trim(),o=(0,m.QL)(t,r);o!==t&&(e.innerHTML=o)}e=e.nextElementSibling}}if(s=(null==n?void 0:n.includes("/post/video/"))?n:(null==a?void 0:a.includes("/post/video/"))?a:a||n){let l=h(s),a=p.current.has(s);if((null==l?void 0:l.poster_url)||a){var d;let n="VIDEO_POSTER_MARKER_".concat(i,"_").concat(r);o.push({marker:n,iframeSrc:s,posterUrl:(null==l?void 0:l.poster_url)||"",isLoaded:a,videoId:r});let c=e.createElement("div");c.className=n,null===(d=t.parentNode)||void 0===d||d.replaceChild(c,t)}}}
1),Array.from(e.querySelectorAll("iframe")).forEach(e=>{e.getAttribute("loading")||e.setAttribute("loading","lazy"),e.setAttribute("allow","autoplay; fullscreen; picture-in-picture; encrypted-media; gyroscope; accelerometer; clipboard-write; screen-wake-lock;");let t=e.getAttribute("src");if(t&&t.includes("kinescope.io")){let o=(0,m.U2)(t);o!==t&&e.setAttribute("src",o)}}),Array.from(e.querySelectorAll('[class="post-table"]')).forEach(e=>{e.setAttribute("class",A().postTable)}),{html:(0,m.pb)(e.body.innerHTML||""),videoPosterReplacements:o}}catch(e){return{html:t,videoPosterReplacements:[]}}},[t,d,h]);if("gallery"===j.type)return(0,l.jsx)(u.aK,{imgsProps:o[j.index||0],postId:s},"".concat(s,"-gallery-").concat(j.index));if("image"===j.type){let{src:e,description:t,originSrc:o}=i[j.index||0]||{},n=0===(j.index||0)?a:t||"";return e?(0,l.jsxs)("div",{className:A().postImage,children:[(0,l.jsx)(N.Z,{loading:"lazy",src:e.replace(/\/post\/0/,"/post/".concat(s)),alt:n,fallback:E.Z.src,preview:{mask:(0,l.jsx)(S.Z,{style:{fontSize:24}}),src:o.replace(/\/post\/0/,"/post/".concat(s))}}),t&&(0,l.jsx)("span",{children:t})]},"".concat(s,"-image-").concat(j.index)):null}return(()=>{let{html:e,videoPosterReplacements:t}=f;if(0===t.length)return(0,l.jsx)("div",{ref:x,className:A().postText,"data-testid":"content-post-article",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:e}},s);let o=[],i=e;t.forEach(e=>{let{marker:t,iframeSrc:a,posterUrl:n,isLoaded:r,videoId:d}=e,c=RegExp('<div class="'.concat(t,'"><\\/div>'),"g"),p=i.split(c);if(p.length>1){p[0]&&o.push({type:"text",key:"".concat(s,"-text-").concat(t),content:p[0]});let e=h(a);o.push({type:"component",key:t,content:(0,l.jsx)(u.Uo,{posterUrl:n||"",iframeSrc:a,onLoadVideo:g,isVideoLoaded:r,poster:e,videoId:d})}),i=p.slice(1).join("")}}),i&&o.push({type:"text",key:"".concat(s,"-text-final"),content:i});let a=o.findIndex(e=>"text"===e.type);return(0,l.jsx)(l.Fragment,{children:o.map((e,t)=>"text"===e.type?(0,l.jsx)("div",{ref:t===a?x:void 0,className:A().postText,"data-testid":"content-post-article",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:e.content}},e.key):(0,l.jsx)(_.Fragment,{children:e.content},e.key))})})()}(i=s||(s={})).gallery="gallery",i.image="image",i.text="text";var W=o(80126),G=o(56469),H=o(42476),R=o(80075),U=o(52772),O=o(33963),V=o(47959),q=o(84309),z=o(50409),J=o(41664),X=o.n(J),Q=o(70288),K=o(820),$=o(50633),Y=o(66443),ee=o(14558),et=o(70213),eo=o(45054),ei=o(52982),es=o(24345),el=o(82378),ea=o(74917),en=o(73699),er=o(74333),ed=o(11163),ec=o(4595),eu=o(10647),ep=o(7372),e_=o(10223),em=o(19928),ev=o.n(em);let{mediaURL:ex}=(0,o(82506).j)();function eh(e){let{projectUrl:t,projectTitle:o,projectLogo:i,postId:s,postDuration:a,postDate:n,postView:r=d.Td.newsfeed,className:c=""}=e,{t:u}=(0,C.$G)("common"),[p,m]=(0,_.useState)(""),v=null==i?void 0:i.split("?")[1],x=i?(0,ei.t)("".concat(ex).concat(i),"crop","100x100",void 0,v):void 0,h="/".concat(t),g=o.charAt(0).toUpperCase();(0,_.useEffect)(()=>{m((0,ep.H)(n))},[n,u]);let j=()=>(0,l.jsx)(eu.C,{shape:"square",src:x,alt:o,className:ev().avatar,children:!x&&g}),f=()=>(0,l.jsx)(W.default.Text,{ellipsis:!0,className:ev().title,children:o});return(0,l.jsxs)("div",{className:"".concat(ev().root," ").concat(c),children:[(0,l.jsxs)("div",{className:ev().projectInfo,children:[(0,l.jsx)("div",{className:ev().desktopProjectInfo,children:(0,l.jsxs)("div",{className:ev().desktopProjectMeta,children:[(0,l.jsxs)(X(),{href:h,className:ev().projectLink,children:[j(),f()]}),(0,l.jsx)(W.default.Text,{className:ev().time,children:p})]})}),(0,l.jsxs)("div",{className:ev().mobileProjectInfo,children:[(0,l.jsx)(X(),{href:h,className:ev().avatarLink,children:j()}),(0,l.jsxs)("div",{className:ev().titleAndTime,children:[(0,l.jsx)(X(),{href:h,className:ev().titleLink,children:f()}),(0,l.jsx)(W.default.Text,{className:ev().time,children:p})]})]})]}),(0,l.jsx)("div",{className:ev().postDuration,children:(0,l.jsx)(e_.b,{postId:s,postDuration:a,postView:r})})]})}function eg(e){let{actionLabel:t,actionIcon:o,actionTestId:i,onActionClick:s,postUrl:a,goToPostLabel:n,goToPostTestId:r,hideGoToPost:d=!1,isLoading:c=!1}=e;return(0,l.jsxs)("div",{className:T().readActionButtons,children:[(0,l.jsxs)(G.Z,{type:"link",onClick:()=>s(),className:T().readMoreButton,"data-testid":i,disabled:c,"aria-busy":c,children:[(0,l.jsx)("span",{className:c?T().loadingReadMoreLabel:void 0,children:t}),o]}
1),!d&&(0,l.jsx)(G.Z,{size:"large",href:a,className:T().goToPostButton,"data-testid":r,children:n})]})}var ej=o(91624),ef=o(15055);function eb(e){let{tag:t,projectUrl:o,postId:i}=e,{tag_id:s,tag:{tag_name:a},count:n}=t;return(0,l.jsx)(X(),{href:"/".concat(o,"/collections/").concat(s,"/").concat(i?"?currentpost=".concat(i):""),prefetch:!1,children:(0,l.jsxs)(ej.Z,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)(ef.Z,{style:{marginRight:8}}),(0,l.jsx)("span",{children:a})]}),(0,l.jsx)("span",{children:n})]})})}function ey(e){let{tags:t,postId:o,projectUrl:i}=e;return(0,l.jsxs)("div",{className:T().tagsBlockWrapper,children:[(0,l.jsx)("div",{className:T().tagsBlock,children:t.map(e=>(0,l.jsx)(eb,{projectUrl:i,tag:e,postId:o},"".concat(o,"-tag-").concat(e.tag_id)))}),(0,l.jsx)("div",{className:T().tagsBlockGradient})]})}var eP=o(8206);let ek=f()(()=>Promise.resolve().then(o.bind(o,46263)).then(e=>e.PollForm),{loadableGenerated:{webpack:()=>[46263]},ssr:!1}),eT=f()(()=>Promise.resolve().then(o.bind(o,47528)).then(e=>e.IconBlock),{loadableGenerated:{webpack:()=>[47528]},ssr:!1}),eL=f()(()=>Promise.all([o.e(1189),o.e(970)]).then(o.bind(o,90970)),{loadableGenerated:{webpack:()=>[90970]},ssr:!1}),{Text:ew,Title:eC}=W.default,eI=(0,_.memo)(e=>{var t,o,i,s;let{post:a,level:n,project:r,isLikedCurrentPost:h,breakPost:j=[],gallerySrc:f=[],imagesSrcs:k=[],commentDisableReason:I,sortedLevels:N,subscribed:S,userId:E,favoritePosts:M=[],showProjectInfo:A=!1,wasVisited:F=!1,postViewMode:Z=d.Td.feed}=e,{isAuthor:D,isAdmin:W,isAuthorized:J}=(0,L._C)(),{user:eu}=(0,ea.oR)().state,ep=(0,ed.useRouter)(),e_=(0,er.t)(),{t:em}=(0,C.$G)("common"),{t:ev}=(0,C.$G)("post"),[ex,ej]=(0,_.useState)(a.cnt_likes),[ef]=(0,_.useState)(a.cnt_comments),eb=Z===d.Td.newsfeed,eI=!!a.extended_view&&!A,eN=(0,_.useMemo)(()=>eb?j:j.filter(e=>"<p><br></p>"!==e&&""!==e),[j,eb]),eS=(0,_.useRef)(null),eE=(0,_.useRef)(null),eM=(0,_.useRef)(null),eA=(0,_.useMemo)(()=>({likes:ex,comments:ef}),[ex,ef]),[eF,eZ]=(0,_.useState)(!1),[eD,eB]=(0,_.useState)(!1),eW=!!a.image,[eG,eH]=(0,_.useState)({title:"",action:""}),[eR,eU]=(0,_.useState)(!!h),[eO,eV]=(0,_.useState)(null!==(s=null==M?void 0:M.includes(a.id))&&void 0!==s&&s),eq=(0,_.useMemo)(()=>{var e;if(!a.image)return(0,ei.t)("".concat(e_).concat((0,P.M)()),"crop","860x479",".jpg");let t=null===(e=a.image)||void 0===e?void 0:e.split("?")[1];return(0,ei.t)("".concat(e_).concat(a.image),"resize","1720x958",void 0,t)},[e_,a.image]),[ez,eJ]=(0,_.useState)({poll_title:"",poll_answers:[],poll_choose_multiple_values:0,poll_perpetual:0,poll_date:""}),eX=(0,w.O)(),eQ=(0,$.aZ)(eN),eK=(0,$.by)(r.project_url,a),e$=eQ?"".concat(eK,"?autoplay=1"):eK,eY=(0,_.useMemo)(()=>(0,ec.j)(eK),[eK]),e0=(0,_.useMemo)(()=>(0,ec.j)(e$),[e$]),[e1,e2]=(0,_.useState)(null),e5=(0,_.useRef)(null),[e7,e8]=(0,_.useState)(!1),[e4,e3]=(0,_.useState)(null),[e9,e6]=(0,_.useState)(!1),[te,tt]=(0,_.useState)(!1),to=(0,p.e)({postId:a.id,postDate:a.date,projectAccessType:a.project_access_type,level:n,levels:N,historyPost:a.history_post,accessDays:a.history_post&&a.access_days||void 0,accessTime:a.history_post&&a.access_time||void 0,project:r,subscribed:S,post:a,isPurchasedPost:null==a?void 0:a.purchased_post}),ti=(0,_.useMemo)(()=>!E&&to.isAuthRequest?"/auth/signup/?redirect_url=".concat(encodeURIComponent(to.checkoutUrl)):to.checkoutUrl,[to.checkoutUrl,to.isAuthRequest,E]),ts=(0,_.useMemo)(()=>to.kind===p.w.PostOnetime?ev("BuyPostToReadMore"):to.kind===p.w.NoSpots?ev("SubscribeToAnyLevel"):ev("SubscribeToReadMore"),[to.kind,ev]),tl=D||W,ta=(0,$.Aq)(a.status,a.date),tn=(0,_.useRef)(0),tr=(0,_.useCallback)(async()=>{if(!a.available||!E||!(null==eu?void 0:eu.id)||(null==eu?void 0:eu.impersonate))return;let e=Date.now();!(e-tn.current<2e3)&&await (0,en.L)(a.id,{allowedQueryParams:d.Md,force:!0})&&(tn.current=e)},[a.available,a.id,E,null==eu?void 0:eu.id,null==eu?void 0:eu.impersonate]),td=(0,_.useCallback)(async()=>{a.available&&E&&(null==eu?void 0:eu.id)&&(null==eu||!eu.impersonate)&&await (0,en.L)(a.id,{skipQueryParamCheck:!0,force:!0})},[a.available,a.id,E,null==eu?void 0:eu.id,null==eu?void 0:eu.impersonate]),tc=(0,_.useCallback)(async()=>{eZ(!0);try{let e=await (0,et.o)(a.id,r.id);if(!e.success)return x.r.error({content:em("Message.CommonError")});!0===e.deleted?x.r.info({content:em("Post.RemoveFromFavorites")}):x.r.success({content:em("Post.AddToFavorites")}),eV(e=>!e)}catch(e){x.r.error({content:em("Message.CommonError")})}finally{eZ(!1)}},[a.id,r.id,em]),tu=(0,_.useCallback)(async()=>
1{if(!eD){eB(!0),eZ(!0);try{if(!await (0,ee.Z)(a.id,r.id))return x.r.error({content:em("Message.CommonError")});let e=await (0,ee.G)(a.id,r.id);if(null===e)return x.r.error({content:em("Message.CommonError")});ej(e||0),eU(e=>!e)}catch(e){x.r.error({content:em("Message.CommonError")})}finally{eB(!1),eZ(!1)}}},[eD,a.id,r.id,em]),tp=(0,_.useMemo)(()=>(0,y.C)(a,ev),[a.duration_podcast,a.duration_text,a.duration_video,ev]);(0,_.useEffect)(()=>{eH(tp)},[tp]),(0,_.useEffect)(()=>{if(a.poll){let{poll_title:e,poll_answers:t,poll_choose_multiple_values:o,poll_perpetual:i,poll_date:s}=a.poll;eJ({poll_title:e||"",poll_answers:(0,m.qP)(t),poll_choose_multiple_values:o||0,poll_perpetual:i||0,poll_date:s||""}),eX.setToggled()}},[a.poll,eX]),(0,_.useEffect)(()=>{var e;eV(null!==(e=null==M?void 0:M.includes(a.id))&&void 0!==e&&e)},[M,a.id]),(0,_.useEffect)(()=>{eU(!!h)},[h]);let t_=(0,_.useCallback)((e,t,o)=>{let i=0;return(0,l.jsx)(l.Fragment,{children:null==e?void 0:e.map(e=>{var s,n;let r=null===(s=e.match(/data-gallery=(\d+)/))||void 0===s?void 0:s[1],d=null===(n=e.match(/data-postimage=(\d+)/))||void 0===n?void 0:n[1],c="".concat(a.id,"-text-").concat(i);return void 0!==r?c="".concat(a.id,"-gallery-").concat(r):void 0!==d?c="".concat(a.id,"-image-").concat(d):i+=1,(0,l.jsx)(B,{postPart:e,gallerySrcArg:t,imagesSrcsArg:o,postId:a.id,postTitle:a.title||"",videoPosters:a.video_posters,onAttachmentClick:td},c)})})},[a.id,a.title,a.video_posters,td]),tm=(0,eP.d)(el.s,500),tv=eI?te:!e7,tx=eb||tv,th=!eI&&!e4&&!1!==a.text_truncated,tg=(0,_.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,o=null!=e?e:tm?eE.current:eS.current;if(!o)return;if(eb){let e=Number.parseFloat(window.getComputedStyle(o).getPropertyValue("--newsfeed-folded-max-height"));e2(!Number.isFinite(e)||o.scrollHeight>e);return}let i=e=>null==e?void 0:e.matches('[class*="post-video"], [class*="videoPosterContainer"], [class*="videoPlayerContainer"]');if(o.querySelector('[class*="videoPosterContainer"], [class*="videoPlayerContainer"]')){e2(!0);return}let s=o.children.length>1,l=o.children[0];if(1===o.children.length&&(null==l?void 0:l.matches('[class*="postText"]'))){let e=Array.from(l.children);if(i(e[0])&&(0,$.Id)(e[0].nextElementSibling)){e2(!1);return}for(let o=0;o<Math.min(e.length,t);o+=1)if(i(e[o])){0===o&&e[1]&&e[1].classList.add("second-child"),o>0&&e[0]&&e[0].classList.add("first-child"),e2(!0);return}if((0,$.hK)(l)){e2(!0);return}s=l.scrollHeight>l.clientHeight+1}if(1===o.children.length&&(null==l?void 0:l.matches('[class*="filesContainer"]'))&&l.children.length>2){e2(!0);return}e2(s)},[tm,eb]),tj=a.available&&!!(e1||th),tf=eb?tj:!!(e1||e7||eI),tb=(0,_.useCallback)(e=>{let t=null;return e instanceof Element?t=e:e instanceof Node&&(t=e.parentElement),!!t&&!!t.closest('.timecode-link, [data-video-poster], [data-video-player], [class*="post-video"], [data-post-attachment], [data-post-interactive]')},[]),ty=(0,_.useCallback)(e=>{tb(e.target)||ep.push(e0.href,e0.as)},[tb,e0,ep]),tP=(0,_.useCallback)(e=>{tb(e.target)||"Enter"!==e.key&&" "!==e.key||ep.push(e0.href,e0.as)},[tb,e0,ep]);(0,eo.Z)(()=>{tx&&tg()},[tg,tx,e4,e7,te]),(0,_.useEffect)(()=>{if(!tx)return;let e=eS.current,t=eE.current,o=[],i=[],s=e=>{e.querySelectorAll("img").forEach(t=>{if(t.complete)return;let o=()=>tg(e);t.addEventListener("load",o,{once:!0}),i.push(()=>t.removeEventListener("load",o))})};if(e){let t=()=>{tm||tg(e)},i=new MutationObserver(t);i.observe(e,{childList:!0,subtree:!0}),o.push(i);let l=new ResizeObserver(t);l.observe(e),o.push(l),s(e)}if(t){let e=()=>{tm&&tg(t)},i=new MutationObserver(e);i.observe(t,{childList:!0,subtree:!0}),o.push(i);let l=new ResizeObserver(e);l.observe(t),o.push(l),s(t)}return()=>{o.forEach(e=>e.disconnect()),i.forEach(e=>e())}},[tx,tg,tm]),(0,_.useEffect)(()=>{if(!tx)return;let e=()=>tg();return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[tx,tg]),(0,_.useEffect)(()=>{e5.current=e1},[e1]);let tk=(0,_.useCallback)(()=>eX.value?(0,l.jsx)("div",{"data-post-interactive":"poll",children:(0,l.jsx)(ek,{...ez,projectId:r.id,postId:a.id})}):null,[eX.value,ez,r.id,a.id]),tT=(0,_.useMemo)(()=>a.available&&(0,l.jsxs)(l.Fragment,{children:[t_(eN,f,k),tk(),(0,l.jsx)(eL,{files:a.files,postId:a.id,projectId:r.id,projectLogo:r.logo,postTitle:a.title,onAttachmentClick:td})]}),[a.available,t_,eN,f,k,tk,a.files,r.id,r.logo,a.id,a.title,td]),tL=(0,_.useMemo)(()=>{let e=null!=e4?e4:{html:eN,gallerySrc:f,imagesSrcs:k};return a.available&&(0,l.jsxs)(l.Fragment,{children:[t_(e.html,e.gallerySrc,e.imagesSrcs),tk(),(0,l.jsx)(eL,{files:a.files,postId:a.id,projectId:r.id,projectLogo:r.logo,postTitle:a.title,onAttachmentClick:td})]})},[e4,eN,f,k,a.available,t_,tk,a.files,a.id,r.id,r.logo,a.title,td]),tw=(0,_.useCallback)(async()=>
1{if(!e9){if(e7){e8(!1),e2(!0);return}if(tr(),e4){e8(!0);return}e6(!0);try{let e=a.status===c.$4.Draft?c.$4.Draft:c.$4.Active,t=await (0,es.Z)("/content/posts/".concat(a.id,"?project_id=").concat(r.id)+"&text=true&tags=true&withFiles=true"+"&status=".concat(e));if(t.ok&&200===t.status){let e=await t.json(),o=e.list?e.list[0]:e;try{let e=(0,$.t_)([o],N,e_),t=o.id,i={html:e.html[t]||[],gallerySrc:e.gallerySrc[t]||[],imagesSrcs:e.imagesSrcs[t]||[]};e3(i),e8(!0)}catch(e){x.r.error({content:em("Message.CommonError")})}}else x.r.error({content:em("Message.CommonError")})}catch(e){x.r.error({content:em("Message.CommonError")})}finally{e6(!1)}}},[e9,e7,e4,tr,e_,a.id,a.status,r.id,N,em,tg]),tC=(0,_.useCallback)(()=>{if(!eM.current)return;let e=eM.current.getBoundingClientRect().top+window.scrollY-d.ZR;window.scrollTo({top:e,behavior:"auto"})},[]),tI=(0,_.useCallback)(()=>{e9||(tC(),tw())},[tw,e9,tC]),tN=(0,_.useCallback)(()=>{te&&tr(),tt(e=>!e),te||setTimeout(()=>{tg()},0)},[te,tr,tg]),tS=(0,_.useCallback)(()=>{te||tC(),tN()},[tN,te,tC]),tE=(0,_.useCallback)(()=>e9?(0,l.jsx)(R.Z,{}):eI?te?(0,l.jsx)(U.Z,{}):(0,l.jsx)(O.Z,{}):e7?(0,l.jsx)(O.Z,{}):(0,l.jsx)(U.Z,{}),[e9,eI,te,e7]),tM=(0,_.useMemo)(()=>!J||!D&&!W&&(!!eu.status&&![Y.J0.Active,Y.J0.NotConfirmed].includes(eu.status)||!a.available),[J,D,W,eu,a]),tA=(0,_.useMemo)(()=>{if(tM)return J?eu.status!==Y.J0.Active&&eu.status!==Y.J0.NotConfirmed?ev("PostActions.LikeUnavailable"):a.available?ev("PostActions.LikeUnavailable"):ev("PostActions.GetAccessToLike"):ev("PostActions.SignInToLike")},[J,tM,a.available,ev,eu.status]),tF=(e,t)=>{let o=eI?!te:e7,i=!o,s=o?tI:tw;return eI&&(s=o?tS:tN),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:e,suppressHydrationWarning:!0,className:g()(T().newsfeedContent,{[T().foldedPost]:i,[T().foldedPostGradient]:i&&tj,[T().newsfeedFoldedPost]:i}),id:"foldedPost-".concat("m"===t?"mobile-":"").concat(a.id),"data-testid":"m"===t?"post-fold-m-".concat(a.id):void 0,children:tL}),tj&&(0,l.jsx)(eg,{actionLabel:ev(o?"Collapse":"Expand"),actionIcon:o?(0,l.jsx)(V.Z,{}):(0,l.jsx)(q.Z,{}),actionTestId:"post-".concat(o?"col":"exp","-").concat(t,"-").concat(a.id),onActionClick:s,postUrl:eK,goToPostLabel:ev("GoToPost"),goToPostTestId:"post-go-".concat(t,"-").concat(a.id),hideGoToPost:!0,isLoading:e9&&!o})]})},tZ=(0,$.PD)(a,N),tD=(0,_.useMemo)(()=>(0,$.xj)({post:a,level:n,isPostOnetimeAccess:tZ,isAuthor:D,isAdmin:W,t:em,tPost:ev}),[W,D,tZ,n,a,em,ev]);return(0,l.jsxs)("div",{className:g()(T().main,{[T().newsfeedMain]:eb}),ref:eM,children:[tl&&ta&&(0,l.jsx)("div",{className:T().status,style:{backgroundColor:ta.bgColorPrimary}}),A?(0,l.jsx)(eh,{projectUrl:r.project_url,projectTitle:r.project_title,projectLogo:null==r?void 0:r.logo["1x"],postId:a.id,postDuration:eG,postDate:a.date,postView:Z}):(0,l.jsx)("div",{className:T().cardHeader,children:(0,l.jsx)(b.p,{postId:a.id,postDate:a.date,postDuration:eG,postView:Z,postStatus:a.status,pinned:!!a.pinned,className:T().postInfo})}),(0,l.jsxs)("article",{id:"feed-post-".concat(a.id),"data-nd-article":!0,"data-has-files":(null===(t=a.files)||void 0===t?void 0:t.length)?"true":void 0,"data-has-read-actions":eb&&tj?"true":void 0,suppressHydrationWarning:!0,children:[(0,l.jsxs)("div",{className:T().desktop,children:[(0,l.jsxs)("div",{className:T().titleWrapper,children:[(0,l.jsx)(X(),{...eY,className:T().titleLink,children:(0,l.jsx)(eC,{className:"".concat(T().title," ").concat(F?T().visitedTitle:""),level:2,children:a.title})}),(eb||1===r.project_post_expandable)&&tf&&(0,l.jsx)(G.Z,{size:"middle",shape:"circle",type:"text",icon:tE(),onClick:eI?tN:tw,className:T().expandButton,"data-testid":"post-toggle-d-".concat(a.id)})]}),a.available&&(0,l.jsx)(l.Fragment,{children:(()=>{if(eb)return tF(eS,"d");let e=!!eI&&te;return eI&&!te?(0,l.jsxs)(l.Fragment,{children:[tT,1===r.project_post_expandable&&(0,l.jsx)(eg,{actionLabel:ev("Collapse"),actionIcon:(0,l.jsx)(V.Z,{}),actionTestId:"post-col-d-".concat(a.id),onActionClick:tS,postUrl:eK,goToPostLabel:ev("GoToPost"),goToPostTestId:"post-go-d-".concat(a.id),hideGoToPost:eb})]}):e7&&e4?(0,l.jsxs)(l.Fragment,{children:[t_(e4.html,e4.gallerySrc,e4.imagesSrcs),tk(),(0,l.jsx)(eL,{files:a.files,postId:a.id,projectId:r.id,projectLogo:r.logo,postTitle:a.title,onAttachmentClick:td}),1===r.project_post_expandable&&(0,l.jsx)(eg,{actionLabel:ev("Collapse"),actionIcon:(0,l.jsx)(V.Z,{}),actionTestId:"post-col-d-".concat(a.id),onActionClick:tI,postUrl:eK,goToPostLabel:ev("GoToPost"),goToPostTestId:"post-go-d-".concat(a.id),hideGoToPost:eb})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:eS,suppressHydrationWarning:!0,className:g()(T().foldedPost,{[T().foldedPostGradient]:e1||!eb&&e,[T().foldedPostExpandable]:1===r.project_post_expandable,[T().newsfeedFoldedPost]:eb}),id:"foldedPost-".concat(a.id),onClick:1===r.project_post_expandable?void 0:ty,role:1===r.project_post_expandable?void 0:"button",tabIndex:1===r.project_post_expandable?void 0:0,onKeyPress:1===r.project_post_expandable?void 0:tP,style:{cursor:1===r.project_post_expandable?"default":"pointer"},children:tT}),(e1||e)&&1===r.project_post_expandable&&(0,l.jsx)(eg,{actionLabel:ev("Expand"),actionIcon:(0,l.jsx)(q.Z,{}),actionTestId:"post-exp-d-".concat(a.id),onActionClick:eI?tN:tw,postUrl:eK,goToPostLabel:ev("GoToPost"),goToPostTestId:"post-go-d-".concat(a.id),hideGoToPost:eb}),(e1||e)&&1!==r.project_post_expandable&&!eb&&(0,l.jsx)(X(),{...eY,className:T().readMoreLink,children:ev("ReadMore")})]})})()})]}),(0,l.jsxs)("div",{className:T().mobile,children:[(0,l.jsx)("div",{className:T().titleWrapper,children:(0,l.jsx)(X(),{...eY,className:T().titleLink,children:(0,l.jsx)(eC,{className:"".concat(T().title," ").concat(F?T().visitedTitle:""),level:2,children:a.title})})}),a.available&&(0,l.jsx)(l.Fragment,{children:eb?tF(eE,"m"):!eb&&eI?(0,l.jsx)(l.Fragment,{children:tT}):(()=>{let e=1===r.project_post_expandable,t=!eb||!e,o=!!eI&&te;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{ref:eE,"data-testid":"post-fold-m-".concat(a.id),suppressHydrationWarning:!0,className:g()(T().foldedPost,{[T().foldedPostGradient]:e1||!eb&&o,[T
1().foldedPostExpandable]:eb&&e,[T().newsfeedFoldedPost]:eb}),id:"foldedPost-mobile-".concat(a.id),onClick:t?ty:void 0,role:t?"button":void 0,tabIndex:t?0:void 0,onKeyPress:t?tP:void 0,style:{cursor:t?"pointer":"default"},children:tT}),(e1||o)&&eb&&e&&(0,l.jsx)(eg,{actionLabel:ev("Expand"),actionIcon:(0,l.jsx)(q.Z,{}),actionTestId:"post-exp-m-".concat(a.id),onActionClick:eI?tN:tw,postUrl:eK,goToPostLabel:ev("GoToPost"),goToPostTestId:"post-go-m-".concat(a.id),hideGoToPost:eb}),(e1||o)&&!eb&&(0,l.jsx)(X(),{...eY,className:T().readMoreLink,children:ev("ReadMore")})]})})()})]}),!a.available&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.U4,{offer:to,project:r,post:a,image:eq,imageAlt:eW?a.title:"",userId:E,isFeedView:!0}),a.teaser&&(0,l.jsx)(ew,{className:T().teaserText,children:a.teaser}),(0,l.jsx)(X(),{href:ti,className:T().subscribeLink,children:ts})]})]}),a&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:g()({[T().newsfeedFooter]:eb}),children:[(0,l.jsxs)("div",{className:T().iconBlock,children:[(0,l.jsx)(eT,{postUrl:eK,project:r,liked:eR,favorite:eO,data:"feed-post-".concat(a.id),disabled:eF,isPrimary:!0,icons:d.ci,counters:eA,likeHandler:tu,favoriteHandler:tc,projectTitle:r.project_title,shareType:c.yw.POST_FEED,commentDisableReason:I,isLikeDisabled:tM,likeDisabledMessage:tA,mobileDisabledFeedback:tm}),(0,l.jsxs)("div",{className:T().levelChipWrapper,children:[(0,l.jsx)(v.X,{title:tD.title,"data-testid":tD.testId,className:T().levelChip,children:(0,l.jsx)("div",{className:T().iconWrapper,children:tD.icon})}),(0,l.jsxs)("div",{className:T().levelIcon,children:[n&&(a.available||D||W?(0,l.jsx)(H.Z,{title:S?ev("Level.YourLevel",{level:null==S?void 0:null===(o=S.level)||void 0===o?void 0:o.name}):W||D?ev("Level.PostLevel",{level:null==n?void 0:n.level_name}):void 0,getPopupContainer:$.Qh,autoAdjustOverflow:!1,placement:"bottom",children:(0,l.jsx)("span",{className:T().levelTooltipTrigger,children:(0,l.jsx)(K.Z,{width:19,height:19})})}):(0,l.jsx)(H.Z,{title:tD.tooltipTitle,placement:"bottom",getPopupContainer:$.Qh,autoAdjustOverflow:!1,children:(0,l.jsx)("span",{className:T().levelTooltipTrigger,children:(0,l.jsx)(Q.Z,{width:19,height:19})})})),!n&&tZ&&(0,l.jsx)(H.Z,{title:tD.tooltipTitle,getPopupContainer:$.Qh,autoAdjustOverflow:!1,placement:"bottom",children:(0,l.jsx)("span",{className:T().levelTooltipTrigger,children:a.available||D||W?(0,l.jsx)(K.Z,{width:19,height:19}):(0,l.jsx)(Q.Z,{width:19,height:19})})}),!n&&!tZ&&(0,l.jsx)(H.Z,{title:em("Post.Free"),getPopupContainer:$.Qh,autoAdjustOverflow:!1,placement:"bottom",children:(0,l.jsx)(z.Z,{})})]})]})]}),eb&&(0,l.jsx)("div",{className:T().goToPostAction,children:(0,l.jsxs)(G.Z,{size:"large",href:eK,className:T().goToPostButton,"data-testid":"post-go-".concat(a.id),children:[(0,l.jsx)("span",{className:T().goToPostDesktopLabel,children:ev("GoToPost")}),(0,l.jsx)("span",{className:T().goToPostMobileLabel,children:ev("GoToPostMobile")})]})})]}),!!(null===(i=a.tags)||void 0===i?void 0:i.length)&&(0,l.jsx)(ey,{tags:a.tags,postId:a.id,projectUrl:r.project_url})]})]})});var eN=o(90457),eS=o(4116),eE=o(47528),eM=o(31156),eA=o.n(eM);let eF=e=>{let{projectUrl:t,projectTitle:o,projectLogo:i,className:s}=e,a=(0,er.t)(),n=null==i?void 0:i.split("?")[1],r=i?(0,ei.t)("".concat(a).concat(i),"crop","100x100",void 0,n):void 0;return(0,l.jsxs)(X(),{href:"/".concat(t,"/"),className:"".concat(eA().projectHeader," ").concat(s||""),"data-testid":"project-header",children:[(0,l.jsx)(eu.C,{src:r,alt:o,className:eA().avatar,children:!r&&o.charAt(0).toUpperCase()}),(0,l.jsx)("span",{className:eA().projectTitle,children:o})]})};var eZ=o(28809),eD=o.n(eZ);let{Title:eB}=W.default,eW=(0,_.memo)(e=>{var t;let{post:o,project:i,level:s,subscribed:a,userId:n,commentDisableReason:r,favoritePosts:p,isLikedCurrentPost:m,sortedLevels:v,showProjectInfo:h=!1,wasVisited:g=!1}=e,{t:j}=(0,C.$G)("common"),{t:f}=(0,C.$G)("post"),k=(0,er.t)(),{isAuthor:T,isAdmin:w,isAuthorized:I}=(0,L._C)(),{user:S}=(0,ea.oR)().state,[E,M]=(0,_.useState)(!1),[A,F]=(0,_.useState)(!1),[Z,D]=(0,_.useState)(!1),[B,W]=(0,_.useState)(!1),[G,R]=(0,_.useState)({likes:0,comments:0}),[U,O]=(0,_.useState)({title:"",action:""}),[V,q]=(0,_.useState)(""),[J,eo]=(0,_.useState)(),es=(0,$.by)(i.project_url,o),el=(0,_.useMemo)(()=>(0,ec.j)(es),[es]),en=!!o.image,ed=T||w,eu=(0,$.Aq)(o.status,o.date),ep=(0,$.PD)(o,null!=v?v:[]),e_=(0,_.useCallback)(async()=>{D(!0);try{let e=await (0,et.o)(o.id,i.id);if(!e.success)return x.r.error({content:j("Message.CommonError")});!0===e.deleted?x.r.info({content:j("Post.RemoveFromFavorites")}):x.r.success({content:j("Post.AddToFavorites")}),F(e=>!e)}catch(e){x.r.error({content:j("Message.CommonError")})}finally{D(!1)}},[o.id,i.id,j]),em=(0,_.useCallback)(async()=>
1{if(!B){W(!0),D(!0);try{if(!await (0,ee.Z)(o.id,i.id))return x.r.error({content:j("Message.CommonError")});let e=await (0,ee.G)(o.id,i.id);if(null===e)return x.r.error({content:j("Message.CommonError")});R(t=>({...t,likes:e})),M(e=>!e)}catch(e){x.r.error({content:j("Message.CommonError")})}finally{W(!1),D(!1)}}},[B,o.id,i.id,j]),ev=(0,_.useMemo)(()=>(0,y.C)(o,f),[o.duration_podcast,o.duration_text,o.duration_video,f]),ex=(0,_.useMemo)(()=>!I||!T&&!w&&(!!S.status&&![Y.J0.Active,Y.J0.NotConfirmed].includes(S.status)||!o.available),[I,T,w,S,o]);(0,_.useEffect)(()=>{if(o&&O(ev),o.image){var e;let t=null===(e=o.image)||void 0===e?void 0:e.split("?")[1];q((0,ei.t)("".concat(k).concat(o.image),"resize","828x468",void 0,t))}else q((0,ei.t)("".concat(k).concat((0,P.M)()),"crop","414x234",".jpg"));R({likes:o.cnt_likes,comments:o.cnt_comments}),F(p.includes(o.id))},[ev,I,null==s?void 0:s.level_price,o,o.cnt_comments,o.cnt_likes,o.id,o.image,k,v,a,p]),(0,_.useEffect)(()=>{var e;(null===(e=o.tags)||void 0===e?void 0:e.length)&&eo(o.tags),M(!!m)},[m,o]);let eh=(0,_.useMemo)(()=>V||(0,P.M)(),[V,P.M]);return(0,l.jsxs)("div",{id:"feed-post-".concat(o.id),className:"".concat(eD().root," ").concat(h?eD().withProjectInfo:""),children:[ed&&eu&&(0,l.jsx)("div",{className:eD().status,style:{backgroundColor:eu.bgColorPrimary}}),(0,l.jsx)(b.p,{postId:o.id,postDate:o.date,postDuration:U,postView:d.Td.tile,postStatus:o.status,pinned:!!o.pinned}),h&&(0,l.jsx)(eF,{projectUrl:i.project_url,projectTitle:i.project_title,projectLogo:null==i?void 0:i.logo["1x"],className:eD().customProjectHeader}),(0,l.jsxs)("div",{className:eD().section,children:[o.available?(0,l.jsxs)(X(),{...el,className:eD().titleLink,children:[(0,l.jsx)(N.Z,{className:"".concat(eD().previewImage," ").concat(eD().previewImageLoading),preview:!1,src:eh,alt:en?o.title:"",loading:"lazy",fallback:eh,onLoad:e=>{let{children:t}=e.currentTarget;t[0].classList.remove(eD().previewImageLoading)}}),(0,l.jsx)(eB,{className:"".concat(eD().title," ").concat(g?eD().visitedTitle:""),level:2,ellipsis:{rows:3},children:o.title})]}):(0,l.jsxs)(eS.Z,{direction:"vertical",size:16,children:[(0,l.jsx)(u.qJ,{postId:o.id,postDate:o.date,projectAccessType:o.project_access_type,historyPost:o.history_post,accessDays:o.history_post&&o.access_days||void 0,accessTime:o.history_post&&o.access_time||void 0,project:i,level:s,levels:v,image:V,imageAlt:en?o.title:"",subscribed:a,post:o,userId:n,isFeedView:!0,isPurchasedPost:null==o?void 0:o.purchased_post}),(0,l.jsx)(X(),{...el,className:eD().titleLink,children:(0,l.jsx)(eB,{className:"".concat(eD().title," ").concat(g?eD().visitedTitle:""),level:2,ellipsis:{rows:3},children:o.title})})]}),(0,l.jsxs)("div",{className:eD().controls,children:[(0,l.jsxs)("div",{className:eD().iconBlock,children:[(0,l.jsx)(eE.IconBlock,{postUrl:es,project:i,liked:E,favorite:A,data:"feed-post-".concat(o.id),disabled:Z,isPrimary:!0,icons:d.ci,counters:G,likeHandler:em,favoriteHandler:e_,projectTitle:i.project_title,shareType:c.yw.POST_FEED,commentDisableReason:r,isLikeDisabled:ex}),(0,l.jsxs)("div",{className:eD().levelIcon,children:[s&&(o.available||T||w?(0,l.jsx)(H.Z,{title:a?f("Level.YourLevel",{level:null==a?void 0:null===(t=a.level)||void 0===t?void 0:t.name}):w||T?f("Level.PostLevel",{level:null==s?void 0:s.level_name}):void 0,children:(0,l.jsx)(K.Z,{width:18,height:18})}):(0,l.jsx)(H.Z,{title:f("Level.PostLevel",{level:null==s?void 0:s.level_name}),children:(0,l.jsx)(Q.Z,{width:18,height:18})})),!s&&ep&&(0,l.jsx)(H.Z,{title:f("Level.PostOnetime"),children:(0,l.jsx)("span",{className:eD().levelTooltipTrigger,children:o.available||T||w?(0,l.jsx)(K.Z,{width:19,height:19}):(0,l.jsx)(Q.Z,{width:19,height:19})})}),!s&&!ep&&(0,l.jsx)(H.Z,{title:j("Post.Free"),children:(0,l.jsx)(z.Z,{})})]})]}),(null==J?void 0:J.length)&&(0,l.jsxs)("div",{className:eD().tagsBlockWrapper,children:[(0,l.jsx)("div",{className:eD().tagsBlock,children:J.map(e=>(0,l.jsx)(eb,{projectUrl:i.project_url,tag:e,postId:o.id},e.tag_id))}),(0,l.jsx)("div",{className:eD().tagsBlockGradient})]})]})]})]})});var eG=o(51309),eH=o(30381),eR=o.n(eH),eU=o(71780),eO=o.n(eU),eV=o(17677),eq=o.n(eV),ez=o(54140),eJ=o(7601),eX=o(12452);let eQ=e=>{let{t}=(0,C.$G)("project"),{posts:o,user:i,subscribed:s,project:c,postsLevels:u,projectLevels:p,clientHtml:m,favoritePosts:v,projectsMap:x,subscribedMap:h,visitedIds:g,postViewMode:j}=e;return x?0===o.length?(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")}):(0,l.jsx)(n.ZP,{itemLayout:"vertical",split:!1,locale:{emptyText:(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")})},children:o.map((e,t)=>{var a,f;let b=(0,ep.H)(e.date).split(" "),y=t>0?o[t-1]:null,P=!y||(0,ep.H)(y.date).split(" ")[1]!==b[1],k=null!==(a=null==x?void 0:x[e.project_id])&&void 0!==a?a:c,T=null!==(f=null==h?void 0:h[e.project_id])&&void 0!==f?f:s,L=t===o.length-1;return(0,l.jsxs)(_.Fragment,{children:[P&&(0,l.jsxs)("h2",{className:eO().date,children:[eJ.c[b[1]]," ",eR()(e.date).year()]}),(0,l.jsx)(n.ZP.Item,{className:eq().listItem,children:(0,l.jsx)(eI,{userId:null==i?void 0:i.id,subscribed:T,post:e,level:u[e.id],project:k||{},isLikedCurrentPost:e.isLiked,breakPost:m.html[e.id],gallerySrc:m.gallerySrc[e.id],imagesSrcs:m.imagesSrcs[e.id],sortedLevels:p,favoritePosts:v,showProjectInfo:!!x,wasVisited:g.has(Number(e.id)),postViewMode:j})}),j===d.Td.newsfeed&&!L&&(0,l.jsx)(r.Z,{type:"horizontal",className:eq().fullWidthDivider})]},e.id)})}):0===o.length?(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")}):(0,l.jsx)(n.ZP,{itemLayout:"vertical",split:!1,locale:{emptyText:(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")})},dataSource:o,renderItem:(e,t)=>
1{let a=t===o.length-1;return(0,l.jsxs)(_.Fragment,{children:[(0,l.jsx)(n.ZP.Item,{className:eq().listItem,children:(0,l.jsx)(eI,{userId:null==i?void 0:i.id,subscribed:s,post:e,level:u[e.id],project:c||{},isLikedCurrentPost:e.isLiked,breakPost:m.html[e.id],gallerySrc:m.gallerySrc[e.id],imagesSrcs:m.imagesSrcs[e.id],sortedLevels:p,favoritePosts:v,wasVisited:g.has(Number(e.id)),postViewMode:j})}),j===d.Td.newsfeed&&!a&&(0,l.jsx)(r.Z,{type:"horizontal",className:eq().fullWidthDivider})]},e.id)}})},eK=e=>{let{t}=(0,C.$G)("project"),{posts:o,project:i,postsLevels:s,subscribed:r,user:d,favoritePosts:c,projectLevels:u,projectsMap:p,subscribedMap:m,visitedIds:v}=e;return p?0===o.length?(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")}):(0,l.jsx)("div",{className:eq().tileGrid,children:o.map((e,t)=>{var a,n;let x=(0,ep.H)(e.date).split(" "),h=t>0?o[t-1]:null,g=!h||(0,ep.H)(h.date).split(" ")[1]!==x[1],j=null!==(a=null==p?void 0:p[e.project_id])&&void 0!==a?a:i,f=null!==(n=null==m?void 0:m[e.project_id])&&void 0!==n?n:r;return(0,l.jsxs)(_.Fragment,{children:[g&&(0,l.jsx)("div",{className:eq().dateHeader,children:(0,l.jsxs)("h2",{className:eO().date,children:[eJ.c[x[1]]," ",eR()(e.date).year()]})}),(0,l.jsx)(eW,{post:e,project:j||{},level:s[e.id],subscribed:f,userId:d.id,sortedLevels:u,favoritePosts:c,isLikedCurrentPost:e.isLiked,showProjectInfo:!!p,wasVisited:v.has(Number(e.id))})]},e.id)})}):(0,l.jsx)(n.ZP,{itemLayout:"vertical",grid:{gutter:24,xs:1,sm:1,md:2,lg:2,xl:2,xxl:2},split:!1,locale:{emptyText:(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")})},dataSource:o,renderItem:e=>(0,l.jsx)(n.ZP.Item,{children:(0,l.jsx)(eW,{post:e,project:i||{},level:s[e.id],subscribed:r,userId:d.id,sortedLevels:u,favoritePosts:c,isLikedCurrentPost:e.isLiked,wasVisited:v.has(Number(e.id))})},e.id)})},e$=e=>{let{t}=(0,C.$G)("project"),o=(0,er.t)(),{posts:i,project:s,projectsMap:n,favoritePosts:r,onFavoriteToggle:c,visitedIds:u}=e,{isAuthor:p,isAdmin:m}=(0,L._C)(),v=p||m,[x,h]=(0,_.useState)({});(0,_.useEffect)(()=>{h(Object.fromEntries(i.map(e=>[e.id,(0,ep.H)(e.date)])))},[i]);let g=(0,_.useMemo)(()=>{if(!n)return i.map(e=>{var t;return{date:null!==(t=x[e.id])&&void 0!==t?t:"",rawDate:e.date,title:e.title,href:(0,$.by)(null==s?void 0:s.project_url,e),id:e.id,imgSrc:e.image?e.image.startsWith("http")?e.image:"".concat(o).concat(e.image):void 0,status:e.status,pinned:!!e.pinned,projectUrl:null==s?void 0:s.project_url,renderIcon:()=>{var t;return v?null===(t=(0,$.Aq)(e.status,e.date))||void 0===t?void 0:t.icon:void 0},wasVisited:u.has(Number(e.id))}});let e=[];return i.forEach((t,l)=>{var a,d;let c;let p=(0,ep.H)(t.date).split(" "),_=l>0?i[l-1]:null;_&&(0,ep.H)(_.date).split(" ")[1]===p[1]||e.push({id:"date-".concat(t.id),isDateHeader:!0,date:"".concat(eJ.c[p[1]]," ").concat(eR()(t.date).year())});let m=null!==(a=n[t.project_id])&&void 0!==a?a:s;t.image&&(c=t.image.startsWith("http")?t.image:"".concat(o).concat(t.image)),e.push({date:null!==(d=x[t.id])&&void 0!==d?d:"",rawDate:t.date,title:t.title,href:(0,$.by)(null==m?void 0:m.project_url,t),id:t.id,imgSrc:c,status:t.status,pinned:!!t.pinned,projectUrl:null==m?void 0:m.project_url,projectName:null==m?void 0:m.project_title,isFavorite:null==r?void 0:r.includes(t.id),renderIcon:()=>{var e;return v?null===(e=(0,$.Aq)(t.status,t.date))||void 0===e?void 0:e.icon:void 0},wasVisited:u.has(Number(t.id))})}),e},[i,n,s,x,o,v,r,u]),j=(0,_.useCallback)((e,t)=>n?"isDateHeader"in t&&t.isDateHeader?(0,l.jsx)("div",{className:eq().rowsDateHeader,children:(0,l.jsx)("h2",{className:eO().date,children:t.date})}):(0,l.jsx)(ez.Z,{...t,onFavoriteClick:c,showDate:!0,showPostNumber:!1}):(0,l.jsx)(ez.Z,{...t}),[n,c]);return(0,l.jsx)(eN.Z,{items:g,renderItem:n?j:void 0,listClassName:n?eq().feedRowsList:void 0,locale:{emptyText:(0,l.jsx)(a.Z,{description:t("Posts.Empty.NotFound")})},listCount:d.Qi.DEFAULT_POSTS_LIMIT,showDate:!0,showPostNumber:!1,onFavoriteToggle:c})};function eY(e){var t,o;let{updatedView:i,initialView:s}=e,{view:a}=(0,eG.E)(null!=i?i:s),n=(0,eX.e)((null!==(o=e.posts)&&void 0!==o?o:[]).map(e=>e.id),!!(null===(t=e.user)||void 0===t?void 0:t.id));switch(a){case d.Td.tile:return(0,l.jsx)(eK,{...e,visitedIds:n});case d.Td.list:return(0,l.jsx)(e$,{...e,visitedIds:n});case d.Td.feed:return(0,l.jsx)(eQ,{...e,visitedIds:n,postViewMode:d.Td.feed});case d.Td.newsfeed:default:return(0,l.jsx)(eQ,{...e,visitedIds:n,postViewMode:d.Td.newsfeed})}}},66248:function(e,t,o){"use strict";var i=o(85893),s=o(44904),l=o(5233),a=o(72271),n=o.n(a);t.Z=function(e){let{current:t,total:o,pageSize:a,onChange:r,disabled:d=!1,showSizeChanger:c=!1,hideOnSinglePage:u=!0,className:p="",size:_="default",showQuickJumper:m=!1,responsive:v=!0}=e,{t:x}=(0,l.$G)("ui");return(0,i.jsx)("div",{className:"".concat(n().paginationWrapper," ").concat(p),role:"navigation","aria-label":x("Pagination.Pagination"),children:(0,i.jsx)(s.Z,{current:t,total:o,pageSize:a,onChange:e=>{r(e)},showSizeChanger:c,disabled:d,hideOnSinglePage:u,size:_,showQuickJumper:m,responsive:v})})}},87538:function(e,t,o){"use strict";o.d(t,{OG:function(){return r},cy:function(){return l},l6:function(){return a},lJ:function(){return n},uS:function(){return i},x4:function(){return s}});let i={DEFAULT_PAGE:1,DEFAULT_POSTS_LIMIT:100,DEFAULT_POSTS_FEED_LIMIT:20,DEFAULT_PROJECTS_LIMIT:60},s={id:0},l={id:3,name:"publicism"},a={finance:1,art_and_movies:2,publicism:3,history:4,science_and_technology:5,politics:6},n={1:"finance",2:"art_and_movies",3:"publicism",4:"history",5:"science_and_technology",6:"politics"},r=["ÐÑблиÑиÑÑика","ÐÑкÑÑÑÑво и кино","ÐÑÑоÑиÑ","ÐаÑка и ÑеÑ
ника","ÐолиÑика","ФинанÑÑ"];i.DEFAULT_PROJECTS_LIMIT,i.DEFAULT_PAGE,i.DEFAULT_PAGE,i.DEFAULT_POSTS_LIMIT},51309:function(e,t,o){"use strict";o.d(t,{E:function(){return n}});var i=o(11163),s=o(51685),l=o(78741),a=o(7325);function n(e,t){var o,n,r,d,c,u,p,_,m,v,x,h,g,j,f,b,y,P,k;let T=(0,i.useRouter)(),L=null===(n=T.query)||void 0===n?void 0:null===(o=n.view)||void 0===o?void 0:o.replace(/\//g,""),w=null!==(f=null!==(j=(0,a.O)(L,s.Td))&&void 0!==j?j:e)&&void 0!==f?f:s.Td.newsfeed,C=null===(d=T.query)||void 0===d?void 0:null===(r=d.orderByType)||void 0===r?void 0:r.replace(/\//g,""),I=null!==(b=(0,a.O)(C,l.Pi))&&void 0!==b?b:l.Pi.DESC,N=null===(u=T.query)||void 0===u?void 0:null===(c=u.paymentFilter)||void 0===c?void 0:c.replace(/\//g,""),S=null!==(y=(0,a.O)(N,l.X))&&void 0!==y?y:l.X.All,E=null===(_=T.query)||void 0===_?void 0:null===(p=_.status)||void 0===p?void 0:p.replace(/\//g,""),M=null!==(P=(0,a.O)(E,l.ze))&&void 0!==P?P:l.ze.ALL,A=null===(m=T.query)||void 0===m?void 0:m.level_id,F=A?parseInt(A,10):null,Z=(null===(x=T.query)||void 0===x?void 0:null===(v=x.startDate)||void 0===v?void 0:v.replace(/\//g,""))||null,D=(null===(g=T.query)||void 0===g?void 0:null===(h=g.endDate)||void 0===h?void 0:h.replace(/\//g,""))||null,B=!!(E||C||N||A||Z||D),W=E?M:null!==(k=null==t?void 0:t.status)&&void 0!==k?k:l.ze.ALL;return{view:w,orderByType:I,paymentFilter:S,level_id:F,startDate:Z,endDate:D,status:M,hasQueryParams:B,effectiveStatus:W}}},76698:function(e,t,o){"use strict";o.d(t,{a:function(){return a}});var i=o(67294),s=o(11163),l=o(44616);let a=(e,t)=>{let o=(0,s.useRouter)();(0,i.useEffect)(()=>{o.isReady&&t&&(0,l.L)("".concat(e,"-").concat(t))},[e,t,o.isReady])}},7325:function(e,t,o){"use strict";function i(e,t){let o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=Object.fromEntries(Object.entries({...e.query,...t}).filter(e=>{let[,t]=e;return null!=t})),l={pathname:e.pathname,query:s},a={scroll:i,shallow:!0};o?e.replace(l,void 0,a):e.push(l,void 0,a)}function s(e,t){if(Array.isArray(t)){if(t.includes(e))return e}else if(Object.values(t).includes(e))return e}o.d(t,{O:function(){return s},r:function(){return i}})},71780:function(e){e.exports={postsContainer:"PostList_postsContainer__2Ip9Q",catalog:"PostList_catalog__Ii3_v",project:"PostList_project__6kIkp",postsContainerWide:"PostList_postsContainerWide__4__Wa",postsContainerWideCrop:"PostList_postsContainerWideCrop__KuLSZ",spinWrapper:"PostList_spinWrapper__ne_VM",date:"PostList_date__xbYKS",pagination:"PostList_pagination__BcpQp",showMore:"PostList_showMore__vqYTA",emptyContainer:"PostList_emptyContainer__TXYQe",description:"PostList_description__VXBf5",link:"PostList_link__DsXcG"}},19928:function(e){e.exports={layout:"index_layout__crlRU",root:"index_root__cUlt7",projectInfo:"index_projectInfo__jMJZv",desktopProjectInfo:"index_desktopProjectInfo__MlQxT",mobileProjectInfo:"index_mobileProjectInfo__6QqFq",desktopProjectMeta:"index_desktopProjectMeta__NFMFr",projectLink:"index_projectLink__XFFg7",avatarLink:"index_avatarLink__bCs8b",avatar:"index_avatar__BIKlF",titleAndTime:"index_titleAndTime__f4lIp",titleLink:"index_titleLink__ak1x8",title:"index_title__AB_1B",postDuration:"index_postDuration__c7foG",time:"index_time__aLrvW"}},96289:function(e){e.exports={layout:"index_layout__JLdX3",postText:"index_postText__8vmLg",paragraphWithoutIndent:"index_paragraphWithoutIndent__wJScy",postTable:"index_postTable__oTjh8",postPoll:"index_postPoll__nc6AF",codeBlock:"index_codeBlock__qnkWG","code-block-line":"index_code-block-line__kwz_K",postVideo:"index_postVideo__o8ag5",postImage:"index_postImage__E_7xr",iconBlock:"index_iconBlock__vrwWI",main:"index_main__JEPsm",postDuration:"index_postDuration__9GCMy",postVideoContentWrapper:"index_postVideoContentWrapper__WhBl1",postVideoContent:"index_postVideoContent__IbSvP",videoContentButton:"index_videoContentButton__SIrkg",videoContentTooltip:"index_videoContentTooltip__rHiTL",divider:"index_divider__L9I1Z",postFirstVideo:"index_postFirstVideo__IWG0Y",videoContentShowButton:"index_videoContentShowButton__ceMLY",videoContentShowTooltip:"index_videoContentShowTooltip__OfzCi"}},58675:function(e){e.exports={layout:"index_layout__wtJPJ",main:"index_main__r7tpI",newsfeedMain:"index_newsfeedMain__eJS__",readMoreLink:"index_readMoreLink__qOJrp",readMoreButton:"index_readMoreButton__PHdby",teaserText:"index_teaserText___jvy_",tagsBlock:"index_tagsBlock__QSgXc",iconBlock:"index_iconBlock___IO5Z",newsfeedFooter:"index_newsfeedFooter__RBjtH",goToPostAction:"index_goToPostAction__Gou7w",readActionButtons:"index_readActionButtons__xvRON",goToPostButton:"index_goToPostButton__EBXAb",goToPostMobileLabel:"index_goToPostMobileLabel__O0zx9",cardHeader:"index_cardHeader__EfV4U",postInfo:"index_postInfo__I9HXH",projectInfo:"index_projectInfo__I_kbX",expandButton:"index_expandButton__AE9nc",postSecondHeader:"index_postSecondHeader__tp_XN",status:"index_status__x6vOk",titleContainer:"index_titleContainer__nm0By",titleWrapper:"index_titleWrapper__oxxRW",desktop:"index_desktop__mEfHg",mobile:"index_mobile__Yl3U2",titleLink:"index_titleLink__8t52D",title:"index_title__mM4NW",visitedTitle:"index_visitedTitle__jD0_K",levelChipWrapper:"index_levelChipWrapper___oDGT",levelChip:"index_levelChip__Bmr84",levelIcon:"index_levelIcon__pBRRU",foldedPost:"index_foldedPost__6uSQ9",foldedPostExpandable:"index_foldedPostExpandable__Lnlsg",foldedPostGradient:"index_foldedPostGradient__kAlW7",newsfeedContent:"index_newsfeedContent__Kz7t6",newsfeedFoldedPost:"index_newsfeedFoldedPost__EFisI",subscribeLink:"index_subscribeLink__FtVxB",loadingReadMoreLabel:"index_loadingReadMoreLabel___VzuP","expand-button-shimmer"
1:"index_expand-button-shimmer__z_LTk",iconWrapper:"index_iconWrapper__Tsg4b",postTable:"index_postTable__pe_Xp",goToPostDesktopLabel:"index_goToPostDesktopLabel__zYWrx",tagsBlockGradient:"index_tagsBlockGradient__kBJT3",tagsBlockWrapper:"index_tagsBlockWrapper__pU_VX"}},17677:function(e){e.exports={tileGrid:"index_tileGrid__Yr8dU",dateHeader:"index_dateHeader__NNAVl",rowsDateHeader:"index_rowsDateHeader__VmiKD",feedRowsList:"index_feedRowsList__vMPly",fullWidthDivider:"index_fullWidthDivider__5GdEi",listItem:"index_listItem__v_FcT"}},31156:function(e){e.exports={layout:"index_layout__laOpD",projectHeader:"index_projectHeader__ADIYF",avatar:"index_avatar__Ab7K_",projectTitle:"index_projectTitle__W7TWG"}},28809:function(e){e.exports={layout:"index_layout__2XE_d",root:"index_root__83xpd",withProjectInfo:"index_withProjectInfo__IBGVp",customProjectHeader:"index_customProjectHeader__8idYX",status:"index_status__KiMKF",titleLink:"index_titleLink__70BF2",title:"index_title__EyY4w",visitedTitle:"index_visitedTitle__vS_Ao",section:"index_section__nT3Lf",controls:"index_controls__GzMV1",iconBlock:"index_iconBlock__rs9Qx",tagsBlockWrapper:"index_tagsBlockWrapper__6TOI_",tagsBlock:"index_tagsBlock___huNu",tagsBlockGradient:"index_tagsBlockGradient__IWLMH",levelIcon:"index_levelIcon__LLR51"}},72271:function(e){e.exports={paginationWrapper:"pagination_paginationWrapper__oojej"}}}]);
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.