import{c as z,d as G}from"./chunk-YBGMN6OR.js";import{a as q}from"./chunk-WQGDHA2L.js";import{g as Y}from"./chunk-YFLLMV2L.js";import{$b as r,Dc as k,Tc as Q,Ub as B,Uc as R,Vb as D,Xb as O,Xc as W,cc as E,d as f,hc as F,mc as U,nd as j,pd as H,xc as L}from"./chunk-ATD4AEXQ.js";import{$a as M,Fb as I,Gb as _,Hb as w,Ka as o,Kc as x,Qb as m,Rb as p,Ta as N,Ua as C,Ub as y,Vb as V,Wb as A,_b as P,da as T,ja as s,ka as u,nb as c,ob as n,pb as l,xa as S,xb as b,zb as v}from"./chunk-BXH3QC5E.js";var X=["tooltip"],J=2e4,Z={showDelay:0,hideDelay:J,touchendHideDelay:J},$=(()=>{class e{title;values;selection=0;navigateToPrevious=!0;color=f.PRIMARY;leftButtonIcon="arrow_back";rightButtonIcon="arrow_forward";tooltipText="";nextButtonColorAccent=!0;itemSelectionChange=new M;manualTooltip;currentSelection;currentValue;lastValueAdded;ngOnChanges(){if(r.isNullOrUndefined(this.values)||r.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!r.isNullOrUndefined(this.values)&&!r.isNullOrUndefined(this.currentSelection)}getTooltipText(){return this.canNavigateToNext()?this.tooltipText:""}getColor(){return this.nextButtonColorAccent&&this.canNavigateToNext()?f.ACCENT:this.color}showManualTooltip(){this.manualTooltip&&!r.isNullOrUndefined(this.lastValueAdded)&&(this.manualTooltip.show(),this.lastValueAdded=null)}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=N({type:e,selectors:[["abs-selectable-item-navigator"]],viewQuery:function(i,t){if(i&1&&I(X,5),i&2){let a;_(a=w())&&(t.manualTooltip=a.first)}},inputs:{title:"title",values:"values",selection:"selection",navigateToPrevious:"navigateToPrevious",color:"color",leftButtonIcon:"leftButtonIcon",rightButtonIcon:"rightButtonIcon",tooltipText:"tooltipText",nextButtonColorAccent:"nextButtonColorAccent"},outputs:{itemSelectionChange:"itemSelectionChange"},standalone:!1,features:[P([{provide:B,useValue:Z}]),S],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 a=b();n(0,"h4",2),m(1),l(),n(2,"div",3)(3,"button",4),v("click",function(){return s(a),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(a),V(t.currentValue,h)||(t.currentValue=h),u(h)}),l()(),n(9,"button",7,1),v("click",function(){return s(a),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 \u0275fac=function(i){return new(i||e)};static \u0275mod=C({type:e});static \u0275inj=T({imports:[x,L,H,q,R,G,W,O]})}return e})();export{$ as a,tt as b};
