import{a as x,b as I}from"./chunk-KE5SDZFX.js";import{E as D,a as N,g as O,o as B}from"./chunk-OPKDC23H.js";import{Dc as k,Ec as n,Hb as f,Jc as T,Lc as w,Mc as m,Na as l,Ne as P,Oe as S,Wc as y,Y as d,ba as g,cc as b,dc as M,ec as C,kc as v,mb as s,mc as _,nb as c,ob as h}from"./chunk-ZSQR4KTU.js";import{i as p}from"./chunk-IQVXR75E.js";var E=a=>({"with-border":a}),G=(()=>{let i=class i{changeDetector=g(w);maxTimestamp=n(void 0);timestamp=T(void 0);disabled=n(!1,{transform:m});enableBorder=n(!1,{transform:m});inputName=n(void 0);mask=n("99:99:99");formatter=n(e=>S({seconds:e,format:"full",symbol:":"}));parser=n(e=>P(e));inputBlur=k();timestampString;ngOnInit(){this.writeValue(this.timestamp()||0)}propagateChange=e=>{};onTouched=()=>{};writeValue(e){this.timestamp.set(e),this.timestampString=this.formatter()(this.timestamp())}registerOnChange(e){this.propagateChange=e}registerOnTouched(e){this.onTouched=e}onModelChange(){this.timestamp.set(this.parser()(this.timestampString)),this.propagateChange(this.timestamp())}onBlur(){this.onTouched();let e=this.maxTimestamp();e&&this.timestamp()>e&&(this.writeValue(e),this.changeDetector.detectChanges(),this.propagateChange(this.timestamp())),this.inputBlur.emit()}};p(i,"\u0275fac",function(o){return new(o||i)}),p(i,"\u0275cmp",l({type:i,selectors:[["my-timestamp-input"]],inputs:{maxTimestamp:[1,"maxTimestamp"],timestamp:[1,"timestamp"],disabled:[1,"disabled"],enableBorder:[1,"enableBorder"],inputName:[1,"inputName"],mask:[1,"mask"],formatter:[1,"formatter"],parser:[1,"parser"]},outputs:{timestamp:"timestampChange",inputBlur:"inputBlur"},features:[v([{provide:N,useExisting:d(()=>i),multi:!0}])],decls:1,vars:7,consts:[["slotChar","0",3,"ngModelChange","onBlur","disabled","ngModel","ngClass","mask","inputId"]],template:function(o,t){o&1&&(c(0,"p-inputMask",0),C("ngModelChange",function(r){return M(t.timestampString,r)||(t.timestampString=r),r}),f("onBlur",function(){return t.onBlur()})("ngModelChange",function(){return t.onModelChange()}),h()),o&2&&(s("disabled",t.disabled()),b("ngModel",t.timestampString),s("ngClass",_(5,E,t.enableBorder()))("mask",t.mask())("inputId",t.inputName()))},dependencies:[I,x,D,O,B,y],styles:[`p-inputmask.with-border[_ngcontent-%COMP%]{--input-border-color: var(--bg-secondary-500);--p-inputtext-hover-border-color: var(--bg-secondary-500)}p-inputmask[_ngcontent-%COMP%]     input{text-align:center;font-size:16px;padding:var(--input-y-padding) var(--input-x-padding);width:100%;max-width:100%;color:var(--input-fg);background-color:var(--input-bg);border:var(--input-border-width) solid var(--input-border-color);border-radius:var(--input-border-radius);line-height:24px}p-inputmask[_ngcontent-%COMP%]     input::placeholder{color:var(--input-placeholder-color);font-size:var(--input-placeholder-font-size)}p-inputmask[_ngcontent-%COMP%]     input[readonly]{color:var(--fg-300)}p-inputmask[_ngcontent-%COMP%]     input:focus, p-inputmask[_ngcontent-%COMP%]     input:focus-visible{box-shadow:0 0 0 .2rem var(--fg-100);outline:0}p-inputmask[_ngcontent-%COMP%]     input[disabled]{color:var(--fg-300);opacity:.8}@media screen and (max-width: calc(100% + 40px)){p-inputmask[_ngcontent-%COMP%]     input{width:100%}}p-inputmask[_ngcontent-%COMP%]     input:focus-within, p-inputmask[_ngcontent-%COMP%]     input:focus{box-shadow:0 0 0 .2rem var(--fg-100)}p-inputmask[_ngcontent-%COMP%]     input:disabled{background:var(--bg);opacity:.5}
/*# sourceMappingURL=timestamp-input.component-OIEKORMD.css.map */`]}));let a=i;return a})();export{G as a};
/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/
//# sourceMappingURL=chunk-HBWGRPPS.js.map
