UNPKG

iobroker.lovelace

Version:

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

4 lines 48.6 kB
export const __rspack_esm_id=86618;export const __rspack_esm_ids=[86618];export const __webpack_modules__={36312(t,e,o){o.d(e,{x:()=>i});o(74423);const i=(t,e)=>t&&t.components.includes(e)},62384(t,e,o){o.d(e,{v:()=>i});o(74423);const i=(t,e,o,i)=>{const[a,r,n]=t.split(".",3);return Number(a)>e||Number(a)===e&&(void 0===i?Number(r)>=o:Number(r)>o)||void 0!==i&&Number(a)===e&&Number(r)===o&&Number(n)>=i}},46190(t,e,o){o.d(e,{FD:()=>l,Is:()=>i,JF:()=>a,gt:()=>r,jj:()=>s,oL:()=>c,yd:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"],a=["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"],r=["assist_satellite","conversation","stt","tts"],n=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],s=["closed","locked","off"],l=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),c=new Set(["camera","image","media_player"])},380(t,e,o){o.d(e,{D:()=>s,P:()=>n});o(74423);var i=o(67932),a=o(46927),r=o(96029);const n=t=>t.first_weekday===a.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,i.S)(t.language)%7:r.Z.includes(t.first_weekday)?r.Z.indexOf(t.first_weekday):1,s=t=>{const e=n(t);return r.Z[e]}},95747(t,e,o){o.a(t,async function(t,i){try{o.d(e,{CL:()=>b,GH:()=>C,Rl:()=>h,ZS:()=>f,aQ:()=>m,r6:()=>u,yg:()=>_});var a=o(74487),r=o(22786),n=o(72487),s=o(30162),l=o(8480),c=o(69543),d=t([a,l,n,s]);[a,l,n,s]=d.then?(await d)():d;const u=(t,e,o)=>p(e,o.time_zone).format(t),p=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),h=t=>g().format(t),g=(0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),m=(t,e,o)=>y(e,o.time_zone).format(t),y=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),f=(t,e,o)=>v(e,o.time_zone).format(t),v=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),b=(t,e,o)=>(new Date).getFullYear()===t.getFullYear()?f(t,e,o):m(t,e,o),_=(t,e,o)=>w(e,o.time_zone).format(t),w=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),C=(t,e,o)=>`${(0,n.zB)(t,e,o)}, ${(0,s.fU)(t,e,o)}`;i()}catch(t){i(t)}})},8480(t,e,o){o.a(t,async function(t,i){try{o.d(e,{fL:()=>d,n2:()=>u,wj:()=>p});var a=o(74487),r=o(29079),n=o(46927),s=t([a]);a=(s.then?(await s)():s)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,c=l&&("UTC"===l||"Etc/UTC"===l||l in r)?l:void 0,d=14881==o.j?void 0!==c:null,u=c??"UTC",p=(t,e)=>t===n.Wj.local&&c?u:e;i()}catch(t){i(t)}})},96029(t,e,o){o.d(e,{Tq:()=>n,Z:()=>a,ZV:()=>i,sj:()=>r});const i=["sun","mon","tue","wed","thu","fri","sat"],a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},n={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},93905(t,e,o){o.d(e,{I:()=>r});o(44114),o(18111),o(7588),o(69112),o(33110);class i{addFromStorage(t){if(!this._storage[t]){const e=this.storage.getItem(t);e&&(this._storage[t]=JSON.parse(e))}}subscribeChanges(t,e){return this._listeners[t]?this._listeners[t].push(e):this._listeners[t]=[e],()=>{this.unsubscribeChanges(t,e)}}unsubscribeChanges(t,e){if(!(t in this._listeners))return;const o=this._listeners[t].indexOf(e);-1!==o&&this._listeners[t].splice(o,1)}hasKey(t){return t in this._storage}getValue(t){return this._storage[t]}setValue(t,e){const o=this._storage[t];this._storage[t]=e;try{void 0===e?this.storage.removeItem(t):this.storage.setItem(t,JSON.stringify(e))}catch(t){}finally{this._listeners[t]&&this._listeners[t].forEach(t=>t(o,e))}}constructor(t=window.localStorage){this._storage={},this._listeners={},this.storage=t,this.storage===window.localStorage&&window.addEventListener("storage",t=>{t.key&&this.hasKey(t.key)&&(this._storage[t.key]=t.newValue?JSON.parse(t.newValue):t.newValue,this._listeners[t.key]&&this._listeners[t.key].forEach(e=>e(t.oldValue?JSON.parse(t.oldValue):t.oldValue,this._storage[t.key])))})}}const a={};function r(t){return(e,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const r=t.storage||"localStorage";let n;r&&r in a?n=a[r]:(n=new i(window[r]),a[r]=n);const s=t.key||String(o);n.addFromStorage(s);const l=!1!==t.subscribe?t=>n.subscribeChanges(s,(e,i)=>{t.requestUpdate(o,e)}):void 0,c=()=>n.hasKey(s)?t.deserializer?t.deserializer(n.getValue(s)):n.getValue(s):void 0,d=(e,i)=>{let a;t.state&&(a=c()),n.setValue(s,t.serializer?t.serializer(i):i),t.state&&e.requestUpdate(o,a)},u=e.performUpdate;if(e.performUpdate=function(){this.__initialized=!0,u.call(this)},t.subscribe){const t=e.connectedCallback,o=e.disconnectedCallback;e.connectedCallback=function(){t.call(this);const e=this;e.__unbsubLocalStorage||(e.__unbsubLocalStorage=l?.(this))},e.disconnectedCallback=function(){o.call(this);this.__unbsubLocalStorage?.(),this.__unbsubLocalStorage=void 0}}const p=Object.getOwnPropertyDescriptor(e,o);let h;if(void 0===p)h={get:()=>c(),set(t){(this.__initialized||void 0===c())&&d(this,t)},configurable:!0,enumerable:!0};else{const t=p.set;h={...p,get:()=>c(),set(e){(this.__initialized||void 0===c())&&d(this,e),t?.call(this,e)}}}Object.defineProperty(e,o,h)}}},57237(t,e,o){o.d(e,{d:()=>i});const i=t=>t.stopPropagation()},65522(t,e,o){o.d(e,{A:()=>i});const i=t=>t.name?.trim()},81816(t,e,o){o.d(e,{aH:()=>n,cx:()=>s,es:()=>l});var i=o(37981),a=o(28978),r=o(79461);const n=(t,e,o)=>{const i=e[t.entity_id];return i?s(i,o):(0,a.u)(t)},s=(t,e,o)=>{const n=t.name||("original_name"in t&&null!=t.original_name?String(t.original_name):void 0),s=t.device_id?e[t.device_id]:void 0;if(!s)return n||(o?(0,a.u)(o):void 0);const l=(0,i.xn)(s);return l!==n?l&&n&&(0,r.p)(n,l)||n:void 0},l=(t,e,o)=>!n(t,e,o)},74705(t,e,o){o.d(e,{Bj:()=>h,Cf:()=>p,uU:()=>u});o(18111),o(81148),o(22489),o(61701),o(13579);if(66649!=o.j)var i=o(44537);var a=o(15638),r=o(65522),n=o(37981),s=o(81816),l=o(55931);if(66649!=o.j)var c=o(28978);var d=o(28455);const u=(t,e,o,a,r,n,l)=>{if("string"==typeof e)return e;if(!e)return(0,c.u)(t);let d=(0,i.e)(e);const u=l?.separator??" ";if(d.every(t=>"text"===t.type))return d.map(t=>t.text).join(u);if((0,s.es)(t,o,a)){d.some(t=>"device"===t.type)||(d=d.map(t=>"entity"===t.type?{type:"device"}:t))}const h=p(t,d,o,a,r,n);return 1===h.length?h[0]||"":h.filter(t=>t).join(u)},p=(t,e,o,i,a,c)=>{const{device:u,area:p,floor:h}=(0,d.ln)(t,o,i,a,c);return e.map(e=>{switch(e.type){case"entity":return(0,s.aH)(t,o,i);case"device":return u?(0,n.xn)(u):void 0;case"area":return p?(0,r.A)(p):void 0;case"floor":return h?(0,l.X)(h):void 0;case"text":return e.text;default:return""}})},h=(t,e)=>{const[o,i,r]=p(e,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),n=(0,a.qC)(t.language,t.translationMetadata.translations);return{primary:o||i||e.entity_id,secondary:[r,o?i:void 0].filter(Boolean).join(n?" ◂ ":" ▸ ")||void 0}}},55931(t,e,o){o.d(e,{X:()=>i});const i=t=>t.name?.trim()},68246(t,e,o){o.d(e,{Y:()=>i});const i=t=>t.slice(t.indexOf(".")+1)},28978(t,e,o){o.d(e,{_:()=>a,u:()=>r});var i=o(68246);const a=(t,e)=>void 0===e.friendly_name?(0,i.Y)(t).replace(/_/g," "):(e.friendly_name??"").toString(),r=t=>a(t.entity_id,t.attributes)},28455(t,e,o){o.d(e,{EX:()=>a,jI:()=>r,ln:()=>i});const i=(t,e,o,i,a)=>{const n=e[t.entity_id];return n?r(n,e,o,i,a):{entity:null,device:null,area:null,floor:null}},a=(t,e,o)=>{const i=e[t];if(!i)return;const a=i.device_id,r=a?o[a]:void 0;return i.area_id||r?.area_id||void 0},r=(t,e,o,i,a)=>{const r=e[t.entity_id],n=t?.device_id,s=n?o[n]:void 0,l=t?.area_id||s?.area_id,c=l?i[l]:void 0,d=c?.floor_id;return{entity:r,device:s||null,area:c||null,floor:(d?a[d]:void 0)||null}}},79461(t,e,o){o.d(e,{p:()=>a});const i=[" ",": "," - "],a=(t,e)=>{const o=t.toLowerCase(),a=e.toLowerCase();for(const e of i){const i=`${a}${e}`;if(o.startsWith(i)){const e=t.substring(i.length);if(e.length)return r(e.substr(0,e.indexOf(" ")))?e:e[0].toUpperCase()+e.slice(1)}}},r=t=>t.toLowerCase()!==t},24790(t,e,o){o.d(e,{F:()=>a,r:()=>r});o(18111),o(13579);const i=/{%|{{/,a=t=>i.test(t),r=t=>{if(!t)return!1;if("string"==typeof t)return a(t);if("object"==typeof t){return(Array.isArray(t)?t:Object.values(t)).some(t=>t&&r(t))}return!1}},22682(t,e,o){o.d(e,{$:()=>n});const i="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",a=new RegExp(i+"$"),r=new RegExp(i),n=(t,e=!1)=>e?r.test(t):a.test(t)},19459(t,e,o){o.d(e,{b:()=>i});o(45367),o(92731),o(69479),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=(t,e,o)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let a,r;if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(a=r;0!==a--;)if(!i(t[a],e[a],o))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;for(a of t.entries())if(!i(a[1],e.get(a[0]),o))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!==e.length)return!1;for(a=r;0!==a--;)if(t[a]!==e[a])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const n=Object.keys(t);if(r=n.length,r!==Object.keys(e).length)return!1;for(a=r;0!==a--;)if(!Object.prototype.hasOwnProperty.call(e,n[a]))return!1;for(a=r;0!==a--;){const r=n[a];if(!i(t[r],e[r],o))return!1}if(o?.compareSymbols){const a=Object.getOwnPropertySymbols(t),r=Object.getOwnPropertySymbols(e);if(a.length!==r.length)return!1;for(const r of a){if(!Object.prototype.hasOwnProperty.call(e,r))return!1;if(!i(t[r],e[r],o))return!1}}return!0}return t!=t&&e!=e}},7553(t,e,o){o.d(e,{h:()=>a});class i extends Error{constructor(t,...e){super(...e),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="TimeoutError",this.timeout=t,this.message=`Timed out in ${t} ms.`}}const a=(t,e)=>{const o=new Promise((e,o)=>{setTimeout(()=>{o(new i(t))},t)});return Promise.race([e,o])}},70947(t,e,o){var i=o(62826),a=o(50759),r=(o(38625),o(5124)),n=o(22441);o(67094);class s extends a.A{renderCheckboxIcon(){return r.qy` <ha-svg-icon id="check" part="checkmark" .path="${this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z"}"></ha-svg-icon> `}static get styles(){return[a.A.styles,r.AH`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`]}constructor(...t){super(...t),this.selected=!1}}(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"selected",void 0),s=(0,i.Cg)([(0,n.EM)("ha-dropdown-item")],s)},29823(t,e,o){o.a(t,async function(t,e){try{var i=o(62826),a=o(52254),r=o(5124),n=o(22441),s=t([a]);a=(s.then?(await s)():s)[0];class l extends a.A{get anchorElement(){return this.popup?.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[a.A.styles,r.AH`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var( --card-background-color, var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)), )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,i.Cg)([(0,n.EM)("ha-dropdown")],l),e()}catch(t){e(t)}})},18198(t,e,o){o.d(e,{Dc:()=>s,Si:()=>n});var i=o(62826),a=o(5124),r=o(22441);o(47680),o(67094);const n=t=>{switch(t.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},s=t=>{switch(t.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"};class l extends a.WF{render(){if(!this.floor)return a.s6;if(this.floor.icon)return a.qy`<ha-icon .icon="${this.floor.icon}"></ha-icon>`;const t=n(this.floor);return a.qy`<ha-svg-icon .path="${t}"></ha-svg-icon>`}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"floor",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"icon",void 0),l=(0,i.Cg)([(0,r.EM)("ha-floor-icon")],l)},52763(t,e,o){o.a(t,async function(t,i){try{o.d(e,{U:()=>m});o(74423),o(18111),o(7588),o(61701);var a=o(62826),r=o(5124),n=o(22441),s=o(69558),l=o(1087),c=o(38962),d=(o(11399),t([c]));c=(d.then?(await d)():d)[0];const u={boolean:()=>o.e(81347).then(o.bind(o,46990)),constant:()=>o.e(65733).then(o.bind(o,90820)),float:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(51868),o.e(27585)]).then(o.bind(o,20676)),grid:()=>o.e(60761).then(o.bind(o,70208)),expandable:()=>o.e(45001).then(o.bind(o,40003)),integer:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(21543),o.e(86712),o.e(49985)]).then(o.bind(o,20036)),multi_select:()=>Promise.all([o.e(4801),o.e(39763),o.e(46095),o.e(34995),o.e(80131),o.e(58303),o.e(71739),o.e(24407)]).then(o.bind(o,36182)),positive_time_period_dict:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(34995),o.e(67943),o.e(16508),o.e(85462)]).then(o.bind(o,89422)),select:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(7305),o.e(92769),o.e(34995),o.e(3283),o.e(81034),o.e(99463),o.e(26092),o.e(4809)]).then(o.bind(o,63804)),string:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(84725),o.e(95926)]).then(o.bind(o,54753)),optional_actions:()=>Promise.all([o.e(4801),o.e(39763),o.e(34995),o.e(85351)]).then(o.bind(o,8456))},p=(t,e)=>t?!e.name||e.flatten?t:t[e.name]:void 0,h=(t,e)=>t&&e.name?t[e.name]:null,g=(t,e)=>t&&e.name?t[e.name]:null;class m extends r.WF{getFormProperties(){return{}}reportValidity(){const t=this._root;if(!t)return!0;const e=[...t.children].filter(t=>"ha-alert"!==t.localName);let o,i=!0;return this.schema.forEach((t,a)=>{const r=e[a];if(!r)return;let n=!0;if("reportValidity"in r&&"function"==typeof r.reportValidity)n=r.reportValidity();else if(t.required&&(!("type"in t)||!["boolean","constant"].includes(t.type??""))&&(!("selector"in t)||!("boolean"in t.selector)&&!("constant"in t.selector))){const e=p(this.data,t);n=null!=e&&""!==e}n||(i=!1,o||(o=r))}),o&&o.focus?.(),i}willUpdate(t){t.has("schema")&&this.schema&&this.schema.forEach(t=>{"selector"in t||u[t.type]?.()})}render(){return r.qy` <div class="root" part="root"> ${this.error&&this.error.base?r.qy` <ha-alert alert-type="error"> ${this._computeError(this.error.base,this.schema)} </ha-alert> `:""} ${this.schema.map(t=>{const e=h(this.error,t),o=g(this.warning,t);return r.qy` ${e?r.qy` <ha-alert own-margin alert-type="error"> ${this._computeError(e,t)} </ha-alert> `:o?r.qy` <ha-alert own-margin alert-type="warning"> ${this._computeWarning(o,t)} </ha-alert> `:""} ${"selector"in t?r.qy`<ha-selector .schema="${t}" .hass="${this.hass}" .narrow="${this.narrow}" .name="${t.name}" .selector="${t.selector}" .value="${p(this.data,t)}" .label="${this._computeLabel(t,this.data)}" .disabled="${t.disabled||this.disabled||!1}" .placeholder="${t.required?void 0:t.default}" .helper="${this._computeHelper(t)}" .localizeValue="${this.localizeValue}" .required="${t.required||!1}" .context="${this._generateContext(t)}"></ha-selector>`:(0,s._)(this.fieldElementName(t.type),{schema:t,data:p(this.data,t),label:this._computeLabel(t,this.data),helper:this._computeHelper(t),disabled:this.disabled||t.disabled||!1,hass:this.hass,localize:this.hass?.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(t),...this.getFormProperties()})} `})} </div> `}fieldElementName(t){return`ha-form-${t}`}_generateContext(t){if(!t.context&&!this.context)return;const e={...this.context};if(t.context)for(const[o,i]of Object.entries(t.context))e[o]=this.data[i];return e}createRenderRoot(){const t=super.createRenderRoot();return this.addValueChangedListener(t),t}addValueChangedListener(t){t.addEventListener("value-changed",t=>{t.stopPropagation();const e=t.target.schema;if(t.target===this)return;const o=!e.name||"flatten"in e&&e.flatten?t.detail.value:{[e.name]:t.detail.value};this.data={...this.data,...o},(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(t,e){return this.computeLabel?this.computeLabel(t,e):t?t.name:""}_computeHelper(t){return this.computeHelper?this.computeHelper(t):""}_computeError(t,e){return Array.isArray(t)?r.qy`<ul> ${t.map(t=>r.qy`<li> ${this.computeError?this.computeError(t,e):t} </li>`)} </ul>`:this.computeError?this.computeError(t,e):t}_computeWarning(t,e){return this.computeWarning?this.computeWarning(t,e):t}constructor(...t){super(...t),this.narrow=!1,this.disabled=!1}}m.shadowRootOptions={mode:"open",delegatesFocus:!0},m.styles=r.AH`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"data",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"schema",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"error",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"warning",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeError",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeWarning",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeHelper",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"localizeValue",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,a.Cg)([(0,n.P)(".root")],m.prototype,"_root",void 0),m=(0,a.Cg)([(0,n.EM)("ha-form")],m),i()}catch(t){i(t)}})},6274(t,e,o){o.a(t,async function(t,i){try{o.r(e),o.d(e,{HaActionSelector:()=>h});var a=o(62826),r=o(35211),n=o(5124),s=o(22441),l=o(22786),c=o(22792),d=o(84025),u=o(68469),p=t([u]);u=(p.then?(await p)():p)[0];class h extends n.WF{expandAll(){this._actionElement?.expandAll()}collapseAll(){this._actionElement?.collapseAll()}render(){return n.qy` ${this.label?n.qy`<label>${this.label}</label>`:n.s6} <ha-automation-action .disabled="${this.disabled}" .actions="${this._actions(this.value)}" .hass="${this.hass}" .narrow="${this.narrow}" .optionsInSidebar="${!!this.selector.action?.optionsInSidebar}"></ha-automation-action> `}constructor(...t){super(...t),this.narrow=!1,this.disabled=!1,this._actions=(0,l.A)(t=>t?(0,d.Rn)(t):[])}}h.styles=n.AH`ha-automation-action{display:block}label{display:block;margin-bottom:4px;font-weight:var(--ha-font-weight-medium);color:var(--secondary-text-color)}`,(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"selector",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),(0,a.Cg)([(0,s.wk)(),(0,r.Fg)({context:c.ih,subscribe:!0})],h.prototype,"_entityReg",void 0),(0,a.Cg)([(0,s.P)("ha-automation-action")],h.prototype,"_actionElement",void 0),h=(0,a.Cg)([(0,s.EM)("ha-selector-action")],h),i()}catch(t){i(t)}})},91485(t,e,o){o.a(t,async function(t,i){try{o.d(e,{U:()=>w});var a=o(62826),r=(o(86137),o(30006)),n=o(92070),s=o(35211),l=o(5124),c=o(22441),d=o(6412),u=o(63672),p=o(57237),h=o(22792),g=o(26300),m=(o(67094),o(34127)),y=o(53305),f=t([r,g,m]);[r,g,m]=f.then?(await f)():f;const v="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",b="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",_="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,y.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),e=!this.hint&&this._hasSlotController.test("hint"),o=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,d.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||o&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||e||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||t?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${v}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?_:b}"></ha-icon-button> </slot> <div slot="hint" class="${(0,d.H)({error:this.invalid||this._invalid})}" role="${(0,u.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(e?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...t){super(...t),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new n.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const t=this._input?.shadowRoot?.querySelector('[part~="start"]'),e=t?.offsetWidth??0;e>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${e}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[y.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,a.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,a.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"pattern",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"min",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"max",void 0),(0,a.Cg)([(0,c.MZ)()],w.prototype,"step",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,a.Cg)([(0,c.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,a.Cg)([(0,c.P)("wa-input")],w.prototype,"_input",void 0),(0,a.Cg)([(0,c.wk)(),(0,s.Fg)({context:h.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,a.Cg)([(0,c.EM)("ha-input")],w),i()}catch(t){i(t)}})},53305(t,e,o){o.d(e,{w:()=>l,N:()=>c});var i=o(62826),a=o(5124),r=o(22441),n=o(22786);o(74423);const s=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=t=>{class e extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,e,o){this._formControl?.setSelectionRange(t,e,o)}setRangeText(t,e,o,i){this._formControl?.setRangeText(t,e,o,i)}checkValidity(){return!s||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...t){super(...t),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,n.A)((t,e)=>{if(!e)return t;let o=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return o||(o="*"),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o?`${t}${o}`:t})}}return e.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,i.Cg)([(0,r.MZ)()],e.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"hint",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"readonly",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],e.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],e.prototype,"minlength",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],e.prototype,"maxlength",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"autocapitalize",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"autocomplete",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"autofocus",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"spellcheck",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"inputmode",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"enterkeyhint",void 0),(0,i.Cg)([(0,r.MZ)()],e.prototype,"name",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"validation-message"})],e.prototype,"validationMessage",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],e.prototype,"autoValidate",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"invalid",void 0),(0,i.Cg)([(0,r.wk)()],e.prototype,"_invalid",void 0),e},c=a.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},82e3(t,e,o){o.d(e,{D5:()=>i,Fy:()=>u,Gk:()=>g,Hg:()=>a,TJ:()=>n,UQ:()=>d,Y_:()=>m,ds:()=>h,e0:()=>r,ec:()=>p,go:()=>l,n2:()=>c,sq:()=>s});o(74423),o(18111),o(61701),o(33110);const i=14881==o.j?`${location.protocol}//${location.host}`:null,a=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}}),r=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),n=()=>fetch("/auth/providers",{credentials:"same-origin"}),s=(t,e,o)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:o,redirect_uri:e})}),l=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),c=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),d=(t,e,o,i)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,o&&(t+=`&state=${encodeURIComponent(o)}`),i&&(t+="&storeToken=true"),document.location.assign(t)},u=async(t,e,o,i)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:o,password:i}),p=(t,e,o)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:o}),h=(t,e,o)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:o}),g=(t,e,o)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:o}),m=(t,e,o)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:o})},88249(t,e,o){o.d(e,{$W:()=>y,Dp:()=>S,Dt:()=>d,G3:()=>V,HB:()=>v,KH:()=>A,Q:()=>c,S9:()=>x,VH:()=>l,XF:()=>u,aI:()=>w,b1:()=>f,fo:()=>k,lB:()=>p,lg:()=>h,mX:()=>C,oj:()=>m,rY:()=>$,sF:()=>L,vH:()=>M,vO:()=>_});o(44114),o(18111),o(7588),o(61701);var i=o(44537),a=o(91926),r=o(6030),n=o(87225),s=o(84025);const l="__DYNAMIC__",c=t=>t?.startsWith(l),d=t=>t.substring(l.length),u=t=>{if("condition"in t&&Array.isArray(t.condition))return{condition:"and",conditions:t.condition};for(const e of n.I8)if(e in t)return{condition:e,conditions:t[e]};return t},p=(t,e)=>{t.callService("automation","trigger",{entity_id:e,skip_condition:!0})},h=(t,e)=>t.callApi("DELETE",`config/automation/config/${e}`);let g;const m=(t,e)=>t.callApi("GET",`config/automation/config/${e}`),y=(t,e)=>t.callWS({type:"automation/config",entity_id:e}),f=(t,e,o)=>t.callApi("POST",`config/automation/config/${e}`,o),v=t=>{t=b(t);for(const e of["triggers","conditions","actions"]){const o=t[e];o&&!Array.isArray(o)&&(t[e]=[o])}return t},b=t=>("trigger"in t&&("triggers"in t||(t.triggers=t.trigger),delete t.trigger),"condition"in t&&("conditions"in t||(t.conditions=t.condition),delete t.condition),"action"in t&&("actions"in t||(t.actions=t.action),delete t.action),t.triggers&&(t.triggers=_(t.triggers)),t.actions&&(t.actions=(0,s.Rn)(t.actions)),t),_=t=>t?Array.isArray(t)?t.map(_):("triggers"in t&&t.triggers&&(t.triggers=_(t.triggers)),"platform"in t&&("trigger"in t||(t.trigger=t.platform),delete t.platform),"options"in t&&t.options&&"behavior"in t.options&&("any"===t.options.behavior?t.options.behavior="each":"last"===t.options.behavior&&(t.options.behavior="all")),t):t,w=t=>{if(!t)return[];const e=[];return(0,i.e)(t).forEach(t=>{"triggers"in t?t.triggers&&e.push(...w(t.triggers)):e.push(t)}),e},C=(t,e)=>{g=t;const o=e?`?${(0,r.KH)({expanded:"1"})}`:"";(0,a.oo)(`/config/automation/edit/new${o}`)},M=t=>{C({...t,id:void 0,alias:void 0})},$=()=>{const t=g;return g=void 0,t},k=t=>{if(!t||"object"!=typeof t)return!1;const e=t;return"trigger"in e&&"string"==typeof e.trigger||"platform"in e&&"string"==typeof e.platform},V=t=>{if(!t||"object"!=typeof t)return!1;return"condition"in t&&"string"==typeof t.condition},A=t=>{if(!t||"object"!=typeof t)return!1;return"field"in t&&"object"==typeof t.field},S=(t,e,o,i)=>t.connection.subscribeMessage(e,{type:"subscribe_trigger",trigger:o,variables:i}),x=(t,e,o)=>t.callWS({type:"test_condition",condition:e,variables:o}),L=(t,e,o)=>t.subscribeMessage(e,{type:"subscribe_condition",condition:o})},87225(t,e,o){o.d(e,{GS:()=>r,I8:()=>s,YQ:()=>u,bn:()=>c,fg:()=>l,oW:()=>n,ob:()=>d});o(74423);var i=o(71727),a=o(68246);const r=[{groups:{dynamicGroups:{},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},helpers:{},template:{},trigger:{},other:{}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.generic.label",generic:!0,groups:{device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",groups:{customDynamicGroups:{}}}],n={and:{},or:{},not:{}},s=["and","or","not"],l=["ha-automation-condition-and","ha-automation-condition-not","ha-automation-condition-or"],c=(t,e)=>t.connection.subscribeMessage(e,{type:"condition_platforms/subscribe"}),d=t=>t.includes(".")?(0,i.m)(t):t,u=t=>t.includes(".")?(0,a.Y)(t):"_"},48250(t,e,o){o.d(e,{Bp:()=>a,aI:()=>i,gg:()=>l,oT:()=>r,wE:()=>n,x0:()=>s});const i=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_user_data",key:e})).value,a=async(t,e,o)=>t.sendMessagePromise({type:"frontend/set_user_data",key:e,value:o}),r=(t,e,o)=>t.subscribeMessage(o,{type:"frontend/subscribe_user_data",key:e}),n=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_system_data",key:e})).value,s=async(t,e,o)=>t.sendMessagePromise({type:"frontend/set_system_data",key:e,value:o}),l=(t,e,o)=>t.subscribeMessage(o,{type:"frontend/subscribe_system_data",key:e})},88360(t,e,o){o.d(e,{j:()=>a});var i=o(1087);const a=(t,e)=>{(0,i.r)(t,"haptic",e)}},95350(t,e,o){if(o.d(e,{$h:()=>p,FP:()=>y,Og:()=>r,QC:()=>u,QQ:()=>s,S1:()=>n,Ud:()=>f,fK:()=>c,l7:()=>d,nQ:()=>g,p$:()=>l}),66649!=o.j)var i=o(35518);if(66649!=o.j)var a=o(9899);const r=66649!=o.j?{bluetooth:"config/bluetooth",dhcp:"config/dhcp",matter:"config/matter",mqtt:"config/mqtt",ssdp:"config/ssdp",thread:"config/thread",zeroconf:"config/zeroconf",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;var n=66649!=o.j?function(t){return t[t.CRITICAL=50]="CRITICAL",t[t.ERROR=40]="ERROR",t[t.WARNING=30]="WARNING",t[t.INFO=20]="INFO",t[t.DEBUG=10]="DEBUG",t[t.NOTSET=0]="NOTSET",t}({}):null;const s=(t,e)=>e.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${t}%22`,l=(t,e,o)=>t(`component.${e}.title`)||o?.name||e,c=(t,e)=>{const o={type:"manifest/list"};return e&&(o.integrations=e),t.callWS(o)},d=async(t,e)=>{const o=await t.sendMessagePromise({type:"manifest/list"}),i={};for(const t of o)i[t.domain]=t;return e(i),()=>{}},u=(t,e)=>t.callWS({type:"manifest/get",integration:e}),p=t=>t.callWS({type:"integration/setup_info"}),h=t=>t.sendMessagePromise({type:"logger/log_info"}),g=(t,e,o,i)=>t.callWS({type:"logger/integration_log_level",integration:e,level:o,persistence:i}),m=(t,e)=>t.subscribeEvents((0,a.s)(()=>h(t).then(t=>e.setState(t,!0)),200,!0),"logging_changed"),y=(t,e)=>(0,i.N)("_integration_log_info",h,m,t,e),f=(t,e)=>t.callWS({type:"integration/wait",domain:e})},84025(t,e,o){o.d(e,{AM:()=>w,BD:()=>g,FN:()=>d,GA:()=>V,Ht:()=>f,Iq:()=>u,Kq:()=>b,NX:()=>C,Q2:()=>y,R$:()=>_,Rn:()=>S,TP:()=>k,dW:()=>h,kR:()=>m,nB:()=>x,pq:()=>M,sW:()=>A,ve:()=>$});o(18111),o(81148),o(61701),o(13579);var i=o(63533),a=o(23832),r=o(68246),n=o(91926),s=o(24790),l=o(6030),c=o(88249);const d=66649!=o.j?["single","restart","queued","parallel"]:null,u=(0,a.g)(["queued","parallel"]),p=(0,i.Ik)({alias:(0,i.lq)((0,i.Yj)()),note:(0,i.lq)((0,i.Yj)()),continue_on_error:(0,i.lq)((0,i.zM)()),enabled:(0,i.lq)((0,i.zM)())}),h=(0,i.Ik)({entity_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),device_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),area_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),floor_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),label_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())]))}),g=(0,i.kp)(p,(0,i.Ik)({action:(0,i.lq)((0,i.Yj)()),service_template:(0,i.lq)((0,i.Yj)()),entity_id:(0,i.lq)((0,i.Yj)()),target:(0,i.lq)((0,i.KC)([h,(0,i.YP)((0,i.Yj)(),"has_template",t=>(0,s.r)(t))])),data:(0,i.lq)((0,i.Ik)()),response_variable:(0,i.lq)((0,i.Yj)()),metadata:(0,i.lq)((0,i.Ik)())})),m=(t,e,o)=>t.callService("script",e,o),y=t=>"off"===t.state||!!("on"===t.state&&u(t.attributes.mode)&&t.attributes.current<t.attributes.max),f=(t,e)=>t.callApi("DELETE",`config/script/config/${e}`);let v;const b=(t,e)=>t.callApi("GET",`config/script/config/${e}`),_=(t,e)=>t.callWS({type:"script/config",entity_id:e}),w=(t,e)=>{v=t;const o=e?`?${(0,l.KH)({expanded:"1"})}`:"";(0,n.oo)(`/config/script/edit/new${o}`)},C=()=>{const t=v;return v=void 0,t},M=t=>"string"==typeof t&&(0,s.r)(t)?"check_condition":"delay"in t?"delay":"wait_template"in t?"wait_template":["condition","and","or","not"].some(e=>e in t)?"check_condition":"event"in t?"fire_event":!("device_id"in t)||"trigger"in t||"condition"in t?"repeat"in t?"repeat":"choose"in t?"choose":"if"in t?"if":"wait_for_trigger"in t?"wait_for_trigger":"variables"in t?"variables":"stop"in t?"stop":"sequence"in t?"sequence":"parallel"in t?"parallel":"set_conversation_response"in t?"set_conversation_response":"action"in t||"service"in t?"service":"unknown":"device_action",$=t=>"unknown"!==M(t),k=(t,e)=>{const o=t.services.script[(0,r.Y)(e)]?.fields;return void 0!==o&&Object.keys(o).length>0},V=(t,e)=>{const o=t.services.script[(0,r.Y)(e)]?.fields;return void 0!==o&&Object.values(o).some(t=>t.required)},A=(t,e,o)=>{const i=t.services.script[(0,r.Y)(e)]?.fields;return void 0===i||0===Object.keys(i).length||void 0!==o&&Object.entries(i).every(([t,e])=>!e.required||void 0!==o[t])},S=t=>{if(!t)return t;if(Array.isArray(t))return t.map(S);if("object"==typeof t&&null!==t&&"service"in t&&("action"in t||(t.action=t.service),delete t.service),"object"==typeof t&&null!==t&&"scene"in t&&(t.action="scene.turn_on",t.target={entity_id:t.scene},delete t.scene),"object"==typeof t&&null!==t&&"action"in t&&"media_player.play_media"===t.action&&"data"in t&&(t.data?.media_content_id||t.data?.media_content_type)){const e={...t.data},o={media_content_id:e.media_content_id,media_content_type:e.media_content_type,metadata:{...t.metadata||{}}};delete t.metadata,delete e.media_content_id,delete e.media_content_type,t.data={...e,media:o}}if("object"==typeof t&&null!==t&&"sequence"in t){delete t.metadata;for(const e of t.sequence)S(e)}const e=M(t);if("parallel"===e){S(t.parallel)}if("choose"===e){const e=t;if(Array.isArray(e.choose))for(const t of e.choose)S(t.sequence);else e.choose&&S(e.choose.sequence);e.default&&S(e.default)}if("repeat"===e){S(t.repeat.sequence)}if("if"===e){const e=t;S(e.then),e.else&&S(e.else)}if("wait_for_trigger"===e){const e=t;(0,c.vO)(e.wait_for_trigger)}return t},x=t=>{const e=t.sequence;return e&&!Array.isArray(e)&&(t.sequence=[e]),t.sequence&&(t.sequence=S(t.sequence)),t}},38859(t,e,o){o.d(e,{C:()=>a,d:()=>i});o(74423);const i=(t,e)=>t.callWS({type:"execute_script",sequence:e}),a=(t,e,o)=>"homeassistant"===t&&["restart","stop"].includes(e)||"update"===t&&"install"===e&&["update.home_assistant_core_update","update.home_assistant_operating_system_update"].includes(o?.entity_id)},46927(t,e,o){if(o.d(e,{$W:()=>d,Hg:()=>r,Wj:()=>n,Yk:()=>u,jG:()=>a,mo:()=>c,ow:()=>s,zt:()=>l}),66649!=o.j)var i=o(48250);var a=function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.quote_decimal="quote_decimal",t.space_comma="space_comma",t.none="none",t}({}),r=function(t){return t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24",t}({}),n=function(t){return t.local="local",t.server="server",t}({}),s=function(t){return t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD",t}({}),l=function(t){return t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday",t}({});const c=(t,e)=>(0,i.oT)(t.connection,"language",e),d=(t,e)=>(0,i.Bp)(t.connection,"language",e),u=async(t,e,o,i,a)=>(await t.callWS({type:"frontend/get_translations",language:e,category:o,integration:i,config_flow:a})).resources},37619(t,e,o){o.d(e,{X:()=>r,s:()=>a});o(69112),o(33110);let i=!1;const a=t=>{i=t},r=(t,e)=>{const o=t.sendMessagePromise(e);return i&&console.log(`⬆️ Sent #${e.id}`,e),i&&o.then(t=>console.log(`⬇️ Received #${e.id}`,t&&"object"==typeof t?JSON.parse(JSON.stringify(t)):t),t=>console.error(`❌ Error #${e.id}`,t)),o}}};