import{a as B}from"./chunk-MJMWESWV.js";import{b}from"./chunk-5IDV7BCW.js";import{c as F}from"./chunk-GJIGZB63.js";import{b as a}from"./chunk-5VDVFGVW.js";import{Fb as x,Fd as z,Hb as g,Zc as U,ka as T,la as E,pa as v,sb as c}from"./chunk-J476KISY.js";var I=(()=>{class e{constructor(t){this.translate=t}formatElapsedTimeDigits(t,r){let i=Math.floor(t/1e3),s=Math.floor(i/60),h=Math.floor(s/60),y=Math.floor(h/24),$=Math.floor(y/30),C=Math.floor($/12),S=i%60,P=s%60,n=a.zeroPadBefore(a.numToStr(h),2),o=a.zeroPadBefore(a.numToStr(P),2),l=a.zeroPadBefore(a.numToStr(S),2);switch(r){case"minutes":return`${n}:${o}`;case"full":default:return`${n}:${o}:${l}`}}formatElapsedTime(t,r="full",i="long",s=!1){let h=Math.floor(t/1e3),y=Math.floor(h/60),$=Math.floor(y/60),C=Math.floor($/24),S=Math.floor(C/30),P=Math.floor(S/12),n=h%60,o=y%60,l=$%24,V=C%30,j=S%12,m=n&&s?"":this.translateUnit(n,"second",i),u=o&&s?"":this.translateUnit(o,"minute",i),f=l&&s?"":this.translateUnit(l,"hour",i),d=V&&s?"":this.translateUnit(V,"day",i),M=j&&s?"":this.translateUnit(j,"month",i),D=P&&s?"":this.translateUnit(P,"year",i);switch(r){case"seconds":return m;case"minutes":return n===0?`${u}`:`${u} ${m}`;case"hours":return o===0&&n===0?`${f}`:`${f} ${u} ${m}`;case"days":return l===0&&o===0&&n===0?`${d}`:`${d} ${f} ${u} ${m}`;case"months":return V===0&&l===0&&o===0&&n===0?`${M}`:`${M} ${d} ${f} ${u} ${m}`;case"years":return j===0&&V===0&&l===0&&o===0&&n===0?`${D}`:`${D} ${M} ${d} ${f} ${u} ${m}`;case"=years":return D;case"=months":return M;case"=days":return d;case"=hours":return f;case"=minutes":return u;case"=seconds":return m;case"full":default:let p="";return P>0&&(p+=D+" "),S>0&&(p+=M+" "),C>0&&(p+=d+" "),$>0&&(p+=f+" "),y>0&&(p+=u+" "),n>0&&(p+=m+" "),p.trim()}}translateUnit(t,r,i){let s=`TimeUnit${i==="short"?"Short":""}${B.capitalFirst(r)}`;return this.translate.instant(s,{value:t})}static{this.\u0275fac=function(r){return new(r||e)(v(F))}}static{this.\u0275prov=T({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var k=(()=>{class e{constructor(t,r,i){this.formatterService=t,this.translate=r,this.cdr=i,this.lastValue="",this.langChangeSub=null}transform(t,r,i,s){return this.langChangeSub||(this.langChangeSub=this.translate.onLangChange.subscribe(()=>{this.lastValue=this.updateValue(t,r,i,s),this.cdr.markForCheck()})),this.lastValue=this.updateValue(t,r,i,s),this.lastValue}updateValue(t,r,i,s){return a.isSet(t)?this.formatterService.formatElapsedTime(t,r,i,s):""}ngOnDestroy(){this.langChangeSub?.unsubscribe()}static{this.\u0275fac=function(r){return new(r||e)(c(I,16),c(F,16),c(U,16))}}static{this.\u0275pipe=g({name:"pawFormatElapsed",type:e,pure:!1,standalone:!1})}}return e})();var G=(()=>{class e{constructor(t){this.formatterService=t}transform(t,r){return a.isSet(t)?this.formatterService.formatElapsedTimeDigits(t,r):""}static{this.\u0275fac=function(r){return new(r||e)(c(I,16))}}static{this.\u0275pipe=g({name:"pawFormatElapsedDigits",type:e,pure:!0,standalone:!1})}}return e})();var _=(()=>{class e{constructor(t,r){this.translate=t,this.cdr=r,this.lastValue="",this.langChangeSub=null}transform(t){return this.langChangeSub||(this.langChangeSub=this.translate.onLangChange.subscribe(()=>{this.lastValue=this.updateValue(t),this.cdr.markForCheck()})),this.lastValue=this.updateValue(t),this.lastValue}updateValue(t){return a.isSet(t)?a.isString(t)?b.dateFromIso(t):b.dateFromIso(t.toISOString()):""}ngOnDestroy(){this.langChangeSub?.unsubscribe()}static{this.\u0275fac=function(r){return new(r||e)(c(F,16),c(U,16))}}static{this.\u0275pipe=g({name:"pawFormatDate",type:e,pure:!1,standalone:!1})}}return e})();var ft=(()=>{class e{static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275mod=x({type:e})}static{this.\u0275inj=E({imports:[z]})}}return e})();export{I as a,k as b,G as c,_ as d,ft as e};
