- ${Rt("editor.code_information")}
+ ${Ft("editor.code_information")}
@@ -65,12 +65,12 @@ const oe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
slot="dropdown-content"
.selected=${e.indexOf(this._entity)}
>
- ${e.map((e=>z` ${e} `))}
+ ${e.map((e=>C` ${e} `))}
t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
- ${Rt("editor.model")}
- ${Rt("editor.model1")}
+ ${Ft("editor.model")}
+ ${Ft("editor.model1")}
- ${Rt("editor.unit")}
+ ${Ft("editor.unit")}
- ${Rt("editor.header_options")}
+ ${Ft("editor.header_options")}
- ${Rt("editor.show_name")}
+ ${Ft("editor.show_name")}
- ${Rt("editor.show_states")}
+ ${Ft("editor.show_states")}
- ${Rt("editor.show_attributes")}
+ ${Ft("editor.show_attributes")}
- ${Rt("editor.body_options")}
+ ${Ft("editor.body_options")}
- ${Rt("editor.show_toolbar")}
+ ${Ft("editor.show_toolbar")}
- ${Rt("editor.show_body")}
- ${Rt("editor.show_body1")}
+ ${Ft("editor.show_body")}
+ ${Ft("editor.show_body1")}
- ${Rt("editor.show_buttons")}
+ ${Ft("editor.show_buttons")}
- ${Rt("editor.warning")} ${Rt("editor.code_only_note")}
+ ${Ft("editor.warning")} ${Ft("editor.code_only_note")}
- `}_initialize(){void 0!==this.hass&&void 0!==this._config&&void 0!==this._helpers&&(this._initialized=!0)}async loadCardHelpers(){this._helpers=await window.loadCardHelpers()}_valueChanged(e){var t,i;if(!this._config||!this.hass)return;const o=e.target,a=null!==(i=null===(t=e.detail)||void 0===t?void 0:t.value)&&void 0!==i?i:o.value;this[`_${o.configValue}`]!==a&&(o.configValue&&(""===a?delete this._config[o.configValue]:this._config=Object.assign(Object.assign({},this._config),{[o.configValue]:void 0!==o.checked?o.checked:a})),we(this,"config-changed",{config:this._config}))}static get styles(){return n`
+ `}_initialize(){void 0!==this.hass&&void 0!==this._config&&void 0!==this._helpers&&(this._initialized=!0)}async loadCardHelpers(){this._helpers=await window.loadCardHelpers()}_valueChanged(e){var t,o;if(!this._config||!this.hass)return;const i=e.target,a=null!==(o=null===(t=e.detail)||void 0===t?void 0:t.value)&&void 0!==o?o:i.value;this[`_${i.configValue}`]!==a&&(i.configValue&&(""===a?delete this._config[i.configValue]:this._config=Object.assign(Object.assign({},this._config),{[i.configValue]:void 0!==i.checked?i.checked:a})),we(this,"config-changed",{config:this._config}))}static get styles(){return n`
.card-config paper-dropdown-menu {
width: 100%;
}
@@ -189,7 +189,7 @@ const oe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
.option ha-switch {
margin-right: 10px;
}
- `}};e([re({attribute:!1})],Ht.prototype,"hass",void 0),e([ne()],Ht.prototype,"_config",void 0),e([ne()],Ht.prototype,"_helpers",void 0),Ht=e([oe("body-miscale-card-editor")],Ht);const Lt={status:{key:"status",icon:"mdi:scale-bathroom"},problem:{key:"problem",icon:"mdi:alert"}},Vt={weight:{key:"weight",label:Rt("attributes.weight: "),unit:" kg"},impedance:{key:"impedance",label:Rt("attributes.impedance: "),unit:" ohm"},height:{key:"height",label:Rt("attributes.height: "),unit:" cm"},age:{key:"age",label:Rt("attributes.age: "),unit:Rt("unit. years")},gender:{key:"gender",label:Rt("attributes.gender: ")}},jt={weight:{key:"weight",label:Rt("attributes.weight: "),unit:" lbs"},impedance:{key:"impedance",label:Rt("attributes.impedance: "),unit:" ohm"},height:{key:"height",label:Rt("attributes.height: "),unit:" cm"},age:{key:"age",label:Rt("attributes.age: "),unit:Rt("unit. years")},gender:{key:"gender",label:Rt("attributes.gender: ")}},Gt={bmi:{key:"bmi",label:Rt("body.bmi"),icon:"/local/images/bodyscoreIcon/bmi.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:18.5,color:"blue"},{from:18.51,to:25,color:"green"},{from:25.01,to:28,color:"orange"},{from:28.01,to:32,color:"orangered"},{from:32.01,to:1/0,color:"red"}],target:21.75},bmi_label:{key:"bmi_label",label:Rt("body.bmi_label"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},visceral_fat:{key:"visceral_fat",label:Rt("body.visceral_fat"),icon:"/local/images/bodyscoreIcon/visceral_fat.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:20,min:0,severity:[{from:0,to:10,color:"green"},{from:10.01,to:15,color:"orange"},{from:15.01,to:1/0,color:"orangered"}],target:12.5},body_fat:{key:"body_fat",label:Rt("body.body_fat"),icon:"/local/images/bodyscoreIcon/body_fat.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:12,color:"blue"},{from:12.01,to:18,color:"royalblue"},{from:18.01,to:23,color:"green"},{from:23.01,to:28,color:"orange"},{from:28.01,to:1/0,color:"orangered"}],target:20.5},protein:{key:"protein",label:Rt("body.protein"),icon:"/local/images/bodyscoreIcon/protein.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:32,min:0,severity:[{from:0,to:16,color:"orangered"},{from:16.01,to:20,color:"green"},{from:20.01,to:1/0,color:"darkgreen"}],target:18},water:{key:"water",label:Rt("body.water"),icon:"/local/images/bodyscoreIcon/water.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:80,min:0,severity:[{from:0,to:55,color:"orangered"},{from:55.01,to:65.1,color:"green"},{from:65.11,to:1/0,color:"darkgreen"}],target:60},muscle_mass:{key:"muscle_mass",label:Rt("body.muscle_mass"),icon:"/local/images/bodyscoreIcon/muscle_mass.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:100,min:0,severity:[{from:0,to:49.4,color:"orangered"},{from:49.41,to:59.5,color:"green"},{from:59.51,to:1/0,color:"darkgreen"}],target:54.45},bone_mass:{key:"bone_mass",label:Rt("body.bone_mass"),icon:"/local/images/bodyscoreIcon/bone_mass.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:8,min:0,severity:[{from:0,to:2,color:"orangered"},{from:2.01,to:4.2,color:"green"},{from:4.21,to:1/0,color:"darkgreen"}],target:3.1},weight:{key:"weight",label:Rt("body.weight"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:130,min:0,severity:[{from:0,to:57.3,color:"blue"},{from:57.31,to:77.4,color:"green"},{from:77.41,to:86.7,color:"orange"},{from:86.71,to:99.1,color:"orangered"},{from:99.11,to:1/0,color:"red"}],target:67.35},ideal:{key:"ideal",label:Rt("body.ideal"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:130,min:0,severity:[{from:0,to:57.3,color:"blue"},{from:57.31,to:77.4,color:"green"},{from:77.41,to:86.7,color:"orange"},{from:86.71,to:99.1,color:"orangered"},{from:99.11,to:1/0,color:"red"}],target:67.35},basal_metabolism:{key:"basal_metabolism",label:Rt("body.basal_metabolism"),icon:"/local/images/bodyscoreIcon/basal_metabolism.png",unit:" kcal",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:3e3,min:0,severity:[{from:0,to:1530,color:"orangered"},{from:1530.01,to:1/0,color:"green"}],target:1530},body_type:{key:"body_type",label:Rt("body.body_type"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},metabolic_age:{key:"metabolic_age",label:Rt("body.metabolic_age"),icon:"/local/images/bodyscoreIcon/metabolic_age.png",unit:Rt("unit. years"),direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:"",min:"",severity:"",target:""}},Wt={bmi:{key:"bmi",label:Rt("body.bmi"),icon:"/local/images/bodyscoreIcon/bmi.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:18.5,color:"blue"},{from:18.51,to:25,color:"green"},{from:25.01,to:28,color:"orange"},{from:28.01,to:32,color:"orangered"},{from:32.01,to:1/0,color:"red"}],target:21.75},bmi_label:{key:"bmi_label",label:Rt("body.bmi_label"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},visceral_fat:{key:"visceral_fat",label:Rt("body.visceral_fat"),icon:"/local/images/bodyscoreIcon/visceral_fat.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:20,min:0,severity:[{from:0,to:10,color:"green"},{from:10.01,to:15,color:"orange"},{from:15.01,to:1/0,color:"orangered"}],target:12.5},body_fat:{key:"body_fat",label:Rt("body.body_fat"),icon:"/local/images/bodyscoreIcon/body_fat.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:12,color:"blue"},{from:12.01,to:18,color:"royalblue"},{from:18.01,to:23,color:"green"},{from:23.01,to:28,color:"orange"},{from:28.01,to:1/0,color:"orangered"}],target:20.5},protein:{key:"protein",label:Rt("body.protein"),icon:"/local/images/bodyscoreIcon/protein.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:32,min:0,severity:[{from:0,to:16,color:"orangered"},{from:16.01,to:20,color:"green"},{from:20.01,to:1/0,color:"darkgreen"}],target:18},water:{key:"water",label:Rt("body.water"),icon:"/local/images/bodyscoreIcon/water.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:80,min:0,severity:[{from:0,to:55,color:"orangered"},{from:55.01,to:65.1,color:"green"},{from:65.11,to:1/0,color:"darkgreen"}],target:60},muscle_mass:{key:"muscle_mass",label:Rt("body.muscle_mass"),icon:"/local/images/bodyscoreIcon/muscle_mass.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:220.5,min:0,severity:[{from:0,to:108.9,color:"orangered"},{from:109,to:131.2,color:"green"},{from:131.3,to:1/0,color:"darkgreen"}],target:120.1},bone_mass:{key:"bone_mass",label:Rt("body.bone_mass"),icon:"/local/images/bodyscoreIcon/bone_mass.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:17.6,min:0,severity:[{from:0,to:4.4,color:"orangered"},{from:4.5,to:9.3,color:"green"},{from:9.4,to:1/0,color:"darkgreen"}],target:6.9},weight:{key:"weight",label:Rt("body.weight"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:286.6,min:0,severity:[{from:0,to:126.3,color:"blue"},{from:126.4,to:170.6,color:"green"},{from:170.7,to:191.1,color:"orange"},{from:191.2,to:218.5,color:"orangered"},{from:218.6,to:1/0,color:"red"}],target:148.5},ideal:{key:"ideal",label:Rt("body.ideal"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:286.6,min:0,severity:[{from:0,to:126.3,color:"blue"},{from:126.4,to:170.6,color:"green"},{from:170.7,to:191.1,color:"orange"},{from:191.2,to:218.5,color:"orangered"},{from:218.6,to:1/0,color:"red"}],target:148.5},basal_metabolism:{key:"basal_metabolism",label:Rt("body.basal_metabolism"),icon:"/local/images/bodyscoreIcon/basal_metabolism.png",unit:" kcal",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:3e3,min:0,severity:[{from:0,to:1530,color:"orangered"},{from:1530.01,to:1/0,color:"green"}],target:1530},body_type:{key:"body_type",label:Rt("body.body_type"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},metabolic_age:{key:"metabolic_age",label:Rt("body.metabolic_age"),icon:"/local/images/bodyscoreIcon/metabolic_age.png",unit:Rt("unit. years"),direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:"",min:"",severity:"",target:""}},Kt={user1:{show:!1,label:"User1",icon:"mdi:alpha-u-circle"},user2:{show:!1,label:"User2",icon:"mdi:alpha-u-circle"},user3:{show:!1,label:"User3",icon:"mdi:alpha-u-circle"},user4:{show:!1,label:"User4",icon:"mdi:alpha-u-circle"},user5:{show:!1,label:"User5",icon:"mdi:alpha-u-circle"}},Zt={convertkgtolb:e=>Math.round(2.20462*Number(e)*10)/10},qt={false:{states:{status:{key:"state"}},attributes_kg:{weight:{key:"weight"},impedance:!1,height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},attributes_lb:{weight:{key:"weight",compute:Zt.convertkgtolb},impedance:!1,height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},body_kg:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:!1,protein:!1,water:!1,muscle_mass:!1,bone_mass:!1,weight:{key:"weight"},ideal:{key:"ideal"},basal_metabolism:{key:"basal_metabolism"},body_type:!1,metabolic_age:!1},body_lb:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:!1,protein:!1,water:!1,muscle_mass:!1,bone_mass:!1,weight:{key:"weight",compute:Zt.convertkgtolb},ideal:{key:"ideal",compute:Zt.convertkgtolb},basal_metabolism:{key:"basal_metabolism"},body_type:!1,metabolic_age:!1}},true:{states:{status:{key:"state"}},attributes_kg:{weight:{key:"weight"},impedance:{key:"impedance"},height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},attributes_lb:{weight:{key:"weight",compute:Zt.convertkgtolb},impedance:{key:"impedance"},height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},body_kg:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:{key:"body_fat"},protein:{key:"protein"},water:{key:"water"},muscle_mass:{key:"muscle_mass"},bone_mass:{key:"bone_mass"},weight:{key:"weight"},ideal:{key:"ideal"},basal_metabolism:{key:"basal_metabolism"},body_type:{key:"body_type"},metabolic_age:{key:"metabolic_age"}},body_lb:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:{key:"body_fat"},protein:{key:"protein"},water:{key:"water"},muscle_mass:{key:"muscle_mass",compute:Zt.convertkgtolb},bone_mass:{key:"bone_mass",compute:Zt.convertkgtolb},weight:{key:"weight",compute:Zt.convertkgtolb},ideal:{key:"ideal",compute:Zt.convertkgtolb},basal_metabolism:{key:"basal_metabolism"},body_type:{key:"body_type"},metabolic_age:{key:"metabolic_age"}}}},Ft=n`
+ `}};e([re({attribute:!1})],Jt.prototype,"hass",void 0),e([ne()],Jt.prototype,"_config",void 0),e([ne()],Jt.prototype,"_helpers",void 0),Jt=e([ie("body-miscale-card-editor")],Jt);const Yt={status:{key:"status",icon:"mdi:scale-bathroom"},problem:{key:"problem",icon:"mdi:alert"}},Qt={weight:{key:"weight",label:Ft("attributes.weight: "),unit:" kg"},impedance:{key:"impedance",label:Ft("attributes.impedance: "),unit:" ohm"},height:{key:"height",label:Ft("attributes.height: "),unit:" cm"},age:{key:"age",label:Ft("attributes.age: "),unit:Ft("unit. years")},gender:{key:"gender",label:Ft("attributes.gender: ")}},Xt={weight:{key:"weight",label:Ft("attributes.weight: "),unit:" lbs"},impedance:{key:"impedance",label:Ft("attributes.impedance: "),unit:" ohm"},height:{key:"height",label:Ft("attributes.height: "),unit:" cm"},age:{key:"age",label:Ft("attributes.age: "),unit:Ft("unit. years")},gender:{key:"gender",label:Ft("attributes.gender: ")}},eo={bmi:{key:"bmi",label:Ft("body.bmi"),icon:"/local/images/bodyscoreIcon/bmi.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:18.5,color:"blue"},{from:18.51,to:25,color:"green"},{from:25.01,to:28,color:"orange"},{from:28.01,to:32,color:"orangered"},{from:32.01,to:1/0,color:"red"}],target:21.75},bmi_label:{key:"bmi_label",label:Ft("body.bmi_label"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},visceral_fat:{key:"visceral_fat",label:Ft("body.visceral_fat"),icon:"/local/images/bodyscoreIcon/visceral_fat.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:20,min:0,severity:[{from:0,to:10,color:"green"},{from:10.01,to:15,color:"orange"},{from:15.01,to:1/0,color:"orangered"}],target:12.5},body_fat:{key:"body_fat",label:Ft("body.body_fat"),icon:"/local/images/bodyscoreIcon/body_fat.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:12,color:"blue"},{from:12.01,to:18,color:"royalblue"},{from:18.01,to:23,color:"green"},{from:23.01,to:28,color:"orange"},{from:28.01,to:1/0,color:"orangered"}],target:20.5},protein:{key:"protein",label:Ft("body.protein"),icon:"/local/images/bodyscoreIcon/protein.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:32,min:0,severity:[{from:0,to:16,color:"orangered"},{from:16.01,to:20,color:"green"},{from:20.01,to:1/0,color:"darkgreen"}],target:18},water:{key:"water",label:Ft("body.water"),icon:"/local/images/bodyscoreIcon/water.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:80,min:0,severity:[{from:0,to:55,color:"orangered"},{from:55.01,to:65.1,color:"green"},{from:65.11,to:1/0,color:"darkgreen"}],target:60},muscle_mass:{key:"muscle_mass",label:Ft("body.muscle_mass"),icon:"/local/images/bodyscoreIcon/muscle_mass.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:100,min:0,severity:[{from:0,to:49.4,color:"orangered"},{from:49.41,to:59.5,color:"green"},{from:59.51,to:1/0,color:"darkgreen"}],target:54.45},bone_mass:{key:"bone_mass",label:Ft("body.bone_mass"),icon:"/local/images/bodyscoreIcon/bone_mass.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:8,min:0,severity:[{from:0,to:2,color:"orangered"},{from:2.01,to:4.2,color:"green"},{from:4.21,to:1/0,color:"darkgreen"}],target:3.1},weight:{key:"weight",label:Ft("body.weight"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:130,min:0,severity:[{from:0,to:57.3,color:"blue"},{from:57.31,to:77.4,color:"green"},{from:77.41,to:86.7,color:"orange"},{from:86.71,to:99.1,color:"orangered"},{from:99.11,to:1/0,color:"red"}],target:67.35},ideal:{key:"ideal",label:Ft("body.ideal"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" kg",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:130,min:0,severity:[{from:0,to:57.3,color:"blue"},{from:57.31,to:77.4,color:"green"},{from:77.41,to:86.7,color:"orange"},{from:86.71,to:99.1,color:"orangered"},{from:99.11,to:1/0,color:"red"}],target:67.35},basal_metabolism:{key:"basal_metabolism",label:Ft("body.basal_metabolism"),icon:"/local/images/bodyscoreIcon/basal_metabolism.png",unit:" kcal",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:3e3,min:0,severity:[{from:0,to:1530,color:"orangered"},{from:1530.01,to:1/0,color:"green"}],target:1530},body_type:{key:"body_type",label:Ft("body.body_type"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},metabolic_age:{key:"metabolic_age",label:Ft("body.metabolic_age"),icon:"/local/images/bodyscoreIcon/metabolic_age.png",unit:Ft("unit. years"),direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:"",min:"",severity:"",target:""}},to={bmi:{key:"bmi",label:Ft("body.bmi"),icon:"/local/images/bodyscoreIcon/bmi.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:18.5,color:"blue"},{from:18.51,to:25,color:"green"},{from:25.01,to:28,color:"orange"},{from:28.01,to:32,color:"orangered"},{from:32.01,to:1/0,color:"red"}],target:21.75},bmi_label:{key:"bmi_label",label:Ft("body.bmi_label"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},visceral_fat:{key:"visceral_fat",label:Ft("body.visceral_fat"),icon:"/local/images/bodyscoreIcon/visceral_fat.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:20,min:0,severity:[{from:0,to:10,color:"green"},{from:10.01,to:15,color:"orange"},{from:15.01,to:1/0,color:"orangered"}],target:12.5},body_fat:{key:"body_fat",label:Ft("body.body_fat"),icon:"/local/images/bodyscoreIcon/body_fat.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:40,min:0,severity:[{from:0,to:12,color:"blue"},{from:12.01,to:18,color:"royalblue"},{from:18.01,to:23,color:"green"},{from:23.01,to:28,color:"orange"},{from:28.01,to:1/0,color:"orangered"}],target:20.5},protein:{key:"protein",label:Ft("body.protein"),icon:"/local/images/bodyscoreIcon/protein.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:32,min:0,severity:[{from:0,to:16,color:"orangered"},{from:16.01,to:20,color:"green"},{from:20.01,to:1/0,color:"darkgreen"}],target:18},water:{key:"water",label:Ft("body.water"),icon:"/local/images/bodyscoreIcon/water.png",unit:" %",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:80,min:0,severity:[{from:0,to:55,color:"orangered"},{from:55.01,to:65.1,color:"green"},{from:65.11,to:1/0,color:"darkgreen"}],target:60},muscle_mass:{key:"muscle_mass",label:Ft("body.muscle_mass"),icon:"/local/images/bodyscoreIcon/muscle_mass.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:220.5,min:0,severity:[{from:0,to:108.9,color:"orangered"},{from:109,to:131.2,color:"green"},{from:131.3,to:1/0,color:"darkgreen"}],target:120.1},bone_mass:{key:"bone_mass",label:Ft("body.bone_mass"),icon:"/local/images/bodyscoreIcon/bone_mass.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:17.6,min:0,severity:[{from:0,to:4.4,color:"orangered"},{from:4.5,to:9.3,color:"green"},{from:9.4,to:1/0,color:"darkgreen"}],target:6.9},weight:{key:"weight",label:Ft("body.weight"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:286.6,min:0,severity:[{from:0,to:126.3,color:"blue"},{from:126.4,to:170.6,color:"green"},{from:170.7,to:191.1,color:"orange"},{from:191.2,to:218.5,color:"orangered"},{from:218.6,to:1/0,color:"red"}],target:148.5},ideal:{key:"ideal",label:Ft("body.ideal"),icon:"/local/images/bodyscoreIcon/ideal.png",unit:" lbs",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:286.6,min:0,severity:[{from:0,to:126.3,color:"blue"},{from:126.4,to:170.6,color:"green"},{from:170.7,to:191.1,color:"orange"},{from:191.2,to:218.5,color:"orangered"},{from:218.6,to:1/0,color:"red"}],target:148.5},basal_metabolism:{key:"basal_metabolism",label:Ft("body.basal_metabolism"),icon:"/local/images/bodyscoreIcon/basal_metabolism.png",unit:" kcal",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",indicator:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:3e3,min:0,severity:[{from:0,to:1530,color:"orangered"},{from:1530.01,to:1/0,color:"green"}],target:1530},body_type:{key:"body_type",label:Ft("body.body_type"),icon:"/local/images/bodyscoreIcon/body_type.png",direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))"},metabolic_age:{key:"metabolic_age",label:Ft("body.metabolic_age"),icon:"/local/images/bodyscoreIcon/metabolic_age.png",unit:Ft("unit. years"),direction:"right",height:"30px",width:"100%",positions:{icon:"outside",name:"inside",minmax:"off",value:"inside"},color:"var(--score-card-color, var(--ha-card-background))",max:"",min:"",severity:"",target:""}},oo={user1:{show:!1,label:"User1",icon:"mdi:alpha-u-circle"},user2:{show:!1,label:"User2",icon:"mdi:alpha-u-circle"},user3:{show:!1,label:"User3",icon:"mdi:alpha-u-circle"},user4:{show:!1,label:"User4",icon:"mdi:alpha-u-circle"},user5:{show:!1,label:"User5",icon:"mdi:alpha-u-circle"}},io={convertkgtolb:e=>Math.round(2.20462*Number(e)*10)/10},ao={false:{states:{status:{key:"state"}},attributes_kg:{weight:{key:"weight"},impedance:!1,height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},attributes_lb:{weight:{key:"weight",compute:io.convertkgtolb},impedance:!1,height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},body_kg:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:!1,protein:!1,water:!1,muscle_mass:!1,bone_mass:!1,weight:{key:"weight"},ideal:{key:"ideal"},basal_metabolism:{key:"basal_metabolism"},body_type:!1,metabolic_age:!1},body_lb:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:!1,protein:!1,water:!1,muscle_mass:!1,bone_mass:!1,weight:{key:"weight",compute:io.convertkgtolb},ideal:{key:"ideal",compute:io.convertkgtolb},basal_metabolism:{key:"basal_metabolism"},body_type:!1,metabolic_age:!1}},true:{states:{status:{key:"state"}},attributes_kg:{weight:{key:"weight"},impedance:{key:"impedance"},height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},attributes_lb:{weight:{key:"weight",compute:io.convertkgtolb},impedance:{key:"impedance"},height:{key:"height"},age:{key:"age"},gender:{key:"gender"}},body_kg:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:{key:"body_fat"},protein:{key:"protein"},water:{key:"water"},muscle_mass:{key:"muscle_mass"},bone_mass:{key:"bone_mass"},weight:{key:"weight"},ideal:{key:"ideal"},basal_metabolism:{key:"basal_metabolism"},body_type:{key:"body_type"},metabolic_age:{key:"metabolic_age"}},body_lb:{bmi:{key:"bmi"},bmi_label:{key:"bmi_label"},visceral_fat:{key:"visceral_fat"},body_fat:{key:"body_fat"},protein:{key:"protein"},water:{key:"water"},muscle_mass:{key:"muscle_mass",compute:io.convertkgtolb},bone_mass:{key:"bone_mass",compute:io.convertkgtolb},weight:{key:"weight",compute:io.convertkgtolb},ideal:{key:"ideal",compute:io.convertkgtolb},basal_metabolism:{key:"basal_metabolism"},body_type:{key:"body_type"},metabolic_age:{key:"metabolic_age"}}}},ro=n`
ha-card {
display: flex;
flex-direction: column;
@@ -461,7 +461,7 @@ const oe=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t
.value-direction-up {
margin-top: auto;
}
-`;function Jt(...e){const t=e=>e&&"object"==typeof e,i={};return e.filter((e=>t(e))).forEach((e=>{Object.keys(e).forEach((o=>{const a=i[o],r=e[o];Array.isArray(a)&&Array.isArray(r)?i[o]=a.concat(r):t(a)&&t(r)?i[o]=Jt(Object.assign({},a),r):i[o]=r}))})),i}var Yt;!function(e){e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.space_comma="space_comma",e.none="none"}(Yt||(Yt={}));const Qt=(e,t,i)=>{let o;switch(null==t?void 0:t.number_format){case Yt.comma_decimal:o=["en-US","en"];break;case Yt.decimal_comma:o=["de","es","it"];break;case Yt.space_comma:o=["fr","sv","cs"];break;case Yt.system:o=void 0;break;default:o=null==t?void 0:t.language}if(Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},!Number.isNaN(Number(e))&&Intl&&(null==t?void 0:t.number_format)!==Yt.none)try{return new Intl.NumberFormat(o,Xt(e,i)).format(Number(e))}catch(t){return console.error(t),new Intl.NumberFormat(void 0,Xt(e,i)).format(Number(e))}return e.toString()},Xt=(e,t)=>{const i=t||{};if("string"!=typeof e)return i;if(!t||!t.minimumFractionDigits&&!t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;i.minimumFractionDigits=t,i.maximumFractionDigits=t}return i};console.info(`%c Body-miscale-card \n%c ${Rt("common.version")} 5.6.7 `,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"body-miscale-card",name:Rt("common.name"),description:Rt("common.description")});let ei=class extends ie{constructor(){super(...arguments),this._configArray=[],this.open=!1}static async getConfigElement(){return document.createElement("body-miscale-card-editor")}static getStubConfig(){return{}}getCardSize(){return this.config.show_name&&this.config.show_buttons?4:this.config.show_name||this.config.show_buttons?3:2}setConfig(e){if(!e.entity)throw new Error(Rt("error.missing_entity"));if("bodymiscale"!==e.entity.split(".")[0])throw new Error(Rt("error.missing_entity_bodymiscale"));if(e.model&&!(e.model in qt))throw new Error(Rt("error.missing_model"));const t=qt[e.model]||qt.false;this.config=Object.assign(Object.assign({name:e.name,show_name:e.show_name,show_states:e.show_states,show_attributes:e.show_attributes,show_body:e.show_body,show_buttons:e.show_buttons,show_toolbar:e.show_toolbar},e),{states:Jt(Lt,t.states,e.states),attributes:e.unit?Jt(jt,t.attributes_lb,e.attributes):Jt(Vt,t.attributes_kg,e.attributes),body:e.unit?Jt(Wt,t.body_lb,e.body):Jt(Gt,t.body_kg,e.body),buttons:Jt(Kt,t.buttons,e.buttons),direction:"right",styles:{background:e.image?`background-image: url('${e.image}'); color: white; text-shadow: 0 0 10px black;`:"",icon:`color: ${e.image?"white":"var(--paper-item-icon-color)"};`,iconbody:"background-color: white;",content:`padding: ${!1!==e.name?"8px":"16px"} ${!1!==e.buttons?"8px":"16px"};`}}),this.open=this.open||this.config.open}shouldUpdate(e){return function(e,t,i){if(t.has("config")||i)return!0;if(e.config.entity){var o=t.get("hass");return!o||o.states[e.config.entity]!==e.hass.states[e.config.entity]}return!1}(this,e,!1)}toggle(e){e&&e.stopPropagation(),this.open=!this.open}_customEvent(e){e.detail.fold_row&&this.toggle(e)}render(){if(!this.hass||!this.config)return z``;const e=this.hass.states[this.config.entity];return e?z`
+ `}renderName(e){return this.config.show_name?C`
${this.config.name||e.attributes.friendly_name}
`:C``}renderState(e){if(!this.config.show_states)return C``;const t=this.hass.states[this.config.entity],o=e&&e.key in t.attributes,i=e&&e.key in t,a=o?t.attributes[e.key]:i?t[e.key]:this.hass.localize("state.default.unavailable"),r=lo(a,this.hass.locale),n=C`
${e.icon&&this.renderIcon(e)}
- ${(e.label||"")+(Rt(`states.${a}`)||r)+(e.unit||"")}
+ ${(e.label||"")+(Ft(`states.${a}`)||r)+(e.unit||"")}
-
`;return`${e.key}_list`in t.attributes&&(i||o)?this.renderDropdown(n,e.key):n}renderAttribute(e){if(!this.config.show_attributes)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Qt(r,this.hass.locale),s=z`
- ${e.icon&&this.renderIcon(e)}${(e.label||"")+(Rt(`attributes_value.${r}`)||n)+(e.unit||"")}
-
`;return`${e.key}_list`in t.attributes&&(o||a)?this.renderDropdown(s,e.key):s}renderBody(e){if(!this.config.show_body)return z``;const t=this.hass.states[this.config.entity],i=e.compute||(e=>e),o=e&&e.key in t.attributes,a=e&&e.key in t,r=o?i(t.attributes[e.key]):a?i(t[e.key]):this.hass.localize("state.default.unavailable"),n=Qt(r,this.hass.locale);let s=30;e.height&&(s=e.height);let l,c,d,h,m,b,u,g,p="stretch",_="0px 0px 0px 13px",f="right",v="row",y="left",w="height: 100%; width: 2px;";switch(e.direction){case"right":f="right",y="left";break;case"up":_="0px",f="top",v="column-reverse",y="bottom",w="height: 2px; width: 100%;"}switch(e.positions.icon){case"outside":l=z`
${e.icon&&this.renderIconbody(e)} `;break;case"inside":c=z`
${e.icon&&this.renderIconbody(e)} `,_="0px";break;case"off":_="0px"}switch(e.positions.name){case"outside":d=z`
+
`;return`${e.key}_list`in t.attributes&&(o||i)?this.renderDropdown(n,e.key):n}renderAttribute(e){if(!this.config.show_attributes)return C``;const t=this.hass.states[this.config.entity],o=e.compute||(e=>e),i=e&&e.key in t.attributes,a=e&&e.key in t,r=i?o(t.attributes[e.key]):a?o(t[e.key]):this.hass.localize("state.default.unavailable"),n=lo(r,this.hass.locale),s=C`
+ ${e.icon&&this.renderIcon(e)}${(e.label||"")+(Ft(`attributes_value.${r}`)||n)+(e.unit||"")}
+
`;return`${e.key}_list`in t.attributes&&(i||a)?this.renderDropdown(s,e.key):s}renderBody(e){if(!this.config.show_body)return C``;const t=this.hass.states[this.config.entity],o=e.compute||(e=>e),i=e&&e.key in t.attributes,a=e&&e.key in t,r=i?o(t.attributes[e.key]):a?o(t[e.key]):this.hass.localize("state.default.unavailable"),n=lo(r,this.hass.locale);let s=30;e.height&&(s=e.height);let l,c,d,h,b,m,u,g,p="stretch",_="0px 0px 0px 13px",v="right",f="row",y="left",w="height: 100%; width: 2px;";switch(e.direction){case"right":v="right",y="left";break;case"up":_="0px",v="top",f="column-reverse",y="bottom",w="height: 2px; width: 100%;"}switch(e.positions.icon){case"outside":l=C`