"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["86310"],{63130:function(o,e,t){t.d(e,{l:function(){return i}});t(3362);var a=t(50248);const i=async(o,e)=>{if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(o))}catch(s){}const t=e||(()=>{const o=(0,a.n)();if(o instanceof HTMLElement){let e=o.getRootNode(),t=null;for(;e instanceof ShadowRoot&&e.host instanceof HTMLElement;)t=e.host,e=e.host.getRootNode();if(t)return t}return document.body})(),i=document.createElement("textarea");i.value=o,i.setAttribute("readonly",""),i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.opacity="0",t.appendChild(i),i.select(),document.execCommand("copy"),t.removeChild(i)}},82277:function(o,e,t){t.a(o,async function(o,a){try{t.r(e);t(3362);var i=t(40445),s=t(96196),n=t(77845),c=t(1087),r=t(63130),l=t(18350),d=(t(93444),t(26300)),h=t(72554),p=t(14503),y=t(81619),u=o([l,d,h]);[l,d,h]=u.then?(await u)():u;let m,g,v=o=>o;const f="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z";class _ extends s.WF{async showDialog(o){this._params=o}closeDialog(){this._params=void 0,(0,c.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._params?(0,s.qy)(m||(m=v` <ha-dialog open @closed="${0}" header-title="${0}"> <div class="content"> <p> ${0} </p> <div class="key-row"> <div class="key-container"> <code>${0}</code> </div> <ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> </div> </div> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" data-dialog="close"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this.closeDialog,this.hass.localize("ui.panel.config.devices.esphome.encryption_key_title"),this.hass.localize("ui.panel.config.devices.esphome.encryption_key_description"),this._params.encryption_key,this._copyToClipboard,this.hass.localize("ui.common.copy"),f,this.hass.localize("ui.common.close")):s.s6}async _copyToClipboard(){var o;null!==(o=this._params)&&void 0!==o&&o.encryption_key&&(await(0,r.l)(this._params.encryption_key),(0,y.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")}))}static get styles(){return[p.nA,(0,s.AH)(g||(g=v`.content{display:flex;flex-direction:column;gap:var(--ha-space-6)}.key-row{display:flex;gap:var(--ha-space-2);align-items:center}.key-container{flex:1;border-radius:var(--ha-space-2);border:1px solid var(--divider-color);background-color:var(--code-editor-background-color,var(--secondary-background-color));padding:var(--ha-space-3);overflow:auto}p{margin:0;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed)}`))]}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],_.prototype,"_params",void 0),_=(0,i.Cg)([(0,n.EM)("dialog-esphome-encryption-key")],_),a()}catch(m){a(m)}})}}]);
//# sourceMappingURL=86310.20d7ee8572e0f20c.js.map