1"use strict";(self.webpackChunkmangane_fe=self.webpackChunkmangane_fe||[]).push([[14],{1220:function(e,t,n){n.r(t),n.d(t,{default:function(){return L}});var a=n(1855),r=(n(1),n(5)),i=n.n(r),o=n(308),u=n(0),c=n(1871),s=n(526),l=n(46),d=n(256),m=n(2),f=n(3),v=n(1841),g=(n(4),n(1865)),p=function(e){var t=e.announcement,n=(0,g.k6)(),a=(0,u.useRef)(null);(0,u.useEffect)((function(){c()}));var r=function(e,t){0!==t.button||t.ctrlKey||t.metaKey||(t.preventDefault(),t.stopPropagation(),n.push("/@".concat(e.acct)))},i=function(e,t){e=e.replace(/^#/,"").toLowerCase(),0!==t.button||t.ctrlKey||t.metaKey||(t.preventDefault(),t.stopPropagation(),n.push("/tag/".concat(e)))},o=function(e,t){0!==t.button||t.ctrlKey||t.metaKey||(t.preventDefault(),n.push(e))},c=function(){a.current&&a.current.querySelectorAll("a").forEach((function(e){var n,a,u;if(!e.classList.contains("status-link")){e.classList.add("status-link"),e.setAttribute("rel","nofollow noopener"),e.setAttribute("target","_blank");var c=t.mentions.find((function(t){return e.href==="".concat(t.url)}));if(c)e.addEventListener("click",r.bind(e,c),!1),e.setAttribute("title",c.acct);else if("#"===(null===(n=e.textContent)||void 0===n?void 0:n.charAt(0))||"#"===(null===(a=e.previousSibling)||void 0===a||null===(u=a.textContent)||void 0===u?void 0:u.charAt(e.previousSibling.textContent.length-1)))e.addEventListener("click",i.bind(e,e.text),!1);else{var s=t.statuses.get(e.href);s&&e.addEventListener("click",o.bind(void 0,s),!1),e.setAttribute("title",e.href),e.classList.add("unhandled-link")}}}))};return u.createElement("div",{className:"translate text-sm",ref:a,dangerouslySetInnerHTML:{__html:t.contentHtml}})},y=n(74),h=n(473),b=function(e){return e<0?0:e<=1?e:"1+"},Z=function(e){var t=e.value,n=e.obfuscate,r=(0,f.rV)().get("reduceMotion"),i=(0,u.useState)(1),o=i[0],c=i[1],s=(0,u.useState)(t),l=s[0],d=s[1];if((0,u.useEffect)((function(){void 0!==l&&(t>l?c(1):t<l&&c(-1)),d(t)}),[t]),r)return n?u.createElement(u.Fragment,null,b(l)):(0,a.Z)(v.BK,{value:l});var m=[{key:"".concat(l),data:l,style:{y:(0,y.ST)(0,{damping:35,stiffness:400})}}];return(0,a.Z)(y.bg,{styles:m,willEnter:function(){return{y:-1*o}},willLeave:function(){return{y:(0,y.ST)(1*o,{damping:35,stiffness:400})}}},void 0,(function(e){return(0,a.Z)("span",{className:"inline-flex flex-col items-stretch relative overflow-hidden"},void 0,e.map((function(e){var t=e.key,r=e.data,i=e.style;return(0,a.Z)("span",{style:{position:o*i.y>0?"absolute":"static",transform:"translateY(".concat(100*i.y,"%)")}},t,n?b(r):(0,a.Z)(v.BK,{value:r}))})))}))},k=n(185),x=n.n(k),w=n(184),M=function(e){var t=e.emoji,n=e.emojiMap,r=e.hovered,i=(0,f.rV)().get("autoPlayGif");if(x()[t]){var o=x()[t],u=o.filename,c=(s=o.shortCode)?":".concat(s,":"):"";return(0,a.Z)("img",{draggable:"false",className:"emojione block m-0",alt:t,title:c,src:(0,w.J)("packs/emoji/".concat(u,".svg"))})}if(n.get(t)){u=i||r?n.getIn([t,"url"]):n.getIn([t,"static_url"]);var s=":".concat(t,":");return(0,a.Z)("img",{draggable:"false",className:"emojione block m-0",alt:s,title:s,src:u})}return null},j=function(e){var t=e.announcementId,n=e.reaction,r=e.addReaction,o=e.removeReaction,c=e.emojiMap,s=e.style,l=(0,u.useState)(!1),d=l[0],m=l[1],f=n.name;return x()[f]&&(f=x()[f].shortCode),(0,a.Z)("button",{className:i()("flex shrink-0 items-center gap-1.5 bg-gray-100 dark:bg-primary-900 rounded-sm px-1.5 py-1 transition-colors",{"bg-gray-200 dark:bg-primary-800":d,"bg-primary-200 dark:bg-primary-500":n.me}),onClick:function(){n.me?o(t,n.name):r(t,n.name)},onMouseEnter:function(){return m(!0)},onMouseLeave:function(){return m(!1)},title:":".concat(f,":"),style:s},void 0,(0,a.Z)("span",{className:"block h-4 w-4"},void 0,(0,a.Z)(M,{hovered:d,emoji:n.name,emojiMap:c})),(0,a.Z)("span",{className:"block min-w-[9px] text-center text-xs font-medium text-primary-600 dark:text-white"},void 0,(0,a.Z)(Z,{value:n.count})))},C=function(e){var t=e.announcementId,r=e.reactions,o=e.addReaction,u=e.removeReaction,c=e.emojiMap,s=(0,f.rV)().get("reduceMotion"),l=function(e){o(t,e.native.replace(/:/g,""))},d=r.filter((function(e){return e.count>0})),v=d.map((function(e){return{key:e.name,data:e,style:{scale:s?1:(0,y.ST)(1,{stiffness:150,damping:13})}}})).toArray();return(0,a.Z)(y.bg,{styles:v,willEnter:function(){return{scale:s?1:0}},willLeave:function(){return{scale:s?0:(0,y.ST)(0,{stiffness:170,damping:26})}}},void 0,(function(e){return(0,a.Z)("div",{className:i()("flex flex-wrap items-center gap-1",{"reactions-bar--empty":d.isEmpty()})},void 0,e.map((function(e){var n=e.key,r=e.data,i=e.style;return(0,a.Z)(j,{reaction:r,style:{transform:"scale(".concat(i.scale,")"),position:i.scale<.5?"absolute":"static"},announcementId:t,addReaction:o,removeReaction:u,emojiMap:c},n)})),d.size<8&&(0,a.Z)(h.Z,{onPickEmoji:l,button:(0,a.Z)(m.JO,{className:"h-4 w-4 text-gray-400 hover:text-gray-600 dark:hover:text-white",src:n(50)})}))}))},R=function(e){var t=e.announcement,n=e.addReaction,r=e.removeReaction,i=e.emojiMap,o=(0,f.hz)(),u=t.starts_at&&new Date(t.starts_at),
1c=t.ends_at&&new Date(t.ends_at),s=new Date,l=u&&c,d=l&&u.getFullYear()===c.getFullYear()&&c.getFullYear()===s.getFullYear(),g=l&&u.getDate()===c.getDate()&&u.getMonth()===c.getMonth()&&u.getFullYear()===c.getFullYear(),y=t.all_day;return(0,a.Z)(m.Kq,{className:"w-full",space:2},void 0,l&&(0,a.Z)(m.xv,{theme:"muted"},void 0,(0,a.Z)(v.Ji,{value:u,hour12:!1,year:d||u.getFullYear()===s.getFullYear()?void 0:"numeric",month:"short",day:"2-digit",hour:y?void 0:"2-digit",minute:y?void 0:"2-digit"})," ","-"," ",(0,a.Z)(v.Ji,{value:c,hour12:!1,year:d||c.getFullYear()===s.getFullYear()?void 0:"numeric",month:g?void 0:"short",day:g?void 0:"2-digit",hour:y?void 0:"2-digit",minute:y?void 0:"2-digit"})),(0,a.Z)(p,{announcement:t}),o.announcementsReactions&&(0,a.Z)(C,{reactions:t.reactions,announcementId:t.id,addReaction:n,removeReaction:r,emojiMap:i}))},E=(0,l.P1)([function(e){return e.custom_emojis}],(function(e){return e.reduce((function(e,t){return e.set(t.get("shortcode"),t)}),(0,o.Map)())})),L=function(){var e=(0,f.TL)(),t=(0,f.CG)((function(e){return E(e)})),n=(0,u.useState)(0),r=n[0],o=n[1],l=(0,f.CG)((function(e){return e.announcements.items})),v=function(t,n){return e((0,d.rU)(t,n))},g=function(t,n){return e((0,d.WO)(t,n))};return 0===l.size?null:(0,a.Z)(m.$L,{title:(0,a.Z)(c.Z,{id:"announcements.title",defaultMessage:"Announcements"})},void 0,(0,a.Z)(m.Zb,{className:"relative",size:"md",variant:"rounded"},void 0,(0,a.Z)(s.ZP,{animateHeight:!0,index:r,onChangeIndex:function(e){o(e%l.size)}},void 0,l.map((function(e){return(0,a.Z)(R,{announcement:e,emojiMap:t,addReaction:v,removeReaction:g},e.id)})).reverse()),l.size>1&&(0,a.Z)(m.Ug,{space:2,alignItems:"center",justifyContent:"center",className:"relative"},void 0,l.map((function(e,t){return(0,a.Z)("button",{tabIndex:0,onClick:function(){return o(t)},className:i()({"w-2 h-2 rounded-full focus:ring-primary-600 focus:ring-2 focus:ring-offset-2":!0,"bg-gray-200 hover:bg-gray-300":t!==r,"bg-primary-600":t===r})},t)})))))}}}]); 2//# sourceMappingURL=announcements-c28ace45af26fcdc003a.chunk.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.