"use strict";(self.webpackChunkdotcms_ui=self.webpackChunkdotcms_ui||[]).push([[37],{80037:(u,h,i)=>{i.r(h),i.d(h,{dot_time:()=>o});var d=i(15861),s=i(55956),a=i(26184),n=i(47628),r=i(50394);const o=class{constructor(t){(0,s.r)(this,t),this.dotValueChange=(0,s.c)(this,"dotValueChange",7),this.dotStatusChange=(0,s.c)(this,"dotStatusChange",7),this.value="",this.name="",this.label="",this.hint="",this.required=!1,this.requiredMessage="This field is required",this.validationMessage="The field doesn't comply with the specified format",this.disabled=!1,this.min="",this.max="",this.step="1",this.classNames=void 0,this.errorMessageElement=void 0}reset(){var t=this;return(0,d.Z)(function*(){t.el.querySelector("dot-input-calendar").reset()})()}componentWillLoad(){this.validateProps()}componentDidLoad(){const t=["dottype"],e=this.el.querySelector('input[type="time"]');setTimeout(()=>{const m=(0,r.g)(Array.from(this.el.attributes),t);(0,r.s)(e,m)},0)}minWatch(){this.min=(0,n.c)(this,"min","time")}maxWatch(){this.max=(0,n.c)(this,"max","time")}emitValueChange(t){t.stopImmediatePropagation();const e=t.detail;this.value=e.value,this.dotValueChange.emit(e)}emitStatusChange(t){t.stopImmediatePropagation();const e=t.detail;this.classNames=(0,a.a)(e.status,e.status.dotValid,this.required),this.setErrorMessageElement(e),this.dotStatusChange.emit({name:e.name,status:e.status})}render(){return(0,s.h)(s.H,{class:Object.assign({},this.classNames)},(0,s.h)("dot-label",{label:this.label,required:this.required,name:this.name},(0,s.h)("dot-input-calendar",{"aria-describedby":(0,a.h)(this.hint),tabIndex:this.hint?0:null,disabled:this.disabled,type:"time",name:this.name,value:this.value,required:this.required,min:this.min,max:this.max,step:this.step})),(0,a.c)(this.hint),this.errorMessageElement)}validateProps(){this.minWatch(),this.maxWatch()}setErrorMessageElement(t){this.errorMessageElement=(0,a.b)(!t.status.dotValid&&!t.status.dotPristine,this.getErrorMessage(t))}getErrorMessage(t){return this.value?t.isValidRange?"":this.validationMessage:this.requiredMessage}get el(){return(0,s.g)(this)}static get watchers(){return{min:["minWatch"],max:["maxWatch"]}}};o.style=""}}]);