iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 15.3 kB
JavaScript
export const __rspack_esm_id=52487;export const __rspack_esm_ids=[52487];export const __webpack_modules__={26218(e,t,a){a.d(t,{a:()=>o});const s=(0,a(77796).n)(e=>{history.replaceState({scrollPosition:e},"")},300);function o(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=t.connectedCallback;t.connectedCallback=function(){o.call(this);const t=this[a];t&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(e);a&&setTimeout(()=>{a.scrollTop=t},0)})};const r=Object.getOwnPropertyDescriptor(t,a);let i;if(void 0===r)i={get(){return this[`__${String(a)}`]||history.state?.scrollPosition},set(e){s(e),this[`__${String(a)}`]=e},configurable:!0,enumerable:!0};else{const e=r.set;i={...r,set(t){s(t),this[`__${String(a)}`]=t,e?.call(this,t)}}}Object.defineProperty(t,a,i)}}},77796(e,t,a){a.d(t,{n:()=>s});const s=(e,t,a=!0,s=!0)=>{let o,r=0;const i=(...i)=>{const c=()=>{r=!1===a?0:Date.now(),o=void 0,e(...i)},n=Date.now();r||!1!==a||(r=n);const l=t-(n-r);l<=0||l>t?(o&&(clearTimeout(o),o=void 0),r=n,e(...i)):o||!1===s||(o=window.setTimeout(c,l))};return i.cancel=()=>{clearTimeout(o),o=void 0,r=0},i}},34296(e,t,a){var s=a(62826),o=a(96229),r=a(26069),i=a(91735),c=a(42034),n=a(5124),l=a(22441);class d extends o.k{renderOutline(){return this.filled?n.qy`<span class="filled"></span>`:super.renderOutline()}getContainerClasses(){return{...super.getContainerClasses(),active:this.active}}renderPrimaryContent(){return n.qy` <span class="leading icon" aria-hidden="true"> ${this.renderLeadingIcon()} </span> <span class="label">${this.label}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${this.renderTrailingIcon()} </span> `}renderTrailingIcon(){return n.qy`<slot name="trailing-icon"></slot>`}constructor(...e){super(...e),this.filled=!1,this.active=!1}}d.styles=[i.R,c.R,r.R,n.AH`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var(
--ha-assist-chip-container-shape,
16px
);--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`],(0,s.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],d.prototype,"filled",void 0),(0,s.Cg)([(0,l.MZ)({type:Boolean})],d.prototype,"active",void 0),d=(0,s.Cg)([(0,l.EM)("ha-assist-chip")],d)},47680(e,t,a){a.r(t),a.d(t,{HaIcon:()=>S});a(74423);var s=a(62826),o=a(5124),r=a(22441),i=a(1087),c=a(9899),n=a(700),l=(a(44114),a(18111),a(7588),a(95192)),d=a(7553);const f=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let h;const b=()=>(h||(h=p().catch(e=>{throw h=void 0,e})),h),p=async()=>{const e=(0,l.y$)("hass-icon-db","mdi-icon-store"),t=await(0,l.Jt)("_version",e);return t?t!==f.version&&(await(0,l.IU)(e),(0,l.hZ)("_version",f.version,e)):(0,l.hZ)("_version",f.version,e),e},u=["mdi","hass","hassio","hademo"];let v=[];a(67094);const g={},m={},y=(0,c.s)(()=>(async e=>{const t=Object.keys(e),a=await Promise.allSettled(Object.values(e));(await b())("readwrite",s=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([e,t])=>{s.put(t,e)}),delete e[t[o]]})})})(m),2e3),_={},w={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(e=>e.mdiEsphomeLogo)};class S extends o.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?o.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:o.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:o.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let s,o=a;if(!t||!o)return;if(!u.includes(t)){const a=n.y[t];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in g){const e=g[o];let a;e.newName?(a=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):a=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(a),(0,i.r)(this,"write_log",{level:"warning",message:a})}if(o in _)return void(this._path=_[o]);if(o in w){const t=await w[o]();return this.icon===e&&(this._path=t),void(_[o]=t)}try{s=await(e=>new Promise((t,a)=>{if(v.push([e,t,a]),v.length>1)return;const s=b();(0,d.h)(1e3,(async()=>{(await s)("readonly",e=>{for(const[t,a,s]of v)(0,l.Yd)(e.get(t)).then(e=>a(e)).catch(e=>s(e));v=[]})})()).catch(e=>{for(const[,,t]of v)t(e);v=[]})}))(o)}catch(e){s=void 0}if(s)return this.icon===e&&(this._path=s),void(_[o]=s);const r=(e=>{let t;for(const a of f.parts){if(void 0!==a.start&&e<a.start)break;t=a}return t.file})(o);if(r in m)return void this._setPath(m[r],o,e);const c=fetch(`/static/mdi/${r}.json`).then(e=>e.json());m[r]=c,this._setPath(c,o,e),c.catch(()=>{delete m[r]}),y()}async _setCustomPath(e,t){const a=await e;this.icon===t&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(e,t,a){try{const s=await e;this.icon===a&&(this._path=s[t]),_[t]=s[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}S.styles=o.AH`:host{fill:currentcolor}`,(0,s.Cg)([(0,r.MZ)()],S.prototype,"icon",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_path",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_secondaryPath",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_viewBox",void 0),(0,s.Cg)([(0,r.wk)()],S.prototype,"_legacy",void 0),S=(0,s.Cg)([(0,r.EM)("ha-icon")],S)},36866(e,t,a){a.a(e,async function(e,t){try{var s=a(62826),o=a(5124),r=a(22441),i=a(91485),c=e([i]);i=(c.then?(await c)():c)[0];const n="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class l extends i.U{willUpdate(e){super.willUpdate(e),this.label||this.placeholder||this.hasUpdated&&!e.has("_i18n")||(this.placeholder=this.i18n?.localize?.("ui.common.search")||"Search")}renderStartDefault(){return o.qy`<ha-svg-icon slot="start" .path="${n}"></ha-svg-icon>`}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}l.styles=[...i.U.styles,o.AH`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`],l=(0,s.Cg)([(0,r.EM)("ha-input-search")],l),t()}catch(e){t(e)}})},700(e,t,a){a.d(t,{y:()=>i});const s=window;"customIconsets"in s||(s.customIconsets={});const o=s.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const i=new Proxy(r.customIcons,{get:(e,t)=>e[t]??(o[t]?{getIcon:o[t]}:void 0)})},35952(e,t,a){function s(e){return"strategy"in e}a.d(t,{Dz:()=>o,Wu:()=>s,ql:()=>r});const o=(e,t,a)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:a}),r=(e,t,a)=>e.callWS({type:"lovelace/config/save",url_path:t,config:a})},71730(e,t,a){a.d(t,{A_:()=>i,SJ:()=>s,mQ:()=>r,n6:()=>o});const s=e=>e.callWS({type:"lovelace/dashboards/list"}),o=(e,t)=>e.callWS({type:"lovelace/dashboards/create",...t}),r=(e,t,a)=>e.callWS({type:"lovelace/dashboards/update",dashboard_id:t,...a}),i=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},59992(e,t,a){a.d(t,{V:()=>n});var s=a(62826),o=a(88696),r=a(5124),i=a(6412),c=a(22441);const n=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return r.qy` <div class="${(0,i.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,i.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],r.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:s=0,scrollTop:o=0}=e;this._contentScrollable=a-s>o+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new o.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,s.Cg)([(0,c.wk)()],t.prototype,"_contentScrolled",void 0),(0,s.Cg)([(0,c.wk)()],t.prototype,"_contentScrollable",void 0),t}},85614(e,t,a){a.d(t,{i:()=>s});const s=async()=>{await Promise.all([a.e(69139),a.e(22309)]).then(a.bind(a,46974))}},22348(e,t,a){a.d(t,{V:()=>o});var s=a(37177);const o=e=>!!e&&s.n},37177(e,t,a){a.d(t,{n:()=>s});const s=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}};