import{i as z,j as G}from"./chunk-YXT7BC4V.js";import{l as Y,m as q}from"./chunk-HK3Q37NB.js";import{$ as S,$e as D,If as k,Ja as c,Pf as Q,Qf as R,Sf as W,Ta as n,Ua as l,V as T,Za as b,Zb as x,_e as B,aa as N,ab as v,af as O,ca as C,cf as a,da as s,ea as u,ff as E,jb as I,jf as F,jg as j,kb as _,la as M,lb as w,mc as f,mg as H,of as U,pb as m,qb as p,ta as o,tb as y,ub as V,vb as A,wb as P,yf as L}from"./chunk-ELB72B7E.js";var X=["tooltip"],J=2e4,Z={showDelay:0,hideDelay:J,touchendHideDelay:J},$=(()=>{class e{constructor(){this.selection=0,this.navigateToPrevious=!0,this.color=f.PRIMARY,this.leftButtonIcon="arrow_back",this.rightButtonIcon="arrow_forward",this.tooltipText="",this.nextButtonColorAccent=!0,this.itemSelectionChange=new M}ngOnChanges(){if(a.isNullOrUndefined(this.values)||a.isNullOrUndefined(this.selection)){this.currentValue=null,this.currentSelection=null;return}this.selection>=this.values.length||(this.currentSelection=this.selection,this.currentValue=this.values[this.currentSelection],this.lastValueAdded=this.values[this.values.length-1],setTimeout(()=>{this.showManualTooltip()},0))}actionPrevious(){this.canNavigateToPrevious()&&(this.currentSelection--,this.currentValue=this.values[this.currentSelection],this.itemSelectionChange.emit(this.currentSelection))}canNavigateToPrevious(){return this.navigateToPrevious&&this.isDataAvailable()&&this.currentSelection>0&&this.values.length>1}actionNext(){this.canNavigateToNext()&&(this.currentSelection++,this.currentValue=this.values[this.currentSelection],this.itemSelectionChange.emit(this.currentSelection))}canNavigateToNext(){return this.isDataAvailable()&&this.currentSelection<this.values.length-1}isDataAvailable(){return!a.isNullOrUndefined(this.values)&&!a.isNullOrUndefined(this.currentSelection)}getTooltipText(){return this.canNavigateToNext()?this.tooltipText:""}getColor(){return this.nextButtonColorAccent&&this.canNavigateToNext()?f.ACCENT:this.color}showManualTooltip(){this.manualTooltip&&!a.isNullOrUndefined(this.lastValueAdded)&&(this.manualTooltip.show(),this.lastValueAdded=null)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=S({type:e,selectors:[["abs-selectable-item-navigator"]],viewQuery:function(i,t){if(i&1&&I(X,5),i&2){let r;_(r=w())&&(t.manualTooltip=r.first)}},inputs:{title:"title",values:"values",selection:"selection",navigateToPrevious:"navigateToPrevious",color:"color",leftButtonIcon:"leftButtonIcon",rightButtonIcon:"rightButtonIcon",tooltipText:"tooltipText",nextButtonColorAccent:"nextButtonColorAccent"},outputs:{itemSelectionChange:"itemSelectionChange"},features:[P([{provide:B,useValue:Z}]),C],decls:13,vars:12,consts:[["inputField",""],["tooltip","matTooltip"],[1,"abs-primary-color"],[1,"navigator-wrapper"],["mat-raised-button","",1,"navigator-btn",3,"click","color","disabled"],[1,"abs-form-field","navigator-input"],["matInput","","type","text","readonly","true",1,"input-field",3,"ngModelChange","ngModel","disabled"],["mat-raised-button","","absTooltip","",1,"navigator-btn",3,"click","color","matTooltip","disabled","matTooltipDisabled","matTooltipPosition"]],template:function(i,t){if(i&1){let r=b();n(0,"h4",2),m(1),l(),n(2,"div",3)(3,"button",4),v("click",function(){return s(r),u(t.actionPrevious())}),n(4,"mat-icon"),m(5),l()(),n(6,"mat-form-field",5)(7,"input",6,0),A("ngModelChange",function(h){return s(r),V(t.currentValue,h)||(t.currentValue=h),u(h)}),l()(),n(9,"button",7,1),v("click",function(){return s(r),u(t.actionNext())}),n(11,"mat-icon"),m(12),l()()()}i&2&&(o(),p(t.title),o(2),c("color",t.color)("disabled",!t.canNavigateToPrevious()),o(2),p(t.leftButtonIcon),o(2),y("ngModel",t.currentValue),c("disabled",!0),o(2),c("color",t.getColor())("matTooltip",t.getTooltipText())("disabled",!t.canNavigateToNext())("matTooltipDisabled",!t.canNavigateToNext())("matTooltipPosition","below"),o(3),p(t.rightButtonIcon))},dependencies:[E,F,U,j,Y,Q,z,k,D],encapsulation:2})}}return e})();var tt=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=N({type:e})}static{this.\u0275inj=T({imports:[x,L,H,q,R,G,W,O]})}}return e})();export{$ as a,tt as b};
