"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["45750"],{90005:function(e,a,t){t.a(e,async function(e,r){try{t.r(a),t.d(a,{PanelView:function(){return y}});t(3362),t(62953);var i=t(40445),d=t(96196),s=t(77845),o=t(94333),l=t(1087),n=t(15638),h=t(38962),c=e([h]);h=(c.then?(await c)():c)[0];let v,p,u,b,g=e=>e;const f="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";let w=!1;class y extends d.WF{setConfig(e){}willUpdate(e){var a,r,i;if(super.willUpdate(e),null!==(a=this.lovelace)&&void 0!==a&&a.editMode&&!w&&(w=!0,t.e("59127").then(t.bind(t,70410))),e.has("cards")&&this._createCard(),!e.has("lovelace"))return;const d=e.get("lovelace");(!e.has("cards")&&(null==d?void 0:d.config)!==(null===(r=this.lovelace)||void 0===r?void 0:r.config)||d&&(null==d?void 0:d.editMode)!==(null===(i=this.lovelace)||void 0===i?void 0:i.editMode))&&this._createCard()}render(){var e;return(0,d.qy)(v||(v=g` ${0} ${0} ${0} `),this.cards.length>1?(0,d.qy)(p||(p=g`<ha-alert alert-type="warning">${0}</ha-alert>`),this.hass.localize("ui.panel.lovelace.editor.view.panel_mode.warning_multiple_cards")):"",this._card,null!==(e=this.lovelace)&&void 0!==e&&e.editMode&&0===this.cards.length?(0,d.qy)(u||(u=g` <ha-fab .label="${0}" extended @click="${0}" class="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-fab> `),this.hass.localize("ui.panel.lovelace.editor.edit_card.add"),this._addCard,(0,o.H)({rtl:(0,n.qC)(this.hass)}),f):"")}_addCard(){(0,l.r)(this,"ll-create-card")}_createCard(){var e;if(0===this.cards.length)return void(this._card=void 0);const a=this.cards[0];if(a.layout="panel",this.isStrategy||null===(e=this.lovelace)||void 0===e||!e.editMode)return a.preview=!1,void(this._card=a);const t=document.createElement("hui-card-options");t.hass=this.hass,t.lovelace=this.lovelace,t.path=[this.index,0],t.hidePosition=!0,a.preview=!0,t.appendChild(a),this._card=t}constructor(...e){super(...e),this.isStrategy=!1,this.cards=[]}}y.styles=(0,d.AH)(b||(b=g`:host{display:block;height:100%;--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)}*{--ha-card-border-radius:var(--ha-border-radius-square);--ha-card-border-width:0;--ha-card-box-shadow:none}ha-fab{position:fixed;right:calc(16px + var(--safe-area-inset-right));bottom:calc(16px + var(--safe-area-inset-bottom));z-index:1;float:var(--float-end);inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial}`)),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"lovelace",void 0),(0,i.Cg)([(0,s.MZ)({type:Number})],y.prototype,"index",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"isStrategy",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"cards",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_card",void 0),y=(0,i.Cg)([(0,s.EM)("hui-panel-view")],y),r()}catch(v){r(v)}})}}]);
//# sourceMappingURL=45750.8e5f801884469dca.js.map