"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[93037],{83676:function(a,e,t){t.a(a,async function(a,r){try{t.r(e);var i,o,s,d,n=t(28430),l=t(57567),h=t(25979),c=t(12463),v=t(16472),u=t(92297),p=(t(28706),t(2892),t(15697)),g=t(57527),f=t(51209),b=t(48612),y=t(148),w=t(99517),_=t(88457),C=t(98747),x=a([_,C]);[_,C]=x.then?(await x)():x;var M=!1,k=function(a){function e(){var a;(0,l.A)(this,e);for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return(a=(0,v.A)(this,e,[].concat(r))).isStrategy=!1,a.cards=[],a}return(0,c.A)(e,a),(0,h.A)(e,[{key:"setConfig",value:function(a){}},{key:"willUpdate",value:function(a){var r,i,o;if((0,u.A)(e,"willUpdate",this,3)([a]),null!==(r=this.lovelace)&&void 0!==r&&r.editMode&&!M&&(M=!0,t.e(14150).then(t.bind(t,58533))),a.has("cards")&&this._createCard(),a.has("lovelace")){var s=a.get("lovelace");(!a.has("cards")&&(null==s?void 0:s.config)!==(null===(i=this.lovelace)||void 0===i?void 0:i.config)||s&&(null==s?void 0:s.editMode)!==(null===(o=this.lovelace)||void 0===o?void 0:o.editMode))&&this._createCard()}}},{key:"render",value:function(){var a;return(0,g.qy)(i||(i=(0,n.A)([" "," "," "," "])),this.cards.length>1?(0,g.qy)(o||(o=(0,n.A)(['<ha-alert alert-type="warning">',"</ha-alert>"])),this.hass.localize("ui.panel.lovelace.editor.view.panel_mode.warning_multiple_cards")):"",this._card,null!==(a=this.lovelace)&&void 0!==a&&a.editMode&&0===this.cards.length?(0,g.qy)(s||(s=(0,n.A)([' <ha-button size="l" @click='," class=",'> <ha-svg-icon slot="start" .path=',"></ha-svg-icon> "," </ha-button> "])),this._addCard,(0,b.H)({rtl:(0,w.qC)(this.hass.language,this.hass.translationMetadata.translations)}),"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",this.hass.localize("ui.panel.lovelace.editor.edit_card.add")):"")}},{key:"_addCard",value:function(){(0,y.r)(this,"ll-create-card")}},{key:"_createCard",value:function(){var a;if(0!==this.cards.length){var e=this.cards[0];if(e.layout="panel",this.isStrategy||null===(a=this.lovelace)||void 0===a||!a.editMode)return e.preview=!1,void(this._card=e);var t=document.createElement("hui-card-options");t.hass=this.hass,t.lovelace=this.lovelace,t.path=[this.index,0],t.hidePosition=!0,e.preview=!0,t.appendChild(e),this._card=t}else this._card=void 0}}])}(g.WF);k.styles=(0,g.AH)(d||(d=(0,n.A)([":host{--restore-card-border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));--restore-card-border-width:var(--ha-card-border-width,1px);--restore-card-box-shadow:var(--ha-card-box-shadow,none);height:100%;display:block}*{--ha-card-border-radius:var(--ha-border-radius-square);--ha-card-border-width:0;--ha-card-box-shadow:none}ha-button{right:calc(16px + var(--safe-area-inset-right));bottom:calc(16px + var(--safe-area-inset-bottom));z-index:1;float:var(--float-end);--ha-button-box-shadow:var(--ha-box-shadow-l);position:fixed;inset-inline-start:initial;inset-inline-end:calc(16px + var(--safe-area-inset-right))}"]))),(0,p.Cg)([(0,f.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,p.Cg)([(0,f.MZ)({attribute:!1})],k.prototype,"lovelace",void 0),(0,p.Cg)([(0,f.MZ)({type:Number})],k.prototype,"index",void 0),(0,p.Cg)([(0,f.MZ)({attribute:!1})],k.prototype,"isStrategy",void 0),(0,p.Cg)([(0,f.MZ)({attribute:!1})],k.prototype,"cards",void 0),(0,p.Cg)([(0,f.wk)()],k.prototype,"_card",void 0),k=(0,p.Cg)([(0,f.EM)("hui-panel-view")],k),t.d(e,{PanelView:function(){return k}}),r()}catch(A){r(A)}})}}]);
//# sourceMappingURL=93037.53c042b316871868.js.map