UNPKG

iobroker.lovelace

Version:

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

4 lines 22.3 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[1139],{70947:function(a,t,e){e(62953);var o=e(40445),s=e(50759),i=(e(38625),e(5124)),r=e(67576);e(67094);let n,l,c=a=>a;class p extends s.A{renderCheckboxIcon(){return(0,i.qy)(n||(n=c` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[s.A.styles,(0,i.AH)(l||(l=c`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...a){super(...a),this.selected=!1}}(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],p.prototype,"selected",void 0),p=(0,o.Cg)([(0,r.EM)("ha-dropdown-item")],p)},29823:function(a,t,e){e.a(a,async function(a,t){try{e(3362),e(62953);var o=e(40445),s=e(52254),i=e(5124),r=e(67576),n=a([s]);s=(n.then?(await n)():n)[0];let l,c=a=>a;class p extends s.A{get anchorElement(){var a;return null===(a=this.popup)||void 0===a?void 0:a.anchor}set anchorElement(a){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=a)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const a=this.getTrigger();a&&"ha-icon-button"===a.localName&&(a.selected=!0)}async hideMenu(){const a=this.getTrigger();a&&"ha-icon-button"===a.localName&&(a.selected=!1),await super.hideMenu()}static get styles(){return[s.A.styles,(0,i.AH)(l||(l=c`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var( --card-background-color, var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)), )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...a){super(...a),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"dropdownTag",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"dropdownItemTag",void 0),p=(0,o.Cg)([(0,r.EM)("ha-dropdown")],p),t()}catch(l){t(l)}})},47351:function(a,t,e){e.d(t,{PS:function(){return o},Tv:function(){return r},VR:function(){return s},lE:function(){return n}});e(74423),e(3362),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698),e(62953);const o=a=>a.data,s=a=>"object"==typeof a?"object"==typeof a.body?a.body.message||"Unknown error, see supervisor logs":a.body||a.message||"Unknown error, see supervisor logs":a,i=new Set([502,503,504]),r=a=>!!(a&&a.status_code&&i.has(a.status_code))||!(!a||!a.message||!a.message.includes("ERR_CONNECTION_CLOSED")&&!a.message.includes("ERR_CONNECTION_RESET")),n=async(a,t)=>a({type:"supervisor/api",endpoint:`/${t}/stats`,method:"get"})},81562:function(a,t,e){e.r(t),e.d(t,{addStoreRepository:function(){return r},fetchStoreRepositories:function(){return i},fetchSupervisorStore:function(){return s},removeStoreRepository:function(){return n}});e(3362);var o=e(35541);const s=async a=>(0,o.X)(a,"/store"),i=async a=>(0,o.X)(a,"/store/repositories"),r=async(a,t)=>(0,o.X)(a,"/store/repositories",{method:"post",data:{repository:t}}),n=async(a,t)=>(0,o.X)(a,`/store/repositories/${t}`,{method:"delete"})},81310:function(a,t,e){e.a(a,async function(a,t){try{e(62953);var o=e(40445),s=e(5124),i=e(67576),r=e(6412),n=e(26218),l=e(91926),c=e(90248),p=e(2054),h=e(14503),d=a([c,p]);[c,p]=d.then?(await d)():d;let v,g,u,f,b,y=a=>a;class m extends s.WF{render(){var a;return(0,s.qy)(v||(v=y` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${0}" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,r.H)({narrow:this.narrow}),this.mainPage||null!==(a=history.state)&&void 0!==a&&a.root?(0,s.qy)(g||(g=y` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,s.qy)(u||(u=y` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,s.qy)(f||(f=y` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,r.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(a){this._savedScrollPos=a.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[h.dp,(0,s.AH)(b||(b=y`: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(...a){super(...a),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,o.Cg)([(0,i.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,i.MZ)()],m.prototype,"header",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,attribute:"main-page"})],m.prototype,"mainPage",void 0),(0,o.Cg)([(0,i.MZ)({type:String,attribute:"back-path"})],m.prototype,"backPath",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],m.prototype,"backCallback",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],m.prototype,"narrow",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],m.prototype,"scrollable",void 0),(0,o.Cg)([(0,n.a)(".content")],m.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,i.Ls)({passive:!0})],m.prototype,"_saveScrollPos",null),m=(0,o.Cg)([(0,i.EM)("hass-subpage")],m),t()}catch(v){t(v)}})},80888:function(a,t,e){e.a(a,async function(a,t){try{e(89463),e(18111),e(61701),e(62953);var o=e(40445),s=e(10058),i=e(5124),r=e(67576),n=(e(67094),e(67398)),l=(e(94969),e(55380)),c=a([s,l]);[s,l]=c.then?(await c)():c;let p,h,d,v,g,u,f,b,y,m,w=a=>a;const C="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",_="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z";class x extends i.WF{render(){var a,t,e;return(0,i.qy)(p||(p=w` <div class="app"> <div class="icon-wrapper"> ${0} </div> <div> <div class="title-row"> <div class="title"> ${0} </div> </div> <div class="addition"> ${0} ${0} </div> </div> </div> ${0} `),this.iconImage?(0,i.qy)(h||(h=w` <img class="icon-image" src="${0}" .title="${0}" alt="${0}"> `),this.iconImage,this.iconTitle,null!==(a=this.iconTitle)&&void 0!==a?a:""):(0,i.qy)(d||(d=w` <ha-svg-icon class="app-icon" .path="${0}" .title="${0}"></ha-svg-icon> `),this.icon,this.iconTitle),(0,n.z)(this.title,this.stage),this.description,!1===this.available?" (Not available)":"",null!==(t=this.tags)&&void 0!==t&&t.length||void 0!==this.state||this.installed?(0,i.qy)(v||(v=w` <div class="footer"> ${0} ${0} </div> `),void 0!==this.state?(0,i.qy)(g||(g=w`<supervisor-apps-state .state="${0}"></supervisor-apps-state>`),this.state||"unknown"):this.installed?(0,i.qy)(u||(u=w`<div class="installed"> <ha-svg-icon .path="${0}"></ha-svg-icon> <span>${0}</span> </div>`),C,this.hass.localize("ui.panel.config.apps.state.installed")):(0,i.qy)(f||(f=w`<span></span>`)),null!==(e=this.tags)&&void 0!==e&&e.length?(0,i.qy)(b||(b=w`<div class="tags"> ${0} </div>`),this.tags.map(a=>(0,i.qy)(y||(y=w`<supervisor-apps-tag .variant="${0}" .iconPath="${0}" .label="${0}"></supervisor-apps-tag>`),a.variant,a.iconPath,a.label))):i.s6):i.s6)}constructor(...a){super(...a),this.stage="stable",this.installed=!1,this.available=!0,this.icon=_}}x.styles=(0,i.AH)(m||(m=w`.app{margin-bottom:var(--ha-space-2);gap:var(--ha-space-4);display:flex}.icon-wrapper{position:relative;margin-top:var(--ha-space-1);width:40px;height:40px;flex-shrink:0}.app-icon{margin-left:var(--ha-space-2);margin-top:var(--ha-space-2);color:var(--secondary-text-color)}.icon-image{max-height:40px;max-width:40px}.title{flex:1;min-width:0;color:var(--primary-text-color);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title-row{display:flex;align-items:center;gap:var(--ha-space-2);min-width:0}.addition{color:var(--secondary-text-color);margin-top:var(--ha-space-1);overflow:hidden;position:relative;height:2.4em;line-height:var(--ha-line-height-condensed)}.footer{border-top:var(--ha-border-width-sm) solid var(--ha-color-border-neutral-quiet);padding-top:var(--ha-space-2);display:flex;gap:var(--ha-space-2);flex-wrap:wrap;justify-content:space-between}.tags{display:flex;gap:var(--ha-space-2)}.installed{display:inline-flex;align-items:center;gap:var(--ha-space-2);color:var(--ha-color-text-secondary);font-size:var(--ha-font-size-m)}.installed ha-svg-icon{--mdc-icon-size:16px;color:var(--ha-color-on-success-normal)}`)),(0,o.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)()],x.prototype,"title",void 0),(0,o.Cg)([(0,r.MZ)()],x.prototype,"stage",void 0),(0,o.Cg)([(0,r.MZ)()],x.prototype,"state",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],x.prototype,"installed",void 0),(0,o.Cg)([(0,r.MZ)()],x.prototype,"description",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],x.prototype,"available",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"tags",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"iconTitle",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"iconClass",void 0),(0,o.Cg)([(0,r.MZ)()],x.prototype,"icon",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],x.prototype,"iconImage",void 0),x=(0,o.Cg)([(0,r.EM)("supervisor-apps-card-content")],x),t()}catch(p){t(p)}})},11368:function(a,t,e){e.d(t,{C:function(){return s}});e(18111),e(61701),e(27495);var o=e(78648);function s(a,t){const e={keys:["name","description","slug"],isCaseSensitive:!1,minMatchCharLength:Math.min(t.length,2),threshold:.2,ignoreDiacritics:!0};return new o.A(a,e).search(t).map(a=>a.item)}},68702:function(a,t,e){e.a(a,async function(a,o){try{e.r(t),e.d(t,{HaConfigAppsAvailable:function(){return V}});e(26910),e(18111),e(22489),e(61701),e(3362),e(62953);var s=e(40445),i=e(5124),r=e(67576),n=e(22786),l=e(91926),c=e(29823),p=(e(70947),e(26300)),h=e(36866),d=e(22130),v=e(47351),g=e(81562),u=e(65063),f=e(28794),b=e(23296),y=e(81310),m=e(92503),w=a([c,p,h,f,b,y,m]);[c,p,h,f,b,y,m]=w.then?(await w)():w;let C,_,x,A,$,k,L,M=a=>a;const H="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",Z=(a,t)=>"local"===a.slug?-1:"local"===t.slug?1:"core"===a.slug?-1:"core"===t.slug?1:a.name.toUpperCase()<t.name.toUpperCase()?-1:1;class V extends i.WF{connectedCallback(){super.connectedCallback(),this.addEventListener("apps-collection-refresh",this._handleCollectionRefresh)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("apps-collection-refresh",this._handleCollectionRefresh)}firstUpdated(a){super.firstUpdated(a),this._loadData(),this.addEventListener("hass-api-called",a=>this._apiCalled(a))}render(){if(this._error)return(0,i.qy)(C||(C=M` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this._error);if(!this._store||!this._addon)return(0,i.qy)(_||(_=M` <hass-loading-screen .hass="${0}" .narrow="${0}"></hass-loading-screen> `),this.hass,this.narrow);let a=[];return this._store.repositories&&(a=this._addonRepositories(this._store.repositories,this._store.addons,this._filter)),(0,i.qy)(x||(x=M` <hass-subpage .hass="${0}" .narrow="${0}" .route="${0}" back-path="/config/apps" .header="${0}"> <ha-dropdown slot="toolbar-icon" @wa-select="${0}"> <ha-icon-button .label="${0}" .path="${0}" slot="trigger"></ha-icon-button> <ha-dropdown-item value="check_updates"> ${0} </ha-dropdown-item> <ha-dropdown-item value="repositories"> ${0} </ha-dropdown-item> <ha-dropdown-item value="registries"> ${0} </ha-dropdown-item> </ha-dropdown> ${0} </hass-subpage> `),this.hass,this.narrow,this.route,this.hass.localize("ui.panel.config.apps.store.title"),this._handleAction,this.hass.localize("ui.common.menu"),H,this.hass.localize("ui.panel.config.apps.store.check_updates"),this.hass.localize("ui.panel.config.apps.store.repositories"),this.hass.localize("ui.panel.config.apps.store.registries"),0===a.length?(0,i.qy)(A||(A=M`<hass-loading-screen no-toolbar></hass-loading-screen>`)):(0,i.qy)($||($=M` <div class="search"> <ha-input-search appearance="outlined" .value="${0}" @input="${0}"></ha-input-search> </div> ${0} `),this._filter,this._filterChanged,a))}_handleAction(a){const t=a.detail.item.value;if(t)switch(t){case"check_updates":this._refreshData();break;case"repositories":this._manageRepositoriesClicked();break;case"registries":this._manageRegistries()}}async _refreshData(){try{await(0,d.reloadHassioAddons)(this.hass)}catch(a){(0,u.showAlertDialog)(this,{text:(0,v.VR)(a)})}finally{this._loadData()}}_apiCalled(a){a.detail.success&&this._loadData()}_manageRepositoriesClicked(){(0,l.oo)("/config/apps/repositories")}_manageRegistries(){(0,l.oo)("/config/apps/registries")}async _loadData(){try{const[a,t]=await Promise.all([(0,d.fetchHassioAddonsInfo)(this.hass),(0,g.fetchSupervisorStore)(this.hass)]);this._addon=a,this._store=t}catch(a){this._error=a.message||this.hass.localize("ui.panel.config.apps.error_loading"),(0,u.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.apps.error_loading"),text:this._error})}}_filterChanged(a){this._filter=a.target.value}constructor(...a){super(...a),this.narrow=!1,this._addonRepositories=(0,n.A)((a,t,e)=>a.sort(Z).map(a=>{const o=t.filter(t=>t.repository===a.slug);return 0!==o.length?(0,i.qy)(k||(k=M` <supervisor-apps-repository .hass="${0}" .repo="${0}" .addons="${0}" .filter="${0}"></supervisor-apps-repository> `),this.hass,a,o,e):i.s6})),this._handleCollectionRefresh=async a=>{const{collection:t}=a.detail;try{"addon"===t?this._addon=await(0,d.fetchHassioAddonsInfo)(this.hass):"store"===t&&(this._store=await(0,g.fetchSupervisorStore)(this.hass))}catch(e){}}}}V.styles=(0,i.AH)(L||(L=M`:host{display:block;height:100%;background-color:var(--primary-background-color)}supervisor-apps-repository{margin-top:24px}.search{position:sticky;top:0;z-index:2}ha-input-search{padding:var(--ha-space-3) var(--ha-space-2);background:var(--sidebar-background-color);border-bottom:1px solid var(--divider-color)}`)),(0,s.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],V.prototype,"narrow",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],V.prototype,"route",void 0),(0,s.Cg)([(0,r.wk)()],V.prototype,"_store",void 0),(0,s.Cg)([(0,r.wk)()],V.prototype,"_addon",void 0),(0,s.Cg)([(0,r.wk)()],V.prototype,"_error",void 0),(0,s.Cg)([(0,r.wk)()],V.prototype,"_filter",void 0),V=(0,s.Cg)([(0,r.EM)("ha-config-apps-available")],V),o()}catch(C){o(C)}})},92503:function(a,t,e){e.a(a,async function(a,t){try{e(89463),e(44114),e(26910),e(18111),e(22489),e(61701),e(62953);var o=e(40445),s=e(5124),i=e(67576),r=e(6412),n=e(22786),l=e(91926),c=e(52220),p=(e(76776),e(80888)),h=e(11368),d=e(93560),v=a([p]);p=(v.then?(await v)():v)[0];let g,u,f,b,y=a=>a;const m="M23,12L20.56,14.78L20.9,18.46L17.29,19.28L15.4,22.46L12,21L8.6,22.47L6.71,19.29L3.1,18.47L3.44,14.78L1,12L3.44,9.21L3.1,5.53L6.71,4.72L8.6,1.54L12,3L15.4,1.54L17.29,4.72L20.9,5.54L20.56,9.22L23,12M20.33,12L18.5,9.89L18.74,7.1L16,6.5L14.58,4.07L12,5.18L9.42,4.07L8,6.5L5.26,7.09L5.5,9.88L3.67,12L5.5,14.1L5.26,16.9L8,17.5L9.42,19.93L12,18.81L14.58,19.92L16,17.5L18.74,16.89L18.5,14.1L20.33,12M11,15H13V17H11V15M11,7H13V13H11V7",w="M12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22M12,7L7,12H10V16H14V12H17L12,7Z",C="M12,7L17,12H14V16H10V12H7L12,7M12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20Z",_="M6,22A3,3 0 0,1 3,19C3,18.4 3.18,17.84 3.5,17.37L9,7.81V6A1,1 0 0,1 8,5V4A2,2 0 0,1 10,2H14A2,2 0 0,1 16,4V5A1,1 0 0,1 15,6V7.81L20.5,17.37C20.82,17.84 21,18.4 21,19A3,3 0 0,1 18,22H6M5,19A1,1 0 0,0 6,20H18A1,1 0 0,0 19,19C19,18.79 18.93,18.59 18.82,18.43L16.53,14.47L14,17L8.93,11.93L5.18,18.43C5.07,18.59 5,18.79 5,19M13,10A1,1 0 0,0 12,11A1,1 0 0,0 13,12A1,1 0 0,0 14,11A1,1 0 0,0 13,10Z",x="M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z";class A extends s.WF{render(){const a=this.repo,t=this._getAddons(this.addons,this.filter);return this.filter&&t.length<1?(0,s.qy)(g||(g=y` <div class="content"> <p class="description"> ${0} </p> </div> `),this.hass.localize("ui.panel.config.apps.store.no_results_found",{repository:a.name})):(0,s.qy)(u||(u=y` <div class="content"> <h1>${0}</h1> <div class="card-group"> ${0} </div> </div> `),a.name,t.map(a=>{const t=this._getAppTags(a);return(0,s.qy)(f||(f=y` <ha-card outlined .addon="${0}" class="${0}" @click="${0}"> <div class="${0}"> <supervisor-apps-card-content .hass="${0}" .title="${0}" .stage="${0}" .description="${0}" .available="${0}" .installed="${0}" .tags="${0}" .icon="${0}" .iconTitle="${0}" .iconClass="${0}" .iconImage="${0}" .showTopbar="${0}" .topbarClass="${0}"></supervisor-apps-card-content> </div> </ha-card> `),a,a.available?"":"not_available",this._addonTapped,(0,r.H)({"card-content":!0,"has-footer":t.length>0||a.installed}),this.hass,a.name,a.stage,a.description,a.available,a.installed,t,a.installed&&a.update_available?w:x,a.installed?a.update_available?this.hass.localize("ui.panel.config.apps.state.update_available"):this.hass.localize("ui.panel.config.apps.state.installed"):a.available?this.hass.localize("ui.panel.config.apps.state.not_installed"):this.hass.localize("ui.panel.config.apps.state.not_available"),a.installed?a.update_available?"update":"installed":a.available?"":"not_available",a.icon?`/api/hassio/addons/${a.slug}/icon`:void 0,a.installed||!a.available,a.installed?a.update_available?"update":"installed":a.available?"":"unavailable")}))}_addonTapped(a){(0,l.oo)(`/config/app/${a.currentTarget.addon.slug}/info?store=true`)}_getAppTags(a){const t=[];return a.installed&&a.update_available&&t.push({label:this.hass.localize("ui.panel.config.apps.state.update_available"),variant:"brand",iconPath:C}),"stable"!==a.stage&&t.push({label:this.hass.localize(`ui.panel.config.apps.dashboard.capability.stages.${a.stage}`),variant:"experimental"===a.stage?"warning":"danger",iconPath:"experimental"===a.stage?_:m}),t}static get styles(){return[d.g,(0,s.AH)(b||(b=y`ha-card{cursor:pointer;overflow:hidden}ha-card:hover{background-color:var(--ha-color-fill-neutral-quiet-resting)}.card-content.has-footer{padding:var(--ha-space-4) var(--ha-space-4) var(--ha-space-2)}.not_available{opacity:.6}a.repo{color:var(--primary-text-color)}`))]}constructor(...a){super(...a),this._getAddons=(0,n.A)((a,t)=>t?(0,h.C)(a,t):a.sort((a,t)=>(0,c.SH)(a.name,t.name,this.hass.locale.language)))}}(0,o.Cg)([(0,i.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],A.prototype,"repo",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],A.prototype,"addons",void 0),(0,o.Cg)([(0,i.MZ)()],A.prototype,"filter",void 0),A=(0,o.Cg)([(0,i.EM)("supervisor-apps-repository")],A),t()}catch(g){t(g)}})}}]);