import{Ab as m,Ob as g,Qb as p,Zb as n,_b as r,_c as l,cd as c,hd as h,jb as i,jc as u,kc as C,yc as s,zc as d}from"./chunk-UNHECMG2.js";function b(e,S){if(e&1&&(n(0,"span",2),s(1),r()),e&2){let t=C();i(),d(t.sortDirectionCharacter())}}var M=(()=>{class e{constructor(){this.label=c(""),this.sortKey=c.required(),this.sortCriteria=h.required(),this.isSorted=l(()=>this.sortCriteria()?.primarySortKey===this.sortKey()),this.sortDirectionCharacter=l(()=>this.isSorted()?this.sortCriteria()?.ascending?"\u2193":"\u2191":"")}toggleSort(){let t=this.sortCriteria()?.ascending??null;this.sortCriteria.set({primarySortKey:this.sortKey(),ascending:this.isSorted()&&t!==null?!t:!0})}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=m({type:e,selectors:[["bkd-sortable-header"]],inputs:{label:[1,"label"],sortKey:[1,"sortKey"],sortCriteria:[1,"sortCriteria"]},outputs:{sortCriteria:"sortCriteriaChange"},decls:4,vars:2,consts:[[1,"d-flex",3,"click"],[1,"label"],[1,"sort-direction","ms-1"]],template:function(o,a){o&1&&(n(0,"button",0),u("click",function(){return a.toggleSort()}),n(1,"span",1),s(2),r(),g(3,b,2,1,"span",2),r()),o&2&&(i(2),d(a.label()),i(),p(a.isSorted()?3:-1))},styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%], button[_ngcontent-%COMP%]{max-width:100%}.label[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}button[_ngcontent-%COMP%]{background:none;border:none;padding:0;margin:0;font-weight:500}"],changeDetection:0})}}return e})();export{M as a};
