1import{j as e}from"./client-By3tlFYA.js";import{r as t,u as T,a as $}from"./index-DN3cA6_s.js";import{c as g}from"./index-CaP65SFA.js";import{S as P}from"./add-VjIs_MtH.js";import{S as ee}from"./chevron_left-B4sngfCc.js";import{bu as se,h as te,o as R,a5 as r,ax as ae,S as ne}from"./useSelectableClick-BJt1tH7m.js";import{S as oe}from"./unfold_more-DqDauahV.js";import{M as j}from"./message-DgP9QxZo.js";const y=t.createContext({tabsBarElement:null,multiColumn:!1,setTabsBarElement:()=>{}});function le(){return t.useContext(y)}const ce=({children:s})=>{const{multiColumn:a,tabsBarElement:n}=le();return a?s:n?se.createPortal(s,n):s},ve=({multiColumn:s,children:a})=>{const[n,m]=t.useState(null),l=t.useMemo(()=>({multiColumn:s,tabsBarElement:n,setTabsBarElement:m}),[s,n]);return e.jsx(y.Provider,{value:l,children:a})},ie=s=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...s},t.createElement("path",{d:"m313-440 224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})),re=s=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...s},t.createElement("path",{d:"m356-160-56-56 180-180 180 180-56 56-124-124-124 124Zm124-404L300-744l56-56 124 124 124-124 56 56-180 180Z"})),o=$({show:{id:"column_header.show_settings",defaultMessage:"Show settings"},hide:{id:"column_header.hide_settings",defaultMessage:"Hide settings"},moveLeft:{id:"column_header.moveLeft_settings",defaultMessage:"Move column to the left"},moveRight:{id:"column_header.moveRight_settings",defaultMessage:"Move column to the right"},back:{id:"column_back_button.label",defaultMessage:"Back"}}),me=({onlyIcon:s})=>{const a=R(),n=T(),m=t.useCallback(()=>{var l;(l=a.location.state)!=null&&l.fromMastodon?a.goBack():a.push("/")},[a]);return e.jsxs("button",{onClick:m,className:g("column-header__back-button",{compact:s}),"aria-label":n.formatMessage(o.back),children:[e.jsx(r,{id:"chevron-left",icon:ie,className:"column-back-button__icon"}),!s&&e.jsx(j,{id:"column_back_button.label",defaultMessage:"Back"})]})},je=({title:s,icon:a,iconComponent:n,active:m,children:l,pinned:b,multiColumn:h,extraButton:A,showBackButton:H,placeholder:U,appendContent:Z,collapseIssues:F,onClick:x,onMove:c,onPin:d})=>{var L;const u=T(),{signedIn:z}=te(),p=R(),[i,C]=t.useState(!0),[k,f]=t.useState(!1),D=t.useCallback(X=>{X.stopPropagation(),C(Y=>!Y),f(!0)},[C,f]),V=t.useCallback(()=>{x==null||x()},[x]),q=t.useCallback(()=>{c==null||c(-1)},[c]),G=t.useCallback(()=>{c==null||c(1)},[c]),J=t.useCallback(()=>{f(!1)},[f]),N=t.useCallback(()=>{b||p.replace("/"),d==null||d()},[p,b,d]),K=g("column-header__wrapper",{active:m}),O=g("column-header",{active:m}),Q=g("column-header__collapsible",{collapsed:i,animating:k}),W=g("column-header__button",{active:!i});let w,v,B,_,M;l&&(w=e.jsx("div",{className:"column-header__collapsible__extra",children:l},"extra-content")),h&&b?(v=e.jsxs("button",{className:"text-btn column-header__setting-btn",onClick:N,children:[e.jsx(r,{id:"times",icon:ne})," ",e.jsx(j,{id:"column_header.unpin",defaultMessage:"Unpin"})]}),B=e.jsxs("div",{className:"column-header__setting-arrows",children:[e.jsx("button",{title:u.formatMessage(o.moveLeft),"aria-label":u.formatMessage(o.moveLeft),className:"icon-button column-header__setting-btn",onClick:q,children:e.jsx(r,{id:"chevron-left",icon:ee})}),e.jsx("button",{title:u.formatMessage(o.moveRight),"aria-label":u.formatMessage(o.moveRight),className:"icon-button column-header__setting-btn",onClick:G,children:e.jsx(r,{id:"chevron-right",icon:ae})})]})):h&&d&&(v=e.jsxs("button",{className:"text-btn column-header__setting-btn",onClick:N,children:[e.jsx(r,{id:"plus",icon:P})," ",e.jsx(j,{id:"column_header.pin",defaultMessage:"Pin"})]})),!b&&(h&&((L=p.location.state)!=null&&L.fromMastodon)||H)&&(_=e.jsx(me,{onlyIcon:!!s}));const S=[w];h&&S.push(e.jsxs("div",{className:"column-header__advanced-buttons",children:[v,B]},"buttons")),z&&(l||h&&d)&&(M=e.jsx("button",{className:W,title:u.formatMessage(i?o.show:o.hide),"aria-label":u.formatMessage(i?o.show:o.hide),onClick:D,children:e.jsxs("i",{className:"icon-with-badge",children:[e.jsx(r,{id:"sliders",icon:i?oe:re}),F&&e.jsx("i",{className:"icon-with-badge__issue-badge"})]})}));const E=a&&n&&s,I=e.jsxs("div",{className:K,children:[e.jsxs("h1",{className:O,children:[E&&e.jsxs(e.Fragment,{children:[_,e.jsxs("button",{onClick:V,className:"column-header__title",children:[!_&&e.jsx(r,{id:a,icon:n,className:"column-header__icon"}),s]})]}),!E&&_,e.jsxs("div",{className:"column-header__buttons",children:[A,M]})]}),e.jsx("div",{className:Q,tabIndex:i?-1:void 0,onTransitionEnd:J,children:e.jsx("div",{className:"column-header__collapsible-inner",children:(!i||k)&&S})}),Z]});return U?I:e.jsx(ce,{children:I})};export{ce as B,je as C,ie as S,ve as a,o as m,le as u}; 2//# sourceMappingURL=column_header-u2kMQgCZ.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.