UNPKG

iobroker.lovelace

Version:

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

22 lines 91.3 kB
export const __rspack_esm_id=61023;export const __rspack_esm_ids=[61023];export const __webpack_modules__={36312(t,e,i){i.d(e,{x:()=>a});i(74423);const a=(t,e)=>t&&t.components.includes(e)},62384(t,e,i){i.d(e,{v:()=>a});i(74423);const a=(t,e,i,a)=>{const[s,o,r]=t.split(".",3);return Number(s)>e||Number(s)===e&&(void 0===a?Number(o)>=i:Number(o)>i)||void 0!==a&&Number(s)===e&&Number(o)===i&&Number(r)>=a}},46190(t,e,i){i.d(e,{FD:()=>l,Is:()=>a,JF:()=>s,gt:()=>o,jj:()=>n,oL:()=>d,yd:()=>r});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"],s=["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"],o=["assist_satellite","conversation","stt","tts"],r=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],n=["closed","locked","off"],l=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),d=new Set(["camera","image","media_player"])},93421(t,e,i){i.d(e,{IW:()=>c,dH:()=>d,fI:()=>l});i(44114);var a=i(35211),s=i(22792),o=i(32172);const r=(t,e)=>{let i=t;for(const t of e){if(null==i)return;i=i[t]}return i},n=(t,e,i)=>{const s=(0,o.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),r=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),r(t,e)}},l=t=>n(s.iN,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),d=t=>n(s.X1,t.entityIdPath[0],function(e){const i=r(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),c=()=>n(s.D5,void 0,({localize:t})=>t)},32172(t,e,i){i.d(e,{p:()=>a});i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);function a(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),s=e;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,e)=>s._transformers.set(e,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=s._watching.get(t);e||(e=new Set,s._watching.set(t,e)),e.add(i)});const o=Object.getOwnPropertyDescriptor(e,i);let r;if(void 0===o)r={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=o.set;r={...o,set(e){const i=this[`__transform_${a}`],s=this._transformers.get(a);this[`__transform_${a}`]=s?s.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,i),t?.call(this,e)}}}Object.defineProperty(e,i,r)}}},65522(t,e,i){i.d(e,{A:()=>a});const a=t=>t.name?.trim()},37981(t,e,i){i.d(e,{xn:()=>o,T:()=>r,Kh:()=>l});i(18111),i(22489),i(61701);var a=i(22786);i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var s=i(28978);const o=t=>(t.name_by_user||t.name)?.trim(),r=(t,e,i,a)=>o(t)||a&&n(i,a)||e("ui.panel.config.devices.unnamed_device",{type:e(`ui.panel.config.devices.type.${t.entry_type||"device"}`)}),n=(t,e)=>{for(const i of e||[]){const e=t["string"==typeof i?i:i.entity_id];if(e)return(0,s.u)(e)}},l=(0,a.A)(t=>function(t){const e=new Set,i=new Set;for(const a of t)i.has(a)?e.add(a):i.add(a);return e}(Object.values(t).map(t=>o(t)).filter(t=>void 0!==t)))},81816(t,e,i){i.d(e,{aH:()=>r,cx:()=>n,es:()=>l});var a=i(37981),s=i(28978),o=i(79461);const r=(t,e,i)=>{const a=e[t.entity_id];return a?n(a,i):(0,s.u)(t)},n=(t,e,i)=>{const r=t.name||("original_name"in t&&null!=t.original_name?String(t.original_name):void 0),n=t.device_id?e[t.device_id]:void 0;if(!n)return r||(i?(0,s.u)(i):void 0);const l=(0,a.xn)(n);return l!==r?l&&r&&(0,o.p)(r,l)||r:void 0},l=(t,e,i)=>!r(t,e,i)},74705(t,e,i){i.d(e,{Bj:()=>u,Cf:()=>p,uU:()=>h});i(18111),i(81148),i(22489),i(61701),i(13579);if(66649!=i.j)var a=i(44537);var s=i(15638),o=i(65522),r=i(37981),n=i(81816),l=i(55931);if(66649!=i.j)var d=i(28978);var c=i(28455);const h=(t,e,i,s,o,r,l)=>{if("string"==typeof e)return e;if(!e)return(0,d.u)(t);let c=(0,a.e)(e);const h=l?.separator??" ";if(c.every(t=>"text"===t.type))return c.map(t=>t.text).join(h);if((0,n.es)(t,i,s)){c.some(t=>"device"===t.type)||(c=c.map(t=>"entity"===t.type?{type:"device"}:t))}const u=p(t,c,i,s,o,r);return 1===u.length?u[0]||"":u.filter(t=>t).join(h)},p=(t,e,i,a,s,d)=>{const{device:h,area:p,floor:u}=(0,c.ln)(t,i,a,s,d);return e.map(e=>{switch(e.type){case"entity":return(0,n.aH)(t,i,a);case"device":return h?(0,r.xn)(h):void 0;case"area":return p?(0,o.A)(p):void 0;case"floor":return u?(0,l.X)(u):void 0;case"text":return e.text;default:return""}})},u=(t,e)=>{const[i,a,o]=p(e,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),r=(0,s.qC)(t.language,t.translationMetadata.translations);return{primary:i||a||e.entity_id,secondary:[o,i?a:void 0].filter(Boolean).join(r?" ◂ ":" ▸ ")||void 0}}},68246(t,e,i){i.d(e,{Y:()=>a});const a=t=>t.slice(t.indexOf(".")+1)},69093(t,e,i){i.d(e,{t:()=>s});var a=i(71727);const s=t=>(0,a.m)(t.entity_id)},28978(t,e,i){i.d(e,{_:()=>s,u:()=>o});var a=i(68246);const s=(t,e)=>void 0===e.friendly_name?(0,a.Y)(t).replace(/_/g," "):(e.friendly_name??"").toString(),o=t=>s(t.entity_id,t.attributes)},28455(t,e,i){i.d(e,{EX:()=>s,jI:()=>o,ln:()=>a});const a=(t,e,i,a,s)=>{const r=e[t.entity_id];return r?o(r,e,i,a,s):{entity:null,device:null,area:null,floor:null}},s=(t,e,i)=>{const a=e[t];if(!a)return;const s=a.device_id,o=s?i[s]:void 0;return a.area_id||o?.area_id||void 0},o=(t,e,i,a,s)=>{const o=e[t.entity_id],r=t?.device_id,n=r?i[r]:void 0,l=t?.area_id||n?.area_id,d=l?a[l]:void 0,c=d?.floor_id;return{entity:o,device:n||null,area:d||null,floor:(c?s[c]:void 0)||null}}},52658(t,e,i){i.d(e,{ZK:()=>p,gf:()=>h,mT:()=>g,Se:()=>c,mg:()=>u});i(44114),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(22675),s=i(68287),o=i(86030),r=i(80880);var n=i(71727),l=i(47129);const d=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater","weather"]),c=(t,e)=>{if((void 0!==e?e:t?.state)===a.Hh)return"var(--state-unavailable-color)";const i=u(t,e);return i?(0,o.B)(i):void 0},h=(t,e,i)=>{const a=void 0!==i?i:e.state,s=(0,l.a)(e,i);return p(t,e.attributes.device_class,a,s)},p=(t,e,i,a)=>{const s=[],o=(0,r.Y)(i,"_"),n=a?"active":"inactive";return e&&s.push(`--state-${t}-${e}-${o}-color`),s.push(`--state-${t}-${o}-color`,`--state-${t}-${n}-color`,`--state-${n}-color`),s},u=(t,e)=>{const i=void 0!==e?e:t?.state,a=(0,n.m)(t.entity_id),o=t.attributes.device_class;if("sensor"===a&&"battery"===o){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(i);if(t)return[t]}if("group"===a){const i=(0,s.z)(t);if(i&&d.has(i))return h(i,t,e)}if(d.has(a))return h(a,t,e)},g=t=>{if(t.attributes.brightness&&"plant"!==(0,n.m)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},79461(t,e,i){i.d(e,{p:()=>s});const a=[" ",": "," - "],s=(t,e)=>{const i=t.toLowerCase(),s=e.toLowerCase();for(const e of a){const a=`${s}${e}`;if(i.startsWith(a)){const e=t.substring(a.length);if(e.length)return o(e.substr(0,e.indexOf(" ")))?e:e[0].toUpperCase()+e.slice(1)}}},o=t=>t.toLowerCase()!==t},82286(t,e,i){i.d(e,{$:()=>a});const a=(t,e)=>s(t.attributes,e),s=(t,e)=>0!==(t.supported_features&e)},78649(t,e,i){i.d(e,{n:()=>s});const a=/^(\w+)\.(\w+)$/,s=t=>a.test(t)},20058(t,e,i){i.a(t,async function(t,a){try{i.d(e,{QL:()=>h,ZQ:()=>p,ZV:()=>c,ty:()=>l,x:()=>n});var s=i(74487),o=(i(74423),i(18111),i(61701),i(46927)),r=t([s]);s=(r.then?(await r)():r)[0];const n=t=>l(t.attributes),l=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),d=t=>{switch(t.number_format){case o.jG.comma_decimal:return["en-US","en"];case o.jG.decimal_comma:return["de","es","it"];case o.jG.space_comma:return["fr","sv","cs"];case o.jG.quote_decimal:return["de-CH"];case o.jG.system:return;default:return t.language}},c=(t,e,i)=>h(t,e,i).map(t=>t.value).join(""),h=(t,e,i)=>{const a=e?d(e):void 0;return e?.number_format===o.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==o.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",u(t,{...i,useGrouping:!1})).formatToParts(Number(t)):new Intl.NumberFormat(a,u(t,i)).formatToParts(Number(t))},p=(t,e)=>{const i=e?.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(t?.attributes?.step))&&Number.isInteger(Number(t?.state))?{maximumFractionDigits:0}:void 0},u=(t,e)=>{const i={maximumFractionDigits:2,...e};if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};a()}catch(t){a(t)}})},80880(t,e,i){i.d(e,{Y:()=>a});const a=(t,e="_")=>{const i="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",a=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,s=new RegExp(i.split("").join("|"),"g"),o={ж:"zh",х:"kh",ц:"ts",ч:"ch",ш:"sh",щ:"shch",ю:"iu",я:"ia"};let r;return""===t?r="":(r=t.toString().toLowerCase().replace(s,t=>a.charAt(i.indexOf(t))).replace(/[а-я]/g,t=>o[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===r&&(r="unknown")),r}},34470(t,e,i){i.d(e,{E:()=>a});const a=i(5124).AH`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`},12587(t,e,i){i.d(e,{E:()=>s,m:()=>a});const a=t=>{requestAnimationFrame(()=>setTimeout(t,0))},s=()=>new Promise(t=>{a(t)})},3931(t,e,i){i.d(e,{U:()=>a});const a=async(t,e,i,a,s,...o)=>{let r=a[t];r||(r=a[t]={});const n=r[s];if(n)return n;const l=i(a,s,...o);return r[s]=l,l.then(()=>setTimeout(()=>{r[s]=void 0},e),()=>{r[s]=void 0}),l}},86836(t,e,i){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function s(){return a()+a()+a()+a()+a()}i.d(e,{L:()=>s})},64481(t,e,i){i.d(e,{D:()=>s,J:()=>r});i(64979);let a=!1;try{a="true"===window.localStorage.getItem("disableViewTransition")}catch{}const s=t=>{a=t},o=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},r=t=>{if(!document.startViewTransition||a)return t(!1),Promise.resolve();let e=!1;try{const i=document.startViewTransition(()=>{e=!0,t(!0)});return i.ready.catch(o),i.finished.catch(o)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),e?Promise.reject(i):(t(!1),Promise.resolve())}}},34296(t,e,i){var a=i(62826),s=i(96229),o=i(26069),r=i(91735),n=i(42034),l=i(5124),d=i(22441);class c extends s.k{renderOutline(){return this.filled?l.qy`<span class="filled"></span>`:super.renderOutline()}getContainerClasses(){return{...super.getContainerClasses(),active:this.active}}renderPrimaryContent(){return l.qy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label">${this.label}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${this.renderTrailingIcon()} </span> `}renderTrailingIcon(){return l.qy`<slot name="trailing-icon"></slot>`}constructor(...t){super(...t),this.filled=!1,this.active=!1}}c.styles=[r.R,n.R,o.R,l.AH`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var(
          --ha-assist-chip-container-shape,
          16px
        );--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`],(0,a.Cg)([(0,d.MZ)({type:Boolean,reflect:!0})],c.prototype,"filled",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean})],c.prototype,"active",void 0),c=(0,a.Cg)([(0,d.EM)("ha-assist-chip")],c)},82474(t,e,i){i.a(t,async function(t,e){try{i(18111),i(20116),i(61701);var a=i(62826),s=i(5124),o=i(22441),r=i(22786),n=i(1087),l=i(74705),d=i(78649),c=i(53756),h=i(95350),p=i(24367),u=i(19711),g=(i(75064),i(38508)),y=(i(47680),i(67094),i(74281)),m=t([g,y]);[g,y]=m.then?(await m)():m;const v="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",_="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",f="___create-new-entity___";class b extends s.WF{willUpdate(t){this._pendingEntityId&&t.has("hass")&&this.hass.states!==t.get("hass")?.states&&this.hass.states[this._pendingEntityId]&&(this._setValue(this._pendingEntityId),this._pendingEntityId=void 0)}firstUpdated(t){super.firstUpdated(t),this.hass.loadBackendTranslation("title")}_findExtraOption(t){return t?this.extraOptions?.find(e=>e.id===t):void 0}_renderExtraOptionStart(t){const e=t.entity_id?this.hass.states[t.entity_id]:void 0;return e?s.qy` <state-badge slot="start" .stateObj="${e}" .hass="${this.hass}"></state-badge> `:t.icon_path?s.qy` <ha-svg-icon slot="start" .path="${t.icon_path}" style="margin:0 4px"></ha-svg-icon> `:t.icon?s.qy`<ha-icon slot="start" .icon="${t.icon}"></ha-icon>`:s.s6}get _showEntityId(){return this.showEntityId||this.hass.userData?.showEntityIdPicker}_shouldHideClearIcon(){return!!this._findExtraOption(this.value)?.hide_clear}render(){const t=this.placeholder??this.hass.localize("ui.components.entity.entity-picker.placeholder");return s.qy` <ha-generic-picker .hass="${this.hass}" .disabled="${this.disabled}" .autofocus="${this.autofocus}" .allowCustomValue="${this.allowCustomEntity}" .required="${this.required}" .label="${this.label}" .placeholder="${t}" .helper="${this.helper}" .value="${this.addButton?void 0:this.value}" .searchLabel="${this.searchLabel}" .notFoundLabel="${this._notFoundLabel}" .rowRenderer="${this._rowRenderer}" .getItems="${this._getItems}" .getAdditionalItems="${this._getAdditionalItems}" .hideClearIcon="${this.hideClearIcon||this._shouldHideClearIcon()}" .searchFn="${this._searchFn}" .valueRenderer="${this._valueRenderer}" .searchKeys="${c.t}" use-top-label .addButtonLabel="${this.addButton?this.addButtonLabel??this.hass.localize("ui.components.entity.entity-picker.add"):void 0}" .unknownItemText="${this.hass.localize("ui.components.entity.entity-picker.unknown")}" @value-changed="${this._valueChanged}"> </ha-generic-picker> `}async open(){await this.updateComplete,await(this._picker?.open())}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(f)){const t=e.substring(f.length);return void(0,u.$)(this,{domain:t,dialogClosedCallback:t=>{t.entityId&&(this.hass.states[t.entityId]?this._setValue(t.entityId):this._pendingEntityId=t.entityId)}})}((0,d.n)(e)||this._findExtraOption(e))&&this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,n.r)(this,"value-changed",{value:t}),(0,n.r)(this,"change")}constructor(...t){super(...t),this.autofocus=!1,this.disabled=!1,this.required=!1,this.showEntityId=!1,this.hideClearIcon=!1,this.addButton=!1,this._valueRenderer=t=>{const e=t||"",i=this._findExtraOption(e);if(i)return s.qy` ${this._renderExtraOptionStart(i)} <span slot="headline">${i.primary}</span> ${i.secondary?s.qy`<span slot="supporting-text">${i.secondary}</span>`:s.s6} `;const a=this.hass.states[e];if(!a)return s.qy` <ha-svg-icon slot="start" .path="${_}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${e}</span> `;const{primary:o,secondary:r}=(0,l.Bj)(this.hass,a);return s.qy` <state-badge .hass="${this.hass}" .stateObj="${a}" slot="start"></state-badge> <span slot="headline">${o}</span> <span slot="supporting-text">${r}</span> `},this._rowRenderer=(t,e)=>{const i=this._showEntityId;return s.qy` <ha-combo-box-item type="button" compact="compact" .borderTop="${0!==e}"> ${t.icon_path?s.qy` <ha-svg-icon slot="start" style="margin:0 4px" .path="${t.icon_path}"></ha-svg-icon> `:s.qy` <state-badge slot="start" .stateObj="${t.stateObj}" .hass="${this.hass}"></state-badge> `} <span slot="headline">${t.primary}</span> ${t.secondary?s.qy`<span slot="supporting-text">${t.secondary}</span>`:s.s6} ${t.stateObj&&i?s.qy` <span slot="supporting-text" class="code"> ${t.stateObj.entity_id} </span> `:s.s6} ${t.domain_name&&!i?s.qy` <div slot="trailing-supporting-text" class="domain"> ${t.domain_name} </div> `:s.s6} </ha-combo-box-item> `},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,r.A)((t,e)=>e?.length?(this.hass.loadFragmentTranslation("config"),e.map(e=>{const i=t("ui.components.entity.entity-picker.create_helper",{domain:(0,p.z)(e)?t(`ui.panel.config.helpers.types.${e}`)||e:(0,h.p$)(t,e)});return{id:f+e,primary:i,secondary:t("ui.components.entity.entity-picker.new_entity"),icon_path:v}})):[]),this._getEntitiesMemoized=(0,r.A)(c.w),this._getItems=()=>{const t=this._getEntitiesMemoized(this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities,this.value);if(this.extraOptions?.length){return[...this.extraOptions.map(t=>({...t,stateObj:t.entity_id?this.hass.states[t.entity_id]:void 0})),...t]}return t},this._searchFn=(t,e)=>{const i=e.findIndex(e=>e.stateObj?.entity_id===t);if(-1===i)return e;const[a]=e.splice(i,1);return e.unshift(a),e},this._notFoundLabel=t=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:s.qy`<b>‘${t}’</b>`})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],b.prototype,"autofocus",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],b.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],b.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"allow-custom-entity"})],b.prototype,"allowCustomEntity",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"show-entity-id"})],b.prototype,"showEntityId",void 0),(0,a.Cg)([(0,o.MZ)()],b.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],b.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)()],b.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],b.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"search-label"})],b.prototype,"searchLabel",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"createDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-domains"})],b.prototype,"includeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-domains"})],b.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-device-classes"})],b.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-unit-of-measurement"})],b.prototype,"includeUnitOfMeasurement",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-entities"})],b.prototype,"includeEntities",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-entities"})],b.prototype,"excludeEntities",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"entityFilter",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],b.prototype,"extraOptions",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],b.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"add-button",type:Boolean})],b.prototype,"addButton",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"add-button-label"})],b.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,o.P)("ha-generic-picker")],b.prototype,"_picker",void 0),(0,a.Cg)([(0,o.wk)()],b.prototype,"_pendingEntityId",void 0),b=(0,a.Cg)([(0,o.EM)("ha-entity-picker")],b),e()}catch(t){e(t)}})},74281(t,e,i){i.a(t,async function(t,e){try{i(18111),i(7588),i(45367),i(92731);var a=i(62826),s=i(5124),o=i(22441),r=i(63672),n=i(89784),l=i(71727),d=i(69093),c=i(52658),h=i(34470),p=i(10897),u=i(38279),g=i(93367),y=t([g]);g=(y.then?(await y)():y)[0];const m="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class v extends s.WF{connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(this.stateObj?.attributes.entity_picture||this.stateObj?.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){super.disconnectedCallback(),void 0===this.overrideImage&&(this.stateObj?.attributes.entity_picture||this.stateObj?.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){const t=this.stateObj?(0,d.t)(this.stateObj):void 0;return this.stateColor??"light"===t}render(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return s.qy`<div class="missing"> <ha-svg-icon .path="${m}"></ha-svg-icon> </div>`;const e=this.getClass();if(e&&e.forEach((t,e)=>{t?this.classList.add(e):this.classList.remove(e)}),!this.icon)return s.s6;const i=t?(0,d.t)(t):void 0;return s.qy`<ha-state-icon style="${(0,n.W)(this._iconStyle)}" data-domain="${(0,r.J)(i)}" data-state="${(0,r.J)(t?.state)}" .icon="${this.overrideIcon}" .stateObj="${t}"></ha-state-icon>`}willUpdate(t){if(super.willUpdate(t),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,i={};let a="";if(this.icon=!0,e){const t=(0,l.m)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)i.color=this.color;else if(this._stateColor){const t=(0,c.Se)(e);if(t&&(i.color=t),e.attributes.rgb_color&&(i.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const i=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(i)}i.filter=(0,c.mT)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in u.sx?i.color=(0,c.Se)(e,u.sx[t]):delete i.color}}}else{let i=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===t&&(i=(0,p.su)(i,80,80)),a=`url(${i})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),a=`url(${t})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=a}getClass(){const t=new Map(["has-no-radius","has-media-image","has-image"].map(t=>[t,!1]));if(this.stateObj){const e=(0,l.m)(this.stateObj.entity_id);"update"===e?t.set("has-no-radius",!0):"media_player"===e||"camera"===e?t.set("has-media-image",!0):""!==this.style.backgroundImage&&t.set("has-image",!0)}return t}static get styles(){return[h.E,s.AH`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`]}constructor(...t){super(...t),this.icon=!0,this._iconStyle={}}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"stateObj",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"overrideIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"overrideImage",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"stateColor",void 0),(0,a.Cg)([(0,o.MZ)()],v.prototype,"color",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],v.prototype,"icon",void 0),(0,a.Cg)([(0,o.wk)()],v.prototype,"_iconStyle",void 0),v=(0,a.Cg)([(0,o.EM)("state-badge")],v),e()}catch(t){e(t)}})},38962(t,e,i){i.a(t,async function(t,a){try{i.r(e);var s=i(62826),o=i(5124),r=i(22441),n=i(6412),l=i(93421),d=i(1087),c=i(26300),h=(i(67094),t([c]));c=(h.then?(await h)():h)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class g extends o.WF{render(){return o.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?o.qy`<div class="title">${this.title}</div>`:o.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?o.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:o.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=o.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,s.Cg)([(0,r.MZ)()],g.prototype,"title",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,s.Cg)([(0,r.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,s.Cg)([(0,r.EM)("ha-alert")],g),a()}catch(t){a(t)}})},832(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(5124),o=i(22441),r=i(1087),n=i(26613),l=t([n]);n=(l.then?(await l)():l)[0];class d extends s.WF{render(){return this.aliases?s.qy` <ha-input-multi .value="${this.aliases}" .disabled="${this.disabled}" .sortable="${this.sortable}" update-on-blur .label="${this.hass.localize("ui.dialogs.aliases.label")}" .removeLabel="${this.hass.localize("ui.dialogs.aliases.remove")}" .addLabel="${this.hass.localize("ui.dialogs.aliases.add")}" item-index @value-changed="${this._aliasesChanged}"> </ha-input-multi> `:s.s6}_aliasesChanged(t){t.stopPropagation(),(0,r.r)(this,"value-changed",{value:t.detail.value})}constructor(...t){super(...t),this.disabled=!1,this.sortable=!1}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Array})],d.prototype,"aliases",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"sortable",void 0),d=(0,a.Cg)([(0,o.EM)("ha-aliases-editor")],d),e()}catch(t){e(t)}})},93444(t,e,i){var a=i(62826),s=i(5124),o=i(22441);class r extends s.WF{render(){return s.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[s.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,a.Cg)([(0,o.EM)("ha-dialog-footer")],r)},76538(t,e,i){var a=i(62826),s=i(5124),o=i(22441);class r extends s.WF{render(){const t=s.qy`<div class="header-title"> <slot name="title"></slot> </div>`,e=s.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return s.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?s.qy`${e}${t}`:s.qy`${t}${e}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[s.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,a.Cg)([(0,o.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,a.Cg)([(0,o.EM)("ha-dialog-header")],r)},72554(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(93900),o=i(35211),r=i(5124),n=i(22441),l=i(63672),d=i(1087),c=i(64481),h=i(22792),p=i(59992),u=i(14503),g=i(22348),y=(i(76538),i(26300)),m=t([s,y]);[s,y]=m.then?(await m)():m;const v="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class _ extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${v}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(t){this._open?(0,c.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){const e=t.detail?.source===t.target.dialog;this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,r.AH`wa-dialog{--full-width:var(
            --ha-dialog-width-full,
            min(95vw, var(--safe-width))
          );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
            --ha-dialog-surface-background,
            var(--card-background-color, var(--ha-color-surface-default))
          );--wa-panel-border-radius:var(
            --ha-dialog-border-radius,
            var(--ha-border-radius-3xl)
          );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
            --ha-dialog-header-title-font-size,
            var(--ha-font-size-2xl)
          );line-height:var(
            --ha-dialog-header-title-line-height,
            var(--ha-line-height-condensed)
          );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],_.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],_.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({reflect:!0})],_.prototype,"type",void 0),(0,a.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],_.prototype,"width",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],_.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-title"})],_.prototype,"headerTitle",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],_.prototype,"headerSubtitle",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],_.prototype,"headerSubtitlePosition",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],_.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],_.prototype,"withoutHeader",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_open",void 0),(0,a.Cg)([(0,n.P)(".body")],_.prototype,"bodyContainer",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:h.D5,subscribe:!0})],_.prototype,"_i18n",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:h.WF,subscribe:!0})],_.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_bodyScrolled",void 0),(0,a.Cg)([(0,n.Ls)({passive:!0})],_.prototype,"_handleBodyScroll",null),_=(0,a.Cg)([(0,n.EM)("ha-dialog")],_),e()}catch(t){e(t)}})},11382(t,e,i){var a=i(62826),s=i(5124),o=i(22441),r=i(6412),n=i(1087),l=i(12587);i(67094);class d extends s.WF{render(){const t=this.noCollapse?s.s6:s.qy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,r.H)({expanded:this.expanded})}"></ha-svg-icon> `;return s.qy` <div class="top ${(0,r.H)({expanded:this.expanded})}"> <div id="summary" class="${(0,r.H)({noCollapse:this.noCollapse})}" @click="${this._toggleContainer}" @keydown="${this._toggleContainer}" @focus="${this._focusChanged}" @blur="${this._focusChanged}" role="button" tabindex="${this.noCollapse?-1:0}" aria-expanded="${this.expanded}" aria-controls="sect1" part="summary"> ${this.leftChevron?t:s.s6} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${this.header} <slot class="secondary" name="secondary">${this.secondary}</slot> </div> </slot> <slot name="event"></slot> ${this.leftChevron?s.s6:t} <slot name="icons"></slot> </div> </div> <div class="container ${(0,r.H)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?s.qy`<slot></slot>`:""} </div> `}willUpdate(t){super.willUpdate(t),t.has("expanded")&&(this._showContent=this.expanded,setTimeout(()=>{this._container.style.overflow=this.expanded?"initial":"hidden"},300))}_handleTransitionEnd(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}async _toggleContainer(t){if(t.defaultPrevented)return;if("keydown"===t.type&&"Enter"!==t.key&&" "!==t.key)return;if(t.preventDefault(),this.noCollapse)return;const e=!this.expanded;(0,n.r)(this,"expanded-will-change",{expanded:e}),this._container.style.overflow="hidden",e&&(this._showContent=!0,await(0,l.E)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,e||setTimeout(()=>{this._container.style.height="0px"},0),this.expanded=e,(0,n.r)(this,"expanded-changed",{expanded:this.expanded})}_focusChanged(t){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===t.type)}constructor(...t){super(...t),this.expanded=!1,this.outlined=!1,this.leftChevron=!1,this.noCollapse=!1,this._showContent=this.expanded}}d.styles=s.AH`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;border-radius:var(--ha-border-radius-circle)}#summary:focus-visible ha-svg-icon.summary-icon{background-color:var(--ha-color-fill-neutral-normal-active)}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:var(--ha-font-weight-medium);outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1;overflow-wrap:anywhere;color:var(--primary-text-color)}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}`,(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"expanded",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"outlined",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],d.prototype,"leftChevron",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],d.prototype,"noCollapse",void 0),(0,a.Cg)([(0,o.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,o.MZ)()],d.prototype,"secondary",void 0),(0,a.Cg)([(0,o.wk)()],d.prototype,"_showContent",void 0),(0,a.Cg)([(0,o.P)(".container")],d.prototype,"_container",void 0),d=(0,a.Cg)([(0,o.EM)("ha-expansion-panel")],d)},23430(t,e,i){i.a(t,async function(t,a){try{i.d(e,{l:()=>p});var s=i(62826),o=i(5124),r=i(22441),n=i(78870),l=i(79622),d=i(86836),c=i(34127),h=t([c]);c=(h.then?(await h)():h)[0];const p=t=>{const e=t?(0,n.MP)(t):void 0;return e?`--ha-label-background-color: ${e};\n       --primary-text-color: ${(0,l.gJ)(t)};`:"--ha-label-background-color: rgba(var(--rgb-primary-text-color), 0.15);"};class u extends o.WF{willUpdate(t){super.willUpdate(t),t.has("color")&&(this.style.cssText=p(this.color))}render(){return o.qy` <ha-tooltip .for="${this._elementId}" .disabled="${!this.description?.trim()}"> ${this.description} </ha-tooltip> <div class="container" .id="${this._elementId}"> <span class="content"> <slot name="icon"></slot> <slot></slot> </span> </div> `}static get styles(){return[o.AH`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed);letter-spacing:.1px;height:32px;border-radius:var(--ha-border-radius-xl);color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}.container{display:flex;align-items:center;position:relative;height:100%;padding:0 16px}span{display:inline-flex}:host([dense]){height:20px;border-radius:var(--ha-border-radius-md)}:host([dense]) .container{padding:0 12px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`]}constructor(...t){super(...t),this.dense=!1,this._elementId="label-"+(0,d.L)()}}(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"dense",void 0),(0,s.Cg)([(0,r.MZ)()],u.prototype,"color",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"description"})],u.prototype,"description",void 0),u=(0,s.Cg)([(0,r.EM)("ha-label")],u),a()}catch(t){a(t)}})},8034(t,e,i){var a=i(62826),s=i(92070),o=i(5124),r=i(22441);class n extends o.WF{render(){const t=this._hasSlotController.test("description");return o.qy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${!this.threeLine&&t}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> ${t?o.qy`<span class="secondary"><slot name="description"></slot></span>`:o.s6} </div> </div> <div class="content"> <slot></slot> </div> `}constructor(...t){super(...t),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new s.X(this,"description")}}n.styles=o.AH`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var(
        --mdc-typography-body2-font-family,
        var(--mdc-typography-font-family, var(--ha-font-family-body))
      );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`,(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"slim",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"three-line"})],n.prototype,"threeLine",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],n.prototype,"wrapHeading",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"empty",void 0),n=(0,a.Cg)([(0,r.EM)("ha-settings-row")],n)},85938(t,e,i){i(18111),i(22489),i(46058);var a=i(62826),s=i(5124),o=i(22441),r=i(1087);class n extends s.WF{updated(t){t.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}disconnectedCallback(){super.disconnectedCallback(),this._shouldBeDestroy=!0,setTimeout(()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)},1)}connectedCallback(){super.connectedCallback(),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}createRenderRoot(){return this}render(){return this.noStyle?s.s6:s.qy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:var(--ha-border-radius-sm);opacity:.4}.sortable-drag{border-radius:var(--ha-border-radius-sm);opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}async _createSortable(){if(this._sortable)return;const t=this.children[0];if(!t)return;const e=(await Promise.all([i.e(85283),i.e(70322)]).then(i.bind(i,80745))).default,a={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(a.draggable=this.draggableSelector),this.handleSelector&&(a.handle=this.handleSelector),void 0!==this.invertSwap&&(a.invertSwap=this.invertSwap),this.group&&(a.group=this.group),this.filter&&(a.filter=this.filter),this._sortable=new e(t,a)}_destroySortable(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}constructor(...t){super(...t),this.disabled=!1,this.noStyle=!1,this.invertSwap=!1,this.rollback=!0,this._shouldBeDestroy=!1,this._handleUpdate=t=>{(0,r.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,r.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,r.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,r.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,r.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,a.Cg)([(0,o.MZ)({type:Boolean})],n.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"no-style"})],n.prototype,"noStyle",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"draggable-selector"})],n.prototype,"draggableSelector",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"handle-selector"})],n.prototype,"handleSelector",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"filter"})],n.prototype,"filter",void 0),(0,a.Cg)([(0,o.MZ)({type:String})],n.prototype,"group",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"invert-swap"})],n.prototype,"invertSwap",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],n.prototype,"options",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],n.prototype,"rollback",void 0),n=(0,a.Cg)([(0,o.EM)("ha-sortable")],n)},93367(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(35211),o=i(5124),r=i(22441),n=i(91450),l=i(69093),d=i(22792),c=i(85694),h=(i(47680),i(67094),t([c]));c=(h.then?(await h)():h)[0];class p extends o.WF{render(){const t=this.icon||this.stateObj&&this._entities?.[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(t)return o.qy`<ha-icon .icon="${t}"></ha-icon>`;if(!this.stateObj)return o.s6;if(!this._config||!this._connection||!this._entities)return this._renderFallback();const e=(0,c.fq)(this._entities,this._config.config,this._connection.connection,this.stateObj,this.stateValue).then(t=>t?o.qy`<ha-icon .icon="${t}"></ha-icon>`:this._renderFallback());return o.qy`${(0,n.T)(e)}`}_renderFallback(){const t=(0,l.t)(this.stateObj);return o.qy` <ha-svg-icon .path="${c.l[t]||c.lW}"></ha-svg-icon> `}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"stateObj",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"stateValue",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"icon",void 0),(0,a.Cg)([(0,r.wk)(),(0,s.Fg)({context:d.WF,subscribe:!0})],p.prototype,"_config",void 0),(0,a.Cg)([(0,r.wk)(),(0,s.Fg)({context:d.Wq,subscribe:!0})],p.prototype,"_connection",void 0),(0,a.Cg)([(0,r.wk)(),(0,s.Fg)({context:d.X1,subscribe:!0})],p.prototype,"_entities",void 0),p=(0,a.Cg)([(0,r.EM)("ha-state-icon")],p),e()}catch(t){e(t)}})},26613(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(35211),o=i(5124),r=i(22441),n=i(75751),l=i(1087),d=i(22792),c=i(14503),h=i(18350),p=i(26300),u=(i(3449),i(85938),i(91485)),g=t([h,p,u]);[h,p,u]=g.then?(await g)():g;const y="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",m="M21 11H3V9H21V11M21 13H3V15H21V13Z",v="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class _ extends o.WF{render(){return o.qy` <ha-sortable handle-selector=".handle" draggable-selector=".row" .disabled="${!this.sortable||this.disabled}" @item-moved="${this._itemMoved}"> <div class="items"> ${(0,n.u)(this._items,(t,e)=>`${t}-${e}`,(t,e)=>{const i=""+(this.itemIndex?` ${e+1}`:"");return o.qy` <div class="layout horizontal center-center row"> <ha-input .type="${this.inputType}" .autocomplete="${this.autocomplete}" .disabled="${this.disabled}" dialogInitialFocus="${e}" .index="${e}" class="flex-auto" .label="${""+(this.label?`${this.label}${i}`:"")}" .value="${t}" ?data-last="${e===this._items.length-1}" @input="${this._editItem}" @change="${this._editItem}" @keydown="${this._keyDown}"> ${this.inputPrefix?o.qy`<span slot="start">${this.inputPrefix}</span>`:o.s6} ${this.inputSuffix?o.qy`<span slot="end">${this.inputSuffix}</span>`:o.s6} </ha-input> <ha-icon-button .disabled="${this.disabled}" .index="${e}" slot="navigationIcon" .label="${this.removeLabel??this._i18n?.localize("ui.common.remove")??"Remove"}" @click="${this._removeItem}" .path="${y}"></ha-icon-button> ${this.sortable?o.qy`<ha-svg-icon class="handle" .path="${m}"></ha-svg-icon>`:o.s6} </div> `})} </div> </ha-sortable> <div class="layout horizontal"> <ha-button size="small" appearance="filled" @click="${this._addItem}" .disabled="${this.disabled||null!=this.max&&this._items.length>=this.max}"> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> ${this.addLabel??(this.label?this._i18n?.localize("ui.components.multi-textfield.add_item",{item:this.label}):this._i18n?.localize("ui.common.add"))??"Add"} </ha-button> </div> ${this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6} `}get _items(){return this.value??[]}async _addItem(){if(null!=this.max&&this._items.length>=this.max)return;const t=[...this._items,""];this._fireChanged(t),await this.updateComplete,this._lastInput?.focus()}async _editItem(t){if(this.updateOnBlur&&"input"===t.type)return;if(!this.updateOnBlur&&"change"===t.type)return;const e=t.target.index,i=[...this._items];i[e]=t.target.value,this._fireChanged(i)}async _keyDown(t){"Enter"===t.key&&(t.stopPropagation(),this._addItem())}_itemMoved(t){t.stopPropagation();const{oldIndex:e,newIndex:i}=t.detail,a=[...this._items],[s]=a.splice(e,1);a.splice(i,0,s),this._fireChanged(a)}async _removeItem(t){const e=t.target.index,i=[...this._items];i.splice(e,1),this._fireChanged(i)}_fireChanged(t){this.value=t,(0,l.r)(this,"value-changed",{value:t})}static get styles(){return[c.RF,o.AH`.row{margin-bottom:8px;--ha-input-padding-bottom:0}ha-icon-button{display:block}.handle{cursor:grab;padding:8px;margin:-8px}`]}constructor(...t){super(...t),this.disabled=!1,this.itemIndex=!1,this.sortable=!1,this.updateOnBlur=!1}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)()],_.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],_.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"input-type"})],_.prototype,"inputType",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"input-suffix"})],_.prototype,"inputSuffix",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"input-prefix"})],_.prototype,"inputPrefix",void 0),(0,a.Cg)([(0,r.MZ)()],_.prototype,"autocomplete",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"add-label"})],_.prototype,"addLabel",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"remove-label"})],_.prototype,"removeLabel",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"item-index",type:Boolean})],_.prototype,"itemIndex",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],_.prototype,"max",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"sortable",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"update-on-blur"})],_.prototype,"updateOnBlur",void 0),(0,a.Cg)([(0,r.wk)(),(0,s.Fg)({context:d.D5,subscribe:!0})],_.prototype,"_i18n",void 0),(0,a.Cg)([(0,r.P)("ha-input[data-last]")],_.prototype,"_lastInput",void 0),_=(0,a.Cg)([(0,r.EM)("ha-input-multi")],_),e()}catch(t){e(t)}})},82e3(t,e,i){i.d(e,{D5:()=>a,Fy:()=>h,Gk:()=>g,Hg:()=>s,TJ:()=>r,UQ:()=>c,Y_:()=>y,ds:()=>u,e0:()=>o,ec:()=>p,go:()=>l,n2:()=>d,sq:()=>n});i(74423),i(18111),i(61701),i(33110);const a=14881==i.j?`${location.protocol}//${location.host}`:null,s=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}}),o=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),r=()=>fetch("/auth/providers",{credentials:"same-origin"}),n=(t,e,i)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:i,redirect_uri:e})}),l=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),d=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),c=(t,e,i,a)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,i&&(t+=`&state=${encodeURIComponent(i)}`),a&&(t+="&storeToken=true"),document.location.assign(t)},h=async(t,e,i,a)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:a}),p=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),u=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),g=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),y=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},10897(t,e,i){i.d(e,{C4:()=>d,CK:()=>l,FX:()=>y,UC:()=>u,_Z:()=>f,bT:()=>b,j4:()=>v,sd:()=>o,su:()=>n,vc:()=>_,w8:()=>p,wv:()=>h,y3:()=>g,zS:()=>r});var a=i(3931),s=i(82e3);const o=[1,2,3,4,6,8],r="web_rtc",n=(t,e,i)=>`${t}&width=${e}&height=${i}`,l=t=>t.attributes.access_token?`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`:void 0,d=async(t,e,i,s)=>{const o=await(0,a.U)("_cameraTmbUrl",9e3,c,t,e);return n(o,i,s)},c=async(t,e)=>{const i=await(0,s.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},h=async(t,e,i)=>{const a={type:"camera/stream",entity_id:e};i&&(a.format=i);const s=await t.callWS(a);return s.url=t.hassUrl(s.url),s},p=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:e,offer:i}),u=(t,e,i,a)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:a}),g=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),y=(t,e,i)=>t.callWS({type:"camera/update_prefs",entity_id:e,...i}),m="media-source://camera/",v=t=>t.startsWith(m),_=t=>t.substring(22),f=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),b=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},76570(t,e,i){if(i.d(e,{AH:()=>r,Ar:()=>n,JJ:()=>c,pW:()=>d,s_:()=>l}),66649!=i.j)var a=i(35518);var s=i(52220);if(66649!=i.j)var o=i(9899);const r=(t,e)=>t.sendMessagePromise({type:"config/category_registry/list",scope:e}).then(t=>t.sort((t,e)=>(0,s.xL)(t.name,e.name))),n=(t,e,i)=>(0,a.N)(`_categoryRegistry_${e}`,t=>r(t,e),(t,i)=>t.subscribeEvents((0,o.s)(()=>r(t,e).then(t=>i.setState(t,!0)),500,!0),"category_registry_updated"),t,i),l=(t,e,i)=>t.callWS({type:"config/category_registry/create",scope:e,...i}),d=(t,e,i,a)=>t.callWS({type:"config/category_registry/update",scope:e,category_id:i,...a}),c=(t,e,i)=>t.callWS({type:"config/category_registry/delete",scope:e,category_id:i})},38279(t,e,i){i.d(e,{$2:()=>a,VV:()=>o,on:()=>l,sx:()=>r});var a=function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({});const s=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((t,e,i)=>(t[e]=i,t),{}),o=(t,e)=>s[t]-s[e],r={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},n={cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",dry:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",auto:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22C12.4 22 12.7 22 13.1 21.9L15.4 15.3L14.8 14.7C15.5 14 16 13 16 11.9C16 11.2 15.8 10.5 15.4 9.9L17.6 7.7C18.5 9 19 10.4 19 12H20C20.3 12 20.6 12.1 20.8 12.2C20.8 12.2 20.9 12.2 20.9 12.3C21.3 12.5 21.7 12.9 21.9 13.4C22 12.9 22 12.5 22 12C22 6.5 17.5 2 12 2M14 8.6C13.4 8.2 12.7 8 12 8C9.8 8 8 9.8 8 12C8 13.1 8.4 14.1 9.2 14.8L7.1 16.9C5.8 15.7 5 13.9 5 12C5 8.1 8.1 5 12 5C13.6 5 15 5.5 16.2 6.4L14 8.6M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",heat_cool:"M12.92 1.58L11.18 2.58L12.39 4.67L11.8 6.85L9 7.6L7.38 6L7.42 3.59L5.43 3.59L5.43 5.42L3.59 5.42L3.6 7.42L6 7.42L7.65 9.03L6.9 11.82L4.68 12.4L2.59 11.2L1.59 12.93L3.17 13.84L2.26 15.42L4 16.42L5.19 14.33L7.42 13.75L7.92 14.26L9.32 12.86L8.78 12.32L9.53 9.54L12.32 8.78L12.85 9.32L14.26 7.91L13.73 7.37L14.32 5.19L16.41 4L15.41 2.25L13.83 3.16L12.92 1.58M20.72 4L4 20.72L5.27 22L10.16 17.11C10.63 17.43 11.15 17.68 11.71 17.83C14.38 18.55 17.12 16.96 17.83 14.29C18.22 12.86 17.93 11.36 17.11 10.16L22 5.27L20.72 4M18.74 9C19.18 9.63 19.53 10.38 19.75 11.19C19.97 12 20.03 12.81 19.96 13.61L22.65 10.41L18.74 9M19.32 15.95C19 16.67 18.5 17.35 17.93 17.94C17.34 18.53 16.66 19 15.96 19.34L20.05 20.06L19.32 15.95M9 18.71L10.41 22.66L13.59 19.95C12.81 20 12 19.97 11.19 19.76C10.36 19.54 9.62 19.17 9 18.71Z"},l=t=>n[t]||"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},87225(t,e,i){i.d(e,{GS:()=>o,I8:()=>n,YQ:()=>h,bn:()=>d,fg:()=>l,oW:()=>r,ob:()=>c});i(74423);var a=i(71727),s=i(68246);const o=[{groups:{dynamicGroups:{},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},helpers:{},template:{},trigger:{},other:{}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.generic.label",generic:!0,groups:{device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",groups:{customDynamicGroups:{}}}],r={and:{},or:{},not:{}},n=["and","or","not"],l=["ha-automation-condition-and","ha-automation-condition-not","ha-automation-condition-or"],d=(t,e)=>t.connection.subscribeMessage(e,{type:"condition_platforms/subscribe"}),c=t=>t.includes(".")?(0,a.m)(t):t,h=t=>t.includes(".")?(0,s.Y)(t):"_"},53756(t,e,i){i.d(e,{t:()=>l,w:()=>d});i(74423),i(18111),i(22489),i(61701);var a=i(71727),s=i(74705),o=i(28978),r=i(15638),n=i(95350);const l=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],d=(t,e,i,l,d,c,h,p,u,g="")=>{let y,m=Object.keys(t.states);return h&&(m=m.filter(t=>h.includes(t))),p&&(m=m.filter(t=>!p.includes(t))),e&&(m=m.filter(t=>e.includes((0,a.m)(t)))),i&&(m=m.filter(t=>!i.includes((0,a.m)(t)))),y=m.map(e=>{const i=t.states[e],l=(0,o.u)(i),[d,c,h]=(0,s.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),p=(0,n.p$)(t.localize,(0,a.m)(e)),u=(0,r.qC)(t.language,t.translationMetadata.translations),y=d||c||e,m=[h,d?c:void 0].filter(Boolean).join(u?" ◂ ":" ▸ ");return{id:`${g}${e}`,primary:y,secondary:m,domain_name:p,sorting_label:[y,m].filter(Boolean).join("_"),search_labels:{entityName:d||null,deviceName:c||null,areaName:h||null,domainName:p||null,friendlyName:l||null,entityId:e},stateObj:i}}),d&&(y=y.filter(t=>t.id===u||t.stateObj?.attributes.device_class&&d.includes(t.stateObj.attributes.device_class))),c&&(y=y.filter(t=>t.id===u||t.stateObj?.attributes.unit_of_measurement&&c.includes(t.stateObj.attributes.unit_of_measurement))),l&&(y=y.filter(t=>t.id===u||t.stateObj&&l(t.stateObj))),y}},59241(t,e,i){i.d(e,{BM:()=>E,Bz:()=>$,DW:()=>y,Er:()=>g,G3:()=>_,G_:()=>f,Ox:()=>L,P9:()=>k,RP:()=>x,bg:()=>b,fs:()=>h,jh:()=>m,n4:()=>M,oY:()=>c,v:()=>v,z0:()=>p});i(74423),i(18111),i(22489),i(20116);var a=i(35518),s=i(22786),o=i(71727);if(66649!=i.j)var r=i(28978);var n=i(52220),l=i(9899);const d=66649!=i.j?["light","cover","valve"]:null,c=t=>d.includes(t),h=t=>null==t||t.length>0,p=t=>null!=t,u=["sensor","binary_sensor"],g=(t,e)=>{const i=e.filter(e=>t.states[e.entity_id]&&"battery"===t.states[e.entity_id].attributes.device_class&&u.includes((0,o.m)(e.entity_id))).sort((t,e)=>u.indexOf((0,o.m)(t.entity_id))-u.indexOf((0,o.m)(e.entity_id)));if(i.length>0)return i[0]},y=(t,e)=>e.find(e=>t.states[e.entity_id]&&"battery_charging"===t.states[e.entity_id].attributes.device_class),m=(t,e)=>{if(e.name)return e.name;const i=t.states[e.entity_id];return i?(0,r.u)(i):e.original_name?e.original_name:e.entity_id},v=(t,e)=>t.callWS({type:"config/entity_registry/get",entity_id:e}),_=(t,e)=>t.callWS({type:"config/entity_registry/get_entries",entity_ids:e}),f=(t,e,i)=>t.callWS({type:"config/entity_registry/update",entity_id:e,...i}),b=(t,e)=>t.callWS({type:"config/entity_registry/remove",entity_id:e}),w=t=>t.sendMessagePromise({type:"config/entity_registry/list"}),x=t=>t.sendMessagePromise({type:"config/entity_registry/list_for_display"}),C=(t,e)=>t.subscribeEvents((0,l.s)(()=>w(t).then(t=>e.setState(t,!0)),500,!0),"entity_registry_updated"),$=(t,e)=>(0,a.N)("_entityRegistry",w,C,t,e),M=(t,e)=>t.sort((t,i)=>(0,n.SH)(t.name||"",i.name||"",e)),L=(0,s.A)(t=>{const e={};for(const i of t)e[i.entity_id]=i;return e}),k=(0,s.A)(t=>{const e={};for(const i of t)e[i.id]=i;return e}),E=(t,e)=>t.callWS({type:"config/entity_registry/get_automatic_entity_ids",entity_ids:e})},48250(t,e,i){i.d(e,{Bp:()=>s,aI:()=>a,gg:()=>l,oT:()=>o,wE:()=>r,x0:()=>n});const a=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_user_data",key:e})).value,s=async(t,e,i)=>t.sendMessagePromise({type:"frontend/set_user_data",key:e,value:i}),o=(t,e,i)=>t.subscribeMessage(i,{type:"frontend/subscribe_user_data",key:e}),r=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_system_data",key:e})).value,n=async(t,e,i)=>t.sendMessagePromise({type:"frontend/set_system_data",key:e,value:i}),l=(t,e,i)=>t.subscribeMessage(i,{type:"frontend/subscribe_system_data",key:e})},68287(t,e,i){i.d(e,{z:()=>s});i(18111),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(71727);const s=t=>{const e=t.attributes.entity_id||[],i=[...new Set(e.map(t=>(0,a.m)(t)))];return 1===i.length?i[0]:void 0}},95350(t,e,i){if(i.d(e,{$h:()=>p,FP:()=>m,Og:()=>o,QC:()=>h,QQ:()=>n,S1:()=>r,Ud:()=>v,fK:()=>d,l7:()=>c,nQ:()=>g,p$:()=>l}),66649!=i.j)var a=i(35518);if(66649!=i.j)var s=i(9899);const o=66649!=i.j?{bluetooth:"config/bluetooth",dhcp:"config/dhcp",matter:"config/matter",mqtt:"config/mqtt",ssdp:"config/ssdp",thread:"config/thread",zeroconf:"config/zeroconf",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;var r=66649!=i.j?function(t){return t[t.CRITICAL=50]="CRITICAL",t[t.ERROR=40]="ERROR",t[t.WARNING=30]="WARNING",t[t.INFO=20]="INFO",t[t.DEBUG=10]="DEBUG",t[t.NOTSET=0]="NOTSET",t}({}):null;const n=(t,e)=>e.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${t}%22`,l=(t,e,i)=>t(`component.${e}.title`)||i?.name||e,d=(t,e)=>{const i={type:"manifest/list"};return e&&(i.integrations=e),t.callWS(i)},c=async(t,e)=>{const i=await t.sendMessagePromise({type:"manifest/list"}),a={};for(const t of i)a[t.domain]=t;return e(a),()=>{}},h=(t,e)=>t.callWS({type:"manifest/get",integration:e}),p=t=>t.callWS({type:"integration/setup_info"}),u=t=>t.sendMessagePromise({type:"logger/log_info"}),g=(t,e,i,a)=>t.callWS({type:"logger/integration_log_level",integration:e,level:i,persistence:a}),y=(t,e)=>t.subscribeEvents((0,s.s)(()=>u(t).then(t=>e.setState(t,!0)),200,!0),"logging_changed"),m=(t,e)=>(0,a.N)("_integration_log_info",u,y,t,e),v=(t,e)=>t.callWS({type:"integration/wait",domain:e})},92557(t,e,i){i.d(e,{Rp:()=>c,_9:()=>d,_G:()=>r,d4:()=>h,o5:()=>l});var a=i(35518),s=i(52220),o=i(9899);const r=t=>t.sendMessagePromise({type:"config/label_registry/list"}).then(t=>t.sort((t,e)=>(0,s.xL)(t.name,e.name))),n=(t,e)=>t.subscribeEvents((0,o.s)(()=>r(t).then(t=>e.setState(t,!0)),500,!0),"label_registry_updated"),l=(t,e)=>(0,a.N)("_labelRegistry",r,n,t,e),d=(t,e)=>t.callWS({type:"config/label_registry/create",...e}),c=(t,e,i)=>t.callWS({type:"config/label_registry/update",label_id:e,...i}),h=(t,e)=>t.callWS({type:"config/label_registry/delete",label_id:e})},64808(t,e,i){i.d(e,{G6:()=>r,KL:()=>d,Sn:()=>a,j4:()=>n,q2:()=>s,tb:()=>o});const a="timestamp",s="temperature",o="humidity",r=["timestamp","uptime"],n=(t,e)=>t.callWS({type:"sensor/device_class_convertible_units",device_class:e});let l;const d=async t=>l||(l=t.callWS({type:"sensor/numeric_device_classes"}).catch(t=>{throw l=void 0,t}),l)},46927(t,e,i){if(i.d(e,{$W:()=>c,Hg:()=>o,Wj:()=>r,Yk:()=>h,jG:()=>s,mo:()=>d,ow:()=>n,zt:()=>l}),66649!=i.j)var a=i(48250);var s=function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.quote_decimal="quote_decimal",t.space_comma="space_comma",t.none="none",t}({}),o=function(t){return t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24",t}({}),r=function(t){return t.local="local",t.server="server",t}({}),n=function(t){return t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD",t}({}),l=function(t){return t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday",t}({});const d=(t,e)=>(0,a.oT)(t.connection,"language",e),c=(t,e)=>(0,a.Bp)(t.connection,"language",e),h=async(t,e,i,a,s)=>(await t.callWS({type:"frontend/get_translations",language:e,category:i,integration:a,config_flow:s})).resources},42961(t,e,i){i.d(e,{e:()=>n});var a=i(35518),s=i(9899);const o=t=>t.sendMessagePromise({type:"config/floor_registry/list"}),r=(t,e)=>t.subscribeEvents((0,s.s)(()=>o(t).then(t=>e.setState(t,!0)),500,!0),"floor_registry_updated"),n=(t,e)=>(0,a.N)("_floorRegistry",o,r,t,e)},39803(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(18111),i(22489),i(61701);var s=i(62826),o=i(5124),r=i(22441),n=i(1087),l=i(82474),d=i(38962),c=i(832),h=i(18350),p=i(72554),u=(i(93444),i(11382),i(7089)),g=i(64138),y=i(50176),m=i(44002),v=(i(8034),i(63891),i(91485)),_=i(2514),f=i(64808),b=i(65063),w=i(14503),x=i(36215),C=i(91536),$=i(97268),M=t([l,d,c,h,p,u,g,y,m,v,x]);[l,d,c,h,p,u,g,y,m,v,x]=M.then?(await M)():M;const L={round:!1},k=["sensor"],E=[f.q2],S=[f.tb];class A extends o.WF{async showDialog(t){this._params=t,this._error=void 0,this._params.entry?(this._name=this._params.entry.name,this._aliases=this._params.entry.aliases,this._labels=this._params.entry.labels,this._picture=this._params.entry.picture,this._icon=this._params.entry.icon,this._floor=this._params.entry.floor_id,this._temperatureEntity=this._params.entry.temperature_entity_id,this._humidityEntity=this._params.entry.humidity_entity_id):(this._name=this._params.suggestedName||"",this._aliases=[],this._labels=[],this._picture=null,this._icon=null,this._floor=null,this._temperatureEntity=null,this._humidityEntity=null),this._open=!0,await this.updateComplete}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._error="",this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_renderSettings(t){return o.qy` ${t?o.qy` <ha-settings-row> <span slot="heading"> ${this.hass.localize("ui.panel.config.areas.editor.area_id")} </span> <span slot="description"> ${t.area_id} </span> </ha-settings-row> `:o.s6} <ha-input autofocus .value="${this._name}" @input="${this._nameChanged}" .label="${this.hass.localize("ui.panel.config.areas.editor.name")}" .validationMessage="${this.hass.localize("ui.panel.config.areas.editor.name_required")}" auto-validate required></ha-input> <ha-icon-picker .hass="${this.hass}" .value="${this._icon}" @value-changed="${this._iconChanged}" .label="${this.hass.localize("ui.panel.config.areas.editor.icon")}"></ha-icon-picker> <ha-floor-picker .hass="${this.hass}" .value="${this._floor}" @value-changed="${this._floorChanged}" .label="${this.hass.localize("ui.panel.config.areas.editor.floor")}"></ha-floor-picker> <ha-labels-picker .label="${this.hass.localize("ui.components.label-picker.labels")}" .hass="${this.hass}" .value="${this._labels}" @value-changed="${this._labelsChanged}" .placeholder="${this.hass.localize("ui.panel.config.areas.editor.add_labels")}"></ha-labels-picker> <ha-picture-upload .hass="${this.hass}" .value="${this._picture}" crop select-media .cropOptions="${L}" @change="${this._pictureChanged}"></ha-picture-upload> `}_renderAliasExpansion(){return o.qy` <ha-expansion-panel outlined .header="${this.hass.localize("ui.panel.config.areas.editor.aliases_section")}" expanded> <div class="content"> <p class="description"> ${this.hass.localize("ui.panel.config.areas.editor.aliases_description")} </p> <ha-aliases-editor .hass="${this.hass}" .aliases="${this._aliases}" @value-changed="${this._aliasesChanged}"></ha-aliases-editor> </div> </ha-expansion-panel> `}_renderRelatedEntitiesExpansion(){return o.qy` <ha-expansion-panel outlined .header="${this.hass.localize("ui.panel.config.areas.editor.related_entities_section")}" expanded> <div class="content"> <ha-entity-picker .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.areas.editor.temperature_entity")}" .helper="${this.hass.localize("ui.panel.config.areas.editor.temperature_entity_description")}" .value="${this._temperatureEntity}" .includeDomains="${k}" .includeDeviceClasses="${E}" .entityFilter="${this._areaEntityFilter}" @value-changed="${this._sensorChanged}"></ha-entity-picker> <ha-entity-picker .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.areas.editor.humidity_entity")}" .helper="${this.hass.localize("ui.panel.config.areas.editor.humidity_entity_description")}" .value="${this._humidityEntity}" .includeDomains="${k}" .includeDeviceClasses="${S}" .entityFilter="${this._areaEntityFilter}" @value-changed="${this._sensorChanged}"></ha-entity-picker> </div> </ha-expansion-panel> `}async _getLabelNames(){if(!this._labels.length)return[];const t=await(0,C.wR)(this.hass.connection);return this._labels.map(e=>t[e]).filter(t=>Boolean(t))}async _handleSuggestion(t){const e=t.detail,i=await(0,x.Fn)(this.hass.connection,"area",e,this._suggestionInclude);i.name&&(this._name=i.name),i.labels?.length&&(this._labels=i.labels),i.floor&&(this._floor=i.floor)}render(){if(!this._params)return o.s6;const t=this._params.entry,e=!this._isNameValid(),i=!t;return o.qy` <ha-dialog .hass="${this.hass}" .open="${this._open}" header-title="${t?this.hass.localize("ui.panel.config.areas.editor.update_area"):this.hass.localize("ui.panel.config.areas.editor.create_area")}" prevent-scrim-close @closed="${this._dialogClosed}"> <ha-suggest-with-ai-button slot="headerActionItems" .hass="${this.hass}" .generateTask="${this._generateTask}" @suggestion="${this._handleSuggestion}"></ha-suggest-with-ai-button> <div> ${this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""} <div class="form"> ${this._renderSettings(t)} ${this._renderAliasExpansion()} ${i?o.s6:this._renderRelatedEntitiesExpansion()} </div> </div> <ha-dialog-footer slot="footer"> ${i?o.qy`<ha-button appearance="plain" slot="secondaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </ha-button>`:o.qy` <ha-button slot="secondaryAction" variant="danger" appearance="plain" @click="${this._deleteArea}" .disabled="${this._submitting}"> ${this.hass.localize("ui.common.delete")} </ha-button> `} <ha-button slot="primaryAction" @click="${this._updateEntry}" .disabled="${e||this._submitting}"> ${t?this.hass.localize("ui.common.save"):this.hass.localize("ui.common.create")} </ha-button> </ha-dialog-footer> </ha-dialog> `}_isNameValid(){return""!==this._name.trim()}_nameChanged(t){this._error=void 0,this._name=t.target.value??""}_floorChanged(t){this._error=void 0,this._floor=t.detail.value}_iconChanged(t){this._error=void 0,this._icon=t.detail.value}_labelsChanged(t){this._error=void 0,this._labels=t.detail.value}_pictureChanged(t){this._error=void 0,this._picture=t.target.value}_aliasesChanged(t){this._aliases=t.detail.value}_sensorChanged(t){this[`_${t.target.includeDeviceClasses[0]}Entity`]=t.detail.value||null}async _updateEntry(){const t=!this._params.entry;this._submitting=!0;try{const e={name:this._name.trim(),picture:this._picture||(t?void 0:null),icon:this._icon||(t?void 0:null),floor_id:this._floor||(t?void 0:null),labels:this._labels||null,aliases:this._aliases,temperature_entity_id:this._temperatureEntity,humidity_entity_id:this._humidityEntity};t?await this._params.createEntry(e):await this._params.updateEntry(e),this.closeDialog()}catch(t){this._error=t.message||this.hass.localize("ui.panel.config.areas.editor.unknown_error")}finally{this._submitting=!1}}async _deleteArea(){if(!this._params?.entry)return;await(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.areas.delete.confirmation_title",{name:this._params.entry.name}),text:this.hass.localize("ui.panel.config.areas.delete.confirmation_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})&&(await(0,_.uG)(this.hass,this._params.entry.area_id),this.closeDialog())}static get styles(){return[w.nA,o.AH`ha-expansion-panel{--expansion-panel-content-padding:0}ha-aliases-editor,ha-entity-picker,ha-expansion-panel,ha-floor-picker,ha-icon-picker,ha-labels-picker,ha-picture-upload{display:block;margin-bottom:var(--ha-space-4)}.content{padding:var(--ha-space-3)}.description{margin:0 0 var(--ha-space-4) 0}ha-suggest-with-ai-button{margin:var(--ha-space-2) var(--ha-space-4)}`]}constructor(...t){super(...t),this._submitting=!1,this._open=!1,this._suggestionInclude={name:!0,labels:!0,floor:!0},this._generateTask=async()=>(this._suggestionInclude={...this._suggestionInclude,name:""===this._name.trim()},(0,x.q3)(this.hass.connection,this.hass.language,"area",{name:this._name,aliases:this._aliases,labels:await this._getLabelNames(),floor:this._floor?this.hass.floors?.[this._floor]?.name:null,temperature_entity:this._temperatureEntity?this.hass.states[this._temperatureEntity]?.attributes?.friendly_name??null:null,humidity_entity:this._humidityEntity?this.hass.states[this._humidityEntity]?.attributes?.friendly_name??null:null},await(0,$.U)(this.hass.connection),this._suggestionInclude)),this._areaEntityFilter=t=>{const e=this.hass.entities[t.entity_id];if(!e)return!1;const i=this._params.entry.area_id;if(e.area_id===i)return!0;if(!e.device_id)return!1;const a=this.hass.devices[e.device_id];return a&&a.area_id===i}}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_name",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_aliases",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_labels",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_picture",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_icon",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_floor",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_temperatureEntity",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_humidityEntity",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_error",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_params",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_submitting",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_open",void 0),(0,s.Cg)([(0,r.wk)()],A.prototype,"_suggestionInclude",void 0),A=(0,s.Cg)([(0,r.EM)("dialog-area-registry-detail")],A),a()}catch(t){a(t)}})},24367(t,e,i){i.d(e,{L:()=>s,z:()=>o});var a=i(23832);const s=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],o=(0,a.g)(s)},19711(t,e,i){i.d(e,{$:()=>o});var a=i(1087);const s=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:s,dialogParams:e})}},69569(t,e,i){i.d(e,{f:()=>o});var a=i(1087);const s=()=>Promise.all([i.e(92769),i.e(3283),i.e(37941),i.e(26092),i.e(18965)]).then(i.bind(i,427)),o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-label-detail",dialogImport:s,dialogParams:e})}},86030(t,e,i){i.d(e,{B:()=>a,a:()=>s});i(18111),i(18237);function a(t){return Array.isArray(t)?t.reverse().reduce((t,e)=>`var(${e}${t?`, ${t}`:""})`,void 0):`var(${t})`}function s(t,e){if(Array.isArray(t))for(const i of t){const t=s(i,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}},53580(t,e,i){i.d(e,{mdiHomeAssistant:()=>a});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},37619(t,e,i){i.d(e,{X:()=>o,s:()=>s});i(69112),i(33110);let a=!1;const s=t=>{a=t},o=(t,e)=>{const i=t.sendMessagePromise(e);return a&&console.log(`⬆️ Sent #${e.id}`,e),a&&i.then(t=>console.log(`⬇️ Received #${e.id}`,t&&"object"==typeof t?JSON.parse(JSON.stringify(t)):t),t=>console.error(`❌ Error #${e.id}`,t)),i}}};