PageSourceSearch

https://burninghut.ru/_nuxt/v2.5-BKKwV1hJ.js

js burninghut.ru collected 2026-09-24 17:36:42 UTC 61,497 bytes, 19 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./v2.5-BhXONrG7.js","./entry-BzqvZ8qj.css"])))=>i.map(i=>d[i]);
2import{bc as f,bi as G,bF as q,be as X,b3 as z,a$ as _,bf as c,aM as o,aS as m,aT as S,aU as l,b8 as T,bh as L,aO as $,aR as w,br as E,bm as k,aY as d,aN as u,bX as O,ce as J,cz as h,bg as B,aV as W,aX as Y,a_ as N,dF as Q,dG as x,dH as Ce,c_ as $e,bW as ee,dI as b,cA as ve,dJ as ge,dK as R,aP as we,b7 as te,dL as Se,cX as ke,aZ as Ae,dM as Ie,dN as be,dO as Ee,b6 as Te,cY as Le,bT as Ne,bU as Me,bb as Fe}from"./v2.5-BhXONrG7.js";import{C as De}from"./v2.5-CMojXAEQ.js";import{A as Be}from"./v2.5-CU2XN8rz.js";import{B as Re}from"./v2.5-v3gfoO47.js";import{A as Oe}from"./v2.5-LepDaGUf.js";import{u as Pe}from"./v2.5-Hkp0DjeA.js";import{d as Ue}from"./v2.5-CPDYOnGQ.js";import{v as ne}from"./v2.5-DkgckUMx.js";import{d as He}from"./v2.5-CNWHilYj.js";import{d as Ve}from"./v2.5-wSQKQe-6.js";import{u as qe}from"./v2.5-7u8GmpZv.js";import{a as ze}from"./v2.5-D4aiZnJW.js";import{a as Ye,g as je}from"./v2.5-DkIiwvqz.js";import{u as We}from"./v2.5-DQiUtSN-.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="678a6782-efee-4c21-9953-861ca30992b4",e._sentryDebugIdIdentifier="sentry-dbid-678a6782-efee-4c21-9953-861ca30992b4")}catch{}const Ze=f({name:"ArticleFooter",components:{BHLink:Re,CardFooter:De,ArticleFooterSourceItem:Be},provide(){return{eventItemSharingList:()=>"внизу статьи",eventItemComments:()=>"нижняя иконка комментариев"}},props:{hideTags:{type:Boolean,default:!1},hideSharings:{type:Boolean,default:!1}},setup(){const e=X(),t=Pe();return{article:e.article,isTabletAndMore:z(()=>t.isTabletAndMore),isBigTabletAndMore:z(()=>t.isBigTabletAndMore)}},computed:{filteredTags(){const e=[20874,20873,11214,20837],t=["noad","noadsense","kb"];return this.article?.tags.filter(n=>!e.includes(n.id)).filter(n=>!t.includes(n.slug))},articleMeta(){return this.article.meta},articleInfoClass(){const e="article-footer__info";return{[`${e}--without-tags`]:!this.isShowTags,[`${e}--promo`]:this.isPromo}},articleTagsClass(){return{"article-footer__tags--without-info":!this.isShowInfo}},sources(){const e=[],{createSource:t,articleMeta:n}=this;if(this.isShowAdsSource&&e.push(t("ads-source",this.createAdsSourceLabel(),n.ads_source_url)),this.isShowCoverSource){const i=this.getSourceLabel("Обложка:&nbsp;","cover_source","cover_source_url");e.push(t("cover-source",i,n.cover_source_url))}if(this.isShowPostSource){const i=this.getSourceLabel("Источник:&nbsp;","post_source","post_source_url");e.push(t("post-source",i,n.post_source_url))}if(this.isShowAuthors){const i=this.getSourceLabel("Над текстом работали:&nbsp;","authors","");e.push(t("authors",i))}return e},isShowTags(){return!this.hideTags&&this.filteredTags.length>0},isShowInfo(){const e=this.articleMeta;return e.cover_source||e.post_source||e.authors||this.isShowAdsSource},isShowAuthors(){return this.articleMeta.authors},isShowPostSource(){const e=this.articleMeta;return e.post_source||e.post_source_url},isShowCoverSource(){const e=this.articleMeta;return e.cover_source||e.cover_source_url},isPromo(){return this.article?.is_promo},isAdvertising(){return this.article.is_advertising},isShowAdsSource(){return this.isAdvertising||this.isPromo},errorElemClass(){return{"article-footer__error-elem--promo":this.isPromo}},currentslug(){return G((this._.provides[q]||this.$route).fullPath)}},methods:{createSource(e,t,n=""){return{type:e,label:t,url:n}},createAdsSourceLabel(){const e=this.isPromo?"ads":this.article.advert_label,t=Oe[e]||"",n=this.articleMeta.ads_source.trim()||this.articleMeta.ads_source_url.trim();return n?`${t}:&nbsp;${n}`:t},getSourceLabel(e,t,n){const i=this.articleMeta[t],a=this.articleMeta[n];return`${e}${i||a}`},sendAnalytics(e){this.$sendYandexMetrika({level1:"Клик_теги",level4:Ue(e.url),level5:e.title})}}},"$ai8NZDqOx2"),Ke={class:"article-footer"},Ge={class:"article-footer__tags-list"},Xe={key:2,class:"article-footer__action-list"};function Je(e,t,n,i,a,r){const s=c("BHLink"),p=c("ArticleFooterSourceItem"),y=c("CardFooter");return o(),m("div",Ke,[e.isShowTags?(o(),m("div",{key:0,class:S(["article-footer__tags",e.articleTagsClass])},[l("ul",Ge,[t[0]||(t[0]=l("li",{class:"article-footer__tag-item article-footer__tags-title"},"Теги",-1)),(o(!0),m(T,null,L(e.filteredTags,C=>(o(),m("li",{key:C.id,class:"article-footer__tag-item"},[$(s,{class:"article-footer__tag",href:C.url,onClick:g=>e.sendAnalytics(C)},{default:w(()=>[E(k(C.title),1)]),_:2},1032,["href","onClick"])]))),128))])],2)):d("",!0),e.isShowInfo?(o(),m("div",{key:1,class:S(["article-footer__info",e.articleInfoClass])}
2,[(o(!0),m(T,null,L(e.sources,(C,g)=>(o(),u(p,{key:g,source:C,class:S(["article-footer__info-elem",`article-footer__info-elem--${C.type}`])},null,8,["source","class"]))),128))],2)):d("",!0),O(l("div",{class:S(["article-footer__info-elem article-footer__error-elem",e.errorElemClass])}," Если нашли ошибку, выделите текст и нажмите Ctrl + Enter ",2),[[J,e.isBigTabletAndMore]]),e.hideSharings?d("",!0):(o(),m("div",Xe,[$(y,{class:"article-footer__actions","hide-labels":!1,"hide-share":!1,"hide-date":!0,"hide-reactions":!1,article:e.article,"hide-categories":!0,"is-show-comments-as-button":!0},null,8,["article"])]))])}const bs=_(Ze,[["render",Je],["__scopeId","data-v-e2d301d5"]]),oe=async(e,t)=>{const n={content:e.value,parent:t,post_ID:Number(h().postId)};await h().addNewCommentAction({comment:n,files:e.attachments}),e.value="",e.attachments=[],e.notSavedFiles=[]};class v{constructor({eventName:t,action:n,attachments:i,element:a,errorMessage:r,slugReferer:s}){this.eventName=t,this.action=n,this.attachments="",this.element="",this.errorMessage="",this.slugReferer="",i&&(this.attachments=i),a&&(this.element=a),r&&(this.errorMessage=r),s&&(this.slugReferer=s)}}const j="Отправка",H="ввод",K="скопировать ссылку",se="удалить",Qe="намерение удалить",xe="перейти к корневому комментарию",ie="жалоба",et="скрыть",tt="отменить",A="действия_Комментарии",ae="редактирование_Комметарии",M="ответ_Комментарии",re="поле_ввода_Комментарий",nt="оценка_Комментарии",P="Авторизация_попап",D="изображение_комментарий",ot=f({name:"SvgIcon",props:{tag:{type:String,default:"span"},icon:{type:String,required:!0}},emits:["click"]});function st(e,t,n,i,a,r){return o(),u(W(e.tag),{class:S(`svg-icon svg-icon--${e.icon}`),onClick:t[0]||(t[0]=s=>e.$emit("click",s))},{default:w(()=>[B(e.$slots,"default")]),_:3},8,["class"])}const I=_(ot,[["render",st]]),it=f({name:"CommentAttachmentButton",components:{SvgIcon:I},props:{fileInputName:{type:String,default:void 0},disabled:{type:Boolean,default:!1}},computed:{iconClass(){return{"attachment-button__icon--disabled":this.disabled}}}}),at=["for"];function rt(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("label",{class:"attachment-button",for:e.fileInputName},[$(s,{class:S(["attachment-button__icon",e.iconClass]),icon:"attachment-icon"},null,8,["class"])],8,at)}const ct=_(it,[["render",rt]]),lt=f({name:"CommentButton",props:{type:{type:String,default:"text"},disabled:{type:Boolean,default:!1}},emits:["click"],computed:{buttonClass(){return{[`comment-button--${this.type}`]:this.type}}}}),mt=["disabled"];function ut(e,t,n,i,a,r){return o(),m("button",{disabled:e.disabled,class:S([e.buttonClass,"comment-button"]),onClick:t[0]||(t[0]=s=>e.$emit("click"))},[B(e.$slots,"default",{},void 0,!0)],10,mt)}const ce=_(lt,[["render",ut],["__scopeId","data-v-070dfbff"]]),dt=f({name:"CommentInputActions",components:{CommentButton:ce,CommentAttachmentButton:ct},props:{comment:{type:Object,default:null},type:{type:String,default:"primary"},imageContent:{type:String,default:""},disableSend:{type:Boolean,default:!0},fileInputName:{type:String,default:void 0},attachmentIconActive:{type:Boolean,default:!1}},emits:["show-login","send","remove-attachment"],data(){return{image:""}},computed:{computedType(){return this.type==="primary"?this.type:"text"}},methods:{sendComment(){if(!h().isUserExists){this.$emit("show-login");return}this.$emit("send")},removeAttachment(){this.image="",this.$emit("remove-attachment")}}}),pt={class:"input-footer"},ht={class:"input-footer__actions"};function ft(e,t,n,i,a,r){const s=c("CommentAttachmentButton"),p=c("CommentButton");return o(),m("div",pt,[l("div",ht,[$(s,{class:"input-footer__attachment-button",disabled:!e.attachmentIconActive,"file-input-name":e.fileInputName},null,8,["disabled","file-input-name"]),$(p,{disabled:e.disableSend,type:e.computedType,class:"input-footer__send-button",onClick:e.sendComment},{default:w(()=>[...t[0]||(t[0]=[E(" Отправить ",-1)])]),_:1},8,["disabled","type","onClick"])])])}const _t=_(dt,[["render",ft],["__scopeId","data-v-cc5e707b"]]),yt="оценка_комментарий",Ct="отправка_комментарий",le="жалоба_комментарий",$t=f({name:"CommentAttachment",components:{SvgIcon:I},emits:["remove-attachment"]}),vt={class:"attachment"};function gt(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("div",vt,[l("button",{class:"attachment__remove-btn",onClick:t[0]||(t[0]=p=>e.$emit("remove-attachment"))},[$(s,{class:"attachment__remove-icon",icon:"attachment-remove"})]),B(e.$slots,"default",{},void 0,!0)])}const me=_($t,[["render",gt],["__scopeId","data-v-eace140b"]]),wt=f({name:"FullscreenView",components:{SvgIcon:I},emits:["close"],methods:{close(){this.$emit("close")}}}),St={class:"fullscreen-view"};function kt(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("div",St,[$(s,{tag:"button",icon:"close-cross",class:"fullscreen-view__close",onClick:e.close},null,8,["onClick"]),B(e.$slots,"default",{},void 0,!0)])}const ue=_(wt,[["render",kt],["__scopeId","data-v-9bd36f30"]]),At=f({name:"FullscreenImage",components:{FullscreenView:ue},props:{image:{type:String,required:!0}},emits:["close"],methods:{close(){this.$emit("close")}}}),It=["src"];function bt(e,t,n,i,a,r){const s=c("FullscreenView");return o(),u(s,{onClose:e.close},{default:w(()=>[l("div",{class:"fullscreen-image__wrapper",onClick:t[0]||(t[0]=Y((...p)=>e.close&&e.close(...p),["self"]))},[l("img",{src:e.image,alt:"",class:"fullscreen-image__image"},null,8,It)])]),_:1},8,["onClose"])}const de=_(At,[["render",bt],["__scopeId","data-v-35f9f832"]]),Et=f({name:"CommentImageAttachment",components:{CommentAttachment:me},props:{attachment:{type:String,required:!0}},emits:["remove-attachment"],methods:{openFullscreen(){N().open(de,{image:this.attachment},{transition:"modal-fade"})}}}),Tt=["src"];function Lt(e,t,n,i,a,r){const s=c("CommentAttachment");return o(),u(s,{class:"image-attachment",onRemoveAttachment:t[1]||(t[1]=p=>e.$emit("remove-attachment"))},{default:w(()=>[l("img",{src:e.attachment,alt:"Картинка",class:"image-attachment__image",onClick:t[0]||(t[0]=(...p)=>e.openFullscreen&&e.openFullscreen(...p))},null,8,Tt)]),_:1})}const Nt=_(Et,[["render",Lt],["__scopeId","data-v-251d8f15"]]),Mt=f({name:"VideoModal",components:{FullscreenView:ue},props:{video:{type:Object,required:!0}},emits:["close"],methods:{close(){this.$emit("close")}}}),Ft=["innerHTML"];function Dt(e,t,n,i,a,r){const s=c("FullscreenView");return o(),u(s,{class:"fullscreen-video",onClose:e.close},{default:w(()=>[l("div",{class:"fullscreen-video__embed-wrapper",innerHTML:e.video.embed},null,8,Ft)]),_:1},8,["onClose"])}const pe=_(Mt,[["render",Dt],["__scopeId","data-v-9efc950e"]]),Bt=f({name:"CommentVideoAttachment",components:{CommentAttachment:me,SvgIcon:I},props:{video:{type:Object,required:!0}},emits:["remove-attachment"],methods:{removeAttachment(){this.$emit("remove-attachment")},openFullscreen(){N().open(pe,{video:this.video},{transition:"modal-fade"})}}}),Rt=["src","alt"];function Ot(e,t,n,i,a,r){const s=c("SvgIcon"),p=c("CommentAttachment");return o(),u(p,{class:"video-attachment",onRemoveAttachment:e.removeAttachment},{default:w(()=>[$(s,{icon:"play",tag:"button",class:"video-attachment__video-play",onClick:e.openFullscreen},null,8,["onClick"]),l("img",{src:e.video.thumb,alt:e.video.type,onClick:t[0]||(t[0]=(...y)=>e.openFullscreen&&e.openFullscreen(...y))},null,8,Rt)]),_:1},8,["onRemoveAttachment"])}const Pt=_(Bt,[["render",Ot],["__scopeId","data-v-f51b571d"]]),Ut=f({name:"FileSizeError",components:{ErrorModal:Q},emits:["close"],methods:{close(){this.$emit("close")}}});function Ht(e,t,n,i,a,r){const s=c("ErrorModal");return o(),u(s,{class:"file-size-error",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[l("p",{class:"file-size-error__text"},"Cлишком большой файл. Максимальный файл для загрузки – 1 Мб",-1)])]),_:1},8,["onClose"])}const Vt=_(Ut,[["render",Ht]]),qt=f({name:"FileSizeErrorActionSheet",components:{ErrorActionSheet:x},emits:["close"],methods:{close(){this.$emit("close")}}});function zt(e,t,n,i,a,r){const s=c("ErrorActionSheet");return o(),u(s,{class:"file-size-error-action-sheet",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[l("p",{class:"file-size-error-action-sheet__text"}," Cлишком большой файл. Максимальный файл для загрузки – 1 Мб ",-1)])]),_:1},8,["onClose"])}const Yt=_(qt,[["render",zt],["__scopeId","data-v-561564af"]]),jt=f({name:"FileTypeErrorActionSheet",components:{ErrorActionSheet:x},emits:["close"],methods:{close(){this.$emit("close")}}});function Wt(e,t,n,i,a,r){const s=c("ErrorActionSheet");return o(),u(s,{class:"file-type-error-action-sheet",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[l("p",{class:"file-type-error-action-sheet__text"}," Не можем загрузить такой файл. Выберите изображение формата png, jpg, jpeg или gif ",-1)])]),_:1},8,["onClose"])}const Zt=_(jt,[["render",Wt],["__scopeId","data-v-3179ab55"]]),Kt=f({name:"FileTypeError",components:{ErrorModal:Q},emits:["close"],methods:{close(){this.$emit("close")}}});function Gt(e,t,n,i,a,r){const s=c("ErrorModal");return o(),u(s,{class:"file-type-error",onClose:e.close},{default:w(()=>[...t[0]||(t[0]=[l("p",{class:"file-type-error__text"}," Не можем загрузить такой файл. Выберите изображение формата png, jpg, jpeg или gif ",-1)])]),_:1},8,["onClose"])}const Xt=_(Kt,[["render",Gt]]),Jt="Напишите комментарий",Qt="Авторизуйтесь, чтобы оставить комментарий";function xt(e){return!e?.sub}function en(e){return e?Qt:Jt}const tn=f({name:"CommentInput",directives:{clickOutside:ne},components:{CommentInputActions:_t,CommentImageAttachment:Nt,CommentVideoAttachment:Pt},props:{comment:{type:Object,default(){return null}},type:{type:String,default:"primary"},buttonDisabled:{type:Boolean,default:!1},inputContent:{type:String,default:""}},emits:["focus-input","input-mount","analytics","show-login","send"],data(){return{active:!1,isHovered:!1,scrolled:!1,scrollY:0,scrollTimer:0,analyticIsSend:!1,inputState:$e({value:"",attachments:[],notSavedFiles:[],action:"",video:{delete:!1,content:{}}})}},computed:{isPrimary(){return this.type==="primary"},analyticEventName(){return this.isMainInput?re:this.isReply?M:ae},isMainInput(){return this.isPrimary&&!this.comment},isReply(){return!this.isPrimary&&!this.comment},isEditing(){return!this.isPrimary&&this.comment},disableSend(){return!this.isCommentEdited||this.buttonDisabled},isUserExist(){return h().isUserExists},isLocked(){return xt(h().userData)},placeholder(){return en(this.isLocked)},video(){if(!this.inputState.video.delete)return this.comment?.videos?.[0]},fileInputName(){return`file-input-${this.comment?.id??this.type}`},inputClass(){const e="input";return{[`${e}--primary`]:this.type==="primary",[`${e}--secondary`]:this.type==="secondary",[`${e}--active`]:this.active,[`${e}--has-attachments`]:this.isInputHasAttachments,[`${e}--locked`]:this.isLocked}},isInputHasAttachments(){return this.inputState.attachments.length>0||this.type==="secondary"&&this.isCommentHasFiles},isCommentHasFiles(){return this.comment?.files?.length>0},isInputHasComment(){return!!this.comment},isCommentNotEmpty(){const e=this.inputState.attachments.length>0,t=this.inputState.action==="delete-attachment";return!!this.inputState.value.trim()||e||this.isCommentHasFiles&&!t||!this.inputState.video.delete&&this.comment?.videos?.length>0},isCommentEdited(){const e=this.inputState.attachments.length>0,t=this.inputState.action==="delete-attachment",n=this.inputState.video.delete;return this.isInputHasComment?(this.inputState.value!==this.comment?.content||e||t||n)&&this.isCommentNotEmpty:(this.inputState.value.trim()||e)&&this.isCommentNotEmpty},imageContent(){return this.isCommentHasFiles&&this.inputState.action!=="delete-attachment"&&this.inputState.notSavedFiles.length===0?Ce(this.comment.files[0]).path:this.inputState.notSavedFiles[0]},attachmentIconActive(){return this.active||this.isHovered||this.isCommentNotEmpty}},watch:{scrolled:{handler(e){e&&(window.scrollTo(0,this.scrollY),this.$emit("focus-input"))}},isLocked(e){e&&this.deactivateInput(),this.setHeight()}},beforeMount(){this.inputState.value=this.inputContent,window.addEventListener("resize",this.setHeight)},mounted(){this.setHeight(),this.$emit("input-mount")},methods:{focusInput(){if(this.isLocked)return;const e=this.$refs?.textarea;e&&(e.focus(),setTimeout(()=>{this.$emit("focus-input")},200))},dropFile(e){e.preventDefault(),!this.isLocked&&this.processFile(e.dataTransfer.files[0])},setFile(e){this.isLocked||e.target.files.length>0&&this.processFile(e.target.files[0])},resetFileInput(){this.$refs.fileInput.value=""},checkFileSize(e){return e.size<1048576},errorComponent(e){const t=window.innerWidth<=768;switch(e){case"FileSizeError":return t?Yt:Vt;case"FileTypeError":return t?Zt:Xt}},showFileError(e){const t=this.errorComponent(e);N().open(t,{},{transition:"modal-fade"})},processFile(e){if(!this.analyticIsSend){const n=new v({eventName:this.analyticEventName,attachments:D,action:H});this.$emit("analytics",n),this.analyticIsSend=!0}
2if(!this.checkFileSize(e)){this.showFileError("FileSizeError"),this.resetFileInput();return}if(!this.checkFileType(e.type)){this.showFileError("FileTypeError"),this.resetFileInput();return}const t=new FileReader;t.readAsDataURL(e),t.addEventListener("load",n=>{this.loadFile({file:e,fileString:n.target.result})})},checkFileType(e){return!(!e?.startsWith("image")||!e?.includes("image/gif")&&!e?.includes("image/png")&&!e?.includes("image/jpeg")&&!e?.includes("image/jpg"))},processImageLinkBeforePaste(e){const t=new RegExp("(\\s+)?"+e+"(\\s+)?"),n=this.inputState.value;n.indexOf(e)===0?this.inputState.value=n.replace(t,""):this.inputState.value=n.replace(t," ")},async paste(e){if(this.isLocked){e.preventDefault();return}if(e.clipboardData.files.length>0){e.preventDefault(),this.pasteFile(e);return}const t=e.clipboardData.getData("text/plain");if(this.inputState.attachments.length>0)return;const n=t.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/gm);if(!n)return;const i=[];for(const y of n){const C=$fetch(y,{method:"head"}).catch(g=>{console.error("paste fetch url error",g)});i.push(C)}let a=[];a=await Promise.allSettled(i);let r=null;for(const y of a){if(y.status==="rejected")continue;const C=y.value?.headers?.["content-type"];if(!C?.startsWith("image")&&this.checkFileType(C)&&!(Number(y.value?.headers?.["content-length"])>=1048576)){r=y;break}}if(!r)return;const s=r.value.config.url,p=await $fetch(s,{responseType:"blob",method:"get"}).catch(y=>{throw console.error("paste image fetch error",y),""});this.processFile(p.data),this.processImageLinkBeforePaste(s,t)},pasteFile(e){const t=e.clipboardData.files[0];this.processFile(t)},deactivateInput(){this.$refs.textarea.blur(),this.active=!1},activateInput(){this.isLocked||(this.active=!0,this.focusInput())},onFormClick(){if(this.isLocked){this.requestLogin();return}this.activateInput()},requestLogin(){this.$emit("show-login")},showLogin(){if(setTimeout(()=>{this.deactivateInput()},0),this.isCommentEdited){const e=new v({eventName:P,action:"",element:Ct});this.$emit("show-login",{callback:this.sendComment,analyticData:e})}},removeAttachment(){if(this.isCommentHasFiles&&this.inputState.notSavedFiles[0]!==this.imageContent){if(this.inputState.action="delete-attachment",!this.analyticIsSend){const e=new v({eventName:this.analyticEventName,attachments:D,action:H});this.$emit("analytics",e),this.analyticIsSend=!0}}else this.inputState.notSavedFiles=[],this.inputState.attachments=[],this.resetFileInput();this.setHeight()},removeVideo(){this.inputState.video.delete=!0,this.inputState.video.content=this.comment?.videos[0],this.setHeight()},loadFile(e){this.inputState.attachments[0]=e.file,this.inputState.notSavedFiles[0]=e.fileString,this.setHeight()},applySending(){if(this.isLocked){this.requestLogin();return}if(!this.isUserExist){this.showLogin();return}this.sendComment()},sendComment(){this.isCommentEdited&&this.$emit("send",this.inputState)},async onInputTextarea(e){if(!this.isLocked&&(await this.setHeight(),this.inputState.value=e.target.value,!this.analyticIsSend)){this.analyticIsSend=!0;const t=new v({eventName:this.analyticEventName,action:H});this.$emit("analytics",t)}},async setHeight(){const e=this.$refs.textarea;await this.$nextTick(),e&&(e.style.height="auto",e.style.height=e.scrollHeight+"px")},setHovered(e){this.isHovered=e}}}),nn={class:"input__input-wrapper"},on=["tabindex","readonly","value","placeholder","aria-label"],sn={key:0,class:"input__locked-placeholder","aria-hidden":"true"},an={class:"input__locked-placeholder-title"},rn=["id"],cn={class:"input__attachments"};function ln(e,t,n,i,a,r){const s=c("CommentImageAttachment"),p=c("CommentVideoAttachment"),y=c("CommentInputActions"),C=ee("click-outside");return O((o(),m("form",{class:S(["input",e.inputClass]),onDragover:t[3]||(t[3]=Y(()=>{},["prevent"])),onDrop:t[4]||(t[4]=(...g)=>e.dropFile&&e.dropFile(...g)),onSubmit:t[5]||(t[5]=Y(()=>{},["prevent"])),onMouseover:t[6]||(t[6]=g=>e.setHovered(!0)),onMouseleave:t[7]||(t[7]=g=>e.setHovered(!1)),onClick:t[8]||(t[8]=(...g)=>e.onFormClick&&e.onFormClick(...g))},[l("div",nn,[l("textarea",{ref:"textarea",rows:"1",tabindex:e.isLocked?-1:0,readonly:e.isLocked,class:"input__textarea",contenteditable:"true",value:e.inputState.value,placeholder:e.isLocked?"":e.placeholder,"aria-label":e.isLocked?e.placeholder:void 0,onPaste:t[0]||(t[0]=(...g)=>e.paste&&e.paste(...g)),onInput:t[1]||(t[1]=(...g)=>e.onInputTextarea&&e.onInputTextarea(...g))},null,40,on),e.isLocked&&!e.inputState.value?(o(),m("div",sn,[l("span",an,k(e.placeholder),1)])):d("",!0),l("input",{id:e.fileInputName,ref:"fileInput",accept:".jpg, .jpeg, .png, .gif",class:"input__file-input",type:"file",onChange:t[2]||(t[2]=(...g)=>e.setFile&&e.setFile(...g))},null,40,rn),l("div",cn,[e.imageContent?(o(),u(s,{key:0,attachment:e.imageContent,class:"input__image-attachment",onRemoveAttachment:e.removeAttachment},null,8,["attachment","onRemoveAttachment"])):d("",!0),e.video?(o(),u(p,{key:1,video:e.video,class:"input__video-attachment",onRemoveAttachment:e.removeVideo},null,8,["video","onRemoveAttachment"])):d("",!0)])]),$(y,{"file-input-name":e.fileInputName,"disable-send":e.disableSend||e.isLocked,"image-content":e.imageContent,comment:e.comment,type:e.type,"attachment-icon-active":e.attachmentIconActive&&!e.isLocked,class:"input__footer",onShowLogin:e.showLogin,onLoadFile:e.loadFile,onSend:e.applySending},null,8,["file-input-name","disable-send","image-content","comment","type","attachment-icon-active","onShowLogin","onLoadFile","onSend"])],34)),[[C,e.deactivateInput]])}const he=_(tn,[["render",ln],["__scopeId","data-v-239cd86d"]]),mn=f({name:"CommentInputBannedPlate",components:{SvgIcon:I},computed:{rules(){return b==="burninghut"?"https://burninghut.ru/pravila-soobshhestva/":"https://lifehacker.ru/pravila-soobshhestva/"},mail(){return b==="burninghut"?"[email protected]":"[email protected]"}}}),un={class:"comment-input-banned-plate"},dn={class:"comment-input-banned-plate__content"},pn={class:"comment-input-banned-plate__text"},hn=["href"],fn=["href"];function _n(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("div",un,[l("div",dn,[$(s,{class:"comment-input-banned-plate__icon",icon:"banned-icon"}),l("div",pn,[t[0]||(t[0]=E(" Ваш аккаунт заблокирован за нарушение ",-1)),l("a",{href:e.rules},"правил сообщества",8,hn),t[1]||(t[1]=E(". Если произошла ошибка, напишите на ",-1)),l("a",{href:"mailto:"+e.mail},k(e.mail),9,fn),t[2]||(t[2]=E(". ",-1))])])])}
2const yn=_(mn,[["render",_n],["__scopeId","data-v-0248b41c"]]),Cn=f({name:"FileImage",props:{file:{type:Object,required:!0}},methods:{openFullscreen(){N().open(de,{image:this.file.path},{transition:"modal-fade"})}}}),$n={class:"file-image"},vn=["src"];function gn(e,t,n,i,a,r){return o(),m("div",$n,[l("img",{class:"file-image__img",src:e.file.path,alt:"",onClick:t[0]||(t[0]=(...s)=>e.openFullscreen&&e.openFullscreen(...s))},null,8,vn)])}const wn=_(Cn,[["render",gn],["__scopeId","data-v-013bc37d"]]),Sn=f({name:"FileVideo",components:{SvgIcon:I},props:{video:{type:Object,required:!0}},methods:{showVideo(){N().open(pe,{video:this.video},{transition:"modal-fade"})}}}),kn={class:"file-video"},An=["src","alt"];function In(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("div",kn,[$(s,{icon:"play",tag:"button",class:"file-video__play",onClick:e.showVideo},null,8,["onClick"]),l("img",{class:"file-video__preview",src:e.video.thumb,alt:e.video.type,onClick:t[0]||(t[0]=(...p)=>e.showVideo&&e.showVideo(...p))},null,8,An)])}const bn=_(Sn,[["render",In],["__scopeId","data-v-cb51c0eb"]]),En=f({name:"CommentFiles",components:{FileImage:wn,FileVideo:bn},props:{comment:{type:Object,required:!0}},computed:{isCommentHasVideo(){return this.comment.videos.length>0},mappedFiles(){return ve(this.comment.files)}}}),Tn={class:"comment-files"};function Ln(e,t,n,i,a,r){const s=c("FileImage"),p=c("FileVideo");return o(),m("div",Tn,[(o(!0),m(T,null,L(e.mappedFiles,(y,C)=>(o(),u(s,{key:C,class:"comment-files__image",file:y},null,8,["file"]))),128)),e.isCommentHasVideo?(o(),u(p,{key:0,class:"comment-files__video",video:e.comment.videos[0]},null,8,["video"])):d("",!0)])}const Nn=_(En,[["render",Ln],["__scopeId","data-v-e6f3c228"]]),Mn=f({name:"IconButton",components:{SvgIcon:I},props:{label:{type:String,default:"Кнопка"},icon:{type:String,required:!0}},emits:["click"]});function Fn(e,t,n,i,a,r){const s=c("SvgIcon");return o(),u(s,{class:"icon-button",tag:"button","aria-label":e.label,icon:e.icon,onClick:t[0]||(t[0]=p=>e.$emit("click"))},{default:w(()=>[B(e.$slots,"default")]),_:3},8,["aria-label","icon"])}const U=_(Mn,[["render",Fn]]);function F(e,t){return e==null||e===""||t==null||t===""?!1:String(e)===String(t)}const Dn=f({name:"CommentFooter",components:{CommentButton:ce,IconButton:U},props:{comment:{type:Object,required:!0},showReply:{type:Boolean,required:!0}},emits:["show-login","send-rate","open-reply","close-reply"],computed:{userData(){return h().userData},isUserExist(){return h().isUserExists},isUserBanned(){return h().isUserBanned},isShowRatingButtons(){return!this.isUserBanned},isShowReplyButton(){return!this.showReply&&!this.isUserBanned},userId(){return this.userData?.sub},isOwnComment(){return F(this.comment.author_id,this.userId)},isLiked(){return!!this.likes?.find(e=>F(e.author_id,this.userId))},isDisliked(){return!!this.dislikes?.find(e=>F(e.author_id,this.userId))},likesClass(){const e="comment-footer__button";return{[`${e}--liked`]:this.isLiked&&!this.isOwnComment,[`${e}--own-comment`]:this.isOwnComment,[`${e}--empty`]:!this.likes?.length}},dislikeClass(){const e="comment-footer__button";return{[`${e}--disliked`]:this.isDisliked,[`${e}--own-comment`]:this.isOwnComment,[`${e}--empty`]:!this.dislikes?.length}},likes(){return this.comment?.reactions?.filter(e=>e.state==="like")??[]},dislikes(){return this.comment?.reactions?.filter(e=>e.state==="dislike")??[]},likeText(){const e=this.likes?.length;return e===0?"+":"+"+e},dislikeText(){const e=this.dislikes?.length;return e===0?"-":"-"+e}},mounted(){document.addEventListener("click",this.checkClick)},methods:{showLogin(){this.$emit("show-login")},applySending(e){if(!this.isOwnComment){if(!this.isUserExist){const t=new v({eventName:P,action:"",element:yt});this.$emit("show-login",{callback:()=>{this.sendRate(e)},analyticData:t});return}this.sendRate(e)}},sendRate(e){let t=e;this.isLiked&&e==="like"&&(t="remove like"),this.isDisliked&&e==="dislike"&&(t="remove dislike");const n={comment_id:this.comment.id,state:t};this.$emit("send-rate",n)},openInput(){this.$emit("open-reply")},closeInput(){this.$emit("close-reply")},checkClick(e){const t=e.target,n=this.$refs.replyButton,i=Array.from(t.classList),a=t===n;if(i.includes("comment-footer__button--reply")&&!this.showReply){this.closeInput();return}a&&this.openInput()}}}),Bn={class:"comment-footer"},Rn=["disabled"],On=["disabled"];function Pn(e,t,n,i,a,r){const s=c("CommentButton"),p=c("IconButton");return o(),m("div",Bn,[e.isShowRatingButtons?(o(),m("button",{key:0,class:S([e.likesClass,"comment-footer__button comment-footer__button--reaction comment-footer__button--like"]),disabled:e.isOwnComment,onClick:t[0]||(t[0]=y=>e.applySending("like"))}
2,[l("span",null,k(e.likeText),1)],10,Rn)):d("",!0),e.isShowRatingButtons?(o(),m("button",{key:1,class:S([e.dislikeClass,"comment-footer__button comment-footer__button--reaction comment-footer__button--dislike"]),disabled:e.isOwnComment,onClick:t[1]||(t[1]=y=>e.applySending("dislike"))},k(e.dislikeText),11,On)):d("",!0),e.isShowReplyButton?(o(),u(s,{key:2,ref:"replyButton",class:"comment-footer__button comment-footer__button--reply",onClick:e.openInput},{default:w(()=>[...t[2]||(t[2]=[E(" Ответить ",-1)])]),_:1},8,["onClick"])):d("",!0),e.showReply?(o(),u(p,{key:3,class:"comment-footer__close-reply",label:"Отменить ответ",icon:"close-reply",onClick:e.closeInput},null,8,["onClick"])):d("",!0)])}const Un=_(Dn,[["render",Pn],["__scopeId","data-v-2e95d51c"]]),Hn=f({name:"ActionItem",components:{SvgIcon:I},props:{item:{type:Object,required:!0}},emits:["click"],computed:{actionClass(){return{[`action--${this.item.name}`]:!0}}},methods:{emitEvent(){this.$emit("click",this.item)}}}),Vn={class:"action__title"};function qn(e,t,n,i,a,r){const s=c("SvgIcon");return o(),m("button",{class:S([e.actionClass,"action"]),onClick:t[0]||(t[0]=(...p)=>e.emitEvent&&e.emitEvent(...p))},[$(s,{class:"action__icon",icon:e.item.icon},null,8,["icon"]),l("span",Vn,k(e.item.title),1)],2)}const fe=_(Hn,[["render",qn],["__scopeId","data-v-f3eb26c4"]]),zn=f({name:"ActionsPopup",components:{ActionsItem:fe},props:{comment:{type:Object,required:!0}},emits:["copy-link","delete-comment-target","report","edit","to-top","delete-comment","close"],data(){return{isShowApplyDelete:!1}},computed:{userData(){return h().userData},isUserBanned(){return h().isUserBanned},isHasChildren(){return this.comment.children.length>0},isRootComment(){return this.comment.level===0},isShowApplyDeleteButton(){return this.isShowApplyDelete&&this.isOwnComment&&!this.isUserBanned},isShowDeleteButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isShowApplyDeleteButton},isShowReportButton(){return!this.isUserBanned&&!this.isOwnComment},isShowEditButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isHasChildren},isOwnComment(){return F(this.comment.author_id,this.userData?.sub)},isShowToTopButton(){return!this.isRootComment},items(){return[{name:"edit",icon:"edit-comment",title:"Редактировать"},{name:"to-top",icon:"to-top",title:"В начало ветки"},{name:"copy-link",icon:"copy-link",title:"Скопировать ссылку"},{name:"report",icon:"report",title:"Пожаловаться"},{name:"delete",icon:"delete",title:"Удалить комментарий"},{name:"apply-delete",icon:"delete",title:"Точно удалить?"}]}},beforeUnmount(){document.removeEventListener("keyup",this.hidePopupOnESCKey)},mounted(){document.addEventListener("keyup",this.hidePopupOnESCKey)},methods:{onClickAction(e){switch(e.name){case"copy-link":this.$emit("copy-link");break;case"delete":this.$emit("delete-comment-target"),this.showApplyDelete();break;case"report":this.$emit("report");break;case"edit":this.$emit("edit");break;case"to-top":this.$emit("to-top");break;case"apply-delete":this.$emit("delete-comment");break}},showApplyDelete(){this.isShowApplyDelete=!0},hideApplyDelete(){this.isShowApplyDelete=!1},hidePopupOnESCKey(e){e.key==="Escape"&&this.$emit("close")}}}),Yn={class:"actions-popup"};function jn(e,t,n,i,a,r){const s=c("ActionsItem");return o(),m("div",Yn,[e.isShowEditButton?(o(),u(s,{key:0,class:"actions-popup__item",item:e.items[0],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowToTopButton?(o(),u(s,{key:1,class:"actions-popup__item",item:e.items[1],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),$(s,{class:"actions-popup__item",item:e.items[2],onClick:e.onClickAction},null,8,["item","onClick"]),e.isShowReportButton?(o(),u(s,{key:2,class:"actions-popup__item",item:e.items[3],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowDeleteButton?(o(),u(s,{key:3,class:"actions-popup__item",item:e.items[4],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowApplyDeleteButton?(o(),u(s,{key:4,class:"actions-popup__item",item:e.items[5],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0)])}const Wn=_(zn,[["render",jn]]),_e=async e=>{if(navigator.clipboard!==void 0)return await navigator.clipboard.writeText(e),!0;const t=document.createElement("textarea");return t.textContent=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0},Zn=f({name:"CommentActionsModal",components:{Actionsheet:ge,ActionsItem:fe},props:{comment:{type:Object,required:!0},editCallback:{type:Function,required:!0},showLogin:{type:Function,required:!0},emitReport:{type:Function,required:!0}
2,toTop:{type:Function,required:!0}},emits:["close","analytics"],data(){return{isShowApplyDelete:!1}},computed:{userData(){return h().userData},isUserExist(){return h().isUserExists},isUserBanned(){return h().isUserBanned},isHasChildren(){return this.comment.children.length>0},isRootComment(){return this.comment.level===0},isShowApplyDeleteButton(){return this.isShowApplyDelete&&this.isOwnComment&&!this.isUserBanned},isShowDeleteButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isShowApplyDeleteButton},isShowReportButton(){return!this.isUserBanned&&!this.isOwnComment},isShowEditButton(){return!this.isUserBanned&&this.isOwnComment&&!this.isHasChildren},isOwnComment(){return F(this.comment.author_id,this.userData?.sub)},isShowToTopButton(){return!this.isRootComment},items(){return[{name:"edit",icon:"edit-comment",title:"Редактировать"},{name:"to-top",icon:"to-top",title:"В начало ветки"},{name:"copy-link",icon:"copy-link",title:"Скопировать ссылку"},{name:"report",icon:"report",title:"Пожаловаться"},{name:"delete",icon:"delete",title:"Удалить комментарий"},{name:"apply-delete",icon:"delete",title:"Точно удалить?"}]}},methods:{getCommentLink(){const{location:e}=window;return`${e.origin+e.pathname+e.search}#comment-${this.comment.id}`},async copyLink(){try{await _e(this.getCommentLink()),R(this.$modal,{id:Date.now(),title:"Ссылка скопирована"}),this.closeActionSheet()}catch{R(this.$modal,{id:Date.now(),title:"Не удалось скопировать ссылку"})}},closeActionSheet(){this.$emit("close")},onClickAction(e){switch(e.name){case"delete":this.showApplyDelete();break;case"edit":this.activateEdit();break;case"to-top":this.scrollToParent();break;case"apply-delete":this.applyDelete();break;case"copy-link":this.copyLink();break;case"report":this.applyReport();break}},async applyDelete(){const e=new v({action:se,eventName:A});this.$emit("analytics",e),h().setAnalytics(e),await h().deleteComment(this.comment.id),this.closeActionSheet()},activateEdit(){this.editCallback(),this.closeActionSheet()},showApplyDelete(){this.isShowApplyDelete=!0},scrollToParent(){this.closeActionSheet(),this.toTop()},applyReport(){if(this.isUserExist){const e=new v({action:ie,eventName:A});this.$emit("analytics",e),h().setAnalytics(e),this.report()}else{const e=new v({eventName:P,action:"",element:le});this.showLogin({callback:this.report,analyticData:e});return}},async report(){await h().reportComment(this.comment.id),this.emitReport(),this.closeActionSheet()},hideApplyDelete(){this.isShowApplyDelete=!1}}});function Kn(e,t,n,i,a,r){const s=c("ActionsItem"),p=c("Actionsheet");return o(),u(p,{class:"actions-action-sheet","close-click-outside":!0,onClose:e.closeActionSheet},{default:w(()=>[e.isShowEditButton?(o(),u(s,{key:0,class:"actions-popup__item",item:e.items[0],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowToTopButton?(o(),u(s,{key:1,class:"actions-popup__item",item:e.items[1],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),$(s,{class:"actions-popup__item",item:e.items[2],onClick:e.onClickAction},null,8,["item","onClick"]),e.isShowReportButton?(o(),u(s,{key:2,class:"actions-popup__item",item:e.items[3],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowDeleteButton?(o(),u(s,{key:3,class:"actions-popup__item",item:e.items[4],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0),e.isShowApplyDeleteButton?(o(),u(s,{key:4,class:"actions-popup__item",item:e.items[5],onClick:e.onClickAction},null,8,["item","onClick"])):d("",!0)]),_:1},8,["onClose"])}const Gn=_(Zn,[["render",Kn]]),Xn=f({name:"CommentActions",directives:{clickOutside:ne},components:{IconButton:U,ActionsPopup:Wn},props:{comment:{type:Object,required:!0}},emits:["analytics","report","show-login","activate-edit","close"],data(){return{showPopup:!1}},computed:{isUserExist(){return h().isUserExists}},methods:{getCommentLink(){const{location:e}=window;return`${e.origin+e.pathname+e.search}#comment-${this.comment.id}`},async copyLink(){try{await _e(this.getCommentLink()),R(this.$modal,{id:Date.now(),title:"Ссылка скопирована"});const e=new v({action:K,eventName:A});this.$emit("analytics",e),this.closePopup()}catch{const e=new v({action:K,eventName:A,errorMessage:"произошла ошибка"});this.$emit("analytics",e),R(this.$modal,{id:Date.now(),title:"Не удалось скопировать ссылку"})}},applyReport(){if(this.isUserExist){const e=new v({action:ie,eventName:A});this.$emit("analytics",e),h().setAnalytics(e),this.report()}else{const e=new v({eventName:P,action:"",element:le});this.$emit("analytics",e),this.showLogin({callback:this.report,analyticData:e});return}},async report(){await h().reportComment(this.comment.id),this.$emit("report"),this.closePopup()},emitReport(){this.$emit("report")},showLogin(e){this.$emit("show-login",e)},togglePopup(){window.innerWidth>=768?this.showPopup=!this.showPopup:N().open(Gn,{comment:this.comment,editCallback:this.activateEdit,showLogin:this.showLogin,emitReport:this.emitReport,toTop:this.scrollToRoot},{transition:"modal-fade",align:"bottom"})},activateEdit(){this.closePopup(),this.$emit("activate-edit")},closePopup(){this.showPopup=!1},async deleteComment(){const e=new v({action:se,eventName:A});this.$emit("analytics",e),h().setAnalytics(e),await h().deleteComment(this.comment.id),this.closePopup()},async deleteCommentTarget(){const e=new v({action:Qe,eventName:A});this.$emit("analytics",e)},scrollToRoot(){const e=document.querySelector(`#comment-${this.comment.root}`);if(!e)return;document.documentElement.style.scrollBehavior="smooth";const n=e.getBoundingClientRect().top;window.scrollBy(0,n),document.documentElement.style.scrollBehavior="",this.closePopup();const i=new v({action:xe,eventName:A});this.$emit("analytics",i)}}}),Jn={class:"comment-actions"};function Qn(e,t,n,i,a,r){const s=c("IconButton"),p=c("ActionsPopup"),y=ee("click-outside");return o(),m("div",Jn,[$(s,{class:"comment-actions__button",label:"Открыть меню",icon:"comment-actions",onClick:e.togglePopup},null,8,["onClick"]),$(we,{name:"actions-fade"},{default:w(()=>[e.showPopup?O((o(),u(p,{key:0,comment:e.comment,class:"comment-actions__popup",onCopyLink:e.copyLink,onDeleteComment:e.deleteComment,onDeleteCommentTarget:e.deleteCommentTarget,onToTop:e.scrollToRoot,onEdit:e.activateEdit,onReport:e.applyReport,onShowLogin:e.showLogin,onActivateEdit:e.activateEdit,onClose:e.closePopup,onAnalytics:t[0]||(t[0]=C=>e.$emit("analytics",C))},null,8,["comment","onCopyLink","onDeleteComment","onDeleteCommentTarget","onToTop","onEdit","onReport","onShowLogin","onActivateEdit","onClose"])),[[y,e.closePopup]]):d("",!0)]),_:1})])}const xn=_(Xn,[["render",Qn],["__scopeId","data-v-86bf2f0f"]]),eo=f({name:"CommentInfo",components:{CommentActions:xn,IconButton:U,ClientOnly:te},props:{comment:{type:Object,required:!0},isActiveEdit:{type:Boolean,default:!1}},emits:["close-edit","analytics","report","show-login","activate-edit"],setup(e){const t=()=>Ye(e.comment.date_gmt),n=qe(`COMMENT_TIME_AGO_${e.comment.id}`,t);return{commentIso:z(()=>ze(je(e.comment.date_gmt))),commentTimeAgo:n,computeTimeAgo:t}},data(){return{isShowDate:!1,noscript:`
3        <noscript>
4            <style>
5               .info__comment-meta-wrapper--edit {
6                    opacity: 1;
7               }
8            </style>
9        </noscript>
10      `,componentStyle:`
11        <noscript>
12            <style>
13               .info__comment-meta-wrapper--edit {
14                    opacity: ${He.isIOS?1:0};
15               }
16            </style>
17        </noscript>
18      `}}
18,computed:{dateClass(){return{"info__comment-date--hidden":!this.isShowDate}},isUpdated(){return!!this.comment.updated_at},isUserExist(){return!!this.comment.avatar},userImage(){return this.comment.avatar?.url||Ve},isDeleted(){return!!this.comment.deleted},isShowActions(){return!this.isDeleted&&!this.isActiveEdit}},mounted(){this.isShowDate=!0,this.commentTimeAgo=this.computeTimeAgo()},methods:{sendAnalytics(e){this.$emit("analytics",e)},report(){this.$emit("report")},showLogin(e){this.$emit("show-login",e)},closeEdit(){this.$emit("close-edit")},activateEdit(){this.$emit("activate-edit")}}}),to={class:"info"},no={class:"info__user-avatar"},oo=["src"],so={class:"info__comment-meta"},io={class:"info__comment-meta-wrapper"},ao={key:0,class:"info__username"},ro={class:"info__comment-meta-wrapper info__comment-meta-wrapper--edit"},co=["innerHTML"],lo=["datetime"],mo={key:0,class:"info__comment-meta-delimiter"},uo={key:1,class:"info__comment-meta-edited"},po={class:"info__comment-meta-wrapper info__comment-meta-wrapper--edit"},ho=["datetime"],fo={key:0,class:"info__comment-meta-delimiter"},_o={key:1,class:"info__comment-meta-edited"};function yo(e,t,n,i,a,r){const s=c("IconButton"),p=c("CommentActions"),y=te;return o(),m("div",to,[l("div",no,[l("img",{src:e.userImage,alt:"",class:"info__user-avatar-img"},null,8,oo)]),l("div",so,[l("div",io,[e.isUserExist?(o(),m("span",ao,k(e.comment.author),1)):d("",!0),e.isActiveEdit?(o(),u(s,{key:1,class:"info__close-edit",icon:"close-reply",onClick:t[0]||(t[0]=C=>e.$emit("close-edit"))})):d("",!0),e.isShowActions?(o(),u(p,{key:2,comment:e.comment,class:"info__actions",onShowLogin:e.showLogin,onReport:e.report,onActivateEdit:e.activateEdit,onAnalytics:e.sendAnalytics},null,8,["comment","onShowLogin","onReport","onActivateEdit","onAnalytics"])):d("",!0)]),$(y,null,{placeholder:w(()=>[l("div",ro,[(o(),u(W("style"),{"component-style":"",innerHTML:""})),O(l("span",{innerHTML:e.noscript},null,8,co),[[J,!1]]),l("time",{class:"info__comment-date info__comment-date--client",datetime:e.commentIso},k(e.commentTimeAgo),9,lo),e.isUpdated?(o(),m("span",mo,"|")):d("",!0),e.isUpdated?(o(),m("span",uo,"изменено")):d("",!0)])]),default:w(()=>[l("div",po,[l("time",{class:"info__comment-date info__comment-date--client",datetime:e.commentIso},k(e.commentTimeAgo),9,ho),e.isUpdated?(o(),m("span",fo,"|")):d("",!0),e.isUpdated?(o(),m("span",_o,"изменено")):d("",!0)])]),_:1})])])}const Co=_(eo,[["render",yo],["__scopeId","data-v-bcf61148"]]),$o=f({name:"CommentReportPlate"}),vo={class:"comment-report-plate"};function go(e,t,n,i,a,r){return o(),m("p",vo,"ПРОВЕРЯЕМ ВАШУ ЖАЛОБУ")}const wo=_($o,[["render",go],["__scopeId","data-v-41d40ce2"]]),So="лайк",ko="дизлайк",Ao="комментарий_дизлайк",Io="комментарий_лайк";function bo(e,...t){return e}const Eo=f({name:"Comment",components:{CommentInfo:Co,CommentInput:he,CommentFooter:Un,CommentFiles:Nn,CommentReportPlate:wo},props:{comment:{type:Object,required:!0}},emits:["comment-mount","analytics","show-login"],data(){return{isShowEdit:!1,isShowReply:!1,isReported:!1,buttonDisabled:!1,focusedInput:!1}},computed:{userData(){return h().userData},isUserBanned(){return h().isUserBanned},commentId(){return`comment-${this.comment.id}`},commentClass(){return{"comment--deleted":this.isDeleted}},commentForInput(){const e={...this.comment};if(this.isShowReply)return null;if(window){const t=document.createElement("div");t.innerHTML=e.content,e.content=t.innerText||""}return e},isShowCommentVerifyPlate(){return this.comment.audit_status_id===2},isShowReportPlate(){return this.isReported},commentContent(){return this.commentContentLinkProcessing(this.comment.content)},isShowFiles(){return(this.comment.files.length>0||this.comment.videos.length>0)&&!this.isShowEdit},isDeleted(){return!!this.comment.deleted},isShowCommentFooter(){return!this.isShowEdit&&!this.isDeleted&&!this.isUserBanned},isShowNestedComments(){return this.comment.children.length>0},inputContent(){return this.isShowEdit?this.commentForInput?.content??"":""},contentClass(){const e="comment__content";return{[`${e}--deleted`]:this.isDeleted&&!this.isShowCommentVerifyPlate,[`${e}--moderated`]:this.isShowCommentVerifyPlate,[`${e}--banned`]:this.isUserBanned}}},beforeMount(){},mounted(){this.comment.isNeedEmitMountEvent&&this.$emit("comment-mount",this.commentId)},methods:{async sendAnalytics(e){await this.$nextTick(),this.$emit("analytics",e)},sanitizeHtmlLinkProtocol(e){return bo(e,{allowedAttributes:{a:["href","rel","target"]},transformTags:{a:function(t,n){try{const i=new URL(n.href);return i.protocol==="http:"&&(i.protocol="https:"),{tagName:t,attribs:{...n,href:i.toString()}}}catch{return{tagName:t,attribs:n}}}}})},commentContentLinkProcessing(e){let t=/test/,n=/test/;return b==="lifehacker"&&(t=/https?:\/\/(www\.)?(?!(www\.)?(dev\.|stage\.)?(lifehacker|lifebeta))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),b==="burninghut"&&(t=/https?:\/\/(www\.)?(?!(www\.)?(dev\.|stage\.)?(burninghut))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),b==="lifehacker"&&(n=/https?:\/\/(www\.)?((www\.)?(dev\.|stage\.)?(lifehacker|lifebeta))\.ru\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),b==="burninghut"&&(n=/https?:\/\/(www\.)?((www\.)?(dev\.|stage\.)?(burninghut))\.ru\b([-a-zA-Z0-9@:%_+~#?&//=]*)(?![^<>]*>|[^"]*?<\/a)/gm),e.replace(t,a=>`<a rel="nofollow" href="${a}" target="_blank">${a}</a>`).replace(n,a=>`<a target="_blank" href="${a}">${a}</a>`)},onChildMount(e){this.$emit("comment-mount",e)}
18,reportComment(){this.isReported=!0},showLogin(e){this.$emit("show-login",e)},sendRate(e){try{const n=e.state==="like"||e.state==="remove like"?So:ko,i=nt;let a={},r=Io;(e.state==="remove like"||e.state==="remove dislike")&&(r=Ao,e.state=null),a=new v({action:n,element:r,eventName:i}),this.$emit("analytics",a),h().setAnalytics(a),h().setLikes(e)}catch(t){this.errorCallback("sendRate",t)}},async saveComment(e){try{this.buttonDisabled=!0,this.isShowEdit&&await this.sendEditedComment(e),this.isShowReply&&await this.sendReply(e),this.closeReply(),this.closeEdit(),this.buttonDisabled=!1,this.$refs.commentInput?.resetFileInput()}catch(t){this.errorCallback("save-comment",t),this.buttonDisabled=!1}},async sendEditedComment(e){const n={comment:{id:this.comment.id,content:e.value},postId:this.comment.post_ID};n.newFiles=e.attachments,n.video=e.video,(e.action==="delete-attachment"||this.comment.files.length>0&&e.attachments.length>0)&&(n.oldFiles=this.comment.files);const i=new v({eventName:ae,action:j});n.newFiles?.length>0&&(i.attachments=D),this.$emit("analytics",i),h().setAnalytics(i),h().saveEditedComment(n)},async sendReply(e){const t=new v({action:j,eventName:M});e.attachments?.length>0&&(t.attachments=D),this.$emit("analytics",t),h().setAnalytics(t);const n=this.comment.parent!==0?this.comment.id:this.comment.root;await oe(e,n)},errorCallback(e,t){this.isUserBanned&&(this.closeReply(),this.closeEdit()),console.error(e,t)},async scrollToInput(){this.focusedInput||(await this.$nextTick(),setTimeout(()=>{const e=window.innerWidth<768,t=this.$refs.commentInput?.$el,n=t.getBoundingClientRect(),i=n.height,a=n.top,r=window.innerHeight;document.documentElement.style.scrollBehavior="smooth",e||a+i+16>r&&window.scrollBy(0,a-r+i+16),e&&t.scrollIntoView({behavior:"smooth",block:"center"}),document.documentElement.style.scrollBehavior=""},300),this.focusedInput=!0)},focusInput(){this.$refs.commentInput?.activateInput()},async openReply(){this.closeEditWithAnalytic(),this.isShowReply=!0,await this.$nextTick();const e=new v({eventName:A,action:M});this.$emit("analytics",e),this.focusInput()},closeReplyWithAnalytic(){if(!this.closeReply())return;const e=new v({eventName:M,action:tt});this.$emit("analytics",e)},closeEditWithAnalytic(){if(!this.closeEdit())return;const e=new v({eventName:M,action:et});this.$emit("analytics",e)},closeReply(){return this.isShowReply?(this.isShowReply=!1,this.focusedInput=!1,!0):!1},closeEdit(){return this.isShowEdit?(this.isShowEdit=!1,this.focusedInput=!1,!0):!1},async activateEdit(){this.closeReplyWithAnalytic(),this.isShowEdit=!0,await this.$nextTick(),this.focusInput()}}}),To=["id"],Lo={class:"comment__wrapper"},No=["innerHTML"],Mo={key:0,class:"comment__input-wrapper"},Fo={key:1,class:"comment__nested-comments"};function Do(e,t,n,i,a,r){const s=c("CommentInfo"),p=c("CommentReportPlate"),y=c("CommentFiles"),C=c("CommentFooter"),g=c("CommentInput"),ye=c("Comment",!0);return o(),m("div",{class:S(["comment",e.commentClass])},[l("div",{id:`comment-${e.comment.id}`,class:"comment__anchor-target"},null,8,To),l("div",Lo,[$(s,{"is-active-edit":e.isShowEdit,class:"comment__info",comment:e.comment,onReport:e.reportComment,onAnalytics:e.sendAnalytics,onShowLogin:e.showLogin,onCloseEdit:e.closeEditWithAnalytic,onActivateEdit:e.activateEdit},null,8,["is-active-edit","comment","onReport","onAnalytics","onShowLogin","onCloseEdit","onActivateEdit"]),e.isShowReportPlate?(o(),u(p,{key:0,class:"comment__report-plate"})):d("",!0),e.isShowEdit?d("",!0):(o(),m("div",{key:1,class:S([e.contentClass,"comment__content"]),innerHTML:e.commentContent},null,10,No)),e.isShowFiles?(o(),u(y,{key:2,class:"comment__files",comment:e.comment},null,8,["comment"])):d("",!0),e.isShowCommentFooter?(o(),u(C,{key:3,"show-reply":e.isShowReply,comment:e.comment,onShowLogin:e.showLogin,onSendRate:e.sendRate,onOpenReply:e.openReply,onCloseReply:e.closeReplyWithAnalytic},null,8,["show-reply","comment","onShowLogin","onSendRate","onOpenReply","onCloseReply"])):d("",!0),e.isShowEdit?(o(),u(g,{key:4,ref:"commentInput","button-disabled":e.buttonDisabled,comment:e.commentForInput,"input-content":e.inputContent,class:"comment__input comment__input--edit",type:"secondary",onShowLogin:e.showLogin,onFocusInput:e.scrollToInput,onSend:e.saveComment},null,8,["button-disabled","comment","input-content","onShowLogin","onFocusInput","onSend"])):d("",!0)]),e.isShowReply?(o(),m("div",Mo,[$(g,{ref:"commentInput","button-disabled":e.buttonDisabled,comment:e.commentForInput,"input-content":e.inputContent,class:"comment__input comment__input--reply",type:"secondary",onShowLogin:e.showLogin,onFocusInput:e.scrollToInput,onSend:e.saveComment},null,8,["button-disabled","comment","input-content","onShowLogin","onFocusInput","onSend"])])):d("",!0),e.isShowNestedComments?(o(),m("div",Fo,[(o(!0),m(T,null,L(e.comment.children,Z=>(o(),u(ye,{key:Z.id,comment:Z,onCommentMount:e.onChildMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comment","onCommentMount","onShowLogin","onAnalytics"]))),128))])):d("",!0)],2)}const Bo=_(Eo,[["render",Do],["__scopeId","data-v-242120bd"]]),Ro=f({name:"TheMain",components:{Comment:Bo},props:{comments:{type:Array,required:!0}},emits:["analytics","comment-mount","show-login"],methods:{sendAnalytics(e){this.$emit("analytics",e)},onCommentMount(e){this.$emit("comment-mount",e)}
18,showLogin(e){this.$emit("show-login",e)}}}),Oo={class:"main"};function Po(e,t,n,i,a,r){const s=c("Comment");return o(),m("div",Oo,[(o(!0),m(T,null,L(e.comments,p=>(o(),u(s,{key:p.id,comment:p,onCommentMount:e.onCommentMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comment","onCommentMount","onShowLogin","onAnalytics"]))),128))])}const Uo=_(Ro,[["render",Po]]),Ho=f({name:"CommentsPlaceholder"}),Vo={class:"comments-placeholder"};function qo(e,t,n,i,a,r){return o(),m("div",Vo,[...t[0]||(t[0]=[l("p",{class:"comments-placeholder__text"},"Станьте первым, кто оставит комментарий",-1)])])}const zo=_(Ho,[["render",qo],["__scopeId","data-v-22b30def"]]),Yo=f({name:"PushText",components:{IconButton:U},props:{push:{type:Object,required:!0}},emits:["close"],mounted(){setTimeout(()=>{this.closePush()},this.push.timeout)},methods:{closePush(){this.$emit("close",this.push.id)}}}),jo={class:"push"},Wo={class:"push__content"};function Zo(e,t,n,i,a,r){const s=c("IconButton");return o(),m("div",jo,[l("div",Wo,k(e.push.title),1),$(s,{class:"push__close-button",icon:"close-cross",onClick:e.closePush},null,8,["onClick"])])}const Ko=_(Yo,[["render",Zo]]),Go=f({name:"PushContainers",components:{"text-push":Ko},computed:{pushes(){return h().pushes}},methods:{...Se(h,["removePush"])}}),Xo={class:"push-container"};function Jo(e,t,n,i,a,r){return o(),u(Ae,{to:"#teleports"},[l("div",Xo,[$(ke,{name:"list"},{default:w(()=>[(o(!0),m(T,null,L(e.pushes,s=>(o(),u(W(s.type),{key:s.id,class:"push-container__push",push:s,onClose:e.removePush},null,40,["push","onClose"]))),128))]),_:1})])])}const Qo=_(Go,[["render",Jo]]),xo=f({name:"Talker",components:{CommentInput:he,CommentInputBannedPlate:yn,TheMain:Uo,CommentsPlaceholder:zo,PushContainer:Qo},emits:["analytics","comment-mount","input-mount","show-login"],data:()=>({echo:null,buttonDisabled:!1}),computed:{isUserBanned(){return h().isUserBanned},mappedComments(){return h().mappedComments},isShowComments(){return this.mappedComments?.length>0},isShowBannedPlate(){return this.isUserBanned},isShowCommentsPlaceholder(){return!this.isShowComments&&!this.isUserBanned}},unmounted(){this.echo?.leave("post_comments_update."+h().postId)},methods:{sendAnalytics(e){this.$emit("analytics",e)},onCommentMount(e){this.$emit("comment-mount",e)},onInputMount(){this.$emit("input-mount")},blurMainInput(){this.$refs.commentInput?.deactivateInput()},focusMainInput(){this.$refs.commentInput?.activateInput()},createEcho(e){this.echo=new be({broadcaster:"socket.io",host:Ee,path:"/talker",transports:["websocket","polling"]}),this.echo?.channel("post_comments_update."+e)?.listen(".public.message",this.handleMessage)},async saveComment(e){try{const t=new v({eventName:re,action:j});e.attachments?.length>0&&(t.attachments=D),this.$emit("analytics",t),h().setAnalytics(t),this.buttonDisabled=!0,await oe(e,0),await this.$refs.commentInput?.setHeight(),this.buttonDisabled=!1,this.$refs.commentInput?.resetFileInput()}catch(t){console.error("save-comment",t),this.buttonDisabled=!1}},showLogin(e){this.$emit("show-login",e)},async addCommentFromMessage(e){await this.$nextTick(),setTimeout(()=>{Ie(this.mappedComments,Number(e.id))||h().addNewCommentMutation(e)},150)},updateCommentFromMessage(e){h().updateComment(e)},handleMessage(e){if(e.event==="add_comment"){this.addCommentFromMessage(e.comment);return}this.updateCommentFromMessage(e.comment)}}}),es={class:"talker"},ts={class:"talker__top-container"};function ns(e,t,n,i,a,r){const s=c("CommentInput"),p=c("CommentInputBannedPlate"),y=c("TheMain"),C=c("CommentsPlaceholder"),g=c("PushContainer");return o(),m("div",es,[l("div",ts,[t[0]||(t[0]=l("div",{class:"talker__headline"},"Комментарии",-1)),e.isUserBanned?d("",!0):(o(),u(s,{key:0,ref:"commentInput","button-disabled":e.buttonDisabled,class:"talker__input",onInputMount:e.onInputMount,onShowLogin:e.showLogin,onSend:e.saveComment,onAnalytics:e.sendAnalytics},null,8,["button-disabled","onInputMount","onShowLogin","onSend","onAnalytics"])),e.isShowBannedPlate?(o(),u(p,{key:1,class:"talker__input-plate"})):d("",!0)]),e.isShowComments?(o(),u(y,{key:0,class:"talker__main",comments:e.mappedComments,onCommentMount:e.onCommentMount,onShowLogin:e.showLogin,onAnalytics:e.sendAnalytics},null,8,["comments","onCommentMount","onShowLogin","onAnalytics"])):d("",!0),e.isShowCommentsPlaceholder?(o(),u(C,{key:1})):d("",!0),$(g)])}const os=_(xo,[["render",ns],["__scopeId","data-v-cfc005f0"]]),ss=globalThis.setInterval;function V(e,t=1e3){let n=0,i=null,a=null;a=ss(()=>{const r=is(e);r!==n&&(e.scrollIntoView(),n=r,i&&clearTimeout(i),i=setTimeout(()=>clearInterval(a),t))},25)}function is(e){if(!e)return 0;const t=e.getBoundingClientRect(),n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;return Math.round(t.top+n)}const as=f({name:"CommentsContainer",components:{TalkerRoot:os},props:{id:{type:Number,required:!0}},data(){return{isFirstOpenModal:!0}},computed:{article(){return X().article},isServiceError(){return We().commentsServiceError},currentSlug(){return G((this._.provides[q]||this.$route).fullPath)}
18,postId(){return this.article.id},hash(){return(this._.provides[q]||this.$route).hash}},async beforeMount(){this.isServiceError||h().setPostId(this.postId)},async mounted(){if(!this.isServiceError){this.createAnalytics(),this.createAuthEventBus(),this.handleHashScroll(),await this.$nextTick();try{if(!this.postId)throw new Error("No postId provided");window.io=(await Fe(async()=>{const{default:e}=await import("./v2.5-BhXONrG7.js").then(t=>t.i);return{default:e}},__vite__mapDeps([0,1]),import.meta.url)).default,this.$refs.talker.createEcho(this.postId)}catch(e){console.error("Error while mounting comments",e)}}},unmounted(){document.removeEventListener("send-analytic",this.analyticsListener),window.removeEventListener("success-refresh-comments",this.successRefreshListener),window.removeEventListener("failed-refresh-comments",this.failedRefreshListener)},methods:{sendAnalytics(e){this.$sendYandexMetrika({level1:`${e.eventName}_${e.action}`})},async handleHashScroll(){this.hash==="#write-a-comment"&&this.scrollToInput(),this.hash==="#comments"&&this.scrollToComments(),this.hash?.match(/comment-[0-9]*/gm)&&this.scrollToComment(this.hash)},scrollToComments(){V(this.$refs.commentsAnchorTarget)},scrollToComment(e){const t=document.querySelector(e);t&&V(t)},createAnalytics(){document.addEventListener("send-analytic",this.analyticsListener)},createAuthEventBus(){document.addEventListener("success-refresh-comments",this.successRefreshListener),document.addEventListener("failed-refresh-comments",this.failedRefreshListener)},analyticsListener(e){},async failedRefreshListener(e){const t=Ne(),n=e.detail;n?.response?.data?.data?.isBanned||n?.request?.data?.data?.isBanned||(console.warn("refresh failed CommentsContainer",n),await t.logout(),this.isFirstOpenModal&&(Me().login(),this.isFirstOpenModal=!1))},successRefreshListener(){console.log("refresh-success-talker-frontend")},prepareAnalyticModal(e){const{eventName:t,action:n,attachments:i,currency:a,element:r,value:s,slugReferer:p,item:y}=e;return{event:t,slug_location:this.currentSlug,slug_referer:p,action:n,attachments:i,currency:a,element:r,value:s,item:y}},showLoginPopup(e){const t=e?.callback;t&&(Te().afterLoginAction=t),Le().requestAuthPush()},scrollToInput(){V(this.$refs.commentsInputAnchorTarget),setTimeout(()=>{this.$refs.talker.focusMainInput()},150)}}},"$e6xr0Pzw3d"),rs={key:0,id:"comments-wrapper",class:"comments__wrapper"},cs={id:"comments",ref:"commentsAnchorTarget",class:"comments__anchor-target"},ls={id:"write-a-comment",ref:"commentsInputAnchorTarget",class:"comments__anchor-target"},ms={class:"comments__container"},us={class:"comments__container-inner"};function ds(e,t,n,i,a,r){const s=c("TalkerRoot");return e.isServiceError?d("",!0):(o(),m("div",rs,[l("div",cs,null,512),l("div",ls,null,512),l("div",ms,[l("div",us,[$(s,{id:e.id,ref:"talker",onShowLogin:e.showLoginPopup,onAnalytics:e.sendAnalytics},null,8,["id","onShowLogin","onAnalytics"])])])]))}const Es=_(as,[["render",ds],["__scopeId","data-v-e2fd997a"]]);export{bs as A,Es as C};
19//# sourceMappingURL=v2.5-BKKwV1hJ.js.map

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.