8d11de8a28
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
29 lines
213 KiB
JavaScript
29 lines
213 KiB
JavaScript
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Ho(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ke={},on=[],$t=()=>{},ol=()=>!1,Ls=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ds=e=>e.startsWith("onUpdate:"),De=Object.assign,Uo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},La=Object.prototype.hasOwnProperty,me=(e,t)=>La.call(e,t),se=Array.isArray,Yt=e=>ns(e)==="[object Map]",Dt=e=>ns(e)==="[object Set]",di=e=>ns(e)==="[object Date]",re=e=>typeof e=="function",Te=e=>typeof e=="string",xt=e=>typeof e=="symbol",we=e=>e!==null&&typeof e=="object",il=e=>(we(e)||re(e))&&re(e.then)&&re(e.catch),ll=Object.prototype.toString,ns=e=>ll.call(e),Da=e=>ns(e).slice(8,-1),al=e=>ns(e)==="[object Object]",jo=e=>Te(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Hn=Ho(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Fa=/-\w/g,Ve=Fs(e=>e.replace(Fa,t=>t.slice(1).toUpperCase())),Na=/\B([A-Z])/g,Qt=Fs(e=>e.replace(Na,"-$1").toLowerCase()),Ns=Fs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Zs=Fs(e=>e?`on${Ns(e)}`:""),kt=(e,t)=>!Object.is(e,t),hs=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},rl=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},Rs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let fi;const Hs=()=>fi||(fi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Pe(e){if(se(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=Te(s)?ja(s):Pe(s);if(o)for(const l in o)t[l]=o[l]}return t}else if(Te(e)||we(e))return e}const Ra=/;(?![^(]*\))/g,Ha=/:([^]+)/,Ua=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ja(e){const t={};return e.replace(Ua,n=>n.startsWith("/*")?"":n).split(Ra).forEach(n=>{if(n){const s=n.split(Ha);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function ue(e){let t="";if(Te(e))t=e;else if(se(e))for(let n=0;n<e.length;n++){const s=ue(e[n]);s&&(t+=s+" ")}else if(we(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ba="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Va=Ho(Ba);function ul(e){return!!e||e===""}function Wa(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=ut(e[o],t[o],n);return s}function pi(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const l of e){let a=-1;for(let r=0;r<s.length;r++)if(!o[r]&&ut(l,s[r],n)){a=r;break}if(a<0)return!1;o[a]=1}return!0}function Ka(e,t,n){let s=Yt(e),o=Yt(t);if(s||o||(s=Dt(e),o=Dt(t),s||o))return s&&o?pi(e,t,n):!1;const l=Object.keys(e).length,a=Object.keys(t).length;if(l!==a)return!1;for(const r in e){const d=e.hasOwnProperty(r),u=t.hasOwnProperty(r);if(d&&!u||!d&&u||!ut(e[r],t[r],n))return!1}return String(e)===String(t)}function hi(e,t,n,s){n||(n=[new Map,new Map]);const[o,l]=n;if(o.has(e)||l.has(t))return o.get(e)===t&&l.get(t)===e;o.set(e,t),l.set(t,e);const a=s(e,t,n);return o.delete(e),l.delete(t),a}function ut(e,t,n){if(e===t)return!0;let s=di(e),o=di(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=xt(e),o=xt(t),s||o?e===t:(s=se(e),o=se(t),s||o?s&&o?hi(e,t,n,Wa):!1:(s=we(e),o=we(t),s||o?!s||!o?!1:hi(e,t,n,Ka):String(e)===String(t))))}function Bo(e,t){return e.findIndex(n=>ut(n,t))}const cl=e=>!!(e&&e.__v_isRef===!0),y=e=>Te(e)?e:e==null?"":se(e)||we(e)&&(e.toString===ll||!re(e.toString))?cl(e)?y(e.value):JSON.stringify(e,dl,2):String(e),dl=(e,t)=>cl(t)?dl(e,t.value):Yt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],l)=>(n[eo(s,l)+" =>"]=o,n),{})}:Dt(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>eo(n))}:xt(t)?eo(t):we(t)&&!se(t)&&!al(t)?String(t):t,eo=(e,t="")=>{var n;return xt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};let Le;class qa{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Le&&(Le.active?(this.parent=Le,this.index=(Le.scopes||(Le.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Le;try{return Le=this,t()}finally{Le=n}}}on(){++this._on===1&&(this.prevScope=Le,Le=this)}off(){if(this._on>0&&--this._on===0){if(Le===this)Le=this.prevScope;else{let t=Le;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Ya(){return Le}let xe;const to=new WeakSet;class fl{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Le&&(Le.active?Le.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,to.has(this)&&(to.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vi(this),vl(this);const t=xe,n=rt;xe=this,rt=!0;try{return this.fn()}finally{ml(this),xe=t,rt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ko(t);this.deps=this.depsTail=void 0,vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?to.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){bo(this)&&this.run()}get dirty(){return bo(this)}}let pl=0,Un,jn;function hl(e,t=!1){if(e.flags|=8,t){e.next=jn,jn=e;return}e.next=Un,Un=e}function Vo(){pl++}function Wo(){if(--pl>0)return;if(jn){let t=jn;for(jn=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Un;){let t=Un;for(Un=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function vl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ml(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Ko(s),za(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function bo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(yl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function yl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===qn)||(e.globalVersion=qn,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!bo(e))))return;e.flags|=2;const t=e.dep,n=xe,s=rt;xe=e,rt=!0;try{vl(e);const o=e.fn(e._value);(t.version===0||kt(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{xe=n,rt=s,ml(e),e.flags&=-3}}function Ko(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)Ko(l,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function za(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let rt=!0;const gl=[];function Ft(){gl.push(rt),rt=!1}function Nt(){const e=gl.pop();rt=e===void 0?!0:e}function vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=xe;xe=void 0;try{t()}finally{xe=n}}}let qn=0;class Ja{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class qo{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!xe||!rt||xe===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==xe)n=this.activeLink=new Ja(xe,this),xe.deps?(n.prevDep=xe.depsTail,xe.depsTail.nextDep=n,xe.depsTail=n):xe.deps=xe.depsTail=n,bl(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=xe.depsTail,n.nextDep=void 0,xe.depsTail.nextDep=n,xe.depsTail=n,xe.deps===n&&(xe.deps=s)}return n}trigger(t){this.version++,qn++,this.notify(t)}notify(t){Vo();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Wo()}}}function bl(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)bl(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const wo=new WeakMap,ln=Symbol(""),_o=Symbol(""),Yn=Symbol("");function Fe(e,t,n){if(rt&&xe){let s=wo.get(e);s||wo.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new qo),o.map=s,o.key=n),o.track()}}function Ot(e,t,n,s,o,l){const a=wo.get(e);if(!a){qn++;return}const r=d=>{d&&d.trigger()};if(Vo(),t==="clear")a.forEach(r);else{const d=se(e),u=d&&jo(n);if(d&&n==="length"){const f=Number(s);a.forEach((p,_)=>{(_==="length"||_===Yn||!xt(_)&&_>=f)&&r(p)})}else switch((n!==void 0||a.has(void 0))&&r(a.get(n)),u&&r(a.get(Yn)),t){case"add":d?u&&r(a.get("length")):(r(a.get(ln)),Yt(e)&&r(a.get(_o)));break;case"delete":d||(r(a.get(ln)),Yt(e)&&r(a.get(_o)));break;case"set":Yt(e)&&r(a.get(ln));break}}Wo()}function vn(e){const t=ve(e);return t===e||(Fe(t,"iterate",Yn),nt(e))?t:St(e)?zt(e)?t.map(n=>Jt(ot(n))):t.map(Jt):t.map(ot)}function Us(e){return Fe(e=ve(e),"iterate",Yn),e}function wt(e,t){return St(e)?Jt(zt(e)?ot(t):t):ot(t)}const Ga={__proto__:null,[Symbol.iterator](){return no(this,Symbol.iterator,e=>wt(this,e))},concat(...e){return vn(this).concat(...e.map(t=>se(t)?vn(t):t))},entries(){return no(this,"entries",e=>(e[1]=wt(this,e[1]),e))},every(e,t){return At(this,"every",e,t,void 0,arguments)},filter(e,t){return At(this,"filter",e,t,n=>n.map(s=>wt(this,s)),arguments)},find(e,t){return At(this,"find",e,t,n=>wt(this,n),arguments)},findIndex(e,t){return At(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return At(this,"findLast",e,t,n=>wt(this,n),arguments)},findLastIndex(e,t){return At(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return At(this,"forEach",e,t,void 0,arguments)},includes(...e){return so(this,"includes",e)},indexOf(...e){return so(this,"indexOf",e)},join(e){return vn(this).join(e)},lastIndexOf(...e){return so(this,"lastIndexOf",e)},map(e,t){return At(this,"map",e,t,void 0,arguments)},pop(){return Pn(this,"pop")},push(...e){return Pn(this,"push",e)},reduce(e,...t){return mi(this,"reduce",e,t)},reduceRight(e,...t){return mi(this,"reduceRight",e,t)},shift(){return Pn(this,"shift")},some(e,t){return At(this,"some",e,t,void 0,arguments)},splice(...e){return Pn(this,"splice",e)},toReversed(){return vn(this).toReversed()},toSorted(e){return vn(this).toSorted(e)},toSpliced(...e){return vn(this).toSpliced(...e)},unshift(...e){return Pn(this,"unshift",e)},values(){return no(this,"values",e=>wt(this,e))}};function no(e,t,n){const s=Us(e),o=s[t]();return s!==e&&!nt(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=n(l.value)),l}),o}const Xa=Array.prototype;function At(e,t,n,s,o,l){const a=Us(e),r=a!==e&&!nt(e),d=a[t];if(d!==Xa[t]){const p=d.apply(e,l);return r?ot(p):p}let u=n;a!==e&&(r?u=function(p,_){return n.call(this,wt(e,p),_,e)}:n.length>2&&(u=function(p,_){return n.call(this,p,_,e)}));const f=d.call(a,u,s);return r&&o?o(f):f}function mi(e,t,n,s){const o=Us(e),l=o!==e&&!nt(e);let a=n,r=!1;o!==e&&(l?(r=s.length===0,a=function(u,f,p){return r&&(r=!1,u=wt(e,u)),n.call(this,u,wt(e,f),p,e)}):n.length>3&&(a=function(u,f,p){return n.call(this,u,f,p,e)}));const d=o[t](a,...s);return r?wt(e,d):d}function so(e,t,n){const s=ve(e);Fe(s,"iterate",Yn);const o=s[t](...n);return(o===-1||o===!1)&&Jo(n[0])?(n[0]=ve(n[0]),s[t](...n)):o}function Pn(e,t,n=[]){Ft(),Vo();const s=ve(e)[t].apply(e,n);return Wo(),Nt(),s}const Qa=Ho("__proto__,__v_isRef,__isVue"),wl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xt));function Za(e){xt(e)||(e=String(e));const t=ve(this);return Fe(t,"has",e),t.hasOwnProperty(e)}class _l{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return l;if(n==="__v_raw")return s===(o?l?ur:Sl:l?xl:$l).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const a=se(t);if(!o){let d;if(a&&(d=Ga[n]))return d;if(n==="hasOwnProperty")return Za}const r=Reflect.get(t,n,He(t)?t:s);if((xt(n)?wl.has(n):Qa(n))||(o||Fe(t,"get",n),l))return r;if(He(r)){const d=a&&jo(n)?r:r.value;return o&&we(d)?$o(d):d}return we(r)?o?$o(r):fn(r):r}}class kl extends _l{constructor(t=!1){super(!1,t)}set(t,n,s,o){let l=t[n];const a=se(t)&&jo(n);if(!this._isShallow){const u=St(l);if(!nt(s)&&!St(s)&&(l=ve(l),s=ve(s)),!a&&He(l)&&!He(s))return u||(l.value=s),!0}const r=a?Number(n)<t.length:me(t,n),d=Reflect.set(t,n,s,He(t)?t:o);return t===ve(o)&&d&&(r?kt(s,l)&&Ot(t,"set",n,s):Ot(t,"add",n,s)),d}deleteProperty(t,n){const s=me(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Ot(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!xt(n)||!wl.has(n))&&Fe(t,"has",n),s}ownKeys(t){return Fe(t,"iterate",se(t)?"length":ln),Reflect.ownKeys(t)}}class er extends _l{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const tr=new kl,nr=new er,sr=new kl(!0);const ko=e=>e,us=e=>Reflect.getPrototypeOf(e);function or(e,t,n){return function(...s){const o=this.__v_raw,l=ve(o),a=Yt(l),r=e==="entries"||e===Symbol.iterator&&a,d=e==="keys"&&a,u=o[e](...s),f=n?ko:t?Jt:ot;return!t&&Fe(l,"iterate",d?_o:ln),De(Object.create(u),{next(){const{value:p,done:_}=u.next();return _?{value:p,done:_}:{value:r?[f(p[0]),f(p[1])]:f(p),done:_}}})}}function cs(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ir(e,t){const n={get(o){const l=this.__v_raw,a=ve(l),r=ve(o);e||(kt(o,r)&&Fe(a,"get",o),Fe(a,"get",r));const{has:d}=us(a),u=t?ko:e?Jt:ot;if(d.call(a,o))return u(l.get(o));if(d.call(a,r))return u(l.get(r));l!==a&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Fe(ve(o),"iterate",ln),o.size},has(o){const l=this.__v_raw,a=ve(l),r=ve(o);return e||(kt(o,r)&&Fe(a,"has",o),Fe(a,"has",r)),o===r?l.has(o):l.has(o)||l.has(r)},forEach(o,l){const a=this,r=a.__v_raw,d=ve(r),u=t?ko:e?Jt:ot;return!e&&Fe(d,"iterate",ln),r.forEach((f,p)=>o.call(l,u(f),u(p),a))}};return De(n,e?{add:cs("add"),set:cs("set"),delete:cs("delete"),clear:cs("clear")}:{add(o){const l=ve(this),a=us(l),r=ve(o),d=!t&&!nt(o)&&!St(o)?r:o;return a.has.call(l,d)||kt(o,d)&&a.has.call(l,o)||kt(r,d)&&a.has.call(l,r)||(l.add(d),Ot(l,"add",d,d)),this},set(o,l){!t&&!nt(l)&&!St(l)&&(l=ve(l));const a=ve(this),{has:r,get:d}=us(a);let u=r.call(a,o);u||(o=ve(o),u=r.call(a,o));const f=d.call(a,o);return a.set(o,l),u?kt(l,f)&&Ot(a,"set",o,l):Ot(a,"add",o,l),this},delete(o){const l=ve(this),{has:a,get:r}=us(l);let d=a.call(l,o);d||(o=ve(o),d=a.call(l,o)),r&&r.call(l,o);const u=l.delete(o);return d&&Ot(l,"delete",o,void 0),u},clear(){const o=ve(this),l=o.size!==0,a=o.clear();return l&&Ot(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=or(o,e,t)}),n}function Yo(e,t){const n=ir(e,t);return(s,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?s:Reflect.get(me(n,o)&&o in s?n:s,o,l)}const lr={get:Yo(!1,!1)},ar={get:Yo(!1,!0)},rr={get:Yo(!0,!1)};const $l=new WeakMap,xl=new WeakMap,Sl=new WeakMap,ur=new WeakMap;function cr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fn(e){return St(e)?e:zo(e,!1,tr,lr,$l)}function dr(e){return zo(e,!1,sr,ar,xl)}function $o(e){return zo(e,!0,nr,rr,Sl)}function zo(e,t,n,s,o){if(!we(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=o.get(e);if(l)return l;const a=cr(Da(e));if(a===0)return e;const r=new Proxy(e,a===2?s:n);return o.set(e,r),r}function zt(e){return St(e)?zt(e.__v_raw):!!(e&&e.__v_isReactive)}function St(e){return!!(e&&e.__v_isReadonly)}function nt(e){return!!(e&&e.__v_isShallow)}function Jo(e){return e?!!e.__v_raw:!1}function ve(e){const t=e&&e.__v_raw;return t?ve(t):e}function fr(e){return!me(e,"__v_skip")&&Object.isExtensible(e)&&rl(e,"__v_skip",!0),e}const ot=e=>we(e)?fn(e):e,Jt=e=>we(e)?$o(e):e;function He(e){return e?e.__v_isRef===!0:!1}function fe(e){return pr(e,!1)}function pr(e,t){return He(e)?e:new hr(e,t)}class hr{constructor(t,n){this.dep=new qo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ve(t),this._value=n?t:ot(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||nt(t)||St(t);t=s?t:ve(t),kt(t,n)&&(this._rawValue=t,this._value=s?t:ot(t),this.dep.trigger())}}function v(e){return He(e)?e.value:e}const vr={get:(e,t,n)=>t==="__v_raw"?e:v(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return He(o)&&!He(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function Cl(e){return zt(e)?e:new Proxy(e,vr)}class mr{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new qo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=qn-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&xe!==this)return hl(this,!0),!0}get value(){const t=this.dep.track();return yl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function yr(e,t,n=!1){let s,o;return re(e)?s=e:(s=e.get,o=e.set),new mr(s,o,n)}const ds={},_s=new WeakMap;let nn;function gr(e,t=!1,n=nn){if(n){let s=_s.get(n);s||_s.set(n,s=[]),s.push(e)}}function br(e,t,n=ke){const{immediate:s,deep:o,once:l,scheduler:a,augmentJob:r,call:d}=n,u=C=>o?C:nt(C)||o===!1||o===0?It(C,1):It(C);let f,p,_,T,M=!1,I=!1;if(He(e)?(p=()=>e.value,M=nt(e)):zt(e)?(p=()=>u(e),M=!0):se(e)?(I=!0,M=e.some(C=>zt(C)||nt(C)),p=()=>e.map(C=>{if(He(C))return C.value;if(zt(C))return u(C);if(re(C))return d?d(C,2):C()})):re(e)?t?p=d?()=>d(e,2):e:p=()=>{if(_){Ft();try{_()}finally{Nt()}}const C=nn;nn=f;try{return d?d(e,3,[T]):e(T)}finally{nn=C}}:p=$t,t&&o){const C=p,z=o===!0?1/0:o;p=()=>It(C(),z)}const $=Ya(),x=()=>{f.stop(),$&&$.active&&Uo($.effects,f)};if(l&&t){const C=t;t=(...z)=>{const P=C(...z);return x(),P}}let O=I?new Array(e.length).fill(ds):ds;const J=C=>{if(!(!(f.flags&1)||!f.dirty&&!C))if(t){const z=f.run();if(C||o||M||(I?z.some((P,S)=>kt(P,O[S])):kt(z,O))){_&&_();const P=nn;nn=f;try{const S=[z,O===ds?void 0:I&&O[0]===ds?[]:O,T];O=z,d?d(t,3,S):t(...S)}finally{nn=P}}}else f.run()};return r&&r(J),f=new fl(p),f.scheduler=a?()=>a(J,!1):J,T=C=>gr(C,!1,f),_=f.onStop=()=>{const C=_s.get(f);if(C){if(d)d(C,4);else for(const z of C)z();_s.delete(f)}},t?s?J(!0):O=f.run():a?a(J.bind(null,!0),!0):f.run(),x.pause=f.pause.bind(f),x.resume=f.resume.bind(f),x.stop=x,x}function It(e,t=1/0,n){if(t<=0||!we(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,He(e))It(e.value,t,n);else if(se(e))for(let s=0;s<e.length;s++)It(e[s],t,n);else if(Dt(e)||Yt(e))e.forEach(s=>{It(s,t,n)});else if(al(e)){for(const s in e)It(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&It(e[s],t,n)}return e}function ss(e,t,n,s){try{return s?e(...s):e()}catch(o){js(o,t,n)}}function ct(e,t,n,s){if(re(e)){const o=ss(e,t,n,s);return o&&il(o)&&o.catch(l=>{js(l,t,n)}),o}if(se(e)){const o=[];for(let l=0;l<e.length;l++)o.push(ct(e[l],t,n,s));return o}}function js(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||ke;if(t){let r=t.parent;const d=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){const f=r.ec;if(f){for(let p=0;p<f.length;p++)if(f[p](e,d,u)===!1)return}r=r.parent}if(l){Ft(),ss(l,null,10,[e,d,u]),Nt();return}}wr(e,n,o,s,a)}function wr(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Be=[];let gt=-1;const gn=[];let Wt=null,mn=0;const Al=Promise.resolve();let ks=null;function Bs(e){const t=ks||Al;return e?t.then(this?e.bind(this):e):t}function _r(e){let t=gt+1,n=Be.length;for(;t<n;){const s=t+n>>>1,o=Be[s],l=zn(o);l<e||l===e&&o.flags&2?t=s+1:n=s}return t}function Go(e){if(!(e.flags&1)){const t=zn(e),n=Be[Be.length-1];!n||!(e.flags&2)&&t>=zn(n)?Be.push(e):Be.splice(_r(t),0,e),e.flags|=1,Tl()}}function Tl(){ks||(ks=Al.then(Pl))}function kr(e){if(!se(e))Wt&&e.id===-1?Wt.splice(mn+1,0,e):e.flags&1||(gn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)gn.push(e[t]);Tl()}function yi(e,t,n=gt+1){for(;n<Be.length;n++){const s=Be[n];if(s&&s.flags&2){if(e&&s.id!==e.uid)continue;Be.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function El(e){if(gn.length){const t=[...new Set(gn)].sort((n,s)=>zn(n)-zn(s));if(gn.length=0,Wt){for(let n=0;n<t.length;n++)Wt.push(t[n]);return}for(Wt=t,mn=0;mn<Wt.length;mn++){const n=Wt[mn];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Wt=null,mn=0}}const zn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Pl(e){try{for(gt=0;gt<Be.length;gt++){const t=Be[gt];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ss(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;gt<Be.length;gt++){const t=Be[gt];t&&(t.flags&=-2)}gt=-1,Be.length=0,El(),ks=null,(Be.length||gn.length)&&Pl()}}let ze=null,Ol=null;function $s(e){const t=ze;return ze=e,Ol=e&&e.type.__scopeId||null,t}function $r(e,t=ze,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Ei(-1);const l=$s(t),a=rn.length;let r;try{r=e(...o)}finally{for(let d=rn.length;d>a;d--)na();$s(l),s._d&&Ei(1)}return r};return s._n=!0,s._c=!0,s._d=!0,s}function ye(e,t){if(ze===null)return e;const n=Ys(ze),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[l,a,r,d=ke]=t[o];l&&(re(l)&&(l={mounted:l,updated:l}),l.deep&&It(a),s.push({dir:l,instance:n,value:a,oldValue:void 0,arg:r,modifiers:d}))}return e}function en(e,t,n,s){const o=e.dirs,l=t&&t.dirs;for(let a=0;a<o.length;a++){const r=o[a];l&&(r.oldValue=l[a].value);let d=r.dir[s];d&&(Ft(),ct(d,n,8,[e.el,r,e,t]),Nt())}}function xr(e,t){if(Ne){let n=Ne.provides;const s=Ne.parent&&Ne.parent.provides;s===n&&(n=Ne.provides=Object.create(s)),n[e]=t}}function vs(e,t,n=!1){const s=_u();if(s||bn){let o=bn?bn._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&re(t)?t.call(s&&s.proxy):t}}const Sr=Symbol.for("v-scx"),Cr=()=>vs(Sr);function an(e,t,n){return Il(e,t,n)}function Il(e,t,n=ke){const{immediate:s,deep:o,flush:l,once:a}=n,r=De({},n),d=t&&s||!t&&l!=="post";let u;if(Xn){if(l==="sync"){const T=Cr();u=T.__watcherHandles||(T.__watcherHandles=[])}else if(!d){const T=()=>{};return T.stop=$t,T.resume=$t,T.pause=$t,T}}const f=Ne;r.call=(T,M,I)=>ct(T,f,M,I);let p=!1;l==="post"?r.scheduler=T=>{We(T,f&&f.suspense)}:l!=="sync"&&(p=!0,r.scheduler=(T,M)=>{M?T():Go(T)}),r.augmentJob=T=>{t&&(T.flags|=4),p&&(T.flags|=2,f&&(T.id=f.uid,T.i=f))};const _=br(e,t,r);return Xn&&(u?u.push(_):d&&_()),_}function Ar(e,t,n){const s=this.proxy,o=Te(e)?e.includes(".")?Ml(s,e):()=>s[e]:e.bind(s,s);let l;re(t)?l=t:(l=t.handler,n=t);const a=os(this),r=Il(o,l.bind(s),n);return a(),r}function Ml(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const Tr=Symbol("_vte"),Vs=e=>e.__isTeleport,oo=Symbol("_leaveCb");function Er(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Rt){t=n;break}}return t}function Ll(e){if(!Qo(e))return Vs(e.type)&&e.children?Er(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&re(n.default))return n.default()}}function Xo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;Xo(Vs(n.type)&&Ll(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Ce(e,t){return re(e)?De({name:e.name},t,{setup:e}):e}function Dl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function gi(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const xs=new WeakMap;function Bn(e,t,n,s,o=!1){if(se(e)){e.forEach((I,$)=>Bn(I,t&&(se(t)?t[$]:t),n,s,o));return}if(Vn(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Bn(e,t,n,s.component.subTree);return}const l=s.shapeFlag&4?Ys(s.component):s.el,a=o?null:l,{i:r,r:d}=e,u=t&&t.r,f=r.refs===ke?r.refs={}:r.refs,p=r.setupState,_=ve(p),T=p===ke?ol:I=>gi(f,I)?!1:me(_,I),M=(I,$)=>!($&&gi(f,$));if(u!=null&&u!==d){if(bi(t),Te(u))f[u]=null,T(u)&&(p[u]=null);else if(He(u)){const I=t;M(u,I.k)&&(u.value=null),I.k&&(f[I.k]=null)}}if(re(d))ss(d,r,12,[a,f]);else{const I=Te(d),$=He(d);if(I||$){const x=()=>{if(e.f){const O=I?T(d)?p[d]:f[d]:M()||!e.k?d.value:f[e.k];if(o)se(O)&&Uo(O,l);else if(se(O))O.includes(l)||O.push(l);else if(I)f[d]=[l],T(d)&&(p[d]=f[d]);else{const J=[l];M(d,e.k)&&(d.value=J),e.k&&(f[e.k]=J)}}else I?(f[d]=a,T(d)&&(p[d]=a)):$&&(M(d,e.k)&&(d.value=a),e.k&&(f[e.k]=a))};if(a){const O=()=>{x(),xs.delete(e)};O.id=-1,xs.set(e,O),We(O,n)}else bi(e),x()}}}function bi(e){const t=xs.get(e);t&&(t.flags|=8,xs.delete(e))}Hs().requestIdleCallback;Hs().cancelIdleCallback;const Vn=e=>!!e.type.__asyncLoader,Qo=e=>e.type.__isKeepAlive;function Pr(e,t){Fl(e,"a",t)}function Or(e,t){Fl(e,"da",t)}function Fl(e,t,n=Ne){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(Ws(t,s,n),n){let o=n.parent;for(;o&&o.parent;)Qo(o.parent.vnode)&&Ir(s,t,n,o),o=o.parent}}function Ir(e,t,n,s){const o=Ws(t,e,s,!0);Nl(()=>{Uo(s[t],o)},n)}function Ws(e,t,n=Ne,s=!1){if(n){const o=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...a)=>{Ft();const r=os(n),d=ct(t,n,e,a);return r(),Nt(),d});return s?o.unshift(l):o.push(l),l}}const Ut=e=>(t,n=Ne)=>{(!Xn||e==="sp")&&Ws(e,(...s)=>t(...s),n)},Mr=Ut("bm"),hn=Ut("m"),Lr=Ut("bu"),Dr=Ut("u"),An=Ut("bum"),Nl=Ut("um"),Fr=Ut("sp"),Nr=Ut("rtg"),Rr=Ut("rtc");function Hr(e,t=Ne){Ws("ec",e,t)}const Ur="components",Rl=Symbol.for("v-ndc");function jr(e){return Te(e)?Br(Ur,e,!1)||e:e||Rl}function Br(e,t,n=!0,s=!1){const o=ze||Ne;if(o){const l=o.type;{const r=Cu(l,!1);if(r&&(r===t||r===Ve(t)||r===Ns(Ve(t))))return l}const a=wi(o[e]||l[e],t)||wi(o.appContext[e],t);return!a&&s?l:a}}function wi(e,t){return e&&(e[t]||e[Ve(t)]||e[Ns(Ve(t))])}function ie(e,t,n,s){let o;const l=n,a=se(e);if(a||Te(e)){const r=a&&zt(e);let d=!1,u=!1;r&&(d=!nt(e),u=St(e),e=Us(e)),o=new Array(e.length);for(let f=0,p=e.length;f<p;f++)o[f]=t(d?u?Jt(ot(e[f])):ot(e[f]):e[f],f,void 0,l)}else if(typeof e=="number"){o=new Array(e);for(let r=0;r<e;r++)o[r]=t(r+1,r,void 0,l)}else if(we(e))if(e[Symbol.iterator])o=Array.from(e,(r,d)=>t(r,d,void 0,l));else{const r=Object.keys(e);o=new Array(r.length);for(let d=0,u=r.length;d<u;d++){const f=r[d];o[d]=t(e[f],f,d,l)}}else o=[];return o}const xo=e=>e?la(e)?Ys(e):xo(e.parent):null,Wn=De(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>xo(e.parent),$root:e=>xo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ul(e),$forceUpdate:e=>e.f||(e.f=()=>{Go(e.update)}),$nextTick:e=>e.n||(e.n=Bs.bind(e.proxy)),$watch:e=>Ar.bind(e)}),io=(e,t)=>e!==ke&&!e.__isScriptSetup&&me(e,t),Vr={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:l,accessCache:a,type:r,appContext:d}=e;if(t[0]!=="$"){const _=a[t];if(_!==void 0)switch(_){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return l[t]}else{if(io(s,t))return a[t]=1,s[t];if(o!==ke&&me(o,t))return a[t]=2,o[t];if(me(l,t))return a[t]=3,l[t];if(n!==ke&&me(n,t))return a[t]=4,n[t];So&&(a[t]=0)}}const u=Wn[t];let f,p;if(u)return t==="$attrs"&&Fe(e.attrs,"get",""),u(e);if((f=r.__cssModules)&&(f=f[t]))return f;if(n!==ke&&me(n,t))return a[t]=4,n[t];if(p=d.config.globalProperties,me(p,t))return p[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:l}=e;return io(o,t)?(o[t]=n,!0):s!==ke&&me(s,t)?(s[t]=n,!0):me(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:l,type:a}},r){let d;return!!(n[r]||e!==ke&&r[0]!=="$"&&me(e,r)||io(t,r)||me(l,r)||me(s,r)||me(Wn,r)||me(o.config.globalProperties,r)||(d=a.__cssModules)&&d[r])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:me(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function _i(e){return se(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let So=!0;function Wr(e){const t=Ul(e),n=e.proxy,s=e.ctx;So=!1,t.beforeCreate&&ki(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:a,watch:r,provide:d,inject:u,created:f,beforeMount:p,mounted:_,beforeUpdate:T,updated:M,activated:I,deactivated:$,beforeDestroy:x,beforeUnmount:O,destroyed:J,unmounted:C,render:z,renderTracked:P,renderTriggered:S,errorCaptured:b,serverPrefetch:A,expose:q,inheritAttrs:W,components:le,directives:Z,filters:B}=t;if(u&&Kr(u,s,null),a)for(const V in a){const Q=a[V];re(Q)&&(s[V]=Q.bind(n))}if(o){const V=o.call(n,n);we(V)&&(e.data=fn(V))}if(So=!0,l)for(const V in l){const Q=l[V],Ee=re(Q)?Q.bind(n,n):re(Q.get)?Q.get.bind(n,n):$t,pt=!re(Q)&&re(Q.set)?Q.set.bind(n):$t,Ze=k({get:Ee,set:pt});Object.defineProperty(s,V,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:qe=>Ze.value=qe})}if(r)for(const V in r)Hl(r[V],s,n,V);if(d){const V=re(d)?d.call(n):d;Reflect.ownKeys(V).forEach(Q=>{xr(Q,V[Q])})}f&&ki(f,e,"c");function ce(V,Q){se(Q)?Q.forEach(Ee=>V(Ee.bind(n))):Q&&V(Q.bind(n))}if(ce(Mr,p),ce(hn,_),ce(Lr,T),ce(Dr,M),ce(Pr,I),ce(Or,$),ce(Hr,b),ce(Rr,P),ce(Nr,S),ce(An,O),ce(Nl,C),ce(Fr,A),se(q))if(q.length){const V=e.exposed||(e.exposed={});q.forEach(Q=>{Object.defineProperty(V,Q,{get:()=>n[Q],set:Ee=>n[Q]=Ee,enumerable:!0})})}else e.exposed||(e.exposed={});z&&e.render===$t&&(e.render=z),W!=null&&(e.inheritAttrs=W),le&&(e.components=le),Z&&(e.directives=Z),A&&Dl(e)}function Kr(e,t,n=$t){se(e)&&(e=Co(e));for(const s in e){const o=e[s];let l;we(o)?"default"in o?l=vs(o.from||s,o.default,!0):l=vs(o.from||s):l=vs(o),He(l)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[s]=l}}function ki(e,t,n){ct(se(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Hl(e,t,n,s){let o=s.includes(".")?Ml(n,s):()=>n[s];if(Te(e)){const l=t[e];re(l)&&an(o,l)}else if(re(e))an(o,e.bind(n));else if(we(e))if(se(e))e.forEach(l=>Hl(l,t,n,s));else{const l=re(e.handler)?e.handler.bind(n):t[e.handler];re(l)&&an(o,l,e)}}function Ul(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,r=l.get(t);let d;return r?d=r:!o.length&&!n&&!s?d=t:(d={},o.length&&o.forEach(u=>Ss(d,u,a,!0)),Ss(d,t,a)),we(t)&&l.set(t,d),d}function Ss(e,t,n,s=!1){const{mixins:o,extends:l}=t;l&&Ss(e,l,n,!0),o&&o.forEach(a=>Ss(e,a,n,!0));for(const a in t)if(!(s&&a==="expose")){const r=qr[a]||n&&n[a];e[a]=r?r(e[a],t[a]):t[a]}return e}const qr={data:$i,props:xi,emits:xi,methods:Ln,computed:Ln,beforeCreate:Ue,created:Ue,beforeMount:Ue,mounted:Ue,beforeUpdate:Ue,updated:Ue,beforeDestroy:Ue,beforeUnmount:Ue,destroyed:Ue,unmounted:Ue,activated:Ue,deactivated:Ue,errorCaptured:Ue,serverPrefetch:Ue,components:Ln,directives:Ln,watch:zr,provide:$i,inject:Yr};function $i(e,t){return t?e?function(){return De(re(e)?e.call(this,this):e,re(t)?t.call(this,this):t)}:t:e}function Yr(e,t){return Ln(Co(e),Co(t))}function Co(e){if(se(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ue(e,t){return e?[...new Set([].concat(e,t))]:t}function Ln(e,t){return e?De(Object.create(null),e,t):t}function xi(e,t){return e?se(e)&&se(t)?[...new Set([...e,...t])]:De(Object.create(null),_i(e),_i(t??{})):t}function zr(e,t){if(!e)return t;if(!t)return e;const n=De(Object.create(null),e);for(const s in t)n[s]=Ue(e[s],t[s]);return n}function jl(){return{app:null,config:{isNativeTag:ol,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Jr=0;function Gr(e,t){return function(s,o=null){re(s)||(s=De({},s)),o!=null&&!we(o)&&(o=null);const l=jl(),a=new WeakSet,r=[];let d=!1;const u=l.app={_uid:Jr++,_component:s,_props:o,_container:null,_context:l,_instance:null,version:Tu,get config(){return l.config},set config(f){},use(f,...p){return a.has(f)||(f&&re(f.install)?(a.add(f),f.install(u,...p)):re(f)&&(a.add(f),f(u,...p))),u},mixin(f){return l.mixins.includes(f)||l.mixins.push(f),u},component(f,p){return p?(l.components[f]=p,u):l.components[f]},directive(f,p){return p?(l.directives[f]=p,u):l.directives[f]},mount(f,p,_){if(!d){const T=u._ceVNode||$e(s,o);return T.appContext=l,_===!0?_="svg":_===!1&&(_=void 0),e(T,f,_),d=!0,u._container=f,f.__vue_app__=u,Ys(T.component)}},onUnmount(f){r.push(f)},unmount(){d&&(ct(r,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(f,p){return l.provides[f]=p,u},runWithContext(f){const p=bn;bn=u;try{return f()}finally{bn=p}}};return u}}let bn=null;const Xr=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Ve(t)}Modifiers`]||e[`${Qt(t)}Modifiers`];function Qr(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ke;let o=n;const l=t.startsWith("update:"),a=l&&Xr(s,t.slice(7));a&&(a.trim&&(o=n.map(f=>Te(f)?f.trim():f)),a.number&&(o=o.map(Rs)));let r,d=s[r=Zs(t)]||s[r=Zs(Ve(t))];!d&&l&&(d=s[r=Zs(Qt(t))]),d&&ct(d,e,6,o);const u=s[r+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[r])return;e.emitted[r]=!0,ct(u,e,6,o)}}const Zr=new WeakMap;function Bl(e,t,n=!1){const s=n?Zr:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const l=e.emits;let a={},r=!1;if(!re(e)){const d=u=>{const f=Bl(u,t,!0);f&&(r=!0,De(a,f))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!l&&!r?(we(e)&&s.set(e,null),null):(se(l)?l.forEach(d=>a[d]=null):De(a,l),we(e)&&s.set(e,a),a)}function Ks(e,t){return!e||!Ls(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),me(e,t[0].toLowerCase()+t.slice(1))||me(e,Qt(t))||me(e,t))}function Si(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[l],slots:a,attrs:r,emit:d,render:u,renderCache:f,props:p,data:_,setupState:T,ctx:M,inheritAttrs:I}=e,$=$s(e);let x,O;try{if(n.shapeFlag&4){const C=o||s,z=C;x=_t(u.call(z,C,f,p,T,_,M)),O=r}else{const C=t;x=_t(C.length>1?C(p,{attrs:r,slots:a,emit:d}):C(p,null)),O=t.props?r:eu(r)}}catch(C){rn.length=0,js(C,e,1),x=$e(Rt)}let J=x;if(O&&I!==!1){const C=Object.keys(O),{shapeFlag:z}=J;C.length&&z&7&&(l&&C.some(Ds)&&(O=tu(O,l)),J=kn(J,O,!1,!0))}if(n.dirs&&(J=kn(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(n.dirs):n.dirs),n.transition){const C=Vs(J.type)&&Ll(J)||J;Xo(C,n.transition)}return x=J,$s($),x}const eu=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ls(n))&&((t||(t={}))[n]=e[n]);return t},tu=(e,t)=>{const n={};for(const s in e)(!Ds(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function nu(e,t,n){const{props:s,children:o,component:l}=e,{props:a,children:r,patchFlag:d}=t,u=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return s?Ci(s,a,u):!!a;if(d&8){const f=t.dynamicProps;for(let p=0;p<f.length;p++){const _=f[p];if(Vl(a,s,_)&&!Ks(u,_))return!0}}}else return(o||r)&&(!r||!r.$stable)?!0:s===a?!1:s?a?Ci(s,a,u):!0:!!a;return!1}function Ci(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const l=s[o];if(Vl(t,e,l)&&!Ks(n,l))return!0}return!1}function Vl(e,t,n){const s=e[n],o=t[n];return n==="style"&&we(s)&&we(o)?!ut(s,o):s!==o}function su({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Wl={},Kl=()=>Object.create(Wl),ql=e=>Object.getPrototypeOf(e)===Wl;function ou(e,t,n,s=!1){const o={},l=Kl();e.propsDefaults=Object.create(null),Yl(e,t,o,l);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);n?e.props=s?o:dr(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function iu(e,t,n,s){const{props:o,attrs:l,vnode:{patchFlag:a}}=e,r=ve(o),[d]=e.propsOptions;let u=!1;if((s||a>0)&&!(a&16)){if(a&8){const f=e.vnode.dynamicProps;for(let p=0;p<f.length;p++){let _=f[p];if(Ks(e.emitsOptions,_))continue;const T=t[_];if(d)if(me(l,_))T!==l[_]&&(l[_]=T,u=!0);else{const M=Ve(_);o[M]=Ao(d,r,M,T,e,!1)}else T!==l[_]&&(l[_]=T,u=!0)}}}else{Yl(e,t,o,l)&&(u=!0);let f;for(const p in r)(!t||!me(t,p)&&((f=Qt(p))===p||!me(t,f)))&&(d?n&&(n[p]!==void 0||n[f]!==void 0)&&(o[p]=Ao(d,r,p,void 0,e,!0)):delete o[p]);if(l!==r)for(const p in l)(!t||!me(t,p))&&(delete l[p],u=!0)}u&&Ot(e.attrs,"set","")}function Yl(e,t,n,s){const[o,l]=e.propsOptions;let a=!1,r;if(t)for(let d in t){if(Hn(d))continue;const u=t[d];let f;o&&me(o,f=Ve(d))?!l||!l.includes(f)?n[f]=u:(r||(r={}))[f]=u:Ks(e.emitsOptions,d)||(!(d in s)||u!==s[d])&&(s[d]=u,a=!0)}if(l){const d=ve(n),u=r||ke;for(let f=0;f<l.length;f++){const p=l[f];n[p]=Ao(o,d,p,u[p],e,!me(u,p))}}return a}function Ao(e,t,n,s,o,l){const a=e[n];if(a!=null){const r=me(a,"default");if(r&&s===void 0){const d=a.default;if(a.type!==Function&&!a.skipFactory&&re(d)){const{propsDefaults:u}=o;if(n in u)s=u[n];else{const f=os(o);s=u[n]=d.call(null,t),f()}}else s=d;o.ce&&o.ce._setProp(n,s)}a[0]&&(l&&!r?s=!1:a[1]&&(s===""||s===Qt(n))&&(s=!0))}return s}const lu=new WeakMap;function zl(e,t,n=!1){const s=n?lu:t.propsCache,o=s.get(e);if(o)return o;const l=e.props,a={},r=[];let d=!1;if(!re(e)){const f=p=>{d=!0;const[_,T]=zl(p,t,!0);De(a,_),T&&r.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!l&&!d)return we(e)&&s.set(e,on),on;if(se(l))for(let f=0;f<l.length;f++){const p=Ve(l[f]);Ai(p)&&(a[p]=ke)}else if(l)for(const f in l){const p=Ve(f);if(Ai(p)){const _=l[f],T=a[p]=se(_)||re(_)?{type:_}:De({},_),M=T.type;let I=!1,$=!0;if(se(M))for(let x=0;x<M.length;++x){const O=M[x],J=re(O)&&O.name;if(J==="Boolean"){I=!0;break}else J==="String"&&($=!1)}else I=re(M)&&M.name==="Boolean";T[0]=I,T[1]=$,(I||me(T,"default"))&&r.push(p)}}const u=[a,r];return we(e)&&s.set(e,u),u}function Ai(e){return e[0]!=="$"&&!Hn(e)}const Zo=e=>e==="_"||e==="_ctx"||e==="$stable",ei=e=>se(e)?e.map(_t):[_t(e)],au=(e,t,n)=>{if(t._n)return t;const s=$r((...o)=>ei(t(...o)),n);return s._c=!1,s},Jl=(e,t,n)=>{const s=e._ctx;for(const o in e){if(Zo(o))continue;const l=e[o];if(re(l))t[o]=au(o,l,s);else if(l!=null){const a=ei(l);t[o]=()=>a}}},Gl=(e,t)=>{const n=ei(t);e.slots.default=()=>n},Xl=(e,t,n)=>{for(const s in t)(n||!Zo(s))&&(e[s]=t[s])},ru=(e,t,n)=>{const s=e.slots=Kl();if(e.vnode.shapeFlag&32){const o=t._;o?(Xl(s,t,n),n&&rl(s,"_",o,!0)):Jl(t,s)}else t&&Gl(e,t)},uu=(e,t,n)=>{const{vnode:s,slots:o}=e;let l=!0,a=ke;if(s.shapeFlag&32){const r=t._;r?n&&r===1?l=!1:Xl(o,t,n):(l=!t.$stable,Jl(t,o)),a=t}else t&&(Gl(e,t),a={default:1});if(l)for(const r in o)!Zo(r)&&a[r]==null&&delete o[r]},We=hu;function cu(e){return du(e)}function du(e,t){const n=Hs();n.__VUE__=!0;const{insert:s,remove:o,patchProp:l,createElement:a,createText:r,createComment:d,setText:u,setElementText:f,parentNode:p,nextSibling:_,setScopeId:T=$t,insertStaticContent:M}=e,I=(g,w,E,R=null,L=null,F=null,Y=void 0,K=null,j=!!w.dynamicChildren)=>{if(g===w)return;g&&!On(g,w)&&(R=de(g),qe(g,L,F,!0),g=null),w.patchFlag===-2&&(j=!1,w.dynamicChildren=null),w.dynamicChildren&&g&&g.dynamicChildren&&g.dynamicChildren.hasOnce&&(w.dynamicChildren===on&&(w.dynamicChildren=[]),w.dynamicChildren.hasOnce=!0);const{type:D,ref:ne,shapeFlag:G}=w;switch(D){case qs:$(g,w,E,R);break;case Rt:x(g,w,E,R);break;case ms:g==null&&O(w,E,R,Y);break;case U:le(g,w,E,R,L,F,Y,K,j);break;default:G&1?z(g,w,E,R,L,F,Y,K,j):G&6?Z(g,w,E,R,L,F,Y,K,j):(G&64||G&128)&&D.process(g,w,E,R,L,F,Y,K,j,Zt)}ne!=null&&L?Bn(ne,g&&g.ref,F,w||g,!w):ne==null&&g&&g.ref!=null&&Bn(g.ref,null,F,g,!0)},$=(g,w,E,R)=>{if(g==null)s(w.el=r(w.children),E,R);else{const L=w.el=g.el;w.children!==g.children&&u(L,w.children)}},x=(g,w,E,R)=>{g==null?s(w.el=d(w.children||""),E,R):w.el=g.el},O=(g,w,E,R)=>{[g.el,g.anchor]=M(g.children,w,E,R,g.el,g.anchor)},J=({el:g,anchor:w},E,R)=>{let L;for(;g&&g!==w;)L=_(g),s(g,E,R),g=L;s(w,E,R)},C=({el:g,anchor:w})=>{let E;for(;g&&g!==w;)E=_(g),o(g),g=E;o(w)},z=(g,w,E,R,L,F,Y,K,j)=>{if(w.type==="svg"?Y="svg":w.type==="math"&&(Y="mathml"),g==null)P(w,E,R,L,F,Y,K,j);else{const D=g.el&&g.el._isVueCE?g.el:null;try{D&&D._beginPatch(),A(g,w,L,F,Y,K,j)}finally{D&&D._endPatch()}}},P=(g,w,E,R,L,F,Y,K)=>{let j,D;const{props:ne,shapeFlag:G,transition:te,dirs:ae}=g;if(j=g.el=a(g.type,F,ne&&ne.is,ne),G&8?f(j,g.children):G&16&&b(g.children,j,null,R,L,lo(g,F),Y,K),ae&&en(g,null,R,"created"),S(j,g,g.scopeId,Y,R),ne){for(const _e in ne)_e!=="value"&&!Hn(_e)&&l(j,_e,null,ne[_e],F,R);"value"in ne&&l(j,"value",null,ne.value,F),(D=ne.onVnodeBeforeMount)&&yt(D,R,g)}ae&&en(g,null,R,"beforeMount");const he=fu(L,te);he&&te.beforeEnter(j),s(j,w,E),((D=ne&&ne.onVnodeMounted)||he||ae)&&We(()=>{D&&yt(D,R,g),he&&te.enter(j),ae&&en(g,null,R,"mounted")},L)},S=(g,w,E,R,L)=>{if(E&&T(g,E),R)for(let F=0;F<R.length;F++)T(g,R[F]);if(L){let F=L.subTree;if(w===F||ta(F.type)&&(F.ssContent===w||F.ssFallback===w)){const Y=L.vnode;S(g,Y,Y.scopeId,Y.slotScopeIds,L.parent)}}},b=(g,w,E,R,L,F,Y,K,j=0)=>{for(let D=j;D<g.length;D++){const ne=g[D]=K?Et(g[D]):_t(g[D]);I(null,ne,w,E,R,L,F,Y,K)}},A=(g,w,E,R,L,F,Y)=>{const K=w.el=g.el;let{patchFlag:j,dynamicChildren:D,dirs:ne}=w;j|=g.patchFlag&16;const G=g.props||ke,te=w.props||ke;let ae;if(E&&tn(E,!1),(ae=te.onVnodeBeforeUpdate)&&yt(ae,E,w,g),ne&&en(w,g,E,"beforeUpdate"),E&&tn(E,!0),D&&(!g.dynamicChildren||g.dynamicChildren.length!==D.length)&&(j=0,Y=!1,D=null),(G.innerHTML&&te.innerHTML==null||G.textContent&&te.textContent==null)&&f(K,""),D?q(g.dynamicChildren,D,K,E,R,lo(w,L),F):Y||Q(g,w,K,null,E,R,lo(w,L),F,!1),j>0){if(j&16)W(K,G,te,E,L);else if(j&2&&G.class!==te.class&&l(K,"class",null,te.class,L),j&4&&l(K,"style",G.style,te.style,L),j&8){const he=w.dynamicProps;for(let _e=0;_e<he.length;_e++){const ge=he[_e],Oe=G[ge],Me=te[ge];(Me!==Oe||ge==="value")&&l(K,ge,Oe,Me,L,E)}}j&1&&g.children!==w.children&&f(K,w.children)}else!Y&&D==null&&W(K,G,te,E,L);((ae=te.onVnodeUpdated)||ne)&&We(()=>{ae&&yt(ae,E,w,g),ne&&en(w,g,E,"updated")},R)},q=(g,w,E,R,L,F,Y)=>{for(let K=0;K<w.length;K++){const j=g[K],D=w[K],ne=j.el&&(j.type===U||!On(j,D)||j.shapeFlag&198)?p(j.el):E;I(j,D,ne,null,R,L,F,Y,!0)}},W=(g,w,E,R,L)=>{if(w!==E){if(w!==ke)for(const F in w)!Hn(F)&&!(F in E)&&l(g,F,w[F],null,L,R);for(const F in E){if(Hn(F))continue;const Y=E[F],K=w[F];Y!==K&&F!=="value"&&l(g,F,K,Y,L,R)}"value"in E&&l(g,"value",w.value,E.value,L)}},le=(g,w,E,R,L,F,Y,K,j)=>{const D=w.el=g?g.el:r(""),ne=w.anchor=g?g.anchor:r("");let{patchFlag:G,dynamicChildren:te,slotScopeIds:ae}=w;ae&&(K=K?K.concat(ae):ae),g==null?(s(D,E,R),s(ne,E,R),b(w.children||[],E,ne,L,F,Y,K,j)):G>0&&G&64&&te&&g.dynamicChildren&&g.dynamicChildren.length===te.length?(q(g.dynamicChildren,te,E,L,F,Y,K),(w.key!=null||L&&w===L.subTree)&&Ql(g,w,!0)):Q(g,w,E,ne,L,F,Y,K,j)},Z=(g,w,E,R,L,F,Y,K,j)=>{w.slotScopeIds=K,g==null?w.shapeFlag&512?L.ctx.activate(w,E,R,Y,j):B(w,E,R,L,F,Y,j):X(g,w,j)},B=(g,w,E,R,L,F,Y)=>{const K=g.component=wu(g,R,L);if(Qo(g)&&(K.ctx.renderer=Zt),ku(K,!1,Y),K.asyncDep){if(L&&L.registerDep(K,ce,Y),!g.el){const j=K.subTree=$e(Rt);x(null,j,w,E),g.placeholder=j.el}}else ce(K,g,w,E,L,F,Y)},X=(g,w,E)=>{const R=w.component=g.component;if(nu(g,w,E))if(R.asyncDep&&!R.asyncResolved){w.el=g.el,V(R,w,E);return}else R.next=w,R.update();else w.el=g.el,R.vnode=w},ce=(g,w,E,R,L,F,Y)=>{const K=()=>{if(g.isMounted){let{next:G,bu:te,u:ae,parent:he,vnode:_e}=g;{const vt=Zl(g);if(vt){G&&(G.el=_e.el,V(g,G,Y)),vt.asyncDep.then(()=>{We(()=>{g.isUnmounted||D()},L)});return}}let ge=G,Oe;tn(g,!1),G?(G.el=_e.el,V(g,G,Y)):G=_e,te&&hs(te),(Oe=G.props&&G.props.onVnodeBeforeUpdate)&&yt(Oe,he,G,_e),tn(g,!0);const Me=Si(g),ht=g.subTree;g.subTree=Me,I(ht,Me,p(ht.el),de(ht),g,L,F),G.el=Me.el,ge===null&&su(g,Me.el),ae&&We(ae,L),(Oe=G.props&&G.props.onVnodeUpdated)&&We(()=>yt(Oe,he,G,_e),L)}else{let G;const{el:te,props:ae}=w,{bm:he,m:_e,parent:ge,root:Oe,type:Me}=g,ht=Vn(w);tn(g,!1),he&&hs(he),!ht&&(G=ae&&ae.onVnodeBeforeMount)&&yt(G,ge,w),tn(g,!0);{Oe.ce&&Oe.ce._hasShadowRoot()&&Oe.ce._injectChildStyle(Me,g.parent?g.parent.type:void 0);const vt=g.subTree=Si(g);I(null,vt,E,R,g,L,F),w.el=vt.el}if(_e&&We(_e,L),!ht&&(G=ae&&ae.onVnodeMounted)){const vt=w;We(()=>yt(G,ge,vt),L)}(w.shapeFlag&256||ge&&Vn(ge.vnode)&&ge.vnode.shapeFlag&256)&&g.a&&We(g.a,L),g.isMounted=!0,w=E=R=null}};g.scope.on();const j=g.effect=new fl(K);g.scope.off();const D=g.update=j.run.bind(j),ne=g.job=j.runIfDirty.bind(j);ne.i=g,ne.id=g.uid,j.scheduler=()=>Go(ne),tn(g,!0),D()},V=(g,w,E)=>{w.component=g;const R=g.vnode.props;g.vnode=w,g.next=null,iu(g,w.props,R,E),uu(g,w.children,E),Ft(),yi(g),Nt()},Q=(g,w,E,R,L,F,Y,K,j=!1)=>{const D=g&&g.children,ne=g?g.shapeFlag:0,G=w.children,{patchFlag:te,shapeFlag:ae}=w;if(te>0){if(te&128){pt(D,G,E,R,L,F,Y,K,j);return}else if(te&256){Ee(D,G,E,R,L,F,Y,K,j);return}}ae&8?(ne&16&&N(D,L,F),G!==D&&f(E,G)):ne&16?ae&16?pt(D,G,E,R,L,F,Y,K,j):N(D,L,F,!0):(ne&8&&f(E,""),ae&16&&b(G,E,R,L,F,Y,K,j))},Ee=(g,w,E,R,L,F,Y,K,j)=>{g=g||on,w=w||on;const D=g.length,ne=w.length,G=Math.min(D,ne);let te;for(te=0;te<G;te++){const ae=w[te]=j?Et(w[te]):_t(w[te]);I(g[te],ae,E,null,L,F,Y,K,j)}D>ne?N(g,L,F,!0,!1,G):b(w,E,R,L,F,Y,K,j,G)},pt=(g,w,E,R,L,F,Y,K,j)=>{let D=0;const ne=w.length;let G=g.length-1,te=ne-1;for(;D<=G&&D<=te;){const ae=g[D],he=w[D]=j?Et(w[D]):_t(w[D]);if(On(ae,he))I(ae,he,E,null,L,F,Y,K,j);else break;D++}for(;D<=G&&D<=te;){const ae=g[G],he=w[te]=j?Et(w[te]):_t(w[te]);if(On(ae,he))I(ae,he,E,null,L,F,Y,K,j);else break;G--,te--}if(D>G){if(D<=te){const ae=te+1,he=ae<ne?w[ae].el:R;for(;D<=te;)I(null,w[D]=j?Et(w[D]):_t(w[D]),E,he,L,F,Y,K,j),D++}}else if(D>te)for(;D<=G;)qe(g[D],L,F,!0),D++;else{const ae=D,he=D,_e=new Map;for(D=he;D<=te;D++){const Ye=w[D]=j?Et(w[D]):_t(w[D]);Ye.key!=null&&_e.set(Ye.key,D)}let ge,Oe=0;const Me=te-he+1;let ht=!1,vt=0;const En=new Array(Me);for(D=0;D<Me;D++)En[D]=0;for(D=ae;D<=G;D++){const Ye=g[D];if(Oe>=Me){qe(Ye,L,F,!0);continue}let mt;if(Ye.key!=null)mt=_e.get(Ye.key);else for(ge=he;ge<=te;ge++)if(En[ge-he]===0&&On(Ye,w[ge])){mt=ge;break}mt===void 0?qe(Ye,L,F,!0):(En[mt-he]=D+1,mt>=vt?vt=mt:ht=!0,I(Ye,w[mt],E,null,L,F,Y,K,j),Oe++)}const ri=ht?pu(En):on;for(ge=ri.length-1,D=Me-1;D>=0;D--){const Ye=he+D,mt=w[Ye],ui=w[Ye+1],ci=Ye+1<ne?ui.el||ea(ui):R;En[D]===0?I(null,mt,E,ci,L,F,Y,K,j):ht&&(ge<0||D!==ri[ge]?Ze(mt,E,ci,2):ge--)}}},Ze=(g,w,E,R,L=null)=>{const{el:F,type:Y,transition:K,children:j,shapeFlag:D}=g;if(D&6){Ze(g.component.subTree,w,E,R);return}if(D&128){g.suspense.move(w,E,R);return}if(D&64){Y.move(g,w,E,Zt);return}if(Y===U){s(F,w,E);for(let G=0;G<j.length;G++)Ze(j[G],w,E,R);s(g.anchor,w,E);return}if(Y===ms){J(g,w,E);return}if(R!==2&&D&1&&K)if(R===0)K.persisted&&!F[oo]?s(F,w,E):(K.beforeEnter(F),s(F,w,E),We(()=>K.enter(F),L));else{const{leave:G,delayLeave:te,afterLeave:ae}=K,he=()=>{g.ctx.isUnmounted?o(F):s(F,w,E)},_e=()=>{const ge=F._isLeaving||!!F[oo];F._isLeaving&&F[oo](!0),K.persisted&&!ge?he():G(F,()=>{he(),ae&&ae()})};te?te(F,he,_e):_e()}else s(F,w,E)},qe=(g,w,E,R=!1,L=!1)=>{const{type:F,props:Y,ref:K,children:j,dynamicChildren:D,shapeFlag:ne,patchFlag:G,dirs:te,cacheIndex:ae,memo:he}=g;if((G===-2||D&&D.hasOnce)&&(L=!1),K!=null&&(Ft(),Bn(K,null,E,g,!0),Nt()),ae!=null&&(!g.ctx||g.ctx===w)&&(w.renderCache[ae]=void 0),ne&256){w.ctx.deactivate(g);return}const _e=ne&1&&te,ge=!Vn(g);let Oe;if(ge&&(Oe=Y&&Y.onVnodeBeforeUnmount)&&yt(Oe,w,g),ne&6)pe(g.component,E,R);else{if(ne&128){g.suspense.unmount(E,R);return}_e&&en(g,null,w,"beforeUnmount"),ne&64?g.type.remove(g,w,E,Zt,R):D&&!D.hasOnce&&(F!==U||G>0&&G&64)?N(D,w,E,!1,!0):(F===U&&G&384||!L&&ne&16)&&N(j,w,E),R&&as(g)}const Me=he!=null&&ae==null;(ge&&(Oe=Y&&Y.onVnodeUnmounted)||_e||Me)&&We(()=>{Oe&&yt(Oe,w,g),_e&&en(g,null,w,"unmounted"),Me&&(g.el=null)},E)},as=g=>{const{type:w,el:E,anchor:R,transition:L}=g;if(w===U){rs(E,R);return}if(w===ms){C(g),L&&!L.persisted&&L.afterLeave&&L.afterLeave();return}const F=()=>{o(E),L&&!L.persisted&&L.afterLeave&&L.afterLeave()};if(g.shapeFlag&1&&L&&!L.persisted){const{leave:Y,delayLeave:K}=L,j=()=>Y(E,F);K?K(g.el,F,j):j()}else F()},rs=(g,w)=>{let E;for(;g!==w;)E=_(g),o(g),g=E;o(w)},pe=(g,w,E)=>{const{bum:R,scope:L,job:F,subTree:Y,um:K,m:j,a:D}=g;Ti(j),Ti(D),R&&hs(R),L.stop(),F?(F.flags|=8,qe(Y,g,w,E)):g.vnode.el&&Y&&(Y.transition=g.vnode.transition,qe(Y,g,w,E)),K&&We(K,w),We(()=>{g.isUnmounted=!0},w)},N=(g,w,E,R=!1,L=!1,F=0)=>{for(let Y=F;Y<g.length;Y++)qe(g[Y],w,E,R,L)},de=g=>{if(g.shapeFlag&6)return de(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const w=_(g.anchor||g.el),E=w&&w[Tr];return E?_(E):w};let et=!1;const Tn=(g,w,E)=>{let R;g==null?w._vnode&&(qe(w._vnode,null,null,!0),R=w._vnode.component):I(w._vnode||null,g,w,null,null,null,E),w._vnode=g,et||(et=!0,yi(R),El(),et=!1)},Zt={p:I,um:qe,m:Ze,r:as,mt:B,mc:b,pc:Q,pbc:q,n:de,o:e};return{render:Tn,hydrate:void 0,createApp:Gr(Tn)}}function lo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function tn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function fu(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ql(e,t,n=!1){const s=e.children,o=t.children;if(se(s)&&se(o))for(let l=0;l<s.length;l++){const a=s[l];let r=o[l];r.shapeFlag&1&&!r.dynamicChildren&&((r.patchFlag<=0||r.patchFlag===32)&&(r=o[l]=Et(o[l]),r.el=a.el),!n&&r.patchFlag!==-2&&Ql(a,r)),r.type===qs&&(r.patchFlag===-1&&(r=o[l]=Et(r)),r.el=a.el),r.type===Rt&&!r.el&&(r.el=a.el)}}function pu(e){const t=e.slice(),n=[0];let s,o,l,a,r;const d=e.length;for(s=0;s<d;s++){const u=e[s];if(u!==0){if(o=n[n.length-1],e[o]<u){t[s]=o,n.push(s);continue}for(l=0,a=n.length-1;l<a;)r=l+a>>1,e[n[r]]<u?l=r+1:a=r;u<e[n[l]]&&(l>0&&(t[s]=n[l-1]),n[l]=s)}}for(l=n.length,a=n[l-1];l-- >0;)n[l]=a,a=t[a];return n}function Zl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Zl(t)}function Ti(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ea(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?ea(t.subTree):null}const ta=e=>e.__isSuspense;function hu(e,t){t&&t.pendingBranch?se(e)?t.effects.push(...e):t.effects.push(e):kr(e)}const U=Symbol.for("v-fgt"),qs=Symbol.for("v-txt"),Rt=Symbol.for("v-cmt"),ms=Symbol.for("v-stc"),rn=[];let Je=null;function h(e=!1){rn.push(Je=e?null:[])}function na(){rn.pop(),Je=rn[rn.length-1]||null}let Jn=1;function Ei(e,t=!1){Jn+=e,e<0&&Je&&t&&(Je.hasOnce=!0)}function sa(e){return e.dynamicChildren=Jn>0?Je||on:null,na(),Jn>0&&Je&&Je.push(e),e}function m(e,t,n,s,o,l){return sa(i(e,t,n,s,o,l,!0))}function Ke(e,t,n,s,o){return sa($e(e,t,n,s,o,!0))}function oa(e){return e?e.__v_isVNode===!0:!1}function On(e,t){return e.type===t.type&&e.key===t.key}const ia=({key:e})=>e??null,ys=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Te(e)||He(e)||re(e)?{i:ze,r:e,k:t,f:!!n}:e:null);function i(e,t=null,n=null,s=0,o=null,l=e===U?0:1,a=!1,r=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&ia(t),ref:t&&ys(t),scopeId:Ol,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:ze};return r?(Cs(d,n),l&128&&e.normalize(d)):n&&(d.shapeFlag|=Te(n)?8:16),Jn>0&&!a&&Je&&(d.patchFlag>0||l&6)&&d.patchFlag!==32&&Je.push(d),d}const $e=vu;function vu(e,t=null,n=null,s=0,o=null,l=!1){if((!e||e===Rl)&&(e=Rt),oa(e)){const r=kn(e,t,!0);return n&&Cs(r,n),Jn>0&&!l&&Je&&(r.shapeFlag&6?Je[Je.indexOf(e)]=r:Je.push(r)),r.patchFlag=-2,r}if(Au(e)&&(e=e.__vccOpts),t){t=mu(t);let{class:r,style:d}=t;r&&!Te(r)&&(t.class=ue(r)),we(d)&&(Jo(d)&&!se(d)&&(d=De({},d)),t.style=Pe(d))}const a=Te(e)?1:ta(e)?128:Vs(e)?64:we(e)?4:re(e)?2:0;return i(e,t,n,s,o,a,l,!0)}function mu(e){return e?Jo(e)||ql(e)?De({},e):e:null}function kn(e,t,n=!1,s=!1){const{props:o,ref:l,patchFlag:a,children:r,transition:d}=e,u=t?yu(o||{},t):o,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&ia(u),ref:t&&t.ref?n&&l?se(l)?l.concat(ys(t)):[l,ys(t)]:ys(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:r,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==U?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&kn(e.ssContent),ssFallback:e.ssFallback&&kn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return d&&s&&Xo(f,d.clone(f)),f}function ee(e=" ",t=0){return $e(qs,null,e,t)}function gs(e,t){const n=$e(ms,null,e);return n.staticCount=t,n}function H(e="",t=!1){return t?(h(),Ke(Rt,null,e)):$e(Rt,null,e)}function _t(e){return e==null||typeof e=="boolean"?$e(Rt):se(e)?$e(U,null,e.slice()):oa(e)?Et(e):$e(qs,null,String(e))}function Et(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:kn(e)}function Cs(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(se(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Cs(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!ql(t)?t._ctx=ze:o===3&&ze&&(ze.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(re(t)){if(s&65){Cs(e,{default:t});return}t={default:t,_ctx:ze},n=32}else t=String(t),s&64?(n=16,t=[ee(t)]):n=8;e.children=t,e.shapeFlag|=n}function yu(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=ue([t.class,s.class]));else if(o==="style")t.style=Pe([t.style,s.style]);else if(Ls(o)){const l=t[o],a=s[o];a&&l!==a&&!(se(l)&&l.includes(a))?t[o]=l?[].concat(l,a):a:a==null&&l==null&&!Ds(o)&&(t[o]=a)}else o!==""&&(t[o]=s[o])}return t}function yt(e,t,n,s=null){ct(e,t,7,[n,s])}const gu=jl();let bu=0;function wu(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||gu,l={uid:bu++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new qa(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:zl(s,o),emitsOptions:Bl(s,o),emit:null,emitted:null,propsDefaults:ke,inheritAttrs:s.inheritAttrs,ctx:ke,data:ke,props:ke,attrs:ke,slots:ke,refs:ke,setupState:ke,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=Qr.bind(null,l),e.ce&&e.ce(l),l}let Ne=null;const _u=()=>Ne||ze;let As,Gn;{const e=Hs(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),l=>{o.length>1?o.forEach(a=>a(l)):o[0](l)}};As=t("__VUE_INSTANCE_SETTERS__",n=>Ne=n),Gn=t("__VUE_SSR_SETTERS__",n=>Xn=n)}const os=e=>{const t=Ne;return As(e),e.scope.on(),()=>{e.scope.off(),As(t)}},Pi=()=>{Ne&&Ne.scope.off(),As(null)};function la(e){return e.vnode.shapeFlag&4}let Xn=!1;function ku(e,t=!1,n=!1){t&&Gn(t);const{props:s,children:o}=e.vnode,l=la(e);ou(e,s,l,t),ru(e,o,n||t);const a=l?$u(e,t):void 0;return t&&Gn(!1),a}function $u(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Vr);const{setup:s}=n;if(s){Ft();const o=e.setupContext=s.length>1?Su(e):null,l=os(e),a=ss(s,e,0,[e.props,o]),r=il(a);if(Nt(),l(),(r||e.sp)&&!Vn(e)&&Dl(e),r){if(a.then(Pi,Pi),t)return a.then(d=>{Gn(!0);try{Oi(e,d,t)}finally{Gn(!1)}}).catch(d=>{js(d,e,0)});e.asyncDep=a}else Oi(e,a)}else aa(e)}function Oi(e,t,n){re(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:we(t)&&(e.setupState=Cl(t)),aa(e)}function aa(e,t,n){const s=e.type;e.render||(e.render=s.render||$t);{const o=os(e);Ft();try{Wr(e)}finally{Nt(),o()}}}const xu={get(e,t){return Fe(e,"get",""),e[t]}};function Su(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,xu),slots:e.slots,emit:e.emit,expose:t}}function Ys(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Cl(fr(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Wn)return Wn[n](e)},has(t,n){return n in t||n in Wn}})):e.proxy}function Cu(e,t=!0){return re(e)?e.displayName||e.name:e.name||t&&e.__name}function Au(e){return re(e)&&"__vccOpts"in e}const k=(e,t)=>yr(e,t,Xn),Tu="3.5.43";let To;const Ii=typeof window<"u"&&window.trustedTypes;if(Ii)try{To=Ii.createPolicy("vue",{createHTML:e=>e})}catch{}const ra=To?e=>To.createHTML(e):e=>e,Eu="http://www.w3.org/2000/svg",Pu="http://www.w3.org/1998/Math/MathML",Tt=typeof document<"u"?document:null,Mi=Tt&&Tt.createElement("template"),Ou={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?Tt.createElementNS(Eu,e):t==="mathml"?Tt.createElementNS(Pu,e):n?Tt.createElement(e,{is:n}):Tt.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Tt.createTextNode(e),createComment:e=>Tt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Tt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,l){const a=n?n.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===l||!(o=o.nextSibling)););else{Mi.innerHTML=ra(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const r=Mi.content;if(s==="svg"||s==="mathml"){const d=r.firstChild;for(;d.firstChild;)r.appendChild(d.firstChild);r.removeChild(d)}t.insertBefore(r,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Iu=Symbol("_vtc");function Mu(e,t,n){const s=e[Iu];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Li=Symbol("_vod"),Lu=Symbol("_vsh"),Du=Symbol(""),Fu=/(?:^|;)\s*display\s*:/;function Nu(e,t,n){const s=e.style,o=Te(n);let l=!1;if(n&&!o){if(t)if(Te(t))for(const a of t.split(";")){const r=a.slice(0,a.indexOf(":")).trim();n[r]==null&&Dn(s,r,"")}else for(const a in t)n[a]==null&&Dn(s,a,"");for(const a in n){a==="display"&&(l=!0);const r=n[a];r!=null?Hu(e,a,!Te(t)&&t?t[a]:void 0,r)||Dn(s,a,r):Dn(s,a,"")}}else if(o){if(t!==n){const a=s[Du];a&&(n+=";"+a),s.cssText=n,l=Fu.test(n)}}else t&&e.removeAttribute("style");Li in e&&(e[Li]=l?s.display:"",e[Lu]&&(s.display="none"))}const fs=/\s*!important$/;function Dn(e,t,n){if(se(n))n.forEach(s=>Dn(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))fs.test(n)?e.setProperty(t,n.replace(fs,""),"important"):e.setProperty(t,n);else{const s=Ru(e,t);fs.test(n)?e.setProperty(Qt(s),n.replace(fs,""),"important"):e[s]=n}}const Di=["Webkit","Moz","ms"],ao={};function Ru(e,t){const n=ao[t];if(n)return n;let s=Ve(t);if(s!=="filter"&&s in e)return ao[t]=s;s=Ns(s);for(let o=0;o<Di.length;o++){const l=Di[o]+s;if(l in e)return ao[t]=l}return t}function Hu(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Te(s)&&n===s}const Fi="http://www.w3.org/1999/xlink";function Ni(e,t,n,s,o,l=Va(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Fi,t.slice(6,t.length)):e.setAttributeNS(Fi,t,n):n==null||l&&!ul(n)?e.removeAttribute(t):e.setAttribute(t,l?"":xt(n)?String(n):n)}function Ri(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ra(n):n);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const r=l==="OPTION"?e.getAttribute("value")||"":e.value,d=n==null?e.type==="checkbox"?"on":"":String(n);(r!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let a=!1;if(n===""||n==null){const r=typeof e[t];r==="boolean"?n=ul(n):n==null&&r==="string"?(n="",a=!0):r==="number"&&(n=0,a=!0)}try{e[t]=n}catch{}a&&e.removeAttribute(o||t)}function Mt(e,t,n,s){e.addEventListener(t,n,s)}function Uu(e,t,n,s){e.removeEventListener(t,n,s)}const Hi=Symbol("_vei");function ju(e,t,n,s,o=null){const l=e[Hi]||(e[Hi]={}),a=l[t];if(s&&a)a.value=s;else{const[r,d]=Wu(t);if(s){const u=l[t]=Yu(s,o);Mt(e,r,u,d)}else a&&(Uu(e,r,a,d),l[t]=void 0)}}const Bu=/(Once|Passive|Capture)$/,Vu=/^on:?(?:Once|Passive|Capture)$/;function Wu(e){let t,n;for(;(n=e.match(Bu))&&!Vu.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Qt(e.slice(2)),t]}let ro=0;const Ku=Promise.resolve(),qu=()=>ro||(Ku.then(()=>ro=0),ro=Date.now());function Yu(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(se(o)){const l=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{l.call(s),s._stopped=!0};const a=o.slice(),r=[s];for(let d=0;d<a.length&&!s._stopped;d++){const u=a[d];u&&ct(u,t,5,r)}}else ct(o,t,5,[s])};return n.value=e,n.attached=qu(),n}const Ui=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zu=(e,t,n,s,o,l)=>{const a=o==="svg";t==="class"?Mu(e,s,a):t==="style"?Nu(e,n,s):Ls(t)?Ds(t)||ju(e,t,n,s,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Ju(e,t,s,a))?(Ri(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ni(e,t,s,a,l,t!=="value")):e._isVueCE&&(Gu(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Te(s)))?Ri(e,Ve(t),s,l,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),Ni(e,t,s,a))};function Ju(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ui(t)&&re(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Ui(t)&&Te(n)?!1:t in e}function Gu(e,t){const n=e._def.props;if(!n)return!1;const s=Ve(t);return Array.isArray(n)?n.some(o=>Ve(o)===s):Object.keys(n).some(o=>Ve(o)===s)}const Gt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return se(t)?n=>hs(t,n):t};function Xu(e){e.target.composing=!0}function ji(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ge=Symbol("_assign"),ps=Symbol("_initialValue");function uo(e,t,n){return t&&(e=e.trim()),n&&(e=Rs(e)),e}const Ie={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[ps]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[ps]=e.defaultValue.replace(/\r\n?/g,`
|
||
`))),e[Ge]=Gt(o);const l=s||o.props&&o.props.type==="number";Mt(e,t?"change":"input",a=>{a.target.composing||e[Ge](uo(e.value,n,l))}),(n||l)&&Mt(e,"change",()=>{e.value=uo(e.value,n,l)}),t||(Mt(e,"compositionstart",Xu),Mt(e,"compositionend",ji),Mt(e,"change",ji))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",l=e[ps];delete e[ps],l!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==l?e[Ge](uo(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:l}},a){if(e[Ge]=Gt(a),e.composing)return;const r=(l||e.type==="number")&&!/^0\d/.test(e.value)?Rs(e.value):e.value,d=t??"";if(r===d)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===d)||(e.value=d)}},Qu={deep:!0,created(e,t,n){e[Ge]=Gt(n),Mt(e,"change",()=>{const s=e._modelValue,o=$n(e),l=e.checked,a=e[Ge];if(se(s)){const r=Bo(s,o),d=r!==-1;if(l&&!d)a(s.concat(o));else if(!l&&d){const u=[...s];u.splice(r,1),a(u)}}else if(Dt(s)){const r=new Set(s);l?r.add(o):r.delete(o),a(r)}else a(ua(e,l))})},mounted:Bi,beforeUpdate(e,t,n){e[Ge]=Gt(n),Bi(e,t,n)}};function Bi(e,{value:t,oldValue:n},s){e._modelValue=t;let o;if(se(t))o=Bo(t,s.props.value)>-1;else if(Dt(t))o=t.has(s.props.value);else{if(t===n)return;o=ut(t,ua(e,!0))}e.checked!==o&&(e.checked=o)}const Vi={created(e,{value:t},n){e.checked=ut(t,n.props.value),e[Ge]=Gt(n),Mt(e,"change",()=>{e[Ge]($n(e))})},beforeUpdate(e,{value:t,oldValue:n},s){e[Ge]=Gt(s),t!==n&&(e.checked=ut(t,s.props.value))}},un={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Mt(e,"change",()=>{const o=Array.prototype.filter.call(e.options,d=>d.selected).map(d=>n?Rs($n(d)):$n(d)),l=e.multiple,a=l?Dt(e._modelValue)?new Set(o):o:o[0],r=e._pendingValue=[l,l?se(a)?o.slice():o:a];try{e[Ge](a)}finally{Bs(()=>{e._pendingValue===r&&(e._pendingValue=void 0)})}}),e[Ge]=Gt(s)},mounted(e,{value:t}){Wi(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Ge]=Gt(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Zu(t,n[1],n[0]))&&Wi(e,t)}};function Zu(e,t,n){if(!n||se(e))return ut(e,t);if(Dt(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function Wi(e,t){const n=e.multiple,s=se(t);if(!(n&&!s&&!Dt(t))){for(let o=0,l=e.options.length;o<l;o++){const a=e.options[o],r=$n(a);if(n)if(s){const d=typeof r;d==="string"||d==="number"?a.selected=t.some(u=>String(u)===String(r)):a.selected=Bo(t,r)>-1}else a.selected=t.has(r);else if(ut($n(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $n(e){return"_value"in e?e._value:e.value}function ua(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const ec=["ctrl","shift","alt","meta"],tc={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>ec.some(n=>e[`${n}Key`]&&!t.includes(n))},it=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=((o,...l)=>{for(let a=0;a<t.length;a++){const r=tc[t[a]];if(r&&r(o,t))return}return e(o,...l)}))},nc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ca=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=(o=>{if(!("key"in o))return;const l=Qt(o.key);if(t.some(a=>a===l||nc[a]===l))return e(o)}))},sc=De({patchProp:zu},Ou);let Ki;function oc(){return Ki||(Ki=cu(sc))}const ic=((...e)=>{const t=oc().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=ac(s);if(!o)return;const l=t._component;!re(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=n(o,!1,lc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function lc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ac(e){return Te(e)?document.querySelector(e):e}const rc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],uc=["Su","Mo","Tu","We","Th","Fr","Sa"],da={clock:"clock-outline",analog:"clock-outline",date:"calendar"},je=e=>JSON.stringify(e),be=e=>String.fromCodePoint(parseInt(e,16));function ti(e,t=new Date){let n=t.getHours();return e||(n=n%12||12),`${String(n).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}const ni=(e=new Date)=>`${uc[e.getDay()]} ${e.getDate()} ${rc[e.getMonth()]}`;function cc(e,t=Math.floor(Date.now()/1e3)){const n=t-e,s=Math.abs(n),o=l=>Math.floor(s/l);return n<0?s<3600?`In ${Math.max(1,o(60))} min`:s<86400?o(3600)===1?"In 1 hour":`In ${o(3600)} hours`:s<172800?"Tomorrow":`In ${o(86400)} days`:s<60?"Just now":s<3600?`${o(60)} min ago`:s<86400?o(3600)===1?"1 hour ago":`${o(3600)} hours ago`:s<172800?"Yesterday":s<604800?`${o(86400)} days ago`:s<2592e3?o(604800)===1?"1 week ago":`${o(604800)} weeks ago`:s<31536e3?o(2592e3)===1?"1 month ago":`${o(2592e3)} months ago`:o(31536e3)===1?"1 year ago":`${o(31536e3)} years ago`}const dc={guition:{width:448,top:36,name:27,text:21,icon:26},cyd:{width:298,top:24,name:18,text:14,icon:18}};let In;const Eo=new Map,fc=()=>Eo.clear();function sn(e,t){const n=`${t}|${e}`;let s=Eo.get(n);if(!s){if(In===void 0&&(In=document.createElement("canvas").getContext("2d")),In){In.font=t;const o=In.measureText(e);s={left:-o.actualBoundingBoxLeft,right:o.actualBoundingBoxRight,top:-o.actualBoundingBoxAscent,bottom:o.actualBoundingBoxDescent,advance:o.width}}else{const o=Number(/(\d+(?:\.\d+)?)px/.exec(t)?.[1]||14),l=[...e].length*o*.55;s={left:0,right:l,top:-o*.72,bottom:o*.02,advance:l}}Eo.set(n,s)}return s}const pc=e=>({name:`500 ${e.name}px "Bar Roboto"`,text:`400 ${e.text}px "Bar Roboto"`,icon:`${e.icon}px "Tile Icons"`});function hc(e){return{icon:Math.max(2,Math.floor((e*4+5)/10)),item:Math.max(6,Math.floor((e*125+50)/100)),name:Math.max(8,Math.floor((e*16+5)/10))}}function fa(e,t,n,s){const o=pc(t),l=sn("0",o.text),a=Math.round(l.bottom-l.top),r=hc(a),d=sn(String.fromCodePoint(983376),o.icon),u=Math.round(d.bottom-d.top),f=e.map((C,z)=>{const P=s(C),S={index:z,item:C,view:P,shown:P.shown,width:0};return P.analog?(S.dial=u,S.width=u,S):(P.icon&&(S.icon={glyph:be(P.icon),ink:sn(be(P.icon),o.icon)},S.width+=S.icon.ink.right-S.icon.ink.left),P.text&&(S.text={value:P.text,ink:sn(P.text,o.text)},S.width+=(S.icon?r.icon:0)+S.text.ink.right-S.text.ink.left),S)}),p=f.filter(C=>C.shown),_=sn(n,o.name).advance,T=Math.min(_,Math.floor(t.width*35/100)),M=C=>C.reduce((z,P)=>z+P.width,0)+Math.max(0,C.length-1)*r.item;let I=0;for(;I<p.length&&M(p.slice(I))+r.name+T>t.width;)I++;const $=p.slice(I),x=new Set(p.slice(0,I).map(C=>C.index));let O=t.width-M($);for(const C of $)C.x=O,O+=C.width+r.item;const J=$.length?$[0].x-r.name:t.width;return{metrics:t,fonts:o,cap:a,zero:l,gaps:r,parts:f,placed:$,dropped:x,nameText:n,natural:_,nameRoom:J}}function vc(e,t,n){if(sn(e,t).advance<=n)return e;const s=[...e];for(;s.length&&sn(s.join("")+"...",t).advance>n;)s.pop();return s.join("")+"..."}function mc(e){"fonts"in document&&Promise.all([document.fonts.load('500 27px "Bar Roboto"',"Studio 0"),document.fonts.load('400 21px "Bar Roboto"',"Away 0"),document.fonts.load('26px "Tile Icons"',String.fromCodePoint(983376))]).then(()=>{fc(),e()}).catch(()=>{})}let pa="";function yc(e){pa=e||""}async function si(e,t={}){const n=await fetch(`api/${e}`,{...t,headers:{"Content-Type":"application/json","X-Screen-CSRF":pa,...t.headers}});if(!n.ok){let s="That didn't work. Refresh the page and try again.";try{s=(await n.json()).error||s}catch{}throw new Error(s)}return n}const dt=async e=>(await si(e)).json(),Xe=async(e,t,n,s={})=>{const l=await(await si(e,{method:t,body:n===void 0?void 0:JSON.stringify(n),...s})).text();return l?JSON.parse(l):null},Lt=6,xn=8,oi=xn*Lt,st=e=>e.options?.size==="wide",Kn=(e,t)=>t?[e,e+1]:[e],Po=e=>e-e%2,Ts=e=>Math.floor(e/Lt),ft=e=>e.tiles.map(t=>({tile:t,slot:t.slot}));function ha(e){let t=0;return e.map(n=>{const s=st(n);s&&t%2===1&&t++;const o=t;return t+=s?2:1,o})}function gc(e){const t=ha(e);return e.some((n,s)=>n.slot!==t[s])}function zs(e){if(e.tiles.some(t=>!Number.isInteger(t.slot))){const t=ha(e.tiles);e.tiles.forEach((n,s)=>n.slot=t[s])}e.tiles.sort((t,n)=>t.slot-n.slot)}function ii(e){const t=new Set;for(const{tile:n,slot:s}of e)for(const o of Kn(s,st(n)))t.add(o);return t}const Qn=(e,t,n)=>Number.isInteger(t)&&t>=0&&t+(n?1:0)<oi&&!(n&&t%2)&&Kn(t,n).every(s=>!e.has(s));function bc(e,t){for(let n=0;n<oi;n++)if(Qn(e,n,t))return n;return-1}function va(e,t,n){let s=-1;for(let o=0;o<oi;o++)Qn(e,o,t)&&(s<0||Math.abs(o-n)<=Math.abs(s-n))&&(s=o);return s}function ma(e,t,n){const s=st(t);if(s&&(n=Po(n)),!Qn(new Set,n,s))return null;const o=Kn(n,s),l=e.includes(t)?Kn(t.slot,s):[],a=[{tile:t,slot:n}],r=[];for(const d of e)d!==t&&(Kn(d.slot,st(d)).some(u=>o.includes(u))?r.push(d):a.push({tile:d,slot:d.slot}));for(const d of r){const u=st(d),f=ii(a);let p=l.map(_=>u?Po(_):_).find(_=>Qn(f,_,u));if(p===void 0&&(p=va(f,u,d.slot)),p<0)return null;a.push({tile:d,slot:p})}return a.sort((d,u)=>d.slot-u.slot)}function jt(e,t=1){const n=Math.max(0,...e.map(({tile:s,slot:o})=>o+(st(s)?2:1)));return Math.min(xn,Math.max(1,Math.ceil(n/Lt),t||1))}function wc(e){const t=e.split(".")[0];return t==="sun"?{options:{display:"sunpath",size:"wide"}}:t==="weather"?{options:{display:"forecast",size:"wide"}}:t==="screen"?{options:{display:"digital",size:"wide"}}:{}}const ya=e=>({entity:e,name:"",slot:-1,...wc(e)});function ga(e,t){const n=e.entity.split(".")[0],s=t.controls?.[n],o=e.options||{};if(!s||o.size!=="wide"||(o.display||"standard")!=="standard"||o.inline==="slider")return null;const l=o.controls??s.default;return l==="none"?null:l}function _c(e,t){const n=ga(e,t);return n?t.controls?.[e.entity.split(".")[0]]?.choices.find(s=>s.key===n)?.label.toLocaleLowerCase()||n:"none"}const Oo=e=>(/^(\d+)\.(\d+)\.(\d+)$/.exec(e||"")||[]).slice(1).map(Number);function Sn(e,t){const[n,s]=[Oo(e),Oo(t)];if(n.length!==3||s.length!==3)return!1;for(let o=0;o<3;o++)if(n[o]!==s[o])return n[o]>s[o];return!0}const kc=(e,t,n,s)=>Sn(e,`${t}.${n}.${s}`);function $c(e){const t=Oo(e);return t.length!==3?10:t[0]>0||t[1]>2||t[1]===2&&t[2]>=7?20:10}const ba={standard:"standard",watch:"large value",forecast:"weather forecast",graph:"graph",digital:"digital clock",analog:"analog clock",sunpath:"sun path"},qi=["light","switch","input_boolean","fan","media_player","climate"],xc=["light","fan","cover","number","input_number","media_player"],Sc={light:["Light","☀","#ad7600","#fff3d3"],climate:["Climate","❄","#c86620","#ffebdc"],vacuum:["Vacuum","◉","#008577","#def3ed"],fan:["Fan","✣","#008aab","#def5fa"],cover:["Cover","▤","#8053af","#eee5f8"],media_player:["Media","▶","#007cad","#def2fc"],sensor:["Sensor","⌁","#3476b1","#e5effa"],binary_sensor:["Status","◈","#ad7600","#fff3d3"],switch:["Switch","⏻","#ad7600","#fff3d3"],input_boolean:["Switch","⏻","#ad7600","#fff3d3"],scene:["Scene","✦","#8053af","#eee5f8"],script:["Script","▷","#8053af","#eee5f8"],weather:["Weather","☁","#007cad","#def2fc"],number:["Value","±","#008577","#def3ed"],input_number:["Value","±","#008577","#def3ed"],select:["Select","≡","#5862af","#eaecfa"],input_select:["Select","≡","#5862af","#eaecfa"],button:["Action","↗","#5862af","#eaecfa"],input_button:["Action","↗","#5862af","#eaecfa"],screen:["Clock","◷","#25282c","#e9ecf1"],sun:["Sun","☼","#c86620","#ffebdc"],timer:["Timer","⏱","#008577","#def3ed"],person:["Person","☺","#2f7d32","#e1f2e2"],camera:["Camera","◧","#3d4a57","#e6ebf0"],image:["Image","◧","#3d4a57","#e6ebf0"]},bt=e=>Sc[e.split(".")[0]]||["Entity","◇","#637184","#edf0f4"],c=fn({inventory:{screens:[],entities:[]},connected:!1,reachable:!0,selected:null,layout:null,dirty:!1,busy:!1,saved:0,tab:"layout",selectedTile:null,inspector:null,iconPickerOpen:!1,actionPickerOpen:!1,actionSearch:"",insertAt:-1,filter:"",search:"",capabilities:{},entityActions:{},topbarPreviews:{},topbarAdded:null,topbarOverflow:[],settingEdits:{},settingPending:!1,updating:[],toast:null,now:Date.now(),fontsVersion:0,route:location.hash,overrideProfile:null,overrideFriendly:"",drag:{active:!1,moving:null,preview:null},menuOpen:!1,liveStates:{},room:"",hidePlaced:!1,palette:!1,firmwareJob:null}),Ct=k(()=>c.inventory.screens.find(e=>e.id===c.selected)),wa=k(()=>Ct.value?.firmware||""),wn=(e,t,n)=>kc(wa.value,e,t,n),cn=k(()=>$c(wa.value)),li=k(()=>Ct.value?.board==="guition"),_a=k(()=>dc[li.value?"guition":"cyd"]),co=k(()=>c.selectedTile&&c.layout?c.layout.tiles.find(e=>e.entity===c.selectedTile):void 0);let Yi=0;function Se(e,t){c.toast={message:e,action:t},clearTimeout(Yi),Yi=window.setTimeout(()=>c.toast=null,t?8e3:5e3)}function Cc(){c.toast=null}async function lt(e,t,n="API key"){try{if(!navigator.clipboard||!window.isSecureContext)throw new Error;await navigator.clipboard.writeText(e),Se(`${n} copied.`)}catch{if(t){const s=document.createRange();s.selectNodeContents(t);const o=window.getSelection();o?.removeAllRanges(),o?.addRange(s)}Se(document.execCommand("copy")?`${n} copied.`:`${n} is selected. Copy with Ctrl+C or Command+C.`)}}function Es(){const e="/config/integrations/dashboard";try{window.top.location.assign(e)}catch{window.open(e,"_blank")}}const Ac=["","#settings","#new-screen","#firmware","#alerts","#override"],tt=k(()=>Ac.includes(c.route)?c.route:"");function Ae(e){if(location.hash===e){c.route=e;return}location.hash=e}window.addEventListener("hashchange",()=>{c.route=location.hash,window.scrollTo(0,0)});function is(e){return c.inventory.entities.find(t=>t.id===e)?.name||c.inventory.builtin?.find(t=>t.id===e)?.name||e}let fo={source:null,byName:{}};function ls(e){return fo.source!==c.inventory.icons&&(fo={source:c.inventory.icons,byName:Object.fromEntries((c.inventory.icons?.groups||[]).flatMap(t=>t.icons.map(n=>[n.name,n])))}),e?fo.byName[e]:void 0}function Xt(e){const t=c.inventory.icons;if(!t)return"F0335";const n=c.inventory.entities.find(o=>o.id===e),s=e.split(".")[0];return t.builtin?.[e]?t.builtin[e]:n?.icon?n.icon:s==="weather"?t.weather[n?.state||""]||t.weather.partlycloudy:s==="sun"?t.sun[n?.state||""]||t.sun.below_horizon:t.defaults[s]||t.fallback}const bs=e=>ls(e.options?.icon)?.cp||Xt(e.entity),po=new Set;async function Js(e){const t=[...new Set(e)].filter(n=>!po.has(n)&&!n.startsWith("screen."));if(t.length){t.forEach(n=>po.add(n));try{for(let n=0;n<t.length;n+=40){const s=t.slice(n,n+40).map(o=>`entity=${encodeURIComponent(o)}`).join("&");Object.assign(c.capabilities,(await dt(`capabilities?${s}`)).capabilities||{})}}catch{t.forEach(n=>po.delete(n))}}}const ho=new Set;async function Tc(e){if(!ho.has(e)){ho.add(e);try{c.entityActions[e]=(await dt(`entity-actions?entity=${encodeURIComponent(e)}`)).actions}catch{ho.delete(e)}}}let vo=!1;async function Gs(){const e=[...new Set((c.layout?.tiles||[]).map(t=>t.entity).filter(t=>!t.startsWith("screen.")))];if(!(!e.length||vo)){vo=!0;try{for(let t=0;t<e.length;t+=60){const n=e.slice(t,t+60).map(s=>`entity=${encodeURIComponent(s)}`).join("&");Object.assign(c.liveStates,(await dt(`states?${n}`)).states||{})}}catch{}finally{vo=!1}}}function Ec(e){const t=c.liveStates[e];if(t)return t;const n=c.inventory.entities.find(s=>s.id===e);return n?.state?{state:n.state,word:null,a:{}}:null}function Qe(){c.dirty=!0,c.saved=0}function ka(e){if(e!==c.selected&&c.dirty&&!confirm("You have unsaved changes. Open a different screen anyway?"))return;e!==c.selected&&(es(),c.settingEdits={}),c.selected=e,c.selectedTile=null,c.inspector=null,c.tab="layout",c.menuOpen=!1;const t=c.inventory.screens.find(s=>s.id===e);if(!t){c.layout=null;return}const n=JSON.parse(JSON.stringify(t.layout));zs(n),n.pages=jt(ft(n),n.pages),c.layout=n,c.insertAt=-1,c.dirty=!1,c.saved=0,Qs(0),Js(n.tiles.map(s=>s.entity)),Gs(),Ae("")}function Pc(e){const t=c.layout,n=t.tiles.map(o=>`${o.entity}@${o.slot}`).join();for(const{tile:o,slot:l}of e)o.slot=l,t.tiles.includes(o)||t.tiles.push(o);zs(t),t.pages=jt(ft(t),t.pages);const s=t.tiles.map(o=>`${o.entity}@${o.slot}`).join()!==n;return s&&Qe(),s}function Xs(e,t){if(!c.layout)return!1;Js([e.entity]);const n=ma(c.layout.tiles,e,t),s=n?Pc(n):!1;return s&&!c.liveStates[e.entity]&&Gs(),s}function $a(e){const t=c.layout;if(!t||t.tiles.some(o=>o.entity===e)||t.tiles.length>=cn.value)return;const n=ya(e),s=c.insertAt>=0?c.insertAt:bc(ii(ft(t)),st(n));c.insertAt=-1,s>=0&&Xs(n,s)&&Io(e)}function xa(e){const t=c.layout;if(!t)return;const n=t.tiles.indexOf(e);n<0||(t.tiles.splice(n,1),c.selectedTile===e.entity&&Re(),Qe(),t.pages=jt(ft(t),t.pages),Se(`${e.name||is(e.entity)} removed`,{label:"Undo",run:()=>Xs(e,e.slot)}))}function zi(){const e=c.layout;e&&(e.pages=Math.min(xn,jt(ft(e),e.pages)+1),Qe())}function Oc(e){const t=c.layout;if(t){for(const n of t.tiles)Ts(n.slot)>e&&(n.slot-=Lt);t.pages=Math.max(1,jt(ft(t),t.pages)-1),Qe()}}function Ic(){const e=c.layout;if(!e)return 1;const t=c.drag.preview||ft(e),n=jt(t,e.pages);return c.drag.active&&n<xn?n+1:n}function Bt(e,t,n){const s=e.entity.split(".")[0],o=c.capabilities[e.entity],l=st(e);e.options={...e.options,[t]:n},t==="display"&&n==="watch"&&(e.options.inline="none",c.inventory.controls?.[s]&&(e.options.controls="none")),t==="display"&&["forecast","sunpath"].includes(n)&&(e.options.size="wide"),t==="inline"&&n==="slider"&&(e.options.display="standard",c.inventory.controls?.[s]&&(e.options.controls="none")),t==="controls"&&n!=="none"&&(e.options.display="standard",e.options.inline="none");const a=c.inventory.controls?.[s];if(t==="size"&&n==="wide"&&o&&a&&!("controls"in e.options)&&!o.controls.includes(a.default)&&(e.options.controls=a.choices.find(r=>r.key!=="none"&&o.controls.includes(r.key))?.key||"none"),Qe(),c.layout&&st(e)&&!l){const r=ii(ft(c.layout).filter(f=>f.tile!==e)),d=Po(e.slot),u=Qn(r,d,!0)?d:va(r,!0,d);u>=0&&(e.slot=u),zs(c.layout),c.layout.pages=jt(ft(c.layout),c.layout.pages)}}function Io(e){c.selectedTile!==e&&(c.iconPickerOpen=!1,c.actionPickerOpen=!1,c.actionSearch=""),c.selectedTile=e,c.inspector={kind:"tile"},Js([e])}function Pt(e){c.inspector?.kind==="bar"&&c.inspector.index===e||(c.iconPickerOpen=!1),c.selectedTile=null,c.inspector={kind:"bar",index:e}}function Ji(){c.selectedTile=null,c.inspector={kind:"bar-add"}}function Re(){c.inspector=null,c.selectedTile=null}async function Mo(){if(!(c.busy||!c.layout||!c.selected)){c.busy=!0;try{const{settings:e,...t}=c.layout;await Xe(`screens/${encodeURIComponent(c.selected)}`,"PUT",t),c.dirty=!1,c.saved=Date.now(),Se("Saved. Your screen is being updated."),await pn()}catch(e){Se(e.message)}finally{c.busy=!1}}}const dn=e=>!!(e&&e.alert_action&&Sn(e.firmware,c.inventory.alerts?.min_firmware||"0.2.31"));async function Sa(e){try{await Xe(`screens/${encodeURIComponent(e.id)}/identify`,"POST"),Se(`${e.name} blinks and shows a card for a few seconds.`)}catch(t){Se(t.message)}}async function Mc(e,t){return await Xe("alerts/test","POST",{screen:e,data:t})}const Lc=["title","tiles","header","pages"];function Ca(e,t){const n=c.layout;if(!n)return;const s=(Array.isArray(e.tiles)?e.tiles:[]).filter(r=>!!(r&&typeof r=="object"&&typeof r.entity=="string"&&r.entity.includes("."))).map(r=>({entity:r.entity,name:typeof r.name=="string"?r.name:"",slot:Number.isInteger(r.slot)?r.slot:-1,...r.options&&typeof r.options=="object"?{options:{...r.options}}:{}})),o=new Set,l=s.filter(r=>!o.has(r.entity)&&o.add(r.entity)),a=l.slice(0,cn.value);n.tiles=a,e.header&&Array.isArray(e.header.items)?n.header={items:e.header.items.map(r=>({...r}))}:delete n.header,n.pages=Number.isInteger(e.pages)?e.pages:1,zs(n),n.pages=jt(ft(n),n.pages),Re(),Qe(),Js(a.map(r=>r.entity)),Gs(),Qs(0),Se(a.length<l.length?`${t}: ${a.length} of ${l.length} tiles fit this screen's firmware. Save & send when it looks right.`:`${t}. Save & send when it looks right.`)}function Dc(e){const t=c.inventory.screens.find(n=>n.id===e);!t||!c.layout||Ca(JSON.parse(JSON.stringify(t.layout)),`Layout of ${t.name} copied`)}function Fc(){const e=c.layout;if(!e)return"";const t={esp_screens_layout:1};for(const n of Lc)e[n]!==void 0&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Aa(){const e=Fc();if(!e)return;const t=`${(Ct.value?.name||"screen").toLowerCase().replace(/[^a-z0-9]+/g,"-")}.layout.json`,n=URL.createObjectURL(new Blob([e],{type:"application/json"})),s=document.createElement("a");s.href=n,s.download=t,s.click(),setTimeout(()=>URL.revokeObjectURL(n),5e3),lt(e,void 0,"Layout JSON")}function Nc(e){let t;try{t=JSON.parse(e)}catch{Se("That isn't JSON. Export a layout first, or paste one from another ESP Screens.");return}if(!t||typeof t!="object"||!Array.isArray(t.tiles)){Se("No tiles in this file. Expected a layout exported from ESP Screens.");return}Ca(t,"Layout imported")}function Gi(e){const t=c.inventory.updates?.target,n=c.inventory.updates?.changelog;if(!n||!t)return[];const s=e.firmware,o=[];for(const l of n)if(!(Sn(l.firmware,t)&&l.firmware!==t)&&!(s&&Sn(s,l.firmware)))for(const a of l.lines)o.includes(a)||o.push(a);return o}let mo=!1;async function Rc(){if(!mo){mo=!0;try{const e=await dt("firmware");c.firmwareJob={job:e.job,logs:e.logs||[]}}catch{}finally{mo=!1}}}const Lo=()=>c.inventory.screens.some(e=>e.update?.state==="running")||c.updating.length>0;function yn(e){const t=e.update||{};if(!(t.state==="running"||c.updating.includes(e.id)))return null;const n=c.firmwareJob?.job?.stage;return t.phase==="verify"?{percent:78,text:Rn.verify}:t.phase==="settle"?{percent:92,text:Rn.settle}:t.phase==="install"||!t.phase?n==="upload"?{percent:66,text:"Writing the firmware over Wi-Fi…"}:n?{percent:40,text:"Building the firmware…"}:{percent:12,text:Rn.install}:{percent:12,text:Rn[t.phase]||"Starting update…"}}const Ht=()=>c.layout?.header?.items??(c.layout?.settings?.show_clock??!0?[{type:"clock"}]:[]),Kt=()=>c.inventory.header?.max_items||6;function Zn(e){c.layout&&(c.layout.header={items:e},Qe(),Qs())}let Xi=0;function Qs(e=150){clearTimeout(Xi),Xi=window.setTimeout(async()=>{const t=Ht();if(t.some(n=>n.type==="entity"))try{const n=await Xe("header-preview","POST",{header:{items:t}});t.forEach((s,o)=>c.topbarPreviews[je(s)]=n.items[o])}catch{}},e)}function Fn(e){return e.type==="entity"?is(e.entity):c.inventory.header?.builtin.find(t=>t.type===e.type)?.label||e.type}function Vt(e){const t=new Date(c.now);if(e.type==="clock")return{text:ti(Cn().clock_24h!==!1,t),shown:!0};if(e.type==="date")return{text:ni(t),shown:!0};if(e.type==="analog")return{analog:!0,shown:!0};const n=c.topbarPreviews[je(e)];return n?{icon:n.i||null,text:n.k==="ago"?cc(n.e,Math.floor(c.now/1e3)):n.t,color:n.c?`#${n.c}`:null,shown:n.shown}:{icon:e.icon==="none"?null:ls(e.icon)?.cp||Xt(e.entity),text:"…",shown:!0,loading:!0}}function yo(e,t){const n=[...Ht()];return t<0||t>=n.length||e===t?!1:(n.splice(t,0,...n.splice(e,1)),Zn(n),!0)}function Qi(e){const t=[...Ht()],[n]=t.splice(e,1);n&&(c.inspector?.kind==="bar"&&Re(),Zn(t),Se(`${Fn(n)} removed from the top bar`,{label:"Undo",run:()=>{const s=[...Ht()];s.splice(Math.min(e,s.length),0,n),Zn(s)}}))}function go(e){const t=Ht();if(t.length>=Kt())return Se(`The top bar has room for ${Kt()} items.`);if(t.some(n=>je(n)===je(e)))return Se("This is already in the top bar.");c.topbarAdded={key:je(e),time:Date.now()},Zn([...t,e]),Pt(t.length)}const Hc=[{title:"Brightness",icon:"F0599",rows:[{key:"brightness",label:"Brightness",kind:"number",min:5,max:100,step:5,unit:"%"},{key:"dark_mode",label:"Dark mode",kind:"toggle"},{key:"standby_enabled",label:"Auto standby",kind:"toggle"},{key:"standby_seconds",label:"Standby after",kind:"duration",min:60,max:86400,needs:"standby_enabled"},{key:"standby_brightness",label:"Standby brightness",kind:"number",min:0,max:100,step:5,unit:"%",needs:"standby_enabled",cap:"brightness"}]},{title:"Night",icon:"F0594",rows:[{key:"night_enabled",label:"Night mode",kind:"toggle"},{key:"night_start",label:"Starts",kind:"moment",needs:"night_enabled"},{key:"night_end",label:"Ends",kind:"moment",needs:"night_enabled"},{key:"night_brightness",label:"Night brightness",kind:"number",min:0,max:100,step:5,unit:"%",needs:"night_enabled",cap:"brightness"}]},{title:"Screen",icon:"F0379",rows:[{key:"clock_24h",label:"Clock",kind:"choice",options:[[!1,"12 hour"],[!0,"24 hour"]]},{key:"auto_home",label:"Back to page 1",kind:"toggle"},{key:"auto_home_seconds",label:"After",kind:"duration",min:30,max:3600,needs:"auto_home"},{key:"home_on_standby",label:"Also on standby",kind:"toggle"},{key:"swipe_pages",label:"Swipe between pages",kind:"toggle"},{key:"rotation",label:"Rotation",kind:"choice",options:[[0,"0°"],[90,"90°"],[180,"180°"],[270,"270°"]]}]}],Ta=4e3;let qt={},_n=null,Ps=0,ws=null;const ai=()=>Ct.value?.settings;function Cn(){const e=ai(),t={...e?.values||{}};for(const[n,s]of Object.entries(c.settingEdits))t[n]=s.value;return t}const Uc=e=>e<300?30:e<900?60:e<3600?300:e<7200?900:1800;function Zi(e,t,n,s,o){if(e.kind==="moment"){let r=s&&t%60?Math.floor(t/60)*60+(n>0?60:0):t+n*(s?60:15);return r%=1440,r<0?r+1440:r}const l=e.kind==="duration"?Uc(n<0?t-1:t):e.step,a=e.cap?Math.min(e.max,o[e.cap]):e.max;return Math.min(a,Math.max(e.min,t+n*l))}function jc(e){if(e<60)return`${e} sec`;if(e<3600)return`${Math.floor(e/60)} min`;const t=Math.floor(e/3600),n=Math.floor(e%3600/60);return n?`${t} h ${String(n).padStart(2,"0")}`:`${t} h`}function Bc(e,t){const n=Math.floor(e/60),s=String(e%60).padStart(2,"0");return t?`${String(n).padStart(2,"0")}:${s}`:`${n%12||12}:${s} ${n<12?"AM":"PM"}`}function Vc(e,t){const n=t[e.key];return n==null?"—":e.kind==="number"?`${n}${e.unit||""}`:e.kind==="duration"?jc(n):e.kind==="moment"?Bc(n,t.clock_24h!==!1):""}function Nn(e,t,n){if(_n&&_n!==c.selected&&Object.keys(qt).length){es(),Se("Still saving the other screen's settings. Try again in a moment.");return}_n=c.selected;const s=Cn();if(c.settingEdits[e]={value:t,at:Date.now()},qt[e]=t,e==="brightness")for(const o of["standby_brightness","night_brightness"])s[o]>t&&(c.settingEdits[o]={value:t,at:Date.now()});c.settingPending=!0,clearTimeout(Ps),Ps=window.setTimeout(()=>es(),n)}async function es(e=!1){if(clearTimeout(Ps),ws||!Object.keys(qt).length||!_n)return;const t=_n,n=qt;qt={};const s=si(`screens/${encodeURIComponent(t)}/settings`,{method:"PUT",body:JSON.stringify({settings:n}),keepalive:e});ws=s;try{const o=await(await s).json(),l=c.inventory.screens.find(a=>a.id===t);l&&(l.settings=o)}catch(o){if(Se(o.message),t===c.selected)for(const l of Object.keys(n))delete c.settingEdits[l];if(t===c.selected&&n.brightness!==void 0)for(const l of["standby_brightness","night_brightness"])delete c.settingEdits[l]}finally{ws=null,Object.keys(qt).length?Ps=window.setTimeout(()=>es(),150):_n=null,c.settingPending=!!Object.keys(qt).length,t===c.selected&&Os(),setTimeout(()=>{t===c.selected&&Os()},Ta+100)}}function Os(){const e=ai();for(const[t,n]of Object.entries(c.settingEdits))qt[t]!==void 0||ws||(e&&e.values[t]===n.value||Date.now()-n.at>Ta)&&delete c.settingEdits[t]}const Rn={install:"Building and installing…",verify:"Waiting for the screen to come back…",settle:"Checking that it stays stable…"};async function Do(e,t){c.updating.push(e.id);try{await Xe(`screens/${encodeURIComponent(e.id)}/update`,"POST",t?{host:t}:{}),await pn()}catch(n){c.updating=c.updating.filter(s=>s!==e.id),Se(n.message)}}async function el(){try{await Xe("updates/run","POST"),await pn()}catch(e){Se(e.message)}}async function Wc(e){try{await Xe("updates","PUT",{auto:e}),c.inventory.updates&&(c.inventory.updates.auto=e),Se(e?"Screens will now update automatically at night.":"Automatic updates are off.")}catch(t){Se(t.message)}}async function Kc(){try{c.inventory.claude_skill=await Xe("claude-skill","POST"),Se(c.inventory.claude_skill?.restart?"Skill installed. Restart Claude Code once so it finds the new skills folder.":"Skill installed. Claude Code picks it up right away.")}catch(e){Se(e.message)}}async function pn(e=!0){try{const t=await dt(e?"inventory":"inventory?light=1");c.inventory=e?t:{...c.inventory,...t},t.csrf&&yc(t.csrf),c.connected=!!c.inventory.connected,c.reachable=!0;for(const n of c.inventory.screens)n.update?.state==="running"&&(c.updating=c.updating.filter(s=>s!==n.id));c.selected&&Os()}catch{c.reachable=!1}}function qc(e){c.inventory={...c.inventory,...e},c.connected=!!c.inventory.connected;for(const t of c.inventory.screens)t.update?.state==="running"&&(c.updating=c.updating.filter(n=>n!==t.id));c.selected&&Os()}let tl=0,Fo=Date.now(),Is=!1,Mn=null;function Yc(){Mn||typeof EventSource>"u"||(Mn=new EventSource("api/events"),Mn.onopen=()=>{Is=!0,ts()},Mn.onmessage=e=>{document.hidden||qc(JSON.parse(e.data))},Mn.onerror=()=>{Is=!1,ts()})}function ts(){clearTimeout(tl);const e=Is?6e4:c.inventory.updates?.busy?3e3:1e4;tl=window.setTimeout(async()=>{if(!document.hidden){const t=Date.now()-Fo>=3e5;t&&(Fo=Date.now()),(t||!Is)&&await pn(t)}ts()},e)}let nl=!1;function zc(){nl||(nl=!0,pn(),Yc(),ts(),mc(()=>c.fontsVersion++),setInterval(()=>{!c.layout||document.hidden||c.drag.active||(c.now=Date.now(),Qs(0))},3e4),setInterval(()=>{!document.hidden&&c.layout&&c.tab==="layout"&&tt.value===""&&Gs()},8e3),setInterval(()=>{!document.hidden&&Lo()?Rc():c.firmwareJob&&!Lo()&&(c.firmwareJob=null)},3e3),document.addEventListener("visibilitychange",async()=>{document.hidden||(Fo=Date.now(),c.now=Date.now(),await pn(),ts())}),window.addEventListener("pagehide",()=>es(!0)),window.addEventListener("beforeunload",e=>{c.dirty&&(e.preventDefault(),e.returnValue="")}))}const Jc={class:"side"},Gc={id:"screens"},Xc=["aria-current","onClick"],Qc={class:"txt"},Zc={key:0,class:"pill"},ed={key:1,class:"spin small"},td=["onSubmit"],nd=["disabled","title","onClick"],sd={key:2,class:"whatsnew"},od=["aria-valuenow"],id={class:"progress-text"},ld=["title"],ad=["title"],rd={id:"pending"},ud={class:"pending-actions"},cd=["onClick"],dd=["aria-current"],fd={class:"more"},pd=["aria-current"],hd={class:"mdi"},vd=["aria-current"],md={class:"mdi"},yd=["aria-current"],gd={class:"mdi"},bd=Ce({__name:"Sidebar",setup(e){const t=fe(null),n=fe("");function s(d){const u=d.update||{};return u.state==="running"||c.updating.includes(d.id)?{kind:"running",text:Rn[u.phase||""]||"Starting update…"}:u.state==="queued"?{kind:"queued",text:"Queued for the update"}:u.available&&d.online?{kind:"available",text:`Update ${u.target}`}:u.result&&Date.now()/1e3-u.result.time<86400?{kind:u.result.state==="failed"?"failed":"done",text:u.result.message}:null}function o(d){const u=d.update||{};u.host&&u.profile?Do(d):u.profile&&(t.value=d.id,n.value="")}function l(d){const u=n.value.trim();u&&(t.value=null,Do(d,u))}const a=()=>{const d=c.firmwareJob?.logs||[];return d.length?d[d.length-1]:""},r=d=>d.installed?"Installed, but not yet in Home Assistant. Add the discovered ESPHome device under Settings → Devices & services, paste the API key there, and turn on “Allow the device to perform Home Assistant actions” under Configure.":d.downloaded?"Firmware downloaded, not yet in Home Assistant. Put it on the screen with ESPHome Web, then add the discovered ESPHome device under Settings → Devices & services, paste the API key there, and allow the Home Assistant actions under Configure.":`Not yet in Home Assistant. Already flashed? Add the ESPHome device under Settings → Devices & services, then allow the Home Assistant actions under Configure. Not flashed yet? Firmware & USB → ${d.file}.`;return(d,u)=>(h(),m("aside",Jc,[u[20]||(u[20]=i("div",{class:"brand"},[i("span",{class:"mark"},"▦"),i("span",null,"ESP Screens")],-1)),i("span",{id:"connection",class:ue(["conn",{online:v(c).connected}]),role:"status"},y(v(c).reachable?v(c).connected?"Home Assistant connected":"Reconnecting to Home Assistant…":"Management page unreachable · retrying…"),3),i("button",{type:"button",class:"search-btn",id:"open-palette",onClick:u[0]||(u[0]=f=>v(c).palette=!0)},[...u[10]||(u[10]=[ee("⌕ Search",-1),i("kbd",null,"⌘K",-1)])]),u[21]||(u[21]=i("div",{class:"label"},"Screens",-1)),i("div",Gc,[(h(!0),m(U,null,ie(v(c).inventory.screens,f=>(h(),m("div",{key:f.id,class:ue(["screen-item",{selected:f.id===v(c).selected&&v(tt)===""}])},[i("button",{type:"button",class:"nav-item","aria-current":f.id===v(c).selected&&v(tt)===""?"true":"false",onClick:p=>v(ka)(f.id)},[i("span",{class:ue(["dot",{off:!f.online}])},null,2),i("span",Qc,[i("span",null,y(f.name),1),i("small",null,y(f.online?"Online":"Offline")+y(f.area?" · "+f.area:"")+" · "+y(f.firmware||"unknown"),1)]),s(f)?.kind==="available"?(h(),m("span",Zc,"Update")):s(f)?.kind==="running"?(h(),m("span",ed)):H("",!0)],8,Xc),s(f)?(h(),m("div",{key:0,class:ue(["screen-update",s(f).kind])},[s(f).kind==="available"?(h(),m(U,{key:0},[t.value===f.id?(h(),m(U,{key:0},[u[12]||(u[12]=i("small",null,"The IP address, once; new firmware reports it itself.",-1)),i("form",{class:"screen-host",onSubmit:it(p=>l(f),["prevent"])},[ye(i("input",{"onUpdate:modelValue":u[1]||(u[1]=p=>n.value=p),placeholder:"IP address, e.g. 192.168.1.50",required:"",pattern:"[A-Za-z0-9][A-Za-z0-9.\\-]*","aria-label":"IP address",autofocus:""},null,512),[[Ie,n.value]]),u[11]||(u[11]=i("button",{type:"submit",class:"btn mini primary"},"Start",-1)),i("button",{type:"button",class:"icon-btn","aria-label":"Cancel",onClick:u[2]||(u[2]=p=>t.value=null)},"✕")],40,td)],64)):(h(),m(U,{key:1},[i("small",null,y(s(f).text),1),i("button",{type:"button",class:"btn mini primary",disabled:!f.update?.profile,title:f.update?.profile?"":"No ESPHome profile found with this device name.",onClick:p=>o(f)},"Update",8,nd)],64)),v(Gi)(f).length?(h(),m("details",sd,[u[13]||(u[13]=i("summary",null,"What's new",-1)),i("ul",null,[(h(!0),m(U,null,ie(v(Gi)(f).slice(0,8),p=>(h(),m("li",{key:p},y(p),1))),128))])])):H("",!0)],64)):s(f).kind==="running"&&v(yn)(f)?(h(),m(U,{key:1},[i("div",{class:"progress",role:"progressbar","aria-valuenow":v(yn)(f).percent,"aria-valuemin":"0","aria-valuemax":"100"},[i("i",{style:Pe({width:v(yn)(f).percent+"%"})},null,4)],8,od),i("div",id,[i("span",null,y(v(yn)(f).percent)+" %",1),i("span",{title:a()},y(v(yn)(f).text),9,ld)]),a()?(h(),m("small",{key:0,title:a(),style:{"white-space":"nowrap",overflow:"hidden","text-overflow":"ellipsis"}},y(a()),9,ad)):H("",!0),i("button",{type:"button",class:"btn link mini",style:{"justify-self":"start"},onClick:u[3]||(u[3]=p=>v(Ae)("#firmware"))},"Full log")],64)):(h(),m("small",{key:2,class:ue({failed:s(f).kind==="failed"})},y(s(f).text),3))],2)):H("",!0)],2))),128))]),i("div",rd,[(h(!0),m(U,null,ie(v(c).inventory.pending||[],f=>(h(),m("div",{key:f.file,class:"pending"},[i("strong",null,y(f.friendly),1),i("small",null,y(r(f)),1),i("div",ud,[i("button",{type:"button",class:"btn mini quiet",onClick:u[4]||(u[4]=(...p)=>v(Es)&&v(Es)(...p))},"Open Devices & services"),f.api_key?(h(),m("button",{key:0,type:"button",class:"btn mini quiet",onClick:p=>v(lt)(f.api_key)},"Copy API key",8,cd)):H("",!0)])]))),128))]),i("button",{id:"new-screen",type:"button",class:"nav-item ghost","aria-current":v(tt)==="#new-screen"?"true":"false",onClick:u[5]||(u[5]=f=>v(Ae)("#new-screen"))},[...u[14]||(u[14]=[i("span",{class:"plus"},"+",-1),i("span",{class:"txt"},"New screen",-1)])],8,dd),u[22]||(u[22]=i("div",{class:"spacer"},null,-1)),i("div",fd,[u[19]||(u[19]=i("div",{class:"label"},"More",-1)),i("button",{id:"open-firmware",type:"button",class:"nav-item","aria-current":v(tt)==="#firmware"?"true":"false",onClick:u[6]||(u[6]=f=>v(Ae)("#firmware"))},[i("span",hd,y(v(be)("F0241")),1),u[15]||(u[15]=i("span",{class:"txt"},"Firmware & USB",-1))],8,pd),i("button",{id:"open-alerts",type:"button",class:"nav-item","aria-current":v(tt)==="#alerts"?"true":"false",onClick:u[7]||(u[7]=f=>v(Ae)("#alerts"))},[i("span",md,y(v(be)("F0594")),1),u[16]||(u[16]=i("span",{class:"txt"},"Alerts",-1))],8,vd),i("button",{id:"open-settings",type:"button",class:"nav-item","aria-current":v(tt)==="#settings"?"true":"false",onClick:u[8]||(u[8]=f=>v(Ae)("#settings"))},[i("span",gd,y(v(be)("F0493")),1),u[17]||(u[17]=i("span",{class:"txt"},"Settings",-1))],8,yd),i("button",{id:"refresh",type:"button",class:"nav-item ghost",onClick:u[9]||(u[9]=f=>v(pn)())},[...u[18]||(u[18]=[i("span",{class:"plus"},"↻",-1),i("span",{class:"txt"},"Refresh",-1)])])])]))}}),wd={key:0,id:"toast",class:"toast",role:"status"},_d=Ce({__name:"Toast",setup(e){return(t,n)=>v(c).toast?(h(),m("div",wd,[i("span",null,y(v(c).toast.message),1),v(c).toast.action?(h(),m("button",{key:0,type:"button",onClick:n[0]||(n[0]=s=>{v(c).toast.action.run(),v(Cc)()})},y(v(c).toast.action.label),1)):H("",!0)])):H("",!0)}}),kd={class:"palette-list"},$d={class:"palette-group"},xd=["onMouseenter","onClick"],Sd={key:0,class:"mdi"},Cd={key:1,class:"glyph"},Ad={class:"tx"},Td={key:0},Ed={key:2,class:"hint-key"},Pd={key:0,class:"palette-empty"},Od=Ce({__name:"CommandPalette",setup(e){const t=fe(""),n=fe(0),s=fe(null),o=k(()=>{const u=t.value.trim().toLocaleLowerCase(),f=[];for(const T of c.inventory.screens)f.push({group:"Screens",label:T.name,detail:`${T.online?"Online":"Offline"} · ${T.firmware||"unknown"}`,glyphText:"▦",run:()=>ka(T.id)});const p=Ct.value,_=[{group:"Actions",label:"New screen",detail:"Connect and install",glyphText:"+",run:()=>Ae("#new-screen")},{group:"Actions",label:"Firmware & USB",icon:"F0241",run:()=>Ae("#firmware")},{group:"Actions",label:"Alerts",detail:"Cheatsheet and a test alert",icon:"F0594",run:()=>Ae("#alerts")},{group:"Actions",label:"Settings",detail:"Updates, Claude",icon:"F0493",run:()=>Ae("#settings")}];if(p&&c.layout&&_.unshift({group:"Actions",label:"Save & send",detail:c.dirty?"Unsaved changes":"Nothing to save",key:"⌘S",run:()=>Mo()},{group:"Actions",label:"Layout",detail:p.name,run:()=>{Ae(""),c.tab="layout"}},{group:"Actions",label:"Screen settings",detail:p.name,run:()=>{Ae(""),c.tab="settings"}},{group:"Actions",label:"Identify this screen",detail:dn(p)?"Blinks the backlight and shows a card":"Needs a newer firmware",run:()=>{dn(p)&&Sa(p)}},{group:"Actions",label:"Export layout",detail:"Download and copy as JSON",run:Aa}),f.push(..._),p&&c.layout&&u){const T=new Set(c.layout.tiles.map(I=>I.entity)),M=c.layout.tiles.length>=cn.value;for(const I of c.inventory.entities)if(!(I.tile===!1||T.has(I.id))&&`${I.name} ${I.id} ${I.area||""} ${I.device||""}`.toLocaleLowerCase().includes(u)&&(f.push({group:"Add to this screen",label:I.name,detail:[bt(I.id)[0],I.area].filter(Boolean).join(" · "),icon:c.inventory.icons?Xt(I.id):void 0,run:()=>{M||$a(I.id)}}),f.length>60))break}return u?f.filter(T=>`${T.label} ${T.detail||""}`.toLocaleLowerCase().includes(u)):f}),l=k(()=>{const u=[];return o.value.forEach((f,p)=>{(u.find(T=>T.group===f.group)||(u.push({group:f.group,items:[]}),u[u.length-1])).items.push({item:f,index:p})}),u});function a(){c.palette=!1}function r(u){a(),u.run()}function d(u){if(u.key==="Escape")u.preventDefault(),a();else if(u.key==="ArrowDown")u.preventDefault(),n.value=Math.min(o.value.length-1,n.value+1);else if(u.key==="ArrowUp")u.preventDefault(),n.value=Math.max(0,n.value-1);else if(u.key==="Enter"){u.preventDefault();const f=o.value[n.value];f&&r(f)}}return an(t,()=>n.value=0),an(()=>c.palette,async u=>{u&&(t.value="",n.value=0,await Bs(),s.value?.focus())}),(u,f)=>v(c).palette?(h(),m("div",{key:0,class:"palette-backdrop",onClick:a},[i("div",{class:"palette",role:"dialog","aria-label":"Search",onClick:f[1]||(f[1]=it(()=>{},["stop"])),onKeydown:d},[ye(i("input",{ref_key:"input",ref:s,"onUpdate:modelValue":f[0]||(f[0]=p=>t.value=p),id:"palette-input",placeholder:"Search screens, entities, actions…","aria-label":"Search",autocomplete:"off"},null,512),[[Ie,t.value]]),i("div",kd,[(h(!0),m(U,null,ie(l.value,p=>(h(),m(U,{key:p.group},[i("div",$d,y(p.group),1),(h(!0),m(U,null,ie(p.items,({item:_,index:T})=>(h(),m("button",{key:T,type:"button",class:ue(["palette-item",{active:T===n.value}]),onMouseenter:M=>n.value=T,onClick:M=>r(_)},[_.icon?(h(),m("span",Sd,y(v(be)(_.icon)),1)):(h(),m("span",Cd,y(_.glyphText||"›"),1)),i("span",Ad,[i("span",null,y(_.label),1),_.detail?(h(),m("small",Td,y(_.detail),1)):H("",!0)]),_.key?(h(),m("kbd",Ed,y(_.key),1)):H("",!0)],42,xd))),128))],64))),128)),o.value.length?H("",!0):(h(),m("p",Pd,"Nothing matches. Type part of a screen, entity or action."))])],32)])):H("",!0)}}),oe={source:null,element:null,ghost:null,timer:0,start:null,offset:{x:0,y:0},pointerId:null,suppressUntil:0,last:null,scroller:0,target:null},Ea={mounted(e,t){e.__dragSource=t.value,e.addEventListener("pointerdown",s=>{const o=e.__dragSource;if(!(s.button!==0||e.disabled||s.target.closest(".remove"))){s.pointerType!=="touch"&&s.preventDefault(),Object.assign(oe,{source:o,element:e,start:{x:s.clientX,y:s.clientY},pointerId:s.pointerId});try{e.setPointerCapture(s.pointerId)}catch{}clearTimeout(oe.timer),s.pointerType==="touch"&&(oe.timer=window.setTimeout(()=>sl(s),260))}}),e.addEventListener("pointermove",s=>{if(c.drag.active||!oe.start||oe.element!==e)return;const o=Math.hypot(s.clientX-oe.start.x,s.clientY-oe.start.y);if(s.pointerType==="touch"){o>10&&(clearTimeout(oe.timer),oe.start=null);return}o>=6&&sl(s)});const n=()=>{oe.element===e&&!c.drag.active&&(clearTimeout(oe.timer),oe.start=null)};e.addEventListener("pointerup",n),e.addEventListener("pointercancel",n)},updated(e,t){e.__dragSource=t.value}};function sl(e){if(c.drag.active||!oe.start||!oe.source||!oe.element)return;c.drag.active=!0,c.drag.moving=oe.source.kind==="tile"?oe.source.tile:ya(oe.source.id),c.drag.preview=null,oe.target=null,getSelection()?.removeAllRanges();const t=oe.element.getBoundingClientRect(),n=oe.element.cloneNode(!0);n.classList.add("drag-ghost"),n.style.width=`${t.width}px`,n.style.height=`${t.height}px`,oe.offset={x:e.clientX-t.left,y:e.clientY-t.top},document.body.append(n),oe.ghost=n,document.addEventListener("pointermove",No),document.addEventListener("pointerup",Ms),document.addEventListener("pointercancel",Ms);try{oe.element.releasePointerCapture(oe.pointerId)}catch{}try{document.documentElement.setPointerCapture(oe.pointerId)}catch{}document.addEventListener("touchmove",Pa,{passive:!1}),oe.scroller=window.setInterval(()=>{if(!oe.last)return;const s=document.querySelector(".canvas");if(!s)return;const o=s.getBoundingClientRect(),l=oe.last.x<o.left+60?-12:oe.last.x>o.right-60?12:0,a=oe.last.y<o.top+60?-12:oe.last.y>o.bottom-60?12:0;(l||a)&&(s.scrollBy(l,a),Ro(Oa(oe.last.x,oe.last.y)))},16),Ro(-1),No(e)}function Pa(e){c.drag.active&&e.preventDefault()}function Ms(e){e.pointerId===oe.pointerId&&Id(e.type==="pointerup")}function No(e){!oe.ghost||e.pointerId!==oe.pointerId||(oe.last={x:e.clientX,y:e.clientY},oe.ghost.style.transform=`translate(${e.clientX-oe.offset.x}px, ${e.clientY-oe.offset.y}px)`,Ro(Oa(e.clientX,e.clientY)))}function Oa(e,t){let n=null,s=1/0;for(const l of document.querySelectorAll(".pages [data-slot]")){const a=l.getBoundingClientRect(),r=Math.hypot(Math.max(a.left-e,0,e-a.right),Math.max(a.top-t,0,t-a.bottom));r<s&&(s=r,n={cell:l,r:a})}if(!n||s>16)return-1;let o=Number(n.cell.dataset.slot);return n.cell.classList.contains("wide")&&e>(n.r.left+n.r.right)/2&&(o+=1),o}function Ro(e){oe.target===e||!c.layout||!c.drag.moving||(oe.target=e,c.drag.preview=e>=0?ma(c.layout.tiles,c.drag.moving,e):null)}function Id(e){const t=c.drag.preview,n=c.drag.moving;document.removeEventListener("pointermove",No),document.removeEventListener("pointerup",Ms),document.removeEventListener("pointercancel",Ms),document.removeEventListener("touchmove",Pa);try{document.documentElement.releasePointerCapture(oe.pointerId)}catch{}if(oe.ghost?.remove(),Object.assign(oe,{ghost:null,suppressUntil:Date.now()+400,last:null,start:null,target:null,element:null,source:null}),clearInterval(oe.scroller),c.drag.active=!1,c.drag.preview=null,c.drag.moving=null,e&&t&&n&&c.layout){const s=c.layout.tiles.map(o=>`${o.entity}@${o.slot}`).join();for(const{tile:o,slot:l}of t)o.slot=l,c.layout.tiles.includes(o)||c.layout.tiles.push(o);c.layout.tiles.sort((o,l)=>o.slot-l.slot),c.layout.tiles.map(o=>`${o.entity}@${o.slot}`).join()!==s&&Qe(),s.includes(`${n.entity}@`)||Xs(n,n.slot)}}window.addEventListener("click",e=>{Date.now()<oe.suppressUntil&&(e.stopPropagation(),e.preventDefault())},!0);const Md=["data-slot","tabindex","role","aria-label"],Ld={class:"clockface",viewBox:"0 0 60 60","aria-hidden":"true"},Dd=["transform"],Fd=["transform"],Nd=["transform"],Rd={key:0,class:"lead"},Hd={class:"tx"},Ud={class:"nm"},jd={class:"st"},Bd={class:"ic mdi"},Vd={class:"lead"},Wd={class:"big"},Kd={class:"nm"},qd={class:"lead"},Yd={class:"tx"},zd={class:"nm"},Jd={key:0,class:"big"},Gd={key:0},Xd={key:1,class:"ctl"},Qd={key:1,class:"stp"},Zd={class:"mdi"},ef={class:"mdi"},tf={class:"key mdi"},nf={class:"key mdi"},sf={key:3,class:"stp"},of={class:"mdi"},lf={class:"mdi"},af={class:"key mdi"},rf={class:"key mdi"},uf={class:"key mdi"},cf={class:"key mdi"},df={class:"key mdi"},ff={class:"key mdi"},pf={class:"key mdi"},hf={class:"key mdi"},vf={class:"key mdi"},mf={class:"key mdi"},yf={class:"key mdi"},gf={class:"key mdi"},bf={class:"key mdi"},wf={class:"key mdi"},_f={class:"key mdi"},kf={key:10,class:"run"},$f={class:"lead"},xf={key:0,class:"big"},Sf={key:0},Cf={class:"nm"},Af=["aria-label"],Tf=Ce({__name:"TileCard",props:{tile:{},slot:{},placeholder:{type:Boolean}},setup(e){const t=e,n=k(()=>t.tile.name||is(t.tile.entity)),s=k(()=>st(t.tile)),o=k(()=>c.inventory.backgrounds?.[t.tile.options?.background||""]?.color),l=k(()=>t.tile.options?.background==="none"),a=k(()=>t.tile.options?.display||"standard"),r=k(()=>a.value!=="standard"?ba[a.value]||a.value:""),d=k(()=>ga(t.tile,c.inventory)),u=k(()=>t.tile.entity.split(".")[0]),f=k(()=>c.inventory.icons?.controls||{}),p=V=>f.value[V]?be(f.value[V]):"",_=k(()=>c.selectedTile===t.tile.entity&&c.inspector?.kind==="tile"),T=k(()=>!t.placeholder&&c.layout?.tiles.includes(t.tile)),M=k(()=>`${n.value}, slot ${t.slot%Lt+1} on page ${Ts(t.slot)+1}. Enter: configure, arrow keys: move`),I=k(()=>new Date(c.now)),$=k(()=>(I.value.getHours()%12+I.value.getMinutes()/60)*30),x=k(()=>I.value.getMinutes()*6),O=k(()=>u.value==="screen"?null:Ec(t.tile.entity)),J=k(()=>!O.value||["unavailable","unknown",""].includes(O.value.state)),C=k(()=>!!O.value&&!J.value&&O.value.state!=="off"&&O.value.state!=="closed"&&O.value.state!=="standby"&&O.value.state!=="idle"&&O.value.state!=="docked"),z=k(()=>["light","switch","input_boolean","fan"].includes(u.value)&&O.value?.state==="on"),P=k(()=>O.value?.a?.unit_of_measurement),S=V=>V.charAt(0).toUpperCase()+V.slice(1).replace(/_/g," "),b={"clear-night":"Clear, night",cloudy:"Cloudy",exceptional:"Exceptional",fog:"Fog",hail:"Hail",lightning:"Lightning","lightning-rainy":"Lightning, rainy",partlycloudy:"Partly cloudy",pouring:"Pouring",rainy:"Rainy",snowy:"Snowy","snowy-rainy":"Snowy, rainy",sunny:"Sunny",windy:"Windy","windy-variant":"Windy"},A=["scene","script","button","input_button"],q=k(()=>{const V=O.value;if(!V||A.includes(u.value))return r.value;if(J.value)return V.state==="unknown"?"Unknown":"Unavailable";const Q=V.a||{};return u.value==="climate"?`${Q.current_temperature!==void 0?`${Q.current_temperature}° · `:""}${V.word||S(V.state)}`:u.value==="weather"?`${V.word||b[V.state]||S(V.state)}${Q.temperature!==void 0?` · ${Q.temperature}°`:""}`:u.value==="cover"&&Q.current_position!==void 0&&Q.current_position>0&&Q.current_position<100?`${V.word||S(V.state)} · ${Q.current_position} %`:u.value==="media_player"&&Q.media_title?`${V.word||S(V.state)} · ${Q.media_title}`:u.value==="sensor"?`${V.state}${P.value?` ${P.value}`:""}`:(u.value==="timer",V.word||S(V.state))}),W=k(()=>O.value&&!J.value?O.value.state:"—"),le=k(()=>{const V=O.value;if(!V||J.value)return 0;const Q=V.a||{};if(u.value==="light")return V.state==="on"?Q.brightness!==void 0?Math.round(Q.brightness/255*100):100:0;if(u.value==="fan")return V.state==="on"?Q.percentage??100:0;if(u.value==="cover")return Q.current_position??(V.state==="open"?100:0);if(u.value==="media_player")return Math.round((Q.volume_level??0)*100);if(u.value==="number"||u.value==="input_number"){const Ee=Number(V.state),pt=Number(Q.min??0),Ze=Number(Q.max??100);return Number.isFinite(Ee)&&Ze>pt?Math.round((Ee-pt)/(Ze-pt)*100):0}return 0}),Z=k(()=>({background:`linear-gradient(to right, ${le.value?"#ffbf38":"#c9ccd1"} ${le.value}%, ${le.value?"#fff1d3":"#e6e8ec"} ${le.value}%)`})),B=k(()=>({background:`linear-gradient(to right, #2196f3 ${le.value}%, #d3e8fb ${le.value}%)`})),X=k(()=>{const V=O.value?.a?.temperature;return V!=null?`${V}°`:"—"});async function ce(V){if(V.key==="Enter"||V.key===" "){V.preventDefault(),Io(t.tile.entity);return}const Q={ArrowLeft:-1,ArrowRight:1,ArrowUp:-2,ArrowDown:2}[V.key];Q&&(V.preventDefault(),Xs(t.tile,t.tile.slot+(s.value?Math.sign(Q)*2:Q))&&(await Bs(),document.querySelector(`.pages [data-slot="${t.tile.slot}"]`)?.focus()))}return(V,Q)=>ye((h(),m("div",{class:ue(["tile",{wide:s.value,bare:l.value,placeholder:e.placeholder||!T.value,chosen:_.value}]),"data-slot":e.slot,style:Pe(o.value&&!l.value?{backgroundColor:o.value}:void 0),tabindex:T.value?0:-1,role:T.value?"button":void 0,"aria-label":T.value?M.value:void 0,onClick:Q[1]||(Q[1]=Ee=>T.value&&v(Io)(e.tile.entity)),onKeydown:Q[2]||(Q[2]=Ee=>T.value&&ce(Ee))},[a.value==="analog"?(h(),m(U,{key:0},[(h(),m("svg",Ld,[Q[3]||(Q[3]=i("circle",{cx:"30",cy:"30",r:"27",fill:"#fff",stroke:"#c9ccd1"},null,-1)),(h(),m(U,null,ie([0,90,180,270],Ee=>i("line",{key:Ee,x1:"30",y1:"5",x2:"30",y2:"9",stroke:"#1b1b1b","stroke-width":"1.5",transform:`rotate(${Ee} 30 30)`},null,8,Dd)),64)),i("line",{x1:"30",y1:"30",x2:"30",y2:"16",stroke:"#1b1b1b","stroke-width":"2.4","stroke-linecap":"round",transform:`rotate(${$.value} 30 30)`},null,8,Fd),i("line",{x1:"30",y1:"30",x2:"30",y2:"11",stroke:"#1b1b1b","stroke-width":"1.6","stroke-linecap":"round",transform:`rotate(${x.value} 30 30)`},null,8,Nd),Q[4]||(Q[4]=i("circle",{cx:"30",cy:"30",r:"1.8",fill:"#1b1b1b"},null,-1))])),s.value?(h(),m("span",Rd,[i("span",Hd,[i("span",Ud,y(n.value),1),i("span",jd,y(r.value),1)])])):H("",!0)],64)):a.value==="digital"&&u.value==="screen"?(h(),m(U,{key:1},[i("span",Bd,y(v(be)(v(bs)(e.tile))),1),i("span",Vd,[i("span",Wd,y(String(I.value.getHours()).padStart(2,"0"))+":"+y(String(I.value.getMinutes()).padStart(2,"0")),1),i("span",Kd,y(n.value),1)])],64)):s.value?(h(),m(U,{key:2},[i("span",qd,[i("span",{class:ue(["ic mdi",{lit:z.value}])},y(v(be)(v(bs)(e.tile))),3),i("span",Yd,[i("span",zd,y(n.value),1),a.value==="watch"?(h(),m("span",Jd,[ee(y(W.value),1),P.value&&!J.value?(h(),m("small",Gd,y(P.value),1)):H("",!0)])):q.value?(h(),m("span",{key:1,class:ue(["st",{off:J.value}])},y(q.value),3)):H("",!0)])]),e.tile.options?.inline==="slider"?(h(),m("span",{key:0,class:"mini-slider",style:Pe(Z.value)},null,4)):H("",!0),d.value?(h(),m("span",Xd,[d.value==="toggle"?(h(),m("span",{key:0,class:ue(["tog",{off:!C.value}])},null,2)):d.value==="setpoint"?(h(),m("span",Qd,[i("span",Zd,y(p("minus")||"−"),1),i("b",null,y(X.value),1),i("span",ef,y(p("plus")||"+"),1)])):d.value==="stepper"&&u.value.endsWith("select")?(h(),m(U,{key:2},[i("span",tf,y(p("chevron-left")),1),i("span",nf,y(p("chevron-right")),1)],64)):d.value==="stepper"?(h(),m("span",sf,[i("span",of,y(p("minus")||"−"),1),i("b",null,y(W.value),1),i("span",lf,y(p("plus")||"+"),1)])):d.value==="mode"?(h(),m(U,{key:4},[i("span",af,y(p("power")),1),i("span",rf,y(p("fire")),1),i("span",uf,y(p("snowflake")),1)],64)):d.value==="volume"?(h(),m(U,{key:5},[i("span",{class:"range",style:Pe(B.value)},null,4),i("span",cf,y(p("volume-high")),1)],64)):d.value==="playback"?(h(),m(U,{key:6},[i("span",df,y(p("skip-previous")),1),i("span",ff,y(p(C.value?"pause":"play")||p("play")),1),i("span",pf,y(p("skip-next")),1)],64)):d.value==="buttons"&&u.value==="cover"?(h(),m(U,{key:7},[i("span",hf,y(p("arrow-expand-horizontal")),1),i("span",vf,y(p("stop")),1),i("span",mf,y(p("arrow-collapse-horizontal")),1)],64)):d.value==="buttons"&&u.value==="vacuum"?(h(),m(U,{key:8},[i("span",yf,y(p("play")),1),i("span",gf,y(p("stop")),1),i("span",bf,y(p("home-map-marker")),1)],64)):d.value==="buttons"&&u.value==="timer"?(h(),m(U,{key:9},[i("span",wf,y(p("play")),1),i("span",_f,y(p("close")),1)],64)):d.value==="run"?(h(),m("span",kf,y({scene:"Activate",script:"Run"}[u.value]||"Press"),1)):(h(),m("span",{key:11,class:"range",style:Pe({background:`linear-gradient(to right, #2196f3 ${le.value}%, #d3e8fb ${le.value}%)`})},null,4))])):H("",!0)],64)):(h(),m(U,{key:3},[i("span",{class:ue(["ic mdi",{lit:z.value}])},y(v(be)(v(bs)(e.tile))),3),i("span",$f,[a.value==="watch"?(h(),m("span",xf,[ee(y(W.value),1),P.value&&!J.value?(h(),m("small",Sf,y(P.value),1)):H("",!0)])):H("",!0),i("span",Cf,y(n.value),1),a.value!=="watch"&&q.value?(h(),m("span",{key:1,class:ue(["st",{off:J.value}])},y(q.value),3)):H("",!0),e.tile.options?.inline==="slider"?(h(),m("span",{key:2,class:"mini-slider",style:Pe(Z.value)},null,4)):H("",!0)])],64)),T.value?(h(),m("button",{key:4,type:"button",class:"remove",title:"Remove tile","aria-label":`Remove ${n.value}`,onClick:Q[0]||(Q[0]=it(Ee=>v(xa)(e.tile),["stop"]))},"✕",8,Af)):H("",!0)],46,Md)),[[v(Ea),{kind:"tile",tile:e.tile}]])}}),Ef=["viewBox","aria-label"],Pf=["y"],Of=["cx","cy","r","stroke","stroke-width"],If=["x1","y1","x2","y2","stroke","stroke-width"],Mf=["x","y","fill"],Lf=["x","y"],Ia=Ce({__name:"TopbarSvg",props:{items:{},nameText:{},single:{type:Boolean}},setup(e,{expose:t}){const n=e,s=k(()=>{c.fontsVersion,c.now,c.topbarPreviews;const $=n.items||Ht();return fa($,_a.value,n.nameText??(c.layout?.title||"Home"),Vt)}),o=k(()=>s.value.metrics),l=k(()=>n.single?Math.round(o.value.text*1.4):o.value.top+Math.round(o.value.name*.45)),a=k(()=>n.single?Math.round(o.value.text*1.05):o.value.top),r=k(()=>{if(!n.single)return s.value.placed;const $=s.value.parts[0];return $&&($.x=0),$?[$]:[]}),d=k(()=>n.single?`-2 0 ${Math.max(1,r.value[0]?.width||1)+4} ${l.value}`:`0 0 ${o.value.width} ${l.value}`),u=k(()=>a.value+(s.value.zero.top+s.value.zero.bottom)/2),f=k(()=>vc(s.value.nameText,s.value.fonts.name,Math.min(s.value.natural,s.value.nameRoom))),p=k(()=>new Date(c.now));function _($){const x=p.value;return[[(x.getHours()%12+x.getMinutes()/60)*30,$*.24],[x.getMinutes()*6,$*.34]].map(([O,J])=>{const C=O*Math.PI/180;return{x2:J*Math.sin(C),y2:-J*Math.cos(C)}})}const T=$=>$.x-$.icon.ink.left,M=$=>($.icon?$.x+($.icon.ink.right-$.icon.ink.left)+s.value.gaps.icon:$.x)-$.text.ink.left,I=k(()=>`${(Math.max(1,r.value[0]?.width||1)+4)*(26/o.value.icon)}px`);return t({lay:s}),($,x)=>(h(),m("svg",{viewBox:d.value,role:"img","aria-label":e.single?"How it looks on the screen":`Top bar: ${s.value.nameText}`,style:Pe(e.single?{width:I.value}:void 0)},[e.single?H("",!0):(h(),m("text",{key:0,x:"0",y:o.value.top,fill:"#1b1b1b",style:Pe({font:s.value.fonts.name})},y(f.value),13,Pf)),i("g",null,[(h(!0),m(U,null,ie(r.value,O=>(h(),m(U,{key:O.index},[O.dial?(h(),m(U,{key:0},[i("circle",{cx:O.x+O.dial/2,cy:u.value,r:O.dial/2-Math.max(1,Math.round(O.dial/10))/2,fill:"none",stroke:O.view.color||"#46525e","stroke-width":Math.max(1,Math.round(O.dial/10))},null,8,Of),(h(!0),m(U,null,ie(_(O.dial),(J,C)=>(h(),m("line",{key:C,x1:O.x+O.dial/2,y1:u.value,x2:O.x+O.dial/2+J.x2,y2:u.value+J.y2,stroke:O.view.color||"#46525e","stroke-width":Math.max(1,Math.round(O.dial*.075)),"stroke-linecap":"round"},null,8,If))),128))],64)):(h(),m(U,{key:1},[O.icon?(h(),m("text",{key:0,x:T(O),y:u.value-(O.icon.ink.top+O.icon.ink.bottom)/2,fill:O.view.color||"#46525e",style:Pe({font:s.value.fonts.icon})},y(O.icon.glyph),13,Mf)):H("",!0),O.text?(h(),m("text",{key:1,x:M(O),y:a.value,fill:"#46525e",style:Pe({font:s.value.fonts.text})},y(O.text.value),13,Lf)):H("",!0)],64))],64))),128))])],12,Ef))}}),Df={class:"page"},Ff={class:"page-label"},Nf={key:1},Rf={class:"tiles"},Hf=["data-slot","aria-label","onClick"],Uf=Ce({__name:"DevicePage",props:{page:{},entries:{},pages:{},moving:{}},setup(e){const t=e,n=k(()=>new Map(t.entries.map(u=>[u.slot,u]))),s=k(()=>new Set(t.entries.filter(u=>st(u.tile)).map(u=>u.slot+1))),o=k(()=>Array.from({length:Lt},(u,f)=>t.page*Lt+f).filter(u=>!s.value.has(u))),l=k(()=>t.pages>1&&!t.entries.some(u=>Ts(u.slot)===t.page)),a=k(()=>c.inspector?.kind==="bar"||c.inspector?.kind==="bar-add"),r=k(()=>t.entries.filter(u=>Ts(u.slot)===t.page).reduce((u,f)=>u+(st(f.tile)?2:1),0));function d(u){const f=c.insertAt===u;c.insertAt=f?-1:u,c.insertAt>=0&&document.querySelector("#search")?.focus()}return(u,f)=>(h(),m("div",Df,[i("div",Ff,[i("span",null,"Page "+y(e.page+1),1),l.value?(h(),m("button",{key:0,type:"button",class:"btn mini",title:"The pages after this one shift up one slot",onClick:f[0]||(f[0]=p=>v(Oc)(e.page))},"Remove page")):(h(),m("span",Nf,y(r.value)+" / "+y(v(Lt)),1))]),i("div",{class:ue(["device",{cyd:!v(li)}])},[i("div",{class:ue(["bar-wrap",{selected:a.value}]),title:"Edit top bar",role:"button",tabindex:"0",onClick:f[1]||(f[1]=p=>v(Pt)(0)),onKeydown:f[2]||(f[2]=ca(it(p=>v(Pt)(0),["prevent"]),["enter"]))},[$e(Ia)],34),i("div",Rf,[(h(!0),m(U,null,ie(o.value,p=>(h(),m(U,{key:p},[n.value.get(p)?(h(),Ke(Tf,{key:0,tile:n.value.get(p).tile,slot:p,placeholder:n.value.get(p).tile===e.moving},null,8,["tile","slot","placeholder"])):(h(),m("button",{key:1,type:"button",class:ue(["cell",{"insert-here":v(c).insertAt===p}]),"data-slot":p,title:"Empty slot. Click to add a tile here, or drag one over.","aria-label":`Empty slot ${p%v(Lt)+1} on page ${e.page+1}: add the next tile here`,onClick:_=>d(p)},[f[3]||(f[3]=i("span",null,"+",-1)),i("small",null,y(v(c).insertAt===p?"Next tile goes here":"Empty"),1)],10,Hf))],64))),128))])],2)]))}}),jf={class:"library",id:"library"},Bf={class:"lib-head"},Vf={class:"lib-title"},Wf={class:"filters",id:"filters"},Kf=["aria-pressed","onClick"],qf={class:"lib-row"},Yf=["value"],zf=["aria-pressed"],Jf={class:"lib-list",id:"results","aria-live":"polite"},Gf=["title","disabled","onClick"],Xf={class:"tx"},Qf={key:0,class:"hint"},Zf={key:1,class:"hint"},ep={class:"lib-foot"},tp=Ce({__name:"Library",setup(e){const t=[["","All"],["light","Lights"],["climate","Climate"],["switch","Switches"],["binary_sensor","Status"],["button","Actions"],["script","Scripts"],["fan","Fans"],["cover","Covers"],["scene","Scenes"],["vacuum","Vacuum"],["sensor","Sensors"],["media_player","Media"],["weather","Weather"],["number","Values"],["select","Selects"],["person","People"],["timer","Timers"],["screen","Clock"]],n={switch:"input_boolean",number:"input_number",select:"input_select",weather:"sun",button:"input_button"},s=k(()=>new Set(c.layout?.tiles.map(u=>u.entity)||[])),o=k(()=>[...new Set(c.inventory.entities.map(u=>u.area).filter(u=>!!u))].sort((u,f)=>u.localeCompare(f))),l=k(()=>{const u=c.search.toLocaleLowerCase(),f=c.filter,p=c.room;return[...c.inventory.builtin||[],...c.inventory.entities].filter(_=>_.tile!==!1&&(li.value||!["camera","image"].includes(_.id.split(".")[0]))&&(!f||_.id.startsWith(f+".")||n[f]===_.id.split(".")[0])&&(!p||_.area===p)&&(!c.hidePlaced||!s.value.has(_.id))&&`${_.name} ${_.id} ${_.device||""} ${_.area||""}`.toLocaleLowerCase().includes(u))}),a=k(()=>(c.layout?.tiles.length||0)>=cn.value),r=k(()=>c.inventory.entities.length),d=u=>{const f=u.id.split(".")[0];return u.state==="unavailable"||u.state==="unknown"?"gone":["light","switch","input_boolean","fan"].includes(f)&&u.state==="on"?"on":""};return(u,f)=>(h(),m("aside",jf,[i("div",Bf,[i("div",Vf,[f[3]||(f[3]=ee("Library ",-1)),i("small",null,y(r.value)+" entities",1)]),ye(i("input",{id:"search","onUpdate:modelValue":f[0]||(f[0]=p=>v(c).search=p),type:"search",placeholder:"Search by name, device, or room…",autocomplete:"off","aria-label":"Add an entity"},null,512),[[Ie,v(c).search]]),i("div",Wf,[(h(),m(U,null,ie(t,([p,_])=>i("button",{key:p,type:"button","aria-pressed":v(c).filter===p?"true":"false",onClick:T=>v(c).filter=p},[p?(h(),m("span",{key:0,class:"domain-icon",style:Pe({color:v(bt)(p+".")[2],background:v(bt)(p+".")[3]}),"aria-hidden":"true"},y(v(bt)(p+".")[1]),5)):H("",!0),ee(y(_),1)],8,Kf)),64))]),i("div",qf,[ye(i("select",{id:"room","onUpdate:modelValue":f[1]||(f[1]=p=>v(c).room=p),"aria-label":"Room"},[f[4]||(f[4]=i("option",{value:""},"All rooms",-1)),(h(!0),m(U,null,ie(o.value,p=>(h(),m("option",{key:p,value:p},y(p),9,Yf))),128))],512),[[un,v(c).room]]),i("button",{type:"button",class:"chip-toggle",id:"hide-placed","aria-pressed":v(c).hidePlaced?"true":"false",title:"Hide what is already on this screen",onClick:f[2]||(f[2]=p=>v(c).hidePlaced=!v(c).hidePlaced)},"Hide placed",8,zf)])]),i("div",Jf,[(h(!0),m(U,null,ie(l.value.slice(0,80),p=>ye((h(),m("button",{key:p.id,type:"button",class:"ent",title:p.id,disabled:s.value.has(p.id)||a.value,onClick:_=>v($a)(p.id)},[i("span",{class:ue(["av mdi",d(p)]),style:Pe({color:v(bt)(p.id)[2],background:v(bt)(p.id)[3]})},y(v(c).inventory.icons?v(be)(v(Xt)(p.id)):v(bt)(p.id)[1]),7),i("span",Xf,[i("b",null,y(p.name),1),i("small",null,y([v(bt)(p.id)[0],p.area,p.device].filter(Boolean).join(" · ")),1)]),i("span",{class:ue(["add",{done:s.value.has(p.id)}])},y(s.value.has(p.id)?"✓":"+"),3)],8,Gf)),[[v(Ea),{kind:"entity",id:p.id}]])),128)),l.value.length?l.value.length>80?(h(),m("p",Zf,y(l.value.length)+" results. Keep typing to narrow it down.",1)):H("",!0):(h(),m("p",Qf,y(v(c).hidePlaced&&!v(c).search&&!v(c).filter&&!v(c).room?"Everything here is already on this screen.":"No entities found. Try a different name, room or filter."),1))]),i("div",ep,y(a.value?`This screen holds ${v(cn)} tiles${v(cn)===10?"; update its firmware for 20":""}.`:"Drag onto a page, or tap + to add to the first free slot. ⌘K searches everything."),1)]))}}),np={class:"canvas-head"},sp={id:"count"},op={key:0,id:"no-tiles"},ip={key:1},lp={key:2,id:"positions-hint",class:"warn"},ap={class:"pages",id:"layout-preview","aria-label":"Screen layout"},rp={class:"page-label"},up=["tabindex"],cp=Ce({__name:"LayoutView",setup(e){const t=k(()=>c.layout),n=k(()=>c.drag.preview||ft(t.value)),s=k(()=>jt(n.value,t.value.pages)),o=k(()=>Ic()),l=k(()=>s.value<xn),a=k(()=>gc(t.value.tiles)&&!wn(0,2,26)?`Empty slots and fixed positions work from firmware 0.2.26. This screen (firmware ${Ct.value?.firmware||"unknown"}) shifts the tiles up to the first free slot until that update.`:"");function r(d){d.target.closest(".device, .page-label, .canvas-head")||c.inspector&&Re()}return(d,u)=>(h(),m(U,null,[i("div",{class:"canvas",id:"canvas",onClick:r},[i("div",np,[i("b",sp,y(s.value)+" "+y(s.value===1?"page":"pages")+" · "+y(t.value.tiles.length)+" / "+y(v(cn))+" tiles",1),t.value.tiles.length?(h(),m("span",ip,"Tap the top bar or a tile to change it. Drag to move; drop on the next page for a new one.")):(h(),m("span",op,"Add your first light, scene, or device from the library.")),a.value?(h(),m("span",lp,y(a.value),1)):H("",!0)]),i("div",ap,[(h(!0),m(U,null,ie(o.value,f=>(h(),Ke(Uf,{key:f,page:f-1,entries:n.value,pages:s.value,moving:v(c).drag.moving},null,8,["page","entries","pages","moving"]))),128)),i("div",{class:ue(["page ghost",{disabled:!l.value}])},[i("div",rp,[i("span",null,"Page "+y(o.value+1),1)]),i("div",{class:ue(["device",{cyd:v(Ct)?.board!=="guition"}]),id:"add-page",role:"button",tabindex:l.value?0:-1,onClick:u[0]||(u[0]=f=>l.value&&v(zi)()),onKeydown:u[1]||(u[1]=ca(it(f=>l.value&&v(zi)(),["prevent"]),["enter"]))},y(l.value?"+ Add page":`${v(xn)} pages is the most`),43,up)],2)])]),$e(tp)],64))}}),dp={class:"status",id:"settings-status",role:"status"},fp={key:0,class:"set-grid",id:"settings-groups"},pp={class:"mdi"},hp=["data-setting","title","onClick"],vp=["id"],mp={class:"s-control"},yp=["id","aria-checked","aria-labelledby","disabled","onClick"],gp=["aria-labelledby"],bp=["aria-pressed","disabled","onClick"],wp={key:2,class:"step"},_p=["aria-label","disabled","onPointerdown","onClick"],kp={class:"mdi"},$p=["id","aria-labelledby"],xp=["aria-label","disabled","onPointerdown","onClick"],Sp={class:"mdi"},Cp=Ce({__name:"SettingsTab",setup(e){const t=k(()=>ai()),n=k(()=>Cn()),s=k(()=>t.value?.owner==="screen"&&!Ct.value?.online),o=k(()=>Hc.map(M=>({...M,rows:M.rows.filter(I=>t.value?.keys.includes(I.key))})).filter(M=>M.rows.length)),l=M=>s.value||!!t.value?.unavailable.includes(M.key),a=M=>M.needs?!!n.value[M.needs]:!0,r=k(()=>s.value?"This screen is offline. Its settings can change once it's back.":c.settingPending?"Saving…":t.value?.owner==="screen"?"Changes apply on the screen at once, and show up here when they change there.":"Changes apply at once. Firmware 0.2.49 lets the screen keep them itself."),d=(M,I)=>{const $=n.value[M.key];return l(M)||!a(M)||$===null||$===void 0?!0:M.kind!=="moment"&&Zi(M,$,I,!1,n.value)===$},u=new WeakMap;function f(M,I,$){const x=Cn(),O=Zi(M,x[M.key],I,$,x);O!==x[M.key]&&Nn(M.key,O,600)}function p(M,I,$){const x=M.currentTarget;if(x.disabled||M.button!==0)return;const O={timer:0,held:!1};u.set(x,O);let J=0;O.timer=window.setTimeout(function C(){O.held=!0,J+=1,f(I,$,J>5),O.timer=window.setTimeout(C,180)},450)}function _(M){const I=u.get(M.currentTarget);I&&clearTimeout(I.timer)}function T(M,I,$){const x=u.get(M.currentTarget);if(x?.held){x.held=!1;return}f(I,$,!1)}return(M,I)=>(h(),m("div",{class:ue(["settings",{offline:s.value}]),id:"general-settings"},[i("span",dp,y(r.value),1),t.value?(h(),m("div",fp,[(h(!0),m(U,null,ie(o.value,$=>(h(),m("section",{key:$.title,class:"set-card"},[i("h4",null,[i("span",pp,y(v(be)($.icon)),1),ee(y($.title),1)]),(h(!0),m(U,null,ie($.rows,x=>(h(),m("div",{key:x.key,class:ue(["srow",[`setting-${x.kind}`,{inactive:!a(x)||l(x)}]]),"data-setting":x.key,title:l(x)&&!s.value?"This entity is off in Home Assistant, or the screen is restarting.":"",onClick:O=>x.kind==="toggle"&&O.target.closest(".srow")===O.currentTarget&&!O.target.closest("button")&&!l(x)&&v(Nn)(x.key,!n.value[x.key],150)},[i("span",{class:"s-label",id:`setting-label-${x.key}`},y(x.label),9,vp),i("div",mp,[x.kind==="toggle"?(h(),m("button",{key:0,type:"button",class:ue(["switch",{unknown:n.value[x.key]===null||n.value[x.key]===void 0}]),role:"switch",id:`setting-${x.key}`,"aria-checked":n.value[x.key]?"true":"false","aria-labelledby":`setting-label-${x.key}`,disabled:l(x),onClick:it(O=>v(Nn)(x.key,!n.value[x.key],150),["stop"])},null,10,yp)):x.kind==="choice"?(h(),m("div",{key:1,class:"seg",role:"group","aria-labelledby":`setting-label-${x.key}`},[(h(!0),m(U,null,ie(x.options,([O,J])=>(h(),m("button",{key:String(O),type:"button","aria-pressed":n.value[x.key]===O?"true":"false",disabled:l(x),onClick:C=>v(Nn)(x.key,O,150)},y(J),9,bp))),128))],8,gp)):(h(),m("div",wp,[i("button",{type:"button","aria-label":`${x.label} lower`,disabled:d(x,-1),onPointerdown:O=>p(O,x,-1),onPointerup:_,onPointercancel:_,onPointerleave:_,onClick:O=>T(O,x,-1)},[i("span",kp,y(v(be)("F0374")),1)],40,_p),i("output",{id:`setting-${x.key}`,"aria-labelledby":`setting-label-${x.key}`},y(v(Vc)(x,n.value)),9,$p),i("button",{type:"button","aria-label":`${x.label} higher`,disabled:d(x,1),onPointerdown:O=>p(O,x,1),onPointerup:_,onPointercancel:_,onPointerleave:_,onClick:O=>T(O,x,1)},[i("span",Sp,y(v(be)("F0415")),1)],40,xp)]))])],10,hp))),128))]))),128))])):H("",!0)],2))}}),Ap={class:"seg wrap",role:"group"},Tp=["disabled","aria-pressed","onClick"],at=Ce({__name:"Segmented",props:{choices:{},value:{},disabled:{type:Boolean}},emits:["pick"],setup(e,{emit:t}){const n=t;return(s,o)=>(h(),m("div",Ap,[(h(!0),m(U,null,ie(e.choices,([l,a])=>(h(),m("button",{key:String(l),type:"button",disabled:e.disabled,"aria-pressed":String(l)===String(e.value)?"true":"false",onClick:r=>n("pick",l)},y(a),9,Tp))),128))]))}}),Ep={class:"f"},Pp={key:0},Op={key:1,class:"warn"},Ip=["aria-expanded"],Mp={class:"tx"},Lp={key:0,class:"mono"},Dp={class:"link"},Fp={key:0,class:"picker"},Np={class:"action-list"},Rp=["aria-pressed","onClick"],Hp={key:0,class:"hint"},Up={key:1,class:"warn"},jp={class:"f-label"},Bp=["aria-label","value","onChange"],Vp=["value"],Wp={key:3,class:"action-number"},Kp=["aria-label","value","onInput"],qp=["onClick"],Yp={key:4,class:"action-number"},zp=["aria-label","min","max","step","value","placeholder","onInput"],Jp={key:0},Gp=["aria-label","value","placeholder","onInput"],Xp={key:6},Qp={key:0,class:"warn"},Zp={key:3},eh=Ce({__name:"ActionPicker",props:{tile:{}},setup(e){const t=e,n=k(()=>c.entityActions[t.tile.entity]),s=k(()=>t.tile.options?.action),o=k(()=>n.value?.find(C=>C.action===s.value?.action)),l=k(()=>c.actionPickerOpen||!s.value),a=k(()=>{const C=c.actionSearch.trim().toLocaleLowerCase();return(n.value||[]).filter(z=>`${z.name} ${z.action} ${z.description}`.toLocaleLowerCase().includes(C))});n.value===void 0&&Tc(t.tile.entity);function r(C){const z=C.action===s.value?.action;t.tile.options={...t.tile.options,action:z?s.value:{action:C.action}},c.actionPickerOpen=!1,Qe()}function d(C,z){const P={...t.tile.options?.action?.data||{}};z===void 0?delete P[C]:P[C]=z,t.tile.options={...t.tile.options,action:{action:s.value.action,...Object.keys(P).length?{data:P}:{}}},Qe()}const u=k(()=>{if(!o.value)return[];const C=t.tile.options?.action?.data||{};return o.value.fields.filter(z=>z.required&&C[z.key]===void 0).map(z=>z.name)}),f=C=>Object.keys(C.selector||{})[0]||"text",p=C=>(C.selector||{})[f(C)]||{},_=C=>C.example===void 0?"":typeof C.example=="string"?C.example:JSON.stringify(C.example);function T(C){const z=p(C),P=f(C);return Array.isArray(C.options)?C.options.map(S=>[S,S]):P==="select"&&Array.isArray(z.options)&&!z.multiple?z.options.map(S=>S&&typeof S=="object"?[String(S.value),String(S.label??S.value)]:[String(S),String(S)]):null}const M=C=>"#"+C.map(z=>Math.max(0,Math.min(255,Number(z)||0)).toString(16).padStart(2,"0")).join(""),I=C=>Array.isArray(C)&&C.length===3?M(C):"#ffffff",$=C=>C===void 0?"":typeof C=="string"?C:JSON.stringify(C);function x(C,z){const P=z.trim();if(!P)return d(C.key,void 0);if(f(C)==="text")return d(C.key,z);try{d(C.key,JSON.parse(P))}catch{d(C.key,z)}}function O(C,z){d(C.key,z===""||!Number.isFinite(Number(z))?void 0:Number(z))}const J=C=>p(C).unit_of_measurement||f(C)==="color_temp"&&p(C).unit||"";return(C,z)=>(h(),m("div",Ep,[z[3]||(z[3]=i("span",{class:"f-label"},"Action",-1)),n.value===void 0?(h(),m("small",Pp,"Asking Home Assistant which actions this entity has…")):n.value===null?(h(),m("small",Op,"Home Assistant isn't answering right now. Try again in a moment.")):(h(),m(U,{key:2},[i("button",{type:"button",class:"row","aria-expanded":l.value?"true":"false",onClick:z[0]||(z[0]=P=>v(c).actionPickerOpen=!l.value)},[i("span",Mp,[i("b",null,y(o.value?o.value.name:s.value?s.value.action:"Choose an action"),1),s.value?(h(),m("small",Lp,y(s.value.action),1)):H("",!0)]),i("span",Dp,y(l.value?"Close":"Change"),1)],8,Ip),l.value?(h(),m("div",Fp,[ye(i("input",{"onUpdate:modelValue":z[1]||(z[1]=P=>v(c).actionSearch=P),type:"search",placeholder:"Search, for example toggle, position, or play","aria-label":"Search for an action"},null,512),[[Ie,v(c).actionSearch]]),i("div",Np,[(h(!0),m(U,null,ie(a.value,P=>(h(),m("button",{key:P.action,type:"button",class:"action-choice","aria-pressed":P.action===s.value?.action?"true":"false",onClick:S=>r(P)},[i("strong",null,y(P.name),1),i("small",null,y(P.description?`${P.action} · ${P.description}`:P.action),1)],8,Rp))),128)),a.value.length?H("",!0):(h(),m("p",Hp,"No action found."))])])):H("",!0),s.value&&!o.value?(h(),m("small",Up,"Home Assistant doesn't offer this action for this entity any more, so a tap does nothing. Choose another one.")):H("",!0),o.value&&!l.value?(h(),m(U,{key:2},[(h(!0),m(U,null,ie(o.value.fields,P=>(h(),m("div",{key:P.key,class:"f"},[i("span",jp,y(P.required?P.name:`${P.name} (optional)`),1),f(P)==="boolean"?(h(),Ke(at,{key:0,choices:[["","Not set"],["true","On"],["false","Off"]],value:s.value?.data?.[P.key]===void 0?"":String(s.value?.data?.[P.key]),onPick:S=>d(P.key,S===""?void 0:S==="true")},null,8,["value","onPick"])):T(P)&&T(P).length<=4?(h(),Ke(at,{key:1,choices:[["","Not set"],...T(P)],value:s.value?.data?.[P.key]===void 0?"":String(s.value?.data?.[P.key]),onPick:S=>d(P.key,S===""?void 0:S)},null,8,["choices","value","onPick"])):T(P)?(h(),m("select",{key:2,"aria-label":P.name,value:String(s.value?.data?.[P.key]??""),onChange:S=>d(P.key,S.target.value===""?void 0:S.target.value)},[z[2]||(z[2]=i("option",{value:""},"Not set",-1)),(h(!0),m(U,null,ie(T(P),([S,b])=>(h(),m("option",{key:S,value:S},y(b),9,Vp))),128))],40,Bp)):f(P)==="color_rgb"?(h(),m("div",Wp,[i("input",{type:"color","aria-label":P.name,value:I(s.value?.data?.[P.key]),onInput:S=>d(P.key,[1,3,5].map(b=>parseInt(S.target.value.slice(b,b+2),16)))},null,40,Kp),i("button",{type:"button",class:"btn quiet mini",onClick:S=>d(P.key,void 0)},"Not set",8,qp)])):f(P)==="number"||f(P)==="color_temp"?(h(),m("div",Yp,[i("input",{type:"number","aria-label":P.name,min:p(P).min,max:p(P).max,step:p(P).step==="any"?"any":p(P).step,value:s.value?.data?.[P.key]??"",placeholder:_(P),onInput:S=>O(P,S.target.value)},null,40,zp),J(P)?(h(),m("span",Jp,y(J(P)),1)):H("",!0)])):(h(),m("input",{key:5,type:"text","aria-label":P.name,value:$(s.value?.data?.[P.key]),placeholder:_(P),onInput:S=>x(P,S.target.value)},null,40,Gp)),P.description?(h(),m("small",Xp,y(P.description),1)):H("",!0)]))),128)),u.value.length?(h(),m("small",Qp,"Home Assistant needs "+y(u.value.join(", "))+".",1)):H("",!0)],64)):H("",!0),v(wn)(0,2,58)?H("",!0):(h(),m("small",Zp,"The screen performs an action from firmware 0.2.58: press Update on the screen. Until then a tap works as Automatic."))],64))]))}}),th={class:"f"},nh=["aria-expanded"],sh={class:"av mdi"},oh={class:"tx"},ih={class:"link"},lh={key:0,class:"picker"},ah=["aria-pressed","title"],rh={class:"mdi"},uh=["aria-pressed"],ch={class:"icon-list"},dh={class:"icon-grid"},fh=["title","aria-label","aria-pressed","onClick"],ph={class:"mdi"},hh={key:0,class:"hint"},vh={key:1},Ma=Ce({__name:"IconPicker",props:{selected:{},automatic:{},autoLabel:{},allowNone:{type:Boolean},note:{}},emits:["pick"],setup(e,{emit:t}){const n=e,s=t,o=fe(""),l=k(()=>ls(n.selected)),a=k(()=>n.selected==="none"?"":be(l.value?.cp||n.automatic)),r=k(()=>n.selected==="none"?"No icon":l.value?.label||n.autoLabel),d=k(()=>{const u=o.value.trim().toLocaleLowerCase();return(c.inventory.icons?.groups||[]).map(f=>({label:f.label,icons:f.icons.filter(p=>!u||`${p.label} ${p.name.replaceAll("-"," ")} ${f.label}`.toLocaleLowerCase().includes(u))})).filter(f=>f.icons.length)});return(u,f)=>(h(),m("div",th,[f[5]||(f[5]=i("span",{class:"f-label"},"Icon",-1)),i("button",{type:"button",class:"row","aria-expanded":v(c).iconPickerOpen?"true":"false",onClick:f[0]||(f[0]=p=>v(c).iconPickerOpen=!v(c).iconPickerOpen)},[i("span",sh,y(a.value),1),i("span",oh,[i("b",null,y(r.value),1)]),i("span",ih,y(v(c).iconPickerOpen?"Close":"Change"),1)],8,nh),v(c).iconPickerOpen?(h(),m("div",lh,[ye(i("input",{"onUpdate:modelValue":f[1]||(f[1]=p=>o.value=p),type:"search",placeholder:"Search, for example lamp, music, or door","aria-label":"Search for an icon"},null,512),[[Ie,o.value]]),i("button",{type:"button",class:"icon-choice icon-auto","aria-pressed":e.selected==="auto"?"true":"false",title:e.autoLabel,onClick:f[2]||(f[2]=p=>s("pick","auto"))},[i("span",rh,y(v(be)(e.automatic)),1),i("span",null,y(e.autoLabel),1)],8,ah),e.allowNone?(h(),m("button",{key:0,type:"button",class:"icon-choice icon-auto","aria-pressed":e.selected==="none"?"true":"false",title:"No icon",onClick:f[3]||(f[3]=p=>s("pick","none"))},[...f[4]||(f[4]=[i("span",{class:"mdi"},null,-1),i("span",null,"No icon, text only",-1)])],8,uh)):H("",!0),i("div",ch,[(h(!0),m(U,null,ie(d.value,p=>(h(),m("section",{key:p.label},[i("small",null,y(p.label),1),i("div",dh,[(h(!0),m(U,null,ie(p.icons,_=>(h(),m("button",{key:_.name,type:"button",class:"icon-choice",title:_.label,"aria-label":`Icon: ${_.label}`,"aria-pressed":e.selected===_.name?"true":"false",onClick:T=>s("pick",_.name)},[i("span",ph,y(v(be)(_.cp)),1)],8,fh))),128))])]))),128)),d.value.length?H("",!0):(h(),m("p",hh,"No icon found."))])])):H("",!0),e.note?(h(),m("small",vh,y(e.note),1)):H("",!0)]))}}),mh={class:"dr-head"},yh={class:"tx"},gh={class:"mono"},bh={class:"dr-body"},wh={class:"f"},_h=["value","placeholder"],kh={class:"f"},$h={key:0,class:"warn"},xh={class:"f"},Sh={key:1,class:"f"},Ch={key:2,class:"f"},Ah={key:4,class:"f"},Th={key:0,class:"warn"},Eh={key:5,class:"f"},Ph={class:"f"},Oh={class:"sw"},Ih=["aria-label","aria-pressed","onClick"],Mh={class:"dr-foot"},Lh=Ce({__name:"TileInspector",props:{tile:{}},setup(e){const t=e,n=k(()=>t.tile.entity.split(".")[0]),s=k(()=>is(t.tile.entity)),o=k(()=>c.capabilities[t.tile.entity]),l=(q,W)=>t.tile.options?.[q]??W,a=k(()=>l("display",n.value==="screen"?"digital":"standard")),r=k(()=>{const q=n.value==="screen"?[["digital","Digital clock"],["analog","Analog clock"]]:[["standard","Name and status"],["watch","Large value"]],W=o.value;return n.value==="weather"&&(!W||W.displays.includes("forecast")||a.value==="forecast")&&q.push(["forecast","Weather forecast"]),n.value==="sensor"&&(!W||W.displays.includes("graph")||a.value==="graph")&&q.push(["graph","Graph"]),n.value==="sun"&&q.push(["sunpath","Sun path"]),q}),d=k(()=>{const q=o.value;return q&&a.value==="graph"&&!q.displays.includes("graph")?"Home Assistant has no numbers for this entity, so the graph stays empty. Choose another display.":q&&a.value==="forecast"&&!q.displays.includes("forecast")?"This weather service has no daily forecast in Home Assistant. Choose another display.":""}),u=k(()=>l("size","single")),f=k(()=>c.inventory.controls?.[n.value]),p=k(()=>l("controls",f.value?.default)),_=k(()=>{const q=o.value;return(f.value?.choices||[]).filter(W=>!q||W.key==="none"||W.key===p.value||q.controls.includes(W.key)).map(W=>[W.key,W.label])}),T=k(()=>{const q=o.value;return q&&p.value!=="none"&&!q.controls.includes(p.value)?{text:"Home Assistant doesn't offer this control for this entity, so it stays empty on the screen. Choose another one.",warn:!0}:{text:wn(0,2,19)?"On the right of the double-width tile, like the rows in Home Assistant. Tapping the name works as set below.":"The screen shows direct control from firmware 0.2.19; until then the tile stays as it was.",warn:!1}}),M=k(()=>l("tap","auto")),I=k(()=>{const q=[["auto","Automatic"],["detail","Open control"],["none","View only"]];return((o.value?o.value.toggle:qi.includes(n.value))||M.value==="toggle")&&q.push(["toggle","On / off"]),q.push(["action","Perform action"]),q}),$=k(()=>M.value==="toggle"&&o.value&&!o.value.toggle?{text:"Home Assistant can't turn this on and off, so a tap does nothing. Choose another option.",warn:!0}:M.value==="toggle"&&!qi.includes(n.value)&&!wn(0,2,58)?{text:"The screen switches this from firmware 0.2.58: press Update on the screen. Until then a tap opens its card.",warn:!1}:M.value==="toggle"?{text:"Hold the tile to open its card.",warn:!1}:null),x=k(()=>l("inline","none")),O=k(()=>xc.includes(n.value)&&(!o.value||o.value.inline||x.value==="slider")),J=k(()=>x.value==="slider"&&o.value&&!o.value.inline),C=k(()=>l("history_hours",24)),z=k(()=>Object.entries(c.inventory.backgrounds||{})),P=k(()=>!!c.inventory.entities.find(q=>q.id===t.tile.entity)?.icon),S=k(()=>!!c.inventory.icons&&n.value!=="screen"&&!["forecast","sunpath"].includes(a.value));function b(q){t.tile.name=q,Qe()}function A(){c.inspector={kind:"inspect",entity:t.tile.entity}}return(q,W)=>(h(),m(U,null,[i("div",mh,[i("span",{class:"av mdi",style:Pe({color:v(bt)(e.tile.entity)[2],background:v(bt)(e.tile.entity)[3]})},y(v(be)(v(bs)(e.tile))),5),i("span",yh,[i("b",null,y(e.tile.name||s.value),1),i("small",gh,y(e.tile.entity),1)]),i("button",{type:"button",class:"icon-btn","aria-label":"Close",onClick:W[0]||(W[0]=(...le)=>v(Re)&&v(Re)(...le))},"✕")]),i("div",bh,[i("div",wh,[W[10]||(W[10]=i("label",{class:"f-label",for:"tile-name"},"Name on the screen",-1)),i("input",{id:"tile-name",value:e.tile.name,placeholder:s.value,maxlength:"60",onInput:W[1]||(W[1]=le=>b(le.target.value))},null,40,_h)]),S.value?(h(),Ke(Ma,{key:0,selected:e.tile.options?.icon||"auto",automatic:v(Xt)(e.tile.entity),"auto-label":`Automatic (${P.value?"from Home Assistant":"default"})`,note:v(wn)(0,2,18)?"":"The screen shows a chosen icon from firmware 0.2.18.",onPick:W[2]||(W[2]=le=>v(Bt)(e.tile,"icon",le))},null,8,["selected","automatic","auto-label","note"])):H("",!0),i("div",kh,[W[11]||(W[11]=i("span",{class:"f-label"},"Display",-1)),$e(at,{choices:r.value,value:a.value,onPick:W[3]||(W[3]=le=>v(Bt)(e.tile,"display",le))},null,8,["choices","value"]),d.value?(h(),m("small",$h,y(d.value),1)):H("",!0)]),i("div",xh,[W[12]||(W[12]=i("span",{class:"f-label"},"Width",-1)),$e(at,{choices:[["single","Normal"],["wide","Double-width"]],value:u.value,onPick:W[4]||(W[4]=le=>v(Bt)(e.tile,"size",le))},null,8,["value"])]),f.value&&u.value==="wide"?(h(),m("div",Sh,[W[13]||(W[13]=i("span",{class:"f-label"},"Direct control on the tile",-1)),$e(at,{choices:_.value,value:p.value,onPick:W[5]||(W[5]=le=>v(Bt)(e.tile,"controls",le))},null,8,["choices","value"]),i("small",{class:ue({warn:T.value.warn})},y(T.value.text),3)])):H("",!0),n.value!=="screen"?(h(),m("div",Ch,[W[14]||(W[14]=i("span",{class:"f-label"},"On tap",-1)),$e(at,{choices:I.value,value:M.value,onPick:W[6]||(W[6]=le=>v(Bt)(e.tile,"tap",le))},null,8,["choices","value"]),$.value?(h(),m("small",{key:0,class:ue({warn:$.value.warn})},y($.value.text),3)):H("",!0)])):H("",!0),n.value!=="screen"&&M.value==="action"?(h(),Ke(eh,{key:3,tile:e.tile},null,8,["tile"])):H("",!0),O.value?(h(),m("div",Ah,[W[15]||(W[15]=i("span",{class:"f-label"},"Small slider on the tile",-1)),$e(at,{choices:[["none","No"],["slider","Yes, control directly"]],value:x.value,onPick:W[7]||(W[7]=le=>v(Bt)(e.tile,"inline",le))},null,8,["value"]),J.value?(h(),m("small",Th,"Home Assistant has nothing a slider can change for this entity. Choose No.")):H("",!0)])):H("",!0),n.value==="sensor"?(h(),m("div",Eh,[W[16]||(W[16]=i("span",{class:"f-label"},"History",-1)),$e(at,{choices:[[1,"1 hour"],[6,"6 hours"],[24,"24 hours"]],value:C.value,onPick:W[8]||(W[8]=le=>v(Bt)(e.tile,"history_hours",Number(le)))},null,8,["value"])])):H("",!0),i("div",Ph,[W[17]||(W[17]=i("span",{class:"f-label"},"Pastel background",-1)),i("div",Oh,[(h(!0),m(U,null,ie(z.value,([le,Z])=>(h(),m("button",{key:le,type:"button","aria-label":`Background: ${Z.label}`,"aria-pressed":(e.tile.options?.background||"auto")===le?"true":"false",onClick:B=>v(Bt)(e.tile,"background",le)},[i("i",{class:ue(Z.color?"":le==="none"?"none":"auto"),style:Pe(Z.color?{background:Z.color}:void 0)},null,6),ee(y(Z.label),1)],8,Ih))),128))])])]),i("div",Mh,[i("button",{type:"button",class:"btn danger",onClick:W[9]||(W[9]=le=>v(xa)(e.tile))},"Remove"),W[18]||(W[18]=i("span",{class:"spacer"},null,-1)),n.value!=="screen"?(h(),m("button",{key:0,type:"button",class:"btn quiet",onClick:A},"Read current data")):H("",!0)])],64))}}),Dh={class:"dr-head"},Fh={class:"av mdi",style:{background:"var(--seg)",color:"var(--ink-2)"}},Nh={class:"tx"},Rh={class:"dr-body"},Hh={class:"f"},Uh=["value"],jh={class:"f"},Bh={class:"f-label",id:"topbar-caption"},Vh={style:{"text-transform":"none","letter-spacing":"0","font-weight":"500"}},Wh={class:"items",id:"topbar-chips",role:"list","aria-labelledby":"topbar-caption"},Kh=["data-index","aria-label","onPointerdown","onClick","onKeydown"],qh={class:"tx"},Yh=["aria-label","onClick"],zh=["disabled","title"],Jh={class:"live",id:"topbar-live"},Gh={class:"f"},Xh={class:"f"},Qh={key:1,class:"f"},Zh={key:2},ev={key:0,class:"dr-foot"},tv=["disabled"],nv=["disabled"],sv=Ce({__name:"TopbarInspector",props:{index:{}},setup(e){const t=e,n=k(()=>Ht()),s=k(()=>n.value[t.index]),o=k(()=>(c.fontsVersion,c.now,c.topbarPreviews,fa(n.value,_a.value,c.layout?.title||"Home",Vt))),l=k(()=>o.value.dropped),a=k(()=>c.inventory.header?.min_firmware||"0.2.32"),r=k(()=>{const[Z,B,X]=a.value.split(".").map(Number);return wn(Z,B,X)}),d=k(()=>r.value?l.value.size?"Not everything fits next to the name: the screen drops the dashed items. Remove one or choose a shorter name.":"Drag to reorder; tap an item to configure it.":`Sensors, the date, and the analog clock appear from firmware ${a.value}; until that update, this screen shows the name and, if the time is in the bar, the clock.`),u=(Z,B)=>{const X=Vt(Z);return X.shown?l.value.has(B)?"Doesn't fit next to the name":X.analog?"Dial":X.text:"Hidden: not active right now"},f=Z=>{const B=Vt(Z);return B.analog||Z.type!=="entity"?ls(da[Z.type])?.cp:B.icon},p=Z=>c.topbarAdded?.key===je(Z)&&Date.now()-c.topbarAdded.time<1200;function _(Z){c.layout&&(c.layout.title=Z,Qe())}function T(Z){const B=[...n.value];B[t.index]={...B[t.index],...Z},Zn(B)}const M=k(()=>s.value?Vt(s.value).shown?l.value.has(t.index)?"Doesn't currently fit next to the name":"How it looks on the screen":"Hidden right now: not active":""),I=k(()=>Cn().clock_24h!==!1),$=k(()=>({clock:ti(I.value,new Date(c.now)),analog:"Small dial with the time",date:ni(new Date(c.now))})),x=fe({index:-1,active:!1,moved:!1});let O=null,J=0,C=null,z=0;function P(Z,B){Z.button!==0||Z.target.closest(".x")||(Z.pointerType!=="touch"&&Z.preventDefault(),x.value={index:B,active:!1,moved:!1},O={x:Z.clientX,y:Z.clientY},C=Z.pointerId,clearTimeout(J),Z.pointerType==="touch"&&(J=window.setTimeout(S,260)),document.addEventListener("pointermove",A),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",q))}function S(){x.value.active=!0,document.addEventListener("touchmove",b,{passive:!1})}function b(Z){x.value.active&&Z.preventDefault()}function A(Z){if(Z.pointerId!==C||!O)return;if(!x.value.active){const ce=Math.hypot(Z.clientX-O.x,Z.clientY-O.y);if(Z.pointerType==="touch"){ce>10&&(clearTimeout(J),O=null);return}if(ce<6)return;S()}const B=[...document.querySelectorAll(".items .item[data-index]")];let X=x.value.index;if(B.forEach((ce,V)=>{const Q=ce.getBoundingClientRect();V<x.value.index&&Z.clientY<Q.top+Q.height/2&&(X=Math.min(X,V)),V>x.value.index&&Z.clientY>Q.top+Q.height/2&&(X=Math.max(X,V))}),X!==x.value.index&&c.layout){const ce=[...n.value];ce.splice(X,0,...ce.splice(x.value.index,1)),c.layout.header={items:ce};const V=t.index===x.value.index;x.value.index=X,x.value.moved=!0,V&&Pt(X)}}function q(Z){Z.pointerId===C&&(clearTimeout(J),document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",q),document.removeEventListener("touchmove",b),x.value.active&&(z=Date.now()+400,x.value.moved&&Qe()),x.value={index:-1,active:!1,moved:!1},O=null,C=null)}function W(Z){Date.now()<z||Pt(Z)}function le(Z,B){if(Z.key==="Enter"||Z.key===" "){Z.preventDefault(),Pt(B);return}const X={ArrowUp:-1,ArrowDown:1}[Z.key];X&&yo(B,B+X)&&(t.index===B&&Pt(B+X),Z.preventDefault())}return(Z,B)=>(h(),m(U,null,[i("div",Dh,[i("span",Fh,y(s.value?v(be)(f(s.value)||"F0150"):v(be)("F0150")),1),i("span",Nh,[i("b",null,y(s.value?s.value.type==="entity"?v(is)(s.value.entity):v(Fn)(s.value):"Top bar"),1),i("small",{class:ue({mono:s.value?.type==="entity"})},y(s.value?s.value.type==="entity"?s.value.entity:"From the screen itself, also works without Home Assistant":`${n.value.length} of ${v(Kt)()} items`),3)]),i("button",{type:"button",class:"icon-btn","aria-label":"Close",onClick:B[0]||(B[0]=(...X)=>v(Re)&&v(Re)(...X))},"✕")]),i("div",Rh,[i("div",Hh,[B[10]||(B[10]=i("label",{class:"f-label",for:"title"},"Left: name",-1)),i("input",{id:"title",value:v(c).layout?.title,maxlength:"60",placeholder:"For example: Living room",onInput:B[1]||(B[1]=X=>_(X.target.value))},null,40,Uh)]),i("div",jh,[i("span",Bh,[B[11]||(B[11]=ee("Right: time, sensors, or a clock ",-1)),i("span",Vh," · "+y(n.value.length)+" / "+y(v(Kt)()),1)]),i("div",Wh,[(h(!0),m(U,null,ie(n.value,(X,ce)=>(h(),m("div",{key:v(je)(X)+ce,class:ue(["item",{selected:ce===e.index,"is-hidden":!v(Vt)(X).shown,"is-overflow":l.value.has(ce),"just-added":p(X),"dragging-chip":x.value.active&&x.value.index===ce}]),role:"listitem",tabindex:"0","data-index":ce,"aria-label":`${v(Fn)(X)}, slot ${ce+1}. Enter: configure, arrows: move`,onPointerdown:V=>P(V,ce),onClick:V=>W(ce),onKeydown:V=>le(V,ce)},[B[12]||(B[12]=i("span",{class:"grip","aria-hidden":"true"},"⋮⋮",-1)),i("span",{class:"av mdi",style:Pe(v(Vt)(X).color?{color:v(Vt)(X).color}:void 0)},y(f(X)?v(be)(f(X)):""),5),i("span",qh,[i("b",null,y(v(Fn)(X)),1),i("small",null,y(u(X,ce)),1)]),i("button",{type:"button",class:"x","aria-label":`Remove ${v(Fn)(X)} from the top bar`,onClick:it(V=>v(Qi)(ce),["stop"])},"✕",8,Yh)],42,Kh))),128)),i("button",{type:"button",class:"ghost-btn",id:"topbar-add",disabled:n.value.length>=v(Kt)(),title:n.value.length>=v(Kt)()?`Maximum ${v(Kt)()} items`:"Add the time, date, analog clock, or an entity",onClick:B[2]||(B[2]=(...X)=>v(Ji)&&v(Ji)(...X))},"+ Add time, date, or an entity",8,zh)]),i("small",{id:"topbar-hint",class:ue({warn:l.value.size>0&&r.value})},y(d.value),3)]),s.value?(h(),m(U,{key:0},[i("div",Jh,[i("small",null,y(M.value),1),$e(Ia,{items:[s.value],single:""},null,8,["items"])]),s.value.type==="entity"?(h(),m(U,{key:0},[i("div",Gh,[B[13]||(B[13]=i("span",{class:"f-label"},"What to show",-1)),$e(at,{choices:(v(c).inventory.header?.contents||[]).map(X=>[X.key,X.label]),value:s.value.content,onPick:B[3]||(B[3]=X=>T({content:X}))},null,8,["choices","value"]),B[14]||(B[14]=i("small",null,"Last changed keeps counting on the screen itself: “Just now”, “5 min ago”, “Yesterday”.",-1))]),$e(Ma,{selected:s.value.icon||"auto",automatic:v(c).topbarPreviews[v(je)(s.value)]?.auto_icon||v(Xt)(s.value.entity),"auto-label":"Automatic (like Home Assistant)","allow-none":"",onPick:B[4]||(B[4]=X=>T({icon:X}))},null,8,["selected","automatic"]),i("div",Xh,[B[15]||(B[15]=i("span",{class:"f-label"},"Show",-1)),$e(at,{choices:(v(c).inventory.header?.shows||[]).map(X=>[X.key,X.label]),value:s.value.show,onPick:B[5]||(B[5]=X=>T({show:X}))},null,8,["choices","value"]),B[16]||(B[16]=i("small",null,"Only when active hides the item as long as it's off, closed, away, or 0. Handy for an open door, a running washing machine, or who's home.",-1))])],64)):s.value.type!=="date"?(h(),m("div",Qh,[B[17]||(B[17]=i("span",{class:"f-label"},"Format",-1)),$e(at,{choices:[["24","24 hour"],["12","12 hour"]],value:I.value?"24":"12",onPick:B[6]||(B[6]=X=>v(Nn)("clock_24h",X==="24",150))},null,8,["value"]),B[18]||(B[18]=i("small",null,"The screen's own clock setting: it applies at once to every clock on this screen, including the clock tiles.",-1))])):(h(),m("small",Zh,y($.value.date)+" today. The date follows the screen's own clock.",1))],64)):H("",!0)]),s.value?(h(),m("div",ev,[i("button",{type:"button",class:"btn danger",onClick:B[7]||(B[7]=X=>v(Qi)(e.index))},"Remove"),B[19]||(B[19]=i("span",{class:"spacer"},null,-1)),i("button",{type:"button",class:"btn quiet",disabled:e.index===0,onClick:B[8]||(B[8]=X=>v(yo)(e.index,e.index-1)&&v(Pt)(e.index-1))},"↑ Up",8,tv),i("button",{type:"button",class:"btn quiet",disabled:e.index>=n.value.length-1,onClick:B[9]||(B[9]=X=>v(yo)(e.index,e.index+1)&&v(Pt)(e.index+1))},"↓ Down",8,nv)])):H("",!0)],64))}}),ov={class:"dr-head"},iv={class:"tx"},lv={class:"dr-body"},av={class:"f"},rv={class:"options"},uv=["disabled","onClick"],cv={class:"mdi"},dv={class:"tx"},fv={key:0,class:"f"},pv={class:"options"},hv=["disabled","onClick"],vv={class:"mdi"},mv={class:"tx"},yv={class:"f"},gv={class:"options"},bv=["disabled","onClick"],wv={class:"mdi"},_v={class:"tx"},kv={key:0,class:"hint"},$v={key:1,class:"hint"},xv={class:"dr-foot"},Sv=Ce({__name:"TopbarAdd",setup(e){const t=fe(""),n=k(()=>new Set(Ht().map(je))),s=k(()=>Cn().clock_24h!==!1),o=k(()=>({clock:ti(s.value,new Date(c.now)),analog:"Small dial with the time",date:ni(new Date(c.now))})),l=k(()=>c.inventory.header?.suggestions?.[c.selected||""]||[]),a=k(()=>{const d=t.value.trim().toLocaleLowerCase();return c.inventory.entities.filter(u=>`${u.name} ${u.id} ${u.area||""} ${u.device||""}`.toLocaleLowerCase().includes(d))}),r=d=>({type:"entity",entity:d,content:"state",icon:"auto",show:"always"});return(d,u)=>(h(),m(U,null,[i("div",ov,[u[4]||(u[4]=i("span",{class:"av",style:{background:"var(--seg)",color:"var(--ink-2)","font-size":"18px"}},"+",-1)),i("span",iv,[u[3]||(u[3]=i("b",null,"Add to the top bar",-1)),i("small",null,y(v(Ht)().length)+" of "+y(v(Kt)())+" slots used",1)]),i("button",{type:"button",class:"icon-btn","aria-label":"Close",onClick:u[0]||(u[0]=(...f)=>v(Re)&&v(Re)(...f))},"✕")]),i("div",lv,[i("div",av,[u[5]||(u[5]=i("span",{class:"f-label"},"From the screen itself",-1)),i("div",rv,[(h(!0),m(U,null,ie(v(c).inventory.header?.builtin||[],f=>(h(),m("button",{key:f.type,type:"button",class:"option",disabled:n.value.has(v(je)({type:f.type})),onClick:p=>v(go)({type:f.type})},[i("span",cv,y(v(be)(v(ls)(v(da)[f.type])?.cp||"F0150")),1),i("span",dv,[i("strong",null,y(f.label),1),i("small",null,y(n.value.has(v(je)({type:f.type}))?"Already added":o.value[f.type]),1)])],8,uv))),128))])]),l.value.length?(h(),m("div",fv,[u[6]||(u[6]=i("span",{class:"f-label"},"Suggestions from Home Assistant",-1)),i("div",pv,[(h(!0),m(U,null,ie(l.value,f=>(h(),m("button",{key:v(je)(f.item),type:"button",class:"option",disabled:n.value.has(v(je)(f.item)),onClick:p=>v(go)(f.item)},[i("span",vv,y(v(be)(f.icon||v(Xt)(f.item.entity))),1),i("span",mv,[i("strong",null,y(f.label),1),i("small",null,y(n.value.has(v(je)(f.item))?"Already added":[f.name,f.area].filter(Boolean).join(" · ")),1)])],8,hv))),128))])])):H("",!0),i("div",yv,[u[7]||(u[7]=i("label",{class:"f-label",for:"topbar-search"},"An entity",-1)),ye(i("input",{id:"topbar-search","onUpdate:modelValue":u[1]||(u[1]=f=>t.value=f),type:"search",placeholder:"Search by name, room, or entity, e.g. temperature or door","aria-label":"Search for an entity for the top bar"},null,512),[[Ie,t.value]]),i("div",gv,[(h(!0),m(U,null,ie(a.value.slice(0,40),f=>(h(),m("button",{key:f.id,type:"button",class:"option",disabled:n.value.has(v(je)(r(f.id))),onClick:p=>v(go)(r(f.id))},[i("span",wv,y(v(be)(v(Xt)(f.id))),1),i("span",_v,[i("strong",null,y(f.name),1),i("small",null,y([f.area,f.id].filter(Boolean).join(" · ")),1)])],8,bv))),128)),a.value.length?a.value.length>40?(h(),m("p",$v,y(a.value.length)+" results. Keep typing to narrow it down.",1)):H("",!0):(h(),m("p",kv,"No entities found."))])])]),i("div",xv,[u[8]||(u[8]=i("span",{class:"spacer"},null,-1)),i("button",{type:"button",class:"btn quiet",onClick:u[2]||(u[2]=(...f)=>v(Re)&&v(Re)(...f))},"Cancel")])],64))}}),Cv={class:"dr-head"},Av={class:"tx"},Tv={class:"dr-body",id:"inspector-section"},Ev={id:"inspection-summary"},Pv={key:0,class:"hint warn"},Ov={key:1,class:"hint"},Iv={id:"inspection"},Mv=Ce({__name:"InspectPanel",props:{entity:{}},setup(e){const t=e,n=fe(null),s=fe("Reading…"),o=fe("");async function l(){if(c.selected){n.value=null,o.value="",s.value="Fetching current HA status...";try{const r=await dt(`screens/${encodeURIComponent(c.selected)}/inspect`),d=t.entity?r.tiles.filter(u=>u.entity===t.entity):r.tiles;n.value=d,s.value=JSON.stringify(t.entity?d[0]:r,null,2)}catch(r){o.value=r.message,s.value="",Se(r.message)}}}const a=r=>{const d=c.layout?.tiles.find(u=>u.entity===r)?.options||{};return`Small slider: ${d.inline==="slider"?"yes":"no"} · Display: ${ba[d.display||"standard"]||d.display} · Width: ${d.size==="wide"?"double":"normal"} · Control: ${_c({entity:r,options:d},c.inventory)} · Background: ${c.inventory.backgrounds?.[d.background||"auto"]?.label||"Default"}`};return hn(l),an(()=>t.entity,l),(r,d)=>(h(),m(U,null,[i("div",Cv,[d[2]||(d[2]=i("span",{class:"av",style:{background:"var(--seg)",color:"var(--ink-2)","font-size":"16px"}},"⌕",-1)),i("span",Av,[d[1]||(d[1]=i("b",null,"Current data",-1)),i("small",{class:ue({mono:e.entity})},y(e.entity||"Connection, status, and supported properties"),3)]),i("button",{type:"button",class:"icon-btn","aria-label":"Close",onClick:d[0]||(d[0]=(...u)=>v(Re)&&v(Re)(...u))},"✕")]),i("div",Tv,[i("div",Ev,[o.value?(h(),m("p",Pv,y(o.value),1)):n.value?H("",!0):(h(),m("p",Ov,"Fetching current HA status...")),(h(!0),m(U,null,ie(n.value||[],u=>(h(),m("article",{key:u.entity,class:"inspection-tile"},[i("strong",null,y(u.entity),1),i("span",null,"Status: "+y(u.word||u.state),1),i("small",null,y(a(u.entity)),1)]))),128))]),i("pre",Iv,y(s.value),1)]),i("div",{class:"dr-foot"},[i("button",{type:"button",class:"btn quiet",onClick:l},"Read again"),d[3]||(d[3]=i("span",{class:"spacer"},null,-1))])],64))}}),Lv=["aria-hidden"],Dv=Ce({__name:"Drawer",setup(e){const t=k(()=>!!(c.inspector&&(c.inspector.kind!=="tile"||co.value)));return(n,s)=>(h(),m("aside",{class:ue(["drawer",{open:t.value}]),id:"tile-sheet","aria-hidden":t.value?"false":"true",onClick:s[0]||(s[0]=it(()=>{},["stop"]))},[v(c).inspector?(h(),m(U,{key:0},[v(c).inspector.kind==="tile"&&v(co)?(h(),Ke(Lh,{key:0,tile:v(co)},null,8,["tile"])):v(c).inspector.kind==="bar"?(h(),Ke(sv,{key:1,index:v(c).inspector.index},null,8,["index"])):v(c).inspector.kind==="bar-add"?(h(),Ke(Sv,{key:2})):v(c).inspector.kind==="inspect"?(h(),Ke(Mv,{key:3,entity:v(c).inspector.entity},null,8,["entity"])):H("",!0)],64)):H("",!0)],10,Lv))}}),Fv={class:"main-head"},Nv={class:"eyebrow",id:"screen-name"},Rv=["title"],Hv={class:"head-right"},Uv={class:"seg",role:"tablist"},jv=["aria-pressed"],Bv=["aria-pressed"],Vv={key:1,id:"dirty",class:"chip dirty"},Wv=["disabled"],Kv={key:0,class:"spin small"},qv=["aria-expanded"],Yv={key:3,class:"menu",role:"menu"},zv=["disabled","title"],Jv=["disabled","aria-expanded"],Gv={key:0,class:"sub"},Xv=["onClick"],Qv=["disabled","title"],Zv={class:"body",id:"body"},em=Ce({__name:"ScreenView",setup(e){const t=k(()=>Ct.value),n=k(()=>t.value.online?`${t.value.delivery} · ${t.value.status}`:"Offline · changes are saved"),s=k(()=>t.value.update?.available&&t.value.online&&t.value.update?.profile&&t.value.update?.host),o=k(()=>c.inventory.screens.filter(I=>I.id!==t.value.id&&I.layout?.tiles?.length)),l=fe(!1),a=fe(null);function r(){c.menuOpen=!1,l.value=!1}function d(){r(),c.overrideProfile=t.value.update?.profile||null,c.overrideFriendly=t.value.name,Ae("#override")}function u(){r(),c.selectedTile=null,c.inspector={kind:"inspect"}}function f(I){r(),!(c.dirty&&!confirm("Replace the unsaved layout with a copy of the other screen's?"))&&Dc(I)}function p(){r(),a.value?.click()}async function _(I){const $=I.target,x=$.files?.[0];$.value="",x&&(c.dirty&&!confirm("Replace the unsaved layout with the imported one?")||Nc(await x.text()))}function T(I){if(I.key==="Escape")if(c.menuOpen)r();else{if(c.palette)return;c.inspector&&!I.target?.closest?.(".picker")&&Re()}else(I.metaKey||I.ctrlKey)&&I.key.toLowerCase()==="s"&&(I.preventDefault(),c.dirty&&Mo())}function M(I){c.menuOpen&&!I.target.closest(".head-right .menu, #more")&&r()}return hn(()=>{document.addEventListener("keydown",T),document.addEventListener("click",M)}),An(()=>{document.removeEventListener("keydown",T),document.removeEventListener("click",M)}),(I,$)=>(h(),m(U,null,[i("header",Fv,[i("div",null,[i("span",Nv,y(t.value.name),1),i("h1",null,y(v(c).layout?.title||"Home"),1)]),i("span",{id:"delivery",class:ue(["chip",{off:!t.value.online}]),title:n.value},[$[9]||($[9]=i("span",{class:"dot"},null,-1)),ee(y(n.value),1)],10,Rv),i("div",Hv,[i("div",Uv,[i("button",{type:"button",id:"tab-layout",role:"tab","aria-pressed":v(c).tab==="layout"?"true":"false",onClick:$[0]||($[0]=x=>v(c).tab="layout")},"Layout",8,jv),i("button",{type:"button",id:"tab-settings",role:"tab","aria-pressed":v(c).tab==="settings"?"true":"false",onClick:$[1]||($[1]=x=>{v(c).tab="settings",v(Re)()})},"Screen settings",8,Bv)]),v(c).dirty?(h(),m("span",Vv,"Unsaved changes")):(h(),m("span",{key:0,id:"dirty",class:ue(["chip",{sent:v(c).saved}])},y(v(c).saved?"Saved · sent to screen":"All saved"),3)),v(c).dirty?(h(),m("button",{key:2,id:"save",type:"button",class:"btn primary",disabled:v(c).busy,title:"⌘S",onClick:$[2]||($[2]=x=>v(Mo)())},[v(c).busy?(h(),m("span",Kv)):H("",!0),ee(y(v(c).busy?"Saving…":"Save & send"),1)],8,Wv)):H("",!0),i("button",{id:"more",type:"button",class:"icon-btn","aria-label":"More","aria-haspopup":"menu","aria-expanded":v(c).menuOpen?"true":"false",onClick:$[3]||($[3]=it(x=>{v(c).menuOpen=!v(c).menuOpen,l.value=!1},["stop"]))},"···",8,qv),v(c).menuOpen?(h(),m("div",Yv,[i("button",{type:"button",role:"menuitem",id:"identify",disabled:!v(dn)(t.value)||!t.value.online,title:v(dn)(t.value)?"":"Needs firmware 0.2.31 or newer",onClick:$[4]||($[4]=x=>{r(),v(Sa)(t.value)})},[...$[10]||($[10]=[ee("Identify ",-1),i("small",null,"blink the screen",-1)])],8,zv),i("button",{type:"button",role:"menuitem",id:"inspect",onClick:u},[...$[11]||($[11]=[ee("Read current data ",-1),i("small",null,"from Home Assistant",-1)])]),$[17]||($[17]=i("div",{class:"sep"},null,-1)),i("button",{type:"button",role:"menuitem",id:"copy-layout",disabled:!o.value.length,"aria-expanded":l.value?"true":"false",onClick:$[5]||($[5]=it(x=>l.value=!l.value,["stop"]))},[$[12]||($[12]=ee("Copy layout from… ",-1)),i("small",null,y(o.value.length?`${o.value.length} screen${o.value.length===1?"":"s"}`:"no other screen"),1)],8,Jv),l.value?(h(),m("div",Gv,[(h(!0),m(U,null,ie(o.value,x=>(h(),m("button",{key:x.id,type:"button",role:"menuitem",onClick:O=>f(x.id)},[ee(y(x.name)+" ",1),i("small",null,y(x.layout.tiles.length)+" tiles",1)],8,Xv))),128))])):H("",!0),i("button",{type:"button",role:"menuitem",id:"export-layout",onClick:$[6]||($[6]=x=>{r(),v(Aa)()})},[...$[13]||($[13]=[ee("Export layout ",-1),i("small",null,"JSON",-1)])]),i("button",{type:"button",role:"menuitem",id:"import-layout",onClick:p},[...$[14]||($[14]=[ee("Import layout… ",-1),i("small",null,"JSON",-1)])]),$[18]||($[18]=i("div",{class:"sep"},null,-1)),i("button",{type:"button",role:"menuitem",id:"open-override",disabled:!t.value.update?.profile,title:t.value.update?.profile?"":"No ESPHome profile found for this screen",onClick:d},[...$[15]||($[15]=[ee("Override YAML ",-1),i("small",null,"advanced",-1)])],8,Qv),i("button",{type:"button",role:"menuitem",onClick:$[7]||($[7]=x=>{r(),v(Ae)("#firmware")})},"Firmware & USB"),s.value?(h(),m("button",{key:1,type:"button",role:"menuitem",onClick:$[8]||($[8]=x=>{r(),v(Do)(t.value)})},[$[16]||($[16]=ee("Update firmware ",-1)),i("small",null,y(t.value.update?.target),1)])):H("",!0)])):H("",!0),i("input",{ref_key:"fileInput",ref:a,type:"file",accept:"application/json,.json",hidden:"",onChange:_},null,544)])]),i("div",Zv,[v(c).tab==="layout"?(h(),Ke(cp,{key:0})):(h(),Ke(Cp,{key:1})),$e(Dv)])],64))}}),tm={key:0,id:"choose",class:"empty"},nm={key:1,id:"empty",class:"empty"},sm=Ce({__name:"EmptyState",setup(e){return(t,n)=>v(c).inventory.screens.length?(h(),m("section",tm,[...n[1]||(n[1]=[i("span",{class:"empty-icon"},"▦",-1),i("h2",null,"Choose a screen",-1),i("p",null,"Pick one of your screens on the left to change its tiles, top bar and settings.",-1)])])):(h(),m("section",nm,[n[2]||(n[2]=i("span",{class:"empty-icon"},"▦",-1)),n[3]||(n[3]=i("h2",null,"Start with a screen",-1)),n[4]||(n[4]=i("p",null,"Connect a CYD or Guition via USB to your Home Assistant machine. Profile, firmware, and the first flash happen in one go.",-1)),i("button",{id:"start",type:"button",class:"btn primary",onClick:n[0]||(n[0]=s=>v(Ae)("#new-screen"))},"Install new screen")]))}}),om={class:"panel",id:"settings-view"},im={class:"panel-head"},lm={class:"card-grid"},am={class:"card"},rm={class:"tools"},um={key:0,class:"card updates",id:"updates"},cm={id:"updates-hint"},dm=["aria-valuenow"],fm={class:"progress-text"},pm={key:0,class:"log-lines"},hm={key:2,class:"whatsnew"},vm={class:"check"},mm=["checked"],ym={class:"card"},gm={class:"tools"},bm={class:"card",id:"claude"},wm={class:"actions"},_m=["disabled"],km={id:"claude-path"},$m=Ce({__name:"AppSettingsView",setup(e){const t=k(()=>c.inventory.updates),n=k(()=>c.inventory.screens.filter(p=>p.update?.available).length),s=k(()=>t.value?t.value.busy?`Updating to firmware ${t.value.target}…`:c.inventory.screens.length?n.value?`Firmware ${t.value.target} is available for ${n.value} screen${n.value===1?"":"s"}.`:`All screens have firmware ${t.value.target}.`:`No screen paired yet. New screens get firmware ${t.value.target}.`:""),o=k(()=>c.inventory.screens.find(p=>p.update?.state==="running"||c.updating.includes(p.id))),l=k(()=>o.value?yn(o.value):null),a=k(()=>(c.firmwareJob?.logs||[]).slice(-12).join(`
|
||
`)),r=k(()=>{const p=t.value?.changelog,_=t.value?.target;return!p||!_?[]:p.filter(T=>T.firmware===_).flatMap(T=>T.lines).slice(0,10)}),d=k(()=>c.inventory.claude_skill),u=fe(!1);async function f(){u.value=!0;try{await Kc()}finally{u.value=!1}}return(p,_)=>(h(),m("div",om,[i("div",im,[_[6]||(_[6]=i("div",{class:"tx"},[i("span",{class:"eyebrow"},"Settings"),i("h1",{id:"settings-title"},"Everything around your screens.")],-1)),i("button",{type:"button",class:"btn quiet",id:"close-settings",onClick:_[0]||(_[0]=T=>v(Ae)(""))},"← My screens")]),i("div",lm,[i("section",am,[_[9]||(_[9]=i("h2",null,"Screens",-1)),_[10]||(_[10]=i("p",null,"Add a screen, or build and reinstall the firmware of one you already have.",-1)),i("div",rm,[i("button",{type:"button",class:"tool",onClick:_[1]||(_[1]=T=>v(Ae)("#new-screen"))},[..._[7]||(_[7]=[i("span",{class:"tool-icon"},"+",-1),i("span",{class:"tx"},[i("b",null,"New screen"),i("small",null,"Connect and install")],-1)])]),i("button",{type:"button",class:"tool",onClick:_[2]||(_[2]=T=>v(Ae)("#firmware"))},[..._[8]||(_[8]=[i("span",{class:"tool-icon"},"⇪",-1),i("span",{class:"tx"},[i("b",null,"Firmware & USB"),i("small",null,"Build and install via USB or Wi-Fi")],-1)])])])]),t.value?(h(),m("section",um,[_[12]||(_[12]=i("h2",null,"Firmware updates",-1)),i("p",cm,y(s.value),1),o.value&&l.value?(h(),m(U,{key:0},[i("div",{class:"progress",role:"progressbar","aria-valuenow":l.value.percent,"aria-valuemin":"0","aria-valuemax":"100"},[i("i",{style:Pe({width:l.value.percent+"%"})},null,4)],8,dm),i("div",fm,[i("span",null,y(o.value.name)+" · "+y(l.value.percent)+" %",1),i("span",null,y(l.value.text),1)]),a.value?(h(),m("pre",pm,y(a.value),1)):H("",!0)],64)):H("",!0),t.value.pending&&!t.value.busy&&t.value.pending>=2?(h(),m("button",{key:1,id:"update-all",type:"button",class:"btn primary",onClick:_[3]||(_[3]=(...T)=>v(el)&&v(el)(...T))},"Update all "+y(t.value.pending)+" screens",1)):H("",!0),r.value.length&&!v(Lo)()?(h(),m("details",hm,[i("summary",null,"What's new in firmware "+y(t.value.target),1),i("ul",null,[(h(!0),m(U,null,ie(r.value,T=>(h(),m("li",{key:T},y(T),1))),128))])])):H("",!0),i("label",vm,[i("input",{type:"checkbox",id:"auto-update",checked:!!t.value.auto,onChange:_[4]||(_[4]=T=>v(Wc)(T.target.checked))},null,40,mm),_[11]||(_[11]=i("span",null,[ee("Update automatically every night"),i("small",null,"Between 03:00 and 06:00, one screen at a time. Stops on an error and reports it in Home Assistant.")],-1))])])):H("",!0),i("section",ym,[_[14]||(_[14]=i("h2",null,"Alerts",-1)),_[15]||(_[15]=i("p",null,"A card over the whole screen from an automation, on one screen or on all of them. The cheatsheet has the action names, fields, icons, and colors, and a form to try one.",-1)),i("div",gm,[i("button",{type:"button",class:"tool",onClick:_[5]||(_[5]=T=>v(Ae)("#alerts"))},[..._[13]||(_[13]=[i("span",{class:"tool-icon"},"!",-1),i("span",{class:"tx"},[i("b",null,"Alerts"),i("small",null,"Full-screen notifications, from an automation")],-1)])])])]),i("section",bm,[_[18]||(_[18]=i("h2",null,"Claude",-1)),_[19]||(_[19]=i("p",null,'Teach Claude about ESP Screens, then ask: "Show an alert on all my screens when the mailbox is full." Claude knows the alert events, every field, color, and icon.',-1)),i("div",wm,[i("button",{type:"button",id:"claude-install",class:ue(["btn",d.value?.installed&&d.value.current?"quiet":"primary"]),disabled:!d.value||u.value,onClick:f},y(!d.value||!d.value.installed?"Install for Claude Code":d.value.current?"Install again":"Update the skill"),11,_m),i("span",{id:"claude-status",class:ue(["chip",d.value&&d.value.installed?d.value.current?"good":"update":""]),role:"status"},y(d.value?d.value.installed?d.value.current?"● Installed":"Installed · a newer version is ready":"Not installed":"Loading…"),3)]),i("small",null,[_[16]||(_[16]=ee("For Claude Code in Home Assistant. Writes one file to ",-1)),i("code",km,y(d.value?.path||"/homeassistant/.claude/skills/esp-screens"),1),_[17]||(_[17]=ee("; installing again replaces it.",-1))]),_[20]||(_[20]=i("div",{class:"actions"},[i("a",{class:"btn quiet",id:"claude-download",href:"api/claude-skill.zip",download:"esp-screens.zip"},"Download for claude.ai"),i("small",null,"Upload the zip in Claude under Customize → Skills.")],-1))])])]))}}),xm={class:"panel",id:"installer"},Sm={class:"panel-head"},Cm={class:"tx"},Am={id:"install-title"},Tm={key:0},Em={class:"boards"},Pm={class:"board"},Om={class:"board"},Im={class:"field"},Mm={class:"node-line"},Lm={id:"node-preview"},Dm={key:0,class:"field",id:"node-label"},Fm={key:1,id:"wifi-fields",class:"wifi"},Nm={class:"hint",id:"wifi-status"},Rm={key:0,class:"field",id:"wifi-ssid-label"},Hm={key:1,class:"field",id:"wifi-password-label"},Um={class:"field"},jm={key:0,value:"usb"},Bm=["value"],Vm={id:"target-hint"},Wm={key:2,class:"hint",id:"install-note"},Km={class:"actions"},qm=["disabled"],Ym={id:"install-status",class:"status-line error",role:"status"},zm={key:1,id:"install-progress",class:"card"},Jm={class:"progress-head"},Gm={key:0,class:"spin",id:"progress-spin"},Xm={id:"progress-title"},Qm={id:"progress-detail"},Zm={key:0,id:"install-download",class:"card",style:{background:"var(--surface-2)"}},ey=["href","download"],ty={class:"steps",id:"download-steps"},ny={key:1,id:"install-result",class:"field"},sy={class:"key-box"},oy={class:"steps",id:"install-steps"},iy=["open"],ly={id:"install-log",class:"log"},ay={class:"actions"},ry="https://web.esphome.io/?dashboard_install",uy="Download · flash from your own computer",cy=Ce({__name:"InstallerView",setup(e){const t=fn({board:"cyd",friendly_name:"",name:"",wifi_ssid:"",wifi_password:"",target:""}),n=fn({view:"setup",file:null,friendly:"",board:"cyd",target:"",apiKey:null,nodeEdited:!1,jobState:null,picked:!1,action:null}),s=fe(!1),o=fe(null),l=fe(null),a=fe([]),r=fe(""),d=fe(""),u=fe(!1),f=fe(!1),p=fe(null);let _=0;function T(pe){return pe.toLowerCase().normalize("NFD").replace(/[̀-ͯ]/g,"").replace(/[^a-z0-9]+/g,"-").replace(/^[^a-z]+/,"").slice(0,30).replace(/-+$/,"")||"screen"}function M(pe){const N=pe.replace(/^\/dev\/serial\/by-id\/usb-/,"").replace(/-if\d+(-port\d+)?$/,"").replace(/_/g," ");return`USB · ${N===pe?pe.replace(/^\/dev\//,""):N}`}an(()=>t.friendly_name,()=>{n.nodeEdited||(t.name=T(t.friendly_name))});const I=k(()=>t.name||"…"),$=k(()=>o.value?.ports||[]),x=k(()=>o.value?.wifi),O=k(()=>x.value?.state==="new"||x.value?.state==="missing"),J=k(()=>x.value?.missing||[]),C=k(()=>x.value?.state==="new"?"Fill in once: ESP Screens saves this in ESPHome secrets.yaml, later screens use it automatically.":"Your ESPHome secrets.yaml is still missing Wi-Fi details. ESP Screens only fills in the missing lines."),z=k(()=>x.value?.state==="ready"?"Wi-Fi comes from your ESPHome secrets.yaml.":x.value?.state==="invalid"?"secrets.yaml in the ESPHome folder isn't valid YAML. Fix the file first; it won't be overwritten.":""),P=k(()=>t.target==="usb"?"Connect the screen with a USB data cable to the Home Assistant machine; the list refreshes on its own. Or choose Download to use your own computer.":t.target==="download"?"Download the firmware and put it on the screen from your own computer, in Chrome or Edge. After that, updates go over Wi-Fi.":t.target?$.value.length>1?"More than one board connected: choose this screen's port.":"Once over USB; after that, everything is wireless.":"The profile goes into the ESPHome folder. You can install later via Firmware & USB, or from ESPHome Device Builder."),S=k(()=>t.target==="download"?"Build & download":t.target?"Install":"Save profile"),b=k(()=>o.value?.job?.state==="running"&&!(n.file&&o.value.job.file===n.file)),A=k(()=>u.value||x.value?.state==="invalid"||t.target==="usb"||!!t.target&&(b.value||!o.value?.available));function q(){const pe=t.target;(pe==="download"||pe===""?n.picked:$.value.includes(pe))||(t.target=$.value[0]||"usb")}async function W(){let pe;try{pe=await dt("firmware")}catch(et){r.value=et.message;return}o.value=pe;const N=pe.job,de=N&&n.file&&N.file===n.file;if(de&&(n.jobState=N.state),n.view==="setup"){if(de&&N.state==="running"){le(N,pe.logs||[]);return}q(),r.value=b.value?`A build or installation is already running (${N.file}). Wait for it to finish.`:!pe.available&&t.target?"The ESPHome CLI is missing from this installation; only saving the profile is possible.":z.value}else n.view==="progress"&&de&&(l.value=N,a.value=pe.logs||[],N.state!=="running"&&N.state!=="success"&&(f.value=!0))}function le(pe,N){n.view="progress",n.jobState=pe.state,n.action=pe.action,l.value=pe,a.value=N}const Z=k(()=>l.value?.state==="running"),B=k(()=>n.view==="done"||l.value?.state==="success"),X=k(()=>n.action==="download"),ce=k(()=>n.view==="done"?"Profile saved.":Z.value?"One moment…":B.value?X.value?"Ready to download.":"Done.":"That didn't work."),V=k(()=>n.view==="done"?`${n.file} is in the ESPHome folder`:Z.value?l.value?.stage==="upload"?`Writing firmware to ${n.friendly}…`:"Building firmware…":B.value?X.value?`Firmware for ${n.friendly} is ready`:`Firmware is on ${n.friendly}`:X.value?"Build failed":"Install failed"),Q=k(()=>n.view==="done"?"Install it later from Firmware & USB: choose this profile, then the USB port of the Home Assistant machine, or Download to put the firmware on the screen from your own computer. Save the API key for pairing:":Z.value?l.value?.stage==="upload"?"Don't disconnect the USB cable yet.":`A first build takes a few minutes on a Raspberry Pi. You can leave this page: the ${X.value?"build":"installation"} keeps running and you'll find it again under New screen.`:B.value?X.value?"Put it on the screen from your own computer, then pair the screen with Home Assistant.":`The screen boots up and connects to your Wi-Fi.${n.board==="cyd"?" The CYD first asks for a touch calibration: tap the crosshairs.":""} Pair it with Home Assistant now:`:a.value.filter(pe=>/error/i.test(pe)).pop()||a.value.filter(pe=>/failed/i.test(pe)).pop()||"See the log below."),Ee=k(()=>({href:`api/firmware/profiles/${encodeURIComponent(n.file||"")}/download`,name:(n.file||"").replace(/\.yaml$/,"")+".factory.bin"})),pt=k(()=>[["Go to Home Assistant → Settings → Devices & services.",` This happens outside ESP Screens. Home Assistant discovers ${n.friendly} as an ESPHome device; click Add. Not discovered? Add ESPHome manually with the screen's IP address. `],["Paste the API key"," above when Home Assistant asks for an encryption key."],["Allow HA actions:"," ESPHome integration → Configure → “Allow the device to perform Home Assistant actions”. Without this, the screen sees everything but controls nothing."],["Choose your tiles."," Back in ESP Screens, the screen appears in the list on the left within about thirty seconds; until then it's shown there as “not yet in Home Assistant”."]]);async function Ze(pe){const N=pe.target;if(n.nodeEdited||(t.name=T(t.friendly_name)),!!N.reportValidity()){u.value=!0,d.value="";try{const de={board:t.board,friendly_name:t.friendly_name,name:t.name,target:t.target};O.value&&(J.value.includes("wifi_ssid")&&(de.wifi_ssid=t.wifi_ssid),J.value.includes("wifi_password")&&(de.wifi_password=t.wifi_password));const et=await Xe("firmware/profiles","POST",de);Object.assign(n,{file:et.file,apiKey:et.api_key,friendly:t.friendly_name.trim(),board:t.board,target:t.target}),t.wifi_password="",et.job?le(et.job,[]):n.view="done"}catch(de){d.value=de.message}finally{u.value=!1}}}async function qe(){try{if(!X.value){const{ports:N}=await dt("firmware");!N.includes(n.target)&&N.length===1&&(n.target=N[0])}const pe=await Xe("firmware/jobs","POST",X.value?{file:n.file,action:"download"}:{file:n.file,action:"install",target:n.target});le(pe,[])}catch(pe){Se(pe.message)}}function as(){Object.assign(n,{view:"setup",file:null,apiKey:null,nodeEdited:!1,jobState:null,target:"",picked:!1,action:null}),Object.assign(t,{board:"cyd",friendly_name:"",name:"",wifi_ssid:"",wifi_password:"",target:""}),s.value=!1,l.value=null,a.value=[],d.value="",r.value="",f.value=!1,W()}function rs(){n.view==="progress"&&n.jobState!=="running"&&(n.view="done"),Ae("")}return hn(()=>{W(),_=window.setInterval(W,3e3)}),An(()=>clearInterval(_)),(pe,N)=>(h(),m("div",xm,[i("div",Sm,[i("div",Cm,[N[13]||(N[13]=i("span",{class:"eyebrow"},"New screen",-1)),i("h1",Am,y(n.view==="setup"?"Connect and install.":ce.value),1),n.view==="setup"?(h(),m("p",Tm,"ESP Screens creates the screen's own profile with unique keys and builds the firmware. Connect the screen with a USB data cable to the machine running Home Assistant, or download the firmware and put it on the screen from your own computer.")):H("",!0)]),i("button",{type:"button",class:"btn quiet",id:"close-install","aria-label":"Close",onClick:rs},"← Back")]),n.view==="setup"?(h(),m("form",{key:0,id:"install-form",class:"card",onSubmit:it(Ze,["prevent"])},[i("fieldset",null,[N[16]||(N[16]=i("legend",null,"Which screen do you have?",-1)),i("div",Em,[i("label",Pm,[ye(i("input",{type:"radio",name:"board",value:"cyd","onUpdate:modelValue":N[0]||(N[0]=de=>t.board=de)},null,512),[[Vi,t.board]]),N[14]||(N[14]=i("span",null,[i("b",null,"CYD · 2.8 inch"),i("small",null,"ESP32-2432S028 · 320 × 240")],-1))]),i("label",Om,[ye(i("input",{type:"radio",name:"board",value:"guition","onUpdate:modelValue":N[1]||(N[1]=de=>t.board=de)},null,512),[[Vi,t.board]]),N[15]||(N[15]=i("span",null,[i("b",null,"Guition · 4 inch"),i("small",null,"ESP32-S3-4848S040 · 480 × 480 · GT911")],-1))])])]),i("div",Im,[N[18]||(N[18]=i("label",{class:"f-label",for:"friendly_name"},"Name",-1)),ye(i("input",{id:"friendly_name",name:"friendly_name","onUpdate:modelValue":N[2]||(N[2]=de=>t.friendly_name=de),required:"",maxlength:"60",placeholder:"Living room screen",autocomplete:"off"},null,512),[[Ie,t.friendly_name]]),i("small",Mm,[N[17]||(N[17]=ee("Device name ",-1)),i("code",Lm,y(I.value),1),i("button",{type:"button",class:"btn link mini",id:"edit-node",onClick:N[3]||(N[3]=de=>{n.nodeEdited=!0,s.value=!0})},"customize")]),N[19]||(N[19]=i("small",null,"Every screen gets its own profile with its own keys. Four screens? Go through this four times with a different name.",-1))]),s.value?(h(),m("div",Dm,[N[20]||(N[20]=i("label",{class:"f-label",for:"node-name"},"Device name",-1)),ye(i("input",{id:"node-name",name:"name","onUpdate:modelValue":N[4]||(N[4]=de=>t.name=de),pattern:"[a-z][a-z0-9\\-]{0,29}",maxlength:"30",autocomplete:"off",onInput:N[5]||(N[5]=de=>n.nodeEdited=!0)},null,544),[[Ie,t.name]]),N[21]||(N[21]=i("small",null,"Lowercase letters, digits, and dashes. A different name for each screen.",-1))])):H("",!0),O.value?(h(),m("fieldset",Fm,[N[24]||(N[24]=i("legend",null,"Wi-Fi",-1)),i("p",Nm,y(C.value),1),J.value.includes("wifi_ssid")?(h(),m("div",Rm,[N[22]||(N[22]=i("label",{class:"f-label",for:"wifi_ssid"},"Wi-Fi name (2.4 GHz)",-1)),ye(i("input",{id:"wifi_ssid",name:"wifi_ssid","onUpdate:modelValue":N[6]||(N[6]=de=>t.wifi_ssid=de),autocomplete:"off"},null,512),[[Ie,t.wifi_ssid]])])):H("",!0),J.value.includes("wifi_password")?(h(),m("div",Hm,[N[23]||(N[23]=i("label",{class:"f-label",for:"wifi_password"},"Wi-Fi password",-1)),ye(i("input",{id:"wifi_password",name:"wifi_password",type:"password","onUpdate:modelValue":N[7]||(N[7]=de=>t.wifi_password=de),autocomplete:"new-password"},null,512),[[Ie,t.wifi_password]])])):H("",!0)])):H("",!0),i("div",Um,[N[26]||(N[26]=i("label",{class:"f-label",for:"install-target"},"Install via",-1)),ye(i("select",{id:"install-target",name:"target","onUpdate:modelValue":N[8]||(N[8]=de=>t.target=de),onChange:N[9]||(N[9]=de=>{n.picked=!0,W()})},[$.value.length?H("",!0):(h(),m("option",jm,"USB · no board found on the Home Assistant machine yet")),(h(!0),m(U,null,ie($.value,de=>(h(),m("option",{key:de,value:de},y(M(de)),9,Bm))),128)),i("option",{value:"download"},y(uy)),N[25]||(N[25]=i("option",{value:""},"Later · save profile only",-1))],544),[[un,t.target]]),i("small",Vm,y(P.value),1)]),r.value?(h(),m("p",Wm,y(r.value),1)):H("",!0),i("div",Km,[i("button",{type:"submit",class:"btn primary",id:"install-go",disabled:A.value},y(S.value),9,qm),i("span",Ym,y(d.value),1)])],32)):(h(),m("div",zm,[i("div",Jm,[Z.value?(h(),m("span",Gm)):(h(),m("span",{key:1,class:ue(["outcome",B.value?"ok":"bad"]),id:"progress-mark"},y(B.value?"✓":"✕"),3)),i("strong",Xm,y(V.value),1)]),i("p",Qm,y(Q.value),1),B.value&&X.value&&n.view!=="done"?(h(),m("div",Zm,[i("a",{class:"btn primary",id:"download-firmware",href:Ee.value.href,download:Ee.value.name},"Download "+y(Ee.value.name),9,ey),i("ol",ty,[N[30]||(N[30]=i("li",null,[i("b",null,"Plug the screen into your computer"),ee(" with a USB data cable.")],-1)),i("li",null,[i("b",null,[N[27]||(N[27]=ee("Open ",-1)),i("a",{href:ry,target:"_blank",rel:"noopener"},"ESPHome Web")]),N[28]||(N[28]=ee(" in Chrome or Edge, click Connect and choose the screen's USB port.",-1))]),i("li",null,[N[29]||(N[29]=i("b",null,"Click Install",-1)),ee(" and select "+y(Ee.value.name)+". The screen restarts and joins your Wi-Fi."+y(n.board==="cyd"?" The CYD first asks for a touch calibration: tap the crosshairs.":""),1)])]),N[31]||(N[31]=i("small",null,"The file holds your Wi-Fi password and the screen's keys: keep it to yourself.",-1))])):H("",!0),B.value?(h(),m("div",ny,[i("div",sy,[N[32]||(N[32]=i("span",null,"API key",-1)),i("code",{id:"api-key",ref_key:"keyBox",ref:p},y(n.apiKey||""),513),i("button",{type:"button",class:"btn quiet mini",id:"copy-key",onClick:N[10]||(N[10]=de=>v(lt)(n.apiKey||"",p.value))},"Copy")]),i("ol",oy,[(h(!0),m(U,null,ie(pt.value,([de,et],Tn)=>(h(),m("li",{key:Tn},[i("b",null,y(de),1),ee(y(et),1),Tn===0?(h(),m("button",{key:0,type:"button",class:"btn quiet mini",onClick:N[11]||(N[11]=(...Zt)=>v(Es)&&v(Es)(...Zt))},"Open Devices & services")):H("",!0)]))),128))])])):H("",!0),n.view!=="done"?(h(),m("details",{key:2,id:"install-log-wrap",class:"log-wrap",open:f.value,onToggle:N[12]||(N[12]=de=>f.value=de.target.open)},[N[33]||(N[33]=i("summary",null,"ESPHome log",-1)),i("pre",ly,y(a.value.join(`
|
||
`)),1)],40,iy)):H("",!0),i("div",ay,[!Z.value&&!B.value?(h(),m("button",{key:0,type:"button",class:"btn primary",id:"install-retry",onClick:qe},"Retry")):H("",!0),i("button",{type:"button",class:"btn quiet",id:"install-close",onClick:as},y(B.value?"Install another screen":"Start over"),1),i("button",{type:"button",class:ue(["btn",B.value?"primary":"quiet"]),onClick:rs},y(B.value?"Done":"Close"),3)])]))]))}}),dy={class:"panel",id:"firmware-dialog"},fy={class:"panel-head"},py={class:"card"},hy={class:"card-grid"},vy={class:"field"},my=["value"],yy={class:"field"},gy={key:0,value:"usb"},by=["value"],wy={key:0,class:"field",id:"firmware-host-label"},_y=["placeholder"],ky={class:"actions"},$y=["disabled"],xy=["disabled"],Sy=["disabled"],Cy={key:0,class:"spin"},Ay={id:"firmware-status",class:"status-line",role:"status"},Ty={key:0,id:"firmware-download",class:"card",style:{background:"var(--surface-2)"}},Ey=["href","download"],Py={id:"firmware-log",class:"log"},Oy="https://web.esphome.io/?dashboard_install",Iy="Download · flash from your own computer",My=Ce({__name:"FirmwareView",setup(e){const t=fe(null),n=fe(""),s=fe("ota"),o=fe("");let l=0;async function a(I=!1){try{const $=await dt("firmware");t.value=$,(I||!n.value)&&(n.value=$.profiles[0]?.file||"");const x=$.ports||[];s.value.startsWith("/")&&!x.includes(s.value)&&(s.value=x[0]||"usb"),s.value==="usb"&&x.length&&(s.value=x[0])}catch($){Se($.message)}}const r=k(()=>t.value?.job?.state==="running"),d=k(()=>!t.value||r.value||!t.value.available||!t.value.profiles?.length),u=k(()=>d.value||s.value==="usb"),f=k(()=>t.value?.ports||[]),p=k(()=>t.value?t.value.available?t.value.job?`${t.value.job.file} · ${t.value.job.action} · ${t.value.job.state}`:"Choose the intended profile, then a USB port, an IP address, or Download.":"The ESPHome CLI is missing. Update the app to 0.2.0.":"Loading…"),_=k(()=>s.value==="download"&&!!n.value&&!!t.value?.downloads?.includes(n.value)),T=k(()=>({href:`api/firmware/profiles/${encodeURIComponent(n.value)}/download`,name:n.value.replace(/\.yaml$/,"")+".factory.bin"}));async function M(I){try{await Xe("firmware/jobs","POST",{file:n.value,action:I==="validate"?"validate":I==="build"?"build":s.value==="download"?"download":"install",target:s.value==="ota"?o.value.trim():s.value==="download"?"":s.value}),await a()}catch($){Se($.message)}}return hn(()=>{a(!0),l=window.setInterval(()=>a(),3e3)}),An(()=>clearInterval(l)),(I,$)=>(h(),m("div",dy,[i("div",fy,[$[7]||($[7]=gs('<div class="tx"><span class="eyebrow">Firmware & USB</span><h1>Build and install screen firmware</h1><p>The built-in ESPHome CLI uses your own profile (YAML with keys) and secrets. Choose the screen's profile, then a USB port (screen connected to the Home Assistant machine), <b>Wi-Fi / OTA</b> with the hostname, or <b>Download</b> to put the firmware on the screen from your own computer. <b>Check</b> only validates, <b>Build only</b> compiles, <b>Build & install</b> puts the firmware on the screen. Your tiles stay as they are in ESP Screens. The first build takes a few minutes.</p></div>',1)),i("button",{type:"button",class:"btn quiet",id:"close-firmware",onClick:$[0]||($[0]=x=>v(Ae)(""))},"← Back")]),i("div",py,[i("div",hy,[i("div",vy,[$[8]||($[8]=i("label",{class:"f-label",for:"firmware-file"},"ESPHome profile",-1)),ye(i("select",{id:"firmware-file","onUpdate:modelValue":$[1]||($[1]=x=>n.value=x)},[(h(!0),m(U,null,ie(t.value?.profiles||[],x=>(h(),m("option",{key:x.file,value:x.file},y(x.file),9,my))),128))],512),[[un,n.value]])]),i("div",yy,[$[10]||($[10]=i("label",{class:"f-label",for:"firmware-port"},"Install to",-1)),ye(i("select",{id:"firmware-port","onUpdate:modelValue":$[2]||($[2]=x=>s.value=x)},[$[9]||($[9]=i("option",{value:"ota"},"Wi-Fi / OTA",-1)),f.value.length?H("",!0):(h(),m("option",gy,"USB · no board found on the Home Assistant machine yet")),(h(!0),m(U,null,ie(f.value,x=>(h(),m("option",{key:x,value:x},y(x),9,by))),128)),i("option",{value:"download"},y(Iy))],512),[[un,s.value]])]),s.value==="ota"?(h(),m("div",wy,[$[11]||($[11]=i("label",{class:"f-label",for:"firmware-host"},"IP address or hostname",-1)),ye(i("input",{id:"firmware-host","onUpdate:modelValue":$[3]||($[3]=x=>o.value=x),placeholder:n.value?n.value.replace(/\.yaml$/,".local"):"screen-livingroom.local"},null,8,_y),[[Ie,o.value]])])):H("",!0)]),i("div",ky,[i("button",{type:"button",class:"btn quiet",id:"firmware-validate",disabled:d.value,onClick:$[4]||($[4]=x=>M("validate"))},"Check",8,$y),i("button",{type:"button",class:"btn quiet",id:"firmware-build",disabled:d.value,onClick:$[5]||($[5]=x=>M("build"))},"Build only",8,xy),i("button",{type:"button",class:"btn primary",id:"firmware-install",disabled:u.value,onClick:$[6]||($[6]=x=>M("install"))},y(s.value==="download"?"Build & download":"Build & install"),9,Sy),r.value?(h(),m("span",Cy)):H("",!0)]),i("p",Ay,y(p.value),1),_.value?(h(),m("div",Ty,[i("a",{class:"btn primary",id:"firmware-download-link",href:T.value.href,download:T.value.name},"Download "+y(T.value.name),9,Ey),i("small",null,[$[12]||($[12]=ee("Put it on the screen with ",-1)),i("a",{href:Oy,target:"_blank",rel:"noopener"},"ESPHome Web"),$[13]||($[13]=ee(" in Chrome or Edge: Connect, choose the screen's USB port, Install, and select this file. It holds your Wi-Fi password and the screen's keys: keep it to yourself.",-1))])])):H("",!0)]),i("pre",Py,y((t.value?.logs||[]).join(`
|
||
`)),1)]))}}),Ly={class:"panel wide alerts",id:"alerts-dialog"},Dy={class:"panel-head"},Fy={key:0,class:"hint"},Ny={class:"alert-hero"},Ry={class:"alert-mock",id:"alert-mock","aria-hidden":"true"},Hy={class:"mdi alert-mock-icon",id:"alert-mock-icon"},Uy={class:"alerts-nav","aria-label":"Sections"},jy=["data-jump","onClick"],By={id:"alerts-try",class:"card"},Vy={class:"field"},Wy={value:"all"},Ky=["value","disabled"],qy={class:"field"},Yy={class:"field"},zy={class:"field"},Jy={id:"try-icons"},Gy=["value"],Xy={class:"field"},Qy=["value"],Zy={class:"field"},eg={class:"field"},tg={class:"check field"},ng={class:"actions field wide"},sg=["disabled"],og={class:"status-line",id:"try-result",role:"status"},ig={id:"alerts-screens",class:"card"},lg={id:"alerts-min-firmware"},ag={id:"alerts-screen-list",class:"options"},rg={key:0,class:"hint"},ug={class:"alert-screen-head"},cg={class:"copy-label"},dg=["onClick"],fg={id:"alerts-howto",class:"card"},pg={class:"field"},hg=["value"],vg={key:0,value:""},mg={class:"copy-line"},yg={id:"alerts-example"},gg={id:"alerts-all",class:"card"},bg={id:"alerts-all-event"},wg={id:"alerts-all-dismiss"},_g={class:"copy-line"},kg={id:"alerts-all-example"},$g={id:"alerts-fields",class:"card"},xg={class:"table-scroll"},Sg={id:"alerts-field-table"},Cg={key:0},Ag={id:"alerts-icons",class:"card"},Tg={class:"chips",id:"alerts-suggested"},Eg=["onClick"],Pg={class:"mdi"},Og={class:"field"},Ig={id:"alerts-icon-groups"},Mg={class:"subhead"},Lg={class:"alert-icon-grid"},Dg=["title","onClick"],Fg={class:"mdi"},Ng={key:0},Rg={key:0,class:"hint"},Hg={id:"alerts-colors",class:"card"},Ug={class:"swatches",id:"alerts-swatches"},jg=["onClick"],Bg={id:"alerts-events",class:"card"},Vg={id:"alerts-event-name"},Wg={class:"table-scroll"},Kg={id:"alerts-ending-table"},qg={class:"copy-line"},Yg={id:"alerts-wait-example"},zg={id:"alerts-tips",class:"card"},Jg={class:"alerts-list"},Gg=Ce({__name:"AlertsView",setup(e){const t=k(()=>c.inventory.alerts),n=fn({screen:"all",title:"Someone is at the door",subtitle:"Door 3, back",icon:"doorbell",color:"orange",button_text:"Coming",timeout:30,flash:!0}),s=fe(!1),o=fe(""),l=k(()=>c.inventory.screens.filter(S=>dn(S)&&S.online));async function a(){s.value=!0,o.value="";try{const{screen:S,...b}=n,A=await Mc(S,b),q=S==="all"?`${A.sent} screen${A.sent===1?"":"s"}`:c.inventory.screens.find(W=>W.id===S)?.name||"the screen";o.value=A.sent?`Sent to ${q}.${A.skipped?` ${A.skipped} skipped (offline or old firmware).`:""}${A.unusable?.length?` Left empty: ${A.unusable.join(", ")}.`:""}`:"No screen could show it: check that a screen is online with firmware "+(t.value?.min_firmware||"0.2.31")+" or newer."}catch(S){o.value=S.message}finally{s.value=!1}}const r=k(()=>c.inventory.icons),d=fe(""),u=fe(""),f=S=>`"${String(S).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,p=S=>S.type==="string"?/^[a-z][a-z0-9-]*$/.test(S.example)?S.example:f(S.example):S.example===!0?"true":S.example===!1?"false":String(S.example),_=k(()=>c.inventory.screens.filter(S=>S.alert_action)),T=k(()=>d.value||_.value[0]?.alert_action||""),M=k(()=>{const S=(t.value?.fields||[]).map(b=>` ${b.name}: ${p(b)}`);return`action: ${T.value||"esphome.<device_name>_show_alert"}
|
||
data:
|
||
${S.join(`
|
||
`)}`}),I=k(()=>["# Doorbell: show the alert and wait until someone presses the button.","actions:",` - action: ${T.value||"esphome.<device_name>_show_alert"}`," data:",' title: "Someone is at the door"',' subtitle: "Door 3, back"'," icon: doorbell"," color: orange",' button_text: "Coming"'," timeout: 0"," flash: true"," - wait_for_trigger:"," - trigger: event",` event_type: ${t.value?.event||"esphome.screen_alert"}`," event_data:"," action: ok",' timeout: "00:05:00"'," - if:"," - condition: template",' value_template: "{{ wait.trigger is not none }}"'," then:"," - action: notify.notify"," data:",' message: "Someone is coming to the door."'].join(`
|
||
`)),$=k(()=>{const S=(t.value?.fields||[]).map(A=>` ${A.name}: ${p(A)}`),b=t.value?.camera;return b&&S.push(` # ${b.name}: ${b.example} # a Guition shows its picture on the card`),`event: ${t.value?.broadcast?.show||"esp_screens_show_alert"}
|
||
event_data:
|
||
${S.join(`
|
||
`)}`}),x=k(()=>{if(!t.value||!r.value)return[];const S=u.value.trim().toLowerCase();return[...r.value.groups,{label:"Also available: control and weather icons",icons:t.value.extra_icons}].map(A=>({label:A.label,icons:A.icons.filter(q=>!S||q.name.includes(S)||(q.label||"").toLowerCase().includes(S))})).filter(A=>A.icons.length)}),O=k(()=>t.value?.suggested_icons?.find(S=>S.name==="doorbell")),J=k(()=>t.value?.colors?.find(S=>S.name==="orange")),C={string:"text",int:"number",bool:"on / off"};function z(S){document.getElementById(S)?.scrollIntoView({behavior:"smooth",block:"start"})}const P=[["alerts-try","Try it"],["alerts-screens","Your screens"],["alerts-howto","In an automation"],["alerts-all","All screens"],["alerts-fields","The fields"],["alerts-icons","Icons"],["alerts-colors","Colors"],["alerts-behaviour","Behavior"],["alerts-events","Events"],["alerts-tips","Tips"]];return(S,b)=>(h(),m("div",Ly,[i("div",Dy,[b[15]||(b[15]=i("div",{class:"tx"},[i("span",{class:"eyebrow"},"Alerts · cheatsheet"),i("h1",null,"A full-screen notification, from an automation."),i("p",null,[ee("Every screen has the "),i("code",null,"show_alert"),ee(" action. It places a card over everything, wakes the screen, and keeps the backlight at normal brightness until someone taps the button or the timeout runs out. Home Assistant itself shows no explanation or dropdowns for ESPHome actions; everything you can fill in is listed here.")])],-1)),i("button",{type:"button",class:"btn quiet",id:"close-alerts",onClick:b[0]||(b[0]=A=>v(Ae)(""))},"← Back")]),t.value?(h(),m(U,{key:1},[i("div",Ny,[i("div",Ry,[i("div",{class:"alert-mock-card",style:Pe(J.value?{background:J.value.color}:void 0)},[i("span",Hy,y(O.value?v(be)(O.value.cp):""),1),b[16]||(b[16]=i("strong",{id:"alert-mock-title"},"Someone is at the door",-1)),b[17]||(b[17]=i("span",{id:"alert-mock-subtitle"},"Door 3, back",-1)),b[18]||(b[18]=i("span",{class:"fake",id:"alert-mock-button"},"Coming",-1))],4)]),i("nav",Uy,[(h(),m(U,null,ie(P,([A,q])=>i("button",{key:A,type:"button","data-jump":A,onClick:W=>z(A)},y(q),9,jy)),64))])]),i("section",By,[b[28]||(b[28]=i("h2",null,"Try it",-1)),b[29]||(b[29]=i("p",null,"Send one alert now, with the same fields an automation sends. The screen shows the card and, with blinking on, flashes its backlight.",-1)),i("form",{class:"try-grid",onSubmit:it(a,["prevent"])},[i("div",Vy,[b[19]||(b[19]=i("label",{class:"f-label",for:"try-screen"},"Screen",-1)),ye(i("select",{id:"try-screen","onUpdate:modelValue":b[1]||(b[1]=A=>n.screen=A)},[i("option",Wy,"All screens ("+y(l.value.length)+" ready)",1),(h(!0),m(U,null,ie(v(c).inventory.screens,A=>(h(),m("option",{key:A.id,value:A.id,disabled:!v(dn)(A)||!A.online},y(A.name)+y(v(dn)(A)&&A.online?"":" · not ready"),9,Ky))),128))],512),[[un,n.screen]])]),i("div",qy,[b[20]||(b[20]=i("label",{class:"f-label",for:"try-title"},"Title",-1)),ye(i("input",{id:"try-title","onUpdate:modelValue":b[2]||(b[2]=A=>n.title=A),maxlength:"64"},null,512),[[Ie,n.title]])]),i("div",Yy,[b[21]||(b[21]=i("label",{class:"f-label",for:"try-subtitle"},"Subtitle",-1)),ye(i("input",{id:"try-subtitle","onUpdate:modelValue":b[3]||(b[3]=A=>n.subtitle=A),maxlength:"240"},null,512),[[Ie,n.subtitle]])]),i("div",zy,[b[22]||(b[22]=i("label",{class:"f-label",for:"try-icon"},"Icon",-1)),ye(i("input",{id:"try-icon","onUpdate:modelValue":b[4]||(b[4]=A=>n.icon=A),list:"try-icons",placeholder:"doorbell"},null,512),[[Ie,n.icon]]),i("datalist",Jy,[(h(!0),m(U,null,ie(t.value.suggested_icons,A=>(h(),m("option",{key:A.name,value:A.name},y(A.label||A.name),9,Gy))),128))])]),i("div",Xy,[b[24]||(b[24]=i("label",{class:"f-label",for:"try-color"},"Color",-1)),ye(i("select",{id:"try-color","onUpdate:modelValue":b[5]||(b[5]=A=>n.color=A)},[b[23]||(b[23]=i("option",{value:""},"White (default)",-1)),(h(!0),m(U,null,ie(t.value.colors,A=>(h(),m("option",{key:A.name,value:A.name},y(A.label),9,Qy))),128))],512),[[un,n.color]])]),i("div",Zy,[b[25]||(b[25]=i("label",{class:"f-label",for:"try-button"},"Button text",-1)),ye(i("input",{id:"try-button","onUpdate:modelValue":b[6]||(b[6]=A=>n.button_text=A),maxlength:"16"},null,512),[[Ie,n.button_text]])]),i("div",eg,[b[26]||(b[26]=i("label",{class:"f-label",for:"try-timeout"},"Timeout (seconds, 0 waits for the button)",-1)),ye(i("input",{id:"try-timeout","onUpdate:modelValue":b[7]||(b[7]=A=>n.timeout=A),type:"number",min:"0",max:"86400"},null,512),[[Ie,n.timeout,void 0,{number:!0}]])]),i("label",tg,[ye(i("input",{type:"checkbox",id:"try-flash","onUpdate:modelValue":b[8]||(b[8]=A=>n.flash=A)},null,512),[[Qu,n.flash]]),b[27]||(b[27]=i("span",null,[ee("Blink the backlight"),i("small",null,"Four times when the alert arrives.")],-1))]),i("div",ng,[i("button",{type:"submit",class:"btn primary",id:"try-send",disabled:s.value||!l.value.length},y(s.value?"Sending…":"Send alert"),9,sg),i("span",og,y(o.value),1)])],32)]),i("section",ig,[b[32]||(b[32]=i("h2",null,"Your screens",-1)),i("p",null,[b[30]||(b[30]=ee("Every screen has its own action, with the device name in it. From firmware ",-1)),i("code",lg,y(t.value.min_firmware),1),b[31]||(b[31]=ee("; update an older screen with its Update button under Screens.",-1))]),i("div",ag,[v(c).inventory.screens.length?H("",!0):(h(),m("p",rg,"No screen paired yet. Install one via New screen; the action appears once Home Assistant sees the screen.")),(h(!0),m(U,null,ie(v(c).inventory.screens,A=>(h(),m("div",{key:A.id,class:"alert-screen"},[i("div",ug,[i("strong",null,y(A.name),1),i("span",{class:ue(["chip",v(Sn)(A.firmware,t.value.min_firmware)&&A.alert_action?"good":"update"])},y(v(Sn)(A.firmware,t.value.min_firmware)&&A.alert_action?`● firmware ${A.firmware}`:A.alert_action?`Update needed · firmware ${A.firmware||"unknown"}`:"Device name unknown · update the screen"),3)]),(h(!0),m(U,null,ie([["Show alert",A.alert_action],["Dismiss alert",A.dismiss_action]],([q,W])=>(h(),m("div",{key:q,class:"copy-line"},[i("span",cg,y(q),1),i("code",null,y(W||"esphome.<device_name>_show_alert"),1),W?(h(),m("button",{key:0,type:"button",class:"btn quiet mini",onClick:le=>v(lt)(W,void 0,"Action name")},"Copy",8,dg)):H("",!0)]))),128))]))),128))])]),i("section",fg,[b[34]||(b[34]=gs('<h2>In an automation</h2><ol class="steps"><li><b>Add action</b> and search for <b>ESPHome</b>. Choose your screen's action: Home Assistant calls it "Performs the action show_alert of the node <i>device name</i>".</li><li><b>Fill in the fields.</b> Home Assistant asks for all seven; leave what you don't use empty (<code>""</code>, <code>0</code>, off).</li><li>Prefer YAML? Choose <b>Edit in YAML</b> on the action and paste the example below.</li></ol>',2)),i("div",pg,[b[33]||(b[33]=i("label",{class:"f-label",for:"alerts-example-screen"},"Example for",-1)),ye(i("select",{id:"alerts-example-screen","onUpdate:modelValue":b[9]||(b[9]=A=>d.value=A),style:{"max-width":"360px"}},[(h(!0),m(U,null,ie(_.value,A=>(h(),m("option",{key:A.id,value:A.alert_action},y(A.name),9,hg))),128)),_.value.length?H("",!0):(h(),m("option",vg,"a screen (not paired yet)"))],512),[[un,d.value]])]),i("div",mg,[i("pre",yg,y(M.value),1),i("button",{type:"button",class:"btn quiet mini",id:"alerts-example-copy",onClick:b[10]||(b[10]=A=>v(lt)(M.value,void 0,"YAML"))},"Copy YAML")])]),i("section",gg,[b[42]||(b[42]=i("h2",null,"All screens at once",-1)),i("p",null,[b[35]||(b[35]=ee("Fire the event ",-1)),i("code",bg,y(t.value.broadcast?.show||"esp_screens_show_alert"),1),b[36]||(b[36]=ee(" with the same fields, and ESP Screens passes the alert on to every screen that is online, including screens you add later. ",-1)),i("code",wg,y(t.value.broadcast?.dismiss||"esp_screens_dismiss_alert"),1),b[37]||(b[37]=ee(" clears it everywhere. In an automation, add the ",-1)),b[38]||(b[38]=i("b",null,"Event",-1)),b[39]||(b[39]=ee(" action or paste the example under ",-1)),b[40]||(b[40]=i("b",null,"Edit in YAML",-1)),b[41]||(b[41]=ee(". Leave out the fields you don't use. ESP Screens has to be running for this.",-1))]),i("div",_g,[i("pre",kg,y($.value),1),i("button",{type:"button",class:"btn quiet mini",id:"alerts-all-copy",onClick:b[11]||(b[11]=A=>v(lt)($.value,void 0,"YAML"))},"Copy YAML")])]),i("section",$g,[b[46]||(b[46]=i("h2",null,"The fields",-1)),b[47]||(b[47]=i("p",null,"Text is free-form; the limit is in bytes, and an accented letter counts as two. What doesn't fit gets an ellipsis (title) or is dropped (subtitle).",-1)),i("div",xg,[i("table",Sg,[b[45]||(b[45]=i("tr",null,[i("th",null,"Field"),i("th",null,"Type"),i("th",null,"What it does"),i("th",null,"Example"),i("th",null,"Limit")],-1)),(h(!0),m(U,null,ie(t.value.fields,A=>(h(),m("tr",{key:A.name},[i("td",null,[i("code",null,y(A.name),1),i("small",null,y(A.label),1)]),i("td",null,y(C[A.type]||A.type),1),i("td",null,y(A.help),1),i("td",null,[i("code",null,y(typeof A.example=="string"?A.example:String(A.example)),1)]),i("td",null,y(t.value.limits.cyd[A.name]?`CYD ${t.value.limits.cyd[A.name]} · Guition ${t.value.limits.guition[A.name]} bytes`:A.type==="int"?"0 to 86400 s":"—"),1)]))),128)),t.value.camera?(h(),m("tr",Cg,[i("td",null,[i("code",null,y(t.value.camera.name),1),i("small",null,y(t.value.camera.label),1)]),b[43]||(b[43]=i("td",null,"entity",-1)),i("td",null,y(t.value.camera.help),1),i("td",null,[i("code",null,y(t.value.camera.example),1)]),b[44]||(b[44]=i("td",null,"Guition, firmware 0.2.57+",-1))])):H("",!0)])])]),i("section",Ag,[b[49]||(b[49]=i("h2",null,"Icons",-1)),b[50]||(b[50]=i("p",null,[ee("Fill in the name in "),i("code",null,"icon"),ee(", for example "),i("code",null,"doorbell"),ee(". "),i("code",null,"mdi:doorbell"),ee(" and the hex codepoint ("),i("code",null,"F12E6"),ee(") also work. Only these icons are included in the firmware; any other name shows the warning triangle. Tap an icon to copy its name.")],-1)),b[51]||(b[51]=i("p",{class:"subhead"},"Handy for notifications",-1)),i("div",Tg,[(h(!0),m(U,null,ie(t.value.suggested_icons,A=>(h(),m("button",{key:A.name,type:"button",class:"chip",onClick:q=>v(lt)(A.name,void 0,"Icon name")},[i("span",Pg,y(v(be)(A.cp)),1),i("code",null,y(A.name),1)],8,Eg))),128))]),i("div",Og,[b[48]||(b[48]=i("label",{class:"f-label",for:"alerts-icon-search"},"Search for an icon",-1)),ye(i("input",{id:"alerts-icon-search","onUpdate:modelValue":b[12]||(b[12]=A=>u.value=A),type:"search",placeholder:"Search by name or description…",autocomplete:"off"},null,512),[[Ie,u.value]])]),i("div",Ig,[(h(!0),m(U,null,ie(x.value,A=>(h(),m("div",{key:A.label,class:"field"},[i("p",Mg,y(A.label)+" · "+y(A.icons.length),1),i("div",Lg,[(h(!0),m(U,null,ie(A.icons,q=>(h(),m("button",{key:q.name,type:"button",class:"alert-icon",title:`Copy ${q.name}`,onClick:W=>v(lt)(q.name,void 0,"Icon name")},[i("span",Fg,y(v(be)(q.cp)),1),i("code",null,y(q.name),1),q.label?(h(),m("small",Ng,y(q.label),1)):H("",!0)],8,Dg))),128))])]))),128)),x.value.length?H("",!0):(h(),m("p",Rg,'No icon for "'+y(u.value)+'". Unknown names show the warning triangle ('+y(t.value.fallback_icon)+").",1))])]),i("section",Hg,[b[53]||(b[53]=i("h2",null,"Colors",-1)),b[54]||(b[54]=i("p",null,[ee("Fill in the name in "),i("code",null,"color"),ee(". These are the pastel shades of the tiles, with dark text. Empty or unknown gives the white card. Tap to copy.")],-1)),i("div",Ug,[i("button",{type:"button",class:"swatch",onClick:b[13]||(b[13]=A=>v(lt)("",void 0,"Empty color"))},[...b[52]||(b[52]=[i("i",{style:{background:"#ffffff"}},null,-1),i("span",null,[i("code",null,"empty"),i("small",null,"White (default)")],-1)])]),(h(!0),m(U,null,ie(t.value.colors,A=>(h(),m("button",{key:A.name,type:"button",class:"swatch",onClick:q=>v(lt)(A.name,void 0,"Color name")},[i("i",{style:Pe({background:A.color})},null,4),i("span",null,[i("code",null,y(A.name),1),i("small",null,y(A.label)+" · "+y(A.color),1)])],8,jg))),128))])]),b[75]||(b[75]=gs('<section id="alerts-behaviour" class="card"><h2>Behavior</h2><ul class="alerts-list"><li><b>Wakes the screen.</b> An alert immediately wakes a dimmed or dark screen and appears above every page, every open light card, and the standby layer.</li><li><b>On until the button.</b> As long as the card is showing, the backlight stays at normal brightness. Standby and night hours wait. After the button, the regular standby time starts again.</li><li><b>Timeout.</b> <code>timeout: 0</code> waits for the button, however long that takes. With <code>timeout: 60</code> the card disappears after a minute, but the button closes it sooner.</li><li><b>Blinking.</b> <code>flash: true</code> blinks the backlight four times when the alert arrives (about a second) and leaves the screen on afterward.</li><li><b>Replacing.</b> A new alert replaces the current one; there's no stack. The replaced alert reports itself as <code>replaced</code>.</li><li><b>Closing remotely.</b> <code>dismiss_alert</code> clears the card, for example if the door is already open. Without an alert, that action does nothing.</li><li><b>Tapping beside the card</b> does nothing; only the button closes it. That way a wake-up tap never accidentally dismisses the alert.</li></ul></section>',1)),i("section",Bg,[b[66]||(b[66]=i("h2",null,"Events",-1)),i("p",null,[b[55]||(b[55]=ee("Every end fires the event ",-1)),i("code",Vg,y(t.value.event),1),b[56]||(b[56]=ee(" with ",-1)),b[57]||(b[57]=i("code",null,"action",-1)),b[58]||(b[58]=ee(", ",-1)),b[59]||(b[59]=i("code",null,"title",-1)),b[60]||(b[60]=ee(", ",-1)),b[61]||(b[61]=i("code",null,"screen",-1)),b[62]||(b[62]=ee(" (the device name) and the ",-1)),b[63]||(b[63]=i("code",null,"device_id",-1)),b[64]||(b[64]=ee(" that Home Assistant adds. Visible under Settings → Tools → Events.",-1))]),i("div",Wg,[i("table",Kg,[b[65]||(b[65]=i("tr",null,[i("th",null,"action"),i("th",null,"When")],-1)),(h(!0),m(U,null,ie(t.value.endings,A=>(h(),m("tr",{key:A.action},[i("td",null,[i("code",null,y(A.action),1)]),i("td",null,y(A.label),1)]))),128))])]),b[67]||(b[67]=i("p",{class:"subhead"},"Waiting until someone presses the button",-1)),i("div",qg,[i("pre",Yg,y(I.value),1),i("button",{type:"button",class:"btn quiet mini",id:"alerts-wait-copy",onClick:b[14]||(b[14]=A=>v(lt)(I.value,void 0,"YAML"))},"Copy YAML")])]),i("section",zg,[b[74]||(b[74]=i("h2",null,"Tips",-1)),i("ul",Jg,[b[72]||(b[72]=gs("<li>Use a <b>color per kind of notification</b>: orange for the door, red for smoke or water, green for "done". The text always stays dark and readable.</li><li>Keep the title <b>short</b>; a screen shows about twenty characters on one line and ends a longer title with an ellipsis. Put details in the subtitle.</li><li>A <b>custom button text</b> turns the notification into a question: "Coming", "Seen", "Turn off". The event then tells you who responded.</li><li>For an alert that resolves itself (the door opens, the laundry gets taken out) close it in the same automation with <code>dismiss_alert</code>.</li>",4)),i("li",null,[b[68]||(b[68]=ee("Every screen? Fire ",-1)),i("code",null,y(t.value.broadcast?.show||"esp_screens_show_alert"),1),b[69]||(b[69]=ee(" once (see All screens at once). The screens still work independently and each reports with its own ",-1)),b[70]||(b[70]=i("code",null,"screen",-1)),b[71]||(b[71]=ee(".",-1))]),b[73]||(b[73]=i("li",null,[ee("Rather "),i("b",null,"ask Claude"),ee(" for the automation? Install the ESP Screens skill under Settings → Claude.")],-1))])])],64)):(h(),m("p",Fy,"The cheatsheet is still loading; one moment."))]))}}),Xg={class:"panel",id:"override-dialog"},Qg={class:"panel-head"},Zg={class:"tx"},eb={id:"override-title"},tb={class:"notice"},nb={class:"mdi"},sb={class:"file-row"},ob={id:"override-file"},ib={class:"yaml-editor",id:"yaml-editor-wrap"},lb={class:"actions"},ab={id:"override-count",class:"hint"},rb={class:"actions"},ub=["disabled"],cb=["disabled"],db=`# Hardware-specific changes for this screen.
|
||
# This file is kept when the shared firmware package updates.
|
||
# Do not add esphome:, api:, ota:, wifi: or packages: here.
|
||
|
||
# Example: a CYD with the ST7789V display controller.
|
||
# "!extend" changes the display the shared package already defines;
|
||
# a bare id would add a second, incomplete display and fail the build.
|
||
display:
|
||
- id: !extend my_display
|
||
model: ST7789V
|
||
`,fb=Ce({__name:"OverrideView",setup(e){const t=k(()=>c.overrideProfile),n=fe(""),s=fe(""),o=fe(!1),l=fe("Loading…"),a=fe(""),r=fe(!1),d=fe(null),u=fe(null),f=k(()=>n.value.split(`
|
||
`).length),p=k(()=>Array.from({length:f.value},(P,S)=>S+1).join(`
|
||
`)),_=k(()=>`${n.value.length} characters · ${f.value} line${f.value===1?"":"s"}`);let T=!0;function M(P,S=""){l.value=P,a.value=S}async function I(){if(!t.value){M("No ESPHome profile was found for this screen.","error");return}M("Loading…");try{const P=await dt(`firmware/profiles/${encodeURIComponent(t.value)}/override`);s.value=P.override_file,o.value=!!P.attached,n.value=P.exists&&P.content!==`{}
|
||
`?P.content:"",M(P.attached?"Changes here apply on the next build.":"Save once to attach this file to the profile.")}catch(P){M(P.message,"error")}}async function $(P=!1){if(!(!t.value||r.value)){r.value=!0,M("Checking and saving…");try{const S=await Xe(`firmware/profiles/${encodeURIComponent(t.value)}/override`,"PUT",{content:n.value});if(s.value=S.override_file,o.value=!0,!P){M("Saved. The override is kept during firmware updates.","ok"),Se("Override YAML saved.");return}M("Saved. ESPHome is checking the complete profile…"),await Xe("firmware/jobs","POST",{file:t.value,action:"validate"}),x()}catch(S){M(S.message,"error")}finally{r.value=!1}}}function x(){const P=Date.now(),S=t.value,b=async()=>{if(!(!T||t.value!==S))try{const A=await dt("firmware"),q=A.job;if(q&&q.file===S&&q.state==="running")M(`ESPHome is checking the profile… ${q.stage||""}`.trim());else if(q&&q.file===S&&q.state==="success"){M("The complete profile is valid. Safe to build and install.","ok");return}else if(q&&q.file===S&&q.state==="failed"){const W=(A.logs||[]).filter(le=>/error|failed/i.test(le)).pop();M(W||"ESPHome rejected the complete profile. See Firmware & USB for the full log.","error");return}Date.now()-P<72e5&&setTimeout(b,1200)}catch(A){M(A.message,"error")}};b()}function O(){(!n.value.trim()||confirm("Replace the current text with the example?"))&&(n.value=db,M("Example loaded. Save it when you are ready."),d.value?.focus())}function J(){(!n.value.trim()||confirm("Clear the local override?"))&&(n.value="",M("The override will be empty after you save."),d.value?.focus())}function C(P){const S=d.value;if(P.key==="Tab"){P.preventDefault();const b=S.selectionStart,A=S.selectionEnd;S.setRangeText(" ",b,A,"end"),n.value=S.value}else(P.ctrlKey||P.metaKey)&&P.key.toLowerCase()==="s"&&(P.preventDefault(),$(!1))}function z(){u.value&&d.value&&(u.value.scrollTop=d.value.scrollTop)}return hn(I),An(()=>{T=!1}),(P,S)=>(h(),m("div",Xg,[i("div",Qg,[i("div",Zg,[S[4]||(S[4]=i("span",{class:"eyebrow"},"Advanced · local override",-1)),i("h1",eb,"Override YAML"+y(v(c).overrideFriendly?` · ${v(c).overrideFriendly}`:""),1),S[5]||(S[5]=i("p",null,"This small file is yours. It is loaded after the shared screen package and stays in place when ESP Screen Manager updates. Change hardware-specific details here, such as a display model.",-1))]),i("button",{type:"button",class:"btn quiet",id:"close-override",onClick:S[0]||(S[0]=b=>v(Ae)(""))},"← Back")]),i("div",tb,[i("span",nb,y(v(be)("F0493")),1),S[6]||(S[6]=i("div",null,[i("strong",null,"What is safe to change?"),i("span",null,"Display, touchscreen, substitutions, pins and other device details. Name, Wi-Fi, API, OTA and package links remain managed.")],-1))]),i("div",sb,[i("code",ob,y(s.value||t.value||""),1),i("span",{id:"override-state",class:ue(["chip",{good:o.value}])},y(o.value?"Active":"Ready to attach"),3)]),i("div",ib,[i("div",{ref_key:"gutter",ref:u,class:"yaml-gutter",id:"override-gutter","aria-hidden":"true"},y(p.value),513),ye(i("textarea",{ref_key:"editor",ref:d,id:"override-editor","onUpdate:modelValue":S[1]||(S[1]=b=>n.value=b),spellcheck:"false",autocapitalize:"off",autocomplete:"off",autocorrect:"off","aria-label":"Local override YAML",placeholder:`# Example
|
||
display:
|
||
- id: !extend my_display
|
||
model: ST7789V`,onKeydown:C,onScroll:z},null,544),[[Ie,n.value]])]),i("div",lb,[i("button",{type:"button",class:"btn quiet mini",id:"override-example",onClick:O},"Use example"),i("button",{type:"button",class:"btn quiet mini",id:"override-empty",onClick:J},"Clear"),i("span",ab,y(_.value),1)]),i("p",{id:"override-status",class:ue(["status-line",a.value]),role:"status"},y(l.value),3),i("div",rb,[i("button",{type:"button",class:"btn quiet",id:"override-check",disabled:r.value||!t.value,onClick:S[2]||(S[2]=b=>$(!0))},"Save & check",8,ub),i("button",{type:"button",class:"btn primary",id:"override-save",disabled:r.value||!t.value,onClick:S[3]||(S[3]=b=>$(!1))},"Save override",8,cb)])]))}}),pb={class:"main"},hb=Ce({__name:"App",setup(e){const t=k(()=>tt.value==="#settings"?$m:tt.value==="#new-screen"?cy:tt.value==="#firmware"?My:tt.value==="#alerts"?Gg:tt.value==="#override"?fb:Ct.value&&c.layout?em:sm);function n(s){(s.metaKey||s.ctrlKey)&&s.key.toLowerCase()==="k"&&(s.preventDefault(),c.palette=!c.palette)}return hn(()=>document.addEventListener("keydown",n)),An(()=>document.removeEventListener("keydown",n)),(s,o)=>(h(),m("div",{class:ue(["app",{dragging:v(c).drag.active}])},[$e(bd),i("main",pb,[(h(),Ke(jr(t.value)))]),$e(_d),$e(Od)],2))}});ic(hb).mount("#app");zc();
|