iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 19.8 kB
JavaScript
/*! For license information please see 14421.e80940800ab9f4a8.js.LICENSE.txt */
export const __rspack_esm_id=14421;export const __rspack_esm_ids=[14421];export const __webpack_modules__={68462(t,e,r){r.d(e,{M:()=>f});var i=r(62826),o=r(7658),a={ROOT:"mdc-form-field"},n={LABEL_SELECTOR:".mdc-form-field > label"};const l=function(t){function e(r){var o=t.call(this,(0,i.Cl)((0,i.Cl)({},e.defaultAdapter),r))||this;return o.click=function(){o.handleClick()},o}return(0,i.C6)(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return a},enumerable:!1,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return n},enumerable:!1,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},e.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},e}(o.I);var s=r(12451),d=r(51324),c=r(56161),h=r(5124),u=r(22441),p=r(6412);class f extends s.O{createAdapter(){return{registerInteractionHandler:(t,e)=>{this.labelEl.addEventListener(t,e)},deregisterInteractionHandler:(t,e)=>{this.labelEl.removeEventListener(t,e)},activateInputRipple:async()=>{const t=this.input;if(t instanceof d.ZS){const e=await t.ripple;e&&e.startPress()}},deactivateInputRipple:async()=>{const t=this.input;if(t instanceof d.ZS){const e=await t.ripple;e&&e.endPress()}}}}get input(){var t,e;return null!==(e=null===(t=this.slottedInputs)||void 0===t?void 0:t[0])&&void 0!==e?e:null}render(){const t={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return h.qy` <div class="mdc-form-field ${(0,p.H)(t)}"> <slot></slot> <label class="mdc-label" ="${this._labelClick}">${this.label}</label> </div>`}click(){this._labelClick()}_labelClick(){const t=this.input;t&&(t.focus(),t.click())}constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=l}}(0,i.Cg)([(0,u.MZ)({type:Boolean})],f.prototype,"alignEnd",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean})],f.prototype,"spaceBetween",void 0),(0,i.Cg)([(0,u.MZ)({type:Boolean})],f.prototype,"nowrap",void 0),(0,i.Cg)([(0,u.MZ)({type:String}),(0,c.P)(async function(t){var e;null===(e=this.input)||void 0===e||e.setAttribute("aria-label",t)})],f.prototype,"label",void 0),(0,i.Cg)([(0,u.P)(".mdc-form-field")],f.prototype,"mdcRoot",void 0),(0,i.Cg)([(0,u.KN)({slot:"",flatten:!0,selector:"*"})],f.prototype,"slottedInputs",void 0),(0,i.Cg)([(0,u.P)("label")],f.prototype,"labelEl",void 0)},38627(t,e,r){r.d(e,{R:()=>i});const i=r(5124).AH`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`},77957(t,e,r){var i=r(76080),o=r(79504),a=r(47055),n=r(48981),l=r(56969),s=r(26198),d=r(2360),c=r(35370),h=Array,u=o([].push);t.exports=function(t,e,r,o){for(var p,f,b,m=n(t),g=a(m),y=i(e,r),v=d(null),w=s(g),k=0;w>k;k++)b=g[k],(f=l(y(b,k,m)))in v?u(v[f],b):v[f]=[b];if(o&&(p=o(m))!==h)for(f in v)v[f]=c(p,v[f]);return v}},71658(t,e,r){var i=r(46518),o=r(6469),a=r(96837),n=r(26198),l=r(35610),s=r(25397),d=r(91291),c=r(97040),h=Array,u=Math.max,p=Math.min;i({target:"Array",proto:!0},{toSpliced:function(t,e){var r,i,o,f,b=s(this),m=n(b),g=l(t,m),y=arguments.length,v=0;for(0===y?r=i=0:1===y?(r=0,i=m-g):(r=y-2,i=p(u(d(e),0),m-g)),o=a(m+r-i),f=h(o);v<g;v++)c(f,v,b[v]);for(;v<g+r;v++)c(f,v,arguments[v-g+2]);for(;v<o;v++)c(f,v,b[v+i-r]);return f}}),o("toSpliced")},46058(t,e,r){var i=r(46518),o=r(77957),a=r(6469);i({target:"Array",proto:!0},{group:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),a("group")},31886(t,e,r){r.a(t,async function(t,i){try{r.d(e,{BB:()=>o.B});r(38744);var o=r(88775),a=r(49232),n=r(78713),l=r(53834),s=r(35204),d=r(5806),c=t([o,a,n,l,s,d]);[o,a,n,l,s,d]=c.then?(await c)():c,i()}catch(t){i(t)}})},22395(t,e,r){var i=r(5124),o=r(22441),a=r(717),n=i.AH`:host{display:inline-flex}.button-group{display:flex;position:relative;isolation:isolate;flex-wrap:wrap} (hover:hover){.button-group::slotted(:hover),.button-group>:hover{z-index:1}}.button-group::slotted(:focus),.button-group::slotted([aria-checked=true]),.button-group::slotted([checked]),.button-group>:focus,.button-group>[aria-checked=true],.button-group>[checked]{z-index:2!important}:host([orientation=horizontal]) .button-group{flex-direction:row}:host([orientation=vertical]) .button-group{flex-direction:column}:host([orientation=horizontal]){--_button-horizontal-indent:var(--wa-form-control-border-width);--_button-horizontal-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}:host([orientation=vertical]){--_button-vertical-indent:var(--wa-form-control-border-width);--_button-vertical-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}::slotted(:not(:first-child):not(:last-child)){--_button-start-start-radius:0;--_button-start-end-radius:0;--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:first-child:not(:last-child)){--_button-start-end-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-end-start-radius:0}:host([orientation=vertical]) ::slotted(:first-child:not(:last-child)){--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=vertical]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-start-end-radius:0}`,l=Object.defineProperty,s=Object.getOwnPropertyDescriptor,d=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?s(e,r):e,n=t.length-1;n>=0;n--)(o=t[n])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&l(e,r,a),a};let c=class extends a.A{updated(t){super.updated(t),t.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(t){const e=h(t.target,this.childSelector);e?.classList.add("button-focus")}handleBlur(t){const e=h(t.target,this.childSelector);e?.classList.remove("button-focus")}handleMouseOver(t){const e=h(t.target,this.childSelector);e?.classList.add("button-hover")}handleMouseOut(t){const e=h(t.target,this.childSelector);e?.classList.remove("button-hover")}render(){return i.qy` <slot part="base" class="button-group" role="${this.disableRole?"presentation":"group"}" aria-label="${this.label}" aria-orientation="${this.orientation}" ="${this.handleBlur}" ="${this.handleFocus}" ="${this.handleMouseOver}" ="${this.handleMouseOut}"></slot> `}constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal",this.childSelector="wa-button, wa-radio-button"}};function h(t,e){return t.closest(e)??t.querySelector(e)}c.css=[n],d([(0,o.P)("slot")],c.prototype,"defaultSlot",2),d([(0,o.wk)()],c.prototype,"disableRole",2),d([(0,o.wk)()],c.prototype,"hasOutlined",2),d([(0,o.MZ)()],c.prototype,"label",2),d([(0,o.MZ)({reflect:!0})],c.prototype,"orientation",2),d([(0,o.MZ)()],c.prototype,"childSelector",2),c=d([(0,o.EM)("wa-button-group")],c)},29344(t,e,r){r.a(t,async function(t,i){try{r.d(e,{A:()=>x});var o=r(5124),a=r(22441),n=r(6412),l=r(63672),s=r(34514),d=r(40991),c=r(92070),h=r(41268),u=r(9395),p=r(62676),f=r(15477),b=r(31896),m=r(17060),g=r(19978),y=t([m]);m=(y.then?(await y)():y)[0];var v=Object.defineProperty,w=Object.getOwnPropertyDescriptor,k=(t,e,r,i)=>{for(var o,a=i>1?void 0:i?w(e,r):e,n=t.length-1;n>=0;n--)(o=t[n])&&(a=(i?o(e,r,a):o(a))||a);return i&&a&&v(e,r,a),a};let x=class extends p.q{static get validators(){return[...super.validators,(0,h.i)()]}get value(){return this._value??"on"}set value(t){this._value=t}handleSizeChange(){(0,d.b)(this.localName,this.size)}get checked(){return this.valueHasChanged?Boolean(this._checked):this._checked??this.defaultChecked}set checked(t){this._checked=Boolean(t),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(t){const e="rtl"===this.localize.dir();"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("checked")||t.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}setValue(t,e){this.checked?this.internals.setFormValue(t??"on",e):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const t=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,e=!!this.hint||!!t;return o.qy` <label part="base" class="${(0,n.H)({checked:this.checked,disabled:this.disabled})}"> <input class="input" type="checkbox" title="${this.title}" name="${(0,l.J)(this.name)}" value="${(0,l.J)(this.value)}" .checked="${(0,s.V)(this.checked)}" .disabled="${this.disabled}" .required="${this.required}" role="switch" aria-checked="${this.checked?"true":"false"}" aria-describedby="hint" ="${this.handleClick}" ="${this.handleKeyDown}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${(0,n.H)({"has-slotted":e})}" aria-hidden="${e?"false":"true"}">${this.hint}</slot> `}constructor(){super(...arguments),this.hasSlotController=new c.X(this,"hint"),this.localize=new m.c(this),this.title="",this.name=null,this._value=this.getAttribute("value")??null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};x.shadowRootOptions={...p.q.shadowRootOptions,delegatesFocus:!0},x.css=[f.A,b.A,g.A],k([(0,a.P)('input[type="checkbox"]')],x.prototype,"input",2),k([(0,a.MZ)()],x.prototype,"title",2),k([(0,a.MZ)({reflect:!0})],x.prototype,"name",2),k([(0,a.MZ)({reflect:!0})],x.prototype,"value",1),k([(0,a.MZ)({reflect:!0})],x.prototype,"size",2),k([(0,u.w)("size")],x.prototype,"handleSizeChange",1),k([(0,a.MZ)({type:Boolean})],x.prototype,"disabled",2),k([(0,a.MZ)({type:Boolean,attribute:!1})],x.prototype,"checked",1),k([(0,a.MZ)({type:Boolean,attribute:"checked",reflect:!0})],x.prototype,"defaultChecked",2),k([(0,a.MZ)({type:Boolean,reflect:!0})],x.prototype,"required",2),k([(0,a.MZ)({attribute:"hint"})],x.prototype,"hint",2),k([(0,a.MZ)({attribute:"with-hint",type:Boolean})],x.prototype,"withHint",2),k([(0,u.w)(["checked","defaultChecked"])],x.prototype,"handleStateChange",1),k([(0,u.w)("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1),x=k([(0,a.EM)("wa-switch")],x),x.disableWarning?.("change-in-update"),i()}catch(t){i(t)}})},19978(t,e,r){r.d(e,{A:()=>i});var i=r(5124).AH`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)} (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`},88508(t,e,r){r.d(e,{a:()=>n});r(18111),r(81148);var i=r(5055),o=r(42017);const a={},n=(0,o.u$)(class extends o.WL{render(t,e){return e()}update(t,[e,r]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return i.c0}else if(this.ot===e)return i.c0;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,r)}constructor(){super(...arguments),this.ot=a}})},31479(t,e,r){r.d(e,{D:()=>n});var i=r(5055),o=r(42017),a=r(63937);const n=(0,o.u$)(class extends o.WL{render(t,e){return this.key=t,e}update(t,[e,r]){return e!==this.key&&((0,a.mY)(t),this.key=e),r}constructor(){super(...arguments),this.key=i.s6}})},75751(t,e,r){r.d(e,{u:()=>l});r(45367),r(92731);var i=r(5055),o=r(42017),a=r(63937);const n=(t,e,r)=>{const i=new Map;for(let o=e;o<=r;o++)i.set(t[o],o);return i},l=(0,o.u$)(class extends o.WL{dt(t,e,r){let i;void 0===r?r=e:void 0!==e&&(i=e);const o=[],a=[];let n=0;for(const e of t)o[n]=i?i(e,n):n,a[n]=r(e,n),n++;return{values:a,keys:o}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,o]){const l=(0,a.cN)(t),{values:s,keys:d}=this.dt(e,r,o);if(!Array.isArray(l))return this.ut=d,s;const c=this.ut??=[],h=[];let u,p,f=0,b=l.length-1,m=0,g=s.length-1;for(;f<=b&&m<=g;)if(null===l[f])f++;else if(null===l[b])b--;else if(c[f]===d[m])h[m]=(0,a.lx)(l[f],s[m]),f++,m++;else if(c[b]===d[g])h[g]=(0,a.lx)(l[b],s[g]),b--,g--;else if(c[f]===d[g])h[g]=(0,a.lx)(l[f],s[g]),(0,a.Dx)(t,h[g+1],l[f]),f++,g--;else if(c[b]===d[m])h[m]=(0,a.lx)(l[b],s[m]),(0,a.Dx)(t,l[f],l[b]),b--,m++;else if(void 0===u&&(u=n(d,m,g),p=n(c,f,b)),u.has(c[f]))if(u.has(c[b])){const e=p.get(d[m]),r=void 0!==e?l[e]:null;if(null===r){const e=(0,a.Dx)(t,l[f]);(0,a.lx)(e,s[m]),h[m]=e}else h[m]=(0,a.lx)(r,s[m]),(0,a.Dx)(t,l[f],r),l[e]=null;m++}else(0,a.KO)(l[b]),b--;else(0,a.KO)(l[f]),f++;for(;m<=g;){const e=(0,a.Dx)(t,h[g+1]);(0,a.lx)(e,s[m]),h[m++]=e}for(;f<=b;){const t=l[f++];null!==t&&(0,a.KO)(t)}return this.ut=d,(0,a.mY)(t,h),i.c0}constructor(t){if(super(t),t.type!==o.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})},89784(t,e,r){r.d(e,{W:()=>l});r(74423),r(18111),r(18237),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698);var i=r(5055),o=r(42017);const a="important",n=" !"+a,l=(0,o.u$)(class extends o.WL{render(t){return Object.keys(t).reduce((e,r)=>{const i=t[r];return null==i?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(t,[e]){const{style:r}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?r.removeProperty(t):r[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(n);t.includes("-")||e?r.setProperty(t,e?i.slice(0,-11):i,e?a:""):r[t]=i}}return i.c0}constructor(t){if(super(t),t.type!==o.OA.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}};