Module 649671

2,004 characters · in 381faf2c40dd0284.js
Dependencies
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{a8:()=>I,Yn:()=>y,Rg:()=>E});var l=n(392054),i=n(627968),s=n(64700),r=n(503698),a=n.n(r),o=n(17928),c=n(573435),u=n(696451),d=n(486020),h=n(32178),m=n(532406);function p(e){let{section:t,channel:{guild_id:n},isSelected:r,width:p,height:f,className:g,selectable:x=!1,isSquircle:A,onFocus:C,onBlur:E,onMouseOver:I,onMouseLeave:y,...S}=e,[v,N]=s.useState(!1),_=s.useCallback(()=>{N(!0),C?.()},[C]),T=s.useCallback(()=>{N(!1),E?.()},[E]),j=s.useCallback(()=>{N(!0),I?.()},[I]),b=s.useCallback(()=>{N(!1),y?.()},[y]),R=(0,o.bG)([u.Ay],()=>t.application?.bot?.id!=null?u.Ay.getMember(n,t.application?.bot?.id):null),O=s.useMemo(()=>t.type===l.Hf.APPLICATION?d.Ay.getApplicationIconURL({id:t.id,icon:t.icon,bot:t.application?.bot,botIconFirst:!0,guildMember:R,size:p}):m,[t,p,R]);return(0,i.jsx)("div",{...S,className:a()(h.iE,g,{[h.rb]:x,[h.wH]:x&&r}),onFocus:_,onBlur:T,onMouseOver:j,onMouseLeave:b,children:(0,i.jsx)(c.Ay,{className:h.dK,mask:A||x&&(r||v)?c.hW.SQUIRCLE:c.hW.AVATAR_DEFAULT,width:p,height:f,children:(0,i.jsx)("img",{alt:"",className:h.Kk,style:{width:p,height:f},src:O})})})}var f=n(633018),g=n(406810),x=n(73510),A=n(824527);function C(e){let{section:t,className:n,width:l,height:s,padding:r,isSelected:o,selectable:c=!1,...u}=e,d=(e=>{switch(e.id){case x.Ik.BUILT_IN:return f.k;case x.Ik.FRECENCY:return g.O;default:return}})(t);return(0,i.jsx)("div",{className:a()(A.iE,n,{[A.rb]:c,[A.wH]:c&&o}),style:{width:l,height:s,padding:r??0},children:null!=d?(0,i.jsx)(d,{className:A.Kk,color:"currentColor",size:"custom",width:l,height:s,...u}):null})}let E=e=>e.type===l.Hf.BUILT_IN?C:p;function I(e){return`${e/16}rem`}function y(e,t){let n=t,l=!1,i=t.indexOf(":");if(i>=0){let e=t.lastIndexOf(" ",i);e>=0?(t=t.substring(0,e),l=!0):t=t.substring(0,i)}else t=t.substring(0,t.length);let s=t.split(" ",x.uA+1);return s.length>x.uA&&(l=!0,s.pop()),t=s.join(" "),(n.length>t.length||t.endsWith(" "))&&(l=!0,t=t.trimEnd()),{text:t,parts:s,hasSpaceTerminator:l}}}