UNPKG

iobroker.lovelace

Version:

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

17 lines 41.9 kB
/*! For license information please see 91863.65bf45587408a77f.js.LICENSE.txt */ export const __rspack_esm_id=91863;export const __rspack_esm_ids=[91863];export const __webpack_modules__={1054(t,e,i){i.a(t,async function(t,e){try{i(18111),i(61701);var o=i(62826),s=i(5124),a=i(22441),r=i(89784),n=i(1087),l=i(63004),d=i(76760),h=(i(405),i(26300)),c=t([h]);h=(c.then?(await c)():c)[0];const p="M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z";class u extends s.WF{willUpdate(t){t.has("value")&&(this._localValue=this.value)}render(){const t="auto"===this._localValue?.rows,e="full"===this._localValue?.columns,i=e||void 0!==this.columnMin&&this.columnMin===this.columnMax,o=t||void 0!==this.rowMin&&this.rowMin===this.rowMax,a=this.rowMin??1,n=this.rowMax??this.rows,l=Math.ceil((this.columnMin??1)/this.step)*this.step,d=Math.ceil((this.columnMax??this.columns)/this.step)*this.step,h=t?a:this._localValue?.rows,c=this._localValue?.columns;return s.qy` <div class="grid"> <ha-grid-layout-slider aria-label="${this.hass.localize("ui.components.grid-size-picker.columns")}" id="columns" .min="${l}" .max="${d}" .range="${this.columns}" .value="${e?this.columns:this.value?.columns}" .step="${this.step}" @value-changed="${this._valueChanged}" @slider-moved="${this._sliderMoved}" .disabled="${i}" tooltip-mode="${i?"never":"always"}"></ha-grid-layout-slider> <ha-grid-layout-slider aria-label="${this.hass.localize("ui.components.grid-size-picker.rows")}" id="rows" .min="${a}" .max="${n}" .range="${this.rows}" vertical .value="${t?a:this.value?.rows}" @value-changed="${this._valueChanged}" @slider-moved="${this._sliderMoved}" .disabled="${o}" tooltip-mode="${o?"never":"always"}"></ha-grid-layout-slider> ${this.isDefault?s.s6:s.qy` <ha-icon-button @click="${this._reset}" class="reset" .path="${p}" label="${this.hass.localize("ui.components.grid-size-picker.reset_default")}" title="${this.hass.localize("ui.components.grid-size-picker.reset_default")}"> </ha-icon-button> `} <div class="preview"> <table> ${Array(this.rows).fill(0).map((t,e)=>{const i=e+1;return s.qy` <tr> ${Array(this.columns).fill(0).map((t,e)=>{const o=e+1;return o%this.step!==0||this.columns>24&&o%3!=0?s.s6:s.qy` <td data-row="${i}" data-column="${o}" @click="${this._cellClick}"></td> `})} </tr> `})} </table> <div class="preview-card" style="${(0,r.W)({"--rows":h,"--columns":e?this.columns:c,"--total-columns":this.columns})}"></div> </div> </div> `}_cellClick(t){const e=t.currentTarget,i=Number(e.getAttribute("data-row")),o=Number(e.getAttribute("data-column")),s=(0,l.O)(i,this.rowMin,this.rowMax);let a=(0,l.O)(o,this.columnMin,this.columnMax);"full"===(this.value??d.bF).columns&&a===this.columns&&(a="full"),(0,n.r)(this,"value-changed",{value:{rows:s,columns:a}})}_valueChanged(t){t.stopPropagation();const e=t.currentTarget.id,i=this.value??d.bF;let o=t.detail.value;"columns"===e&&"full"===i.columns&&o===this.columns&&(o="full");const s={...i,[e]:o};(0,n.r)(this,"value-changed",{value:s})}_reset(t){t.stopPropagation(),(0,n.r)(this,"value-changed",{value:{rows:void 0,columns:void 0}})}_sliderMoved(t){t.stopPropagation();const e=t.currentTarget.id,i=this.value??d.bF;void 0!==t.detail.value&&(this._localValue={...i,[e]:t.detail.value})}constructor(...t){super(...t),this.rows=8,this.columns=12,this.step=1,this._localValue={rows:1,columns:1}}}u.styles=[s.AH`.grid{display:grid;grid-template-areas:"reset column-slider" "row-slider preview";grid-template-rows:auto auto;grid-template-columns:auto 1fr;gap:var(--ha-space-2)}#columns{grid-area:column-slider}#rows{grid-area:row-slider}.reset{grid-area:reset;--ha-icon-button-size:36px}.preview{position:relative;grid-area:preview}.preview table,.preview td,.preview tr{border:2px dotted var(--divider-color);border-collapse:collapse}.preview table{width:100%}.preview tr{height:30px}.preview td{cursor:pointer}.preview-card{position:absolute;top:0;left:0;background-color:var(--primary-color);opacity:.3;border-radius:var(--ha-border-radius-md);height:calc(var(--rows,1) * 30px);width:calc(var(--columns,1) * 100% / var(--total-columns,12));pointer-events:none;transition:width ease-in-out 180ms,height ease-in-out 180ms}`],(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"value",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"rows",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"columns",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"rowMin",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"rowMax",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"columnMin",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"columnMax",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"isDefault",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"step",void 0),(0,o.Cg)([(0,a.wk)()],u.prototype,"_localValue",void 0),u=(0,o.Cg)([(0,a.EM)("ha-grid-size-picker")],u),e()}catch(t){e(t)}})},62647(t,e,i){var o=i(62826),s=i(9866),a=i(5124),r=i(22441);class n extends s.A{static get styles(){return[s.A.styles,a.AH`:host{font-size:var(--ha-font-size-m);--wa-color-brand-on-quiet:var( --ha-tab-active-text-color, var(--primary-color) );--wa-color-neutral-on-quiet:var(--wa-color-brand-on-quiet);opacity:.8;color:inherit;--wa-space-l:16px}:host([active]:not([disabled])){opacity:1}@media (hover:hover){:host(:hover:not([disabled]):not([active])) .tab{color:var(--wa-color-brand-on-quiet)}}`]}}n=(0,o.Cg)([(0,r.EM)("ha-tab-group-tab")],n)},66289(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),s=i(42814),a=i(5124),r=i(22441),n=i(36356),l=t([s]);s=(l.then?(await l)():l)[0];class d extends s.A{connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeyDown,!0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown,!0)}handleClick(t){this._dragScrollController.scrolled||super.handleClick(t)}static get styles(){return[s.A.styles,a.AH`:host{--track-width:2px;--track-color:var(--ha-tab-track-color, var(--divider-color));--indicator-color:var( --ha-tab-indicator-color, var(--primary-color) );--wa-color-neutral-on-quiet:var(--indicator-color)}.tab-group-top ::slotted(ha-tab-group-tab[active]){border-block-end:solid var(--track-width) var(--indicator-color);margin-block-end:calc(-1 * var(--track-width))}.tab-group-start ::slotted(ha-tab-group-tab[active]){border-inline-end:solid var(--track-width) var(--indicator-color);margin-inline-end:calc(-1 * var(--track-width))}.tab-group-end ::slotted(ha-tab-group-tab[active]){border-inline-start:solid var(--track-width) var(--indicator-color);margin-inline-start:calc(-1 * var(--track-width))}.scroll-button::part(base):hover{background-color:transparent}`]}constructor(...t){super(...t),this._dragScrollController=new n.q(this,{selector:".nav"}),this.tabTag="ha-tab-group-tab",this.tabOnly=!0,this._handleKeyDown=t=>{(t.altKey||t.metaKey)&&t.stopPropagation()}}}(0,o.Cg)([(0,r.MZ)({attribute:"tab-tag"})],d.prototype,"tabTag",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"tab-only",type:Boolean})],d.prototype,"tabOnly",void 0),d=(0,o.Cg)([(0,r.EM)("ha-tab-group")],d),e()}catch(t){e(t)}})},83892(t,e,i){i.d(e,{x:()=>n});i(18111),i(13579);var o=i(62826),s=i(92070),a=i(5124),r=i(22441);class n extends a.WF{_onSlotChange(t){return e=>{const i=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==t.textContent?.trim());"start"===t?this._hasStart=i:this._hasEnd=i}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return a.qy`<div part="base" class="base" id="item">${t}</div>`}_renderInner(){const t=this._slotController.test("content");return a.qy` <div part="start" class="start" ?hidden="${!this._hasStart}"> <slot name="start" @slotchange="${this._onSlotChange("start")}"></slot> </div> <div part="content" class="content"> ${t?a.qy`<slot name="content"></slot>`:this._renderDefaultContent()} </div> <div part="end" class="end" ?hidden="${!this._hasEnd}"> <slot name="end" @slotchange="${this._onSlotChange("end")}"></slot> </div> `}_renderDefaultContent(){const t=this._slotController.test("headline"),e=this._slotController.test("supporting-text"),i=t||void 0!==this.headline,o=e||void 0!==this.supportingText;return a.qy` ${i?a.qy`<div part="headline" class="headline"> <slot name="headline">${this.headline??a.s6}</slot> </div>`:a.s6} ${o?a.qy`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${this.supportingText??a.s6}</slot> </div>`:a.s6} `}constructor(...t){super(...t),this.disabled=!1,this._slotController=new s.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}n.styles=a.AH`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`,(0,o.Cg)([(0,r.MZ)({type:String})],n.prototype,"headline",void 0),(0,o.Cg)([(0,r.MZ)({type:String,attribute:"supporting-text"})],n.prototype,"supportingText",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),(0,o.Cg)([(0,r.wk)()],n.prototype,"_hasStart",void 0),(0,o.Cg)([(0,r.wk)()],n.prototype,"_hasEnd",void 0),n=(0,o.Cg)([(0,r.EM)("ha-row-item")],n)},405(t,e,i){i(18111),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(62826),s=i(26183),a=i(5124),r=i(22441),n=i(6412),l=i(89784),d=i(1087);const h=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","PageUp","PageDown","Home","End"]);class c extends a.WF{get _range(){return this.range??this.max}_valueToPercentage(t){return this._boundedValue(t)/this._range}_percentageToValue(t){return this._range*t}_steppedValue(t){return Math.round(t/this.step)*this.step}_boundedValue(t){return Math.min(Math.max(t,this.min),this.max)}firstUpdated(t){super.firstUpdated(t),this.setupListeners(),this.setAttribute("role","slider"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}updated(t){if(super.updated(t),t.has("value")){const t=this._steppedValue(this.value??0);this.setAttribute("aria-valuenow",t.toString()),this.setAttribute("aria-valuetext",t.toString())}if(t.has("min")&&this.setAttribute("aria-valuemin",this.min.toString()),t.has("max")&&this.setAttribute("aria-valuemax",this.max.toString()),t.has("vertical")){const t=this.vertical?"vertical":"horizontal";this.setAttribute("aria-orientation",t)}}connectedCallback(){super.connectedCallback(),this.setupListeners()}disconnectedCallback(){super.disconnectedCallback(),this.destroyListeners()}setupListeners(){if(this.slider&&!this._mc){let t;this._mc=new s.mS(this.slider,{touchAction:this.touchAction??(this.vertical?"pan-x":"pan-y")}),this._mc.add(new s.uq({threshold:10,direction:s.ge,enable:!0})),this._mc.add(new s.Cx({event:"singletap"})),this._mc.on("panstart",()=>{this.disabled||(this.pressed=!0,this._showTooltip(),t=this.value)}),this._mc.on("pancancel",()=>{this.disabled||(this.pressed=!1,this._hideTooltip(),this.value=t)}),this._mc.on("panmove",t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t);this.value=this._percentageToValue(e);const i=this._steppedValue(this._boundedValue(this.value));(0,d.r)(this,"slider-moved",{value:i})}),this._mc.on("panend",t=>{if(this.disabled)return;this.pressed=!1,this._hideTooltip();const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e);this.value=this._steppedValue(this._boundedValue(i)),(0,d.r)(this,"slider-moved",{value:void 0}),(0,d.r)(this,"value-changed",{value:this.value})}),this._mc.on("singletap",t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e);this.value=this._steppedValue(this._boundedValue(i)),(0,d.r)(this,"value-changed",{value:this.value})}),this.addEventListener("keydown",this._handleKeyDown),this.addEventListener("keyup",this._handleKeyUp)}}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0),this.removeEventListener("keydown",this._handleKeyDown),this.removeEventListener("keyup",this._handleKeyUp)}get _tenPercentStep(){return Math.max(this.step,(this.max-this.min)/10)}_handleKeyDown(t){if(h.has(t.code)){switch(t.preventDefault(),t.code){case"ArrowRight":case"ArrowUp":this.value=this._boundedValue((this.value??0)+this.step);break;case"ArrowLeft":case"ArrowDown":this.value=this._boundedValue((this.value??0)-this.step);break;case"PageUp":this.value=this._steppedValue(this._boundedValue((this.value??0)+this._tenPercentStep));break;case"PageDown":this.value=this._steppedValue(this._boundedValue((this.value??0)-this._tenPercentStep));break;case"Home":this.value=this.min;break;case"End":this.value=this.max}(0,d.r)(this,"slider-moved",{value:this.value})}}_handleKeyUp(t){h.has(t.code)&&(t.preventDefault(),(0,d.r)(this,"value-changed",{value:this.value}))}_showTooltip(){null!=this._tooltipTimeout&&window.clearTimeout(this._tooltipTimeout),this.tooltipVisible=!0}_hideTooltip(t){t?this._tooltipTimeout=window.setTimeout(()=>{this.tooltipVisible=!1},t):this.tooltipVisible=!1}_renderTooltip(){if("never"===this.tooltipMode)return a.s6;const t=this.vertical?"left":"top",e="always"===this.tooltipMode||this.tooltipVisible&&"interaction"===this.tooltipMode,i=this._boundedValue(this._steppedValue(this.value??0));return a.qy` <span aria-hidden="true" class="tooltip ${(0,n.H)({visible:e,[t]:!0})}"> ${i} </span> `}render(){return a.qy` <div class="container${(0,n.H)({pressed:this.pressed})}" style="${(0,l.W)({"--value":`${this._valueToPercentage(this.value??0)}`})}"> <div id="slider" class="slider"> <div class="track"> <div class="background"></div> <div class="active" style="${(0,l.W)({"--min":""+this.min/this._range,"--max":""+(1-this.max/this._range)})}"></div> </div> ${Array(this._range/this.step).fill(0).map((t,e)=>{const i=e/(this._range/this.step);return this.min>=e*this.step||e*this.step>this.max?a.s6:a.qy` <div class="dot" style="${(0,l.W)({"--value":`${i}`})}"></div> `})} ${void 0!==this.value?a.qy`<div class="handle"></div>`:a.s6} ${this._renderTooltip()} </div> </div> `}constructor(...t){super(...t),this.disabled=!1,this.vertical=!1,this.tooltipMode="interaction",this.step=1,this.min=1,this.max=4,this.pressed=!1,this.tooltipVisible=!1,this._getPercentageFromEvent=t=>{if(this.vertical){const e=t.center.y,i=t.target.getBoundingClientRect().top,o=t.target.clientHeight;return Math.max(Math.min(1,(e-i)/o),0)}const e=t.center.x,i=t.target.getBoundingClientRect().left,o=t.target.clientWidth;return Math.max(Math.min(1,(e-i)/o),0)}}}c.styles=a.AH`:host{display:block;--grid-layout-slider:36px;height:var(--grid-layout-slider);width:100%;outline:0;transition:box-shadow 180ms ease-in-out}:host(:focus-visible){box-shadow:0 0 0 2px var(--primary-color)}:host([vertical]){width:var(--grid-layout-slider);height:100%}.container{position:relative;height:100%;width:100%}.slider{position:relative;height:100%;width:100%;transform:translateZ(0);overflow:visible;cursor:pointer}.slider *{pointer-events:none;user-select:none}.track{position:absolute;inset:0;margin:auto;height:16px;width:100%;border-radius:var(--ha-border-radius-md);overflow:hidden}:host([vertical]) .track{width:16px;height:100%}.background{position:absolute;inset:0;background:var(--disabled-color);opacity:.4}.active{position:absolute;background:var(--primary-color);top:0;right:calc(var(--max) * 100%);bottom:0;left:calc(var(--min) * 100%)}:host([vertical]) .active{top:calc(var(--min) * 100%);right:0;bottom:calc(var(--max) * 100%);left:0}.handle{position:absolute;top:0;height:100%;width:16px;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);transition:left 180ms ease-in-out,top 180ms ease-in-out}:host([vertical]) .handle{transform:translate(0,-50%);left:0;top:calc(var(--value,0%) * 100%);height:16px;width:100%}.dot{position:absolute;top:0;bottom:0;opacity:.6;margin:auto;width:4px;height:4px;flex-shrink:0;transform:translate(-50%,0);background:var(--card-background-color);left:calc(var(--value,0%) * 100%);border-radius:2px}:host([vertical]) .dot{transform:translate(0,-50%);left:0;right:0;bottom:inherit;top:calc(var(--value,0%) * 100%)}.handle::after{position:absolute;inset:0;width:4px;border-radius:2px;height:100%;margin:auto;background:var(--primary-color);content:""}:host([vertical]) .handle::after{height:4px;width:100%}:host([disabled]) .slider{cursor:not-allowed}:host([disabled]) .track{opacity:.5}:host([disabled]) .handle::after{background:var(--disabled-color)}:host([disabled]) .active{background:var(--disabled-color)}.tooltip{position:absolute;background-color:var(--clear-background-color);color:var(--primary-text-color);font-size:var(--control-slider-tooltip-font-size);border-radius:var(--ha-border-radius-lg);padding:.2em .4em;opacity:0;white-space:nowrap;box-shadow:0 2px 5px rgba(0,0,0,.2);transition:opacity 180ms ease-in-out,left 180ms ease-in-out,bottom 180ms ease-in-out;--handle-spacing:calc(2 * var(--handle-margin) + var(--handle-size));--slider-tooltip-margin:0px;--slider-tooltip-range:100%;--slider-tooltip-offset:0px;--slider-tooltip-position:calc( min( max( var(--value) * var(--slider-tooltip-range) + var(--slider-tooltip-offset), 0% ), 100% ) )}.tooltip.start{--slider-tooltip-offset:calc(-0.5 * (var(--handle-spacing)))}.tooltip.end{--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.cursor{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.show-handle{--slider-tooltip-range:calc(100% - var(--handle-spacing));--slider-tooltip-offset:calc(0.5 * (var(--handle-spacing)))}.tooltip.visible{opacity:1}.tooltip.top{transform:translate3d(-50%,-100%,0);top:var(--slider-tooltip-margin);left:50%}.tooltip.bottom{transform:translate3d(-50%,100%,0);bottom:var(--slider-tooltip-margin);left:50%}.tooltip.left{transform:translate3d(-100%,-50%,0);top:50%;left:var(--slider-tooltip-margin)}.tooltip.right{transform:translate3d(100%,-50%,0);top:50%;right:var(--slider-tooltip-margin)}:host(:not([vertical])) .tooltip.bottom,:host(:not([vertical])) .tooltip.top{left:var(--slider-tooltip-position)}:host([vertical]) .tooltip.left,:host([vertical]) .tooltip.right{top:var(--slider-tooltip-position)}.pressed .handle{transition:none}.pressed .tooltip{transition:opacity 180ms ease-in-out}`,(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],c.prototype,"vertical",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"touch-action"})],c.prototype,"touchAction",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"tooltip-mode"})],c.prototype,"tooltipMode",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],c.prototype,"value",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],c.prototype,"step",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],c.prototype,"min",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],c.prototype,"max",void 0),(0,o.Cg)([(0,r.MZ)({type:Number})],c.prototype,"range",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"pressed",void 0),(0,o.Cg)([(0,r.wk)()],c.prototype,"tooltipVisible",void 0),(0,o.Cg)([(0,r.P)("#slider")],c.prototype,"slider",void 0),c=(0,o.Cg)([(0,r.EM)("ha-grid-layout-slider")],c)},97962(t,e,i){i.a(t,async function(t,e){try{i(44114);var o=i(62826),s=i(5124),a=i(22441),r=i(66289),n=(i(62647),i(42678)),l=i(8349),d=i(63277),h=i(9346),c=i(91828),p=t([r,h,c,d,l]);[r,h,c,d,l]=p.then?(await p)():p;const u=["config","visibility","layout"];class g extends d.U{async getConfigElement(){const t=await(0,l.dY)(this.configElementType);if(t&&t.getConfigElement)return t.getConfigElement()}async getConfigForm(){const t=await(0,l.dY)(this.configElementType);if(t&&t.getConfigForm)return t.getConfigForm()}_configChanged(t){t.stopPropagation(),this.value=t.detail.value}get _showLayoutTab(){return!!this.sectionConfig&&(void 0===this.sectionConfig.type||"grid"===this.sectionConfig.type)}renderConfigElement(){const t=["config"];if(this.showVisibilityTab&&t.push("visibility"),this._showLayoutTab&&t.push("layout"),1===t.length)return super.renderConfigElement();let e=s.s6;switch(this._currTab){case"config":e=s.qy`${super.renderConfigElement()}`;break;case"visibility":e=s.qy` <hui-card-visibility-editor .hass="${this.hass}" .config="${this.value}" .entityId="${this.value?(0,n.r)(this.value):void 0}" @value-changed="${this._configChanged}"></hui-card-visibility-editor> `;break;case"layout":e=s.qy` <hui-card-layout-editor .hass="${this.hass}" .config="${this.value}" .sectionConfig="${this.sectionConfig}" @value-changed="${this._configChanged}"> </hui-card-layout-editor> `}return s.qy` <ha-tab-group @wa-tab-show="${this._handleTabChanged}"> ${t.map(t=>s.qy` <ha-tab-group-tab slot="nav" .active="${this._currTab===t}" panel="${t}"> ${this.hass.localize(`ui.panel.lovelace.editor.edit_card.tab_${t}`)} </ha-tab-group-tab> `)} </ha-tab-group> ${e} `}_handleTabChanged(t){const e=t.detail.name;e!==this._currTab&&(this._currTab=e)}constructor(...t){super(...t),this.showVisibilityTab=!1,this._currTab=u[0]}}g.styles=[s.AH`ha-tab-group{margin-bottom:16px}ha-tab-group-tab{flex:1}ha-tab-group-tab::part(base){width:100%;justify-content:center}`],(0,o.Cg)([(0,a.MZ)({type:Boolean,attribute:"show-visibility-tab"})],g.prototype,"showVisibilityTab",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],g.prototype,"sectionConfig",void 0),(0,o.Cg)([(0,a.wk)()],g.prototype,"_currTab",void 0),g=(0,o.Cg)([(0,a.EM)("hui-card-element-editor")],g),e()}catch(t){e(t)}})},9346(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),s=i(5124),a=i(22441),r=i(89784),n=i(22786),l=i(1087),d=i(38962),h=i(18350),c=i(29823),p=(i(70947),i(1054)),u=i(26300),g=(i(2846),i(70759)),v=(i(67094),i(59646)),m=i(10763),_=i(14503),y=i(76760),b=t([d,h,c,p,u,g,v,m]);[d,h,c,p,u,g,v,m]=b.then?(await b)():b;const f="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",w="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z";class C extends s.WF{render(){const t=this._configGridOptions(this.config),e=this._mergedOptions(t,this._defaultGridOptions),i=e,o=this._computeCardGridSize(i),a=12*(this.sectionConfig.column_span??1);return s.qy` ${this._defaultGridOptions&&0===Object.keys(this._defaultGridOptions).length?s.qy` <ha-alert alert-type="info"> ${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.no_grid_support")} </ha-alert> `:s.s6} <div class="header"> <ha-dropdown slot="icons" @wa-select="${this._handleAction}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${f}"> </ha-icon-button> <ha-dropdown-item value="toggle_yaml" .disabled="${!this._uiAvailable}"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml"))} <ha-svg-icon slot="icon" .path="${w}"></ha-svg-icon> </ha-dropdown-item> </ha-dropdown> </div> ${this._yamlMode?s.qy` <ha-yaml-editor .defaultValue="${t}" @value-changed="${this._yamlChanged}"></ha-yaml-editor> `:s.qy` <ha-grid-size-picker style="${(0,r.W)({"max-width":250*(this.sectionConfig.column_span??1)+40+"px"})}" .columns="${a}" .hass="${this.hass}" .value="${o}" .isDefault="${this._isDefault(t)}" @value-changed="${this._gridSizeChanged}" .rowMin="${i.min_rows}" .rowMax="${i.max_rows}" .columnMin="${i.min_columns}" .columnMax="${i.max_columns}" .step="${this._preciseMode?1:3}"></ha-grid-size-picker> <ha-md-list-item> <span slot="headline">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.auto_height")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.auto_height_helper")}</span> <ha-switch slot="end" @change="${this._autoHeightChanged}" .checked="${"auto"===e.rows}" name="auto-height"></ha-switch> </ha-md-list-item> <ha-md-list-item> <span slot="headline">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.full_width_helper")}</span> <ha-switch slot="end" @change="${this._fullWidthChanged}" .checked="${"full"===e.columns}" name="full-width"></ha-switch> </ha-md-list-item> <ha-md-list-item> <span slot="headline">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode")}</span> <span slot="supporting-text">${this.hass.localize("ui.panel.lovelace.editor.edit_card.layout.precise_mode_helper")}</span> <ha-switch slot="end" @change="${this._preciseModeChanged}" .checked="${this._preciseMode}" name="precise-mode"></ha-switch> </ha-md-list-item> `} `}firstUpdated(t){super.firstUpdated(t);try{this._cardElement=document.createElement("hui-card"),this._cardElement.hass=this.hass,this._cardElement.preview=!0,this._cardElement.config=this.config,this._cardElement.addEventListener("card-updated",t=>{t.stopPropagation(),this._updateDefaultGridOptions()}),this._cardElement.load(),this._updateDefaultGridOptions()}catch(t){console.error(t)}}_updateDefaultGridOptions(){this._cardElement?this._defaultGridOptions=this._cardElement.getElementGridOptions():this._defaultGridOptions=void 0}updated(t){super.updated(t),this._cardElement&&(t.has("hass")&&(this._cardElement.hass=this.hass),t.has("config")&&(this._cardElement.config=this.config))}willUpdate(t){if(super.willUpdate(t),t.has("config")){const t=this.config.grid_options;if(!t)return void(this._preciseMode=!!this._defaultGridOptions&&(0,y.Z8)(this._defaultGridOptions));const e=(0,y.Z8)(t);!this._preciseMode&&e&&(this._preciseMode=e)}}async _handleAction(t){"toggle_yaml"===t.detail.item.value&&(this._yamlMode=!this._yamlMode)}_gridSizeChanged(t){t.stopPropagation();const e=t.detail.value;this._updateGridOptions({...this.config.grid_options,columns:e.columns,rows:e.rows})}_yamlChanged(t){t.stopPropagation();const e=t.detail.value;this._updateGridOptions(e)}_fullWidthChanged(t){t.stopPropagation();const e=t.target.checked;let i;const o={...y.bF,...this._defaultGridOptions};if(e)i="full";else if("full"===o.columns){const t=12*(this.sectionConfig.column_span??1);i=o.max_columns??t}else i=void 0;this._updateGridOptions({...this.config.grid_options,columns:i})}_autoHeightChanged(t){t.stopPropagation();const e=t.target.checked;let i;const o={...y.bF,...this._defaultGridOptions};i=e?"auto":"auto"===o.rows?o.min_rows??1:void 0,this._updateGridOptions({...this.config.grid_options,rows:i})}_preciseModeChanged(t){if(t.stopPropagation(),this._preciseMode=t.target.checked,this._preciseMode)return;const e=this.config.grid_options?.columns;if("number"==typeof e&&e%3!=0){const t=3*Math.ceil(e/3);this._updateGridOptions({...this.config.grid_options,columns:t})}}_updateGridOptions(t){const e={...this.config,grid_options:{...t}};if(e.grid_options){for(const[t,i]of Object.entries(e.grid_options))void 0===i&&delete e.grid_options[t];0===Object.keys(e.grid_options).length&&delete e.grid_options}e.layout_options&&delete e.layout_options,(0,l.r)(this,"value-changed",{value:e})}constructor(...t){super(...t),this._yamlMode=!1,this._uiAvailable=!0,this._preciseMode=!1,this._mergedOptions=(0,n.A)((t,e)=>({...y.bF,...e,...t})),this._computeCardGridSize=(0,n.A)(y.Ns),this._isDefault=(0,n.A)(t=>void 0===t?.columns&&void 0===t?.rows),this._configGridOptions=t=>t.grid_options?t.grid_options:t.layout_options?(0,y.l6)(t.layout_options):{}}}C.styles=[_.RF,s.AH`.header{display:flex;flex-direction:row;align-items:flex-start;justify-content:flex-end}.header ha-dropdown{--mdc-theme-text-primary-on-background:var(--primary-text-color);margin-top:-8px}.disabled{opacity:.5;pointer-events:none}ha-grid-size-picker{display:block;margin:16px auto;direction:ltr}ha-yaml-editor{display:block;margin:16px 0}`],(0,o.Cg)([(0,a.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],C.prototype,"config",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],C.prototype,"sectionConfig",void 0),(0,o.Cg)([(0,a.wk)()],C.prototype,"_defaultGridOptions",void 0),(0,o.Cg)([(0,a.wk)()],C.prototype,"_yamlMode",void 0),(0,o.Cg)([(0,a.wk)()],C.prototype,"_uiAvailable",void 0),(0,o.Cg)([(0,a.wk)()],C.prototype,"_preciseMode",void 0),C=(0,o.Cg)([(0,a.EM)("hui-card-layout-editor")],C),e()}catch(t){e(t)}})},91828(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),s=i(35211),a=i(5124),r=i(22441),n=i(1087),l=i(82747),d=i(13898),h=i(30461),c=t([d,h]);[d,h]=c.then?(await c)():c;class p extends a.WF{willUpdate(t){t.has("entityId")&&this._contextProvider.setValue(this.entityId?{mode:"current",entityId:this.entityId}:void 0)}render(){const t=this.config.visibility??[];return a.qy` <ha-visibility-status .hass="${this.hass}" .conditions="${t}"></ha-visibility-status> <ha-card-conditions-editor .hass="${this.hass}" .conditions="${t}" @value-changed="${this._valueChanged}"> </ha-card-conditions-editor> `}_valueChanged(t){t.stopPropagation();const e=t.detail.value,i={...this.config,visibility:e};0===i.visibility?.length&&delete i.visibility,(0,n.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this._contextProvider=new s.DT(this,{context:l.$,initialValue:void 0})}}p.styles=a.AH`ha-visibility-status{margin-bottom:var(--ha-space-3)}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"config",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"entityId",void 0),p=(0,o.Cg)([(0,r.EM)("hui-card-visibility-editor")],p),e()}catch(t){e(t)}})},30461(t,e,i){i.a(t,async function(t,e){try{var o=i(62826),s=i(35211),a=i(5124),r=i(22441),n=i(87047),l=i(38962),d=(i(67094),i(83892)),h=i(14487),c=i(82747),p=t([l,h,n]);[l,h,n]=p.then?(await p)():p;const u={visible:"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",hidden:"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",invalid:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"};class g extends a.WF{willUpdate(t){super.willUpdate(t),(t.has("conditions")||t.has("hass"))&&this._listeners.setup(this.conditions??[],this.hass,()=>this._evaluate()),(t.has("hass")||t.has("conditions")||t.has("_entityContext"))&&this._evaluate()}render(){return a.qy` <ha-alert .alertType="${"visible"===this.state?"success":"hidden"===this.state?"warning":"error"}"> <ha-svg-icon slot="icon" .path="${u[this.state]}"></ha-svg-icon> <div class="headline"> ${this.hass?.localize(`ui.panel.lovelace.editor.condition-editor.visibility_status.${this.state}.headline`)} </div> <div class="supporting"> ${this.hass?.localize(`ui.panel.lovelace.editor.condition-editor.visibility_status.${this.state}.supporting${0===(this.conditions?.length??0)?"_empty":""}`)} </div> </ha-alert> `}_evaluate(){const t=this.conditions??[];let e;if(0===t.length)e="visible";else if((0,h.db)(t)){const i="current"===this._entityContext?.mode?{entity_id:this._entityContext.entityId}:{};e=(0,h.XH)(t,this.hass,i)?"visible":"hidden"}else e="invalid";e!==this.state&&(this.state=e)}constructor(...t){super(...t),this.conditions=[],this.state="visible",this._listeners=new n.x(this)}}g.styles=[d.x.styles,a.AH`ha-alert{display:block;--mdc-icon-size:24px}.headline{font-weight:var(--ha-font-weight-medium);margin-bottom:var(--ha-space-1)}`],(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"conditions",void 0),(0,o.Cg)([(0,r.wk)(),(0,s.Fg)({context:c.$,subscribe:!0})],g.prototype,"_entityContext",void 0),(0,o.Cg)([(0,r.MZ)()],g.prototype,"state",void 0),g=(0,o.Cg)([(0,r.EM)("ha-visibility-status")],g),e()}catch(t){e(t)}})},39039(t,e,i){i.d(e,{r:()=>o});class o extends Error{constructor(t,e,i){super(t),this.name="GUISupportError",this.warnings=e,this.errors=i}}},91322(t,e,i){i.a(t,async function(t,o){try{i.d(e,{m:()=>m});i(18111),i(7588),i(61701);var s=i(62826),a=i(5124),r=i(22441),n=i(74985),l=i(1087),d=i(78978),h=i(19459),c=i(38962),p=i(65829),u=i(10763),g=i(39039),v=t([c,p,u]);[c,p,u]=v.then?(await v)():v;class m extends a.WF{get value(){return this._config}set value(t){this._config&&(0,h.b)(t,this._config,{compareSymbols:!0})||(this._config=t,this._errors=void 0,this._setConfig())}_setConfig(){if(!this._errors&&!this._yamlError)try{this._updateConfigElement()}catch(t){this._errors=[t.message]}this.updateComplete.then(()=>{(0,l.r)(this,"config-changed",{config:this.value,error:this._errors?.join(", "),guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})})}get hasWarning(){return void 0!==this._warnings&&this._warnings.length>0}get hasError(){return this._yamlError||void 0!==this._errors&&this._errors.length>0}get GUImode(){return this._guiMode}set GUImode(t){this._guiMode=t,this.updateComplete.then(()=>{(0,l.r)(this,"GUImode-changed",{guiMode:t,guiModeAvailable:!(this.hasWarning||this.hasError||!1===this._guiSupported)})})}toggleMode(){this.GUImode||this._yamlEditor?.disableCodeEditorFullscreen(),this.GUImode=!this.GUImode}focusYamlEditor(){this._configElement?.focusYamlEditor&&this._configElement.focusYamlEditor(),this._yamlEditor&&this._yamlEditor.focus()}async getConfigElement(){}async getConfigForm(){}renderConfigElement(){return a.qy`${this._configElement}`}_renderSubElement(){return a.qy` <hui-sub-element-editor .hass="${this.hass}" .config="${this._subElementEditorConfig}" @go-back="${this._goBack}" @config-changed="${this._subElementChanged}"> </hui-sub-element-editor> `}_subElementChanged(t){t.stopPropagation();const e=t.detail.config;this._subElementEditorConfig={...this._subElementEditorConfig,elementConfig:e},this._subElementEditorConfig.saveElementConfig?.(e)}_goBack(t){t.stopPropagation(),this._subElementEditorConfig=void 0}async _editSubElement(t){t.stopPropagation(),await Promise.all([i.e(92769),i.e(3283),i.e(80131),i.e(70183),i.e(67218),i.e(58416),i.e(99788),i.e(58303),i.e(21543),i.e(22398),i.e(46601),i.e(51455),i.e(26092),i.e(8851),i.e(59704),i.e(25322),i.e(90790),i.e(59532),i.e(55076),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(97500),i.e(12009),i.e(66990),i.e(20282),i.e(87857),i.e(92363),i.e(84240)]).then(i.bind(i,81287)),this._subElementEditorConfig={type:t.detail.type,elementConfig:t.detail.config,context:t.detail.context,saveElementConfig:t.detail.saveConfig}}render(){return a.qy` <div class="wrapper"> ${this.GUImode?a.qy` <div class="gui-editor" @edit-sub-element="${this._editSubElement}"> ${this._loading?a.qy` <ha-spinner class="center margin-bot"></ha-spinner> `:(0,n.P)(this._subElementEditorConfig?this._renderSubElement():this.renderConfigElement())} </div> `:a.qy` <div class="yaml-editor"> <ha-yaml-editor .defaultValue="${this._config}" autofocus .inDialog="${this.inDialog}" @value-changed="${this._handleYAMLChanged}" @keydown="${this._ignoreKeydown}" dir="ltr"></ha-yaml-editor> </div> `} ${!1===this._guiSupported&&!1===this._loading?a.qy` <ha-alert alert-type="info" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> ${this.hass.localize("ui.errors.config.visual_editor_not_supported_reason_type")} <br> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:a.s6} ${this._errors?.length?a.qy` <ha-alert alert-type="error" .title="${this.hass.localize("ui.errors.config.configuration_error")}"> <ul> ${this._errors.map(t=>a.qy`<li>${t}</li>`)} </ul> </ha-alert> `:a.s6} ${this.hasWarning?a.qy` <ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.visual_editor_not_supported")}"> <ul> ${this._warnings.map(t=>a.qy`<li>${t}</li>`)} </ul> ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert> `:a.s6} </div> `}updated(t){super.updated(t),this._configElement&&t.has("hass")&&(this._configElement.hass=this.hass),this._configElement&&"lovelace"in this._configElement&&t.has("lovelace")&&(this._configElement.lovelace=this.lovelace),this._configElement&&t.has("context")&&(this._configElement.context=this.context)}_handleUIConfigChanged(t){if(t.stopPropagation(),!this.GUImode)return;const e=t.detail.config;Object.keys(e).forEach(t=>{void 0===e[t]&&delete e[t]}),this.value=e}_handleYAMLChanged(t){t.stopPropagation(),t.detail.isValid?(this._config=t.detail.value,this._errors=void 0,this._yamlError=!1):this._yamlError=!0,this._setConfig()}async unloadConfigElement(){this._configElement=void 0,this._guiSupported=void 0}async loadConfigElement(){if(this._configElement)return;let t=await this.getConfigElement();if(!t){const e=await this.getConfigForm();if(e){await i.e(15106).then(i.bind(i,15737)),t=document.createElement("hui-form-editor");const{schema:o,assertConfig:s,computeLabel:a,computeHelper:r}=e;t.schema=o,a&&(t.computeLabel=a),r&&(t.computeHelper=r),s&&(t.assertConfig=s)}}t?(t.hass=this.hass,"lovelace"in t&&(t.lovelace=this.lovelace),t.context=this.context,t.addEventListener("config-changed",t=>this._handleUIConfigChanged(t)),this._guiSupported=!0):this._guiSupported=!1,this._configElement=t}async _updateConfigElement(){if(!this.value)return;const t=++this._loadCount;try{if(this._errors=void 0,this._warnings=void 0,await this.loadConfigElement(),this._configElement)try{this._configElement.setConfig(this.value)}catch(t){const e=(0,d._)(this.hass,t);throw new g.r("Config is not supported",e.warnings,e.errors)}else this._guiSupported=!1,this.GUImode=!1}catch(e){if(t!==this._loadCount)return;e instanceof g.r?(this._warnings=e.warnings??[e.message],this._errors=e.errors||void 0):this._errors=[e.message],this.GUImode=!1}finally{this._loading=!1}}_ignoreKeydown(t){t.stopPropagation()}constructor(...t){super(...t),this.inDialog=!1,this._guiMode=!0,this._loading=!1,this._yamlError=!1,this._loadCount=0}}m.styles=a.AH`:host{display:flex}.wrapper{width:100%}.gui-editor,.yaml-editor{padding:8px 0px}ha-code-editor{--code-mirror-max-height:calc(100vh - 245px)}ha-spinner{display:block;margin:auto}`,(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"lovelace",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,attribute:"in-dialog"})],m.prototype,"inDialog",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_config",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_configElement",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_subElementEditorConfig",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_guiMode",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_errors",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_warnings",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_guiSupported",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_loading",void 0),(0,s.Cg)([(0,r.wk)()],m.prototype,"_yamlError",void 0),(0,s.Cg)([(0,r.P)("ha-yaml-editor")],m.prototype,"_yamlEditor",void 0),o()}catch(t){o(t)}})},63277(t,e,i){i.a(t,async function(t,o){try{i.d(e,{U:()=>l});var s=i(62826),a=i(22441),r=i(91322),n=t([r]);r=(n.then?(await n)():n)[0];class l extends r.m{get configElementType(){return this.value?this.value.type:void 0}async loadConfigElement(){if(this._configElementType!==this.configElementType){if(this.unloadConfigElement(),!this.configElementType)throw new Error(this.hass.localize("ui.errors.config.no_type_provided"));this._configElementType=this.configElementType}return super.loadConfigElement()}}(0,s.Cg)([(0,a.wk)()],l.prototype,"_configElementType",void 0),o()}catch(t){o(t)}})},74985(t,e,i){i.d(e,{P:()=>n});i(88454),i(29452);var o=i(5055),s=i(42017),a=i(63937);const r=t=>(0,a.ps)(t)?t._$litType$.h:t.strings,n=(0,s.u$)(class extends s.WL{render(t){return[t]}update(t,[e]){const i=(0,a.qb)(this.it)?r(this.it):null,s=(0,a.qb)(e)?r(e):null;if(null!==i&&(null===s||i!==s)){const e=(0,a.cN)(t).pop();let s=this.et.get(i);if(void 0===s){const t=document.createDocumentFragment();s=(0,o.XX)(o.s6,t),s.setConnected(!1),this.et.set(i,s)}(0,a.mY)(s,[e]),(0,a.Dx)(s,void 0,e)}if(null!==s){if(null===i||i!==s){const e=this.et.get(s);if(void 0!==e){const i=(0,a.cN)(e).pop();(0,a.Jz)(t),(0,a.Dx)(t,void 0,i),(0,a.mY)(t,[i])}}this.it=e}else this.it=void 0;return this.render(e)}constructor(t){super(t),this.et=new WeakMap}})}};