export const __rspack_esm_id="21062";export const __rspack_esm_ids=["21062"];export const __webpack_modules__={68348(e,t,a){a.d(t,{u:()=>s});a(18111),a(13579);const s=e=>{if(e.some(e=>"tagName"in e&&("HA-MENU"===e.tagName||"HA-CODE-EDITOR"===e.tagName)))return!1;const t=e[0];if("TEXTAREA"===t.tagName)return!1;if("HA-SELECT"===t.parentElement?.tagName)return!1;if("INPUT"!==t.tagName)return!0;switch(t.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},31580(e,t,a){a.d(t,{J8:()=>r,Rr:()=>i,b9:()=>s,iV:()=>o});const s=e=>{let t=e;return"string"==typeof e&&(t=parseInt(e,16)),"0x"+t.toString(16).padStart(4,"0")},r=(e,t)=>{const a=e.user_given_name?e.user_given_name:e.name,s=t.user_given_name?t.user_given_name:t.name;return a.localeCompare(s)},o=(e,t)=>{const a=e.name,s=t.name;return a.localeCompare(s)},i=e=>`${e.name} (Endpoint id: ${e.endpoint_id}, Id: ${s(e.id)}, Type: ${e.type})`},32168(e,t,a){a.a(e,async function(e,s){try{a.r(t),a.d(t,{ZHAGroupsDashboard:()=>_});a(18111),a(61701);var r=a(62826),o=a(96196),i=a(44457),n=a(22786),p=a(91926),d=(a(27661),a(26300),a(84621)),c=(a(72553),a(14503)),l=a(31580),u=a(63670),h=e([u]);u=(h.then?(await h)():h)[0];const g="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class _ extends o.WF{connectedCallback(){super.connectedCallback(),this.hass&&this._firstUpdatedCalled&&this._fetchGroups()}firstUpdated(e){super.firstUpdated(e),this.hass&&this._fetchGroups(),this._firstUpdatedCalled=!0}render(){return o.qy` <hass-tabs-subpage-data-table .tabs="${u.zhaTabs}" .hass="${this.hass}" .narrow="${this.narrow}" .route="${this.route}" .columns="${this._columns(this.hass.localize)}" .data="${this._formattedGroups(this._groups)}" @row-click="${this._handleRowClicked}" clickable has-fab> <a href="/config/zha/group-add" slot="fab"> <ha-fab .label="${this.hass.localize("ui.panel.config.zha.groups.add_group")}" extended> <ha-svg-icon slot="icon" .path="${g}"></ha-svg-icon> </ha-fab> </a> </hass-tabs-subpage-data-table> `}async _fetchGroups(){this._groups=(await(0,d.pl)(this.hass)).sort(l.iV)}_handleRowClicked(e){const t=e.detail.id;(0,p.o)(`/config/zha/group/${t}`)}static get styles(){return[c.RF,o.AH`a{color:var(--primary-color)}`]}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this._groups=[],this._firstUpdatedCalled=!1,this._formattedGroups=(0,n.A)(e=>{let t=e;return t=t.map(e=>({...e,id:String(e.group_id)})),t}),this._columns=(0,n.A)(e=>({name:{title:e("ui.panel.config.zha.groups.groups"),sortable:!0,filterable:!0,showNarrow:!0,main:!0,hideable:!1,moveable:!1,direction:"asc",flex:2},group_id:{title:e("ui.panel.config.zha.groups.group_id"),type:"numeric",template:e=>o.qy` ${(0,l.b9)(e.group_id)} `,sortable:!0},members:{title:e("ui.panel.config.zha.groups.members"),type:"numeric",template:e=>o.qy` ${e.members.length} `,sortable:!0}}))}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],_.prototype,"route",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"is-wide",type:Boolean})],_.prototype,"isWide",void 0),(0,r.Cg)([(0,i.wk)()],_.prototype,"_groups",void 0),_=(0,r.Cg)([(0,i.EM)("zha-groups-dashboard")],_),s()}catch(e){s(e)}})}};
//# sourceMappingURL=21062.9a967fb5bb5dd348.js.map