import{r as t,c as s,h as e}from"./p-a0e89da3.js";const i=class{constructor(e){t(this,e),this.step=15,this.clock24=!0,this.timeSelectedChange=s(this,"timeSelectedChange",7)}_getOptions(){const t=Math.round(60/this.step*24),s=[];for(let e=0;e<t;e++)s.push(e*this.step);return s}_format(t,s){let e="";return!this.clock24&&t>=12?(e="PM",t-=12):!this.clock24&&t<12&&(e="AM"),this.clock24||0!==t||(t=12),t<10&&(t=`0${t}`),s<10&&(s=`0${s}`),e&&(s+=` ${e}`),`${t}:${s}`}_renderOption(t){const s=new Date(0);s.setMinutes(t);const i=s.getUTCHours(),r=s.getUTCMinutes(),h=this._format(i,r);return e("materials-list-item",this.timeSelected===h?{selected:!0,onClick:()=>this.timeSelectedChange.emit(h)}:{onClick:()=>this.timeSelectedChange.emit(h)},h)}render(){return this._getOptions().map(t=>this._renderOption(t))}};export{i as materials_timepicker};