"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[62531],{56622:function(t,i,e){e.a(t,async function(t,a){try{e.r(i);var n,o,s,r,m=e(28430),c=e(97058),d=e(57567),l=e(25979),u=e(12463),h=e(16472),p=e(92297),v=(e(50113),e(18111),e(20116),e(26099),e(39980)),f=e(15697),g=e(57527),_=e(51209),k=e(23512),y=e(54239),z=t([v,y]);[v,y]=z.then?(await z)():z;var A=function(t){function i(){return(0,d.A)(this,i),(0,h.A)(this,i,arguments)}return(0,u.A)(i,t),(0,l.A)(i,[{key:"_initDate",value:function(){var t,i,e,a;if(this.config&&this.hass){var n=null===(t=this.hass)||void 0===t?void 0:t.locale;null!==(i=this.config)&&void 0!==i&&i.time_format&&(n=(0,c.A)((0,c.A)({},n),{},{time_format:this.config.time_format}));var o=(0,k.J)(n);this._dateTimeFormat=new Intl.DateTimeFormat(this.hass.locale.language,{hour:o?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:o?"h12":"h23",timeZone:(null===(e=this.config)||void 0===e?void 0:e.time_zone)||(0,y.wj)(n.time_zone,null===(a=this.hass.config)||void 0===a?void 0:a.time_zone)}),this._tick()}}},{key:"updated",value:function(t){if(t.has("hass")){var i,e=t.get("hass");e&&e.locale===(null===(i=this.hass)||void 0===i?void 0:i.locale)||this._initDate()}}},{key:"connectedCallback",value:function(){(0,p.A)(i,"connectedCallback",this,3)([]),this._startTick()}},{key:"disconnectedCallback",value:function(){(0,p.A)(i,"disconnectedCallback",this,3)([]),this._stopTick()}},{key:"_startTick",value:function(){var t=this;this._tickInterval=window.setInterval(function(){return t._tick()},1e3),this._tick()}},{key:"_stopTick",value:function(){this._tickInterval&&(clearInterval(this._tickInterval),this._tickInterval=void 0)}},{key:"_tick",value:function(){var t,i,e,a,n;if(this._dateTimeFormat){var o=this._dateTimeFormat.formatToParts();this._timeHour=null===(t=o.find(function(t){return"hour"===t.type}))||void 0===t?void 0:t.value,this._timeMinute=null===(i=o.find(function(t){return"minute"===t.type}))||void 0===i?void 0:i.value,this._timeSecond=null!==(e=this.config)&&void 0!==e&&e.show_seconds?null===(a=o.find(function(t){return"second"===t.type}))||void 0===a?void 0:a.value:void 0,this._timeAmPm=null===(n=o.find(function(t){return"dayPeriod"===t.type}))||void 0===n?void 0:n.value}}},{key:"render",value:function(){if(!this.config)return g.s6;var t=this.config.clock_size?"size-".concat(this.config.clock_size):"";return(0,g.qy)(n||(n=(0,m.A)([' <div class="time-parts ','"> <div class="time-part hour">','</div> <div class="time-part minute">',"</div> "," "," </div> "])),t,this._timeHour,this._timeMinute,void 0!==this._timeSecond?(0,g.qy)(o||(o=(0,m.A)(['<div class="time-part second">',"</div>"])),this._timeSecond):g.s6,void 0!==this._timeAmPm?(0,g.qy)(s||(s=(0,m.A)(['<div class="time-part am-pm">',"</div>"])),this._timeAmPm):g.s6)}}])}(g.WF);A.styles=(0,g.AH)(r||(r=(0,m.A)([':host{display:block}.time-parts{font-size:1.5rem;font-weight:var(--ha-font-weight-medium);direction:ltr;grid-template-areas:"hour minute second""hour minute am-pm";align-items:center;line-height:.8;display:grid}.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.second,.time-parts.size-medium .time-part.am-pm{font-size:var(--ha-font-size-l);margin-left:6px}.time-parts.size-large .time-part.second,.time-parts.size-large .time-part.am-pm{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{opacity:.4;grid-area:second;line-height:.9}.time-parts .time-part.am-pm{opacity:.6;grid-area:am-pm;line-height:.9}.time-parts .time-part.second,.time-parts .time-part.am-pm{font-size:var(--ha-font-size-xs);margin-left:4px}.time-parts .time-part.hour:after{content:":";margin:0 2px}']))),(0,f.Cg)([(0,_.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,f.Cg)([(0,_.MZ)({attribute:!1})],A.prototype,"config",void 0),(0,f.Cg)([(0,_.wk)()],A.prototype,"_dateTimeFormat",void 0),(0,f.Cg)([(0,_.wk)()],A.prototype,"_timeHour",void 0),(0,f.Cg)([(0,_.wk)()],A.prototype,"_timeMinute",void 0),(0,f.Cg)([(0,_.wk)()],A.prototype,"_timeSecond",void 0),(0,f.Cg)([(0,_.wk)()],A.prototype,"_timeAmPm",void 0),A=(0,f.Cg)([(0,_.EM)("hui-clock-card-digital")],A),e.d(i,{HuiClockCardDigital:function(){return A}}),a()}catch(C){a(C)}})}}]);
//# sourceMappingURL=62531.de936907847c8e41.js.map