iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 17.5 kB
JavaScript
export const __webpack_ids__=["88089"];export const __webpack_modules__={64214:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{DG:()=>f,E8:()=>w,Fu:()=>_,NR:()=>x,W0:()=>m,o0:()=>h,yD:()=>v});var o=i(16485),n=i(27486),s=i(46467),r=i(33570),l=i(11104),c=i(16922),d=e([o,l,s,r]);[o,l,s,r]=d.then?(await d)():d;const h=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),m=e=>p().format(e),p=(0,n.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),f=(e,t,i)=>g(t,i.time_zone).format(e),g=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,c.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),v=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,c.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),_=(e,t,i)=>(new Date).getFullYear()===e.getFullYear()?v(e,t,i):f(e,t,i),w=(e,t,i)=>b(t,i.time_zone).format(e),b=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),x=(e,t,i)=>`${(0,s.WB)(e,t,i)}, ${(0,r.mr)(e,t,i)}`;a()}catch(e){a(e)}}))},33570:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{Vu:()=>h,Zs:()=>f,mr:()=>c,xO:()=>m});var o=i(16485),n=i(27486),s=i(11104),r=i(16922),l=e([o,s]);[o,s]=l.then?(await l)():l;const c=(e,t,i)=>d(t,i.time_zone).format(e),d=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,r.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),h=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,r.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,r.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),m=(e,t,i)=>p(t,i.time_zone).format(e),p=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,r.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,r.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),f=(e,t,i)=>g(t,i.time_zone).format(e),g=(0,n.Z)(((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,s.f)(e.time_zone,t)})));a()}catch(e){a(e)}}))},97199:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),o=i(57243),n=i(15093),s=i(47194),r=i(95975),l=i(5460),c=i(56032),d=e([r,l,c]);[r,l,c]=d.then?(await d)():d;(0,a.Z)([(0,n.Mo)("state-info")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"in-dialog",type:Boolean})],key:"inDialog",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"color",value:void 0},{kind:"method",key:"render",value:function(){if(!this.hass||!this.stateObj)return o.Ld;const e=(0,s.C)(this.stateObj);return o.dy`<state-badge .hass="${this.hass}" .stateObj="${this.stateObj}" .stateColor="${!0}" .color="${this.color}"></state-badge> <div class="info"> <div class="name ${this.inDialog?"in-dialog":""}" .title="${e}"> ${e} </div> ${this.inDialog?o.dy`<div class="time-ago"> <ha-tooltip> <ha-relative-time .hass="${this.hass}" .datetime="${this.stateObj.last_changed}" capitalize></ha-relative-time> <div slot="content"> <div class="row"> <span class="column-name"> ${this.hass.localize("ui.dialogs.more_info_control.last_changed")}: </span> <ha-relative-time .hass="${this.hass}" .datetime="${this.stateObj.last_changed}" capitalize></ha-relative-time> </div> <div class="row"> <span> ${this.hass.localize("ui.dialogs.more_info_control.last_updated")}: </span> <ha-relative-time .hass="${this.hass}" .datetime="${this.stateObj.last_updated}" capitalize></ha-relative-time> </div> </div> </ha-tooltip> </div>`:o.dy`<div class="extra-info"><slot></slot></div>`} </div>`}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{min-width:120px;white-space:nowrap;display:flex;align-items:center}state-badge{flex:none}.info{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;display:flex;flex-direction:column;justify-content:center;height:100%;min-width:0;text-align:var(--float-start);position:relative}.name{color:var(--primary-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name.in-dialog,:host([secondary-line]) .name{line-height:20px}.extra-info,.extra-info>*,.time-ago{color:var(--secondary-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row{display:flex;flex-direction:row;flex-wrap:no-wrap;width:100%;justify-content:space-between;margin:0 2px 4px 0}.row:last-child{margin-bottom:0px}`}]}}),o.oi);t()}catch(e){t(e)}}))},56032:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(44249),o=i(80519),n=i(1261),s=i(57243),r=i(15093),l=i(85605),c=e([o]);o=(c.then?(await c)():c)[0],(0,l.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,l.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});(0,a.Z)([(0,r.Mo)("ha-tooltip")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[n.Z,s.iv`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:Roboto,sans-serif;--sl-tooltip-font-size:12px;--sl-tooltip-font-weight:normal;--sl-tooltip-line-height:1;--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`]}]}}),o.Z);t()}catch(e){t(e)}}))},68908:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var o=i(44249),n=(i(31622),i(35895)),s=i(32424),r=i(97836),l=i(57243),c=i(15093),d=i(46467),h=i(64214),u=i(33570),m=i(36522),p=i(28281),f=i(97199),g=(i(99426),i(36185)),v=i(73729),y=(i(49653),i(91106)),_=i(28008),w=i(8069),b=i(92588),x=i(77490),k=i(17361),$=i(11104),C=e([f,g,w,b,$,n,u,d,h]);[f,g,w,b,$,n,u,d,h]=C.then?(await C)():C;const z="M15,13H16.5V15.82L18.94,17.23L18.19,18.53L15,16.69V13M19,8H5V19H9.67C9.24,18.09 9,17.07 9,16A7,7 0 0,1 16,9C17.07,9 18.09,9.24 19,9.67V8M5,21C3.89,21 3,20.1 3,19V5C3,3.89 3.89,3 5,3H6V1H8V3H16V1H18V3H19A2,2 0 0,1 21,5V11.1C22.24,12.36 23,14.09 23,16A7,7 0 0,1 16,23C14.09,23 12.36,22.24 11.1,21H5M16,11.15A4.85,4.85 0 0,0 11.15,16C11.15,18.68 13.32,20.85 16,20.85A4.85,4.85 0 0,0 20.85,16C20.85,13.32 18.68,11.15 16,11.15Z";let D=(0,o.Z)(null,(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,c.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,c.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,c.SB)()],key:"_calendarId",value:void 0},{kind:"field",decorators:[(0,c.SB)()],key:"_submitting",value:()=>!1},{kind:"field",decorators:[(0,c.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,c.SB)()],key:"_data",value:void 0},{kind:"method",key:"showDialog",value:async function(e){if(this._params=e,e.entry){const t=e.entry;this._data=t,this._calendarId=e.calendarId}}},{kind:"method",key:"closeDialog",value:function(){this._calendarId=void 0,this._params=void 0,(0,m.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){if(!this._params)return l.Ld;const e=this.hass.states[this._calendarId];return l.dy` <ha-dialog open @closed="${this.closeDialog}" scrimClickAction escapeKeyAction .heading="${(0,v.i)(this.hass,this._data.summary)}"> <div class="content"> ${this._error?l.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""} <div class="field"> <ha-svg-icon .path="${z}"></ha-svg-icon> <div class="value"> ${this._formatDateRange()}<br> ${this._data.rrule?this._renderRRuleAsText(this._data.rrule):""} ${this._data.description?l.dy`<br> <div class="description">${this._data.description}</div> <br>`:l.Ld} </div> </div> <div class="attribute"> <state-info .hass="${this.hass}" .stateObj="${e}" .color="${this._params.color}" in-dialog></state-info> </div> </div> ${this._params.canDelete?l.dy` <mwc-button slot="secondaryAction" class="warning" @click="${this._deleteEvent}" .disabled="${this._submitting}"> ${this.hass.localize("ui.components.calendar.event.delete")} </mwc-button> `:""} ${this._params.canEdit?l.dy`<mwc-button slot="primaryAction" @click="${this._editEvent}" .disabled="${this._submitting}"> ${this.hass.localize("ui.components.calendar.event.edit")} </mwc-button>`:""} </ha-dialog> `}},{kind:"method",key:"_renderRRuleAsText",value:function(e){if(!e)return"";try{const t=(0,b.yI)(this.hass,e);return void 0!==t?l.dy`<div id="text">${t}</div>`:l.dy`<div id="text">Cannot convert recurrence rule</div>`}catch(e){return"Error while processing the rule"}}},{kind:"method",key:"_formatDateRange",value:function(){const e=(0,$.f)(this.hass.locale.time_zone,this.hass.config.time_zone),t=(0,n.ZU)(this._data.dtstart,{timeZone:e}),i=(0,n.ZU)(this._data.dtend,{timeZone:e}),a=(0,p.J)(this._data.dtend)?(0,s.E)(i,-1):i;return(0,r.K)(t,a)?(0,p.J)(this._data.dtstart)?(0,d.p6)(t,this.hass.locale,this.hass.config):`${(0,d.p6)(t,this.hass.locale,this.hass.config)} ${(0,u.mr)(t,this.hass.locale,this.hass.config)} - ${(0,u.mr)(a,this.hass.locale,this.hass.config)}`:`${(0,p.J)(this._data.dtstart)?(0,d.p6)(t,this.hass.locale,this.hass.config):(0,h.o0)(t,this.hass.locale,this.hass.config)} - ${(0,p.J)(this._data.dtend)?(0,d.p6)(a,this.hass.locale,this.hass.config):(0,h.o0)(a,this.hass.locale,this.hass.config)}`}},{kind:"method",key:"_editEvent",value:async function(){(0,k.R)(this,this._params),this.closeDialog()}},{kind:"method",key:"_deleteEvent",value:async function(){this._submitting=!0;const e=this._params.entry,t=await(0,x.Y)(this,{title:this.hass.localize("ui.components.calendar.event.confirm_delete.delete"),text:e.recurrence_id?this.hass.localize("ui.components.calendar.event.confirm_delete.recurring_prompt"):this.hass.localize("ui.components.calendar.event.confirm_delete.prompt"),confirmText:e.recurrence_id?this.hass.localize("ui.components.calendar.event.confirm_delete.delete_this"):this.hass.localize("ui.components.calendar.event.confirm_delete.delete"),confirmFutureText:e.recurrence_id?this.hass.localize("ui.components.calendar.event.confirm_delete.delete_future"):void 0});if(void 0!==t){try{await(0,y.d1)(this.hass,this._calendarId,e.uid,e.recurrence_id||"",t)}catch(e){return void(this._error=e?e.message:"Unknown error")}finally{this._submitting=!1}await this._params.updated(),this.closeDialog()}else this._submitting=!1}},{kind:"get",static:!0,key:"styles",value:function(){return[_.yu,l.iv`state-info{line-height:40px}ha-svg-icon{width:40px;margin-right:8px;margin-inline-end:8px;margin-inline-start:initial;direction:var(--direction);vertical-align:top}.field{display:flex}.description{color:var(--secondary-text-color);max-width:300px;overflow-wrap:break-word}`]}}]}}),l.oi);customElements.define("dialog-calendar-event-detail",D),a()}catch(e){a(e)}}))},48734:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{P5:()=>u,Ve:()=>p});var o=i(16485),n=(i(9359),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),e([o]));o=(n.then?(await n)():n)[0];const s=new Set,r=new Map;let l,c="ltr",d="en";const h="undefined"!=typeof MutationObserver&&"undefined"!=typeof document&&void 0!==document.documentElement;if(h){const f=new MutationObserver(m);c=document.documentElement.dir||"ltr",d=document.documentElement.lang||navigator.language,f.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function u(...e){e.map((e=>{const t=e.$code.toLowerCase();r.has(t)?r.set(t,Object.assign(Object.assign({},r.get(t)),e)):r.set(t,e),l||(l=e)})),m()}function m(){h&&(c=document.documentElement.dir||"ltr",d=document.documentElement.lang||navigator.language),[...s.keys()].map((e=>{"function"==typeof e.requestUpdate&&e.requestUpdate()}))}class p{constructor(e){this.host=e,this.host.addController(this)}hostConnected(){s.add(this.host)}hostDisconnected(){s.delete(this.host)}dir(){return`${this.host.dir||c}`.toLowerCase()}lang(){return`${this.host.lang||d}`.toLowerCase()}getTranslationData(e){var t,i;const a=new Intl.Locale(e.replace(/_/g,"-")),o=null==a?void 0:a.language.toLowerCase(),n=null!==(i=null===(t=null==a?void 0:a.region)||void 0===t?void 0:t.toLowerCase())&&void 0!==i?i:"";return{locale:a,language:o,region:n,primary:r.get(`${o}-${n}`),secondary:r.get(o)}}exists(e,t){var i;const{primary:a,secondary:o}=this.getTranslationData(null!==(i=t.lang)&&void 0!==i?i:this.lang());return t=Object.assign({includeFallback:!1},t),!!(a&&a[e]||o&&o[e]||t.includeFallback&&l&&l[e])}term(e,...t){const{primary:i,secondary:a}=this.getTranslationData(this.lang());let o;if(i&&i[e])o=i[e];else if(a&&a[e])o=a[e];else{if(!l||!l[e])return console.error(`No translation found for: ${String(e)}`),String(e);o=l[e]}return"function"==typeof o?o(...t):o}date(e,t){return e=new Date(e),new Intl.DateTimeFormat(this.lang(),t).format(e)}number(e,t){return e=Number(e),isNaN(e)?"":new Intl.NumberFormat(this.lang(),t).format(e)}relativeTime(e,t,i){return new Intl.RelativeTimeFormat(this.lang(),i).format(e,t)}}a()}catch(g){a(g)}}))},31027:function(e,t,i){i.d(t,{P:()=>r});i(9359),i(31526);var a,o=i(52812),n=i(57243),s=i(15093),r=class extends n.oi{constructor(){super(),(0,o.Ko)(this,a,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach((([e,t])=>{this.constructor.define(e,t)}))}emit(e,t){const i=new CustomEvent(e,(0,o.ih)({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){const a=customElements.get(e);if(!a){try{customElements.define(e,t,i)}catch(a){customElements.define(e,class extends t{},i)}return}let o=" (unknown version)",n=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in a&&a.version&&(n=" v"+a.version),o&&n&&o===n||console.warn(`Attempted to register <${e}>${o}, but <${e}>${n} has already been registered.`)}attributeChangedCallback(e,t,i){(0,o.ac)(this,a)||(this.constructor.elementProperties.forEach(((e,t)=>{e.reflect&&null!=this[t]&&this.initialReflectedProperties.set(t,this[t])})),(0,o.qx)(this,a,!0)),super.attributeChangedCallback(e,t,i)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach(((t,i)=>{e.has(i)&&null==this[i]&&(this[i]=t)}))}};a=new WeakMap,r.version="2.20.1",r.dependencies={},(0,o.u2)([(0,s.Cb)()],r.prototype,"dir",2),(0,o.u2)([(0,s.Cb)()],r.prototype,"lang",2)},15073:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{V:()=>r});var o=i(21262),n=i(48734),s=e([n,o]);[n,o]=s.then?(await s)():s;var r=class extends n.Ve{};(0,n.P5)(o.K),a()}catch(e){a(e)}}))},21262:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{K:()=>r});var o=i(48734),n=e([o]);o=(n.then?(await n)():n)[0];var s={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>0===e?"No options selected":1===e?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};(0,o.P5)(s);var r=s;a()}catch(e){a(e)}}))},52812:function(e,t,i){i.d(t,{EZ:()=>m,Ko:()=>v,ac:()=>g,ih:()=>u,qx:()=>y,u2:()=>p});var a=Object.defineProperty,o=Object.defineProperties,n=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,d=e=>{throw TypeError(e)},h=(e,t,i)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,u=(e,t)=>{for(var i in t||(t={}))l.call(t,i)&&h(e,i,t[i]);if(r)for(var i of r(t))c.call(t,i)&&h(e,i,t[i]);return e},m=(e,t)=>o(e,s(t)),p=(e,t,i,o)=>{for(var s,r=o>1?void 0:o?n(t,i):t,l=e.length-1;l>=0;l--)(s=e[l])&&(r=(o?s(t,i,r):s(r))||r);return o&&r&&a(t,i,r),r},f=(e,t,i)=>t.has(e)||d("Cannot "+i),g=(e,t,i)=>(f(e,t,"read from private field"),i?i.call(e):t.get(e)),v=(e,t,i)=>t.has(e)?d("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),y=(e,t,i,a)=>(f(e,t,"write to private field"),a?a.call(e,i):t.set(e,i),i)},81048:function(e,t,i){i.d(t,{N:()=>a});var a=i(57243).iv`:host{box-sizing:border-box}:host *,:host ::after,:host ::before{box-sizing:inherit}[hidden]{display:none!important}`},97836:function(e,t,i){i.d(t,{K:()=>n});var a=i(18492),o=i(7591);function n(e,t,i){const[n,s]=(0,a.d)(i?.in,e,t);return+(0,o.b)(n)==+(0,o.b)(s)}}};
//# sourceMappingURL=88089.81403a167ed1d020.js.map