UNPKG

iobroker.lovelace

Version:

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

1 lines 10.4 kB
export const __rspack_esm_id=27379;export const __rspack_esm_ids=[27379];export const __webpack_modules__={93421(t,s,e){e.d(s,{IW:()=>h,dH:()=>l,fI:()=>c});e(44114);var o=e(35211),i=e(22792),r=e(32172);const a=(t,s)=>{let e=t;for(const t of s){if(null==e)return;e=e[t]}return e},n=(t,s,e)=>{const i=(0,r.p)({transformer:function(t){return e.call(this,t)},watch:s?[s]:[]}),a=(0,o.Fg)({context:t,subscribe:!0});return(t,s)=>{i(t,s),a(t,s)}},c=t=>n(i.iN,t.entityIdPath[0],function(s){const e=a(this,t.entityIdPath);return"string"==typeof e?s?.[e]:void 0}),l=t=>n(i.X1,t.entityIdPath[0],function(s){const e=a(this,t.entityIdPath);return"string"==typeof e?s?.[e]:void 0}),h=()=>n(i.D5,void 0,({localize:t})=>t)},32172(t,s,e){e.d(s,{p:()=>o});e(18111),e(7588),e(45367),e(92731),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698);function o(t){return(s,e)=>{if("object"==typeof e)throw new Error("This decorator does not support this compilation type.");const o=String(e),i=s;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const t=i._transformers;i._transformers=new Map,t.forEach((t,s)=>i._transformers.set(s,t))}}else{i._transformers=new Map,i._watching=new Map;const t=i.willUpdate;i.willUpdate=function(s){t.call(this,s);const e=new Set;s.forEach((t,s)=>{const o=this._watching.get(s);void 0!==o&&o.forEach(t=>e.add(t))}),e.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}i._transformers.set(e,t.transformer),t.watch&&t.watch.forEach(t=>{let s=i._watching.get(t);s||(s=new Set,i._watching.set(t,s)),s.add(e)});const r=Object.getOwnPropertyDescriptor(s,e);let a;if(void 0===r)a={get(){return this[`__transform_${o}`]},set(t){const s=this[`__transform_${o}`],e=this._transformers.get(o);this[`__transform_${o}`]=e?e.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,s)},configurable:!0,enumerable:!0};else{const t=r.set;a={...r,set(s){const e=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,s):s,this[`__original_${o}`]=s,this.requestUpdate(o,e),t?.call(this,s)}}}Object.defineProperty(s,e,a)}}},69093(t,s,e){e.d(s,{t:()=>i});var o=e(71727);const i=t=>(0,o.m)(t.entity_id)},82286(t,s,e){e.d(s,{$:()=>o});const o=(t,s)=>i(t.attributes,s),i=(t,s)=>0!==(t.supported_features&s)},38962(t,s,e){e.a(t,async function(t,o){try{e.r(s);var i=e(62826),r=e(5124),a=e(22441),n=e(6412),c=e(93421),l=e(1087),h=e(26300),d=(e(67094),t([h]));h=(d.then?(await d)():d)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends r.WF{render(){return r.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=r.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,i.Cg)([(0,a.MZ)()],_.prototype,"title",void 0),(0,i.Cg)([(0,a.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,i.Cg)([(0,a.wk)(),(0,c.IW)()],_.prototype,"_localize",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,i.Cg)([(0,a.EM)("ha-alert")],_),o()}catch(t){o(t)}})},24367(t,s,e){e.d(s,{L:()=>i,z:()=>r});var o=e(23832);const i=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,o.g)(i)},56660(t,s,e){e.a(t,async function(t,o){try{e.r(s);var i=e(62826),r=e(5124),a=e(22441),n=e(1087),c=(e(93444),e(52763)),l=e(18350),h=e(72554),d=e(82e3),p=e(14503),u=e(81619),_=t([c,l,h]);[c,l,h]=_.then?(await _)():_;const g=[{name:"new_password",required:!0,selector:{text:{type:"password",autocomplete:"new-password"}}},{name:"password_confirm",required:!0,selector:{text:{type:"password",autocomplete:"new-password"}}}];class m extends r.WF{showDialog(t){this._params=t,this._userId=t.userId,this._data=void 0,this._error=void 0,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._userId=void 0,this._data=void 0,this._error=void 0,this._submitting=!1,this._success=!1,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}_validate(){this._data&&this._data.new_password&&this._data.password_confirm&&this._data.new_password!==this._data.password_confirm?this._error={password_confirm:"password_no_match"}:this._error=void 0}render(){if(!this._params)return r.s6;const t=Boolean(this._data?.new_password&&this._data?.password_confirm&&!this._error);return r.qy` <ha-dialog .open="${this._open}" prevent-scrim-close header-title="${this.hass.localize("ui.panel.config.users.change_password.caption")}" @closed="${this._dialogClosed}"> ${this._success?r.qy` <p> ${this.hass.localize("ui.panel.config.users.change_password.password_changed")} </p> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.ok")} </ha-button> </ha-dialog-footer> `:r.qy` <ha-form autofocus .hass="${this.hass}" .data="${this._data}" .error="${this._error}" .schema="${g}" .computeLabel="${this._computeLabel}" .computeError="${this._computeError}" @value-changed="${this._valueChanged}" .disabled="${this._submitting}"></ha-form> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" @click="${this._changePassword}" .disabled="${this._submitting||!t}"> ${this.hass.localize("ui.panel.config.users.change_password.change")} </ha-button> </ha-dialog-footer> `} </ha-dialog> `}_valueChanged(t){this._data=t.detail.value,this._validate()}async _changePassword(){if(this._userId&&this._data?.new_password)try{this._submitting=!0,await(0,d.ds)(this.hass,this._userId,this._data.new_password),this._success=!0}catch(t){(0,u.P)(this,{message:t.body?.message||t.message||t})}finally{this._submitting=!1}}static get styles(){return[p.nA,r.AH``]}constructor(...t){super(...t),this._open=!1,this._submitting=!1,this._success=!1,this._computeLabel=t=>this.hass.localize(`ui.panel.config.users.change_password.${t.name}`),this._computeError=t=>this.hass.localize(`ui.panel.config.users.change_password.${t}`)||t}}(0,i.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_params",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_open",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_userId",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_data",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_error",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_submitting",void 0),(0,i.Cg)([(0,a.wk)()],m.prototype,"_success",void 0),m=(0,i.Cg)([(0,a.EM)("dialog-admin-change-password")],m),o()}catch(t){o(t)}})},48646(t,s,e){var o=e(69565),i=e(28551),r=e(1767),a=e(50851);t.exports=function(t,s){s&&"string"==typeof t||i(t);var e=a(t);return r(i(void 0!==e?o(e,t):t))}},30531(t,s,e){var o=e(46518),i=e(69565),r=e(79306),a=e(28551),n=e(1767),c=e(48646),l=e(19462),h=e(9539),d=e(96395),p=e(30684),u=e(84549);var _=!d&&!p("flatMap",function(){}),g=!d&&!_&&u("flatMap",TypeError),m=d||_||g||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(t){return!0}}(),f=l(function(){for(var t,s,e=this.iterator,o=this.mapper;;){if(s=this.inner)try{if(!(t=a(i(s.next,s.iterator))).done)return t.value;this.inner=null}catch(t){h(e,"throw",t)}if(t=a(i(this.next,e)),this.done=!!t.done)return;try{this.inner=c(o(t.value,this.counter++),!1)}catch(t){h(e,"throw",t)}}});o({target:"Iterator",proto:!0,real:!0,forced:m},{flatMap:function(t){a(this);try{r(t)}catch(t){h(this,"throw",t)}return g?i(g,this,t):new f(n(this),{mapper:t,inner:null})}})}};