diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js index 167120f..bf1cef0 100644 --- a/dist/mushroom-strategy.js +++ b/dist/mushroom-strategy.js @@ -1 +1 @@ -(()=>{var e={996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function a(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function n(e,t){try{return t in e}catch(e){return!1}}function s(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var d=Array.isArray(r);return d===Array.isArray(e)?d?c.arrayMerge(e,r,c):function(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach((function(t){a[t]=i(e[t],r)})),o(t).forEach((function(o){(function(e,t){return n(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(n(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(o,r)(e[o],t[o],r):a[o]=i(t[o],r))})),a}(e,r,c):i(r,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var c=s;e.exports=c},371:(e,t,r)=>{"use strict";r.d(t,{W:()=>v});const i={areas:{undisclosed:{aliases:[],area_id:"undisclosed",name:"Undisclosed",picture:null,hidden:!1}},debug:!1,domains:{default:{title:"Miscellaneous",showControls:!1,hidden:!1},light:{title:"Lights",showControls:!0,iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},fan:{title:"Fans",showControls:!0,iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{title:"Covers",showControls:!0,iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},switch:{title:"Switches",showControls:!0,iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},camera:{title:"Cameras",showControls:!1,hidden:!1},lock:{title:"Locks",showControls:!1,hidden:!1},climate:{title:"Climates",showControls:!1,hidden:!1},media_player:{title:"Media Players",showControls:!1,hidden:!1},sensor:{title:"Sensors",showControls:!1,hidden:!1},binary_sensor:{title:"Binary Sensors",showControls:!1,hidden:!1},number:{title:"Numbers",showControls:!1,hidden:!1},vacuum:{title:"Vacuums",showControls:!0,hidden:!1}},home_view:{hidden:[]},views:{home:{order:1,hidden:!1},light:{order:2,hidden:!1},fan:{order:3,hidden:!1},cover:{order:4,hidden:!1},switch:{order:5,hidden:!1},climate:{order:6,hidden:!1},camera:{order:7,hidden:!1},vacuum:{order:8,hidden:!1}}};var a,o,n,s,c,d,l,h,f,u,p=r(996),w=r.n(p),m=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},g=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r};class v{constructor(){throw new Error("This class should be invoked with method initialize() instead of using the keyword new!")}static get strategyOptions(){return m(this,a,"f",l)}static get areas(){return m(this,a,"f",s)}static get devices(){return m(this,a,"f",n)}static get entities(){return m(this,a,"f",o)}static get debug(){return m(this,a,"f",h)}static async initialize(e){g(this,a,e.hass.states,"f",c),g(this,a,w()(i,e.config?.strategy?.options??{}),"f",l),g(this,a,m(this,a,"f",l).debug,"f",h);try{[{set value(e){g(a,a,e,"f",o)}}.value,{set value(e){g(a,a,e,"f",n)}}.value,{set value(e){g(a,a,e,"f",s)}}.value]=await Promise.all([e.hass.callWS({type:"config/entity_registry/list"}),e.hass.callWS({type:"config/device_registry/list"}),e.hass.callWS({type:"config/area_registry/list"})])}catch(e){throw a.logError("An error occurred while querying Home assistant's registries!",e),"Check the console for details"}m(this,a,"f",l).areas.undisclosed?.hidden||(m(this,a,"f",l).areas.undisclosed={...i.areas.undisclosed,...m(this,a,"f",l).areas.undisclosed},m(this,a,"f",l).areas.undisclosed.area_id="undisclosed",m(this,a,"f",s).push(m(this,a,"f",l).areas.undisclosed)),g(this,a,a.areas.map((e=>({...e,...m(this,a,"f",l).areas?.[e.area_id]}))),"f",s),m(this,a,"f",s).sort(((e,t)=>(e.order??1/0)-(t.order??1/0)||e.name.localeCompare(t.name))),m(this,a,"f",l).views=Object.fromEntries(Object.entries(m(this,a,"f",l).views).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),m(this,a,"f",l).domains=Object.fromEntries(Object.entries(m(this,a,"f",l).domains).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),g(this,a,!0,"f",d)}static isInitialized(){return m(this,a,"f",d)}static getCountTemplate(e,t,r){const i=[];this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");for(const t of m(this,a,"f",s)){const r=m(this,a,"f",n).filter((e=>e.area_id===t.area_id)).map((e=>e.id)),s=m(this,a,"f",o).filter(m(this,a,"m",f),{area:t,domain:e,areaDeviceIds:r}).map((e=>`states['${e.entity_id}']`));i.push(...s)}return`{% set entities = [${i}] %} {{ entities | selectattr('state','${t}','${r}') | list | count }}`}static getDeviceEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=m(this,a,"f",n).filter((t=>(t.area_id??"undisclosed")===e.area_id)).map((e=>e.id));return m(this,a,"f",o).filter(m(this,a,"m",f),{area:e,domain:t,areaDeviceIds:r}).sort(((e,t)=>(e.original_name??"undefined").localeCompare(t.original_name??"undefined")))}static getStateEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=[],i=Object.fromEntries(m(this,a,"f",o).map((e=>[e.entity_id,e]))),s=Object.fromEntries(m(this,a,"f",n).map((e=>[e.id,e]))),d=Object.values(m(this,a,"f",c)).filter((e=>e.entity_id.startsWith(`${t}.`)));for(const t of d){const a=i[t.entity_id],o=s[a?.device_id??""];(a?.area_id===e.area_id||o&&o.area_id===e.area_id)&&r.push(t)}return r}static sanitizeClassName(e){return(e=e.charAt(0).toUpperCase()+e.slice(1)).replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")))}static getExposedViewIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).views,"hidden",!1)}static getExposedDomainIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).domains,"hidden",!1)}static logError(e,t){a.debug?console.error(e,t):console.error(e)}}a=v,f=function(e){const t=null===e.hidden_by&&null===e.disabled_by,r=e.entity_id.startsWith(`${this.domain}.`),i="undisclosed"===this.area.area_id?!e.area_id&&(this.areaDeviceIds.includes(e.device_id??"")||!e.device_id):this.areaDeviceIds.includes(e.device_id??"")||e.area_id===this.area.area_id;return t&&r&&i},u=function(e,t,r){const i=[];for(const a of Object.keys(e))e[a][t]===r&&i.push(a);return i},o={value:void 0},n={value:void 0},s={value:[]},c={value:void 0},d={value:!1},l={value:void 0},h={value:void 0}},976:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractCard:()=>a});var i=r(371);class a{constructor(e){if(this.config={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},!i.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.");this.entity=e}getCard(){return{...this.config,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},396:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(976),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-template-card",primary:void 0,icon:"mdi:texture-box",icon_color:"blue",tap_action:{action:"navigate",navigation_path:""},hold_action:{action:"none"}}),"default"===t.type&&delete t.type,o(this,i,"f").primary=e.name,o(this,i,"f").tap_action&&"navigation_path"in o(this,i,"f").tap_action&&(o(this,i,"f").tap_action.navigation_path=e.area_id),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},418:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BinarySensorCard:()=>o});var i,a=r(642);class o extends a.SensorCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},604:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},782:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},607:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ControllerCard:()=>s});var i,a,o=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r},n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e,t={}){i.set(this,void 0),a.set(this,{type:"mushroom-title-card",showControls:!0,iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}),o(this,i,e,"f"),o(this,a,{...n(this,a,"f"),...t},"f")}createCard(){const e=[{type:"custom:mushroom-title-card",title:n(this,a,"f").title,subtitle:n(this,a,"f").subtitle}];return n(this,a,"f").showControls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:n(this,a,"f").offService,target:n(this,i,"f"),data:{}}},{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:n(this,a,"f").onService,target:n(this,i,"f"),data:{}}}]}),{type:"horizontal-stack",cards:e}}}i=new WeakMap,a=new WeakMap},758:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},287:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},387:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(976),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"area",area:""}),o(this,i,"f").area=e.area_id,o(this,i,"f").navigation_path=o(this,i,"f").area,delete t.type,this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},475:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightCard:()=>d});var i,a=r(976),o=r(596),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},s=o.R.isCallServiceActionConfig,c=o.R.isCallServiceActionTarget;class d extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-light-card",icon:void 0,show_brightness_control:!0,show_color_control:!0,show_color_temp_control:!0,use_light_color:!0,double_tap_action:{action:"call-service",service:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}),s(n(this,i,"f").double_tap_action)&&c(n(this,i,"f").double_tap_action.target)&&(n(this,i,"f").double_tap_action.target.entity_id=e.entity_id),this.config=Object.assign(this.config,n(this,i,"f"),t)}}i=new WeakMap},696:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LockCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-lock-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},499:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MediaPlayerCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-media-player-card",use_media_info:!0,media_controls:["on_off","play_pause_stop"],show_volume_level:!0,volume_controls:["volume_mute","volume_set","volume_buttons"]}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},571:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MiscellaneousCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon_color:"blue-grey"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},420:(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-number-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},877:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PersonCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},642:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SensorCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:information",animate:!0,line_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},330:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},695:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumCard:()=>n});var i=r(976);const a=["on_off","start_pause","stop","locate","clean_spot","return_home"];var o;class n extends i.AbstractCard{constructor(e,t={}){super(e),o.set(this,{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...a],tap_action:{action:"more-info"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,o,"f"),t)}}o=new WeakMap},370:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractChip:()=>o});var i=r(371),a=r(596).R.isCallServiceActionConfig;class o{constructor(){if(this.config={type:"template"},!i.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.")}getChip(){return this.config}setTapActionTarget(e){"tap_action"in this.config&&a(this.config.tap_action)?this.config.tap_action.target=e:i.W.debug&&console.warn(this.constructor.name+" - Target not set: Invalid target or tap action.")}}},660:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:thermostat",icon_color:"orange",content:a.W.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:window-open",icon_color:"cyan",content:a.W.getCountTemplate("cover","eq","open"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},966:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:fan",icon_color:"green",content:a.W.getCountTemplate("fan","eq","on"),tap_action:{action:"call-service",service:"fan.turn_off"},hold_action:{action:"navigate",navigation_path:"fans"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},95:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:lightbulb-group",icon_color:"amber",content:a.W.getCountTemplate("light","eq","on"),tap_action:{action:"call-service",service:"light.turn_off"},hold_action:{action:"navigate",navigation_path:"lights"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},817:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:dip-switch",icon_color:"blue",content:a.W.getCountTemplate("switch","eq","on"),tap_action:{action:"call-service",service:"switch.turn_off"},hold_action:{action:"navigate",navigation_path:"switches"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},977:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WeatherChip:()=>n});var i,a=r(370),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractChip{constructor(e,t={}){super(),i.set(this,{type:"weather",show_temperature:!0,show_conditions:!0}),function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,{...o(this,i,"f"),entity:e,...t},"f"),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},596:(e,t,r)=>{"use strict";var i;r.d(t,{R:()=>i}),function(e){e.isCallServiceActionConfig=function(e){return e&&"call-service"===e.action&&["action","service"].every((t=>t in e))},e.isCallServiceActionTarget=function(e){return e&&["entity_id","device_id","area_id"].some((t=>t in e))}}(i||(i={}))},1:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractView:()=>s});var i,a=r(371),o=r(607),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e=""){if(this.config={icon:"mdi:view-dashboard",subview:!1},this.viewControllerCard={cards:[],type:""},i.set(this,void 0),!a.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.");e&&function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,e,"f")}async createViewCards(){const e=[];for(const t of a.W.areas){const s=[],c=a.W.getDeviceEntities(t,n(this,i,"f")??""),d=a.W.sanitizeClassName(n(this,i,"f")+"Card"),l=await r(175)(`./${d}`);let h={area_id:[t.area_id]};"undisclosed"===t.area_id&&(h={entity_id:c.map((e=>e.entity_id))});for(const e of c){let t=a.W.strategyOptions.card_options?.[e.entity_id],r=a.W.strategyOptions.card_options?.[e.device_id??"null"];t?.hidden||r?.hidden||s.push(new l[d](e,t).getCard())}if(s.length){const r="controllerCardOptions"in this.config?this.config.controllerCardOptions:{};s.unshift(new o.ControllerCard(h,Object.assign({title:t.name},r)).createCard()),e.push({type:"vertical-stack",cards:s})}}return e.length&&e.unshift(this.viewControllerCard),e}async getView(){return{...this.config,cards:await this.createViewCards()}}targetDomain(e){return{entity_id:a.W.entities.filter((t=>t.entity_id.startsWith(e+".")&&!t.hidden_by&&!a.W.strategyOptions.card_options?.entity_id.hidden)).map((e=>e.entity_id))}}}i=new WeakMap},89:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraView:()=>h});var i,a,o,n,s=r(607),c=r(1),d=r(371),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends c.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Cameras",path:"cameras",icon:"mdi:cctv",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Cameras",subtitle:d.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" cameras on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new s.ControllerCard({},{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"camera"}},81:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Climates",path:"climates",icon:"mdi:thermostat",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Climates",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" climates on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"climate"}},136:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Covers",path:"covers",icon:"mdi:window-open",subview:!1,controllerCardOptions:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}),n.set(this,{title:"All Covers",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","open")+" covers open"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"cover"}},964:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Fans",path:"fans",icon:"mdi:fan",subview:!1,controllerCardOptions:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}),n.set(this,{title:"All Fans",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" fans on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"fan"}},985:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HomeView:()=>h});var i,a,o,n,s,c=r(371),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(),i.add(this),a.set(this,{title:"Home",icon:"mdi:home-assistant",path:"home",subview:!1}),this.config=Object.assign(this.config,l(this,a,"f"),e)}async createViewCards(){return await Promise.all([l(this,i,"m",o).call(this),l(this,i,"m",n).call(this),l(this,i,"m",s).call(this)]).then((([e,t,r])=>{const i=c.W.strategyOptions,a=[];return e.length&&a.push({type:"custom:mushroom-chips-card",alignment:"center",chips:e}),t.length&&a.push({type:"horizontal-stack",cards:t}),c.W.strategyOptions.home_view.hidden.includes("greeting")||a.push({type:"custom:mushroom-template-card",primary:"{% set time = now().hour %} {% if (time >= 18) %} Good Evening, {{user}}! {% elif (time >= 12) %} Good Afternoon, {{user}}! {% elif (time >= 5) %} Good Morning, {{user}}! {% else %} Hello, {{user}}! {% endif %}",icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}}),i.quick_access_cards&&a.push(...i.quick_access_cards),a.push({type:"vertical-stack",cards:r}),i.extra_cards&&a.push(...i.extra_cards),a}))}}a=new WeakMap,i=new WeakSet,o=async function(){if(c.W.strategyOptions.home_view.hidden.includes("chips"))return[];const e=[],t=c.W.strategyOptions.chips,i=["light","fan","cover","switch","climate"],a=c.W.areas.map((e=>e.area_id??""));let o;const n=t?.weather_entity??c.W.entities.find((e=>e.entity_id.startsWith("weather.")&&null===e.disabled_by&&null===e.hidden_by))?.entity_id;if(n)try{o=await Promise.resolve().then(r.bind(r,977));const t=new o.WeatherChip(n);e.push(t.getChip())}catch(e){c.W.logError("An error occurred while creating the weather chip!",e)}for(let n of i)if(t?.[`${n}_count`]??1){const t=c.W.sanitizeClassName(n+"Chip");try{o=await r(837)(`./${t}`);const i=new o[t];i.setTapActionTarget({area_id:a}),e.push(i.getChip())}catch(e){c.W.logError(`An error occurred while creating the ${n} chip!`,e)}}return t?.extra_chips&&e.push(...t.extra_chips),e},n=function(){if(c.W.strategyOptions.home_view.hidden.includes("persons"))return[];const e=[];return Promise.resolve().then(r.bind(r,877)).then((t=>{for(const r of c.W.entities.filter((e=>e.entity_id.startsWith("person.")&&null==e.hidden_by&&null==e.disabled_by)))e.push(new t.PersonCard(r).getCard())})),e},s=async function(){if(c.W.strategyOptions.home_view.hidden.includes("areas"))return[];const e=[];let t=[];c.W.strategyOptions.home_view.hidden.includes("areasTitle")||e.push({type:"custom:mushroom-title-card",title:"Areas"});for(const[i,a]of c.W.areas.entries()){let o,n=c.W.strategyOptions.areas[a.area_id]?.type??c.W.strategyOptions.areas._?.type??"default";try{o=await r(175)(`./${n}`)}catch(e){o=await Promise.resolve().then(r.bind(r,396)),c.W.strategyOptions.debug&&"default"!==n&&console.error(e)}if(!c.W.strategyOptions.areas[a.area_id]?.hidden){let e={...c.W.strategyOptions.areas._,...c.W.strategyOptions.areas[a.area_id]};t.push(new o.AreaCard(a,e).getCard())}if(i===c.W.areas.length-1)for(let r=0;r{"use strict";r.r(t),r.d(t,{LightView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Lights",path:"lights",icon:"mdi:lightbulb-group",subview:!1,controllerCardOptions:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}),n.set(this,{title:"All Lights",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" lights on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"light"}},683:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Switches",path:"switches",icon:"mdi:dip-switch",subview:!1,controllerCardOptions:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}),n.set(this,{title:"All Switches",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" switches on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"switch"}},610:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Vacuums",path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,controllerCardOptions:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}),n.set(this,{title:"All Vacuums",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" vacuums on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"vacuum"}},175:(e,t,r)=>{var i={"./AbstractCard":[976],"./AbstractCard.ts":[976],"./AreaCard":[396,179],"./AreaCard.ts":[396,179],"./BinarySensorCard":[418,179],"./BinarySensorCard.ts":[418,179],"./CameraCard":[604,179],"./CameraCard.ts":[604,179],"./ClimateCard":[782,179],"./ClimateCard.ts":[782,179],"./ControllerCard":[607],"./ControllerCard.ts":[607],"./CoverCard":[758,179],"./CoverCard.ts":[758,179],"./FanCard":[287,179],"./FanCard.ts":[287,179],"./HaAreaCard":[387,179],"./HaAreaCard.ts":[387,179],"./LightCard":[475,179],"./LightCard.ts":[475,179],"./LockCard":[696,179],"./LockCard.ts":[696,179],"./MediaPlayerCard":[499,179],"./MediaPlayerCard.ts":[499,179],"./MiscellaneousCard":[571,179],"./MiscellaneousCard.ts":[571,179],"./NumberCard":[420,179],"./NumberCard.ts":[420,179],"./PersonCard":[877,179],"./PersonCard.ts":[877,179],"./SensorCard":[642],"./SensorCard.ts":[642],"./SwitchCard":[330,179],"./SwitchCard.ts":[330,179],"./VacuumCard":[695,179],"./VacuumCard.ts":[695,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=175,e.exports=a},837:(e,t,r)=>{var i={"./AbstractChip":[370,179],"./AbstractChip.ts":[370,179],"./ClimateChip":[660,179],"./ClimateChip.ts":[660,179],"./CoverChip":[993,179],"./CoverChip.ts":[993,179],"./FanChip":[966,179],"./FanChip.ts":[966,179],"./LightChip":[95,179],"./LightChip.ts":[95,179],"./SwitchChip":[817,179],"./SwitchChip.ts":[817,179],"./WeatherChip":[977,179],"./WeatherChip.ts":[977,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=837,e.exports=a},968:(e,t,r)=>{var i={"./AbstractView":[1,179],"./AbstractView.ts":[1,179],"./CameraView":[89,179],"./CameraView.ts":[89,179],"./ClimateView":[81,179],"./ClimateView.ts":[81,179],"./CoverView":[136,179],"./CoverView.ts":[136,179],"./FanView":[964,179],"./FanView.ts":[964,179],"./HomeView":[985,179],"./HomeView.ts":[985,179],"./LightView":[144,179],"./LightView.ts":[144,179],"./SwitchView":[683,179],"./SwitchView.ts":[683,179],"./VacuumView":[610,179],"./VacuumView.ts":[610,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=968,e.exports=a}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.e=()=>Promise.resolve(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=r(371),t=r(642),i=r(607);class a extends HTMLTemplateElement{static async generateDashboard(t){await e.W.initialize(t);const i=t.config?.views??[];let a;for(let t of e.W.getExposedViewIds())try{const o=e.W.sanitizeClassName(t+"View");a=await r(968)(`./${o}`);const n=await new a[o](e.W.strategyOptions.views[t]).getView();n.cards?.length&&i.push(n)}catch(r){e.W.logError(`View '${t}' couldn't be loaded!`,r)}for(let t of e.W.areas)t.hidden||i.push({title:t.name,path:t.area_id??t.name,subview:!0,strategy:{type:"custom:mushroom-strategy",options:{area:t}}});return e.W.strategyOptions.extra_views&&i.push(...e.W.strategyOptions.extra_views),{views:i}}static async generateView(a){const o=e.W.getExposedDomainIds(),n=a.view.strategy?.options?.area??{},s=[...n.extra_cards??[]];let c={area_id:[n.area_id]};for(const a of o){if("default"===a)continue;const o=e.W.sanitizeClassName(a+"Card");let d=[];try{d=await r(175)(`./${o}`).then((r=>{let s=[];const d=e.W.getDeviceEntities(n,a);if("undisclosed"===n.area_id&&(c={entity_id:d.map((e=>e.entity_id))}),d.length){const l=new i.ControllerCard(c,e.W.strategyOptions.domains[a]).createCard();if("sensor"===a){const r=e.W.getStateEntities(n,"sensor"),i=[];for(const a of d){const o=r.find((e=>e.entity_id===a.entity_id));let n=e.W.strategyOptions.card_options?.[a.entity_id],s=e.W.strategyOptions.card_options?.[a.device_id??"null"];n?.hidden||s?.hidden||(o?.attributes.unit_of_measurement&&(n={type:"custom:mini-graph-card",entities:[a.entity_id],...n}),i.push(new t.SensorCard(a,n).getCard()))}return i.length&&(s.push({type:"vertical-stack",cards:i}),s.unshift(l)),s}for(const t of d){let i,a=e.W.strategyOptions.card_options?.[t.entity_id];t.device_id&&(i=e.W.strategyOptions.card_options?.[t.device_id]),a?.hidden||i?.hidden||s.push(new r[o](t,a).getCard())}if("binary_sensor"===a){const e=[];for(let t=0;te.area_id===n.area_id)).map((e=>e.id)),a=e.W.entities.filter((e=>{const r=t.includes(e.device_id??"null")||e.area_id===n.area_id,i=null===e.hidden_by&&null===e.disabled_by,a=o.includes(e.entity_id.split(".",1)[0]);return i&&!a&&r}));if(a.length){let t=[];try{t=await Promise.resolve().then(r.bind(r,571)).then((t=>{const r=[new i.ControllerCard(c,e.W.strategyOptions.domains.default).createCard()];for(const i of a){let a=e.W.strategyOptions.card_options?.[i.entity_id],o=e.W.strategyOptions.card_options?.[i.device_id??"null"];a?.hidden||o?.hidden||r.push(new t.MiscellaneousCard(i,a).getCard())}return r}))}catch(t){e.W.logError("An error occurred while creating the domain cards!",t)}s.push({type:"vertical-stack",cards:t})}}return{cards:s}}}customElements.define("ll-strategy-mushroom-strategy",a),console.info("%c Mushroom Strategy %c ".concat("v2.0.0"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file +(()=>{var e={996:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function a(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function n(e,t){try{return t in e}catch(e){return!1}}function s(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var d=Array.isArray(r);return d===Array.isArray(e)?d?c.arrayMerge(e,r,c):function(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach((function(t){a[t]=i(e[t],r)})),o(t).forEach((function(o){(function(e,t){return n(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(n(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(o,r)(e[o],t[o],r):a[o]=i(t[o],r))})),a}(e,r,c):i(r,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var c=s;e.exports=c},371:(e,t,r)=>{"use strict";r.d(t,{W:()=>v});const i={areas:{undisclosed:{aliases:[],area_id:"undisclosed",name:"Undisclosed",picture:null,hidden:!1}},debug:!1,domains:{default:{title:"Miscellaneous",showControls:!1,hidden:!1},light:{title:"Lights",showControls:!0,iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},fan:{title:"Fans",showControls:!0,iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{title:"Covers",showControls:!0,iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},switch:{title:"Switches",showControls:!0,iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},camera:{title:"Cameras",showControls:!1,hidden:!1},lock:{title:"Locks",showControls:!1,hidden:!1},climate:{title:"Climates",showControls:!1,hidden:!1},media_player:{title:"Media Players",showControls:!1,hidden:!1},sensor:{title:"Sensors",showControls:!1,hidden:!1},binary_sensor:{title:"Binary Sensors",showControls:!1,hidden:!1},number:{title:"Numbers",showControls:!1,hidden:!1},vacuum:{title:"Vacuums",showControls:!0,hidden:!1}},home_view:{hidden:[]},views:{home:{order:1,hidden:!1},light:{order:2,hidden:!1},fan:{order:3,hidden:!1},cover:{order:4,hidden:!1},switch:{order:5,hidden:!1},climate:{order:6,hidden:!1},camera:{order:7,hidden:!1},vacuum:{order:8,hidden:!1}}};var a,o,n,s,c,d,l,h,f,u,p=r(996),w=r.n(p),m=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},g=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r};class v{constructor(){throw new Error("This class should be invoked with method initialize() instead of using the keyword new!")}static get strategyOptions(){return m(this,a,"f",l)}static get areas(){return m(this,a,"f",s)}static get devices(){return m(this,a,"f",n)}static get entities(){return m(this,a,"f",o)}static get debug(){return m(this,a,"f",h)}static async initialize(e){g(this,a,e.hass.states,"f",c),g(this,a,w()(i,e.config?.strategy?.options??{}),"f",l),g(this,a,m(this,a,"f",l).debug,"f",h);try{[{set value(e){g(a,a,e,"f",o)}}.value,{set value(e){g(a,a,e,"f",n)}}.value,{set value(e){g(a,a,e,"f",s)}}.value]=await Promise.all([e.hass.callWS({type:"config/entity_registry/list"}),e.hass.callWS({type:"config/device_registry/list"}),e.hass.callWS({type:"config/area_registry/list"})])}catch(e){throw a.logError("An error occurred while querying Home assistant's registries!",e),"Check the console for details"}m(this,a,"f",l).areas.undisclosed?.hidden||(m(this,a,"f",l).areas.undisclosed={...i.areas.undisclosed,...m(this,a,"f",l).areas.undisclosed},m(this,a,"f",l).areas.undisclosed.area_id="undisclosed",m(this,a,"f",s).push(m(this,a,"f",l).areas.undisclosed)),g(this,a,a.areas.map((e=>({...e,...m(this,a,"f",l).areas?.[e.area_id]}))),"f",s),m(this,a,"f",s).sort(((e,t)=>(e.order??1/0)-(t.order??1/0)||e.name.localeCompare(t.name))),m(this,a,"f",l).views=Object.fromEntries(Object.entries(m(this,a,"f",l).views).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),m(this,a,"f",l).domains=Object.fromEntries(Object.entries(m(this,a,"f",l).domains).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),g(this,a,!0,"f",d)}static isInitialized(){return m(this,a,"f",d)}static getCountTemplate(e,t,r){const i=[];this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");for(const t of m(this,a,"f",s)){const r=m(this,a,"f",n).filter((e=>e.area_id===t.area_id)).map((e=>e.id)),s=m(this,a,"f",o).filter(m(this,a,"m",f),{area:t,domain:e,areaDeviceIds:r}).map((e=>`states['${e.entity_id}']`));i.push(...s)}return`{% set entities = [${i}] %} {{ entities | selectattr('state','${t}','${r}') | list | count }}`}static getDeviceEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=m(this,a,"f",n).filter((t=>(t.area_id??"undisclosed")===e.area_id)).map((e=>e.id));return m(this,a,"f",o).filter(m(this,a,"m",f),{area:e,domain:t,areaDeviceIds:r}).sort(((e,t)=>(e.original_name??"undefined").localeCompare(t.original_name??"undefined")))}static getStateEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=[],i=Object.fromEntries(m(this,a,"f",o).map((e=>[e.entity_id,e]))),s=Object.fromEntries(m(this,a,"f",n).map((e=>[e.id,e]))),d=Object.values(m(this,a,"f",c)).filter((e=>e.entity_id.startsWith(`${t}.`)));for(const t of d){const a=i[t.entity_id],o=s[a?.device_id??""];(a?.area_id===e.area_id||o&&o.area_id===e.area_id)&&r.push(t)}return r}static sanitizeClassName(e){return(e=e.charAt(0).toUpperCase()+e.slice(1)).replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")))}static getExposedViewIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).views,"hidden",!1)}static getExposedDomainIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).domains,"hidden",!1)}static logError(e,t){a.debug?console.error(e,t):console.error(e)}}a=v,f=function(e){const t=null===e.hidden_by&&null===e.disabled_by,r=e.entity_id.startsWith(`${this.domain}.`),i="undisclosed"===this.area.area_id?!e.area_id&&(this.areaDeviceIds.includes(e.device_id??"")||!e.device_id):this.areaDeviceIds.includes(e.device_id??"")||e.area_id===this.area.area_id;return t&&r&&i},u=function(e,t,r){const i=[];for(const a of Object.keys(e))e[a][t]===r&&i.push(a);return i},o={value:void 0},n={value:void 0},s={value:[]},c={value:void 0},d={value:!1},l={value:void 0},h={value:void 0}},976:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractCard:()=>a});var i=r(371);class a{constructor(e){if(this.config={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},!i.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.");this.entity=e}getCard(){return{...this.config,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},396:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(976),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-template-card",primary:void 0,icon:"mdi:texture-box",icon_color:"blue",tap_action:{action:"navigate",navigation_path:""},hold_action:{action:"none"}}),"default"===t.type&&delete t.type,o(this,i,"f").primary=e.name,o(this,i,"f").tap_action&&"navigation_path"in o(this,i,"f").tap_action&&(o(this,i,"f").tap_action.navigation_path=e.area_id),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},418:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BinarySensorCard:()=>o});var i,a=r(642);class o extends a.SensorCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},604:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},782:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},607:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ControllerCard:()=>s});var i,a,o=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r},n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e,t={}){i.set(this,void 0),a.set(this,{type:"mushroom-title-card",showControls:!0,iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}),o(this,i,e,"f"),o(this,a,{...n(this,a,"f"),...t},"f")}createCard(){const e=[{type:"custom:mushroom-title-card",title:n(this,a,"f").title,subtitle:n(this,a,"f").subtitle}];return n(this,a,"f").showControls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:n(this,a,"f").offService,target:n(this,i,"f"),data:{}}},{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:n(this,a,"f").onService,target:n(this,i,"f"),data:{}}}]}),{type:"horizontal-stack",cards:e}}}i=new WeakMap,a=new WeakMap},758:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},287:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},387:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(976),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"area",area:""}),o(this,i,"f").area=e.area_id,o(this,i,"f").navigation_path=o(this,i,"f").area,delete t.type,this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},475:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightCard:()=>d});var i,a=r(976),o=r(596),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},s=o.R.isCallServiceActionConfig,c=o.R.isCallServiceActionTarget;class d extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-light-card",icon:void 0,show_brightness_control:!0,show_color_control:!0,show_color_temp_control:!0,use_light_color:!0,double_tap_action:{action:"call-service",service:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}),s(n(this,i,"f").double_tap_action)&&c(n(this,i,"f").double_tap_action.target)&&(n(this,i,"f").double_tap_action.target.entity_id=e.entity_id),this.config=Object.assign(this.config,n(this,i,"f"),t)}}i=new WeakMap},696:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LockCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-lock-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},499:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MediaPlayerCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-media-player-card",use_media_info:!0,media_controls:["on_off","play_pause_stop"],show_volume_level:!0,volume_controls:["volume_mute","volume_set","volume_buttons"]}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},571:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MiscellaneousCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon_color:"blue-grey"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},420:(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-number-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},877:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PersonCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},642:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SensorCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:information",animate:!0,line_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},330:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchCard:()=>o});var i,a=r(976);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},695:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumCard:()=>n});var i=r(976);const a=["on_off","start_pause","stop","locate","clean_spot","return_home"];var o;class n extends i.AbstractCard{constructor(e,t={}){super(e),o.set(this,{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...a],tap_action:{action:"more-info"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,o,"f"),t)}}o=new WeakMap},370:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractChip:()=>o});var i=r(371),a=r(596).R.isCallServiceActionConfig;class o{constructor(){if(this.config={type:"template"},!i.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.")}getChip(){return this.config}setTapActionTarget(e){"tap_action"in this.config&&a(this.config.tap_action)?this.config.tap_action.target=e:i.W.debug&&console.warn(this.constructor.name+" - Target not set: Invalid target or tap action.")}}},660:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:thermostat",icon_color:"orange",content:a.W.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:window-open",icon_color:"cyan",content:a.W.getCountTemplate("cover","eq","open"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},966:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:fan",icon_color:"green",content:a.W.getCountTemplate("fan","eq","on"),tap_action:{action:"call-service",service:"fan.turn_off"},hold_action:{action:"navigate",navigation_path:"fans"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},95:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:lightbulb-group",icon_color:"amber",content:a.W.getCountTemplate("light","eq","on"),tap_action:{action:"call-service",service:"light.turn_off"},hold_action:{action:"navigate",navigation_path:"lights"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},817:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchChip:()=>n});var i,a=r(371),o=r(370);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:dip-switch",icon_color:"blue",content:a.W.getCountTemplate("switch","eq","on"),tap_action:{action:"call-service",service:"switch.turn_off"},hold_action:{action:"navigate",navigation_path:"switches"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},977:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WeatherChip:()=>n});var i,a=r(370),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractChip{constructor(e,t={}){super(),i.set(this,{type:"weather",show_temperature:!0,show_conditions:!0}),function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,{...o(this,i,"f"),entity:e,...t},"f"),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},596:(e,t,r)=>{"use strict";var i;r.d(t,{R:()=>i}),function(e){e.isCallServiceActionConfig=function(e){return e&&"call-service"===e.action&&["action","service"].every((t=>t in e))},e.isCallServiceActionTarget=function(e){return e&&["entity_id","device_id","area_id"].some((t=>t in e))}}(i||(i={}))},1:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractView:()=>s});var i,a=r(371),o=r(607),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e=""){if(this.config={icon:"mdi:view-dashboard",subview:!1},this.viewControllerCard={cards:[],type:""},i.set(this,void 0),!a.W.isInitialized())throw new Error("The Helper module must be initialized before using this one.");e&&function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,e,"f")}async createViewCards(){const e=[];for(const t of a.W.areas){const s=[],c=a.W.getDeviceEntities(t,n(this,i,"f")??""),d=a.W.sanitizeClassName(n(this,i,"f")+"Card"),l=await r(175)(`./${d}`);let h={area_id:[t.area_id]};"undisclosed"===t.area_id&&(h={entity_id:c.map((e=>e.entity_id))});for(const e of c){let t=a.W.strategyOptions.card_options?.[e.entity_id],r=a.W.strategyOptions.card_options?.[e.device_id??"null"];t?.hidden||r?.hidden||s.push(new l[d](e,t).getCard())}if(s.length){const r="controllerCardOptions"in this.config?this.config.controllerCardOptions:{};s.unshift(new o.ControllerCard(h,Object.assign({title:t.name},r)).createCard()),e.push({type:"vertical-stack",cards:s})}}return e.length&&e.unshift(this.viewControllerCard),e}async getView(){return{...this.config,cards:await this.createViewCards()}}targetDomain(e){return{entity_id:a.W.entities.filter((t=>t.entity_id.startsWith(e+".")&&!t.hidden_by&&!a.W.strategyOptions.card_options?.[t.entity_id]?.hidden)).map((e=>e.entity_id))}}}i=new WeakMap},89:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraView:()=>h});var i,a,o,n,s=r(607),c=r(1),d=r(371),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends c.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Cameras",path:"cameras",icon:"mdi:cctv",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Cameras",subtitle:d.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" cameras on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new s.ControllerCard({},{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"camera"}},81:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Climates",path:"climates",icon:"mdi:thermostat",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Climates",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" climates on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"climate"}},136:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Covers",path:"covers",icon:"mdi:window-open",subview:!1,controllerCardOptions:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}),n.set(this,{title:"All Covers",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","open")+" covers open"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"cover"}},964:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Fans",path:"fans",icon:"mdi:fan",subview:!1,controllerCardOptions:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}),n.set(this,{title:"All Fans",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" fans on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"fan"}},985:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HomeView:()=>h});var i,a,o,n,s,c=r(371),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(),i.add(this),a.set(this,{title:"Home",icon:"mdi:home-assistant",path:"home",subview:!1}),this.config=Object.assign(this.config,l(this,a,"f"),e)}async createViewCards(){return await Promise.all([l(this,i,"m",o).call(this),l(this,i,"m",n).call(this),l(this,i,"m",s).call(this)]).then((([e,t,r])=>{const i=c.W.strategyOptions,a=[];return e.length&&a.push({type:"custom:mushroom-chips-card",alignment:"center",chips:e}),t.length&&a.push({type:"horizontal-stack",cards:t}),c.W.strategyOptions.home_view.hidden.includes("greeting")||a.push({type:"custom:mushroom-template-card",primary:"{% set time = now().hour %} {% if (time >= 18) %} Good Evening, {{user}}! {% elif (time >= 12) %} Good Afternoon, {{user}}! {% elif (time >= 5) %} Good Morning, {{user}}! {% else %} Hello, {{user}}! {% endif %}",icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}}),i.quick_access_cards&&a.push(...i.quick_access_cards),a.push({type:"vertical-stack",cards:r}),i.extra_cards&&a.push(...i.extra_cards),a}))}}a=new WeakMap,i=new WeakSet,o=async function(){if(c.W.strategyOptions.home_view.hidden.includes("chips"))return[];const e=[],t=c.W.strategyOptions.chips,i=["light","fan","cover","switch","climate"],a=c.W.areas.map((e=>e.area_id??""));let o;const n=t?.weather_entity??c.W.entities.find((e=>e.entity_id.startsWith("weather.")&&null===e.disabled_by&&null===e.hidden_by))?.entity_id;if(n)try{o=await Promise.resolve().then(r.bind(r,977));const t=new o.WeatherChip(n);e.push(t.getChip())}catch(e){c.W.logError("An error occurred while creating the weather chip!",e)}for(let n of i)if(t?.[`${n}_count`]??1){const t=c.W.sanitizeClassName(n+"Chip");try{o=await r(837)(`./${t}`);const i=new o[t];i.setTapActionTarget({area_id:a}),e.push(i.getChip())}catch(e){c.W.logError(`An error occurred while creating the ${n} chip!`,e)}}return t?.extra_chips&&e.push(...t.extra_chips),e},n=function(){if(c.W.strategyOptions.home_view.hidden.includes("persons"))return[];const e=[];return Promise.resolve().then(r.bind(r,877)).then((t=>{for(const r of c.W.entities.filter((e=>e.entity_id.startsWith("person.")&&null==e.hidden_by&&null==e.disabled_by)))e.push(new t.PersonCard(r).getCard())})),e},s=async function(){if(c.W.strategyOptions.home_view.hidden.includes("areas"))return[];const e=[];let t=[];c.W.strategyOptions.home_view.hidden.includes("areasTitle")||e.push({type:"custom:mushroom-title-card",title:"Areas"});for(const[i,a]of c.W.areas.entries()){let o,n=c.W.strategyOptions.areas[a.area_id]?.type??c.W.strategyOptions.areas._?.type??"default";try{o=await r(175)(`./${n}`)}catch(e){o=await Promise.resolve().then(r.bind(r,396)),c.W.strategyOptions.debug&&"default"!==n&&console.error(e)}if(!c.W.strategyOptions.areas[a.area_id]?.hidden){let e={...c.W.strategyOptions.areas._,...c.W.strategyOptions.areas[a.area_id]};t.push(new o.AreaCard(a,e).getCard())}if(i===c.W.areas.length-1)for(let r=0;r{"use strict";r.r(t),r.d(t,{LightView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Lights",path:"lights",icon:"mdi:lightbulb-group",subview:!1,controllerCardOptions:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}),n.set(this,{title:"All Lights",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" lights on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"light"}},683:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Switches",path:"switches",icon:"mdi:dip-switch",subview:!1,controllerCardOptions:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}),n.set(this,{title:"All Switches",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"eq","on")+" switches on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"switch"}},610:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumView:()=>h});var i,a,o,n,s=r(371),c=r(607),d=r(1),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Vacuums",path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,controllerCardOptions:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}),n.set(this,{title:"All Vacuums",subtitle:s.W.getCountTemplate(l(i,i,"f",a),"ne","off")+" vacuums on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"vacuum"}},175:(e,t,r)=>{var i={"./AbstractCard":[976],"./AbstractCard.ts":[976],"./AreaCard":[396,179],"./AreaCard.ts":[396,179],"./BinarySensorCard":[418,179],"./BinarySensorCard.ts":[418,179],"./CameraCard":[604,179],"./CameraCard.ts":[604,179],"./ClimateCard":[782,179],"./ClimateCard.ts":[782,179],"./ControllerCard":[607],"./ControllerCard.ts":[607],"./CoverCard":[758,179],"./CoverCard.ts":[758,179],"./FanCard":[287,179],"./FanCard.ts":[287,179],"./HaAreaCard":[387,179],"./HaAreaCard.ts":[387,179],"./LightCard":[475,179],"./LightCard.ts":[475,179],"./LockCard":[696,179],"./LockCard.ts":[696,179],"./MediaPlayerCard":[499,179],"./MediaPlayerCard.ts":[499,179],"./MiscellaneousCard":[571,179],"./MiscellaneousCard.ts":[571,179],"./NumberCard":[420,179],"./NumberCard.ts":[420,179],"./PersonCard":[877,179],"./PersonCard.ts":[877,179],"./SensorCard":[642],"./SensorCard.ts":[642],"./SwitchCard":[330,179],"./SwitchCard.ts":[330,179],"./VacuumCard":[695,179],"./VacuumCard.ts":[695,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=175,e.exports=a},837:(e,t,r)=>{var i={"./AbstractChip":[370,179],"./AbstractChip.ts":[370,179],"./ClimateChip":[660,179],"./ClimateChip.ts":[660,179],"./CoverChip":[993,179],"./CoverChip.ts":[993,179],"./FanChip":[966,179],"./FanChip.ts":[966,179],"./LightChip":[95,179],"./LightChip.ts":[95,179],"./SwitchChip":[817,179],"./SwitchChip.ts":[817,179],"./WeatherChip":[977,179],"./WeatherChip.ts":[977,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=837,e.exports=a},968:(e,t,r)=>{var i={"./AbstractView":[1,179],"./AbstractView.ts":[1,179],"./CameraView":[89,179],"./CameraView.ts":[89,179],"./ClimateView":[81,179],"./ClimateView.ts":[81,179],"./CoverView":[136,179],"./CoverView.ts":[136,179],"./FanView":[964,179],"./FanView.ts":[964,179],"./HomeView":[985,179],"./HomeView.ts":[985,179],"./LightView":[144,179],"./LightView.ts":[144,179],"./SwitchView":[683,179],"./SwitchView.ts":[683,179],"./VacuumView":[610,179],"./VacuumView.ts":[610,179]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=968,e.exports=a}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.e=()=>Promise.resolve(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=r(371),t=r(642),i=r(607);class a extends HTMLTemplateElement{static async generateDashboard(t){await e.W.initialize(t);const i=t.config?.views??[];let a;for(let t of e.W.getExposedViewIds())try{const o=e.W.sanitizeClassName(t+"View");a=await r(968)(`./${o}`);const n=await new a[o](e.W.strategyOptions.views[t]).getView();n.cards?.length&&i.push(n)}catch(r){e.W.logError(`View '${t}' couldn't be loaded!`,r)}for(let t of e.W.areas)t.hidden||i.push({title:t.name,path:t.area_id??t.name,subview:!0,strategy:{type:"custom:mushroom-strategy",options:{area:t}}});return e.W.strategyOptions.extra_views&&i.push(...e.W.strategyOptions.extra_views),{views:i}}static async generateView(a){const o=e.W.getExposedDomainIds(),n=a.view.strategy?.options?.area??{},s=[...n.extra_cards??[]];let c={area_id:[n.area_id]};for(const a of o){if("default"===a)continue;const o=e.W.sanitizeClassName(a+"Card");let d=[];try{d=await r(175)(`./${o}`).then((r=>{let s=[];const d=e.W.getDeviceEntities(n,a);if("undisclosed"===n.area_id&&(c={entity_id:d.map((e=>e.entity_id))}),d.length){const l=new i.ControllerCard(c,e.W.strategyOptions.domains[a]).createCard();if("sensor"===a){const r=e.W.getStateEntities(n,"sensor"),i=[];for(const a of d){const o=r.find((e=>e.entity_id===a.entity_id));let n=e.W.strategyOptions.card_options?.[a.entity_id],s=e.W.strategyOptions.card_options?.[a.device_id??"null"];n?.hidden||s?.hidden||(o?.attributes.unit_of_measurement&&(n={type:"custom:mini-graph-card",entities:[a.entity_id],...n}),i.push(new t.SensorCard(a,n).getCard()))}return i.length&&(s.push({type:"vertical-stack",cards:i}),s.unshift(l)),s}for(const t of d){let i,a=e.W.strategyOptions.card_options?.[t.entity_id];t.device_id&&(i=e.W.strategyOptions.card_options?.[t.device_id]),a?.hidden||i?.hidden||s.push(new r[o](t,a).getCard())}if("binary_sensor"===a){const e=[];for(let t=0;te.area_id===n.area_id)).map((e=>e.id)),a=e.W.entities.filter((e=>{const r=t.includes(e.device_id??"null")||e.area_id===n.area_id,i=null===e.hidden_by&&null===e.disabled_by,a=o.includes(e.entity_id.split(".",1)[0]);return i&&!a&&r}));if(a.length){let t=[];try{t=await Promise.resolve().then(r.bind(r,571)).then((t=>{const r=[new i.ControllerCard(c,e.W.strategyOptions.domains.default).createCard()];for(const i of a){let a=e.W.strategyOptions.card_options?.[i.entity_id],o=e.W.strategyOptions.card_options?.[i.device_id??"null"];a?.hidden||o?.hidden||r.push(new t.MiscellaneousCard(i,a).getCard())}return r}))}catch(t){e.W.logError("An error occurred while creating the domain cards!",t)}s.push({type:"vertical-stack",cards:t})}}return{cards:s}}}customElements.define("ll-strategy-mushroom-strategy",a),console.info("%c Mushroom Strategy %c ".concat("v2.0.0"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file