"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["31854"],{55782:function(i,s,t){t.d(s,{AU:function(){return o},Ik:function(){return c},Qk:function(){return r},TP:function(){return p},UL:function(){return d},ZF:function(){return l},do:function(){return u},vR:function(){return h}});t(3362);var e=t(70570),n=t(9899);const r={critical:1,error:2,warning:3},a=i=>i.sendMessagePromise({type:"repairs/list_issues"}),o=(i,s,t)=>i.sendMessagePromise({type:"repairs/get_issue_data",domain:s,issue_id:t}),c=async(i,s,t)=>i.callWS({type:"repairs/ignore_issue",issue_id:s.issue_id,domain:s.domain,ignore:t}),h=(i,s,t)=>i.callApi("POST","repairs/issues/fix",{handler:s,issue_id:t}),l=(i,s)=>i.callApi("GET",`repairs/issues/fix/${s}`),u=(i,s,t)=>i.callApi("POST",`repairs/issues/fix/${s}`,t),d=(i,s)=>i.callApi("DELETE",`repairs/issues/fix/${s}`),_=(i,s)=>i.subscribeEvents((0,n.s)(()=>a(i).then(i=>s.setState(i,!0)),500,!0),"repairs_issue_registry_updated"),p=(i,s)=>(0,e.N)("_repairsIssueRegistry",a,_,i,s)},84029:function(i,s,t){t.r(s),t.d(s,{HuiRepairsCard:function(){return g}});t(49255),t(18111),t(22489),t(3362),t(62953);var e=t(40445),n=t(96196),r=t(77845),a=t(1087),o=t(91926),c=(t(76776),t(22573),t(80933),t(32248),t(55782)),h=t(54706),l=t(37544),u=t(97176),d=t(51989);let _,p,f=i=>i;class g extends((0,h.E)(n.WF)){hassSubscribe(){return[(0,c.TP)(this.hass.connection,i=>{this._repairsIssues=i.issues.filter(i=>!1!==i.active&&!i.ignored)})]}setConfig(i){this._config=i}getCardSize(){var i;return null!==(i=this._config)&&void 0!==i&&i.vertical?2:1}getGridOptions(){var i;let s=6,t=1;return null!==(i=this._config)&&void 0!==i&&i.vertical&&(t++,s=3),{columns:6,rows:t,min_columns:s,min_rows:t}}async _handleAction(i){var s;"tap"!==i.detail.action||(0,u.h)(null===(s=this._config)||void 0===s?void 0:s.tap_action)?(0,l.$)(this,this.hass,this._config,i.detail.action):(0,o.o)("/config/repairs")}get _hasCardAction(){var i,s,t,e;return!(null!==(i=this._config)&&void 0!==i&&i.tap_action)||(0,u.h)(null===(s=this._config)||void 0===s?void 0:s.tap_action)||(0,u.h)(null===(t=this._config)||void 0===t?void 0:t.hold_action)||(0,u.h)(null===(e=this._config)||void 0===e?void 0:e.double_tap_action)}willUpdate(i){var s;if(super.willUpdate(i),!this._config||!this.hass)return;const t=Boolean(!(null!==(s=this.hass.user)&&void 0!==s&&s.is_admin)||this._config.hide_empty&&0===this._repairsIssues.length);t!==this.hidden&&(this.style.display=t?"none":"",this.toggleAttribute("hidden",t),(0,a.r)(this,"card-visibility-changed",{value:!t}))}render(){if(!this._config||!this.hass||this.hidden)return n.s6;const i=this._repairsIssues.length,s=this.hass.localize("ui.card.repairs.title"),t=i>0?this.hass.localize("ui.card.repairs.count_issues",{count:i}):this.hass.localize("ui.card.repairs.no_issues");return(0,n.qy)(_||(_=f` <ha-card> <ha-tile-container .vertical="${0}" .interactive="${0}" .actionHandlerOptions="${0}" @action="${0}"> <ha-tile-icon slot="icon" .iconPath="${0}"></ha-tile-icon> <ha-tile-info slot="info" .primary="${0}" .secondary="${0}"></ha-tile-info> </ha-tile-container> </ha-card> `),Boolean(this._config.vertical),this._hasCardAction,{hasHold:(0,u.h)(this._config.hold_action),hasDoubleClick:(0,u.h)(this._config.double_tap_action)},this._handleAction,"M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z",s,t)}constructor(...i){super(...i),this.connectedWhileHidden=!0,this._repairsIssues=[]}}g.styles=[d.c,(0,n.AH)(p||(p=f`:host{--tile-color:var(--warning-color)}`))],(0,e.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,e.Cg)([(0,r.wk)()],g.prototype,"_config",void 0),(0,e.Cg)([(0,r.wk)()],g.prototype,"_repairsIssues",void 0),g=(0,e.Cg)([(0,r.EM)("hui-repairs-card")],g)}}]);
//# sourceMappingURL=31854.5876268207ce5a8c.js.map