var Ee=Object.defineProperty,Se=Object.defineProperties;var ke=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var Ce=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable;var ie=(s,e,t)=>e in s?Ee(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,C=(s,e)=>{for(var t in e||(e={}))Ce.call(e,t)&&ie(s,t,e[t]);if(se)for(var t of se(e))Oe.call(e,t)&&ie(s,t,e[t]);return s},O=(s,e)=>Se(s,ke(e));const V=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),re=new Map;class oe{constructor(e,t){if(this._$cssResult$=!0,t!==W)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){let e=re.get(this.cssText);return V&&e===void 0&&(re.set(this.cssText,e=new CSSStyleSheet),e.replaceSync(this.cssText)),e}toString(){return this.cssText}}const Pe=s=>new oe(typeof s=="string"?s:s+"",W),x=(s,...e)=>{const t=s.length===1?s[0]:e.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("use css function "+n+". Use unsafeCSS")})(r)+s[o+1],s[0]);return new oe(t,W)},Ue=(s,e)=>{V?s.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{const i=document.createElement("style"),r=window.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=t.cssText,s.appendChild(i)})},ne=V?s=>s:s=>s instanceof CSSStyleSheet?(e=>{let t="";for(const i of e.cssRules)t+=i.cssText;return Pe(t)})(s):s;var J;const le=window.reactiveElementPolyfillSupport,K={toAttribute(s,e){switch(e){case Boolean:s=s?"":null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,e){let t=s;switch(e){case Boolean:t=s!==null;break;case Number:t=s===null?null:Number(s);break;case Object:case Array:try{t=JSON.parse(s)}catch{t=null}}return t}},ae=(s,e)=>e!==s&&(e==e||s==s),Q={attribute:!0,type:String,converter:K,reflect:!1,hasChanged:ae};class A extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(e){var t;(t=this.l)!==null&&t!==void 0||(this.l=[]),this.l.push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,i)=>{const r=this._$Eh(i,t);r!==void 0&&(this._$Eu.set(r,i),e.push(r))}),e}static createProperty(e,t=Q){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,r=this.getPropertyDescriptor(e,i,t);r!==void 0&&Object.defineProperty(this.prototype,e,r)}}static getPropertyDescriptor(e,t,i){return{get(){return this[t]},set(r){const o=this[e];this[t]=r,this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||Q}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),this.elementProperties=new Map(e.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){const t=this.properties,i=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of i)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const r of i)t.unshift(ne(r))}else e!==void 0&&t.push(ne(e));return t}static _$Eh(e,t){const i=t.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}o(){var e;this._$Ev=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Ep(),this.requestUpdate(),(e=this.constructor.l)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,i;((t=this._$Em)!==null&&t!==void 0?t:this._$Em=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var t;(t=this._$Em)===null||t===void 0||t.splice(this._$Em.indexOf(e)>>>0,1)}_$Ep(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Et.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return Ue(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$Em)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostConnected)===null||i===void 0?void 0:i.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$Em)===null||e===void 0||e.forEach(t=>{var i;return(i=t.hostDisconnected)===null||i===void 0?void 0:i.call(t)})}attributeChangedCallback(e,t,i){this._$AK(e,i)}_$Eg(e,t,i=Q){var r,o;const n=this.constructor._$Eh(e,i);if(n!==void 0&&i.reflect===!0){const h=((o=(r=i.converter)===null||r===void 0?void 0:r.toAttribute)!==null&&o!==void 0?o:K.toAttribute)(t,i.type);this._$Ei=e,h==null?this.removeAttribute(n):this.setAttribute(n,h),this._$Ei=null}}_$AK(e,t){var i,r,o;const n=this.constructor,h=n._$Eu.get(e);if(h!==void 0&&this._$Ei!==h){const l=n.getPropertyOptions(h),a=l.converter,g=(o=(r=(i=a)===null||i===void 0?void 0:i.fromAttribute)!==null&&r!==void 0?r:typeof a=="function"?a:null)!==null&&o!==void 0?o:K.fromAttribute;this._$Ei=h,this[h]=g(t,l.type),this._$Ei=null}}requestUpdate(e,t,i){let r=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||ae)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),i.reflect===!0&&this._$Ei!==e&&(this._$ES===void 0&&(this._$ES=new Map),this._$ES.set(e,i))):r=!1),!this.isUpdatePending&&r&&(this._$Ev=this._$EC())}async _$EC(){this.isUpdatePending=!0;try{await this._$Ev}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((r,o)=>this[o]=r),this._$Et=void 0);let t=!1;const i=this._$AL;try{t=this.shouldUpdate(i),t?(this.willUpdate(i),(e=this._$Em)===null||e===void 0||e.forEach(r=>{var o;return(o=r.hostUpdate)===null||o===void 0?void 0:o.call(r)}),this.update(i)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(i)}willUpdate(e){}_$AE(e){var t;(t=this._$Em)===null||t===void 0||t.forEach(i=>{var r;return(r=i.hostUpdated)===null||r===void 0?void 0:r.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ev}shouldUpdate(e){return!0}update(e){this._$ES!==void 0&&(this._$ES.forEach((t,i)=>this._$Eg(i,this[i],t)),this._$ES=void 0),this._$EU()}updated(e){}firstUpdated(e){}}A.finalized=!0,A.elementProperties=new Map,A.elementStyles=[],A.shadowRootOptions={mode:"open"},le==null||le({ReactiveElement:A}),((J=globalThis.reactiveElementVersions)!==null&&J!==void 0?J:globalThis.reactiveElementVersions=[]).push("1.0.1");var Z;const L=globalThis.trustedTypes,he=L?L.createPolicy("lit-html",{createHTML:s=>s}):void 0,_=`lit$${(Math.random()+"").slice(9)}$`,ce="?"+_,Te=`<${ce}>`,y=document,P=(s="")=>y.createComment(s),U=s=>s===null||typeof s!="object"&&typeof s!="function",de=Array.isArray,He=s=>{var e;return de(s)||typeof((e=s)===null||e===void 0?void 0:e[Symbol.iterator])=="function"},T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,pe=/-->/g,ue=/>/g,w=/>|[ \n \r](?:([^\s"'>=/]+)([ \n \r]*=[ \n \r]*(?:[^ \n \r"'`<>=]|("|')|))|$)/g,ge=/'/g,fe=/"/g,ve=/^(?:script|style|textarea)$/i,me=s=>(e,...t)=>({_$litType$:s,strings:e,values:t}),d=me(1),Me=me(2),E=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),$e=new WeakMap,Ne=(s,e,t)=>{var i,r;const o=(i=t==null?void 0:t.renderBefore)!==null&&i!==void 0?i:e;let n=o._$litPart$;if(n===void 0){const h=(r=t==null?void 0:t.renderBefore)!==null&&r!==void 0?r:null;o._$litPart$=n=new M(e.insertBefore(P(),h),h,void 0,t!=null?t:{})}return n._$AI(s),n},S=y.createTreeWalker(y,129,null,!1),Re=(s,e)=>{const t=s.length-1,i=[];let r,o=e===2?"":"",n=T;for(let l=0;l"?(n=r!=null?r:T,p=-1):c[1]===void 0?p=-2:(p=n.lastIndex-c[2].length,g=c[1],n=c[3]===void 0?w:c[3]==='"'?fe:ge):n===fe||n===ge?n=w:n===pe||n===ue?n=T:(n=w,r=void 0);const D=n===w&&s[l+1].startsWith("/>")?" ":"";o+=n===T?a+Te:p>=0?(i.push(g),a.slice(0,p)+"$lit$"+a.slice(p)+_+D):a+_+(p===-2?(i.push(void 0),l):D)}const h=o+(s[t]||"")+(e===2?"":"");return[he!==void 0?he.createHTML(h):h,i]};class H{constructor({strings:e,_$litType$:t},i){let r;this.parts=[];let o=0,n=0;const h=e.length-1,l=this.parts,[a,g]=Re(e,t);if(this.el=H.createElement(a,i),S.currentNode=this.el.content,t===2){const c=this.el.content,p=c.firstChild;p.remove(),c.append(...p.childNodes)}for(;(r=S.nextNode())!==null&&l.length0){r.textContent=L?L.emptyScript:"";for(let f=0;f2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,i,r){const o=this.strings;let n=!1;if(o===void 0)e=k(this,e,t,0),n=!U(e)||e!==this._$AH&&e!==E,n&&(this._$AH=e);else{const h=e;let l,a;for(e=o[0],l=0;le=>typeof e=="function"?((t,i)=>(window.customElements.define(t,i),i))(s,e):((t,i)=>{const{kind:r,elements:o}=i;return{kind:r,elements:o,finisher(n){window.customElements.define(t,n)}}})(s,e),Ie=(s,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?O(C({},e),{finisher(t){t.createProperty(e.key,s)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(t){t.createProperty(e.key,s)}};function v(s){return(e,t)=>t!==void 0?((i,r,o)=>{r.constructor.createProperty(o,i)})(s,e,t):Ie(s,e)}function j(s){return v(O(C({},s),{state:!0}))}const Fe=({finisher:s,descriptor:e})=>(t,i)=>{var r;if(i===void 0){const o=(r=t.originalKey)!==null&&r!==void 0?r:t.key,n=e!=null?{kind:"method",placement:"prototype",key:o,descriptor:e(t.key)}:O(C({},t),{key:o});return s!=null&&(n.finisher=function(h){s(h,o)}),n}{const o=t.constructor;e!==void 0&&Object.defineProperty(t,i,e(i)),s==null||s(o,i)}};function qe(s,e){return Fe({descriptor:t=>{const i={get(){var r,o;return(o=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(s))!==null&&o!==void 0?o:null},enumerable:!0,configurable:!0};if(e){const r=typeof t=="symbol"?Symbol():"__"+t;i.get=function(){var o,n;return this[r]===void 0&&(this[r]=(n=(o=this.renderRoot)===null||o===void 0?void 0:o.querySelector(s))!==null&&n!==void 0?n:null),this[r]}}return i}})}var I=x`:host{font-family:ui-monospace,Delius,open sans,sans-serif,system-ui,Helvetica,"Arial Narrow",Roboto,Oxygen,Ubuntu,sans-serif;color-scheme:light dark;--primary-color:#03a9f4;--content-backroundcolor:--header-color: linear-gradient(to bottom, #4b6cb7, #182848);--footer-color:linear-gradient(to bottom, #4b6cb7, #182848);--header-textcolor:#FFF;--footer-textcolor:#FFFF;--content-textcolor:#FFF;--table-headercolor:#E65100;--table-bodycolor:#0D47A1;--table-row2color:#1A237E;--table-row2backcolor:#64B5F6;--table-logcolor:#263238;--table-logheader:#0D47A1;--table-logmsgv:#888888;--table-logmsgd:#00dddd;--table-logmsgc:magenta;--table-logmsgi:limegreen;--table-logmsgw:yellow;--table-logmsge:red;transition:all 350ms!important}`,we=x`.btn,button{cursor:pointer;border-radius:4px;background-color:#fff;color:inherit;border:1px solid rgba(127,127,127,.5);padding:2px;line-height:2em;font-weight:100;font-size:1rem:}.btn:active,button:active{background-image:linear-gradient(0deg,rgba(127,127,127,.8) 0,rgba(127,127,127,.2) 100%);transition-duration:1s}.btn:hover,button:hover{background-image:linear-gradient(0deg,rgba(127,127,127,.2) 0,rgba(127,127,127,.8) 100%);transition-duration:1s}.rnd{border-radius:1rem;height:2rem;width:2rem;font-weight:500;font-size:1.2rem}`,Ve=Object.defineProperty,We=Object.getOwnPropertyDescriptor,xe=(s,e,t,i)=>{for(var r=i>1?void 0:i?We(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Ve(e,t,r),r};function X(){let s=window.location.pathname;return s.endsWith("/")?s.slice(0,-1):s}let Je=X(),ee=class extends ${constructor(){super();this.entities=[]}connectedCallback(){var s;super.connectedCallback(),(s=window.source)==null||s.addEventListener("state",e=>{const t=e,i=JSON.parse(t.data);let r=this.entities.findIndex(o=>o.unique_id===i.id);if(r===-1&&i.id){let o=i.id.split("-"),n=O(C({},i),{index:this.entities.length+1,domain:o[0],unique_id:i.id,id:o.slice(1).join("-")});this.entities.push(n),this.entities.sort((h,l)=>h.domain${e}`}select(s,e,t,i,r){return d``}range(s,e,t,i,r,o,n){return d`
`}switch(s){return d``}control(s){if(s.domain==="switch")return s.assumed_state?d`${this.actionButton(s,"\u274C","turn_off")} ${this.actionButton(s,"\u2714\uFE0F","turn_on")}`:[this.switch(s)];if(s.domain==="fan")return[s.speed," ",s.speed_level,this.switch(s),s.speed_count?this.range(s,`turn_${s.state.toLowerCase()}`,"speed_level",s.speed_level,0,s.speed_count,1):""];if(s.domain==="light")return[this.switch(s),s.brightness?this.range(s,"turn_on","brightness",s.brightness,0,255,1):"",s.effects.filter(e=>e!="None").length?this.select(s,"turn_on","effect",s.effects,s.effect):""];if(s.domain==="lock")return d`${this.actionButton(s,"\u{1F510}","lock")} ${this.actionButton(s,"\u{1F513}","unlock")} ${this.actionButton(s,"\u2191","open")}`;if(s.domain==="cover")return d`${this.actionButton(s,"\u2191","open")} ${this.actionButton(s,"\u2610","stop")} ${this.actionButton(s,"\u2193","close")}`;if(s.domain==="button")return d`${this.actionButton(s,"\u2610","press ")}`;if(s.domain==="select")return this.select(s,"set","option",s.option,s.value);if(s.domain==="number")return this.range(s,"set","value",s.value,s.min_value,s.max_value,s.step);if(s.domain==="climate"){let e,t;return s.target_temperature_low!==void 0?(t=d`${s.target_temperature_low} .. ${s.target_temperature_high}`,e=d`${this.range(s,"set","target_temperature_low",s.target_temperature_low,s.min_temp,s.max_temp,s.step)} ${this.range(s,"set","target_temperature_high",s.target_temperature_high,s.min_temp,s.max_temp,s.step)}`):(t=d`${s.target_temperature}`,e=d`${this.range(s,"set","target_temperature",s.target_temperature,s.min_temp,s.max_temp,s.step)}`),d` ${e}
Mode: ${s.modes.map(i=>d``)}`}return d``}restAction(s,e){fetch(`${Je}/${s.domain}/${s.id}/${e}`,{method:"POST",body:"true"}).then(t=>{console.log(t)})}render(){return d`${this.entities.map(s=>d``)}
NAMESTATEACTIONS
${s.name}${s.state}${this.control(s)}
`}static get styles(){return[I,we,x`table{border-spacing:0;border-collapse:collapse;width:100%;border:1px solid transparent}th{font-weight:500;text-align:left;background-color:#e65100;color:#fff;height:24px;padding:.3rem;font-size:.9em}tbody{background-color:#0d47a1;color:#fff;font-weight:100}td{padding:.3rem;border:1px solid transparent;font-size:.85rem;cursor:default}table tbody tr:nth-child(2n){background-color:#64b5f6;font-weight:500;color:#1a237e}select{background-color:inherit;color:inherit;width:100%;border-radius:4px}option{color:currentColor;background-color:var(--primary-color,currentColor)}input[type=range]{width:calc(100% - 8rem);height:.75rem}.range{text-align:center}`]}};xe([j({type:Array,reflect:!0})],ee.prototype,"entities",2);ee=xe([N("esp-entity-table")],ee);var Ke=Object.defineProperty,Qe=Object.getOwnPropertyDescriptor,te=(s,e,t,i)=>{for(var r=i>1?void 0:i?Qe(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Ke(e,t,r),r};let F=class extends ${constructor(){super();this.rows=10,this.logs=[]}connectedCallback(){var s;super.connectedCallback(),(s=window.source)==null||s.addEventListener("log",e=>{const i=e.data;let o=i.slice(10,i.length-4).split(":").slice(0,2).join(":"),n=i.slice(12+o.length,i.length-4);const l={type:{"":"e","":"w","":"i","":"c","":"d","":"v"}[i.slice(0,7)],level:i.slice(7,10),tag:o,detail:n,when:new Date().toTimeString().split(" ")[0]};this.logs.push(l),this.logs=this.logs.slice(-this.rows)})}render(){return d`
TIME LEVEL MESSAGE
${this.logs.map(s=>d`
${s.when} ${s.level} ${s.tag} ${s.detail}
`)}
`}static get styles(){return[I,x`div.logcontent{max-height:calc(100vh - 320px);overflow:scroll;background-color:#1f3049;overflow-x:auto}div.logheader{height:27px;background-color:#e75100;color:#fff;padding:4px}div.logheader span{line-height:2rem;font-size:.9em;display:inline-block}div.logrow{font-family:monospace;line-height:1rem;margin:0;font-weight:300}div.logcontent div:nth-child(2n){background:rgba(255,255,255,.1)}div.logrow span{display:table-cell;padding:.1rem .25rem;word-break:keep-all;white-space:nowrap;font-size:.85rem;line-height:1.6rem}.v{color:#888}.d{color:#0dd}.c{color:#ff00ff}.i{color:#32cd32}.w{color:#ff0}.e{color:red;font-weight:700}`]}};te([v({type:Number})],F.prototype,"rows",2);te([j()],F.prototype,"logs",2);F=te([N("esp-log")],F);var Ze=Object.defineProperty,Ge=Object.getOwnPropertyDescriptor,b=(s,e,t,i)=>{for(var r=i>1?void 0:i?Ge(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Ze(e,t,r),r};const Ae="checkbox-lever";let m=class extends ${constructor(){super(...arguments);this.checkbox=null,this.toggleCallback=null,this.labelOn="On",this.labelOff="Off",this.stateOn="ON",this.stateOff="OFF",this.state="OFF",this.color="currentColor",this.disabled=!1,this.optimistic=!1}firstUpdated(s){var e;this.checkbox=(e=this.shadowRoot)==null?void 0:e.getElementById(Ae)}isOn(){return this.state===this.stateOn}toggle(s){let e=this.state;this.state=this.isOn()?this.stateOff:this.stateOn;let t=new CustomEvent("state",{detail:{state:this.state,id:this.id}});this.dispatchEvent(t),this.optimistic||new Promise((i,r)=>{this.toggleCallback=i,setTimeout(()=>{r()},500)}).catch(()=>{this.state=e,this.requestUpdate()})}requestUpdate(s,e){return s&&s=="state"&&(this.checkbox&&(this.checkbox.checked=this.isOn()),this.toggleCallback&&this.toggleCallback()),super.requestUpdate(s,e)}render(){return d`
`}static get styles(){return[I,x`.sw,.sw *{-webkit-tap-highlight-color:transparent;user-select:none;cursor:pointer}input[type=checkbox]{opacity:0;width:0;height:0;display:none}input[type=checkbox]:checked+.lever{background-color:currentColor;background-image:linear-gradient(0deg,rgba(255,255,255,.5) 0,rgba(255,255,255,.5) 100%)}input[type=checkbox]:checked+.lever:after,input[type=checkbox]:checked+.lever:before{left:18px}input[type=checkbox]:checked+.lever:after{background-color:currentColor}.lever{content:"";display:inline-block;position:relative;width:36px;height:14px;background-image:linear-gradient(0deg,rgba(127,127,127,.5) 0,rgba(127,127,127,.5) 100%);background-color:inherit;border-radius:15px;margin-right:10px;transition:background .3s ease;margin:0 16px}.lever:after,.lever:before{content:"";position:absolute;display:inline-block;width:20px;height:20px;border-radius:50%;left:0;top:-3px;transition:left .3s ease,background .3s ease,box-shadow .1s ease,transform .1s ease}.lever:before{background-color:currentColor;background-image:linear-gradient(0deg,rgba(255,255,255,.9) 0,rgba(255,255,255,.9) 100%)}.lever:after{background-color:#f1f1f1;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}input[type=checkbox]:checked:not(:disabled).tabbed:focus~.lever::before,input[type=checkbox]:checked:not(:disabled)~.lever:active::before{transform:scale(2.4);background-color:currentColor;background-image:linear-gradient(0deg,rgba(255,255,255,.9) 0,rgba(255,255,255,.9) 100%)}input[type=checkbox]:not(:disabled).tabbed:focus~.lever::before,input[type=checkbox]:not(:disabled)~.lever:active:before{transform:scale(2.4);background-color:rgba(0,0,0,.08)}input[type=checkbox][disabled]+.lever{cursor:default;background-color:rgba(0,0,0,.12)}input[type=checkbox][disabled]+.lever:after,input[type=checkbox][disabled]:checked+.lever:after{background-color:#949494}`]}};b([v({type:String})],m.prototype,"labelOn",2);b([v({type:String})],m.prototype,"labelOff",2);b([v({type:String})],m.prototype,"stateOn",2);b([v({type:String})],m.prototype,"stateOff",2);b([v({type:String})],m.prototype,"state",2);b([v({type:String})],m.prototype,"color",2);b([v({type:Boolean})],m.prototype,"disabled",2);b([v({type:Boolean})],m.prototype,"optimistic",2);m=b([N("esp-switch")],m);var Ye='',Xe=Object.defineProperty,et=Object.getOwnPropertyDescriptor,tt=(s,e,t,i)=>{for(var r=i>1?void 0:i?et(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&Xe(e,t,r),r};let ye=class extends ${render(){return Me([Ye])}};ye=tt([N("esp-logo")],ye);var st=Object.defineProperty,it=Object.getOwnPropertyDescriptor,q=(s,e,t,i)=>{for(var r=i>1?void 0:i?it(e,t):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(e,t,r):n(r))||r);return i&&r&&st(e,t,r),r};window.source=new EventSource(X()+"/events");let R=class extends ${constructor(){super();this.scheme="",this.ping="",this.version="webserver 3.0.0",this.config={ota:!1,title:"",comment:""},this.darkQuery=window.matchMedia("(prefers-color-scheme: dark)"),this.frames=[{color:"inherit"},{color:"red",transform:"scale(1.25) translateY(-30%)"},{color:"inherit"}]}firstUpdated(s){super.firstUpdated(s),document.getElementsByTagName("head")[0].innerHTML+='',document.head.insertAdjacentHTML("beforeend","");const e=document.querySelector("link[rel~='icon']");e.href='data:image/svg+xml,',this.darkQuery.addEventListener("change",()=>{this.scheme=this.isDark()}),this.scheme=this.isDark(),window.source.addEventListener("ping",t=>{const i=t;if(i.data.length){const o=JSON.parse(i.data);this.config=o,document.title="ESPHOME "+o.title,document.documentElement.lang=o.lang}this.ping=i.lastEventId}),window.source.onerror=function(t){console.dir(t)}}isDark(){return this.darkQuery.matches?"dark":"light"}updated(s){super.updated(s),s.has("scheme")&&document.documentElement.style.setProperty("color-scheme",this.scheme),s.has("ping")&&this.beat.animate(this.frames,1e3)}ota(){if(this.config.ota){let s=X();return d`

OTA Update

`}}renderComment(){return this.config.comment?d`

${this.config.comment}

`:u}render(){return d`

${this.config.title}

Components Results

${this.ota()}

Loginfo

`}static get styles(){return[I,we,x`footer,header{background:linear-gradient(to bottom,#4b6cb7,#182848);padding:5px;text-align:center}header{padding:.8em;color:#fff}.flex-grid{display:flex}.flex-grid .col{flex:2}.flex-grid-half{display:flex;justify-content:space-evenly;margin:0 .5em 5em .5em}.col{width:48%}@media (max-width:920px){.flex-grid,.flex-grid-half{display:block}.col{width:100%;margin:0 0 10px 0}}*{box-sizing:border-box}.flex-grid{margin:0 0 20px 0}h1{text-align:center;width:100%;line-height:4rem}h1,h2{margin-bottom:.25rem;font-weight:100;color:#fff}a.logo{position:absolute;top:10px;left:15px;float:left;color:inherit}h1.apptitle{text-transform:uppercase;margin:0;line-height:.9rem;margin:4px;font-size:1.6em;font-size:1.3rem}h3{text-align:center;margin:.5rem 0;font-weight:100}h3.main{padding-top:1em;color:#fff;text-align:left;margin:1rem 0}#beat{float:right;height:1rem}.right{float:right}footer{position:fixed;width:100%;bottom:0;box-sizing:border-box;font-size:.9rem;padding:1em;font-weight:100;color:#fff}`]}};q([j()],R.prototype,"scheme",2);q([j()],R.prototype,"ping",2);q([qe("#beat")],R.prototype,"beat",2);R=q([N("esp-app")],R);