import{d as b}from"./chunk-RH7PHCHG.js";import{l as I,r}from"./chunk-WHAZRQUZ.js";import{Ba as _,Bc as d,Ca as D,Cc as f,Eb as C,Kb as p,Lc as P,Rc as m,Sc as g,Ub as h,Vb as a,cc as o,dc as c,ic as y,lc as L,nc as s,rb as l,sd as x,ud as R}from"./chunk-LPGDQDOD.js";var v=()=>[];function F(n,u){if(n&1&&(o(0,"span"),d(1),m(2,"translate"),c()),n&2){let e=s(2);l(),f(g(2,1,e.linkDef.label))}}function A(n,u){if(n&1&&(o(0,"span"),d(1),c()),n&2){let e=s(2);l(),f(e.linkDef.link)}}function q(n,u){if(n&1){let e=y();o(0,"a",2),L("click",function(i){_(e);let k=s();return D(k.onLinkSelected(i))}),p(1,F,3,3,"span",1)(2,A,2,1,"span",1),c()}if(n&2){let e=s();a("routerLink",e.linkDef.link||P(6,v))("queryParams",e.linkDef.queryParams)("ngClass",e.linkDef.styleCss),h("id",e.linkId),l(),a("ngIf",e.linkDef.label),l(),a("ngIf",e.linkDef.link&&!e.linkDef.label)}}function w(n,u){if(n&1&&(o(0,"span"),d(1),m(2,"translate"),c()),n&2){let e=s();l(),f(g(2,1,e.linkDef.label))}}var O=(()=>{class n{static get agRenderer(){return!0}static{this.allowTooltip=!0}constructor(){this.linkDef={label:"",link:[],queryParams:null,styleCss:null},this.link=[],this.linkId=null}agInit(e){this.setAgGridHandler(e.colDef?.cellRendererParams.agGridHandler),this.setLinkId(e.node.id,e.node.rowIndex),this.setLinkLabelFromParams(e)}refresh(e){return this.setLinkLabelFromParams(e),!0}setLinkLabelFromParams(e){if(!r.isSet(e.colDef)||!r.isSet(e.colDef.cellRendererParams)||!r.isSet(e.data))return;let t=e.colDef.cellRendererParams;if(r.isFunction(t.getParams)){this.linkDef=t.getParams(e.data);return}r.isFunction(t.getLabel)&&(this.linkDef.label=t.getLabel(e.data)),r.isFunction(t.getLink)&&(this.linkDef.link=t.getLink(e.data)),r.isFunction(t.getQueryParams)&&(this.linkDef.queryParams=t.getQueryParams(e.data)),r.isFunction(t.getStyleCss)&&(this.linkDef.styleCss=t.getStyleCss(e.data))}onLinkSelected(e){r.isFunction(this.linkDef.onSelected)&&this.linkDef.onSelected(e)}setAgGridHandler(e){this.agGridHandler=e}setLinkId(e,t){if(this.agGridHandler&&(e||t)){let i=this.agGridHandler.settings?.id,k=i?`${i}-`:"",S=!e||e==="undefined"?t:e;this.linkId=`ag-router-link-${k}${S}`;return}this.linkId=null}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275cmp=C({type:n,selectors:[["paw-ag-router-link-renderer"]],standalone:!1,decls:2,vars:2,consts:[[3,"routerLink","queryParams","ngClass","click",4,"ngIf"],[4,"ngIf"],[3,"click","routerLink","queryParams","ngClass"]],template:function(t,i){t&1&&p(0,q,3,7,"a",0)(1,w,3,3,"span",1),t&2&&(a("ngIf",(i.linkDef==null?null:i.linkDef.link)||(i.linkDef==null?null:i.linkDef.queryParams)),l(),a("ngIf",!(i.linkDef!=null&&i.linkDef.link)&&!i.linkDef.queryParams&&i.linkDef.label))},dependencies:[x,R,I,b],styles:["[_nghost-%COMP%]   a[_ngcontent-%COMP%]{color:var(--paw-text-link);text-decoration:none;font-weight:500}[_nghost-%COMP%]   a.paw-text-primary[_ngcontent-%COMP%]{color:var(--paw-text-primary)!important;cursor:default}"]})}}return n})();export{O as a};
