export const __rspack_esm_id="43388";export const __rspack_esm_ids=["43388"];export const __webpack_modules__={41367(t,i,e){e.a(t,async function(t,s){try{e.r(i),e.d(i,{HuiClockCardDigital:()=>h});e(18111),e(20116);var a=e(74487),r=e(62826),o=e(96196),m=e(97735),n=e(69543),c=e(8480),d=t([a,c]);[a,c]=d.then?(await d)():d;const p=1e3;class h extends o.WF{_initDate(){if(!this.config||!this.hass)return;let t=this.hass?.locale;this.config?.time_format&&(t={...t,time_format:this.config.time_format});const i=(0,n.J)(t);this._dateTimeFormat=new Intl.DateTimeFormat(this.hass.locale.language,{hour:i?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:i?"h12":"h23",timeZone:this.config?.time_zone||(0,c.w)(t.time_zone,this.hass.config?.time_zone)}),this._tick()}updated(t){if(t.has("hass")){const i=t.get("hass");i&&i.locale===this.hass?.locale||this._initDate()}}connectedCallback(){super.connectedCallback(),this._startTick()}disconnectedCallback(){super.disconnectedCallback(),this._stopTick()}_startTick(){this._tickInterval=window.setInterval(()=>this._tick(),p),this._tick()}_stopTick(){this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=void 0)}_tick(){if(!this._dateTimeFormat)return;const t=this._dateTimeFormat.formatToParts();this._timeHour=t.find(t=>"hour"===t.type)?.value,this._timeMinute=t.find(t=>"minute"===t.type)?.value,this._timeSecond=this.config?.show_seconds?t.find(t=>"second"===t.type)?.value:void 0,this._timeAmPm=t.find(t=>"dayPeriod"===t.type)?.value}render(){if(!this.config)return o.s6;const t=this.config.clock_size?`size-${this.config.clock_size}`:"";return o.qy` <div class="time-parts ${t}"> <div class="time-part hour">${this._timeHour}</div> <div class="time-part minute">${this._timeMinute}</div> ${void 0!==this._timeSecond?o.qy`<div class="time-part second">${this._timeSecond}</div>`:o.s6} ${void 0!==this._timeAmPm?o.qy`<div class="time-part am-pm">${this._timeAmPm}</div>`:o.s6} </div> `}}h.styles=o.AH`:host{display:block}.time-parts{align-items:center;display:grid;grid-template-areas:"hour minute second" "hour minute am-pm";font-size:1.5rem;font-weight:var(--ha-font-weight-medium);line-height:.8;direction:ltr}.time-title+.time-parts{font-size:1.5rem}.time-parts.size-medium{font-size:3rem}.time-parts.size-large{font-size:4rem}.time-parts.size-medium .time-part.am-pm,.time-parts.size-medium .time-part.second{font-size:var(--ha-font-size-l);margin-left:6px}.time-parts.size-large .time-part.am-pm,.time-parts.size-large .time-part.second{font-size:var(--ha-font-size-2xl);margin-left:8px}.time-parts .time-part.hour{grid-area:hour}.time-parts .time-part.minute{grid-area:minute}.time-parts .time-part.second{grid-area:second;line-height:.9;opacity:.4}.time-parts .time-part.am-pm{grid-area:am-pm;line-height:.9;opacity:.6}.time-parts .time-part.am-pm,.time-parts .time-part.second{font-size:var(--ha-font-size-xs);margin-left:4px}.time-parts .time-part.hour:after{content:":";margin:0 2px}`,(0,r.Cg)([(0,m.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,r.Cg)([(0,m.MZ)({attribute:!1})],h.prototype,"config",void 0),(0,r.Cg)([(0,m.wk)()],h.prototype,"_dateTimeFormat",void 0),(0,r.Cg)([(0,m.wk)()],h.prototype,"_timeHour",void 0),(0,r.Cg)([(0,m.wk)()],h.prototype,"_timeMinute",void 0),(0,r.Cg)([(0,m.wk)()],h.prototype,"_timeSecond",void 0),(0,r.Cg)([(0,m.wk)()],h.prototype,"_timeAmPm",void 0),h=(0,r.Cg)([(0,m.EM)("hui-clock-card-digital")],h),s()}catch(t){s(t)}})}};
//# sourceMappingURL=43388.41e11e195e0ce540.js.map