1import{V,v as O,q as W,aZ as X,e as J,g as Q,ad as Z,A as G,Q as I,c as a,i as h,E as T,W as $,a as n,J as m,o as i,a3 as q,I as v,aX as A,H as D,X as k,t as Y,a_ as H,R as _,ac as ee,_ as te}from"./oM9zIdsb.js";import{u as se}from"./DWiJAzRA.js";const ne=V("/images/empty/gramophone.png");function oe(u){return u instanceof Error?{message:u.message}:{message:String(u)}}const re=O("news",{state:()=>({screen:null,error:null,isLoading:!1,requestId:0}),actions:{async loadScreen(u,l=1,o=10,p={}){const d=W();if(!d.isAuthorized||!u)return this.clear(),null;const x=++this.requestId,w=d.sessionToken;this.isLoading=!0,this.screen=null,this.error=null;let c;try{const g=await $fetch("/api/v3/news",{query:{page:l,count:o,address:u,date_from:p.dateFrom,date_to:p.dateTo,btlrsid:w}});c={ok:!0,data:X(g)}}catch(g){c={ok:!1,error:oe(g)}}return x!==this.requestId||!d.isAuthorized||d.sessionToken!==w?null:(c.ok?(this.screen=c.data,this.error=null):(this.screen=null,this.error=c.error),this.isLoading=!1,c)},clear(){this.requestId+=1,this.screen=null,this.error=null,this.isLoading=!1}}}),ae={class:"flex flex-col gap-4"},ie={key:1,class:"rounded-[24px] bg-white px-6 py-10 text-center"},le={key:2,class:"flex min-h-[378px] flex-col items-center justify-center rounded-[24px] bg-white px-6 py-10 text-center"},ce=["role","tabindex","onClick","onKeydown"],ue={key:0,class:"relative overflow-hidden rounded-[12px]"},de=["src","alt"],he=["innerHTML"],me=["innerHTML"],M=328/230,pe=J({__name:"news",setup(u){const l=re(),o=Q(),{sessionStore:p,userInfoStore:d}=Z(),{setHeroAction:x,clearHeroAction:w}=se(),{openShareOrExternal:c}=ee(),{$showSnackbar:g}=G(),C=["ЯнваÑÑ","ФевÑалÑ","ÐаÑÑ","ÐпÑелÑ","Ðай","ÐÑнÑ","ÐÑлÑ","ÐвгÑÑÑ","СенÑÑбÑÑ","ÐкÑÑбÑÑ","ÐоÑбÑÑ","ÐекабÑÑ"],N=m(()=>d.residence?.address??""),R=m(()=>d.isLoading||l.isLoading),y=m(()=>[...l.screen?.fixedNews??[],...l.screen?.news??[]]),f=m(()=>{const e=o.query.news_month;if(typeof e!="string")return null;const s=/^(\d{4})-(\d{2})$/.exec(e);if(!s)return null;const t=Number(s[1]),r=Number(s[2]);return!Number.isInteger(t)||r<1||r>12?null:{year:t,month:r}}),z=m(()=>{const e=f.value;return e?C[e.month-1]??"ÐеÑÑÑ":"ÐеÑÑÑ"}),E=m(()=>{const e=f.value;if(!e)return{};const s=String(e.month).padStart(2,"0"),t=new Date(e.year,e.month,0).getDate(),r=String(t).padStart(2,"0");return{dateFrom:`${e.year}-${s}-01T00:00:00.000`,dateTo:`${e.year}-${s}-${r}T23:59:59.999`}});async function P(){if(!p.isAuthorized){l.clear();return}const e=await l.loadScreen(N.value,1,10,E.value);e&&!e.ok&&g(e.error.message??"Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð½Ð¾Ð²Ð¾ÑÑи")}function j(){const e=!!f.value;if(!e&&y.value.length===0){w();return}x({type:"primary",label:z.value,icon:e?"crossWhite":"calendar24",iconPosition:"right",variant:e?"normal":"secondary",height:"h-10",width:"w-auto shrink-0",onClick:e?U:K})}function B(e){const s=new Date(e);if(Number.isNaN(s.getTime()))return"";const t=new Intl.DateTimeFormat("ru-RU",{day:"numeric",month:"long"}).format(s),r=new Intl.DateTimeFormat("ru-RU",{hour:"2-digit",minute:"2-digit"}).format(s);return`${t}, ${r}`}function F(e){return e.imagePosition==="bottom"?"object-bottom":e.imagePosition==="center"?"object-center":"object-top"}function b(e){if(!e.newsId)return;const s={...o.query,panel:"news-detail",news_id:e.newsId};_({path:o.path,query:s})}function S(e){const s=e.target,t=s instanceof Element?s.closest("a[href]"):null;t&&(e.preventDefault(),e.stopPropagation(),c(t.href))}function K(){const e={...o.query,panel:"news-month"};_({path:o.path,query:e})}function U(){const e={...o.query};delete e.news_month,delete e.panel,_({path:o.path,query:e})}return I([()=>p.isAuthorized,N,f],()=>{P()},{immediate:!0}),I([f,()=>y.value.length],()=>{j()},{immediate:!0}),(e,s)=>(i(),a("section",ae,[h(R)?(i(),a(T,{key:0},$(3,t=>n("article",{key:t,class:"rounded-[24px] bg-white p-4"},[t===1?(i(),a("div",{key:0,class:"w-full animate-pulse rounded-[20px] bg-grey-90",style:q({aspectRatio:M})},null,4)):v("",!0),s[0]||(s[0]=n("div",{class:"mt-5 h-5 w-28 animate-pulse rounded-full bg-grey-90"},null,-1)),s[1]||(s[1]=n("div",{class:"mt-4 h-6 w-4/5 animate-pulse rounded-full bg-grey-90"},null,-1)),s[2]||(s[2]=n("div",{class:"mt-3 h-4 w-full animate-pulse rounded-full bg-grey-90"},null,-1)),s[3]||(s[3]=n("div",{class:"mt-2 h-4 w-2/3 animate-pulse rounded-full bg-grey-90"},null,-1))])),64)):h(l).error?(i(),a("section",ie,[...s[4]||(s[4]=[n("h2",{class:"text-24-bold text-black"},"Ðе ÑдалоÑÑ Ð·Ð°Ð³ÑÑзиÑÑ Ð½Ð¾Ð²Ð¾ÑÑи",-1),n("p",{class:"mt-2 text-16 text-grey-40"}," ÐопÑобÑйÑе обновиÑÑ ÑÑÑаниÑÑ Ð¿Ð¾Ð·Ð¶Ðµ ",
1-1)])])):h(y).length===0?(i(),a("section",le,[...s[5]||(s[5]=[n("img",{src:ne,alt:"",class:"h-auto w-[220px] max-w-full shrink-0",draggable:"false"},null,-1),n("h2",{class:"mt-8 text-24-bold text-black"},"ÐовоÑÑей неÑ",-1),n("p",{class:"mt-3 max-w-[330px] text-16 leading-[1.45] text-grey-40"}," ÐдеÑÑ Ð¿Ð¾ÑвÑÑÑÑ Ð²Ð°Ð¶Ð½Ñе обÑÑÐ²Ð»ÐµÐ½Ð¸Ñ Ð¸ Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ ",-1)])])):(i(!0),a(T,{key:3},$(h(y),(t,r)=>(i(),a("article",{key:t.newsId||`${t.datetime}-${r}`,class:k(["overflow-hidden rounded-[24px] bg-white p-4 transition active:scale-[0.99]",t.newsId?"cursor-pointer":""]),role:t.newsId?"button":void 0,tabindex:t.newsId?0:void 0,onClick:L=>b(t),onKeydown:[A(D(L=>b(t),["prevent"]),["enter"]),A(D(L=>b(t),["prevent"]),["space"])]},[t.imageLink?(i(),a("div",ue,[n("img",{src:t.imageLink,alt:t.title,class:k(["w-full object-cover",F(t)]),style:q({aspectRatio:M}),draggable:"false"},null,14,de)])):v("",!0),n("p",{class:k(["text-grey-40",t.imageLink?"mt-4 text-13":"text-13"])},Y(B(t.datetime)),3),n("h2",{class:"news-html mt-2 text-16 text-black",onClick:S,innerHTML:h(H)(t.title)},null,8,he),t.description?(i(),a("div",{key:1,class:"news-html mt-2 line-clamp-2 whitespace-pre-line text-13 text-grey-40",onClick:S,innerHTML:h(H)(t.description)},null,8,me)):v("",!0)],42,ce))),128))]))}}),we=te(pe,[["__scopeId","data-v-b8d60d17"]]);export{we as default};
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.