UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

5 lines 50.1 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["62073"],{31146:function(e,t,a){a.d(t,{i:()=>o});const i=(0,a(93826).P)((e=>{history.replaceState({scrollPosition:e},"")}),300),o=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){i(e),this[`__${String(t.key)}`]=e},get(){var e;return this[`__${String(t.key)}`]||(null===(e=history.state)||void 0===e?void 0:e.scrollPosition)},enumerable:!0,configurable:!0},finisher(a){const i=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){i.call(this);const a=this[t.key];a&&this.updateComplete.then((()=>{const t=this.renderRoot.querySelector(e);t&&setTimeout((()=>{t.scrollTop=a}),0)}))}}})},93826:function(e,t,a){a.d(t,{P:()=>i});a(71695),a(47021);const i=(e,t,a=!0,i=!0)=>{let o,n=0;const r=(...r)=>{const s=()=>{n=!1===a?0:Date.now(),o=void 0,e(...r)},d=Date.now();n||!1!==a||(n=d);const l=t-(d-n);l<=0||l>t?(o&&(clearTimeout(o),o=void 0),n=d,e(...r)):o||!1===i||(o=window.setTimeout(s,l))};return r.cancel=()=>{clearTimeout(o),o=void 0,n=0},r}},34273:function(e,t,a){var i=a(61701),o=a(72621),n=(a(71695),a(9359),a(31526),a(47021),a(22997),a(57243)),r=a(50778),s=a(5111),d=a(76525);let l,c,h=e=>e;(0,i.Z)([(0,r.Mo)("ha-button-menu")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:d.gA,value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"corner",value(){return"BOTTOM_START"}},{kind:"field",decorators:[(0,r.Cb)({attribute:"menu-corner"})],key:"menuCorner",value(){return"START"}},{kind:"field",decorators:[(0,r.Cb)({type:Number})],key:"x",value(){return null}},{kind:"field",decorators:[(0,r.Cb)({type:Number})],key:"y",value(){return null}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"multi",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"activatable",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"fixed",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value(){return!1}},{kind:"field",decorators:[(0,r.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.items}},{kind:"get",key:"selected",value:function(){var e;return null===(e=this._menu)||void 0===e?void 0:e.selected}},{kind:"method",key:"focus",value:function(){var e,t;null!==(e=this._menu)&&void 0!==e&&e.open?this._menu.focusItemAtIndex(0):null===(t=this._triggerButton)||void 0===t||t.focus()}},{kind:"method",key:"render",value:function(){return(0,n.dy)(l||(l=h` <div @click="${0}"> <slot name="trigger" @slotchange="${0}"></slot> </div> <mwc-menu .corner="${0}" .menuCorner="${0}" .fixed="${0}" .multi="${0}" .activatable="${0}" .y="${0}" .x="${0}"> <slot></slot> </mwc-menu> `),this._handleClick,this._setTriggerAria,this.corner,this.menuCorner,this.fixed,this.multi,this.activatable,this.y,this.x)}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(a,"firstUpdated",this,3)([e]),"rtl"===s.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(c||(c=h`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),n.oi)},54977:function(e,t,a){var i=a(61701),o=(a(71695),a(47021),a(57243)),n=a(50778);let r,s,d,l=e=>e;(0,i.Z)([(0,n.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"raised",value(){return!1}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(r||(r=l`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`))}},{kind:"method",key:"render",value:function(){return(0,o.dy)(s||(s=l` ${0} <slot></slot> `),this.header?(0,o.dy)(d||(d=l`<h1 class="card-header">${0}</h1>`),this.header):o.Ld)}}]}}),o.oi)},54202:function(e,t,a){a.r(t),a.d(t,{HaIconButtonArrowPrev:()=>l});var i=a(61701),o=(a(71695),a(47021),a(57243)),n=a(50778),r=a(5111);a(23334);let s,d=e=>e;let l=(0,i.Z)([(0,n.Mo)("ha-icon-button-arrow-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value(){return"rtl"===r.E.document.dir?"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z":"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}},{kind:"method",key:"render",value:function(){var e;return(0,o.dy)(s||(s=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon)}}]}}),o.oi)},23334:function(e,t,a){a.r(t),a.d(t,{HaIconButton:()=>u});var i=a(61701),o=(a(71695),a(47021),a(74269),a(57243)),n=a(50778),r=a(20552);a(37583);let s,d,l,c,h=e=>e,u=(0,i.Z)([(0,n.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){var e;null===(e=this._button)||void 0===e||e.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value(){return{mode:"open",delegatesFocus:!0}}},{kind:"method",key:"render",value:function(){return(0,o.dy)(s||(s=h` <mwc-icon-button aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}"> ${0} </mwc-icon-button> `),(0,r.o)(this.label),(0,r.o)(this.hideTitle?void 0:this.label),(0,r.o)(this.ariaHasPopup),this.disabled,this.path?(0,o.dy)(d||(d=h`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.path):(0,o.dy)(l||(l=h`<slot></slot>`)))}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(c||(c=h`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`))}}]}}),o.oi)},7285:function(e,t,a){a.d(t,{M:()=>p});var i=a(61701),o=a(72621),n=(a(71695),a(47021),a(65703)),r=a(46289),s=a(57243),d=a(50778);let l,c,h,u=e=>e,p=(0,i.Z)([(0,d.Mo)("ha-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,o.Z)(a,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,(0,s.iv)(l||(l=u`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,s.iv)(c||(c=u`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,s.iv)(h||(h=u``))]}}]}}),n.K)},43344:function(e,t,a){var i=a(61701),o=a(72621),n=(a(52247),a(71695),a(47021),a(57243)),r=a(50778),s=a(36522),d=a(83716);a(23334);let l,c,h,u=e=>e;(0,i.Z)([(0,r.Mo)("ha-menu-button")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"hassio",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_hasNotifications",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_show",value(){return!1}},{kind:"field",key:"_alwaysVisible",value(){return!1}},{kind:"field",key:"_attachNotifOnConnect",value(){return!1}},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)(a,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(a,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return n.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,n.dy)(l||(l=u` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",this._toggleMenu,e?(0,n.dy)(c||(c=u`<div class="dot"></div>`)):"")}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(a,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,o.Z)(a,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,i=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===(null==t?void 0:t.dockedSidebar),n=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&i===n||(this._show=n||this._alwaysVisible,n?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,d.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,s.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(h||(h=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`))}}]}}),n.oi)},37583:function(e,t,a){a.r(t),a.d(t,{HaSvgIcon:()=>h});var i=a(61701),o=(a(71695),a(47021),a(57243)),n=a(50778);let r,s,d,l,c=e=>e,h=(0,i.Z)([(0,n.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return(0,o.YP)(r||(r=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,o.YP)(s||(s=c`<path class="primary-path" d="${0}"></path>`),this.path):o.Ld,this.secondaryPath?(0,o.YP)(d||(d=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):o.Ld)}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(l||(l=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`))}}]}}),o.oi)},43546:function(e,t,a){a.d(t,{Cp:()=>r,TZ:()=>s,W2:()=>n,YY:()=>l,iI:()=>o,j2:()=>d,oT:()=>i});a(19083),a(9359),a(70104),a(77439),a(19423),a(40251),a(97499),a(61006);const i=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}})),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=async(e,t,a,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:a,password:i}),r=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:a}),s=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:a}),d=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:a}),l=(e,t,a)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:a})},15681:function(e,t,a){a.d(t,{D4:()=>c,D7:()=>m,Ky:()=>l,P3:()=>s,V3:()=>_,WW:()=>b,XO:()=>h,ZJ:()=>v,d4:()=>f,oi:()=>p,pV:()=>r,zO:()=>u});var i=a(62212),o=a(22381),n=a(57816);const r=["bluetooth","dhcp","discovery","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],s=["reauth"],d={"HA-Frontend-Base":`${location.protocol}//${location.host}`},l=(e,t,a)=>{var i;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(i=e.userData)||void 0===i?void 0:i.showAdvanced),entry_id:a},d)},c=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,d),h=(e,t,a)=>e.callApi("POST",`config/config_entries/flow/${t}`,a,d),u=(e,t,a)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:a}),p=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),f=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),m=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.subscribeEvents((0,o.D)((()=>m(e).then((e=>t.setState(e,!0)))),500,!0),"config_entry_discovered"),v=e=>(0,i._)(e,"_configFlowProgress",m,g),_=(e,t)=>v(e.connection).subscribe(t),b=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,n.Lh)(e,t.handler)):(0,n.Lh)(e,t.handler)},6823:function(e,t,a){a.d(t,{ZK:()=>r,iP:()=>n,lf:()=>o,pD:()=>i});const i=e=>e.callWS({type:"diagnostics/list"}),o=(e,t)=>e.callWS({type:"diagnostics/get",domain:t}),n=e=>`/api/diagnostics/config_entry/${e}`,r=(e,t)=>`/api/diagnostics/config_entry/${e}/device/${t}`},83716:function(e,t,a){a.d(t,{r:()=>i});a(71695),a(19423),a(47021);const i=(e,t)=>{const a=new o,i=e.subscribeMessage((e=>t(a.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{i.then((e=>null==e?void 0:e()))}};class o{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications=Object.assign(Object.assign({},this.notifications),e.notifications);return Object.values(this.notifications)}}},22274:function(e,t,a){a.d(t,{EM:()=>r,NO:()=>c,Xt:()=>d,h:()=>o,jK:()=>s,lR:()=>l,r9:()=>n});class i{constructor(){this.routers=void 0,this.routers={}}processEvent(e){return"router_discovered"===e.type?this.routers[e.key]=e.data:"router_removed"===e.type&&delete this.routers[e.key],Object.values(this.routers)}}const o=(e,t)=>{const a=new i;return e.connection.subscribeMessage((e=>t(a.processEvent(e))),{type:"thread/discover_routers"})},n=e=>e.callWS({type:"thread/list_datasets"}),r=(e,t)=>e.callWS({type:"thread/get_dataset_tlv",dataset_id:t}),s=(e,t,a)=>e.callWS({type:"thread/add_dataset_tlv",source:t,tlv:a}),d=(e,t)=>e.callWS({type:"thread/delete_dataset",dataset_id:t}),l=(e,t)=>e.callWS({type:"thread/set_preferred_dataset",dataset_id:t}),c=(e,t,a,i)=>e.callWS({type:"thread/set_preferred_border_agent",dataset_id:t,border_agent_id:a,extended_address:i})},38572:function(e,t,a){a.d(t,{t:()=>v});a(63721),a(71695),a(40251),a(47021);var i=a(57243),o=a(15681),n=a(57816),r=a(7956);let s,d,l,c,h,u,p,f,m,g=e=>e;const v=(e,t)=>(0,r.w)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,a)=>{const[i]=await Promise.all([(0,o.Ky)(e,a,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",a),e.loadBackendTranslation("selector",a),e.loadBackendTranslation("title",a)]);return i},fetchFlow:async(e,t)=>{const a=await(0,o.D4)(e,t);return await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config",a.handler),await e.loadBackendTranslation("selector",a.handler),a},handleFlowStep:o.XO,deleteFlow:o.oi,renderAbortDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return a?(0,i.dy)(s||(s=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):t.reason},renderShowFormStepHeader(e,t){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`)},renderShowFormStepDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?(0,i.dy)(d||(d=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):""},renderShowFormStepFieldLabel(e,t,a,i){var o;if("expandable"===a.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${a.name}.name`);const n=null!=i&&null!==(o=i.path)&&void 0!==o&&o[0]?`sections.${i.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${n}data.${a.name}`)||a.name},renderShowFormStepFieldHelper(e,t,a,o){var n;if("expandable"===a.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${a.name}.description`);const r=null!=o&&null!==(n=o.path)&&void 0!==n&&n[0]?`sections.${o.path[0]}.`:"",s=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${r}data_description.${a.name}`,t.description_placeholders);return s?(0,i.dy)(l||(l=g`<ha-markdown breaks .content="${0}"></ha-markdown>`),s):""},renderShowFormStepFieldError(e,t,a){return e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${a}`,t.description_placeholders)||a},renderShowFormStepFieldLocalizeValue(e,t,a){return e.localize(`component.${t.handler}.selector.${a}`)},renderShowFormStepSubmitButton(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit"))},renderExternalStepHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return(0,i.dy)(c||(c=g` <p> ${0} </p> ${0} `),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),a?(0,i.dy)(h||(h=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):"")},renderCreateEntryDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return(0,i.dy)(u||(u=g` ${0} <p> ${0} </p> `),a?(0,i.dy)(p||(p=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):"",e.localize("ui.panel.config.integrations.config_flow.created_config",{name:t.title}))},renderShowFormProgressHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderShowFormProgressDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return a?(0,i.dy)(f||(f=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):""},renderMenuHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderMenuDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?(0,i.dy)(m||(m=g` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),a):""},renderMenuOption(e,t,a){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${a}`,t.description_placeholders)},renderLoadingDescription(e,t,a,i){if("loading_flow"!==t&&"loading_step"!==t)return"";const o=(null==i?void 0:i.handler)||a;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:o?(0,n.Lh)(e.localize,o):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},7956:function(e,t,a){a.d(t,{w:()=>n});a(71695),a(19423),a(40251),a(47021);var i=a(36522);const o=()=>Promise.all([a.e("46379"),a.e("66031"),a.e("72206"),a.e("97983"),a.e("24199"),a.e("78943"),a.e("2142"),a.e("58640"),a.e("52430"),a.e("4697"),a.e("43429"),a.e("27090"),a.e("8949")]).then(a.bind(a,12656)),n=(e,t,a)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:o,dialogParams:Object.assign(Object.assign({},t),{},{flowConfig:a,dialogParentElement:e})})}},87979:function(e,t,a){var i=a(61701),o=(a(71695),a(47021),a(57243)),n=a(50778),r=a(31146),s=(a(54202),a(43344),a(28008));let d,l,c,h,u,p=e=>e;(0,i.Z)([(0,n.Mo)("hass-subpage")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"main-page"})],key:"mainPage",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"backCallback",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"supervisor",value(){return!1}},{kind:"field",decorators:[(0,r.i)(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,o.dy)(d||(d=p` <div class="toolbar"> ${0} <div class="main-title"><slot name="header">${0}</slot></div> <slot name="toolbar-icon"></slot> </div> <div class="content ha-scrollbar" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),this.mainPage||null!==(e=history.state)&&void 0!==e&&e.root?(0,o.dy)(l||(l=p` <ha-menu-button .hassio="${0}" .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.supervisor,this.hass,this.narrow):this.backPath?(0,o.dy)(c||(c=p` <a href="${0}"> <ha-icon-button-arrow-prev .hass="${0}"></ha-icon-button-arrow-prev> </a> `),this.backPath,this.hass):(0,o.dy)(h||(h=p` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,this._saveScrollPos)}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[s.$c,(0,o.iv)(u||(u=p`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin:var(--margin-title);line-height:20px;min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:1px}.content{position:relative;width:100%;height:calc(100% - 1px - var(--header-height));overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}#fab{position:absolute;right:calc(16px + env(safe-area-inset-right));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}:host([narrow]) #fab.tabs{bottom:calc(84px + env(safe-area-inset-bottom))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}`))]}}]}}),o.oi)},6798:function(e,t,a){a.r(t),a.d(t,{ThreadConfigPanel:()=>W});var i=a(61701),o=a(72621),n=(a(71695),a(92745),a(61893),a(9359),a(1331),a(70104),a(23669),a(40251),a(19134),a(11740),a(97003),a(47021),a(31622),a(57243)),r=a(50778),s=a(27486),d=a(72344),l=a(1416),c=a(58776),h=(a(34273),a(7285),a(54977),a(43546)),u=a(6823);var p=a(22274),f=a(38572),m=a(76131),g=(a(87979),a(6736)),v=a(28008),_=a(88238),b=a(58014),y=a(73192),k=a(36522);let w,x,$,C,z,S,T,M,A,H,B,V,P,D,O,E,L,F,I,N=e=>e;const Z="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",j="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",R="M7 1C5.9 1 5 1.9 5 3V7H7V4H17V20H7V17H5V21C5 22.1 5.9 23 7 23H17C18.1 23 19 22.1 19 21V3C19 1.9 18.1 1 17 1H7M6 9C4.3 9 3 10.3 3 12S4.3 15 6 15C7.3 15 8.4 14.2 8.8 13H11V15H13V13H15V11H8.8C8.4 9.8 7.3 9 6 9M6 11C6.6 11 7 11.4 7 12S6.6 13 6 13 5 12.6 5 12 5.4 11 6 11Z";let W=(0,i.Z)([(0,r.Mo)("thread-config-panel")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_configEntryId",value(){return null}},{kind:"field",decorators:[(0,r.SB)()],key:"_routers",value(){return[]}},{kind:"field",decorators:[(0,r.SB)()],key:"_datasets",value(){return[]}},{kind:"field",decorators:[(0,r.SB)()],key:"_otbrInfo",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=this._groupRoutersByNetwork(this._routers,this._datasets);return(0,n.dy)(w||(w=N` <hass-subpage .narrow="${0}" .hass="${0}" header="Thread"> <ha-button-menu slot="toolbar-icon"> <ha-icon-button .path="${0}" slot="trigger"></ha-icon-button> <a href="${0}" target="_blank" @click="${0}"> <mwc-list-item> ${0} </mwc-list-item> </a> <mwc-list-item @click="${0}">${0}</mwc-list-item> <mwc-list-item @click="${0}">${0}</mwc-list-item> </ha-button-menu> <div class="content"> <h1>${0}</h1> ${0} ${0} </div> ${0} </hass-subpage> `),this.narrow,this.hass,j,(0,u.iP)(this._configEntryId||""),this._signUrl,this.hass.localize("ui.panel.config.integrations.config_entry.download_diagnostics"),this._addTLV,this.hass.localize("ui.panel.config.thread.add_dataset_from_tlv"),this._addOTBR,this.hass.localize("ui.panel.config.thread.add_open_thread_border_router"),this.hass.localize("ui.panel.config.thread.my_network"),t.preferred?this._renderNetwork(t.preferred):(0,n.dy)(x||(x=N`<ha-card> <div class="card-content no-routers"> <h3> ${0} </h3> <ha-svg-icon .path="${0}"></ha-svg-icon> <a href="${0}" target="_blank"> <mwc-button>${0}</mwc-button> </a> </div> </ha-card>`),this.hass.localize("ui.panel.config.thread.no_preferred_network"),Z,(0,y.R)(this.hass,"/integrations/thread"),this.hass.localize("ui.panel.config.thread.more_info")),t.networks.length?(0,n.dy)($||($=N`<h3> ${0} </h3> ${0}`),this.hass.localize("ui.panel.config.thread.other_networks"),t.networks.map((e=>this._renderNetwork(e)))):"",null!==(e=this.hass.auth.external)&&void 0!==e&&e.config.canImportThreadCredentials?(0,n.dy)(C||(C=N`<ha-fab slot="fab" @click="${0}" extended label="Send credentials to ioBroker"><ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon></ha-fab>`),this._importExternalThreadCredentials,R):n.Ld)}},{kind:"method",key:"_renderNetwork",value:function(e){var t,a,i,o,r;const s=this._otbrInfo&&e.dataset&&(e.dataset.preferred_extended_address&&this._otbrInfo[e.dataset.preferred_extended_address]||Object.values(this._otbrInfo).find((t=>t.extended_pan_id===e.dataset.extended_pan_id))),d=null===(t=this.hass.auth.external)||void 0===t?void 0:t.config.canTransferThreadCredentialsToKeychain;return(0,n.dy)(z||(z=N`<ha-card> <div class="card-header"> ${0}${0} </div> ${0} ${0} ${0} </ha-card>`),e.name,e.dataset?(0,n.dy)(S||(S=N`<div> <ha-icon-button .label="${0}" .otbr="${0}" .network="${0}" .path="${0}" @click="${0}"></ha-icon-button>${0} </div>`),this.hass.localize("ui.panel.config.thread.thread_network_info"),s,e,"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",this._showDatasetInfo,e.dataset.preferred||null!==(a=e.routers)&&void 0!==a&&a.length?"":(0,n.dy)(T||(T=N`<ha-icon-button .label="${0}" .networkDataset="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),this.hass.localize("ui.panel.config.thread.thread_network_delete_credentials"),e.dataset,"M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",this._removeDataset)):"",null!==(i=e.routers)&&void 0!==i&&i.length?(0,n.dy)(M||(M=N`<div class="card-content routers"> <h4> ${0} </h4> </div> ${0}`),this.hass.localize("ui.panel.config.thread.border_routers",{count:e.routers.length}),e.routers.map((t=>{var a,i,o;const r=this._otbrInfo&&this._otbrInfo[t.extended_address],s=!!e.dataset,d=s&&t.extended_address===e.dataset.preferred_extended_address,l=s||r;return(0,n.dy)(A||(A=N`<ha-list-item class="router" twoline graphic="avatar" .hasMeta="${0}"> <img slot="graphic" .src="${0}" alt="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" @error="${0}" @load="${0}"> ${0} <span slot="secondary">${0}</span> ${0} </ha-list-item>`),l,(0,_.X1)({domain:t.brand,brand:!0,type:"icon",darkOptimized:null===(a=this.hass.themes)||void 0===a?void 0:a.darkMode}),t.brand,this._onImageError,this._onImageLoad,t.instance_name||t.model_name||(null===(i=t.server)||void 0===i?void 0:i.replace(".local.",""))||"",t.server,l?(0,n.dy)(H||(H=N`${0} <ha-button-menu slot="meta" .network="${0}" .router="${0}" .otbr="${0}" @action="${0}"> <ha-icon-button .label="${0}" .path="${0}" slot="trigger"></ha-icon-button> ${0} ${0} </ha-button-menu>`),d?(0,n.dy)(B||(B=N`<ha-svg-icon .path="${0}" .title="${0}"></ha-svg-icon>`),R,this.hass.localize("ui.panel.config.thread.default_router")):"",e,t,r,this._handleRouterAction,this.hass.localize("ui.common.overflow_menu"),j,s?(0,n.dy)(V||(V=N`<ha-list-item .disabled="${0}"> ${0} </ha-list-item>`),d,d?this.hass.localize("ui.panel.config.thread.default_router"):this.hass.localize("ui.panel.config.thread.set_default_router")):"",r?(0,n.dy)(P||(P=N`<ha-list-item> ${0}</ha-list-item> <ha-list-item> ${0}</ha-list-item> ${0}`),this.hass.localize("ui.panel.config.thread.reset_border_router"),this.hass.localize("ui.panel.config.thread.change_channel"),null!==(o=e.dataset)&&void 0!==o&&o.preferred?"":(0,n.dy)(D||(D=N`<ha-list-item> ${0} </ha-list-item>`),this.hass.localize("ui.panel.config.thread.add_to_my_network"))):""):"")}))):(0,n.dy)(O||(O=N`<div class="card-content no-routers"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </div> `),Z,s?(0,n.dy)(E||(E=N`${0} <mwc-button .otbr="${0}" @click="${0}">${0}</mwc-button>`),this.hass.localize("ui.panel.config.thread.no_routers_otbr_network"),s,this._resetBorderRouterEvent,this.hass.localize("ui.panel.config.thread.reset_border_router")):this.hass.localize("ui.panel.config.thread.no_border_routers")),e.dataset&&!e.dataset.preferred?(0,n.dy)(L||(L=N`<div class="card-actions"> <mwc-button .datasetId="${0}" @click="${0}">Make preferred network</mwc-button> </div>`),e.dataset.dataset_id,this._setPreferred):"",d&&null!==(o=e.dataset)&&void 0!==o&&o.preferred&&null!==(r=e.routers)&&void 0!==r&&r.length?(0,n.dy)(F||(F=N`<div class="card-actions"> <mwc-button .networkDataset="${0}" @click="${0}">Send credentials to phone</mwc-button> </div>`),e.dataset,this._sendCredentials):"")}},{kind:"method",key:"_sendCredentials",value:async function(e){const t=e.currentTarget.networkDataset;t&&(t.preferred_extended_address||t.preferred_border_agent_id?this.hass.auth.external.fireMessage({type:"thread/store_in_platform_keychain",payload:{mac_extended_address:t.preferred_extended_address,border_agent_id:t.preferred_border_agent_id,active_operational_dataset:(await(0,p.EM)(this.hass,t.dataset_id)).tlv,extended_pan_id:t.extended_pan_id}}):(0,m.showAlertDialog)(this,{title:"Error",text:this.hass.localize("ui.panel.config.thread.no_preferred_router")}))}},{kind:"method",key:"_showDatasetInfo",value:async function(e){const t=e.currentTarget.network,i=e.currentTarget.otbr;var o,n;o=this,n={network:t,otbrInfo:i},(0,k.B)(o,"show-dialog",{dialogTag:"ha-dialog-thread-dataset",dialogImport:()=>Promise.all([a.e("97983"),a.e("14950")]).then(a.bind(a,34061)),dialogParams:n})}},{kind:"method",key:"_importExternalThreadCredentials",value:function(){this.hass.auth.external.fireMessage({type:"thread/import_credentials"})}},{kind:"method",key:"_onImageError",value:function(e){e.target.style.display="none"}},{kind:"method",key:"_onImageLoad",value:function(e){e.target.style.display=""}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,p.h)(this.hass,(e=>{this._routers=e}))]}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this._refresh(),this._configEntryId=(0,c.io)("config_entry")}},{kind:"field",key:"_groupRoutersByNetwork",value(){return(0,s.Z)(((e,t)=>{let a;const i={};for(const n of e){const e=n.extended_pan_id;e in i?i[e].routers.push(n):i[e]={name:n.network_name||"",routers:[n]}}for(const n of t){const e=n.extended_pan_id;var o;if(e)if(n.preferred)a={name:n.network_name,dataset:n,routers:null===(o=i[e])||void 0===o?void 0:o.routers},delete i[e];else e in i?i[e].dataset=n:i[e]={name:n.network_name,dataset:n}}return{preferred:a,networks:Object.values(i).sort(((e,t)=>(0,l.$K)(e.name,t.name,this.hass.locale.language)))}}))}},{kind:"method",key:"_refresh",value:async function(){var e;if((0,p.r9)(this.hass).then((e=>{this._datasets=e.datasets})),(0,d.p)(this.hass,"otbr"))try{this._otbrInfo=await(e=this.hass,e.callWS({type:"otbr/info"}))}catch(t){this._otbrInfo=void 0}}},{kind:"method",key:"_signUrl",value:async function(e){const t=e.target.closest("a");e.preventDefault();const a=await(0,h.iI)(this.hass,t.getAttribute("href"));(0,b.N)(a.path)}},{kind:"method",key:"_addOTBR",value:function(){var e;(0,f.t)(this,{dialogClosedCallback:()=>{this._refresh()},startFlowHandler:"otbr",showAdvanced:null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced})}},{kind:"method",key:"_handleRouterAction",value:function(e){const t=e.currentTarget.network,a=e.currentTarget.router,i=e.currentTarget.otbr;switch(t.dataset?Number(e.detail.index):Number(e.detail.index)+1){case 0:this._setPreferredBorderAgent(t.dataset,a);break;case 1:this._resetBorderRouter(i);break;case 2:this._changeChannel(i);break;case 3:this._setDataset(i)}}},{kind:"method",key:"_resetBorderRouterEvent",value:function(e){const t=e.currentTarget.otbr;this._resetBorderRouter(t)}},{kind:"method",key:"_resetBorderRouter",value:async function(e){if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router_text")})){try{await(t=this.hass,a=e.extended_address,t.callWS({type:"otbr/create_network",extended_address:a}))}catch(i){(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:i.message})}var t,a;this._refresh()}}},{kind:"method",key:"_setDataset",value:async function(e){var t;const a=null===(t=this._groupRoutersByNetwork(this._routers,this._datasets).preferred)||void 0===t||null===(t=t.dataset)||void 0===t?void 0:t.dataset_id;if(!a)return;if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router_text")})){try{await(i=this.hass,o=e.extended_address,n=a,i.callWS({type:"otbr/set_network",extended_address:o,dataset_id:n}))}catch(r){(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:r.message})}var i,o,n;this._refresh()}}},{kind:"method",key:"_setPreferred",value:async function(e){const t=e.target.datasetId;await(0,p.lR)(this.hass,t),this._refresh()}},{kind:"method",key:"_setPreferredBorderAgent",value:async function(e,t){await(0,p.NO)(this.hass,e.dataset_id,t.border_agent_id,t.extended_address),this._refresh()}},{kind:"method",key:"_addTLV",value:async function(){const e=await(0,m.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.thread.add_dataset"),inputLabel:this.hass.localize("ui.panel.config.thread.add_dataset_label"),confirmText:this.hass.localize("ui.panel.config.thread.add_dataset_button")});if(e){try{await(0,p.jK)(this.hass,"manual",e)}catch(t){(0,m.showAlertDialog)(this,{title:"Error",text:t.message||t})}this._refresh()}}},{kind:"method",key:"_removeDataset",value:async function(e){const t=e.currentTarget.networkDataset;if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset",{name:t.network_name}),text:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset_text"),destructive:!0,confirmText:this.hass.localize("ui.common.delete")})){try{await(0,p.Xt)(this.hass,t.dataset_id)}catch(a){(0,m.showAlertDialog)(this,{title:"Error",text:a.message||a})}this._refresh()}}},{kind:"method",key:"_changeChannel",value:async function(e){const t=e.channel,a=await(0,m.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel"),text:this.hass.localize("ui.panel.config.thread.change_channel_text"),inputLabel:this.hass.localize("ui.panel.config.thread.change_channel_label"),confirmText:this.hass.localize("ui.panel.config.thread.change_channel"),inputType:"number",inputMin:"11",inputMax:"26",defaultValue:t?t.toString():void 0});if(!a)return;const i=parseInt(a);if(i<11||i>26)(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_invalid"),text:this.hass.localize("ui.panel.config.thread.change_channel_range")});else{try{const t=await((e,t,a)=>e.callWS({type:"otbr/set_channel",extended_address:t,channel:a}))(this.hass,e.extended_address,i);(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_initiated_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_initiated_text",{delay:Math.floor(t.delay/60)})})}catch(o){if("multiprotocol_enabled"===o.code)return void(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_text")});(0,m.showAlertDialog)(this,{title:"Error",text:o.message||o})}this._refresh()}}},{kind:"field",static:!0,key:"styles",value(){return[v.Qx,(0,n.iv)(I||(I=N`.content{padding:24px 8px 32px;max-width:600px;margin:0 auto;direction:ltr}ha-list-item.router{--mdc-list-item-meta-size:auto;--mdc-list-item-meta-display:flex;--mdc-list-side-padding:16px;cursor:default;overflow:visible}ha-list-item img{border-radius:0}ha-svg-icon[slot=meta]{width:24px}ha-button-menu a{text-decoration:none}.routers{padding-bottom:0}.no-routers{display:flex;flex-direction:column;align-items:center;text-align:center}.no-routers ha-svg-icon{background-color:var(--light-primary-color);color:var(--secondary-text-color);padding:16px;border-radius:50%;margin-bottom:8px}ha-card{margin-bottom:16px}h4{margin:0}.card-header{display:flex;justify-content:space-between}`))]}}]}}),(0,g.f)(n.oi))},28008:function(e,t,a){a.d(t,{$c:()=>p,Qx:()=>h,k1:()=>c,yu:()=>u});var i=a(57243);let o,n,r,s,d,l=e=>e;const c=(0,i.iv)(o||(o=l`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),h=(0,i.iv)(n||(n=l`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overflow:var(--paper-font-title_-_overflow);text-overflow:var(--paper-font-title_-_text-overflow);font-size:var(--paper-font-title_-_font-size);font-weight:var(--paper-font-title_-_font-weight);line-height:var(--paper-font-title_-_line-height)}h3{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);white-space:var(--paper-font-subhead_-_white-space);overflow:var(--paper-font-subhead_-_overflow);text-overflow:var(--paper-font-subhead_-_text-overflow);font-size:var(--paper-font-subhead_-_font-size);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}${0} .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}`),c),u=(0,i.iv)(r||(r=l`ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between}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-dialog{--mdc-dialog-min-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-max-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:0}}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}.error{color:var(--error-color)}`)),p=(0,i.iv)(s||(s=l`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{-webkit-border-radius:4px;border-radius:4px;background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,i.iv)(d||(d=l`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},88238:function(e,t,a){a.d(t,{RU:()=>o,X1:()=>i,u4:()=>n,zC:()=>r});a(88044);const i=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,o=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,n=e=>e.split("/")[4],r=e=>e.startsWith("https://brands.home-assistant.io/")},73192:function(e,t,a){a.d(t,{R:()=>i});const i=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},58014:function(e,t,a){a.d(t,{N:()=>o,G:()=>n});var i=a(18117);const o=(e,t="")=>{const a=document.createElement("a");a.target="_blank",a.href=e,a.download=t,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)},n=e=>{var t;return!(e=>!!e.auth.external&&i.G)(e)||!(null===(t=e.auth.external)||void 0===t||!t.config.downloadFileSupported)}},18117:function(e,t,a){a.d(t,{G:()=>i});a(19134),a(5740);const i=/^((?!chrome|android).)*safar