import {cJ as I,bF as Uu,aY as S,cK as A,bQ as af,gS as Kr,g,cM as Z,cO as Ju,cN as kt,gJ as Yhe,i7 as Ai,i8 as Di,b as Pa,cT as Ln,cU as mn,cV as j0e,U as cl,cX as x3,cd as R3,fe as A3,h9 as us,cZ as Sr,ha as rr,gK as qo,cf as I0,R as tl,s as sp,F as Fp,u as ub,_ as _0,cE as BV,a3 as B0,cs as Lp,z as zB,ah as c$,bP as D,d1 as ge$1,d2 as Pj,d3 as lx,d4 as gb,d5 as yb,eO as Hp,hb as H0e,bY as fb,bZ as kp,o as bV,k as k2,eB as eC,d as $I,G as GI,dI as Cs,L as qp,ar as _pe,fm as WS,fE as Cz,C as Cpe,J as Jn,q as qn,l as ln,V as w3,n as Mx,t as GH,N as Nx,a4 as l$,W as WH,p as e$}from'./main-BiUBeaMj.js';var ue=["clearicon"],he=["input"];function pe(a,m){if(a&1){let t=k2();eC(),sp(0,"svg",5),Fp("click",function(){$I(t);let e=bV(2);return GI(e.clear())}),ub();}if(a&2){let t=bV(2);BV(t.cx("clearIcon")),B0("pBind",t.ptm("clearIcon"));}}function fe(a,m){}function de(a,m){a&1&&_0(0,fe,0,0,"ng-template");}function ce(a,m){if(a&1){let t=k2();sp(0,"span",6),Fp("click",function(){$I(t);let e=bV(2);return GI(e.clear())}),_0(1,de,1,0,null,7),ub();}if(a&2){let t=bV(2);BV(t.cx("clearIcon")),B0("pBind",t.ptm("clearIcon")),zB(),B0("ngTemplateOutlet",t.clearIconTemplate||t._clearIconTemplate);}}function me(a,m){if(a&1&&(fb(0),_0(1,pe,1,3,"svg",3)(2,ce,2,4,"span",4),kp()),a&2){let t=bV();zB(),B0("ngIf",!t.clearIconTemplate&&!t._clearIconTemplate),zB(),B0("ngIf",t.clearIconTemplate||t._clearIconTemplate);}}var ge=`
    /* For PrimeNG */
    p-inputmask {
        position: relative;
    }

    .p-inputmask-clear-icon {
        position: absolute;
        top: 50%;
        margin-top: -0.5rem;
        cursor: pointer;
        inset-inline-end: dt('form.field.padding.x');
        color: dt('form.field.icon.color');
    }

    p-inputMask:has(.p-inputtext-fluid),
    p-input-mask:has(.p-inputtext-fluid),
    p-inputmask:has(.p-inputtext-fluid) {
        width: 100%;
    }

    p-inputMask.ng-invalid.ng-dirty > .p-inputtext,
    p-input-mask.ng-invalid.ng-dirty > .p-inputtext,
    p-inputmask.ng-invalid.ng-dirty > .p-inputtext {
        border-color: dt('inputtext.invalid.border.color');
    }

    p-inputMask.ng-invalid.ng-dirty > .p-inputtext:enabled:focus,
    p-input-mask.ng-invalid.ng-dirty > .p-inputtext:enabled:focus,
    p-inputmask.ng-invalid.ng-dirty > .p-inputtext:enabled:focus {
        border-color: dt('inputtext.focus.border.color');
    }

    p-inputMask.ng-invalid.ng-dirty > .p-inputtext::placeholder,
    p-input-mask.ng-invalid.ng-dirty > .p-inputtext::placeholder,
    p-inputmask.ng-invalid.ng-dirty > .p-inputtext::placeholder {
        color: dt('inputtext.invalid.placeholder.color');
    }
`,ke={root:({instance:a})=>["p-inputmask p-component p-inputwrapper",{"p-variant-filled":a.$variant()==="filled"}],clearIcon:"p-inputmask-clear-icon"},le=(()=>{class a extends I{name="inputmask";style=ge;classes=ke;static \u0275fac=(()=>{let t;return function(e){return (t||(t=Uu(a)))(e||a)}})();static \u0275prov=S({token:a,factory:a.\u0275fac})}return a})();var re=new A("INPUTMASK_INSTANCE");var ve={provide:D,useExisting:af(()=>oe),multi:true},oe=(()=>{class a extends Kr{componentName="InputMask";_componentStyle=g(le);$pcInputMask=g(re,{optional:true,skipSelf:true})??void 0;bindDirectiveInstance=g(Z,{self:true});onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["root","host"]));}ptmParams=Ju(()=>({context:{filled:this.$variant()==="filled"}}));type="text";slotChar="_";autoClear=true;showClear=false;style;inputId;styleClass;placeholder;tabindex;title;ariaLabel;ariaLabelledBy;ariaRequired;readonly;unmask;characterPattern="[A-Za-z]";autofocus;autocomplete;keepBuffer=false;get mask(){return this._mask}set mask(t){this._mask=t,this.initMask(),this.writeValue(""),this.onModelChange(this.value);}onComplete=new kt;onFocus=new kt;onBlur=new kt;onInput=new kt;onKeydown=new kt;onClear=new kt;clearIconTemplate;templates;inputViewChild;value;_mask;input;defs;tests;partialPosition;firstNonMaskPos;lastRequiredNonMaskPos;len;oldVal;buffer;defaultBuffer;focusText;caretTimeoutId;androidChrome=true;focused;onInit(){if(Yhe(this.platformId)){let t=navigator.userAgent;this.androidChrome=/chrome/i.test(t)&&/android/i.test(t);}this.initMask();}_clearIconTemplate;onAfterContentInit(){this.templates.forEach(t=>{t.getType()==="clearicon"&&(this._clearIconTemplate=t.template);});}initMask(){if(!this.mask)return;this.tests=[],this.partialPosition=this.mask.length,this.len=this.mask.length,this.firstNonMaskPos=null,this.defs={9:"[0-9]",a:this.characterPattern,"*":`${this.characterPattern}|[0-9]`};let t=this.mask.split("");for(let i=0;i<t.length;i++){let e=t[i];e=="?"?(this.len--,this.partialPosition=i):this.defs[e]?(this.tests.push(new RegExp(this.defs[e])),this.firstNonMaskPos===null&&(this.firstNonMaskPos=this.tests.length-1),i<this.partialPosition&&(this.lastRequiredNonMaskPos=this.tests.length-1)):this.tests.push(null);}this.buffer=[];for(let i=0;i<t.length;i++){let e=t[i];e!="?"&&(this.defs[e]?this.buffer.push(this.getPlaceholder(i)):this.buffer.push(e));}this.defaultBuffer=this.buffer.join("");}caret(t,i){let e,n,s;if(!(!this.inputViewChild?.nativeElement.offsetParent||this.inputViewChild.nativeElement!==this.inputViewChild.nativeElement.ownerDocument.activeElement))if(typeof t=="number")n=t,s=typeof i=="number"?i:n,this.inputViewChild.nativeElement.setSelectionRange?this.inputViewChild.nativeElement.setSelectionRange(n,s):this.inputViewChild.nativeElement.createTextRange&&(e=this.inputViewChild.nativeElement.createTextRange(),e.collapse(true),e.moveEnd("character",s),e.moveStart("character",n),e.select());else return this.inputViewChild.nativeElement.setSelectionRange?(n=this.inputViewChild.nativeElement.selectionStart,s=this.inputViewChild.nativeElement.selectionEnd):this.document&&this.document.selection.createRange&&(e=this.document.createRange(),n=0-e.duplicate().moveStart("character",-1e5),s=n+e.text.length),{begin:n,end:s}}isCompleted(){for(let i=this.firstNonMaskPos;i<=this.lastRequiredNonMaskPos;i++)if(this.tests[i]&&this.buffer[i]===this.getPlaceholder(i))return  false;return  true}getPlaceholder(t){return t<this.slotChar.length?this.slotChar.charAt(t):this.slotChar.charAt(0)}seekNext(t){for(;++t<this.len&&!this.tests[t];);return t}seekPrev(t){for(;--t>=0&&!this.tests[t];);return t}shiftL(t,i){let e,n;if(!(t<0)){for(e=t,n=this.seekNext(i);e<this.len;e++)if(this.tests[e]){if(n<this.len&&this.tests[e].test(this.buffer[n]))this.buffer[e]=this.buffer[n],this.buffer[n]=this.getPlaceholder(n);else break;n=this.seekNext(n);}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,t));}}shiftR(t){let i,e,n,s;for(i=t,e=this.getPlaceholder(t);i<this.len;i++)if(this.tests[i])if(n=this.seekNext(i),s=this.buffer[i],this.buffer[i]=e,n<this.len&&this.tests[n].test(s))e=s;else break}handleAndroidInput(t){var i=this.inputViewChild?.nativeElement.value,e=this.caret();if(this.oldVal&&this.oldVal.length&&this.oldVal.length>i.length){for(this.checkVal(true);e.begin>0&&!this.tests[e.begin-1];)e.begin--;if(e.begin===0)for(;e.begin<this.firstNonMaskPos&&!this.tests[e.begin];)e.begin++;setTimeout(()=>{this.caret(e.begin,e.begin),this.updateModel(t),this.isCompleted()&&this.onComplete.emit();},0);}else {for(this.checkVal(true);e.begin<this.len&&!this.tests[e.begin];)e.begin++;setTimeout(()=>{this.caret(e.begin,e.begin),this.updateModel(t),this.isCompleted()&&this.onComplete.emit();},0);}}onInputBlur(t){if(this.focused=false,this.onModelTouched(),this.keepBuffer||this.checkVal(),this.onBlur.emit(t),this.modelValue()!=this.focusText||this.modelValue()!=this.value){this.updateModel(t);let i=this.document.createEvent("HTMLEvents");i.initEvent("change",true,false),this.inputViewChild?.nativeElement.dispatchEvent(i);}}onInputKeydown(t){if(this.readonly)return;let i=t.which||t.keyCode,e,n,s,l;Yhe(this.platformId)&&(l=/iphone/i.test(Ai())),this.oldVal=this.inputViewChild?.nativeElement.value,this.onKeydown.emit(t),i===8||i===46||l&&i===127?(e=this.caret(),n=e.begin,s=e.end,s-n===0&&(n=i!==46?this.seekPrev(n):s=this.seekNext(n-1),s=i===46?this.seekNext(s):s),this.clearBuffer(n,s),this.keepBuffer?this.shiftL(n,s-2):this.shiftL(n,s-1),this.updateModel(t),this.onInput.emit(t),t.preventDefault()):i===13?(this.onInputBlur(t),this.updateModel(t)):i===27&&(this.inputViewChild.nativeElement.value=this.focusText,this.caret(0,this.checkVal()),this.updateModel(t),t.preventDefault());}onKeyPress(t){if(!this.readonly){var i=t.which||t.keyCode,e=this.caret(),n,s,l,T;t.ctrlKey||t.altKey||t.metaKey||i<32||i>34&&i<41||(i&&i!==13&&(e.end-e.begin!==0&&(this.clearBuffer(e.begin,e.end),this.shiftL(e.begin,e.end-1)),n=this.seekNext(e.begin-1),n<this.len&&(s=String.fromCharCode(i),this.tests[n].test(s)&&(this.shiftR(n),this.buffer[n]=s,this.writeBuffer(),l=this.seekNext(n),Di()&&/android/i.test(Ai())?setTimeout(()=>{this.caret(l);},0):this.caret(l),e.begin<=this.lastRequiredNonMaskPos&&(T=this.isCompleted()),this.onInput.emit(t))),t.preventDefault()),this.updateModel(t),T&&this.onComplete.emit());}}clearBuffer(t,i){if(!this.keepBuffer){let e;for(e=t;e<i&&e<this.len;e++)this.tests[e]&&(this.buffer[e]=this.getPlaceholder(e));}}writeBuffer(){this.buffer&&this.inputViewChild?.nativeElement&&(this.inputViewChild.nativeElement.value=this.buffer.join(""));}checkVal(t){let i=this.inputViewChild?.nativeElement.value,e=-1,n,s,l;for(n=0,l=0;n<this.len;n++)if(this.tests[n]){for(this.buffer[n]=this.getPlaceholder(n);l++<i.length;)if(s=i.charAt(l-1),this.tests[n].test(s)){this.keepBuffer||(this.buffer[n]=s),e=n;break}if(l>i.length){this.clearBuffer(n+1,this.len);break}}else this.buffer[n]===i.charAt(l)&&l++,n<this.partialPosition&&(e=n);return t?this.writeBuffer():e+1<this.partialPosition?this.autoClear||this.buffer.join("")===this.defaultBuffer?(this.inputViewChild?.nativeElement.value&&(this.inputViewChild.nativeElement.value=""),this.clearBuffer(0,this.len)):this.writeBuffer():(this.writeBuffer(),this.inputViewChild.nativeElement.value=this.inputViewChild?.nativeElement.value.substring(0,e+1)),this.partialPosition?n:this.firstNonMaskPos}onInputFocus(t){if(this.readonly)return;this.focused=true,clearTimeout(this.caretTimeoutId);let i;this.focusText=this.inputViewChild?.nativeElement.value,i=this.keepBuffer?this.inputViewChild?.nativeElement.value.length:this.checkVal(),this.caretTimeoutId=setTimeout(()=>{this.inputViewChild?.nativeElement===this.inputViewChild?.nativeElement.ownerDocument.activeElement&&(this.writeBuffer(),i==this.mask?.replace("?","").length?this.caret(0,i):this.caret(i));},10),this.onFocus.emit(t);}onInputChange(t){this.androidChrome?this.handleAndroidInput(t):this.handleInputChange(t),this.onInput.emit(t);}handleInputChange(t){this.readonly||setTimeout(()=>{var i=this.checkVal(true);this.caret(i),this.updateModel(t),this.isCompleted()&&this.onComplete.emit();},0);}getUnmaskedValue(){let t=[];for(let i=0;i<this.buffer.length;i++){let e=this.buffer[i];this.tests[i]&&e!=this.getPlaceholder(i)&&t.push(e);}return t.join("")}updateModel(t){let i=t.target;if(!i)return;let e=this.unmask?this.getUnmaskedValue():i.value;e!=null&&(this.value=e,this.writeModelValue(this.value),this.onModelChange(this.value));}focus(){this.inputViewChild?.nativeElement.focus();}clear(){this.inputViewChild.nativeElement.value="",this.value=null,this.onModelChange(this.value),this.onClear.emit();}writeControlValue(t,i){this.value=t,i(this.value),this.inputViewChild&&this.inputViewChild.nativeElement&&(this.value==null||this.value==null?this.inputViewChild.nativeElement.value="":this.inputViewChild.nativeElement.value=this.value,this.checkVal(),this.focusText=this.inputViewChild.nativeElement.value),this.cd.markForCheck();}static \u0275fac=(()=>{let t;return function(e){return (t||(t=Uu(a)))(e||a)}})();static \u0275cmp=Pa({type:a,selectors:[["p-inputmask"],["p-inputMask"],["p-input-mask"]],contentQueries:function(i,e,n){if(i&1&&Hp(n,ue,4)(n,H0e,4),i&2){let s;gb(s=yb())&&(e.clearIconTemplate=s.first),gb(s=yb())&&(e.templates=s);}},viewQuery:function(i,e){if(i&1&&lx(he,7),i&2){let n;gb(n=yb())&&(e.inputViewChild=n.first);}},hostVars:2,hostBindings:function(i,e){i&2&&BV(e.cx("root"));},inputs:{type:"type",slotChar:"slotChar",autoClear:[2,"autoClear","autoClear",tl],showClear:[2,"showClear","showClear",tl],style:"style",inputId:"inputId",styleClass:"styleClass",placeholder:"placeholder",tabindex:"tabindex",title:"title",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",ariaRequired:[2,"ariaRequired","ariaRequired",tl],readonly:[2,"readonly","readonly",tl],unmask:[2,"unmask","unmask",tl],characterPattern:"characterPattern",autofocus:[2,"autofocus","autofocus",tl],autocomplete:"autocomplete",keepBuffer:[2,"keepBuffer","keepBuffer",tl],mask:"mask"},outputs:{onComplete:"onComplete",onFocus:"onFocus",onBlur:"onBlur",onInput:"onInput",onKeydown:"onKeydown",onClear:"onClear"},features:[c$([ve,le,{provide:re,useExisting:a},{provide:ge$1,useExisting:a}]),Pj([Z]),I0],decls:3,vars:27,consts:[["input",""],["pInputText","",3,"focus","blur","keydown","keypress","input","paste","pt","unstyled","invalid","ngStyle","pSize","variant","pAutoFocus","fluid"],[4,"ngIf"],["data-p-icon","times",3,"class","pBind","click",4,"ngIf"],[3,"class","pBind","click",4,"ngIf"],["data-p-icon","times",3,"click","pBind"],[3,"click","pBind"],[4,"ngTemplateOutlet"]],template:function(i,e){i&1&&(sp(0,"input",1,0),Fp("focus",function(s){return e.onInputFocus(s)})("blur",function(s){return e.onInputBlur(s)})("keydown",function(s){return e.onInputKeydown(s)})("keypress",function(s){return e.onKeyPress(s)})("input",function(s){return e.onInputChange(s)})("paste",function(s){return e.handleInputChange(s)}),ub(),_0(2,me,3,2,"ng-container",2)),i&2&&(BV(e.styleClass),B0("pt",e.ptm("pcInputText",e.ptmParams()))("unstyled",e.unstyled())("invalid",e.invalid())("ngStyle",e.style)("pSize",e.size())("variant",e.$variant())("pAutoFocus",e.autofocus)("fluid",e.hasFluid),Lp("id",e.inputId)("type",e.type)("name",e.name())("placeholder",e.placeholder)("title",e.title)("size",e.inputSize())("autocomplete",e.autocomplete)("maxlength",e.maxlength())("minlength",e.minlength())("tabindex",e.tabindex)("aria-label",e.ariaLabel)("aria-labelledBy",e.ariaLabelledBy)("aria-required",e.ariaRequired)("required",e.required()?"":void 0)("readonly",e.readonly?"":void 0)("disabled",e.$disabled()?"":void 0),zB(2),B0("ngIf",e.value!=null&&e.$filled()&&e.showClear&&!e.$disabled()));},dependencies:[cl,x3,R3,A3,us,Sr,rr,j0e,qo,Z],encapsulation:2})}return a})(),Xe=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=Ln({type:a});static \u0275inj=mn({imports:[oe,j0e,j0e]})}return a})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/var E=i=>({"with-border":i}),q=(()=>{class i{changeDetector=g(Cs);maxTimestamp=qp(void 0);timestamp=_pe(void 0);disabled=qp(false,{transform:tl});enableBorder=qp(false,{transform:tl});inputName=qp(void 0);mask=qp("99:99:99");formatter=qp(e=>WS({seconds:e,format:"full",symbol:":"}));parser=qp(e=>Cz(e));inputBlur=Cpe();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();}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=Pa({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:[c$([{provide:D,useExisting:af(()=>i),multi:true}])],decls:1,vars:7,consts:[["slotChar","0",3,"ngModelChange","onBlur","disabled","ngModel","ngClass","mask","inputId"]],template:function(a,t){a&1&&(sp(0,"p-inputMask",0),Mx("ngModelChange",function(o){return e$(t.timestampString,o)||(t.timestampString=o),o}),Fp("onBlur",function(){return t.onBlur()})("ngModelChange",function(){return t.onModelChange()}),ub(),GH()),a&2&&(B0("disabled",t.disabled()),Nx("ngModel",t.timestampString),B0("ngClass",l$(5,E,t.enableBorder()))("mask",t.mask())("inputId",t.inputName()),WH());},dependencies:[Xe,oe,Jn,qn,ln,w3],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}"],changeDetection:1})}return i})();/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{Xe as X,q};//# sourceMappingURL=chunk-BeORjHTo.js.map
