homebridge-config-ui-x 5.12.1-beta.4 → 5.12.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/public/{chunk-Q3NZLPIF.js → chunk-2DRLNNDM.js} +1 -1
- package/public/{chunk-W2KCSDQF.js → chunk-2K66PSKD.js} +1 -1
- package/public/{chunk-U5MVAF2Z.js → chunk-2QSUQ4VI.js} +1 -1
- package/public/{chunk-YPN7FV6O.js → chunk-3LY5FRVV.js} +1 -1
- package/public/{chunk-ALOGQFKU.js → chunk-3N3RJBS3.js} +1 -1
- package/public/{chunk-T4UELVH7.js → chunk-4OEYZBSF.js} +1 -1
- package/public/{chunk-SHUCVS7I.js → chunk-4P4VAV7I.js} +1 -1
- package/public/{chunk-KQSZ6SGH.js → chunk-5QHRLSAE.js} +1 -1
- package/public/{chunk-TKVKJ7BH.js → chunk-664C4LX2.js} +1 -1
- package/public/{chunk-AMSZTHK7.js → chunk-6U3YEWBO.js} +1 -1
- package/public/{chunk-QNOVJEHS.js → chunk-A5JF6PDD.js} +1 -1
- package/public/{chunk-EQBPB35I.js → chunk-ATJM3XYR.js} +1 -1
- package/public/{chunk-STRIQHMU.js → chunk-AY35X64S.js} +1 -1
- package/public/{chunk-5GOLEPOT.js → chunk-BRGXDZZE.js} +1 -1
- package/public/{chunk-UOW2U4BJ.js → chunk-BZLBFDQG.js} +1 -1
- package/public/{chunk-A7OA7EDC.js → chunk-C5CMRH2U.js} +1 -1
- package/public/{chunk-A7MBTNVM.js → chunk-CAY6MDP6.js} +1 -1
- package/public/{chunk-DW4GVDBD.js → chunk-CP2QJXVO.js} +1 -1
- package/public/{chunk-SH2LIQC2.js → chunk-FH62LNHX.js} +1 -1
- package/public/{chunk-M5HSZY2K.js → chunk-GDBXX4WT.js} +1 -1
- package/public/{chunk-7SWRANGJ.js → chunk-H2UKSDHZ.js} +1 -1
- package/public/{chunk-AJNVPC3P.js → chunk-JBILFYTL.js} +1 -1
- package/public/{chunk-UUTQE5VH.js → chunk-JPAZUSRO.js} +1 -1
- package/public/{chunk-D4MLVPZP.js → chunk-KIFEAONI.js} +1 -1
- package/public/{chunk-AUCDLTKK.js → chunk-M3DSUNBG.js} +1 -1
- package/public/{chunk-IL3A5BIS.js → chunk-MAJDTCMY.js} +1 -1
- package/public/{chunk-UP6OS2GK.js → chunk-MVT3BOGV.js} +1 -1
- package/public/{chunk-TTY6CFWI.js → chunk-NPMJGEDY.js} +1 -1
- package/public/{chunk-KCDMHC2Q.js → chunk-NYEZF6Y3.js} +1 -1
- package/public/{chunk-LF27VVUY.js → chunk-RMDVYT7X.js} +1 -1
- package/public/{chunk-V2JVDEX6.js → chunk-RWABUVQY.js} +1 -1
- package/public/{chunk-4G3SMV26.js → chunk-S2GJNEOI.js} +1 -1
- package/public/{chunk-EFYVUQZK.js → chunk-TV5ACJCB.js} +1 -1
- package/public/{chunk-CH4W3VJQ.js → chunk-UH3C2FAE.js} +1 -1
- package/public/{chunk-LMPJJK5P.js → chunk-VFMCVZHO.js} +1 -1
- package/public/{chunk-FHRZH5HG.js → chunk-VV4S6PBO.js} +1 -1
- package/public/{chunk-B23NNBW7.js → chunk-VWUZDCBZ.js} +1 -1
- package/public/{chunk-WE4CGPHP.js → chunk-WGTVNYII.js} +1 -1
- package/public/{chunk-Y7OC2MBV.js → chunk-XUP37AHQ.js} +1 -1
- package/public/{chunk-ASKLCERP.js → chunk-Y6B4ENQ3.js} +1 -1
- package/public/{chunk-RRPHHKF2.js → chunk-ZVU2KU6A.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-ZCE52DX6.js → main-QHHXZV7U.js} +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as X,C as tt,F as et,I as it}from"./chunk-B23NNBW7.js";import{L as Q,R,X as G,aa as C,d as U}from"./chunk-F5MBSCH4.js";import{e as ut,g as ct,h as P}from"./chunk-B4AJQJMI.js";var st=ut((B,E)=>{(function(w,k){typeof B=="object"&&typeof E<"u"?E.exports=k():typeof define=="function"&&define.amd?define(k):(w=typeof globalThis<"u"?globalThis:w||self).dayjs=k()})(B,function(){"use strict";var w=1e3,k=6e4,s=36e5,h="millisecond",d="second",m="minute",v="hour",y="day",f="week",L="month",K="quarter",T="year",_="date",q="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var n=String(r);return!n||n.length>=i?r:""+Array(i+1-n.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),n=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(n,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var n=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(n,L),o=t-e<0,a=i.clone().add(n+(o?-1:1),L);return+(-(n+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:L,y:T,w:f,d:y,D:_,h:v,m,s:d,ms:h,Q:K}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},I="en",D={};D[I]=ot;var Z="$isDayjsObject",N=function(r){return r instanceof Y||!(!r||!r[Z])},W=function r(i,t,n){var e;if(!i)return I;if(typeof i=="string"){var o=i.toLowerCase();D[o]&&(e=o),t&&(D[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;D[c]=i,e=c}return!n&&e&&(I=e),e||!n&&I},g=function(r,i){if(N(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new Y(t)},u=at;u.l=W,u.i=N,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Y=(function(){function r(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=(function(n){var e=n.date,o=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)})(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==q},i.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return g(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<g(t)},i.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,n){var e=this,o=!!u.u(n)||n,a=u.p(t),c=function(x,M){var S=u.w(e.$u?Date.UTC(e.$y,M,x):new Date(e.$y,M,x),e);return o?S:S.endOf(y)},l=function(x,M){return u.w(e.toDate()[x].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},$=this.$W,p=this.$M,b=this.$D,H="set"+(this.$u?"UTC":"");switch(a){case T:return o?c(1,0):c(31,11);case L:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,j=($<O?$+7:$)-O;return c(o?b-j:b+(6-j),p);case y:case _:return l(H+"Hours",0);case v:return l(H+"Minutes",1);case m:return l(H+"Seconds",2);case d:return l(H+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,n){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[_]=a+"Date",e[L]=a+"Month",e[T]=a+"FullYear",e[v]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===y?this.$D+(n-this.$W):n;if(o===L||o===T){var $=this.clone().set(_,1);$.$d[c](l),$.init(),this.$d=$.set(_,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,n){return this.clone().$set(t,n)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,n){var e,o=this;t=Number(t);var a=u.p(n),c=function(p){var b=g(o);return u.w(b.date(b.date()+Math.round(p*t)),o)};if(a===L)return this.set(L,this.$M+t);if(a===T)return this.set(T,this.$y+t);if(a===y)return c(1);if(a===f)return c(7);var l=(e={},e[m]=k,e[v]=s,e[d]=w,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,n){return this.add(-1*t,n)},i.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||q;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,b=e.months,H=e.meridiem,O=function(M,S,A,V){return M&&(M[S]||M(n,o))||A[S].slice(0,V)},j=function(M){return u.s(c%12||12,M,"0")},x=H||function(M,S,A){var V=M<12?"AM":"PM";return A?V.toLowerCase():V};return o.replace(rt,function(M,S){return S||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,b,3);case"MMMM":return O(b,$);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return O(e.weekdaysMin,n.$W,p,2);case"ddd":return O(e.weekdaysShort,n.$W,p,3);case"dddd":return p[n.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return x(c,l,!0);case"A":return x(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,n,e){var o,a=this,c=u.p(n),l=g(t),$=(l.utcOffset()-this.utcOffset())*k,p=this-l,b=function(){return u.m(a,l)};switch(c){case T:o=b()/12;break;case L:o=b();break;case K:o=b()/3;break;case f:o=(p-$)/6048e5;break;case y:o=(p-$)/864e5;break;case v:o=p/s;break;case m:o=p/k;break;case d:o=p/w;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(L).$D},i.$locale=function(){return D[this.$L]},i.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),o=W(t,n,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r})(),z=Y.prototype;return g.prototype=z,[["$ms",h],["$s",d],["$m",m],["$H",v],["$W",y],["$M",L],["$y",T],["$D",_]].forEach(function(r){z[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,Y,g),r.$i=!0),g},g.locale=W,g.isDayjs=N,g.unix=function(r){return g(1e3*r)},g.en=D[I],g.Ls=D,g.p={},g})});var J=ct(st(),1);var Mt=(()=>{class w{$api=C(it);$title=C(X);$toastr=C(et);$translate=C(tt);settingsLoadedSubject=new U;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];serverTimeToastCleanup$=new U;restartToastRef=null;env={};host;proxyHost;webroot;originalWebroot;formAuth=!0;sessionTimeout=28800;sessionTimeoutInactivityBased=!1;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;browserLang;onSettingsLoaded=this.settingsLoadedSubject.pipe(Q());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let s=yield this.$api.get("/auth/settings");this.formAuth=s.formAuth,this.sessionTimeout=s.sessionTimeout,this.sessionTimeoutInactivityBased=s.sessionTimeoutInactivityBased,this.env=s.env,this.host=s.host,this.webroot=s.webroot,this.originalWebroot=s.originalWebroot,this.proxyHost=s.proxyHost,this.lightingMode=s.lightingMode,this.wallpaper=s.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(s.theme),this.setMenuMode(s.menuMode),this.setKeepOrphans(s.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(s.serverTimestamp),this.setUiVersion(s.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0),this.browserLang=this.$translate.getBrowserCultureLang()})}setBrowserLightingMode(s){this.browserLightingMode=s,this.lightingMode==="auto"&&this.setLightingMode(s,"browser")}setLightingMode(s,h){h==="user"&&(this.lightingMode=s),this.currentLightingMode=s,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(s){(!s||!this.themeList.includes(s))&&(s=this.defaultTheme,this.$api.put("/config-editor/ui",{key:"theme",value:s}).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=s,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,v)=>{try{let y=m.contentDocument;if(y){let f=y.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:s},window.location.origin)}}catch(y){console.warn(`Iframe ${v}: Access denied (cross-origin?)`,{error:y,src:m.src})}})}setMenuMode(s){this.menuMode=s}setKeepOrphans(s){this.keepOrphans=s}setLang(s){s?this.$translate.use(s):s="auto",this.env.lang=s}setItem(s,h){this[s]=h}setEnvItem(s,h){if(s.includes(".")){let d=s.split("."),m=this.env;for(let v=0;v<d.length-1;v+=1){if(this.forbiddenKeys.includes(d[v]))return;m[d[v]]||(m[d[v]]={}),m=m[d[v]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[s]=h}checkServerTime(s){let d=(0,J.default)(s).diff((0,J.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&(this.serverTimeToastCleanup$.next(),this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.pipe(R(this.serverTimeToastCleanup$)).subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")}))}setUiVersion(s){this.uiVersion||(this.uiVersion=s)}setTitle(s){this.$title.setTitle(s||"Homebridge")}setPageTitle(s){let h=this.env.homebridgeInstanceName||"Homebridge";s?this.$title.setTitle(`${h} \u2014 ${s}`):this.$title.setTitle(h)}isFeatureEnabled(s){return this.env.featureFlags?.[s]??!1}static \u0275fac=function(h){return new(h||w)};static \u0275prov=G({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})();export{st as a,Mt as b};
|
|
1
|
+
import{A as X,C as tt,F as et,I as it}from"./chunk-VWUZDCBZ.js";import{L as Q,R,X as G,aa as C,d as U}from"./chunk-F5MBSCH4.js";import{e as ut,g as ct,h as P}from"./chunk-B4AJQJMI.js";var st=ut((B,E)=>{(function(w,k){typeof B=="object"&&typeof E<"u"?E.exports=k():typeof define=="function"&&define.amd?define(k):(w=typeof globalThis<"u"?globalThis:w||self).dayjs=k()})(B,function(){"use strict";var w=1e3,k=6e4,s=36e5,h="millisecond",d="second",m="minute",v="hour",y="day",f="week",L="month",K="quarter",T="year",_="date",q="Invalid Date",nt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,rt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,ot={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(r){var i=["th","st","nd","rd"],t=r%100;return"["+r+(i[(t-20)%10]||i[t]||i[0])+"]"}},F=function(r,i,t){var n=String(r);return!n||n.length>=i?r:""+Array(i+1-n.length).join(t)+r},at={s:F,z:function(r){var i=-r.utcOffset(),t=Math.abs(i),n=Math.floor(t/60),e=t%60;return(i<=0?"+":"-")+F(n,2,"0")+":"+F(e,2,"0")},m:function r(i,t){if(i.date()<t.date())return-r(t,i);var n=12*(t.year()-i.year())+(t.month()-i.month()),e=i.clone().add(n,L),o=t-e<0,a=i.clone().add(n+(o?-1:1),L);return+(-(n+(t-e)/(o?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M:L,y:T,w:f,d:y,D:_,h:v,m,s:d,ms:h,Q:K}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},I="en",D={};D[I]=ot;var Z="$isDayjsObject",N=function(r){return r instanceof Y||!(!r||!r[Z])},W=function r(i,t,n){var e;if(!i)return I;if(typeof i=="string"){var o=i.toLowerCase();D[o]&&(e=o),t&&(D[o]=t,e=o);var a=i.split("-");if(!e&&a.length>1)return r(a[0])}else{var c=i.name;D[c]=i,e=c}return!n&&e&&(I=e),e||!n&&I},g=function(r,i){if(N(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new Y(t)},u=at;u.l=W,u.i=N,u.w=function(r,i){return g(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var Y=(function(){function r(t){this.$L=W(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[Z]=!0}var i=r.prototype;return i.parse=function(t){this.$d=(function(n){var e=n.date,o=n.utc;if(e===null)return new Date(NaN);if(u.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(nt);if(a){var c=a[2]-1||0,l=(a[7]||"0").substring(0,3);return o?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,l)}}return new Date(e)})(t),this.init()},i.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},i.$utils=function(){return u},i.isValid=function(){return this.$d.toString()!==q},i.isSame=function(t,n){var e=g(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return g(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<g(t)},i.$g=function(t,n,e){return u.u(t)?this[n]:this.set(e,t)},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this.$d.getTime()},i.startOf=function(t,n){var e=this,o=!!u.u(n)||n,a=u.p(t),c=function(x,M){var S=u.w(e.$u?Date.UTC(e.$y,M,x):new Date(e.$y,M,x),e);return o?S:S.endOf(y)},l=function(x,M){return u.w(e.toDate()[x].apply(e.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(M)),e)},$=this.$W,p=this.$M,b=this.$D,H="set"+(this.$u?"UTC":"");switch(a){case T:return o?c(1,0):c(31,11);case L:return o?c(1,p):c(0,p+1);case f:var O=this.$locale().weekStart||0,j=($<O?$+7:$)-O;return c(o?b-j:b+(6-j),p);case y:case _:return l(H+"Hours",0);case v:return l(H+"Minutes",1);case m:return l(H+"Seconds",2);case d:return l(H+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,n){var e,o=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[_]=a+"Date",e[L]=a+"Month",e[T]=a+"FullYear",e[v]=a+"Hours",e[m]=a+"Minutes",e[d]=a+"Seconds",e[h]=a+"Milliseconds",e)[o],l=o===y?this.$D+(n-this.$W):n;if(o===L||o===T){var $=this.clone().set(_,1);$.$d[c](l),$.init(),this.$d=$.set(_,Math.min(this.$D,$.daysInMonth())).$d}else c&&this.$d[c](l);return this.init(),this},i.set=function(t,n){return this.clone().$set(t,n)},i.get=function(t){return this[u.p(t)]()},i.add=function(t,n){var e,o=this;t=Number(t);var a=u.p(n),c=function(p){var b=g(o);return u.w(b.date(b.date()+Math.round(p*t)),o)};if(a===L)return this.set(L,this.$M+t);if(a===T)return this.set(T,this.$y+t);if(a===y)return c(1);if(a===f)return c(7);var l=(e={},e[m]=k,e[v]=s,e[d]=w,e)[a]||1,$=this.$d.getTime()+t*l;return u.w($,this)},i.subtract=function(t,n){return this.add(-1*t,n)},i.format=function(t){var n=this,e=this.$locale();if(!this.isValid())return e.invalidDate||q;var o=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,l=this.$m,$=this.$M,p=e.weekdays,b=e.months,H=e.meridiem,O=function(M,S,A,V){return M&&(M[S]||M(n,o))||A[S].slice(0,V)},j=function(M){return u.s(c%12||12,M,"0")},x=H||function(M,S,A){var V=M<12?"AM":"PM";return A?V.toLowerCase():V};return o.replace(rt,function(M,S){return S||(function(A){switch(A){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return $+1;case"MM":return u.s($+1,2,"0");case"MMM":return O(e.monthsShort,$,b,3);case"MMMM":return O(b,$);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return O(e.weekdaysMin,n.$W,p,2);case"ddd":return O(e.weekdaysShort,n.$W,p,3);case"dddd":return p[n.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return j(1);case"hh":return j(2);case"a":return x(c,l,!0);case"A":return x(c,l,!1);case"m":return String(l);case"mm":return u.s(l,2,"0");case"s":return String(n.$s);case"ss":return u.s(n.$s,2,"0");case"SSS":return u.s(n.$ms,3,"0");case"Z":return a}return null})(M)||a.replace(":","")})},i.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},i.diff=function(t,n,e){var o,a=this,c=u.p(n),l=g(t),$=(l.utcOffset()-this.utcOffset())*k,p=this-l,b=function(){return u.m(a,l)};switch(c){case T:o=b()/12;break;case L:o=b();break;case K:o=b()/3;break;case f:o=(p-$)/6048e5;break;case y:o=(p-$)/864e5;break;case v:o=p/s;break;case m:o=p/k;break;case d:o=p/w;break;default:o=p}return e?o:u.a(o)},i.daysInMonth=function(){return this.endOf(L).$D},i.$locale=function(){return D[this.$L]},i.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),o=W(t,n,!0);return o&&(e.$L=o),e},i.clone=function(){return u.w(this.$d,this)},i.toDate=function(){return new Date(this.valueOf())},i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toISOString=function(){return this.$d.toISOString()},i.toString=function(){return this.$d.toUTCString()},r})(),z=Y.prototype;return g.prototype=z,[["$ms",h],["$s",d],["$m",m],["$H",v],["$W",y],["$M",L],["$y",T],["$D",_]].forEach(function(r){z[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),g.extend=function(r,i){return r.$i||(r(i,Y,g),r.$i=!0),g},g.locale=W,g.isDayjs=N,g.unix=function(r){return g(1e3*r)},g.en=D[I],g.Ls=D,g.p={},g})});var J=ct(st(),1);var Mt=(()=>{class w{$api=C(it);$title=C(X);$toastr=C(et);$translate=C(tt);settingsLoadedSubject=new U;defaultTheme="deep-purple";forbiddenKeys=["__proto__","constructor","prototype"];serverTimeToastCleanup$=new U;restartToastRef=null;env={};host;proxyHost;webroot;originalWebroot;formAuth=!0;sessionTimeout=28800;sessionTimeoutInactivityBased=!1;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;keepOrphans;wallpaper;serverTimeOffset=0;rtl=!1;browserLang;onSettingsLoaded=this.settingsLoadedSubject.pipe(Q());settingsLoaded=!1;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let s=yield this.$api.get("/auth/settings");this.formAuth=s.formAuth,this.sessionTimeout=s.sessionTimeout,this.sessionTimeoutInactivityBased=s.sessionTimeoutInactivityBased,this.env=s.env,this.host=s.host,this.webroot=s.webroot,this.originalWebroot=s.originalWebroot,this.proxyHost=s.proxyHost,this.lightingMode=s.lightingMode,this.wallpaper=s.wallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(s.theme),this.setMenuMode(s.menuMode),this.setKeepOrphans(s.keepOrphans),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(s.serverTimestamp),this.setUiVersion(s.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0),this.browserLang=this.$translate.getBrowserCultureLang()})}setBrowserLightingMode(s){this.browserLightingMode=s,this.lightingMode==="auto"&&this.setLightingMode(s,"browser")}setLightingMode(s,h){h==="user"&&(this.lightingMode=s),this.currentLightingMode=s,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(s){(!s||!this.themeList.includes(s))&&(s=this.defaultTheme,this.$api.put("/config-editor/ui",{key:"theme",value:s}).catch(m=>console.error("Error saving setTheme:",m)));let h=window.document.querySelector("body");h.classList.remove(`config-ui-x-${this.theme}`),h.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=s,this.actualLightingMode==="dark"?(h.classList.add(`config-ui-x-dark-mode-${this.theme}`),h.classList.contains("dark-mode")||h.classList.add("dark-mode")):(h.classList.add(`config-ui-x-${this.theme}`),h.classList.contains("dark-mode")&&h.classList.remove("dark-mode")),window.document.querySelectorAll("iframe").forEach((m,v)=>{try{let y=m.contentDocument;if(y){let f=y.body;this.actualLightingMode==="dark"?(f.classList.contains(`config-ui-x-${this.theme}`)&&f.classList.remove(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)||f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode"),f.style.backgroundColor="#242424 !important",f.style.color="#ffffff !important"):(f.classList.contains(`config-ui-x-${this.theme}`)||f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains(`config-ui-x-dark-mode-${this.theme}`)&&f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"),f.style.backgroundColor="#ffffff !important",f.style.color="#000000 !important"),m.contentWindow.postMessage({type:"theme-update",isDark:this.actualLightingMode==="dark",theme:s},window.location.origin)}}catch(y){console.warn(`Iframe ${v}: Access denied (cross-origin?)`,{error:y,src:m.src})}})}setMenuMode(s){this.menuMode=s}setKeepOrphans(s){this.keepOrphans=s}setLang(s){s?this.$translate.use(s):s="auto",this.env.lang=s}setItem(s,h){this[s]=h}setEnvItem(s,h){if(s.includes(".")){let d=s.split("."),m=this.env;for(let v=0;v<d.length-1;v+=1){if(this.forbiddenKeys.includes(d[v]))return;m[d[v]]||(m[d[v]]={}),m=m[d[v]]}this.forbiddenKeys.includes(d[d.length-1])||(m[d[d.length-1]]=h)}else this.env[s]=h}checkServerTime(s){let d=(0,J.default)(s).diff((0,J.default)(),"hour");this.serverTimeOffset=d*60*60,(d>=8||d<=-8)&&(this.serverTimeToastCleanup$.next(),this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.pipe(R(this.serverTimeToastCleanup$)).subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")}))}setUiVersion(s){this.uiVersion||(this.uiVersion=s)}setTitle(s){this.$title.setTitle(s||"Homebridge")}setPageTitle(s){let h=this.env.homebridgeInstanceName||"Homebridge";s?this.$title.setTitle(`${h} \u2014 ${s}`):this.$title.setTitle(h)}isFeatureEnabled(s){return this.env.featureFlags?.[s]??!1}static \u0275fac=function(h){return new(h||w)};static \u0275prov=G({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})();export{st as a,Mt as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b,b as w,c as y}from"./chunk-BMOLDRJ3.js";import{a as u}from"./chunk-
|
|
1
|
+
import{a as b,b as w,c as y}from"./chunk-BMOLDRJ3.js";import{a as u}from"./chunk-H2UKSDHZ.js";import{I as z}from"./chunk-VWUZDCBZ.js";import{F as o,R as r,X as f,aa as d,d as e}from"./chunk-F5MBSCH4.js";import{g as a,h as p}from"./chunk-B4AJQJMI.js";var l=a(b(),1),m=a(w(),1),c=a(y(),1);var v=(()=>{class n{$ws=d(u);$api=d(z);io;fitAddon;webLinksAddon;resize;elementResize;dataDisposable=null;isInitializing=!1;hasUserTyped=!1;destroy$=new e;term;destroyTerminal(){this.destroy$.next(),this.destroy$.complete(),this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.io&&this.io.end(),this.term&&(this.term.dispose(),this.term=null),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.destroy$=new e,this.isInitializing=!1,this.hasUserTyped=!1}destroyPersistentSession(){return p(this,null,function*(){this.destroyTerminal();try{yield this.$api.post("/platform-tools/terminal/destroy-persistent-session",{})}catch(t){console.error("Failed to destroy persistent session:",t)}})}detachTerminal(){this.destroy$.next(),this.destroy$.complete(),this.dataDisposable&&(this.dataDisposable.dispose(),this.dataDisposable=null),this.term&&this.term.dispose(),this.resize&&this.resize.complete(),this.elementResize&&this.elementResize.complete(),this.destroy$=new e,this.isInitializing=!1}hasActiveSession(){return this.io&&this.io.socket&&this.io.socket.connected}hasUserTypedInSession(){return this.hasUserTyped}isTerminalReady(){return this.term&&!this.isInitializing}reconnectTerminal(t,s={},h){if(this.isInitializing)return!1;this.isInitializing=!0,this.elementResize=h,this.io&&this.io.socket&&this.io.socket.connected?(this.term=new c.Terminal(s),this.fitAddon=new l.FitAddon,this.webLinksAddon=new m.WebLinksAddon,setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.resize=new e,this.term.open(t.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.socket.removeAllListeners("stdout"),this.io.socket.removeAllListeners("process-exit"),this.io.socket.on("stdout",i=>{this.term.write(i)}),this.io.socket.on("process-exit",()=>{this.startSession()}),this.dataDisposable&&this.dataDisposable.dispose(),this.dataDisposable=this.term.onData(i=>{this.hasUserTyped=!0,this.io.socket.emit("stdin",i)}),this.term.onResize(i=>{this.resize.next(i)}),this.resize.pipe(o(500),r(this.destroy$)).subscribe(i=>{this.io.socket.emit("resize",i)}),this.elementResize&&this.elementResize.pipe(o(100),r(this.destroy$)).subscribe({next:()=>{this.fitAddon.fit()}}),this.io.socket.emit("start-session",{cols:this.term.cols,rows:this.term.rows}),this.isInitializing=!1):this.startTerminal(t,s,h)}startTerminal(t,s={},h){return this.isInitializing?!1:(this.isInitializing=!0,this.elementResize=h,this.io=this.$ws.connectToNamespace("platform-tools/terminal"),this.term=new c.Terminal(s),setTimeout(()=>{this.term.loadAddon(this.fitAddon),this.term.loadAddon(this.webLinksAddon)}),this.fitAddon=new l.FitAddon,this.webLinksAddon=new m.WebLinksAddon,this.resize=new e,this.term.open(t.nativeElement),setTimeout(()=>{this.fitAddon.activate(this.term),this.fitAddon.fit()}),this.io.connected.pipe(o(200),r(this.destroy$)).subscribe(()=>{this.startSession()}),this.io.socket.on("disconnect",()=>{this.term.write(`
|
|
2
2
|
\r
|
|
3
3
|
\rTerminal disconnected. Is the server running?
|
|
4
4
|
\r
|