UNPKG

iobroker.lovelace

Version:

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

16 lines 29.7 kB
export const __rspack_esm_id=32340;export const __rspack_esm_ids=[32340];export const __webpack_modules__={93421(t,e,o){o.d(e,{IW:()=>d,dH:()=>c,fI:()=>l});o(44114);var a=o(35211),i=o(22792),n=o(32172);const r=(t,e)=>{let o=t;for(const t of e){if(null==o)return;o=o[t]}return o},s=(t,e,o)=>{const i=(0,n.p)({transformer:function(t){return o.call(this,t)},watch:e?[e]:[]}),r=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{i(t,e),r(t,e)}},l=t=>s(i.iN,t.entityIdPath[0],function(e){const o=r(this,t.entityIdPath);return"string"==typeof o?e?.[o]:void 0}),c=t=>s(i.X1,t.entityIdPath[0],function(e){const o=r(this,t.entityIdPath);return"string"==typeof o?e?.[o]:void 0}),d=()=>s(i.D5,void 0,({localize:t})=>t)},32172(t,e,o){o.d(e,{p:()=>a});o(18111),o(7588),o(45367),o(92731),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);function a(t){return(e,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const a=String(o),i=e;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const t=i._transformers;i._transformers=new Map,t.forEach((t,e)=>i._transformers.set(e,t))}}else{i._transformers=new Map,i._watching=new Map;const t=i.willUpdate;i.willUpdate=function(e){t.call(this,e);const o=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>o.add(t))}),o.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}i._transformers.set(o,t.transformer),t.watch&&t.watch.forEach(t=>{let e=i._watching.get(t);e||(e=new Set,i._watching.set(t,e)),e.add(o)});const n=Object.getOwnPropertyDescriptor(e,o);let r;if(void 0===n)r={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=n.set;r={...n,set(e){const o=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,o),t?.call(this,e)}}}Object.defineProperty(e,o,r)}}},38962(t,e,o){o.a(t,async function(t,a){try{o.r(e);var i=o(62826),n=o(5124),r=o(22441),s=o(6412),l=o(93421),c=o(1087),d=o(26300),h=(o(67094),t([d]));d=(h.then?(await h)():h)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u={info:"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",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class m extends n.WF{render(){return n.qy` <div class="issue-type ${(0,s.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,s.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?n.qy`<div class="title">${this.title}</div>`:n.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?n.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:n.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}m.styles=n.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,i.Cg)([(0,r.MZ)()],m.prototype,"title",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"alert-type"})],m.prototype,"alertType",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"dismissable",void 0),(0,i.Cg)([(0,r.wk)(),(0,l.IW)()],m.prototype,"_localize",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"narrow",void 0),m=(0,i.Cg)([(0,r.EM)("ha-alert")],m),a()}catch(t){a(t)}})},76776(t,e,o){var a=o(62826),i=o(5124),n=o(22441);class r extends i.WF{render(){return i.qy` ${this.header?i.qy`<h1 class="card-header">${this.header}</h1>`:i.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}r.styles=i.AH`: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,var(--ha-border-radius-lg));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, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)} :host ::slotted( .card-content:not(:nth-child(1 of .card-content, .card-header)) ), slot:not(:first-child)::slotted(.card-content) { padding-top: 0; margin-top: calc(var(--ha-space-2) * -1); } :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,a.Cg)([(0,n.MZ)()],r.prototype,"header",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],r.prototype,"raised",void 0),r=(0,a.Cg)([(0,n.EM)("ha-card")],r)},43661(t,e,o){o.r(e),o.d(e,{HaIconNext:()=>s});var a=o(62826),i=o(22441),n=o(63091),r=o(67094);class s extends r.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===n.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,a.Cg)([(0,i.MZ)()],s.prototype,"path",void 0),s=(0,a.Cg)([(0,i.EM)("ha-icon-next")],s)},2846(t,e,o){o.d(e,{G:()=>c,J:()=>l});var a=o(62826),i=o(58168),n=o(82553),r=o(5124),s=o(22441);o(54276);const l=[n.R,r.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 c extends i.n{renderRipple(){return"text"===this.type?r.s6:r.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}c.styles=l,c=(0,a.Cg)([(0,s.EM)("ha-md-list-item")],c)},17308(t,e,o){var a=o(62826),i=o(49838),n=o(11245),r=o(5124),s=o(22441);class l extends i.B{}l.styles=[n.R,r.AH`:host{--md-sys-color-surface:var(--card-background-color)}`],l=(0,a.Cg)([(0,s.EM)("ha-md-list")],l)},54276(t,e,o){var a=o(62826),i=o(76482),n=o(91382),r=o(96245),s=o(5124),l=o(22441);class c extends n.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()}}}c.styles=[r.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)) )}`],c=(0,a.Cg)([(0,l.EM)("ha-ripple")],c)},7749(t,e,o){o.d(e,{HH:()=>a,TY:()=>i,lu:()=>n,mu:()=>r});const a=(t,e)=>t.callApi("POST","config/config_entries/options/flow",{handler:e}),i=(t,e)=>t.callApi("GET",`config/config_entries/options/flow/${e}`),n=(t,e,o)=>t.callApi("POST",`config/config_entries/options/flow/${e}`,o),r=(t,e)=>t.callApi("DELETE",`config/config_entries/options/flow/${e}`)},29094(t,e,o){o.d(e,{g:()=>n});var a=o(1087);const i=()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(7305),o.e(92769),o.e(3283),o.e(80131),o.e(58416),o.e(54066),o.e(84038),o.e(69205),o.e(26092),o.e(48531),o.e(92411),o.e(44642)]).then(o.bind(o,78314)),n=(t,e,o)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:i,dialogParams:{...e,flowConfig:o,dialogParentElement:t}})}},70241(t,e,o){o.d(e,{Q:()=>s});var a=o(5124),i=o(95350),n=o(7749),r=o(29094);const s=(t,e,o)=>(0,r.g)(t,{startFlowHandler:e.entry_id,domain:e.domain,...o},{flowType:"options_flow",showDevices:!1,createFlow:async(t,o)=>{const[a]=await Promise.all([(0,n.HH)(t,o),t.loadFragmentTranslation("config"),t.loadBackendTranslation("options",e.domain),t.loadBackendTranslation("selector",e.domain)]);return a},fetchFlow:async(t,o)=>{const[a]=await Promise.all([(0,n.TY)(t,o),t.loadFragmentTranslation("config"),t.loadBackendTranslation("options",e.domain),t.loadBackendTranslation("selector",e.domain)]);return a},handleFlowStep:n.lu,deleteFlow:n.mu,renderAbortDescription(t,o){const i=t.localize(`component.${o.translation_domain||e.domain}.options.abort.${o.reason}`,o.description_placeholders);return i?a.qy` <ha-markdown breaks allow-svg .content="${i}"></ha-markdown> `:o.reason},renderShowFormStepHeader:(t,o)=>t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.title`,o.description_placeholders)||t.localize("ui.dialogs.options_flow.form.header"),renderShowFormStepDescription(t,o){const i=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.description`,o.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderShowFormStepFieldLabel(t,o,a,i){if("expandable"===a.type)return t.localize(`component.${e.domain}.options.step.${o.step_id}.sections.${a.name}.name`,o.description_placeholders)||a.name;const n=i?.path?.[0]?`sections.${i.path[0]}.`:"";return t.localize(`component.${e.domain}.options.step.${o.step_id}.${n}data.${a.name}`,o.description_placeholders)||a.name},renderShowFormStepFieldHelper(t,o,i,n){if("expandable"===i.type)return t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.sections.${i.name}.description`,o.description_placeholders);const r=n?.path?.[0]?`sections.${n.path[0]}.`:"",s=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.${r}data_description.${i.name}`,o.description_placeholders);return s?a.qy`<ha-markdown breaks .content="${s}"></ha-markdown>`:""},renderShowFormStepFieldError:(t,o,a)=>t.localize(`component.${o.translation_domain||e.domain}.options.error.${a}`,o.description_placeholders)||a,renderShowFormStepFieldLocalizeValue:(t,o,a)=>t.localize(`component.${e.domain}.selector.${a}`),renderShowFormStepSubmitButton:(t,o)=>t.localize(`component.${e.domain}.options.step.${o.step_id}.submit`)||t.localize("ui.panel.config.integrations.config_flow."+(!1===o.last_step?"next":"submit")),renderExternalStepHeader:(t,e)=>"",renderExternalStepDescription:(t,e)=>"",renderCreateEntryDescription:(t,e)=>a.qy` <p>${t.localize("ui.dialogs.options_flow.success.description")}</p> `,renderShowFormProgressHeader:(t,o)=>t.localize(`component.${e.domain}.options.step.${o.step_id}.title`)||t.localize(`component.${e.domain}.title`),renderShowFormProgressDescription(t,o){const i=t.localize(`component.${o.translation_domain||e.domain}.options.progress.${o.progress_action}`,o.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuHeader:(t,o)=>t.localize(`component.${e.domain}.options.step.${o.step_id}.title`)||t.localize(`component.${e.domain}.title`),renderMenuDescription(t,o){const i=t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.description`,o.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuOption:(t,o,a)=>t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.menu_options.${a}`,o.description_placeholders),renderMenuOptionDescription:(t,o,a)=>t.localize(`component.${o.translation_domain||e.domain}.options.step.${o.step_id}.menu_option_descriptions.${a}`,o.description_placeholders),renderLoadingDescription:(t,o)=>t.localize(`component.${e.domain}.options.loading`)||("loading_flow"===o||"loading_step"===o?t.localize(`ui.dialogs.options_flow.loading.${o}`,{integration:(0,i.p$)(t.localize,e.domain)}):"")})},81310(t,e,o){o.a(t,async function(t,e){try{var a=o(62826),i=o(5124),n=o(22441),r=o(6412),s=o(26218),l=o(91926),c=o(90248),d=o(2054),h=o(14503),p=t([c,d]);[c,d]=p.then?(await p)():p;class u extends i.WF{render(){return i.qy` <div class="toolbar ${(0,r.H)({narrow:this.narrow})}"> <div class="toolbar-content"> ${this.mainPage||history.state?.root?i.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?i.qy` <ha-icon-button-arrow-prev href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:i.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"> <slot name="header">${this.header}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${(0,r.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable})}" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[h.dp,i.AH`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);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}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)()],u.prototype,"header",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],u.prototype,"mainPage",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],u.prototype,"backPath",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"backCallback",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],u.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],u.prototype,"scrollable",void 0),(0,a.Cg)([(0,s.a)(".content")],u.prototype,"_savedScrollPos",void 0),(0,a.Cg)([(0,n.Ls)({passive:!0})],u.prototype,"_saveScrollPos",null),u=(0,a.Cg)([(0,n.EM)("hass-subpage")],u),e()}catch(t){e(t)}})},21356(t,e,o){o.a(t,async function(t,a){try{o.r(e),o.d(e,{BluetoothAdapterInfoPage:()=>w});o(44114),o(18111),o(22489),o(20116),o(61701),o(45367),o(92731),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(62826),n=o(5124),r=o(22441),s=o(22786),l=o(37981),c=o(38962),d=o(18350),h=(o(76776),o(26300)),p=(o(43661),o(17308),o(2846),o(67094),o(21030)),u=o(77423),m=o(70241),g=o(65063),b=o(81310),v=o(14503),_=t([c,d,h,b]);[c,d,h,b]=_.then?(await _)():_;const f="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M10,22C9.75,22 9.54,21.82 9.5,21.58L9.13,18.93C8.5,18.68 7.96,18.34 7.44,17.94L4.95,18.95C4.73,19.03 4.46,18.95 4.34,18.73L2.34,15.27C2.21,15.05 2.27,14.78 2.46,14.63L4.57,12.97L4.5,12L4.57,11L2.46,9.37C2.27,9.22 2.21,8.95 2.34,8.73L4.34,5.27C4.46,5.05 4.73,4.96 4.95,5.05L7.44,6.05C7.96,5.66 8.5,5.32 9.13,5.07L9.5,2.42C9.54,2.18 9.75,2 10,2H14C14.25,2 14.46,2.18 14.5,2.42L14.87,5.07C15.5,5.32 16.04,5.66 16.56,6.05L19.05,5.05C19.27,4.96 19.54,5.05 19.66,5.27L21.66,8.73C21.79,8.95 21.73,9.22 21.54,9.37L19.43,11L19.5,12L19.43,13L21.54,14.63C21.73,14.78 21.79,15.05 21.66,15.27L19.66,18.73C19.54,18.95 19.27,19.04 19.05,18.95L16.56,17.95C16.04,18.34 15.5,18.68 14.87,18.93L14.5,21.58C14.46,21.82 14.25,22 14,22H10M11.25,4L10.88,6.61C9.68,6.86 8.62,7.5 7.85,8.39L5.44,7.35L4.69,8.65L6.8,10.2C6.4,11.37 6.4,12.64 6.8,13.8L4.68,15.36L5.43,16.66L7.86,15.62C8.63,16.5 9.68,17.14 10.87,17.38L11.24,20H12.76L13.13,17.39C14.32,17.14 15.37,16.5 16.14,15.62L18.57,16.66L19.32,15.36L17.2,13.81C17.6,12.64 17.6,11.37 17.2,10.2L19.31,8.65L18.56,7.35L16.15,8.39C15.38,7.5 14.32,6.86 13.12,6.62L12.75,4H11.25Z",y="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";class w extends n.WF{connectedCallback(){super.connectedCallback(),this.hass&&(this._loadConfigEntries(),this._subscribeBluetoothConnectionAllocations(),this._subscribeBluetoothScannerState(),this._subscribeScannerDetails())}async _loadConfigEntries(){this._configEntries=await(0,u.VN)(this.hass,{domain:"bluetooth"})}async _subscribeBluetoothConnectionAllocations(){this._unsubConnectionAllocations||(this._unsubConnectionAllocations=await(0,p.gO)(this.hass.connection,t=>{this._connectionAllocationData=t}))}async _subscribeBluetoothScannerState(){this._unsubScannerState||(this._unsubScannerState=await(0,p.wj)(this.hass.connection,t=>{this._scannerStates={...this._scannerStates,[t.source]:t}}))}_subscribeScannerDetails(){this._unsubScannerDetails||(this._unsubScannerDetails=(0,p.mj)(this.hass.connection,t=>{this._scannerDetails=t}))}disconnectedCallback(){super.disconnectedCallback(),this._unsubConnectionAllocations&&(this._unsubConnectionAllocations(),this._unsubConnectionAllocations=void 0),this._unsubScannerState&&(this._unsubScannerState(),this._unsubScannerState=void 0),this._unsubScannerDetails&&(this._unsubScannerDetails(),this._unsubScannerDetails=void 0)}render(){const{enabledDevices:t,disabledDevices:e,disabledEntriesWithoutDevice:o}=this._getBluetoothDevices(this.hass.devices,this._configEntries);return n.qy` <hass-subpage .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.bluetooth.adapter_info_title")}" back-path="/config/bluetooth/dashboard"> <div class="container"> <ha-card> <ha-md-list> ${this._renderAdaptersList(t)} ${e.map(({device:t,entry:e})=>{const o=[t.area_id&&this.hass.areas[t.area_id]?this.hass.areas[t.area_id].name:void 0,this.hass.localize("ui.panel.config.bluetooth.disabled_by_user")].filter(Boolean).join(" · ");return n.qy` <ha-md-list-item class="disabled"> <ha-svg-icon slot="start" .path="${y}"></ha-svg-icon> <div slot="headline"> ${(0,l.xn)(t)||e.title} </div> <div slot="supporting-text">${o}</div> <ha-button slot="end" .entry="${e}" @click="${this._handleEnable}"> ${this.hass.localize("ui.common.enable")} </ha-button> </ha-md-list-item> `})} ${o.map(t=>n.qy` <ha-md-list-item class="disabled"> <ha-svg-icon slot="start" .path="${y}"></ha-svg-icon> <div slot="headline">${t.title}</div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.bluetooth.disabled_by_user")} </div> <ha-button slot="end" .entry="${t}" @click="${this._handleEnable}"> ${this.hass.localize("ui.common.enable")} </ha-button> </ha-md-list-item> `)} </ha-md-list> <div class="card-actions"> <ha-button appearance="plain" href="/config/integrations/integration/bluetooth"> ${this.hass.localize("ui.panel.config.bluetooth.manage_integration")} </ha-button> </div> </ha-card> </div> </hass-subpage> `}_renderAdaptersList(t){return 0===t.length?n.qy`<ha-md-list-item> <div slot="headline"> ${this.hass.localize("ui.panel.config.bluetooth.no_scanner_state_available")} </div> </ha-md-list-item>`:t.map(({device:t,entry:e})=>{const o=t.connections.find(t=>"bluetooth"===t[0]),a=o?.[1],i=a&&this._scannerDetails?Object.values(this._scannerDetails).find(t=>t.source===a):void 0,r=i?this._scannerStates[i.source]:void 0,s=i?.scanner_type??"unknown",c="remote"===s,d=r&&(0,p.SB)(r),h=i?this._connectionAllocationData.find(t=>t.source===i.source):void 0,u=(0,l.xn)(t)||e.title,m=t.area_id?this.hass.areas[t.area_id]?.name:void 0,g=this._formatScannerModeText(r),b=h&&h.slots>0,v=[m,g,h?b?`${h.slots-h.free}/${h.slots} ${this.hass.localize("ui.panel.config.bluetooth.active_connections")}`:this.hass.localize("ui.panel.config.bluetooth.no_connection_slots"):this.hass.localize("ui.panel.config.bluetooth.no_connection_slot_allocations")].filter(Boolean);return n.qy` <ha-md-list-item type="link" href="${`/config/bluetooth/connection-monitor?source=${a}`}"> <ha-svg-icon slot="start" .path="${y}"></ha-svg-icon> <div slot="headline">${u}</div> <div slot="supporting-text">${v.join(" · ")}</div> ${c?n.s6:n.qy`<ha-icon-button slot="end" .path="${f}" .entry="${e}" @click="${this._openOptionFlow}" .label="${this.hass.localize("ui.panel.config.bluetooth.option_flow")}"></ha-icon-button>`} <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> ${d&&i?this._renderScannerMismatchWarning(u,r,s):n.s6} `})}_renderScannerMismatchWarning(t,e,o){const a=[];return"remote"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_remote")),"usb"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_usb")),"uart"!==o&&"unknown"!==o||a.push(this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch_uart")),n.qy`<ha-alert alert-type="warning"> <div> ${this.hass.localize("ui.panel.config.bluetooth.scanner_mode_mismatch",{name:t,requested:this._formatMode(e.requested_mode),current:this._formatMode(e.current_mode)})} </div> <ul> ${a.map(t=>n.qy`<li>${t}</li>`)} </ul> </ha-alert>`}_formatMode(t){switch(t){case null:return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_none");case"active":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_active");case"passive":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_passive");default:return t}}_formatModeLabel(t){switch(t){case null:return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_none_label");case"active":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_active_label");case"passive":return this.hass.localize("ui.panel.config.bluetooth.scanning_mode_passive_label");default:return t}}_formatScannerModeText(t){return t?"auto"===t.requested_mode?this.hass.localize("ui.panel.config.bluetooth.scanning_mode_auto_with_current",{current:this._formatMode(t.current_mode)}):this._formatModeLabel(t.current_mode):this.hass.localize("ui.panel.config.bluetooth.scanner_state_unknown")}async _handleEnable(t){const e=t.currentTarget.entry.entry_id;try{(await(0,u.k3)(this.hass,e)).require_restart&&(0,g.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_entry.enable_restart_confirm")}),this._loadConfigEntries()}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_entry.disable_error"),text:t.message})}}_openOptionFlow(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget;(0,m.Q)(this,e.entry)}static get styles(){return[v.RF,n.AH`.container{padding:var(--ha-space-2) var(--ha-space-4) var(--ha-space-4)}ha-card{max-width:600px;margin:0 auto var(--ha-space-4)}ha-md-list{background:0 0;padding:0}ha-md-list-item{--md-item-overflow:visible}ha-md-list-item ha-svg-icon[slot=start]{color:var(--secondary-text-color)}ha-md-list-item.disabled [slot=headline],ha-md-list-item.disabled [slot=supporting-text],ha-md-list-item.disabled ha-svg-icon[slot=start]{opacity:.5}.card-actions{display:flex;justify-content:flex-end;border-top:1px solid var(--divider-color);padding:var(--ha-space-2) var(--ha-space-4)}`]}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this._configEntries=[],this._connectionAllocationData=[],this._scannerStates={},this._getBluetoothDevices=(0,s.A)((t,e)=>{const o=new Map(e.map(t=>[t.entry_id,t])),a=[],i=[],n=new Set;for(const e of Object.values(t)){if(!e.connections.find(t=>"bluetooth"===t[0]))continue;const t=e.config_entries.map(t=>o.get(t)).find(t=>void 0!==t);t&&(n.add(t.entry_id),null!==t.disabled_by?i.push({device:e,entry:t}):a.push({device:e,entry:t}))}return{enabledDevices:a,disabledDevices:i,disabledEntriesWithoutDevice:e.filter(t=>null!==t.disabled_by&&!n.has(t.entry_id))}})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"route",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],w.prototype,"isWide",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_configEntries",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_connectionAllocationData",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_scannerStates",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_scannerDetails",void 0),w=(0,i.Cg)([(0,r.EM)("bluetooth-adapter-info-page")],w),a()}catch(t){a(t)}})}};