1import{R as H,L as M}from"./LikesButton-CwVkJpvf.js";import{o as x,_ as P,H as q,d as j}from"./app-D8IPa_ef.js";import{_ as E}from"./Dropdown-CNZHH_kJ.js";import{B as a,s as m,C as l,H as p,I as d,T as _,Z as k,A as s,q as y,y as n,z as i,E as c,L as N,v}from"./framework-WJp1PeKY.js";import{_ as C}from"./DropdownMenuItem.vue_vue_type_script_setup_true_lang-BRZ7475r.js";import{_ as T}from"./AvatarImage.vue_vue_type_script_setup_true_lang-Bw_I63yQ.js";import{R as V,D as O}from"./ReplyIcon-eUUgFrHT.js";import{a as z}from"./SyntaxHighlighting-Bxa7LI06.js";import"./HeartIconPixelized-xRXe1EeY.js";import"./BtnPixel.vue_vue_type_script_setup_true_lang-CNNSrqBp.js";import"./LazyImg-CZ_8Ulh2.js";import"./yaml-D8BbUEyL.js";const F={__name:"CommentPinLink",props:{comment:{type:Object,default:()=>({id:null,pinned:!1}),required:!0}},setup(o){let e=o;function t(){if(e.comment.pinned){k.delete(`/comments/${e.comment.id}/pin`,{preserveScroll:!0,only:["comments"]}),x.emit("flash","Comment unpinned.");return}k.post(`/comments/${e.comment.id}/pin`,{},{preserveScroll:!0,only:["comments"]}),x.emit("flash","Comment pinned.")}return(b,r)=>(m(),a(C,{onClick:_(t,["prevent"])},{default:l(()=>[p(d(o.comment?.pinned?"Unpin":"Pin"),1)]),_:1}))}},Z={components:{DotsIcon:O,ReplyIcon:V,AvatarImage:T,DropdownMenuItem:C,CommentPinLink:F,Dropdown:E,LikesButton:M,ReportSpamButton:H},props:{comment:Object,hasChildren:{type:Boolean,default:!1}},data(){return{isHovered:!1,likes:this.comment.likes,currentUserStore:j()}},mounted(){this.$el.querySelectorAll("pre code").forEach(z)},methods:{like(o){q[o?"post":"delete"](this.comment.links.like).then(e=>this.likes=e.data)},deleteComment(){this.flashOverlay({title:"Are you sure?",text:"If you proceed, your comment (and any replies to it) will be deleted.",buttons:["Cancel","Delete"]}).then(o=>{o.confirmed&&this.$emit("delete",this.comment)})}}},G=["id"],J={class:"w-9"},K={class:"flex items-start justify-between"},Q={class:"flex gap-2"},W={class:"font-medium"},X={class:"text-text-secondary text-2xs"},Y={class:"text-text-secondary text-2xs hidden leading-[2] md:block"},$={class:"flex items-start gap-2"},ee={class:"text-text-secondary text-2xs"},te={class:"text-text-secondary text-2xs ml-3"},ne=["id","aria-expanded","aria-controls","onClick"],oe=["innerHTML"];function se(o,e,t,b,r,f){const g=s("AvatarImage"),I=s("LikesButton"),L=s("ReplyIcon"),D=s("DotsIcon"),S=s("CommentPinLink"),h=s("DropdownMenuItem"),w=s("ReportSpamButton"),B=s("Dropdown");return m(),y("article",{id:`reply-${t.comment.id}`,class:v(["lesson-comment relative flex gap-3",t.hasChildren?"":"border-stroke mb-6 border-b pb-6"])},[n("div",J,[i(g,{user:t.comment.user,width:"36",style:{"min-width":"36px"}},null,8,["user"])]),n("div",{class:v(["flex-1",t.hasChildren?"border-stroke mb-6 border-b pb-6":""])},[n("header",K,[n("div",Q,[n("div",null,[n("span",W,d(t.comment.user.username),1),n("div",X,d(t.comment.relativePublishDate),1)]),n("div",Y,"Level "+d(t.comment.user.experience?.level??1),1)]),n("div",$,[n("div",null,[i(I,{likes:r.likes,class:"text-text-secondary",onLike:f.like},null,8,["likes","onLike"])]),n("div",ee,[n("button",{class:"group text-text-secondary hover:text-current-taxonomy inline-flex cursor-pointer gap-2",onClick:e[0]||(e[0]=u=>o.signedIn?o.$emit("reply-requested",t.comment):o.dialog("join"))},[i(L),e[2]||(e[2]=n("span",{class:"font-normal"},"Reply",-1))])]),n("div",te,[o.signedIn?(m(),a(B,{key:0,position:"right"},{trigger:l(({toggle:u,isOpen:R,triggerId:U,dropdownId:A})=>[n("button",{id:U,"aria-expanded":R,"aria-controls":A,"aria-haspopup":"true",class:"text-icon hover:text-current-taxonomy relative -top-px h-5 cursor-pointer",onClick:u},[i(D)],8,ne)]),default:l(()=>[r.currentUserStore.staff?(m(),a(S,{key:0,comment:t.comment},null,8,["comment"])):c("",!0),r.currentUserStore.admin||r.currentUserStore.is(t.comment.user)?(m(),y(N,{key:1},[i(h,{onClick:e[1]||(e[1]=_(u=>o.$emit("edit-requested",t.comment),["prevent"]))},{default:l(()=>[...e[3]||(e[3]=[p("Edit",-1)])]),_:1}),i(h,{onClick:_(f.deleteComment,["prevent"])},{default:l(()=>[...e[4]||(e[4]=[p("Delete",-1)])]),_:1},8,["onClick"])],64)):c("",!0),r.currentUserStore.signedIn&&t.comment.user.id!==r.currentUserStore.get("id")?(m(),a(w,{key:2,url:`/admin/reported-users/${t.comment.user.id}`},null,8,["url"])):c("",!0)]),_:1})):c("",!0)])])]),n("div",{class:"content user-content mt-4 mb-0 text-sm!",innerHTML:t.comment.body},null,8,oe)],2)],10,G)}const xe=P(Z,[["render",se]]);export{xe 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.