export const __rspack_esm_id="36569";export const __rspack_esm_ids=["36569"];export const __webpack_modules__={50248(t,e,a){a.d(e,{n:()=>o});const o=(t=document)=>t.activeElement?.shadowRoot?.activeElement?o(t.activeElement.shadowRoot):t.activeElement},91926(t,e,a){a.d(e,{O:()=>l,o:()=>s});var o=a(22444),i=a(1087),r=a(63091);const n=async t=>{const{history:e}=r.G;if(!e.state?.dialog||Date.now()-t>=500)return!0;return await(0,o.Jh)()?(await new Promise(t=>{setTimeout(t)}),n(t)):(console.warn("Navigation blocked, because dialog refused to close"),!1)},s=async(t,e)=>{if(!await n(Date.now()))return!1;const a=e?.replace||!1;return a?r.G.history.replaceState(r.G.history.state?.root?{root:!0}:e?.data??null,"",t):r.G.history.pushState(e?.data??null,"",t),(0,i.r)(r.G,"location-changed",{replace:a}),!0},l=async t=>{if(!await n(Date.now()))return;const{history:e}=r.G;if(e.length>1)return void e.back();s(t||"/",{replace:!0})}},12587(t,e,a){a.d(e,{E:()=>i,m:()=>o});const o=t=>{requestAnimationFrame(()=>setTimeout(t,0))},i=()=>new Promise(t=>{o(t)})},2846(t,e,a){a.d(e,{G:()=>d,J:()=>l});var o=a(62826),i=a(12415),r=a(82553),n=a(96196),s=a(97735);a(54276);const l=[r.R,n.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class d extends i.n{renderRipple(){return"text"===this.type?n.s6:n.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}d.styles=l,d=(0,o.Cg)([(0,s.EM)("ha-md-list-item")],d)},54276(t,e,a){var o=a(62826),i=a(76482),r=a(91382),n=a(96245),s=a(96196),l=a(97735);class d extends r.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){t?.removeEventListener("touchend",this._handleTouchEnd),e?.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new i.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[n.R,s.AH`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
          --ha-ripple-hover-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        );--md-ripple-pressed-color:var(
          --ha-ripple-pressed-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        )}`],d=(0,o.Cg)([(0,l.EM)("ha-ripple")],d)},34127(t,e,a){a.a(t,async function(t,e){try{var o=a(62826),i=a(52630),r=a(96196),n=a(97735),s=t([i]);i=(s.then?(await s)():s)[0];class l extends i.A{static get styles(){return[i.A.styles,r.AH`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--secondary-background-color)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-s)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-normal)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-sm)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}`]}constructor(...t){super(...t),this.showDelay=150,this.hideDelay=150}}(0,o.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],l.prototype,"showDelay",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],l.prototype,"hideDelay",void 0),l=(0,o.Cg)([(0,n.EM)("ha-tooltip")],l),e()}catch(t){e(t)}})},77423(t,e,a){a.d(e,{A:()=>i,Cm:()=>r,Fs:()=>u,JW:()=>f,TC:()=>l,VN:()=>d,Vx:()=>c,XQ:()=>m,eM:()=>g,iH:()=>h,k3:()=>y,m4:()=>n,qf:()=>s,t0:()=>o,yv:()=>p});a(44114),a(18111),a(22489),a(20116),a(7588),a(61701);const o=(t,e)=>t.callWS({type:"config_entries/subentries/list",entry_id:e}),i=(t,e,a,o)=>t.callWS({type:"config_entries/subentries/update",entry_id:e,subentry_id:a,...o}),r=(t,e,a)=>t.callWS({type:"config_entries/subentries/delete",entry_id:e,subentry_id:a}),n=66649!=a.j?["migration_error","setup_error","setup_retry"]:null,s=66649!=a.j?["not_loaded","loaded","setup_error","setup_retry"]:null,l=(t,e,a)=>{const o={type:"config_entries/subscribe"};return a&&a.type&&(o.type_filter=a.type),t.connection.subscribeMessage(t=>{e(t)},o)},d=(t,e)=>{const a={};return e&&(e.type&&(a.type_filter=e.type),e.domain&&(a.domain=e.domain)),t.callWS({type:"config_entries/get",...a})},c=(t,e)=>t.callWS({type:"config_entries/get_single",entry_id:e}),h=(t,e,a)=>t.callWS({type:"config_entries/update",entry_id:e,...a}),g=(t,e)=>t.callApi("DELETE",`config/config_entries/entry/${e}`),p=(t,e)=>t.callApi("POST",`config/config_entries/entry/${e}/reload`),m=(t,e)=>t.callWS({type:"config_entries/disable",entry_id:e,disabled_by:"user"}),y=(t,e)=>t.callWS({type:"config_entries/disable",entry_id:e,disabled_by:null}),f=(t,e)=>{if(!e)return t;const a=t.find(t=>t.entry_id===e);if(!a)return t;return[a,...t.filter(t=>t.entry_id!==e)]};class u{processMessage(t){return t.forEach(t=>{if(null!==t.type&&"added"!==t.type)if("removed"!==t.type){if("updated"===t.type){const e=t.entry;this._entries=this._entries.map(t=>t.entry_id===e.entry_id?e:t)}}else this._entries=this._entries.filter(e=>e.entry_id!==t.entry.entry_id);else this._entries.push(t.entry)}),this._entries}constructor(){this._entries=[]}}},59241(t,e,a){a.d(e,{BM:()=>A,Bz:()=>E,DW:()=>y,Er:()=>m,G3:()=>v,G_:()=>w,Ox:()=>T,P9:()=>z,RP:()=>x,bg:()=>b,fs:()=>h,jh:()=>f,n4:()=>S,oY:()=>c,v:()=>u,z0:()=>g});a(18111),a(22489),a(20116);var o=a(35518),i=a(22786),r=a(71727),n=a(28978),s=a(52220),l=a(9899);const d=66649!=a.j?["light","cover","valve"]:null,c=t=>d.includes(t),h=t=>null==t||t.length>0,g=t=>null!=t,p=["sensor","binary_sensor"],m=(t,e)=>{const a=e.filter(e=>t.states[e.entity_id]&&"battery"===t.states[e.entity_id].attributes.device_class&&p.includes((0,r.m)(e.entity_id))).sort((t,e)=>p.indexOf((0,r.m)(t.entity_id))-p.indexOf((0,r.m)(e.entity_id)));if(a.length>0)return a[0]},y=(t,e)=>e.find(e=>t.states[e.entity_id]&&"battery_charging"===t.states[e.entity_id].attributes.device_class),f=(t,e)=>{if(e.name)return e.name;const a=t.states[e.entity_id];return a?(0,n.u)(a):e.original_name?e.original_name:e.entity_id},u=(t,e)=>t.callWS({type:"config/entity_registry/get",entity_id:e}),v=(t,e)=>t.callWS({type:"config/entity_registry/get_entries",entity_ids:e}),w=(t,e,a)=>t.callWS({type:"config/entity_registry/update",entity_id:e,...a}),b=(t,e)=>t.callWS({type:"config/entity_registry/remove",entity_id:e}),_=t=>t.sendMessagePromise({type:"config/entity_registry/list"}),x=t=>t.sendMessagePromise({type:"config/entity_registry/list_for_display"}),k=(t,e)=>t.subscribeEvents((0,l.s)(()=>_(t).then(t=>e.setState(t,!0)),500,!0),"entity_registry_updated"),E=(t,e)=>(0,o.N)("_entityRegistry",_,k,t,e),S=(t,e)=>t.sort((t,a)=>(0,s.SH)(t.name||"",a.name||"",e)),T=(0,i.A)(t=>{const e={};for(const a of t)e[a.entity_id]=a;return e}),z=(0,i.A)(t=>{const e={};for(const a of t)e[a.id]=a;return e}),A=(t,e)=>t.callWS({type:"config/entity_registry/get_automatic_entity_ids",entity_ids:e})},65063(t,e,a){a.d(e,{an:()=>l,dk:()=>s,showAlertDialog:()=>n});var o=a(1087);const i=()=>Promise.all([a.e("4801"),a.e("33212"),a.e("46995"),a.e("251"),a.e("84776")]).then(a.bind(a,26683)),r=(t,e,a)=>new Promise(r=>{const n=e.cancel,s=e.confirm;(0,o.r)(t,"show-dialog",{dialogTag:"dialog-box",dialogImport:i,dialogParams:{...e,...a,cancel:()=>{r(!!a?.prompt&&null),n&&n()},confirm:t=>{r(!a?.prompt||t),s&&s(t)}}})}),n=(t,e)=>r(t,e),s=(t,e)=>r(t,e,{confirmation:!0}),l=(t,e)=>r(t,e,{prompt:!0})},22444(t,e,a){a.d(e,{oO:()=>y,t3:()=>g,zU:()=>h,Jh:()=>p,ui:()=>c});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const o=(t,e,a=true)=>{if(!t||t===document.body)return null;if((t=t.assignedSlot??t).parentElement)t=t.parentElement;else{const e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return(a?Object.prototype.hasOwnProperty.call(t,e):t&&e in t)?t:o(t,e,a)};if(66649!=a.j)var i=a(50248);var r=a(63091);if(66649!=a.j)var n=a(12587);const s={},l=[],d=Symbol.for("HA focus target"),c=async(t,e,a,n,h,g=!0)=>{if(!(e in s)){if(!n)return!1;s[e]={element:n().then(()=>{const a=document.createElement(e);return"showDialog"in a&&t.provideHass(a),a.addEventListener("dialog-closed",m),a.addEventListener("dialog-closed",f),a})}}if(g){const{history:o}=r.G;if(o.state?.dialog&&!l.length)return await new Promise(t=>{setTimeout(t)}),c(t,e,a,n,h,g);const i=l.findIndex(t=>t.dialogTag===e);-1!==i&&l.splice(i,1),l.push({element:t,dialogTag:e,dialogParams:a,dialogImport:n,addHistory:g});const s={dialog:e};o.state?.dialog?o.replaceState(s,""):(o.replaceState({...o.state,opensDialog:!0},""),o.pushState(s,""))}let p;if(s[e].closedFocusTargets=((t,e,a=!0)=>{const i=new Set;for(;t;)i.add(t),t=o(t,e,a);return i})((0,i.n)(),d),s[e]&&null===s[e].element?(p=document.createElement(e),p.addEventListener("dialog-closed",m),p.addEventListener("dialog-closed",f),s[e].element=Promise.resolve(p)):p=await s[e].element,"dialogNext"in p&&p.dialogNext)p.params=a;else{if(!("showDialog"in p))throw new Error("Unknown dialog type loaded");p.showDialog(a)}const y=(h||t).shadowRoot;return p.parentNode!==y&&y.appendChild(p),!0},h=async(t,e)=>{if(!(t in s))return!0;const a=await s[t].element;return!a||!a.closeDialog||!1!==a.closeDialog(e)},g=async t=>{if(l.length){const e=l.pop(),a=await h(e.dialogTag,t);return a?l.length&&r.G.history.state?.opensDialog&&r.G.history.pushState({dialog:l[l.length-1].dialogTag},""):l.push(e),a}return!0},p=async()=>{for(let t=l.length-1;t>=0;t--){if(!(!l[t]||await h(l[t].dialogTag)))return!1}return!0},m=t=>{const e=l.findIndex(e=>e.dialogTag===t.detail.dialog);if(-1!==e&&l.splice(e,1),r.G.history.state?.dialog===t.detail.dialog&&(l.length?r.G.history.replaceState({dialog:l[l.length-1].dialogTag},""):-1!==e&&r.G.history.back()),t.currentTarget&&"params"in t.currentTarget){const e=t.currentTarget;e.removeEventListener("dialog-closed",m),e.removeEventListener("dialog-closed",f),s[t.detail.dialog].element=null}},y=t=>{t.addEventListener("show-dialog",e=>{const{dialogTag:a,dialogImport:o,dialogParams:i,addHistory:r,parentElement:n}=e.detail;c(t,a,i,o,n,r)})},f=async t=>{if(!s[t.detail.dialog])return;const e=s[t.detail.dialog].closedFocusTargets;if(delete s[t.detail.dialog].closedFocusTargets,!e)return;let a=(0,i.n)();a instanceof HTMLElement&&a.blur(),await(0,n.E)();for(const t of e)if(t instanceof HTMLElement&&(t.focus(),a=(0,i.n)(),a&&a!==document.body))return}},14503(t,e,a){a.d(e,{RF:()=>r,dp:()=>l,kO:()=>s,nA:()=>n,og:()=>i});var o=a(96196);const i=o.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,r=o.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${i} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,n=o.AH`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`,s=o.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,l=o.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;o.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},44144(t,e,a){a.d(e,{Cv:()=>n,MR:()=>c,QR:()=>h,_c:()=>d,a_:()=>p,bg:()=>m,yM:()=>g});a(18111),a(22489),a(14603),a(47566),a(98721);let o,i;const r=66649!=a.j?18e5:null,n=t=>s(t).then(()=>l(t),()=>{}),s=async t=>{const e=await t.callWS({type:"brands/access_token"});o=e.token},l=t=>{d(),i=setInterval(()=>{s(t).catch(()=>{})},r)},d=()=>{i&&(clearInterval(i),i=void 0)},c=(t,e)=>{e=e??location.origin;const a=`/api/brands/integration/${t.domain}/${t.darkOptimized?"dark_":""}${t.type}.png`,i=new URL(a,e);return o&&i.searchParams.set("token",o),i.toString()},h=(t,e)=>{e=e??location.origin;const a=`/api/brands/hardware/${t.category}/${t.darkOptimized?"dark_":""}${t.manufacturer}${t.model?`_${t.model}`:""}.png`,i=new URL(a,e);return o&&i.searchParams.set("token",o),i.toString()},g=(t,e)=>{if(e=e??location.origin,!o)return t;try{const a=new URL(t,e);return a.pathname.startsWith("/api/brands/")?(a.searchParams.set("token",o),a.toString()):t}catch{return t}},p=t=>{const e=new URL(t,location.origin);if(e.pathname.startsWith("/api/brands/"))return e.pathname.split("/")[4];const a=e.pathname.split("/").filter(t=>t.length>0),o=a.indexOf("_");return-1!==o&&o+1<a.length?a[o+1]:a[1]??""},m=t=>{try{return new URL(t,location.origin).pathname.startsWith("/api/brands/")||t.startsWith("https://brands.home-assistant.io/")}catch{return!1}}}};
//# sourceMappingURL=36569.8c1770ff3a363d41.js.map