UNPKG

iobroker.lovelace

Version:

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

36 lines 109 kB
export const __rspack_esm_id=91123;export const __rspack_esm_ids=[91123];export const __webpack_modules__={80785(t,e,i){function o(t){return!!t&&(t instanceof Date&&!isNaN(t.valueOf()))}i.d(e,{A:()=>o})},57673(t,e,i){i.d(e,{z:()=>o});const o=t=>{if(void 0===t)return;if("object"!=typeof t){if("string"==typeof t||isNaN(t)){const e=t?.toString().split(":")||[];if(1===e.length)return{seconds:Number(e[0])};if(e.length>3)return;const i=Number(e[2])||0,o=Math.floor(i);return{hours:Number(e[0])||0,minutes:Number(e[1])||0,seconds:o,milliseconds:Math.floor(1e3*Number((i-o).toFixed(4)))}}return{seconds:t}}if(!("days"in t))return t;const{days:e,minutes:i,seconds:o,milliseconds:a}=t;let r=t.hours||0;return r=(r||0)+24*(e||0),{hours:r,minutes:i,seconds:o,milliseconds:a}}},72487(t,e,i){i.a(t,async function(t,o){try{i.d(e,{CA:()=>k,Mi:()=>L,Pm:()=>$,Wq:()=>b,Yq:()=>d,bl:()=>I,c2:()=>w,fr:()=>v,gu:()=>A,kz:()=>h,m9:()=>S,sl:()=>y,ur:()=>q,zB:()=>p});i(18111),i(20116);var a=i(74487),r=i(22786),n=i(46927),s=i(8480),l=t([a,s]);[a,s]=l.then?(await l)():l;(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)}));const d=(t,e,i)=>c(e,i.time_zone).format(t),c=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),h=(t,e,i)=>u(e,i.time_zone).format(t),u=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),p=(t,e,i)=>{const o=g(e,i.time_zone);if(e.date_format===n.ow.language||e.date_format===n.ow.system)return o.format(t);const a=o.formatToParts(t),r=a.find(t=>"literal"===t.type)?.value,s=a.find(t=>"day"===t.type)?.value,l=a.find(t=>"month"===t.type)?.value,d=a.find(t=>"year"===t.type)?.value,c=a[a.length-1];let h="literal"===c?.type?c?.value:"";"bg"===e.language&&e.date_format===n.ow.YMD&&(h="");return{[n.ow.DMY]:`${s}${r}${l}${r}${d}${h}`,[n.ow.MDY]:`${l}${r}${s}${r}${d}${h}`,[n.ow.YMD]:`${d}${r}${l}${r}${s}${h}`}[e.date_format]},g=(0,r.A)((t,e)=>{const i=t.date_format===n.ow.system?void 0:t.language;return t.date_format===n.ow.language||(t.date_format,n.ow.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})}),y=(t,e,i)=>m(e,i.time_zone).format(t),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),v=(t,e,i)=>f(e,i.time_zone).format(t),f=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),b=(t,e,i)=>_(e,i.time_zone).format(t),_=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,s.wj)(t.time_zone,e)})),w=(t,e,i)=>C(e,i.time_zone).format(t),C=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),$=(t,e,i)=>x(e,i.time_zone).format(t),x=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),k=(t,e,i)=>M(e,i.time_zone).format(t),M=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,s.wj)(t.time_zone,e)})),A=(t,e,i)=>z(e,i.time_zone).format(t),z=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,s.wj)(t.time_zone,e)})),L=(t,e,i)=>E(e,i.time_zone).format(t),E=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),q=(t,e,i)=>Z(e,i.time_zone).format(t),Z=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),I=(t,e,i)=>{const o=(0,s.wj)(e.time_zone,i.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:o}).format(t)},S=(t,e,i,o)=>`${I(t,i,o)}/${I(e,i,o)}`;o()}catch(t){o(t)}})},30162(t,e,i){i.a(t,async function(t,o){try{i.d(e,{LW:()=>y,Xs:()=>p,fU:()=>d,ie:()=>h});var a=i(74487),r=i(22786),n=i(8480),s=i(69543),l=t([a,n]);[a,n]=l.then?(await l)():l;const d=(t,e,i)=>c(e,i.time_zone).format(t),c=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),h=(t,e,i)=>u(e,i.time_zone).format(t),u=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),p=(t,e,i)=>g(e,i.time_zone).format(t),g=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),y=(t,e,i)=>m(e,i.time_zone).format(t),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,n.wj)(t.time_zone,e)}));o()}catch(t){o(t)}})},27167(t,e,i){i.d(e,{A:()=>a});const o=t=>t<10?`0${t}`:t;function a(t){const e=Math.floor(t/3600),i=Math.floor(t%3600/60),a=Math.floor(t%3600%60);return e>0?`${e}:${o(i)}:${o(a)}`:i>0?`${i}:${o(a)}`:a>0?""+a:null}},69543(t,e,i){i.d(e,{J:()=>r});i(74423);var o=i(22786),a=i(46927);const r=(0,o.A)(t=>{if(t.time_format===a.Hg.language||t.time_format===a.Hg.system){const e=t.time_format===a.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===a.Hg.am_pm})},99124(t,e,i){i.d(e,{C:()=>o});const o=t=>{t.preventDefault(),t.stopPropagation()}},53610(t,e,i){i.a(t,async function(t,o){try{i.d(e,{computeAttributeNameDisplay:()=>b,computeAttributeValueDisplay:()=>v,computeAttributeValueToParts:()=>f});i(44114),i(18111),i(61701),i(13579),i(33110);var a=i(88827),r=i(43248),n=i(80785),s=i(72487),l=i(95747),d=i(20058),c=i(52943),h=i(22682),u=i(6940),p=i(8549),g=i(71727),y=i(69093),m=t([d,a,l,s]);[d,a,l,s]=m.then?(await m)():m;const v=(t,e,i,o,a,r,n)=>f(t,e,i,o,a,r,n).map(t=>t.value).join(""),f=(t,e,i,o,c,m,f)=>{const b=void 0!==f?f:e.attributes[m];if(null==b)return[{type:"value",value:t("state.default.unknown")}];if("number"==typeof b){const t=(0,y.t)(e),n=a.Tf[t]?.[m],s=n?n(b,i):(0,d.ZV)(b,i);let l=a.rM[t]?.[m];"weather"===t?l=(0,r.d9)(o,e,m):a.Zn.has(m)&&(l=o.unit_system.temperature);const c=[{type:"value",value:s}];if(l){const t=(0,p.A)(l,i);t&&c.push({type:"literal",value:t}),c.push({type:"unit",value:l})}return c}if("string"==typeof b&&(0,h.$)(b,!0)){if((0,u.F)(b)){const t=new Date(b);if((0,n.A)(t)){return[{type:"value",value:(0,l.yg)(t,i,o)}]}}const t=new Date(b);if((0,n.A)(t))return[{type:"value",value:(0,s.Yq)(t,i,o)}]}if(Array.isArray(b)&&b.some(t=>t instanceof Object)||!Array.isArray(b)&&b instanceof Object)return[{type:"value",value:JSON.stringify(b)}];if(Array.isArray(b)){return[{type:"value",value:b.map(a=>v(t,e,i,o,c,m,a)).join(", ")}]}const _=e.entity_id,w=(0,g.m)(_),C=e.attributes.device_class,$=c[_],x=$?.translation_key;return[{type:"value",value:x&&t(`component.${$.platform}.entity.${w}.${x}.state_attributes.${m}.state.${b}`)||C&&t(`component.${w}.entity_component.${C}.state_attributes.${m}.state.${b}`)||t(`component.${w}.entity_component._.state_attributes.${m}.state.${b}`)||b}]},b=(t,e,i,o)=>{const a=e.entity_id,r=e.attributes.device_class,n=(0,g.m)(a),s=i[a],l=s?.translation_key;return l&&t(`component.${s.platform}.entity.${n}.${l}.state_attributes.${o}.name`)||r&&t(`component.${n}.entity_component.${r}.state_attributes.${o}.name`)||t(`component.${n}.entity_component._.state_attributes.${o}.name`)||(0,c.Z)(o.replace(/_/g," ").replace(/\bid\b/g,"ID").replace(/\bip\b/g,"IP").replace(/\bmac\b/g,"MAC").replace(/\bgps\b/g,"GPS"))};o()}catch(t){o(t)}})},3471(t,e,i){i.d(e,{e:()=>o});const o=t=>"latitude"in t.attributes&&"longitude"in t.attributes},78649(t,e,i){i.d(e,{n:()=>a});const o=/^(\w+)\.(\w+)$/,a=t=>o.test(t)},52943(t,e,i){i.d(e,{Z:()=>o});const o=t=>t.charAt(0).toUpperCase()+t.slice(1)},8185(t,e,i){i.a(t,async function(t,o){try{i.d(e,{c:()=>s,q:()=>l});var a=i(74487),r=i(22786),n=t([a]);a=(n.then?(await n)():n)[0];const s=(t,e)=>d(t).format(e),l=(t,e)=>c(t).format(e),d=(0,r.A)(t=>new Intl.ListFormat(t.language,{style:"long",type:"conjunction"})),c=(0,r.A)(t=>new Intl.ListFormat(t.language,{style:"long",type:"disjunction"}));o()}catch(t){o(t)}})},6940(t,e,i){i.d(e,{F:()=>a});const o=/^\d{4}-(0[1-9]|1[0-2])-([12]\d|0[1-9]|3[01])[T| ](((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)(\8[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)$/,a=t=>o.test(t)},53516(t,e,i){i.d(e,{C:()=>o});const o=(t,e,i="...")=>t.length<=e+i.length?t:`${t.substring(0,e)}${i}`},78978(t,e,i){i.d(e,{_:()=>a});i(44114),i(33110);var o=i(63533);const a=(t,e)=>{if(!(e instanceof o.C5))return{warnings:[e.message],errors:void 0};const i=[],a=[];for(const o of e.failures())if(void 0===o.value)i.push(t.localize("ui.errors.config.key_missing",{key:o.path.join(".")}));else if("never"===o.type)a.push(t.localize("ui.errors.config.key_not_expected",{key:o.path.join(".")}));else{if("union"===o.type)continue;"enums"===o.type?a.push(t.localize("ui.errors.config.key_wrong_type",{key:o.path.join("."),type_correct:o.message.replace("Expected ","").split(", ")[0],type_wrong:JSON.stringify(o.value)})):a.push(t.localize("ui.errors.config.key_wrong_type",{key:o.path.join("."),type_correct:o.refinement||o.type,type_wrong:JSON.stringify(o.value)}))}return{warnings:a,errors:i}}},34470(t,e,i){i.d(e,{E:()=>o});const o=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)}`},63130(t,e,i){i.d(e,{l:()=>a});var o=i(50248);const a=async(t,e)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(t)}catch{}const i=e||(0,o.n)()?.getRootNode()||document.body,a=document.createElement("textarea");a.value=t,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.opacity="0",i.appendChild(a),a.select(),document.execCommand("copy"),i.removeChild(a)}},3931(t,e,i){i.d(e,{U:()=>o});const o=async(t,e,i,o,a,...r)=>{let n=o[t];n||(n=o[t]={});const s=n[a];if(s)return s;const l=i(o,a,...r);return n[a]=l,l.then(()=>setTimeout(()=>{n[a]=void 0},e),()=>{n[a]=void 0}),l}},3109(t,e,i){var o=i(62826),a=i(86137),r=i(22441);class n extends a.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeIn"}}(0,o.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"play",void 0),n=(0,o.Cg)([(0,r.EM)("ha-fade-in")],n)},14328(t,e,i){var o=i(62826),a=i(86137),r=i(22441);class n extends a.A{constructor(){super(),this.play=!0,this.iterations=1,this.fill="both",this.name="fadeOut"}}(0,o.Cg)([(0,r.MZ)({type:Boolean})],n.prototype,"play",void 0),n=(0,o.Cg)([(0,r.EM)("ha-fade-out")],n)},7822(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=(i(86137),i(5124)),r=i(22441),n=i(31479),s=(i(3109),i(14328),i(26300)),l=t([s]);s=(l.then?(await l)():l)[0];const d="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";class c extends a.WF{willUpdate(t){t.has("show")&&(this._highlight=0,!this.show&&this.hasUpdated&&(this._hide=!0))}render(){if(!this.show&&!this._hide)return a.s6;let t=a.qy`<div><slot></slot></div>`;return this.interactive&&(t=a.qy`<button> <slot></slot> <ha-svg-icon .path="${d}"></ha-svg-icon> </button>`),this.show&&this._highlight?(0,n.D)(this._highlight,a.qy` <wa-animation fill="both" .iterations="${1}" name="headShake" play>${t}</wa-animation> `):!this.show&&this._hide?a.qy` <ha-fade-out @wa-finish="${this._handleHideFinish}">${t}</ha-fade-out> `:a.qy`<ha-fade-in .duration="${250}">${t}</ha-fade-in>`}highlight(){this._highlight+=1}_handleHideFinish(){this._hide=!1}constructor(...t){super(...t),this.variant="info",this.interactive=!1,this.show=!1,this._hide=!1,this._highlight=0}}c.styles=a.AH`:host{--background-color:var(--ha-color-fill-primary-normal-resting);--background-color-hover:var(--ha-color-fill-primary-normal-hover);--text-color:var(--ha-color-on-primary-normal);border-radius:var(--ha-border-radius-pill)}:host([variant=warning]){--background-color:var(--ha-color-fill-warning-normal-resting);--background-color-hover:var(--ha-color-fill-warning-normal-hover);--text-color:var(--ha-color-on-warning-normal)}:host([variant=neutral]){--background-color:var(--ha-color-fill-neutral-normal-resting);--background-color-hover:var(--ha-color-fill-neutral-normal-hover);--text-color:var(--ha-color-on-neutral-normal)}:host([variant=success]){--background-color:var(--ha-color-fill-success-normal-resting);--background-color-hover:var(--ha-color-fill-success-normal-hover);--text-color:var(--ha-color-on-success-normal)}:host([variant=danger]){--background-color:var(--ha-color-fill-danger-normal-resting);--background-color-hover:var(--ha-color-fill-danger-normal-hover);--text-color:var(--ha-color-on-danger-normal)}button,div{background:var(--background-color);border-radius:var(--ha-border-radius-pill);color:var(--text-color);display:inline-flex;gap:var(--ha-space-2);padding:var(--ha-space-1) var(--ha-space-2);align-items:center;--mdc-icon-size:16px;line-height:1;box-shadow:var(--ha-box-shadow-s)}button{border:none;cursor:pointer}button:hover{background:var(--background-color-hover)}button:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}`,(0,o.Cg)([(0,r.MZ)({reflect:!0})],c.prototype,"variant",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"interactive",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"show",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"_hide",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"_highlight",void 0),c=(0,o.Cg)([(0,r.EM)("ha-automation-row-event-chip")],c),e()}catch(t){e(t)}})},56214(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=i(5124),r=i(22441),n=i(1087),s=i(26300),l=t([s]);s=(l.then?(await l)():l)[0];const d="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z";class c extends a.WF{render(){return a.qy` <div class="row" tabindex="0" role="button" @keydown="${this._handleKeydown}"> ${this.leftChevron?a.qy` <ha-icon-button class="expand-button" .path="${d}" @click="${this._handleExpand}" @keydown="${this._handleExpand}"></ha-icon-button> `:a.s6} <div class="leading-icon-wrapper"> <slot name="leading-icon"></slot> </div> <div class="header"> <slot name="header"></slot> <slot name="event"></slot> </div> <div class="icons"> <slot name="icons"></slot> </div> </div> `}async _handleExpand(t){t.defaultPrevented||"keydown"===t.type&&"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),t.preventDefault(),(0,n.r)(this,"toggle-collapsed"))}async _handleKeydown(t){if(!(t.defaultPrevented||"Enter"!==t.key&&" "!==t.key&&(!this.sortSelected&&!t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||"ArrowUp"!==t.key&&"ArrowDown"!==t.key))){if(t.preventDefault(),t.stopPropagation(),"ArrowUp"===t.key||"ArrowDown"===t.key)return"ArrowUp"===t.key?void(0,n.r)(this,"move-up"):void(0,n.r)(this,"move-down");!this.sortSelected||"Enter"!==t.key&&" "!==t.key?this.click():(0,n.r)(this,"stop-sort-selection")}}focus(){requestAnimationFrame(()=>{this._rowElement?.focus()})}constructor(...t){super(...t),this.leftChevron=!1,this.collapsed=!1,this.selected=!1,this.sortSelected=!1,this.disabled=!1,this.buildingBlock=!1,this.dim=!1}}c.styles=a.AH`:host{display:block;position:relative}.row{display:flex;padding-left:var(--ha-space-3);padding-inline-start:var(--ha-space-3);padding-inline-end:initial;min-height:48px;align-items:flex-start;cursor:pointer;overflow:hidden;outline:0;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.row:focus{outline:var(--wa-focus-ring);outline-offset:-2px}.expand-button{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);color:var(--ha-color-on-neutral-quiet);margin-left:calc(var(--ha-space-2) * -1);margin-inline-start:calc(var(--ha-space-2) * -1);margin-inline-end:initial}:host([building-block]) .leading-icon-wrapper{background-color:var(--ha-color-fill-neutral-loud-resting);border-radius:var(--ha-border-radius-md);padding:var(--ha-space-1);margin-top:10px;display:flex;justify-content:center;align-items:center;transform:rotate(45deg)}.leading-icon-wrapper{padding-top:var(--ha-space-3);position:relative;z-index:1}::slotted([slot=leading-icon]){color:var(--ha-color-on-neutral-quiet)}:host([building-block]) ::slotted(#condition-icon),:host([building-block]) ::slotted([slot=leading-icon].action-icon){--mdc-icon-size:var(--ha-space-5);color:var(--white-color);transform:rotate(-45deg)}:host([collapsed]) .expand-button{transform:rotate(180deg)}:host([selected]) .row,:host([selected]) .row:focus{outline:solid;outline-color:var(--primary-color);outline-offset:-2px;outline-width:2px}:host([disabled]) .row{border-top-right-radius:var(--ha-border-radius-square);border-top-left-radius:var(--ha-border-radius-square)}.header{position:relative;display:flex;align-items:center;flex:1;min-width:0;overflow-wrap:anywhere}::slotted([slot=header]){overflow-wrap:anywhere;margin:0 var(--ha-space-3)}::slotted([slot=event]){position:absolute;inset-inline-end:0}.icons{display:flex;align-items:center;flex-shrink:0}:host([sort-selected]) .row{outline:solid;outline-color:rgba(var(--rgb-accent-color),.6);outline-offset:-2px;outline-width:2px;background-color:rgba(var(--rgb-accent-color),.08)}.row:hover{background-color:rgba(var(--rgb-primary-text-color),.04)}:host([highlight]) .row{background-color:rgba(var(--rgb-primary-color),.08)}:host([highlight]) .row:hover{background-color:rgba(var(--rgb-primary-color),.16)}.icons,.leading-icon-wrapper,::slotted([slot=header]){transition:opacity var(--ha-animation-duration-normal);opacity:1}:host([dim]) .icons,:host([dim]) .leading-icon-wrapper,:host([dim]) ::slotted([slot=header]){opacity:.5}`,(0,o.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean})],c.prototype,"leftChevron",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"collapsed",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"sort-selected"})],c.prototype,"sortSelected",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"building-block"})],c.prototype,"buildingBlock",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"highlight",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"dim",void 0),(0,o.Cg)([(0,r.P)(".row")],c.prototype,"_rowElement",void 0),c=(0,o.Cg)([(0,r.EM)("ha-automation-row")],c),e()}catch(t){e(t)}})},17062(t,e,i){i.a(t,async function(t,o){try{i.d(e,{V:()=>m});i(18111),i(20116),i(61701);var a=i(62826),r=i(35211),n=i(5124),s=i(22441),l=i(22786),d=i(1087),c=i(52220),h=i(22792),u=i(10139),p=i(38508),g=t([p]);p=(g.then?(await g)():g)[0];const y="NO_AUTOMATION";class m extends n.WF{get NO_AUTOMATION_TEXT(){return this.hass.localize("ui.panel.config.devices.automation.actions.no_actions")}get _value(){if(!this.value||!this._automations)return"";if(!this._automations.length)return y;const t=this._automations.findIndex(t=>(0,u.Po)(this._entityReg,t,this.value));return-1===t?this.value.alias||this.value.type||"unknown":`${this._automations[t].device_id}_${t}`}render(){if(this._renderEmpty)return n.s6;const t=this._value;return n.qy`<ha-generic-picker .hass="${this.hass}" .label="${this.label}" .value="${t}" .disabled="${!this._automations||0===this._automations.length}" .getItems="${this._getItems(t,this._automations)}" @value-changed="${this._automationChanged}" .valueRenderer="${this._valueRenderer}" .unknownItemText="${this.hass.localize("ui.panel.config.devices.automation.actions.unknown_action")}" hide-clear-icon> </ha-generic-picker>`}updated(t){super.updated(t),t.has("deviceId")&&this._updateDeviceInfo()}async _updateDeviceInfo(){this._automations=this.deviceId?(await this._fetchDeviceAutomations(this.hass.callWS,this.deviceId)).sort(u.RK):[],this.value&&this.value.device_id===this.deviceId||this._setValue(this._automations.length?this._automations[0]:this._createNoAutomation(this.deviceId)),this._renderEmpty=!0,await this.updateComplete,this._renderEmpty=!1}_automationChanged(t){t.stopPropagation();const e=t.detail.value;if(!e||y===e)return;const[i,o]=e.split("_"),a=this._automations[o];a.device_id===i&&this._setValue(a)}_setValue(t){if(this.value&&(0,u.Po)(this._entityReg,t,this.value))return;const e={...t};delete e.metadata,(0,d.r)(this,"value-changed",{value:e})}constructor(t,e,i){super(),this._renderEmpty=!1,this._entityReg=[],this._getItems=(0,l.A)((t,e)=>{if(!e)return()=>{};const i=e.map((t,e)=>{const i=this._localizeDeviceAutomation(this.hass.localize,this.hass.states,this._entityReg,t);return{id:`${t.device_id}_${e}`,primary:i}});return i.sort((t,e)=>(0,c.SH)(t.primary,e.primary,this.hass.locale.language)),t===y&&i.unshift({id:y,primary:this.NO_AUTOMATION_TEXT}),()=>i}),this._valueRenderer=t=>{const e=this._automations?.find((e,i)=>t===`${e.device_id}_${i}`),i=e?this._localizeDeviceAutomation(this.hass.localize,this.hass.states,this._entityReg,e):t===y?this.NO_AUTOMATION_TEXT:t;return n.qy`<span slot="headline">${i}</span>`},this._localizeDeviceAutomation=t,this._fetchDeviceAutomations=e,this._createNoAutomation=i}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)()],m.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"deviceId",void 0),(0,a.Cg)([(0,s.MZ)({type:Object})],m.prototype,"value",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_automations",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_renderEmpty",void 0),(0,a.Cg)([(0,s.wk)(),(0,r.Fg)({context:h.ih,subscribe:!0})],m.prototype,"_entityReg",void 0),o()}catch(t){o(t)}})},82474(t,e,i){i.a(t,async function(t,e){try{i(18111),i(20116),i(61701);var o=i(62826),a=i(5124),r=i(22441),n=i(22786),s=i(1087),l=i(74705),d=i(78649),c=i(53756),h=i(95350),u=i(24367),p=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",f="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",b="___create-new-entity___";class _ extends a.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?a.qy` <state-badge slot="start" .stateObj="${e}" .hass="${this.hass}"></state-badge> `:t.icon_path?a.qy` <ha-svg-icon slot="start" .path="${t.icon_path}" style="margin:0 4px"></ha-svg-icon> `:t.icon?a.qy`<ha-icon slot="start" .icon="${t.icon}"></ha-icon>`:a.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 a.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(b)){const t=e.substring(b.length);return void(0,p.$)(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,s.r)(this,"value-changed",{value:t}),(0,s.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 a.qy` ${this._renderExtraOptionStart(i)} <span slot="headline">${i.primary}</span> ${i.secondary?a.qy`<span slot="supporting-text">${i.secondary}</span>`:a.s6} `;const o=this.hass.states[e];if(!o)return a.qy` <ha-svg-icon slot="start" .path="${f}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${e}</span> `;const{primary:r,secondary:n}=(0,l.Bj)(this.hass,o);return a.qy` <state-badge .hass="${this.hass}" .stateObj="${o}" slot="start"></state-badge> <span slot="headline">${r}</span> <span slot="supporting-text">${n}</span> `},this._rowRenderer=(t,e)=>{const i=this._showEntityId;return a.qy` <ha-combo-box-item type="button" compact="compact" .borderTop="${0!==e}"> ${t.icon_path?a.qy` <ha-svg-icon slot="start" style="margin:0 4px" .path="${t.icon_path}"></ha-svg-icon> `:a.qy` <state-badge slot="start" .stateObj="${t.stateObj}" .hass="${this.hass}"></state-badge> `} <span slot="headline">${t.primary}</span> ${t.secondary?a.qy`<span slot="supporting-text">${t.secondary}</span>`:a.s6} ${t.stateObj&&i?a.qy` <span slot="supporting-text" class="code"> ${t.stateObj.entity_id} </span> `:a.s6} ${t.domain_name&&!i?a.qy` <div slot="trailing-supporting-text" class="domain"> ${t.domain_name} </div> `:a.s6} </ha-combo-box-item> `},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,n.A)((t,e)=>e?.length?(this.hass.loadFragmentTranslation("config"),e.map(e=>{const i=t("ui.components.entity.entity-picker.create_helper",{domain:(0,u.z)(e)?t(`ui.panel.config.helpers.types.${e}`)||e:(0,h.p$)(t,e)});return{id:b+e,primary:i,secondary:t("ui.components.entity.entity-picker.new_entity"),icon_path:v}})):[]),this._getEntitiesMemoized=(0,n.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[o]=e.splice(i,1);return e.unshift(o),e},this._notFoundLabel=t=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:a.qy`<b>‘${t}’</b>`})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"autofocus",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"required",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"allow-custom-entity"})],_.prototype,"allowCustomEntity",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-entity-id"})],_.prototype,"showEntityId",void 0),(0,o.Cg)([(0,r.MZ)()],_.prototype,"label",void 0),(0,o.Cg)([(0,r.MZ)()],_.prototype,"value",void 0),(0,o.Cg)([(0,r.MZ)()],_.prototype,"helper",void 0),(0,o.Cg)([(0,r.MZ)()],_.prototype,"placeholder",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"search-label"})],_.prototype,"searchLabel",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"createDomains",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],_.prototype,"includeDomains",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],_.prototype,"excludeDomains",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],_.prototype,"includeDeviceClasses",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"include-unit-of-measurement"})],_.prototype,"includeUnitOfMeasurement",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"include-entities"})],_.prototype,"includeEntities",void 0),(0,o.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-entities"})],_.prototype,"excludeEntities",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"entityFilter",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],_.prototype,"extraOptions",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"hide-clear-icon",type:Boolean})],_.prototype,"hideClearIcon",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"add-button",type:Boolean})],_.prototype,"addButton",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"add-button-label"})],_.prototype,"addButtonLabel",void 0),(0,o.Cg)([(0,r.P)("ha-generic-picker")],_.prototype,"_picker",void 0),(0,o.Cg)([(0,r.wk)()],_.prototype,"_pendingEntityId",void 0),_=(0,o.Cg)([(0,r.EM)("ha-entity-picker")],_),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 o=i(62826),a=i(5124),r=i(22441),n=i(63672),s=i(89784),l=i(71727),d=i(69093),c=i(52658),h=i(34470),u=i(10897),p=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 a.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 a.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 a.s6;const i=t?(0,d.t)(t):void 0;return a.qy`<ha-state-icon style="${(0,s.W)(this._iconStyle)}" data-domain="${(0,n.J)(i)}" data-state="${(0,n.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 o="";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 p.sx?i.color=(0,c.Se)(e,p.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,u.su)(i,80,80)),o=`url(${i})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),o=`url(${t})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=o}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,a.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,o.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"stateObj",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"overrideIcon",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"overrideImage",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"stateColor",void 0),(0,o.Cg)([(0,r.MZ)()],v.prototype,"color",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],v.prototype,"icon",void 0),(0,o.Cg)([(0,r.wk)()],v.prototype,"_iconStyle",void 0),v=(0,o.Cg)([(0,r.EM)("state-badge")],v),e()}catch(t){e(t)}})},76776(t,e,i){var o=i(62826),a=i(5124),r=i(22441);class n extends a.WF{render(){return a.qy` ${this.header?a.qy`<h1 class="card-header">${this.header}</h1>`:a.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}n.styles=a.AH`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,o.Cg)([(0,r.MZ)()],n.prototype,"header",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"raised",void 0),n=(0,o.Cg)([(0,r.EM)("ha-card")],n)},9503(t,e,i){var o=i(62826),a=i(97577),r=i(5124),n=i(22441);class s extends a.A{get value(){return this._value??null}set value(t){this._value=t}static get styles(){return[a.A.styles,r.AH`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
            --ha-checkbox-border-color,
            var(--ha-color-border-neutral-normal)
          );--wa-form-control-background-color:var(
            --ha-checkbox-background-color,
            var(--wa-form-control-background-color)
          );--checked-icon-color:var(
            --ha-checkbox-checked-icon-color,
            var(--wa-color-brand-on-loud)
          );--wa-form-control-activated-color:var(
            --ha-checkbox-checked-background-color,
            var(--ha-color-fill-primary-loud-resting)
          );-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
            --ha-checkbox-required-marker,
            var(--ha-input-required-marker, "*")
          );--wa-form-control-required-content-offset:var(
            --ha-checkbox-required-marker-offset,
            0.1rem
          )}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
            --ha-checkbox-border-color-hover,
            var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
          )}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`]}}s=(0,o.Cg)([(0,n.EM)("ha-checkbox")],s)},59174(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=i(35211),r=i(5124),n=i(22441),s=i(91450),l=i(22792),d=i(85694),c=i(44144),h=(i(47680),t([d]));d=(h.then?(await h)():h)[0];class u extends r.WF{render(){if(this.icon)return r.qy`<ha-icon .icon="${this.icon}"></ha-icon>`;if(!this.domain)return r.s6;if(!this._connection||!this._hassConfig)return this._renderFallback();const t=(0,d._4)(this._connection.connection,this._hassConfig.config,this.domain,this.deviceClass,this.state).then(t=>t?r.qy`<ha-icon .icon="${t}"></ha-icon>`:this._renderFallback());return r.qy`${(0,s.T)(t)}`}_renderFallback(){if(this.domain&&this.domain in d.l)return r.qy` <ha-svg-icon .path="${d.l[this.domain]}"></ha-svg-icon> `;if(this.brandFallback){const t=(0,c.MR)({domain:this.domain,type:"icon",darkOptimized:this._hassUi?.themes.darkMode},this._hassConfig?.auth.data.hassUrl);return r.qy` <img alt="" src="${t}" crossorigin="anonymous" referrerpolicy="no-referrer"> `}return r.qy`<ha-svg-icon .path="${d.lW}"></ha-svg-icon>`}}u.styles=r.AH`img{width:var(--mdc-icon-size,24px)}`,(0,o.Cg)([(0,n.MZ)()],u.prototype,"domain",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"deviceClass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"state",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"icon",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"brand-fallback",type:Boolean})],u.prototype,"brandFallback",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:l.WF,subscribe:!0})],u.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:l.Wq,subscribe:!0})],u.prototype,"_connection",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:l.EK,subscribe:!0})],u.prototype,"_hassUi",void 0),u=(0,o.Cg)([(0,n.EM)("ha-domain-icon")],u),e()}catch(t){e(t)}})},11382(t,e,i){var o=i(62826),a=i(5124),r=i(22441),n=i(6412),s=i(1087),l=i(12587);i(67094);class d extends a.WF{render(){const t=this.noCollapse?a.s6:a.qy` <ha-svg-icon .path="${"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"}" class="summary-icon ${(0,n.H)({expanded:this.expanded})}"></ha-svg-icon> `;return a.qy` <div class="top ${(0,n.H)({expanded:this.expanded})}"> <div id="summary" class="${(0,n.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:a.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?a.s6:t} <slot name="icons"></slot> </div> </div> <div class="container ${(0,n.H)({expanded:this.expanded})}" @transitionend="${this._handleTransitionEnd}" role="region" aria-labelledby="summary" aria-hidden="${!this.expanded}" tabindex="-1"> ${this._showContent?a.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,s.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,s.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=a.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,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"expanded",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],d.prototype,"outlined",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],d.prototype,"leftChevron",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],d.prototype,"noCollapse",void 0),(0,o.Cg)([(0,r.MZ)()],d.prototype,"header",void 0),(0,o.Cg)([(0,r.MZ)()],d.prototype,"secondary",void 0),(0,o.Cg)([(0,r.wk)()],d.prototype,"_showContent",void 0),(0,o.Cg)([(0,r.P)(".container")],d.prototype,"_container",void 0),d=(0,o.Cg)([(0,r.EM)("ha-expansion-panel")],d)},606(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(61701);var o=i(62826),a=i(5124),r=i(22441),n=i(63672),s=i(22786),l=i(1087),d=i(29823),c=(i(70947),i(3449),i(88285)),h=(i(67094),t([d,c]));[d,c]=h.then?(await h)():h;class u extends a.WF{render(){return this.disabled?a.qy`${this._renderField()}${this._renderHelper()}`:a.qy` <ha-dropdown placement="bottom" @wa-select="${this._handleSelect}" @wa-show="${this._handleShow}" @wa-hide="${this._handleHide}"> ${this._renderField()} ${this.options?this.options.map(t=>{const e=["string","number"].includes(typeof t);return a.qy` <ha-dropdown-item .value="${e?t:t.value}" .disabled="${!e&&(t.disabled??!1)}" .selected="${this.value===(e?t:t.value)}"> ${t.iconPath?a.qy`<ha-svg-icon slot="icon" .path="${t.iconPath}"></ha-svg-icon>`:a.s6} <div class="content"> ${e?t:t.label||t.value} ${t.secondary?a.qy`<div class="secondary">${t.secondary}</div>`:a.s6} </div> </ha-dropdown-item> `}):a.qy`<slot></slot>`} </ha-dropdown> ${this._renderHelper()} `}_renderField(){const t=this._getValueLabel(this.options,this.value);return a.qy` <ha-picker-field slot="trigger" type="button" class="${this._opened?"opened":""}" compact="compact" aria-label="${(0,n.J)(this.label)}" @clear="${this._clearValue}" .label="${this.label}" .value="${t}" .required="${this.required}" .disabled="${this.disabled}" .hideClearIcon="${!this.clearable||this.required||this.disabled||!String(this.value)}"> </ha-picker-field> `}_renderHelper(){return this.helper?a.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:a.s6}_handleSelect(t){t.stopPropagation();const e=t.detail.item.value;e!==this.value&&(0,l.r)(this,"selected",{value:e})}_clearValue(){!this.disabled&&this.value&&(0,l.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...t){super(...t),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,s.A)((t,e)=>{const i=void 0!==e?String(e):void 0;if(!t||!i)return i;for(const e of t){const t=["string","number"].includes(typeof e);if(t&&e===i||!t&&String(e.value)===i)return t?e:e.label||e.value}return i})}}u.styles=a.AH`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`,(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"clearable",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"options",void 0),(0,o.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,o.Cg)([(0,r.MZ)()],u.prototype,"helper",void 0),(0,o.Cg)([(0,r.MZ)()],u.prototype,"value",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"disabled",void 0),(0,o.Cg)([(0,r.wk)()],u.prototype,"_opened",void 0),(0,o.Cg)([(0,r.P)("ha-picker-field")],u.prototype,"_triggerField",void 0),u=(0,o.Cg)([(0,r.EM)("ha-select")],u),e()}catch(t){e(t)}})},85938(t,e,i){i(18111),i(22489),i(46058);var o=i(62826),a=i(5124),r=i(22441),n=i(1087);class s extends a.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?a.s6:a.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,o={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&&(o.draggable=this.draggableSelector),this.handleSelector&&(o.handle=this.handleSelector),void 0!==this.invertSwap&&(o.invertSwap=this.invertSwap),this.group&&(o.group=this.group),this.filter&&(o.filter=this.filter),this._sortable=new e(t,o)}_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,n.r)(this,"item-moved",{newIndex:t.newIndex,oldIndex:t.oldIndex})},this._handleAdd=t=>{(0,n.r)(this,"item-added",{index:t.newIndex,data:t.item.sortableData,item:t.item})},this._handleRemove=t=>{(0,n.r)(this,"item-removed",{index:t.oldIndex})},this._handleEnd=async t=>{(0,n.r)(this,"drag-end"),this.rollback&&t.item.placeholder&&(t.item.placeholder.replaceWith(t.item),delete t.item.placeholder)},this._handleStart=()=>{(0,n.r)(this,"drag-start")},this._handleChoose=t=>{this.rollback&&(t.item.placeholder=document.createComment("sort-placeholder"),t.item.after(t.item.placeholder))}}}(0,o.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"no-style"})],s.prototype,"noStyle",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"draggable-selector"})],s.prototype,"draggableSelector",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"handle-selector"})],s.prototype,"handleSelector",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"filter"})],s.prototype,"filter",void 0),(0,o.Cg)([(0,r.MZ)({type:String})],s.prototype,"group",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"invert-swap"})],s.prototype,"invertSwap",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],s.prototype,"options",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],s.prototype,"rollback",void 0),s=(0,o.Cg)([(0,r.EM)("ha-sortable")],s)},93367(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=i(35211),r=i(5124),n=i(22441),s=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 u extends r.WF{render(){const t=this.icon||this.stateObj&&this._entities?.[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(t)return r.qy`<ha-icon .icon="${t}"></ha-icon>`;if(!this.stateObj)return r.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?r.qy`<ha-icon .icon="${t}"></ha-icon>`:this._renderFallback());return r.qy`${(0,s.T)(e)}`}_renderFallback(){const t=(0,l.t)(this.stateObj);return r.qy` <ha-svg-icon .path="${c.l[t]||c.lW}"></ha-svg-icon> `}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"stateObj",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"stateValue",void 0),(0,o.Cg)([(0,n.MZ)()],u.prototype,"icon",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:d.WF,subscribe:!0})],u.prototype,"_config",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:d.Wq,subscribe:!0})],u.prototype,"_connection",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:d.X1,subscribe:!0})],u.prototype,"_entities",void 0),u=(0,o.Cg)([(0,n.EM)("ha-state-icon")],u),e()}catch(t){e(t)}})},10763(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),a=i(53289),r=i(5124),n=i(22441),s=i(35211),l=i(1087),d=i(63130),c=i(14503),h=i(81619),u=i(18350),p=i(15717),g=i(22792),y=t([u,p]);[u,p]=y.then?(await y)():y;const m=t=>{if("object"!=typeof t||null===t)return!1;for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0};class v extends r.WF{setValue(t){try{this._yaml=m(t)?"":(0,a.dump)(t,{schema:this.yamlSchema,quotingType:'"',noRefs:!0})}catch(e){console.error(e,t),alert(`There was an error converting to YAML: ${e}`)}}firstUpdated(){void 0!==this.defaultValue&&this.setValue(this.defaultValue)}willUpdate(t){super.willUpdate(t),this.autoUpdate&&t.has("value")&&this.setValue(this.value)}focus(){this._codeEditor?.codemirror&&this._codeEditor?.codemirror.focus()}disableCodeEditorFullscreen(){this.disableFullscreen=!0,this._codeEditor&&(this._codeEditor.disableFullscreen=!0)}render(){return void 0===this._yaml?r.s6:r.qy` ${this.label?r.qy`<p>${this.label}${this.required?" *":""}</p>`:r.s6} <ha-code-editor .value="${this._yaml}" .readOnly="${this.readOnly}" .disableFullscreen="${this.disableFullscreen}" .inDialog="${this.inDialog}" mode="yaml" lint autocomplete-entities autocomplete-icons .error="${!1===this.isValid}" @value-changed="${this._onChange}" @editor-save="${this._onEditorSave}" dir="ltr"></ha-code-editor> ${this.copyClipboard||this.hasExtraActions?r.qy` <div class="card-actions"> ${this.copyClipboard?r.qy` <ha-button appearance="plain" @click="${this._copyYaml}"> ${this._i18n.localize("ui.components.yaml-editor.copy_to_clipboard")} </ha-button> `:r.s6} <slot name="extra-actions"></slot> </div> `:r.s6} `}_onChange(t){let e;t.stopPropagation(),this._yaml=t.detail.value;let i,o=!0,r=null;if(this._yaml)try{e=(0,a.Hh)(this._yaml,{schema:this.yamlSchema})}catch(t){o=!1,r=t,i=`${this._i18n.localize("ui.components.yaml-editor.error",{reason:t.reason})}${t.mark?` (${this._i18n.localize("ui.components.yaml-editor.error_location",{line:t.mark.line+1,column:t.mark.column+1})})`:""}`}else e={};this._codeEditor?.setYamlError(r),this.value=e,this.isValid=o,(0,l.r)(this,"value-changed",{value:e,isValid:o,errorMsg:i})}get yaml(){return this._yaml}get codemirror(){return this._codeEditor?.codemirror}get hasComments(){return this._codeEditor?.hasComments??!1}_onEditorSave(t){(0,l.r)(this,"editor-save"),t.stopPropagation()}async _copyYaml(){this.yaml&&(await(0,d.l)(this.yaml),(0,h.P)(this,{message:this._i18n.localize("ui.common.copied_clipboard")}))}static get styles(){return[c.RF,r.AH`.card-actions{border-radius:var(--actions-border-radius,var(--ha-border-radius-square) var(--ha-border-radius-square) var(--ha-card-border-radius,var(--ha-border-radius-lg)) var(--ha-card-border-radius,var(--ha-border-radius-lg)));border:1px solid var(--divider-color);padding:5px 16px}ha-code-editor{flex-grow:1;min-height:0}`]}constructor(...t){super(...t),this.yamlSchema=a.my,this.isValid=!0,this.autoUpdate=!1,this.readOnly=!1,this.disableFullscreen=!1,this.inDialog=!1,this.required=!1,this.copyClipboard=!1,this.hasExtraActions=!1,this._yaml=""}}(0,o.Cg)([(0,n.MZ)()],v.prototype,"value",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"yamlSchema",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"defaultValue",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-valid",type:Boolean})],v.prototype,"isValid",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"auto-update",type:Boolean})],v.prototype,"autoUpdate",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"read-only",type:Boolean})],v.prototype,"readOnly",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"disable-fullscreen"})],v.prototype,"disableFullscreen",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"in-dialog"})],v.prototype,"inDialog",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"required",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"copy-clipboard",type:Boolean})],v.prototype,"copyClipboard",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"has-extra-actions",type:Boolean})],v.prototype,"hasExtraActions",void 0),(0,o.Cg)([(0,n.wk)()],v.prototype,"_yaml",void 0),(0,o.Cg)([(0,n.wk)(),(0,s.Fg)({context:g.D5,subscribe:!0})],v.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.P)("ha-code-editor")],v.prototype,"_codeEditor",void 0),v=(0,o.Cg)([(0,n.EM)("ha-yaml-editor")],v),e()}catch(t){e(t)}})},89081(t,e,i){i.d(e,{D:()=>r});var o=i(1087);const a=()=>Promise.all([i.e(8697),i.e(686)]).then(i.bind(i,25563)),r=(t,e)=>(0,o.r)(t,"show-dialog",{dialogTag:"ha-dialog-target-details",dialogImport:a,dialogParams:e})},79800(t,e,i){i.a(t,async function(t,o){try{i.d(e,{g:()=>$,p:()=>A});i(74423),i(44114),i(18111),i(20116),i(61701),i(33110);var a=i(31886),r=i(44537),n=i(82591),s=i(30162),l=i(27167),d=i(53610),c=i(28978),h=i(78649),u=i(8185),p=i(24790),g=i(87225),y=i(10139),m=i(3496),v=t([a,s,n,d,u]);[a,s,n,d,u]=v.then?(await v)():v;const f="ui.panel.config.automation.editor.triggers.type",b="ui.panel.config.automation.editor.conditions.type",_=(t,e)=>{let i;return i="number"==typeof e?(0,l.A)(e):"string"==typeof e?e:(0,n.nR)(t,e),i},w=(t,e,i)=>{const o=t.split(":");if(o.length<2||o.length>3)return t;try{const t=Number(o[0]),r=Number(o[1]),n=o.length>2?Number(o[2]):0,l=new Date,d=new a.BB(l.getFullYear(),l.getMonth(),l.getDate(),t,r,n,i.time_zone);return 2===o.length||0===n?(0,s.fU)(d,e,i):(0,s.ie)(d,e,i)}catch{return t}},C=(t,e)=>"string"==typeof e&&(0,h.n)(e)&&t.states[e]&&(0,c.u)(t.states[e])||e,$=(t,e,i,o=!1)=>{try{const a=x(t,e,i,o);if("string"!=typeof a)throw new Error(String(a));return a}catch(t){console.error(t);let e="Error in describing trigger";return t.message&&(e+=": "+t.message),e}},x=(t,e,i,o=!1)=>{if((0,m.H4)(t)){const i=(0,r.e)(t.triggers);if(!i||0===i.length)return e.localize(`${f}.list.description.no_trigger`);const o=i.length;return e.localize(`${f}.list.description.full`,{count:o})}if(t.alias&&!o)return t.alias;const a=k(t,e,i);if(a)return a;const n=t.trigger,s=(0,m.zz)(t.trigger),l=(0,m.hN)(t.trigger);return e.localize(`component.${s}.triggers.${l}.name`)||e.localize(`ui.panel.config.automation.editor.triggers.type.${n}.label`)||e.localize("ui.panel.config.automation.editor.triggers.unknown_trigger")},k=(t,e,i)=>{if("event"===t.trigger&&t.event_type){const i=[];if(Array.isArray(t.event_type))for(const e of t.event_type.values())i.push(e);else i.push(t.event_type);const o=(0,u.q)(e.locale,i);return e.localize(`${f}.event.description.full`,{eventTypes:o})}if("homeassistant"===t.trigger&&t.event)return e.localize("start"===t.event?`${f}.homeassistant.description.started`:`${f}.homeassistant.description.shutdown`);if("numeric_state"===t.trigger&&t.entity_id){const i=[],o=e.states,a=Array.isArray(t.entity_id)?e.states[t.entity_id[0]]:e.states[t.entity_id];if(Array.isArray(t.entity_id))for(const e of t.entity_id.values())o[e]&&i.push((0,c.u)(o[e])||e);else t.entity_id&&i.push(o[t.entity_id]?(0,c.u)(o[t.entity_id]):t.entity_id);const r=t.attribute?a?(0,d.computeAttributeNameDisplay)(e.localize,a,e.entities,t.attribute):t.attribute:void 0,n=t.for?_(e.locale,t.for):void 0;if(void 0!==t.above&&void 0!==t.below)return e.localize(`${f}.numeric_state.description.above-below`,{attribute:r,entity:(0,u.q)(e.locale,i),numberOfEntities:i.length,above:C(e,t.above),below:C(e,t.below),duration:n});if(void 0!==t.above)return e.localize(`${f}.numeric_state.description.above`,{attribute:r,entity:(0,u.q)(e.locale,i),numberOfEntities:i.length,above:C(e,t.above),duration:n});if(void 0!==t.below)return e.localize(`${f}.numeric_state.description.below`,{attribute:r,entity:(0,u.q)(e.locale,i),numberOfEntities:i.length,below:C(e,t.below),duration:n})}if("state"===t.trigger){const i=[],o=e.states;let a="";if(t.attribute){const i=Array.isArray(t.entity_id)?e.states[t.entity_id[0]]:e.states[t.entity_id];a=i?(0,d.computeAttributeNameDisplay)(e.localize,i,e.entities,t.attribute):t.attribute}const n=(0,r.e)(t.entity_id);if(n)for(const t of n)o[t]&&i.push((0,c.u)(o[t])||t);const s=e.states[n[0]];let l="other",h="";if(void 0!==t.from)if(null===t.from)t.attribute||(l="null");else{const i=(0,r.e)(t.from),o=[];for(const a of i)o.push(s?t.attribute?e.formatEntityAttributeValue(s,t.attribute,a).toString():e.formatEntityState(s,a):a);0!==o.length&&(h=(0,u.q)(e.locale,o),l="fromUsed")}let p="other",g="";if(void 0!==t.to)if(null===t.to)t.attribute||(p="null");else{const i=(0,r.e)(t.to),o=[];for(const a of i)o.push(s?t.attribute?e.formatEntityAttributeValue(s,t.attribute,a).toString():e.formatEntityState(s,a).toString():a);0!==o.length&&(g=(0,u.q)(e.locale,o),p="toUsed")}t.attribute||void 0!==t.from||void 0!==t.to||(p="special");let y="";return t.for&&(y=_(e.locale,t.for)??""),e.localize(`${f}.state.description.full`,{hasAttribute:""!==a?"true":"false",attribute:a,hasEntity:0!==i.length?"true":"false",entity:(0,u.q)(e.locale,i),fromChoice:l,fromString:h,toChoice:p,toString:g,hasDuration:""!==y?"true":"false",duration:y})}if("sun"===t.trigger&&t.event){let i="";return t.offset&&(i="number"==typeof t.offset?(0,l.A)(t.offset):"string"==typeof t.offset?t.offset:JSON.stringify(t.offset)),e.localize("sunset"===t.event?`${f}.sun.description.sets`:`${f}.sun.description.rises`,{hasDuration:""!==i?"true":"false",duration:i})}if("tag"===t.trigger){const i=Object.values(e.states).find(e=>e.entity_id.startsWith("tag.")&&e.attributes.tag_id===t.tag_id);return i?e.localize(`${f}.tag.description.known_tag`,{tag_name:(0,c.u)(i)}):e.localize(`${f}.tag.description.full`)}if("time"===t.trigger&&t.at){const i=(0,r.e)(t.at).map(t=>{if("string"==typeof t)return(0,h.n)(t)?`entity ${e.states[t]?(0,c.u)(e.states[t]):t}`:w(t,e.locale,e.config);return`${`entity ${e.states[t.entity_id]?(0,c.u)(e.states[t.entity_id]):t.entity_id}`}${t.offset?" "+e.localize(`${f}.time.offset_by`,{offset:_(e.locale,t.offset)}):""}`});let o=[];if(t.weekday){const i=(0,r.e)(t.weekday);i.length>0&&(o=i.map(t=>e.localize(`ui.panel.config.automation.editor.triggers.type.time.weekdays.${t}`)))}return e.localize(`${f}.time.description.full`,{time:(0,u.q)(e.locale,i),hasWeekdays:o.length>0?"true":"false",weekdays:(0,u.q)(e.locale,o)})}if("time_pattern"===t.trigger){if(!t.seconds&&!t.minutes&&!t.hours)return e.localize(`${f}.time_pattern.description.initial`);const i=[];let o,a="other",r="other",n=0,s=0,l=0;if(void 0!==t.seconds){const e="*"===t.seconds,o="string"==typeof t.seconds&&t.seconds.startsWith("/");n=e?0:"number"==typeof t.seconds?t.seconds:o?parseInt(t.seconds.substring(1)):parseInt(t.seconds),(isNaN(n)||n>59||n<0||o&&0===n)&&i.push("seconds"),a=e||o&&1===n?"every":o?"every_interval":"on_the_xth"}if(void 0!==t.minutes){const e="*"===t.minutes,o="string"==typeof t.minutes&&t.minutes.startsWith("/");s=e?0:"number"==typeof t.minutes?t.minutes:o?parseInt(t.minutes.substring(1)):parseInt(t.minutes),(isNaN(s)||s>59||s<0||o&&0===s)&&i.push("minutes"),r=e||o&&1===s?"every":o?"every_interval":void 0!==t.seconds?"has_seconds":"on_the_xth"}else void 0!==t.seconds&&(void 0!==t.hours?(s=0,r="has_seconds"):r="every");if(void 0!==t.hours){const e="*"===t.hours,a="string"==typeof t.hours&&t.hours.startsWith("/");l=e?0:"number"==typeof t.hours?t.hours:a?parseInt(t.hours.substring(1)):parseInt(t.hours),(isNaN(l)||l>23||l<0||a&&0===l)&&i.push("hours"),o=e||a&&1===l?"every":a?"every_interval":void 0!==t.seconds||void 0!==t.minutes?"has_seconds_or_minutes":"on_the_xth"}else o="every";return 0!==i.length?e.localize(`${f}.time_pattern.description.invalid`,{parts:(0,u.c)(e.locale,i.map(t=>e.localize(`${f}.time_pattern.${t}`)))}):e.localize(`${f}.time_pattern.description.full`,{secondsChoice:a,minutesChoice:r,hoursChoice:o,seconds:n,minutes:s,hours:l,secondsWithOrdinal:e.localize(`${f}.time_pattern.description.ordinal`,{part:n}),minutesWithOrdinal:e.localize(`${f}.time_pattern.description.ordinal`,{part:s}),hoursWithOrdinal:e.localize(`${f}.time_pattern.description.ordinal`,{part:l})})}if("zone"===t.trigger&&t.entity_id&&t.zone){const i=[],o=[],a=e.states;if(Array.isArray(t.entity_id))for(const e of t.entity_id.values())a[e]&&i.push((0,c.u)(a[e])||e);else i.push(a[t.entity_id]?(0,c.u)(a[t.entity_id]):t.entity_id);if(Array.isArray(t.zone))for(const e of t.zone.values())a[e]&&o.push((0,c.u)(a[e])||e);else o.push(a[t.zone]?(0,c.u)(a[t.zone]):t.zone);return e.localize(`${f}.zone.description.full`,{entity:(0,u.q)(e.locale,i),event:t.event.toString(),zone:(0,u.q)(e.locale,o),numberOfZones:o.length})}if("geo_location"===t.trigger&&t.source&&t.zone){const i=[],o=[],a=e.states;if(Array.isArray(t.source))for(const e of t.source.values())i.push(e);else i.push(t.source);if(Array.isArray(t.zone))for(const e of t.zone.values())a[e]&&o.push((0,c.u)(a[e])||e);else o.push(a[t.zone]?(0,c.u)(a[t.zone]):t.zone);return e.localize(`${f}.geo_location.description.full`,{source:(0,u.q)(e.locale,i),event:t.event.toString(),zone:(0,u.q)(e.locale,o),numberOfZones:o.length})}if("mqtt"===t.trigger)return e.localize(`${f}.mqtt.description.full`);if("template"===t.trigger){let i="";return t.for&&(i=_(e.locale,t.for)??""),e.localize(`${f}.template.description.full`,{hasDuration:""!==i?"true":"false",duration:i})}if("webhook"===t.trigger)return e.localize(`${f}.webhook.description.full`);if("conversation"===t.trigger){if(!t.command||!t.command.length)return e.localize(`${f}.conversation.description.empty`);const i=(0,r.e)(t.command);return 1===i.length?e.localize(`${f}.conversation.description.single`,{sentence:i[0]}):e.localize(`${f}.conversation.description.multiple`,{sentence:i[0],count:i.length-1})}if("persistent_notification"===t.trigger)return e.localize(`${f}.persistent_notification.description.full`);if("device"===t.trigger&&t.device_id){const o=t,a=(0,y.nx)(e.localize,e.states,i,o);if(a)return a;const r=e.states[o.entity_id];return`${r?(0,c.u)(r):o.entity_id} ${o.type}`}if("calendar"===t.trigger){const i=e.states[t.entity_id]?(0,c.u)(e.states[t.entity_id]):t.entity_id;let o="other",a="";if(t.offset){o=t.offset.startsWith("-")?"before":"after";const i=t.offset.startsWith("-")?t.offset.substring(1).split(":"):t.offset.split(":"),r={hours:i.length>0?+i[0]:0,minutes:i.length>1?+i[1]:0,seconds:i.length>2?+i[2]:0};a=(0,n.i)(e.locale,r),""===a&&(o="other")}return e.localize(`${f}.calendar.description.full`,{eventChoice:t.event,offsetChoice:o,offset:a,hasCalendar:t.entity_id?"true":"false",calendar:i})}},M=(t,e)=>{if(!e)return"";if("number"==typeof e)return(0,l.A)(e);if("string"==typeof e)return e;try{const i=(0,n.E2)(t.locale,e);return i.startsWith("-")?i:`+${i}`}catch(t){return JSON.stringify(e)}},A=(t,e,i,o=!1)=>{try{const a=z(t,e,i,o);if("string"!=typeof a)throw new Error(String(a));return a}catch(t){console.error(t);let e="Error in describing condition";return t.message&&(e+=": "+t.message),e}},z=(t,e,i,o=!1)=>{if("string"==typeof t&&(0,p.r)(t))return e.localize(`${b}.template.description.full`);if(t.alias&&!o)return t.alias;if(!t.condition){const e=["and","or","not"];for(const i of e)i in t&&(0,r.e)(t[i])&&(t={condition:i,conditions:t[i]})}const a=L(t,e,i);if(a)return a;const n=t.condition,s=(0,g.ob)(t.condition),l=(0,g.YQ)(t.condition);return e.localize(`component.${s}.conditions.${l}.name`)||e.localize(`ui.panel.config.automation.editor.conditions.type.${n}.label`)||e.localize("ui.panel.config.automation.editor.conditions.unknown_condition")},L=(t,e,i)=>{if("or"===t.condition){const i=(0,r.e)(t.conditions);if(!i||0===i.length)return e.localize(`${b}.or.description.no_conditions`);const o=i.length;return e.localize(`${b}.or.description.full`,{count:o})}if("and"===t.condition){const i=(0,r.e)(t.conditions);if(!i||0===i.length)return e.localize(`${b}.and.description.no_conditions`);const o=i.length;return e.localize(`${b}.and.description.full`,{count:o})}if("not"===t.condition){const i=(0,r.e)(t.conditions);return i&&0!==i.length?1===i.length?e.localize(`${b}.not.description.one_condition`):e.localize(`${b}.not.description.full`,{count:i.length}):e.localize(`${b}.not.description.no_conditions`)}if("state"===t.condition){if(!t.entity_id)return e.localize(`${b}.state.description.no_entity`);let i="";if(t.attribute){const o=Array.isArray(t.entity_id)?e.states[t.entity_id[0]]:e.states[t.entity_id];i=o?(0,d.computeAttributeNameDisplay)(e.localize,o,e.entities,t.attribute):t.attribute}const o=[];if(Array.isArray(t.entity_id))for(const i of t.entity_id.values())e.states[i]&&o.push((0,c.u)(e.states[i])||i);else t.entity_id&&o.push(e.states[t.entity_id]?(0,c.u)(e.states[t.entity_id]):t.entity_id);const a=[],r=e.states[Array.isArray(t.entity_id)?t.entity_id[0]:t.entity_id];if(Array.isArray(t.state))for(const i of t.state.values())a.push(r?t.attribute?e.formatEntityAttributeValue(r,t.attribute,i).toString():e.formatEntityState(r,i):i);else""!==t.state&&a.push(r?t.attribute?e.formatEntityAttributeValue(r,t.attribute,t.state).toString():e.formatEntityState(r,t.state.toString()):t.state.toString());let n="";return t.for&&(n=_(e.locale,t.for)||""),e.localize(`${b}.state.description.full`,{hasAttribute:""!==i?"true":"false",attribute:i,numberOfEntities:o.length,entities:"any"===t.match?(0,u.q)(e.locale,o):(0,u.c)(e.locale,o),numberOfStates:a.length,states:(0,u.q)(e.locale,a),hasDuration:""!==n?"true":"false",duration:n})}if("numeric_state"===t.condition&&t.entity_id){const i=(0,r.e)(t.entity_id),o=e.states[i[0]],a=(0,u.c)(e.locale,i.map(t=>e.states[t]?(0,c.u)(e.states[t]):t||"")),n=t.attribute?o?(0,d.computeAttributeNameDisplay)(e.localize,o,e.entities,t.attribute):t.attribute:void 0;if(void 0!==t.above&&void 0!==t.below)return e.localize(`${b}.numeric_state.description.above-below`,{attribute:n,entity:a,numberOfEntities:i.length,above:C(e,t.above),below:C(e,t.below)});if(void 0!==t.above)return e.localize(`${b}.numeric_state.description.above`,{attribute:n,entity:a,numberOfEntities:i.length,above:C(e,t.above)});if(void 0!==t.below)return e.localize(`${b}.numeric_state.description.below`,{attribute:n,entity:a,numberOfEntities:i.length,below:C(e,t.below)})}if("time"===t.condition){const i=(0,r.e)(t.weekday),o=i&&i.length>0&&i.length<7;if(t.before||t.after||o){const a="string"!=typeof t.before?t.before:t.before.includes(".")?`entity ${e.states[t.before]?(0,c.u)(e.states[t.before]):t.before}`:w(t.before,e.locale,e.config),r="string"!=typeof t.after?t.after:t.after.includes(".")?`entity ${e.states[t.after]?(0,c.u)(e.states[t.after]):t.after}`:w(t.after,e.locale,e.config);let n=[];o&&(n=i.map(t=>e.localize(`ui.panel.config.automation.editor.conditions.type.time.weekdays.${t}`)));let s="";return void 0!==r&&void 0!==a?s="string"==typeof t.after&&!t.after.includes(".")&&"string"==typeof t.before&&!t.before.includes(".")&&t.after>t.before?"after_before_or":"after_before":void 0!==r?s="after":void 0!==a&&(s="before"),e.localize(`${b}.time.description.full`,{hasTime:s,hasTimeAndDay:(r||a)&&o?"true":"false",hasDay:o?"true":"false",time_before:a,time_after:r,day:(0,u.q)(e.locale,n)})}}if("sun"===t.condition&&(t.before||t.after)){const i=t.after?M(e,t.after_offset):"",o=t.before?M(e,t.before_offset):"";return e.localize(`${b}.sun.description.${t.before&&t.after?"between":t.before?"before":"after"}`,{afterChoice:t.after??"other",afterOffsetChoice:""!==i?"offset":"other",afterOffset:i,beforeChoice:t.before??"other",beforeOffsetChoice:""!==o?"offset":"other",beforeOffset:o})}if("zone"===t.condition&&t.entity_id&&t.zone){const i=[],o=[],a=e.states;if(Array.isArray(t.entity_id))for(const e of t.entity_id.values())a[e]&&i.push((0,c.u)(a[e])||e);else i.push(a[t.entity_id]?(0,c.u)(a[t.entity_id]):t.entity_id);if(Array.isArray(t.zone))for(const e of t.zone.values())a[e]&&o.push((0,c.u)(a[e])||e);else o.push(a[t.zone]?(0,c.u)(a[t.zone]):t.zone);const r=(0,u.q)(e.locale,i),n=(0,u.q)(e.locale,o);return e.localize(`${b}.zone.description.full`,{entity:r,numberOfEntities:i.length,zone:n,numberOfZones:o.length})}if("device"===t.condition&&t.device_id){const o=t,a=(0,y.I3)(e.localize,e.states,i,o);if(a)return a;const r=e.states[o.entity_id];return`${r?(0,c.u)(r):o.entity_id} ${o.type}`}return"template"===t.condition?e.localize(`${b}.template.description.full`):"trigger"===t.condition&&null!=t.id?e.localize(`${b}.trigger.description.full`,{id:(0,u.q)(e.locale,(0,r.e)(t.id).map(t=>t.toString()))}):void 0};o()}catch(t){o(t)}})},10897(t,e,i){i.d(e,{C4:()=>d,CK:()=>l,FX:()=>y,UC:()=>p,_Z:()=>b,bT:()=>_,j4:()=>v,sd:()=>r,su:()=>s,vc:()=>f,w8:()=>u,wv:()=>h,y3:()=>g,zS:()=>n});var o=i(3931),a=i(82e3);const r=[1,2,3,4,6,8],n="web_rtc",s=(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,a)=>{const r=await(0,o.U)("_cameraTmbUrl",9e3,c,t,e);return s(r,i,a)},c=async(t,e)=>{const i=await(0,a.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},h=async(t,e,i)=>{const o={type:"camera/stream",entity_id:e};i&&(o.format=i);const a=await t.callWS(o);return a.url=t.hassUrl(a.url),a},u=(t,e,i,o)=>t.connection.subscribeMessage(o,{type:"camera/webrtc/offer",entity_id:e,offer:i}),p=(t,e,i,o)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:o}),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),f=t=>t.substring(22),b=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),_=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},38279(t,e,i){i.d(e,{$2:()=>o,VV:()=>r,on:()=>l,sx:()=>n});var o=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 a=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((t,e,i)=>(t[e]=i,t),{}),r=(t,e)=>a[t]-a[e],n={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},s={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=>s[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"},12596(t,e,i){i.d(e,{$:()=>o});const o=(t,e)=>t.callWS({type:"validate_config",...e})},10139(t,e,i){i.d(e,{I$:()=>c,I3:()=>v,PV:()=>m,Po:()=>p,RK:()=>w,TB:()=>h,TH:()=>_,T_:()=>b,am:()=>n,jR:()=>d,ng:()=>s,nx:()=>f,o9:()=>l});i(74423);var o=i(28978),a=i(88249),r=i(59241);const n=(t,e)=>t({type:"device_automation/action/list",device_id:e}),s=(t,e)=>t({type:"device_automation/condition/list",device_id:e}),l=(t,e)=>t({type:"device_automation/trigger/list",device_id:e}).then(t=>(0,a.vO)(t)),d=(t,e)=>t({type:"device_automation/action/capabilities",action:e}),c=(t,e)=>t({type:"device_automation/condition/capabilities",condition:e}),h=(t,e)=>t({type:"device_automation/trigger/capabilities",trigger:e}),u=["device_id","domain","entity_id","type","subtype","event","condition","trigger"],p=(t,e,i)=>{if(typeof e!=typeof i)return!1;for(const o in e)if(u.includes(o))if("entity_id"!==o||e[o]?.includes(".")===i[o]?.includes(".")){if(!Object.is(e[o],i[o]))return!1}else if(!g(t,e[o],i[o]))return!1;for(const o in i)if(u.includes(o))if("entity_id"!==o||e[o]?.includes(".")===i[o]?.includes(".")){if(!Object.is(e[o],i[o]))return!1}else if(!g(t,e[o],i[o]))return!1;return!0},g=(t,e,i)=>{if(!e||!i)return!1;if(e.includes(".")){const i=(0,r.Ox)(t)[e];if(!i)return!1;e=i.id}if(i.includes(".")){const e=(0,r.Ox)(t)[i];if(!e)return!1;i=e.id}return e===i},y=(t,e,i,a)=>{if(!a)return`<${t("ui.panel.config.automation.editor.unknown_entity")}>`;if(a.includes(".")){const t=e[a];return t?(0,o.u)(t):a}const n=(0,r.P9)(i)[a];if(n){if(n.name)return n.name;const t=e[n.entity_id];return t?(0,o.u)(t):n.original_name??a}return`<${t("ui.panel.config.automation.editor.unknown_entity")}>`},m=(t,e,i,o)=>t(`component.${o.domain}.device_automation.action_type.${o.type}`,{entity_name:y(t,e,i,o.entity_id),subtype:o.subtype?t(`component.${o.domain}.device_automation.action_subtype.${o.subtype}`)||o.subtype:""})||(o.subtype?`"${o.subtype}" ${o.type}`:o.type),v=(t,e,i,o)=>t(`component.${o.domain}.device_automation.condition_type.${o.type}`,{entity_name:y(t,e,i,o.entity_id),subtype:o.subtype?t(`component.${o.domain}.device_automation.condition_subtype.${o.subtype}`)||o.subtype:""})||(o.subtype?`"${o.subtype}" ${o.type}`:o.type),f=(t,e,i,o)=>t(`component.${o.domain}.device_automation.trigger_type.${o.type}`,{entity_name:y(t,e,i,o.entity_id),subtype:o.subtype?t(`component.${o.domain}.device_automation.trigger_subtype.${o.subtype}`)||o.subtype:""})||(o.subtype?`"${o.subtype}" ${o.type}`:o.type),b=(t,e)=>i=>t(`component.${e.domain}.device_automation.extra_fields.${i.name}`)||i.name,_=(t,e)=>i=>t(`component.${e.domain}.device_automation.extra_fields_descriptions.${i.name}`),w=(t,e)=>t.metadata?.secondary&&!e.metadata?.secondary?1:!t.metadata?.secondary&&e.metadata?.secondary?-1:0},53756(t,e,i){i.d(e,{t:()=>l,w:()=>d});i(74423),i(18111),i(22489),i(61701);var o=i(71727),a=i(74705),r=i(28978),n=i(15638),s=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,u,p,g="")=>{let y,m=Object.keys(t.states);return h&&(m=m.filter(t=>h.includes(t))),u&&(m=m.filter(t=>!u.includes(t))),e&&(m=m.filter(t=>e.includes((0,o.m)(t)))),i&&(m=m.filter(t=>!i.includes((0,o.m)(t)))),y=m.map(e=>{const i=t.states[e],l=(0,r.u)(i),[d,c,h]=(0,a.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),u=(0,s.p$)(t.localize,(0,o.m)(e)),p=(0,n.qC)(t.language,t.translationMetadata.translations),y=d||c||e,m=[h,d?c:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${g}${e}`,primary:y,secondary:m,domain_name:u,sorting_label:[y,m].filter(Boolean).join("_"),search_labels:{entityName:d||null,deviceName:c||null,areaName:h||null,domainName:u||null,friendlyName:l||null,entityId:e},stateObj:i}}),d&&(y=y.filter(t=>t.id===p||t.stateObj?.attributes.device_class&&d.includes(t.stateObj.attributes.device_class))),c&&(y=y.filter(t=>t.id===p||t.stateObj?.attributes.unit_of_measurement&&c.includes(t.stateObj.attributes.unit_of_measurement))),l&&(y=y.filter(t=>t.id===p||t.stateObj&&l(t.stateObj))),y}},93758(t,e,i){if(i.d(e,{CO:()=>c,NS:()=>d,f$:()=>r,ok:()=>n}),66649!=i.j)var o=i(35518);if(66649!=i.j)var a=i(9899);const r=async t=>(await t.callWS({type:"labs/list"})).features,n=(t,e,i,o,a)=>t.callWS({type:"labs/update",domain:e,preview_feature:i,enabled:o,...void 0!==a&&{create_backup:a}}),s=t=>t.sendMessagePromise({type:"labs/list"}).then(t=>t.features),l=(t,e)=>t.subscribeEvents((0,a.s)(()=>s(t).then(t=>e.setState(t,!0)),500,!0),"labs_updated"),d=(t,e)=>(0,o.N)("_labFeatures",s,l,t,e),c=(t,e,i,o)=>t.subscribeMessage(o,{type:"labs/subscribe",domain:e,preview_feature:i})},88555(t,e,i){i.d(e,{F7:()=>n,G_:()=>r,Kx:()=>h,Ly:()=>u,OJ:()=>g,YK:()=>p,aW:()=>s,j_:()=>c,oV:()=>l,vN:()=>d});i(74423),i(18111),i(22489),i(13579);var o=i(44537),a=i(71727);const r="________",n=async(t,e,i=!1,o=!0)=>t({type:"extract_from_target",target:e,expand_group:i,primary_entities_only:o}),s=t=>{const e=t?.entity_id?(0,o.e)(t?.entity_id):[],i=t?.device_id?(0,o.e)(t?.device_id):[],a=t?.area_id?(0,o.e)(t?.area_id):[],r=t?.floor_id?(0,o.e)(t?.floor_id):[],n=t?.label_id?(0,o.e)(t?.label_id):[];return i?.length>0||a?.length>0||r?.length>0||n?.length>0?1/0:e?.length},l=async(t,e,i=!0)=>t({type:"get_triggers_for_target",target:e,expand_group:i}),d=async(t,e,i=!0)=>t({type:"get_conditions_for_target",target:e,expand_group:i}),c=async(t,e,i=!0)=>t({type:"get_services_for_target",target:e,expand_group:i}),h=(t,e,i,o,a,r,n,s,l=!1)=>{if(Object.values(e).filter(e=>e.area_id===t.area_id).some(t=>u(t,i,o,a,r,n,s,l)))return!0;return!!Object.values(i).filter(e=>e.area_id===t.area_id).some(t=>p(t,l,a,r,n,s))},u=(t,e,i,o,a,r,n,s=!1)=>!!Object.values(e).filter(e=>e.device_id===t.id).some(t=>p(t,s,o,a,r,n))&&(!i||i(t)),p=(t,e=!1,i,o,r,n)=>{if(t.hidden||t.entity_category&&!e)return!1;if(i&&!i.includes((0,a.m)(t.entity_id)))return!1;if(o){const e=r?.[t.entity_id];if(!e)return!1;if(!e.attributes.device_class||!o.includes(e.attributes.device_class))return!1}if(n){const e=r?.[t.entity_id];return!!e&&n(e)}return!0},g=t=>"area"===t.type||"floor"===t.type?t.type:"domain"in t?"device":"stateObj"in t?"entity":"___EMPTY_SEARCH___"===t.id?"empty":"label"},42269(t,e,i){i.d(e,{p:()=>a});var o=i(1087);const a=(t,e)=>(0,o.r)(t,"hass-more-info",e)},54706(t,e,i){i.d(e,{E:()=>r});i(74423),i(18111),i(13579);var o=i(62826),a=i(22441);const r=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.some(t=>void 0===this[t])&&(this.__unsubs=this.hassSubscribe())}}return(0,o.Cg)([(0,a.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},49053(t,e,i){i.d(e,{c:()=>r});var o=i(62371),a=i(81619);function r(t,e){const i=function(t){if("ha-automation-editor"===t.localName||"ha-script-editor"===t.localName)return Boolean(t.dirty);const e=(0,o.T)(t,"dirty",!1);return Boolean(e?.dirty)}(t)?60:void 0;(0,a.P)(t,{...e,...void 0!==i?{bottomOffset:i}:{},dismissable:!0})}},15702(t,e,i){i.a(t,async function(t,e){try{i(18111),i(61701);var o=i(62826),a=i(5124),r=i(22441),n=i(38962),s=t([n]);n=(s.then?(await s)():s)[0];class l extends a.WF{render(){return a.qy` <ha-alert alert-type="warning" .title="${this.alertTitle||this.localize("ui.errors.config.editor_not_supported")}"> ${this.warnings.length&&void 0!==this.warnings[0]?a.qy`<ul> ${this.warnings.map(t=>a.qy`<li>${t}</li>`)} </ul>`:a.s6} ${this.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `}constructor(...t){super(...t),this.warnings=[]}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"localize",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"alert-title"})],l.prototype,"alertTitle",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"warnings",void 0),l=(0,o.Cg)([(0,r.EM)("ha-automation-editor-warning")],l),e()}catch(t){e(t)}})},41175(t,e,i){i.d(e,{j:()=>c});i(71658),i(18111),i(22489),i(88454),i(29452);var o=i(62826),a=i(34271),r=i(22441),n=i(44537),s=i(93905),l=i(1087),d=i(12587);const c=t=>{class e extends t{get items(){throw new Error("Not implemented")}set items(t){throw new Error("Not implemented")}getKey(t){return this._itemKeys.has(t)||this._itemKeys.set(t,Math.random().toString()),this._itemKeys.get(t)}moveUp(t){t.stopPropagation();const e=t.target.index;if(!t.target.first){const i=e-1;this.move(e,i),this.rowSortSelected===e&&(this.rowSortSelected=i),t.target.focus()}}moveDown(t){t.stopPropagation();const e=t.target.index;if(!t.target.last){const i=e+1;this.move(e,i),this.rowSortSelected===e&&(this.rowSortSelected=i),t.target.focus()}}move(t,e){const i=this.items.concat(),o=i.splice(t,1)[0];i.splice(e,0,o),this.items=i,(0,l.r)(this,"value-changed",{value:i})}itemMoved(t){t.stopPropagation();const{oldIndex:e,newIndex:i}=t.detail;this.move(e,i)}async itemAdded(t){t.stopPropagation();const{index:e,data:i}=t.detail,o=t.detail.item.selected;let a=[...this.items.slice(0,e),i,...this.items.slice(e)];this.items=a,o&&(this.focusItemIndexOnChange=1===a.length?0:e),await(0,d.E)(),this.items!==a&&(a=[...this.items.slice(0,e),i,...this.items.slice(e)],o&&(this.focusItemIndexOnChange=1===a.length?0:e)),(0,l.r)(this,"value-changed",{value:a})}async itemRemoved(t){t.stopPropagation();const{index:e}=t.detail,i=this.items[e];this.items=this.items.filter(t=>t!==i),await(0,d.E)();const o=this.items.filter(t=>t!==i);(0,l.r)(this,"value-changed",{value:o})}itemChanged(t){t.stopPropagation();const e=[...this.items],i=t.detail.value,o=t.target.index;if(null===i)e.splice(o,1);else{const t=this.getKey(e[o]);this._itemKeys.set(i,t),e[o]=i}this.items=e,(0,l.r)(this,"value-changed",{value:e})}duplicateItem(t){t.stopPropagation();const e=t.target.index;(0,l.r)(this,"value-changed",{value:this.items.toSpliced(e+1,0,(0,a.A)(this.items[e]))})}pasteItem(t){if(t.stopPropagation(),!t.detail.item)return;const e=t.target.index,i=(0,a.A)(t.detail.item);this.setHighlightedItems((0,n.e)(i)),(0,l.r)(this,"value-changed",{value:this.items.toSpliced(e+1,0,i)})}insertAfter(t){t.stopPropagation();const e=t.target.index,i=(0,n.e)(t.detail.value);this.setHighlightedItems(i),(0,l.r)(this,"value-changed",{value:this.items.toSpliced(e+1,0,...i)})}setHighlightedItems(t){throw new Error("Not implemented")}handleDragKeydown(t){"Enter"!==t.key&&" "!==t.key||(t.stopPropagation(),this.rowSortSelected=void 0===this.rowSortSelected?t.target.index:void 0)}stopSortSelection(){this.rowSortSelected=void 0}constructor(...t){super(...t),this.disabled=!1,this.narrow=!1,this.optionsInSidebar=!1,this.focusLastItemOnChange=!1,this._itemKeys=new WeakMap}}return(0,o.Cg)([(0,r.MZ)({attribute:!1})],e.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,attribute:"sidebar"})],e.prototype,"optionsInSidebar",void 0),(0,o.Cg)([(0,r.wk)()],e.prototype,"rowSortSelected",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.I)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],e.prototype,"_clipboard",void 0),e}},82405(t,e,i){i.d(e,{II:()=>d,Ku:()=>r,gZ:()=>h,jJ:()=>n,uV:()=>a,ve:()=>l,yz:()=>s});i(14603),i(47566),i(98721);var o=i(1087);const a="__paste__",r="add_automation_element",n="target_entity_id",s="target_device_id",l="target_area_id",d=(t,e,i,o)=>{const a=new URLSearchParams(window.location.search);if(a.get(r)!==o)return;const d=a.get(n);if(d&&t[d])return{entity_id:d};const c=a.get(s);if(c&&e[c])return{device_id:c};const h=a.get(l);return h&&i[h]?{area_id:h}:void 0},c=()=>Promise.all([i.e(32450),i.e(7305),i.e(92769),i.e(3283),i.e(80131),i.e(70183),i.e(41144),i.e(33758),i.e(61864)]).then(i.bind(i,65467)),h=(t,e)=>{const i=new URLSearchParams(window.location.search);(0,o.r)(t,"show-dialog",{dialogTag:"add-automation-element-dialog",dialogImport:c,dialogParams:e,addHistory:i.get(r)!==e.type})}},67442(t,e,i){i.d(e,{V:()=>a,b:()=>r});var o=i(63533);const a=(0,o.Ik)({trigger:(0,o.Yj)(),id:(0,o.lq)((0,o.Yj)()),enabled:(0,o.lq)((0,o.zM)()),note:(0,o.lq)((0,o.Yj)())}),r=(0,o.Ik)({days:(0,o.lq)((0,o.ai)()),hours:(0,o.lq)((0,o.ai)()),minutes:(0,o.lq)((0,o.ai)()),seconds:(0,o.lq)((0,o.ai)())})},57116(t,e,i){i.d(e,{Ju:()=>d,KC:()=>c,Lt:()=>h,T_:()=>s,aM:()=>n,bH:()=>a,qK:()=>l,yj:()=>r});var o=i(5124);const a=o.AH`ha-icon-button{--mdc-theme-text-primary-on-background:var(--primary-text-color)}ha-expansion-panel{position:relative;--expansion-panel-summary-padding:0 0 0 8px;--expansion-panel-content-padding:0}h3{font-size:inherit;font-weight:inherit;display:flex;align-items:center;flex-wrap:wrap;gap:var(--ha-space-2);padding:var(--ha-space-2) 0;min-height:32px;max-width:100%}ha-card{transition:outline .2s}.disabled-bar{background:var(--divider-color,#e0e0e0);text-align:center;border-top-right-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-top-left-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.warning ul{margin:4px 0}ha-tooltip{cursor:default}.hidden{display:none}ha-automation-row-event-chip.event-chip{position:absolute}.icon-badge-wrapper{position:relative;display:inline-flex}.note-indicator{color:var(--ha-color-on-neutral-normal)}.note-indicator+ha-tooltip::part(body){cursor:default;max-width:300px}.note-indicator+ha-tooltip p{white-space:pre-wrap;margin:0}`,r=o.AH`.disabled{pointer-events:none}.card-content.card{padding:16px}.card-content.yaml{padding:0 1px;border-top:1px solid var(--divider-color);border-bottom:1px solid var(--divider-color)}`,n=o.AH`.card-content.indent,.selector-row,:host([indent]) ha-form{margin-inline-start:12px;padding-top:12px;padding-bottom:16px;padding-inline-start:16px;padding-inline-end:0px;border-inline-start:2px solid var(--ha-color-border-neutral-quiet);border-bottom:2px solid var(--ha-color-border-neutral-quiet);border-radius:var(--ha-border-radius-square);border-end-start-radius:var(--ha-border-radius-lg)}.card-content.indent.selected,.selector-row.parent-selected,:host([selected]) .card-content.indent,:host([selected]) ha-form{border-color:var(--primary-color);background:var(--ha-color-fill-primary-quiet-resting);background:linear-gradient(to right,var(--ha-color-fill-primary-quiet-resting) 0%,var(--ha-color-fill-primary-quiet-resting) 80%,rgba(var(--rgb-primary-color),0) 100%)}`,s=o.AH`:host{overflow:hidden}ha-button[slot=fab]{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s;--ha-button-box-shadow:var(--ha-box-shadow-l)}ha-button[slot=fab].dirty{bottom:calc(16px + var(--safe-area-inset-bottom,0px))}`,l=o.AH`:host{display:block;--sidebar-width:0;--sidebar-gap:0}.has-sidebar{--sidebar-width:min(
      max(var(--sidebar-dynamic-width), ${375}px),
      100vw - ${350}px - var(--ha-sidebar-width, 0px),
      var(--ha-automation-editor-max-width) -
        ${350}px - var(--ha-sidebar-width, 0px)
    );--sidebar-gap:var(--ha-space-4)}.fab-positioner{display:flex;justify-content:flex-end}.fab-positioner ha-button[slot=fab]{position:fixed;right:unset;left:unset;bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s}.fab-positioner ha-button[slot=fab].dirty{bottom:calc(16px + var(--safe-area-inset-bottom,0px))}.content-wrapper{padding-right:calc(var(--sidebar-width) + var(--sidebar-gap));padding-inline-end:calc(var(--sidebar-width) + var(--sidebar-gap));padding-inline-start:0}.content{padding-top:var(--ha-space-3);padding-bottom:max(var(--safe-area-inset-bottom),32px);transition:padding-bottom 180ms ease-in-out}.content.has-bottom-sheet{padding-bottom:calc(90vh - max(var(--safe-area-inset-bottom),32px))}ha-automation-sidebar{position:fixed;top:calc(var(--header-height) + 16px);height:calc(-81px + 100vh - var(--safe-area-inset-top,0px));height:calc(-81px + 100dvh - var(--safe-area-inset-top,0px));width:var(--sidebar-width);display:block}ha-automation-sidebar.hidden{display:none}.sidebar-positioner{display:flex;justify-content:flex-end}.description{margin:0}.header a{color:var(--secondary-text-color)}`,d=o.AH`.rows{display:flex;flex-direction:column;gap:var(--ha-space-4)}.rows.no-sidebar{margin-inline-end:0}.sortable-ghost{background:0 0;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.sortable-drag{background:0 0}ha-automation-action-row{display:block;scroll-margin-top:48px}.handle{padding:4px;cursor:move;cursor:grab;border-radius:var(--ha-border-radius-pill)}.handle:focus{outline:var(--wa-focus-ring);background:var(--ha-color-fill-neutral-quiet-resting)}.handle.active{outline:var(--wa-focus-ring);background:var(--ha-color-fill-neutral-normal-active)}.handle ha-svg-icon{pointer-events:none;height:24px}.buttons{display:flex;flex-wrap:wrap;gap:var(--ha-space-2);order:1}`,c=o.AH`.sidebar-editor{display:block}.description{padding-top:16px}`,h=o.AH`.overflow-label{display:flex;justify-content:space-between;gap:var(--ha-space-3);white-space:nowrap}.overflow-label .shortcut{--mdc-icon-size:12px;display:inline-flex;flex-direction:row;align-items:center;gap:2px}.overflow-label .shortcut span{font-size:var(--ha-font-size-s);font-family:var(--ha-font-family-code);color:var(--ha-color-text-secondary)}.shortcut-placeholder{display:inline-block;width:60px}.shortcut-placeholder.mac{width:46px}@media all and (max-width:870px){.shortcut-placeholder{display:none}}`},14440(t,e,i){i.a(t,async function(t,o){try{i.d(e,{B:()=>c});var a=i(5124),r=i(59174),n=(i(18198),i(47680),i(93367)),s=(i(67094),t([r,n]));[r,n]=s.then?(await s)():s;const l="M17.63,5.84C17.27,5.33 16.67,5 16,5H5A2,2 0 0,0 3,7V17A2,2 0 0,0 5,19H16C16.67,19 17.27,18.66 17.63,18.15L22,12L17.63,5.84Z",d="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",c=(t,e,i,o,r,n,s)=>{if(!o)return a.s6;if("floor"===i&&t.floors[o])return a.qy`<ha-floor-icon .slot="${s}" .floor="${t.floors[o]}"></ha-floor-icon>`;if("area"===i){const e=t.areas[o];return e?.icon?a.qy`<ha-icon .slot="${s}" .icon="${e.icon}"></ha-icon>`:a.qy`<ha-svg-icon .slot="${s}" .path="${d}"></ha-svg-icon>`}if("device"===i&&t.devices[o]){const e=t.devices[o],i=e.primary_config_entry?r[e.primary_config_entry]:void 0,n=i?.domain;if(n)return a.qy`<ha-domain-icon .domain="${n}" brand-fallback .slot="${s}"></ha-domain-icon>`}if("entity"===i&&e[o])return a.qy`<ha-state-icon .stateObj="${e[o]}" .slot="${s}"></ha-state-icon>`;if("label"===i&&n){const t=n(o);return t?.icon?a.qy`<ha-icon .slot="${s}" .icon="${t.icon}"></ha-icon>`:a.qy`<ha-svg-icon .slot="${s}" .path="${l}"></ha-svg-icon>`}return a.s6};o()}catch(t){o(t)}})},69070(t,e,i){i.d(e,{N:()=>s});var o=i(65522),a=i(37981),r=i(74705),n=i(55931);const s=(t,e,i,s,l,d)=>{if("floor"===s)return t.floors[l]&&(0,n.X)(t.floors[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_floor");if("area"===s)return t.areas[l]&&(0,o.A)(t.areas[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_area");if("device"===s)return t.devices[l]&&(0,a.xn)(t.devices[l])||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_device");if("entity"===s&&e[l]){const i=e[l],[o,a]=(0,r.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors);return o||a||l}if("entity"===s)return i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_entity");if("label"===s&&d){const t=d(l);return t?.name||i("ui.panel.config.automation.editor.actions.type.service.description.target_unknown_label")}return l}},62711(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(22489),i(20116),i(61701),i(18237),i(45367),i(92731);var o=i(62826),a=(i(68825),i(35211)),r=i(5124),n=i(22441),s=i(6412),l=i(91450),d=i(44537),c=i(32172),h=i(57237),u=i(24790),p=i(29823),g=(i(70947),i(67094),i(89081)),y=i(22792),m=i(95311),v=i(88555),f=i(42269),b=i(14440),_=i(69070),w=t([p,b]);[p,b]=w.then?(await w)():w;const C="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z",$="M13 13H11V7H13M11 15H13V17H11M15.73 3H8.27L3 8.27V15.73L8.27 21H15.73L21 15.73V8.27L15.73 3Z",x="M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",k="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z",M="M7,10L12,15L17,10H7Z",A="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";class z extends r.WF{willUpdate(t){super.willUpdate(t),(t.has("target")||t.has("selector")||t.has("_registries"))&&(this._rerenderCount=!0)}updated(t){super.updated(t),this._rerenderCount=!1}_countMatchingEntities(t){const e=this.selector,i=!!e?.target?.entity,o=!!e?.target?.device;if(!i&&!o)return t.length;const a=o?Object.values(this._registries.entities):[];return t.filter(t=>{if(i){const i=this._states[t];if(!(0,m.MM)(i,e))return!1}if(o){const i=this._registries.entities[t]?.device_id;if(i){const t=this._registries.devices[i];if(t&&!(0,m.DF)(this._states,a,t,e))return!1}}return!0}).length}_renderCount(t,e){const i=`${t}:${e}`;let o=" (-)";return this._countCache.has(i)&&!this._rerenderCount||("number"==typeof this._countCache.get(i)&&(o=` (${this._countCache.get(i)})`),this._countCache.set(i,(0,v.F7)(this._api.callWS,{[`${t}_id`]:[e]},!1,this.selector?.target?.primary_entities_only).then(t=>this._countMatchingEntities(t.referenced_entities)).catch(t=>{console.error("Error counting target entities",t)}))),this._countCache.get(i)instanceof Promise?(0,l.T)(this._countCache.get(i).then(t=>(this._countCache.set(i,t),void 0===t?r.s6:r.qy` (${t})`)),o):"number"==typeof this._countCache.get(i)?` (${this._countCache.get(i)})`:r.s6}render(){if(!Object.keys(this.target||{}).length)return this._renderTargetBadge(this.targetRequired?r.qy`<ha-svg-icon .path="${$}"></ha-svg-icon>`:r.s6,this._i18n.localize("ui.panel.config.automation.editor.target_summary.no_target"),!1,this.targetRequired);const t=Object.values(this.target||{}).reduce((t,e)=>t+(0,d.e)(e).length,0);if(t<=5){return Object.entries(this.target).reduce((t,[e,i])=>{const o=e.replace("_id","");return[...t,...(0,d.e)(i).map(t=>[o,t])]},[]).map(([t,e])=>r.qy`<span class="target-wrapper"> ${this._renderTarget(t,e)} </span>`)}const e=Object.entries(this.target).reduce((t,[e,i])=>{const o=e.replace("_id","");return[...t,...(0,d.e)(i).map(t=>[o,t])]},[]).sort(([t],[e])=>{const i=["entity","device","area","floor","label"];return i.indexOf(t)-i.indexOf(e)});let i=null;return r.qy` <ha-dropdown @wa-select="${this._handleTargetSelect}" @click="${h.d}" @keydown="${h.d}"> <button slot="trigger" class="target"> <ha-svg-icon .path="${k}"></ha-svg-icon> <div class="label"> ${this._i18n.localize("ui.panel.config.automation.editor.target_summary.targets",{count:t})} </div> <ha-svg-icon .path="${M}"></ha-svg-icon> </button> ${e.map(([t,e])=>{const o=r.qy`${null!==i&&i!==t?r.qy`<wa-divider></wa-divider>`:r.s6} ${i&&i===t?r.s6:r.qy`<h3> ${this._i18n.localize(`ui.panel.config.automation.editor.target_summary.types.${t}`)} </h3>`} ${this._renderTarget(t,e,!0)}`;return i=t,o})} </ha-dropdown> `}_checkTargetExists(t,e){return"floor"===t?!!this._registries.floors[e]:"area"===t?!!this._registries.areas[e]:"device"===t?!!this._registries.devices[e]:"entity"===t?!!this._states[e]:"label"===t&&!!this._getLabel(e)}_renderTargetBadge(t,e,i=!1,o=!1,a,n,l=r.s6){return this.interactive&&a&&n?r.qy`<button class="${(0,s.H)({target:!0,warning:i,error:o})}" .targetId="${a}" .targetType="${n}" .label="${e}" @click="${this._handleTargetClick}" @keydown="${this._handleTargetKeydown}"> ${t} <div class="label">${e}${l}</div> </button>`:r.qy`<div class="${(0,s.H)({target:!0,warning:i,error:o})}" .targetId="${a}" .targetType="${n}" .label="${e}"> ${t} <div class="label">${e}${l}</div> </div>`}_renderTarget(t,e,i=!1){let o,a,n=!1,l=e,d=t,c=r.s6;if("entity"===t&&["all","none"].includes(e))o=A,a=this._i18n.localize(`ui.panel.config.automation.editor.target_summary.${e}_entities`),l=void 0,d=void 0;else if((0,u.F)(e))o=x,a=this._i18n.localize("ui.panel.config.automation.editor.target_summary.template"),l=void 0,d=void 0;else{this._checkTargetExists(t,e)?(a=(0,_.N)(this._registries,this._states,this._i18n.localize,t,e,this._getLabel),"entity"!==t&&this.interactive&&(c=this._renderCount(t,e))):(o=C,a=(0,_.N)(this._registries,this._states,this._i18n.localize,t,e,this._getLabel),n=!0,l=void 0,d=void 0)}const h=o?r.qy`<ha-svg-icon .slot="${i?"icon":""}" .path="${o}"></ha-svg-icon>`:(0,b.B)(this._registries,this._states,t,e,this._configEntryLookup||{},this._getLabel,i?"icon":"");return i?r.qy`<ha-dropdown-item .value="${{targetId:l,targetType:d,label:a}}" class="${(0,s.H)({warning:n})}">${h} ${a}${c}</ha-dropdown-item>`:this._renderTargetBadge(h,a,n,!1,l,d,c)}_handleTargetClick(t){const e=t.currentTarget;e.targetId&&e.targetType&&this._showTargetInfo(e.targetId,e.targetType,e.label,t)}_handleTargetKeydown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this._handleTargetClick(t))}_handleTargetSelect(t){const e=t.detail.item.value;e.targetId&&e.targetType&&this._showTargetInfo(e.targetId,e.targetType,e.label)}_showTargetInfo(t,e,i,o){o?.stopPropagation(),"entity"!==e?(0,g.D)(this,{title:i,type:e,itemId:t,selector:this.selector}):(0,f.p)(this,{entityId:t})}constructor(...t){super(...t),this.targetRequired=!1,this.interactive=!1,this._countCache=new Map,this._rerenderCount=!0,this._getLabel=t=>this._labelRegistry?.find(({label_id:e})=>e===t)}}z.styles=r.AH`:host{display:contents;min-height:32px}.target-wrapper{display:inline-flex;align-items:flex-end;gap:var(--ha-space-1);max-width:100%}.target{display:inline-flex;gap:var(--ha-space-1);justify-content:center;align-items:center;border-radius:var(--ha-border-radius-md);background:var(--ha-color-fill-neutral-normal-resting);padding:0 var(--ha-space-2) 0 var(--ha-space-1);color:var(--ha-color-on-neutral-normal);border:var(--ha-border-width-sm) solid var(--ha-color-border-neutral-quiet);overflow:hidden;height:32px}.target.warning{background:var(--ha-color-fill-warning-normal-resting);color:var(--ha-color-on-warning-normal)}.target.error{background:var(--ha-color-fill-danger-normal-resting);color:var(--ha-color-on-danger-normal)}.target .label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.target ha-domain-icon,.target ha-icon,.target ha-svg-icon{display:flex;padding:var(--ha-space-1) 0}.target ha-floor-icon{display:flex;height:32px;align-items:center}button.target{cursor:pointer}button.target:hover{background:var(--ha-color-fill-neutral-normal-hover)}ha-dropdown-item{padding:0 var(--ha-space-2)}ha-dropdown-item.warning{background-color:var(--ha-color-fill-warning-quiet-resting);color:var(--ha-color-on-warning-normal)}ha-dropdown-item.warning:hover{background-color:var(--ha-color-fill-warning-quiet-hover);color:var(--ha-color-on-warning-normal)}`,(0,o.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"targetRequired",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],z.prototype,"selector",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],z.prototype,"interactive",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:y.D5,subscribe:!0})],z.prototype,"_i18n",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:y.Hd,subscribe:!0})],z.prototype,"_registries",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:y.HD,subscribe:!0})],z.prototype,"_labelRegistry",void 0),(0,o.Cg)([(0,n.wk)(),(0,a.Fg)({context:y.g5,subscribe:!0}),(0,c.p)({transformer:function(t){return t?Object.fromEntries(t.map(t=>[t.entry_id,t])):void 0}})],z.prototype,"_configEntryLookup",void 0),(0,o.Cg)([(0,a.Fg)({context:y.Ie,subscribe:!0})],z.prototype,"_api",void 0),(0,o.Cg)([(0,a.Fg)({context:y.iN,subscribe:!0})],z.prototype,"_states",void 0),z=(0,o.Cg)([(0,n.EM)("ha-automation-row-targets")],z),e()}catch(t){e(t)}})},19711(t,e,i){i.d(e,{$:()=>r});var o=i(1087);const a=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),r=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:a,dialogParams:e})}},53580(t,e,i){i.d(e,{mdiHomeAssistant:()=>o});const o="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"},36918(t,e,i){i.d(e,{o:()=>o});const o=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},41570(t,e,i){i.d(e,{c:()=>o});const o=/Mac/i.test(navigator.userAgent)}};