homebridge-config-ui-x 5.0.0-beta.5 → 5.0.0-beta.7
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/CHANGELOG.md +10 -0
- package/dist/bin/fork.js +17 -7
- package/dist/bin/fork.js.map +1 -1
- package/dist/bin/hb-service.js +17 -7
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/bin/standalone.js +17 -7
- package/dist/bin/standalone.js.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +1 -1
- package/dist/modules/config-editor/config-editor.service.d.ts +1 -1
- package/package.json +3 -3
- package/public/chunk-26EDYJQW.js +1 -0
- package/public/{chunk-6I6PSM5Y.js → chunk-2JDN5J3P.js} +1 -1
- package/public/{chunk-CNJMINEX.js → chunk-2PMXH77A.js} +1 -1
- package/public/{chunk-72QXF2GF.js → chunk-3C2OQ2W5.js} +1 -1
- package/public/chunk-3JROOWCZ.js +1 -0
- package/public/chunk-4LLA7QYB.js +1 -0
- package/public/{chunk-XEVIOBJR.js → chunk-4N3YQA7W.js} +1 -1
- package/public/{chunk-LQ6YDB4A.js → chunk-52L2LAHB.js} +1 -1
- package/public/{chunk-JBM7KQHD.js → chunk-5KIRKUWH.js} +1 -1
- package/public/{chunk-BNVAYTYZ.js → chunk-6HR4EKFX.js} +1 -1
- package/public/chunk-7LUCJVXB.js +1 -0
- package/public/{chunk-BVDMEFSJ.js → chunk-A4HS5JYI.js} +1 -1
- package/public/{chunk-Z7AUXG5E.js → chunk-A76FDQKF.js} +1 -1
- package/public/{chunk-S3XAJEVU.js → chunk-AAVBU64J.js} +1 -1
- package/public/chunk-AFRS7ZFI.js +1 -0
- package/public/chunk-BS2EMJX7.js +1 -0
- package/public/{chunk-D6RX5SPU.js → chunk-BVNJ63AC.js} +1 -1
- package/public/{chunk-BIDQZJXT.js → chunk-CJIFFTFC.js} +1 -1
- package/public/{chunk-XNCOF5TV.js → chunk-CY55AES3.js} +1 -1
- package/public/{chunk-F3EORWUJ.js → chunk-DAYZQW6Q.js} +1 -1
- package/public/{chunk-WJNSNBGE.js → chunk-ED5XL3PD.js} +1 -1
- package/public/{chunk-A7YWFX6I.js → chunk-EJKB2WDE.js} +1 -1
- package/public/chunk-FA2N3XXT.js +1 -0
- package/public/chunk-IB5GZVXD.js +1 -0
- package/public/{chunk-MP3LZHQU.js → chunk-IVORLBXB.js} +1 -1
- package/public/{chunk-RN75UMGP.js → chunk-IW3HI4LO.js} +1 -1
- package/public/{chunk-ZJ4LBIOD.js → chunk-JU4PP2VY.js} +1 -1
- package/public/{chunk-7JR63ERC.js → chunk-KHNBODZR.js} +1 -1
- package/public/{chunk-QOKEWT7C.js → chunk-KRNQN3FT.js} +1 -1
- package/public/{chunk-7DTAFWJ7.js → chunk-KVW76M4O.js} +1 -1
- package/public/chunk-LMPCXQ23.js +1 -0
- package/public/{chunk-SIQ2FHQL.js → chunk-LV2VCDOI.js} +1 -1
- package/public/{chunk-G4TRVUCL.js → chunk-M6SHEAQY.js} +1 -1
- package/public/chunk-MDDU475D.js +1 -0
- package/public/{chunk-4WTXJHZA.js → chunk-MPVSAJDU.js} +1 -1
- package/public/{chunk-5S4H26Y6.js → chunk-NDNK3KHG.js} +1 -1
- package/public/{chunk-74VT5JYS.js → chunk-NV6GUYHV.js} +1 -1
- package/public/{chunk-7K5J3AOO.js → chunk-OKKTO3UM.js} +1 -1
- package/public/chunk-OOHFQB4Z.js +1 -0
- package/public/{chunk-J26JMISE.js → chunk-QGDVQDUP.js} +1 -1
- package/public/{chunk-KJHDP3ZC.js → chunk-QKWNCNRW.js} +1 -1
- package/public/{chunk-ZYZBMA5E.js → chunk-RDAMEJPR.js} +1 -1
- package/public/{chunk-GETFKFI6.js → chunk-SK5UJRQU.js} +1 -1
- package/public/{chunk-W4MTVPF3.js → chunk-TFEVMIHT.js} +1 -1
- package/public/chunk-U2KJ2IEE.js +1 -0
- package/public/{chunk-XXJO3JY3.js → chunk-UAQGK64S.js} +1 -1
- package/public/{chunk-3YKYXC2T.js → chunk-UKAOVQ6N.js} +1 -1
- package/public/{chunk-ZHMC7KSZ.js → chunk-UNVMI6CK.js} +1 -1
- package/public/{chunk-UFDZ4SFB.js → chunk-US5QSVJ2.js} +1 -1
- package/public/{chunk-KPVA6CSL.js → chunk-UWLLEMGO.js} +1 -1
- package/public/chunk-V2TYBIZV.js +1 -0
- package/public/{chunk-UC2NMLJ6.js → chunk-V7D5U2P3.js} +1 -1
- package/public/{chunk-M3N7PSSC.js → chunk-WNVJPPO7.js} +1 -1
- package/public/{chunk-G4CGNDAD.js → chunk-WP6BKFEA.js} +1 -1
- package/public/{chunk-OZ6IXX3E.js → chunk-WSYFRV2X.js} +1 -1
- package/public/{chunk-LBTLF3MZ.js → chunk-XLY5QPTN.js} +1 -1
- package/public/{chunk-5XU3C2P2.js → chunk-XY74TB4S.js} +1 -1
- package/public/{chunk-SJHJKPSQ.js → chunk-YP7JWH3J.js} +1 -1
- package/public/chunk-ZOKILXR3.js +1 -0
- package/public/index.html +1 -1
- package/public/main-6PBYD25D.js +1 -0
- package/public/chunk-4DLA2ICF.js +0 -1
- package/public/chunk-5HCG4CER.js +0 -1
- package/public/chunk-BVK7NCGF.js +0 -1
- package/public/chunk-DNLDZVVB.js +0 -1
- package/public/chunk-I544XQGS.js +0 -1
- package/public/chunk-J3XWQZ5N.js +0 -1
- package/public/chunk-MSXXP7RE.js +0 -1
- package/public/chunk-RD4QIA6H.js +0 -1
- package/public/chunk-TWQP6XJT.js +0 -1
- package/public/chunk-UCB7UE24.js +0 -1
- package/public/chunk-WRDG5DTE.js +0 -1
- package/public/chunk-XDGJOFX2.js +0 -1
- package/public/chunk-YJ7ICNKX.js +0 -1
- package/public/chunk-ZBNZILWV.js +0 -1
- package/public/main-TQOXBTSD.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{a as p}from"./chunk-UWLLEMGO.js";import{a as f}from"./chunk-EJKB2WDE.js";import"./chunk-KRNQN3FT.js";import"./chunk-BKUGARB4.js";import{q as a}from"./chunk-ORPWYWCL.js";import{y as u,z as d}from"./chunk-QHPDGSZ6.js";import"./chunk-SK5UJRQU.js";import{g as i}from"./chunk-NZNNTHFQ.js";import"./chunk-YP7JWH3J.js";import"./chunk-V7D5U2P3.js";import"./chunk-WNVJPPO7.js";import"./chunk-UG5DK2RQ.js";import{c as n}from"./chunk-3IX3CLER.js";import{ia as t,md as m,sb as r}from"./chunk-TXOB7R5K.js";var M=[{path:"",loadComponent:()=>import("./chunk-MDDU475D.js").then(o=>o.SetupWizardComponent)}],l=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({imports:[i.forChild(M),i]})}return o})();var R=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=r({type:o});static \u0275inj=t({providers:[p],imports:[m,u,d,n,a,l,f]})}return o})();export{R as SetupWizardModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as V,b as q}from"./chunk-
|
|
1
|
+
import{a as V,b as q}from"./chunk-6HR4EKFX.js";import{a as _}from"./chunk-KQJ7ONUG.js";import{n as D,o as F}from"./chunk-ORPWYWCL.js";import{b as B,j as E}from"./chunk-WNVJPPO7.js";import{a as k,b as z}from"./chunk-3IX3CLER.js";import{$b as T,Bc as i,Cc as r,Gb as L,Lb as b,Mb as h,Wb as s,Xb as l,Yb as p,cc as d,g as j,gb as y,h as w,ib as m,kc as C,lc as x,n as v,na as o,nc as I,oc as S,rb as $,xa as u,ya as f}from"./chunk-TXOB7R5K.js";var H=j(q(),1);var A=["logoutput"],X=(()=>{class c{$api=o(B);$log=o(V);$modal=o(D);$toastr=o(E);$translate=o(k);termTarget=L("logoutput");resizeEvent=new v;onWindowResize(){this.resizeEvent.next(void 0)}ngOnInit(){window.document.querySelector("body").classList.add("bg-black"),this.$log.startTerminal(this.termTarget(),{},this.resizeEvent)}ngOnDestroy(){window.document.querySelector("body").classList.remove("bg-black"),this.$log.destroyTerminal()}downloadLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_download_log_file"),t.componentInstance.message=this.$translate.instant("logs.download_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_download"),t.componentInstance.faIconClass="fas fa-fw fa-user-secret primary-text",t.result.then(()=>{this.$api.get("/platform-tools/hb-service/log/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{(0,H.saveAs)(e.body,"homebridge.log.txt")},error:e=>w(this,null,function*(){let n;try{n=JSON.parse(yield e.error.text()).message}catch(a){console.error(a)}this.$toastr.error(n||this.$translate.instant("logs.download.error"),this.$translate.instant("toast.title_error"))})})}).catch(()=>{})}truncateLogFile(){let t=this.$modal.open(_,{size:"lg",backdrop:"static"});t.componentInstance.title=this.$translate.instant("logs.title_truncate_log_file"),t.componentInstance.message=this.$translate.instant("logs.truncate_log_warning"),t.componentInstance.confirmButtonLabel=this.$translate.instant("form.button_delete"),t.componentInstance.confirmButtonClass="btn-danger",t.componentInstance.faIconClass="fas fa-fw fa-circle-exclamation primary-text",t.result.then(()=>{this.$api.put("/platform-tools/hb-service/log/truncate",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("logs.log_file_truncated"),this.$translate.instant("toast.title_success")),this.$log.term.clear()},error:e=>{console.error(e),this.$toastr.error(e.error.message||this.$translate.instant("logs.truncate.error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}static \u0275fac=function(e){return new(e||c)};static \u0275cmp=$({type:c,selectors:[["ng-component"]],viewQuery:function(e,n){e&1&&C(n.termTarget,A,5),e&2&&x()},hostBindings:function(e,n){e&1&&d("resize",function(g){return n.onWindowResize(g)},!1,y)},decls:17,vars:15,consts:[["logoutput",""],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-right"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["container","body","placement","bottom","openDelay","150","triggers","hover",1,"btn","btn-elegant","my-0","mr-0",3,"click","ngbTooltip"],[1,"fas","fa-fw","fa-trash-alt"],[1,"flex-column","d-flex","align-items-stretch","adjust-for-mobile"],["id","log-output",1,"align-self-end","w-100","h-100","mb-1"]],template:function(e,n){if(e&1){let a=T();s(0,"div",1)(1,"div",2)(2,"h3",3),I(3),i(4,"translate"),l()(),s(5,"div",4)(6,"button",5),i(7,"translate"),i(8,"translate"),d("click",function(){return u(a),f(n.downloadLogFile())}),p(9,"i",6),l(),s(10,"button",7),i(11,"translate"),i(12,"translate"),d("click",function(){return u(a),f(n.truncateLogFile())}),p(13,"i",8),l()()(),s(14,"div",9),p(15,"div",10,0),l()}e&2&&(m(3),S(r(4,5,"menu.linux.label_logs")),m(3),h("ngbTooltip",r(7,7,"form.button_download")),b("aria-label",r(8,9,"form.button_download")),m(4),h("ngbTooltip",r(11,11,"form.button_delete")),b("aria-label",r(12,13,"form.button_delete")))},dependencies:[F,z],encapsulation:2})}return c})();export{X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s}from"./chunk-NZNNTHFQ.js";import{c as i}from"./chunk-
|
|
1
|
+
import{d as s}from"./chunk-NZNNTHFQ.js";import{c as i}from"./chunk-YP7JWH3J.js";import{j as o}from"./chunk-WNVJPPO7.js";import{a}from"./chunk-3IX3CLER.js";import{ha as e,na as r}from"./chunk-TXOB7R5K.js";var v=(()=>{class t{$auth=r(i);$router=r(s);$translate=r(a);$toastr=r(o);canActivate(){return this.$auth.user&&this.$auth.user.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),this.$router.navigate(["/"]),!1)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=e({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{v as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as s}from"./chunk-NZNNTHFQ.js";import{b as n}from"./chunk-
|
|
1
|
+
import{d as s}from"./chunk-NZNNTHFQ.js";import{b as n}from"./chunk-V7D5U2P3.js";import{h as r,ha as o,na as e,w as i}from"./chunk-TXOB7R5K.js";var l=(()=>{class t{$router=e(s);$settings=e(n);canActivate(){return r(this,null,function*(){return this.$settings.settingsLoaded||(yield i(this.$settings.onSettingsLoaded)),this.$settings.env.setupWizardComplete===!1||this.$router.navigate(["/"]),!0})}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{l as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-WP6BKFEA.js";import"./chunk-SK5UJRQU.js";import"./chunk-NZNNTHFQ.js";import"./chunk-YP7JWH3J.js";import"./chunk-V7D5U2P3.js";import"./chunk-WNVJPPO7.js";import"./chunk-UG5DK2RQ.js";import"./chunk-3IX3CLER.js";import"./chunk-TXOB7R5K.js";export{a as ContainerRestartComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,j as it}from"./chunk-
|
|
1
|
+
import{b as X,j as it}from"./chunk-WNVJPPO7.js";import{l as tt}from"./chunk-UG5DK2RQ.js";import{a as et}from"./chunk-3IX3CLER.js";import{U as K,e as ut,g as ct,h as P,ha as R,n as Q,na as Y,w as G}from"./chunk-TXOB7R5K.js";var nt=ut((N,J)=>{(function(p,b){typeof N=="object"&&typeof J<"u"?J.exports=b():typeof define=="function"&&define.amd?define(b):(p=typeof globalThis<"u"?globalThis:p||self).dayjs=b()})(N,function(){"use strict";var p=1e3,b=6e4,o=36e5,f="millisecond",v="second",L="minute",O="hour",y="day",W="week",M="month",q="quarter",S="year",_="date",z="Invalid Date",rt=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,st=/\[([^\]]+)]|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,at={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},ot={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,M),s=t-e<0,a=i.clone().add(n+(s?-1:1),M);return+(-(n+(t-e)/(s?e-a:a-e))||0)},a:function(r){return r<0?Math.ceil(r)||0:Math.floor(r)},p:function(r){return{M,y:S,w:W,d:y,D:_,h:O,m:L,s:v,ms:f,Q:q}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var B="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[B])},I=function r(i,t,n){var e;if(!i)return x;if(typeof i=="string"){var s=i.toLowerCase();D[s]&&(e=s),t&&(D[s]=t,e=s);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&&(x=e),e||!n&&x},d=function(r,i){if(U(r))return r.clone();var t=typeof i=="object"?i:{};return t.date=r,t.args=arguments,new V(t)},u=ot;u.l=I,u.i=U,u.w=function(r,i){return d(r,{locale:i.$L,utc:i.$u,x:i.$x,$offset:i.$offset})};var V=function(){function r(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[B]=!0}var i=r.prototype;return i.parse=function(t){this.$d=function(n){var e=n.date,s=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(rt);if(a){var c=a[2]-1||0,h=(a[7]||"0").substring(0,3);return s?new Date(Date.UTC(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,h)):new Date(a[1],c,a[3]||1,a[4]||0,a[5]||0,a[6]||0,h)}}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()!==z},i.isSame=function(t,n){var e=d(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return d(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<d(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,s=!!u.u(n)||n,a=u.p(t),c=function(k,m){var w=u.w(e.$u?Date.UTC(e.$y,m,k):new Date(e.$y,m,k),e);return s?w:w.endOf(y)},h=function(k,m){return u.w(e.toDate()[k].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(m)),e)},l=this.$W,g=this.$M,$=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case M:return s?c(1,g):c(0,g+1);case W:var T=this.$locale().weekStart||0,A=(l<T?l+7:l)-T;return c(s?$-A:$+(6-A),g);case y:case _:return h(j+"Hours",0);case O:return h(j+"Minutes",1);case L:return h(j+"Seconds",2);case v:return h(j+"Milliseconds",3);default:return this.clone()}},i.endOf=function(t){return this.startOf(t,!1)},i.$set=function(t,n){var e,s=u.p(t),a="set"+(this.$u?"UTC":""),c=(e={},e[y]=a+"Date",e[_]=a+"Date",e[M]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[v]=a+"Seconds",e[f]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===M||s===S){var l=this.clone().set(_,1);l.$d[c](h),l.init(),this.$d=l.set(_,Math.min(this.$D,l.daysInMonth())).$d}else c&&this.$d[c](h);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,s=this;t=Number(t);var a=u.p(n),c=function(g){var $=d(s);return u.w($.date($.date()+Math.round(g*t)),s)};if(a===M)return this.set(M,this.$M+t);if(a===S)return this.set(S,this.$y+t);if(a===y)return c(1);if(a===W)return c(7);var h=(e={},e[L]=b,e[O]=o,e[v]=p,e)[a]||1,l=this.$d.getTime()+t*h;return u.w(l,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||z;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,$=e.months,j=e.meridiem,T=function(m,w,H,C){return m&&(m[w]||m(n,s))||H[w].slice(0,C)},A=function(m){return u.s(c%12||12,m,"0")},k=j||function(m,w,H){var C=m<12?"AM":"PM";return H?C.toLowerCase():C};return s.replace(st,function(m,w){return w||function(H){switch(H){case"YY":return String(n.$y).slice(-2);case"YYYY":return u.s(n.$y,4,"0");case"M":return l+1;case"MM":return u.s(l+1,2,"0");case"MMM":return T(e.monthsShort,l,$,3);case"MMMM":return T($,l);case"D":return n.$D;case"DD":return u.s(n.$D,2,"0");case"d":return String(n.$W);case"dd":return T(e.weekdaysMin,n.$W,g,2);case"ddd":return T(e.weekdaysShort,n.$W,g,3);case"dddd":return g[n.$W];case"H":return String(c);case"HH":return u.s(c,2,"0");case"h":return A(1);case"hh":return A(2);case"a":return k(c,h,!0);case"A":return k(c,h,!1);case"m":return String(h);case"mm":return u.s(h,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 s,a=this,c=u.p(n),h=d(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,$=function(){return u.m(a,h)};switch(c){case S:s=$()/12;break;case M:s=$();break;case q:s=$()/3;break;case W:s=(g-l)/6048e5;break;case y:s=(g-l)/864e5;break;case O:s=g/o;break;case L:s=g/b;break;case v:s=g/p;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(M).$D},i.$locale=function(){return D[this.$L]},i.locale=function(t,n){if(!t)return this.$L;var e=this.clone(),s=I(t,n,!0);return s&&(e.$L=s),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}(),E=V.prototype;return d.prototype=E,[["$ms",f],["$s",v],["$m",L],["$H",O],["$W",y],["$M",M],["$y",S],["$D",_]].forEach(function(r){E[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),d.extend=function(r,i){return r.$i||(r(i,V,d),r.$i=!0),d},d.locale=I,d.isDayjs=U,d.unix=function(r){return d(1e3*r)},d.en=D[x],d.Ls=D,d.p={},d})});var Z=ct(nt(),1);var vt=(()=>{class p{$api=Y(X);$title=Y(tt);$toastr=Y(it);$translate=Y(et);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;loginWallpaper;serverTimeOffset=0;themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new Q;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return P(this,null,function*(){let o=yield G(this.$api.get("/auth/settings"));this.formAuth=o.formAuth,this.env=o.env,this.lightingMode=o.lightingMode,this.loginWallpaper=o.loginWallpaper,this.setLightingMode(this.lightingMode,"user"),this.setTheme(o.theme),this.setTitle(this.env.homebridgeInstanceName),this.checkServerTime(o.serverTimestamp),this.setUiVersion(o.env.packageVersion),this.setLang(this.env.lang),this.settingsLoaded=!0,this.settingsLoadedSubject.next(void 0)})}setBrowserLightingMode(o){this.browserLightingMode=o,this.lightingMode==="auto"&&this.setLightingMode(o,"browser")}setLightingMode(o,f){f==="user"&&(this.lightingMode=o),this.currentLightingMode=o,this.actualLightingMode=this.currentLightingMode==="auto"?this.browserLightingMode:this.currentLightingMode,this.theme&&this.setTheme(this.theme)}setTheme(o){(!o||!this.themeList.includes(o))&&(o="orange");let f=window.document.querySelector("body");f.classList.remove(`config-ui-x-${this.theme}`),f.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(f.classList.add(`config-ui-x-dark-mode-${this.theme}`),f.classList.contains("dark-mode")||f.classList.add("dark-mode")):(f.classList.add(`config-ui-x-${this.theme}`),f.classList.contains("dark-mode")&&f.classList.remove("dark-mode"))}setTitle(o){this.$title.setTitle(o||"Homebridge")}setUiVersion(o){this.uiVersion||(this.uiVersion=o)}setLang(o){o?this.$translate.use(o):o="auto",this.env.lang=o}setEnvItem(o,f){this.env[o]=f}checkServerTime(o){let v=(0,Z.default)(o).diff((0,Z.default)(),"hour");this.serverTimeOffset=v*60*60,(v>=8||v<=-8)&&this.$toastr.warning(this.$translate.instant("settings.datetime.incorrect"),this.$translate.instant("toast.title_warning"),{timeOut:2e4,tapToDismiss:!1}).onTap.subscribe(()=>{window.open("https://homebridge.io/w/JqTFs","_blank")})}static \u0275fac=function(f){return new(f||p)};static \u0275prov=R({token:p,factory:p.\u0275fac,providedIn:"root"})}return p})();export{nt as a,vt as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as dt,m as pt}from"./chunk-UG5DK2RQ.js";import{$b as U,Ca as H,Db as k,Fb as O,Ga as z,Kb as S,Lb as E,Mb as l,Nb as F,Pb as p,Sc as K,Wb as h,Xb as m,Yb as j,Zb as q,_b as G,a as u,b as T,bc as ht,cb as lt,cc as R,cd as Q,db as L,dc as c,e as It,ha as C,ia as ot,ib as r,jb as v,ka as rt,ma as w,mb as ct,n as g,na as _,nc as f,pc as y,qa as at,rb as Z,sb as ut,xa as $,ya as V}from"./chunk-TXOB7R5K.js";var mt=It((Gt,xt)=>{xt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.5",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"homebridge-config-ui-x":"dist/bin/standalone.js","hb-service":"dist/bin/hb-service.js"},engines:{node:"^18 || ^20 || ^22",homebridge:"^1.8.0 || ^2.0.0-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"11.1.1","@fastify/multipart":"8.3.0","@fastify/static":"7.0.4","@homebridge/hap-client":"2.0.5-beta.0","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.2","@nestjs/axios":"3.1.2","@nestjs/common":"10.4.8","@nestjs/core":"10.4.8","@nestjs/jwt":"10.2.0","@nestjs/passport":"10.0.3","@nestjs/platform-fastify":"10.4.8","@nestjs/platform-socket.io":"10.4.8","@nestjs/swagger":"8.0.7","@nestjs/websockets":"10.4.8",axios:"1.7.7","bash-color":"0.0.4","buffer-shims":"1.0.0","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"12.1.0",dayjs:"1.11.13",fastify:"4.28.1","fs-extra":"11.2.0",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"5.4.1",otplib:"12.0.1","p-limit":"3.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.1",semver:"7.6.3",systeminformation:"5.23.5",tail:"2.2.6",tar:"6.2.1","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@nestjs/testing":"^10.4.8","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.13","@types/node":"^22.9.1","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tar":"^6.1.13","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^2.1.5",concurrently:"^9.1.0","eslint-plugin-format":"^0.1.2","form-data":"^4.0.1",nodemon:"^3.1.7",rimraf:"^6.0.1","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.6.3","unplugin-swc":"^1.5.1",vitest:"^2.1.5"},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}]}});var D={serverTarget:mt().version,production:!0,socket:"",api:{base:"/api",socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[`${window.location.protocol}//${document.location.host}/api/auth/login`]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Wt=(()=>{class i{$http=_(dt);get(t,e){return this.$http.get(`${D.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${D.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${D.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${D.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${D.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var b=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(b||{}),te="*";function _t(i,s){return{type:b.Trigger,name:i,definitions:s,options:{}}}function Y(i,s=null){return{type:b.Animate,styles:s,timings:i}}function ee(i,s=null){return{type:b.Sequence,steps:i,options:s}}function N(i){return{type:b.Style,styles:i,offset:null}}function M(i,s,t){return{type:b.State,name:i,styles:s,options:t}}function J(i,s,t=null){return{type:b.Transition,expr:i,animation:s,options:t}}var ft=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(s=0,t=0){this.totalTime=s+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}onStart(s){this._originalOnStartFns.push(s),this._onStartFns.push(s)}onDone(s){this._originalOnDoneFns.push(s),this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(s=>s()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(s){this._position=this.totalTime?s*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},gt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(s){this.players=s;let t=0,e=0,n=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++e==o&&this._onDestroy()}),a.onStart(()=>{++n==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,d)=>Math.max(a,d.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}init(){this.players.forEach(s=>s.init())}onStart(s){this._onStartFns.push(s)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(s=>s()),this._onStartFns=[])}onDone(s){this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(s=>s.play())}pause(){this.players.forEach(s=>s.pause())}restart(){this.players.forEach(s=>s.restart())}finish(){this._onFinish(),this.players.forEach(s=>s.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(s=>s.destroy()),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this.players.forEach(s=>s.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(s){let t=s*this.totalTime;this.players.forEach(e=>{let n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let s=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return s!=null?s.getPosition():0}beforeDestroy(){this.players.forEach(s=>{s.beforeDestroy&&s.beforeDestroy()})}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ie="!";var vt=["toast-component",""];function St(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function Et(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Ft(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Et,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function jt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Rt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function At(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function Ht(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function kt(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Nt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,kt,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Mt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Pt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Bt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(s,t){this.component=s,this.injector=t}attach(s,t){return this._attachedHost=s,s.attach(this,t)}detach(){let s=this._attachedHost;if(s)return this._attachedHost=void 0,s.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(s){this._attachedHost=s}},X=class{_attachedPortal;_disposeFn;attach(s,t){return this._attachedPortal=s,this.attachComponentPortal(s,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(s){this._disposeFn=s}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new g;_activate=new g;_manualClose=new g;_resetTimeout=new g;_countDuplicate=new g;constructor(s){this._overlayRef=s}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(s,t){s&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},I=class{toastId;config;message;title;toastType;toastRef;_onTap=new g;_onAction=new g;constructor(s,t,e,n,o,a){this.toastId=s,this.config=t,this.message=e,this.title=n,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(s){this._onAction.next(s)}onAction(){return this._onAction.asObservable()}},yt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},bt=new rt("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(s,t,e){super(),this._hostDomElement=s,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(s,t){let e=this._componentFactoryResolver.resolveComponentFactory(s.component),n;return n=e.create(s.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(s){return s.hostView.rootNodes[0]}},$t=(()=>{class i{_document=_(K);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),it=class{_portalHost;constructor(s){this._portalHost=s}attach(s,t=!0){return this._portalHost.attach(s,t)}detach(){return this._portalHost.detach()}},Vt=(()=>{class i{_overlayContainer=_($t);_componentFactoryResolver=_(ct);_appRef=_(k);_document=_(K);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new et(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new it(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Tt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,o,a){this.overlay=e,this._injector=n,this.sanitizer=o,this.ngZone=a,this.toastrConfig=u(u({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},o=""){return this._preBuildNotification(o,t,e,this.applyConfig(n))}success(t,e,n={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}error(t,e,n={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}info(t,e,n={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}warning(t,e,n={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,o){let{includeTitleDuplicates:a}=this.toastrConfig;for(let d of this.toasts){let A=a&&d.title===t;if((!a||A)&&d.message===e)return d.toastRef.onDuplicate(n,o),d}return null}applyConfig(t={}){return u(u({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,o)):this._buildNotification(t,e,n,o)}_buildNotification(t,e,n,o){if(!o.toastComponent)throw new Error("toastComponent required");let a=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&a!==null)return a;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let A=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let st=e;e&&o.enableHtml&&(st=this.sanitizer.sanitize(lt.HTML,e));let x=new tt(A),P=new I(this.index,o,st,n,t,x),Ct=[{provide:I,useValue:P}],wt=H.create({providers:Ct,parent:this._injector}),Dt=new W(o.toastComponent,wt),nt=A.attach(Dt,o.newestOnTop);x.componentInstance=nt.instance;let B={toastId:this.index,title:n||"",message:e||"",toastRef:x,onShown:x.afterActivate(),onHidden:x.afterClosed(),onTap:P.onTap(),onAction:P.onAction(),portal:nt};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{B.toastRef.activate()})),this.toasts.push(B),B}static \u0275fac=function(e){return new(e||i)(w(bt),w(Vt),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),zt=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=O({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>T(u({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>T(u({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>T(u({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(z))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(ht("@flyInOut",n._state),p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,St,3,0,"button",0)(1,Ft,3,5,"div",1)(2,jt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,At,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,data:{animation:[_t("flyInOut",[M("inactive",N({opacity:0})),M("active",N({opacity:1})),M("removed",N({opacity:0})),J("inactive => active",Y("{{ easeTime }}ms {{ easing }}")),J("active => removed",Y("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),Lt=T(u({},yt),{toastComponent:zt}),Zt=(i={})=>at([{provide:bt,useValue:{default:Lt,config:i}}]),ye=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Zt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var qt=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=O("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(k))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,Ht,3,0,"button",0)(1,Nt,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Pt,2,4,"div",3)(4,Bt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,changeDetection:0})}return i})(),be=T(u({},yt),{toastComponent:qt});export{D as a,Wt as b,b as c,te as d,ee as e,N as f,ft as g,gt as h,ie as i,Tt as j,ye as k};
|
|
1
|
+
import{e as dt,m as pt}from"./chunk-UG5DK2RQ.js";import{$b as U,Ca as H,Db as k,Fb as O,Ga as z,Kb as S,Lb as E,Mb as l,Nb as F,Pb as p,Sc as K,Wb as h,Xb as m,Yb as j,Zb as q,_b as G,a as u,b as T,bc as ht,cb as lt,cc as R,cd as Q,db as L,dc as c,e as It,ha as C,ia as ot,ib as r,jb as v,ka as rt,ma as w,mb as ct,n as g,na as _,nc as f,pc as y,qa as at,rb as Z,sb as ut,xa as $,ya as V}from"./chunk-TXOB7R5K.js";var mt=It((Gt,xt)=>{xt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.7",description:"A web based management, configuration and control platform for Homebridge.",author:"oznu <dev@oz.nu>",license:"MIT",funding:[{type:"github",url:"https://github.com/sponsors/oznu"},{type:"paypal",url:"https://paypal.me/oznu"}],repository:{type:"git",url:"git+https://github.com/homebridge/homebridge-config-ui-x.git"},bugs:{url:"https://github.com/homebridge/homebridge-config-ui-x/issues"},keywords:["homebridge-plugin","ui","gui","web","homebridge","homebridge-config-ui-x","ui-x","config-ui-x","homebridge-x","homebridge server","homebridge ui","homebridge-ui","homebridge gui","homebridge-gui","web interface","config ui","management","config editor","linux","macOS","osx","windows","raspberry pi","accessory control","smart home","hb-service"],main:"./dist/index.js",bin:{"homebridge-config-ui-x":"dist/bin/standalone.js","hb-service":"dist/bin/hb-service.js"},engines:{node:"^18 || ^20 || ^22",homebridge:"^1.8.0 || ^2.0.0-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"11.1.1","@fastify/multipart":"8.3.0","@fastify/static":"7.0.4","@homebridge/hap-client":"2.0.5-beta.0","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.2","@nestjs/axios":"3.1.2","@nestjs/common":"10.4.8","@nestjs/core":"10.4.8","@nestjs/jwt":"10.2.0","@nestjs/passport":"10.0.3","@nestjs/platform-fastify":"10.4.8","@nestjs/platform-socket.io":"10.4.8","@nestjs/swagger":"8.0.7","@nestjs/websockets":"10.4.8",axios:"1.7.7","bash-color":"0.0.4","buffer-shims":"1.0.0","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"12.1.0",dayjs:"1.11.13",fastify:"4.28.1","fs-extra":"11.2.0",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"5.4.1",otplib:"12.0.1","p-limit":"3.1.0",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.1",semver:"7.6.3",systeminformation:"5.23.5",tail:"2.2.6",tar:"6.2.1","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^3.9.2","@nestjs/testing":"^10.4.8","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.13","@types/node":"^22.9.3","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tar":"^6.1.13","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^2.1.5",concurrently:"^9.1.0","eslint-plugin-format":"^0.1.2","form-data":"^4.0.1",nodemon:"^3.1.7",rimraf:"^6.0.1","ts-loader":"^9.5.1","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.7.2","unplugin-swc":"^1.5.1",vitest:"^2.1.5"},maintainers:[{email:"bwp91@icloud.com",name:"bwp91"},{email:"dev@oz.nu",name:"oznu"},{email:"northern.man1@gmail.com",name:"northernman"},{email:"mail@anderl-bauer.de",name:"supereg"},{email:"khaos.tian@gmail.com",name:"khaost"},{email:"erik.baauw@xs4all.nl",name:"ebaauw"},{email:"donavan.becker@icloud.com",name:"donavanbecker"},{email:"dustin.greif@gmail.com",name:"dustin.greif"},{email:"nfarina@gmail.com",name:"nfarina"}]}});var D={serverTarget:mt().version,production:!0,socket:"",api:{base:"/api",socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[`${window.location.protocol}//${document.location.host}/api/auth/login`]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Wt=(()=>{class i{$http=_(dt);get(t,e){return this.$http.get(`${D.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${D.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${D.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${D.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${D.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var b=function(i){return i[i.State=0]="State",i[i.Transition=1]="Transition",i[i.Sequence=2]="Sequence",i[i.Group=3]="Group",i[i.Animate=4]="Animate",i[i.Keyframes=5]="Keyframes",i[i.Style=6]="Style",i[i.Trigger=7]="Trigger",i[i.Reference=8]="Reference",i[i.AnimateChild=9]="AnimateChild",i[i.AnimateRef=10]="AnimateRef",i[i.Query=11]="Query",i[i.Stagger=12]="Stagger",i}(b||{}),te="*";function _t(i,s){return{type:b.Trigger,name:i,definitions:s,options:{}}}function Y(i,s=null){return{type:b.Animate,styles:s,timings:i}}function ee(i,s=null){return{type:b.Sequence,steps:i,options:s}}function N(i){return{type:b.Style,styles:i,offset:null}}function M(i,s,t){return{type:b.State,name:i,styles:s,options:t}}function J(i,s,t=null){return{type:b.Transition,expr:i,animation:s,options:t}}var ft=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(s=0,t=0){this.totalTime=s+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}onStart(s){this._originalOnStartFns.push(s),this._onStartFns.push(s)}onDone(s){this._originalOnDoneFns.push(s),this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(s=>s()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(s){this._position=this.totalTime?s*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},gt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(s){this.players=s;let t=0,e=0,n=0,o=this.players.length;o==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(a=>{a.onDone(()=>{++t==o&&this._onFinish()}),a.onDestroy(()=>{++e==o&&this._onDestroy()}),a.onStart(()=>{++n==o&&this._onStart()})}),this.totalTime=this.players.reduce((a,d)=>Math.max(a,d.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(s=>s()),this._onDoneFns=[])}init(){this.players.forEach(s=>s.init())}onStart(s){this._onStartFns.push(s)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(s=>s()),this._onStartFns=[])}onDone(s){this._onDoneFns.push(s)}onDestroy(s){this._onDestroyFns.push(s)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(s=>s.play())}pause(){this.players.forEach(s=>s.pause())}restart(){this.players.forEach(s=>s.restart())}finish(){this._onFinish(),this.players.forEach(s=>s.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(s=>s.destroy()),this._onDestroyFns.forEach(s=>s()),this._onDestroyFns=[])}reset(){this.players.forEach(s=>s.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(s){let t=s*this.totalTime;this.players.forEach(e=>{let n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})}getPosition(){let s=this.players.reduce((t,e)=>t===null||e.totalTime>t.totalTime?e:t,null);return s!=null?s.getPosition():0}beforeDestroy(){this.players.forEach(s=>{s.beforeDestroy&&s.beforeDestroy()})}triggerCallback(s){let t=s=="start"?this._onStartFns:this._onDoneFns;t.forEach(e=>e()),t.length=0}},ie="!";var vt=["toast-component",""];function St(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function Et(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Ft(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Et,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function jt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Rt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function At(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function Ht(i,s){if(i&1){let t=U();h(0,"button",5),R("click",function(){$(t);let n=c();return V(n.remove())}),h(1,"span",6),f(2,"\xD7"),m()()}}function kt(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Nt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,kt,2,1,"ng-container",4),m()),i&2){let t=c();p(t.options.titleClass),E("aria-label",t.title),r(),y(" ",t.title," "),r(),l("ngIf",t.duplicatesCount)}}function Mt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Pt(i,s){if(i&1&&(h(0,"div",8),f(1),m()),i&2){let t=c();p(t.options.messageClass),E("aria-label",t.message),r(),y(" ",t.message," ")}}function Bt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}var W=class{_attachedHost;component;viewContainerRef;injector;constructor(s,t){this.component=s,this.injector=t}attach(s,t){return this._attachedHost=s,s.attach(this,t)}detach(){let s=this._attachedHost;if(s)return this._attachedHost=void 0,s.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(s){this._attachedHost=s}},X=class{_attachedPortal;_disposeFn;attach(s,t){return this._attachedPortal=s,this.attachComponentPortal(s,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(s){this._disposeFn=s}},tt=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new g;_activate=new g;_manualClose=new g;_resetTimeout=new g;_countDuplicate=new g;constructor(s){this._overlayRef=s}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(s,t){s&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},I=class{toastId;config;message;title;toastType;toastRef;_onTap=new g;_onAction=new g;constructor(s,t,e,n,o,a){this.toastId=s,this.config=t,this.message=e,this.title=n,this.toastType=o,this.toastRef=a,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(s){this._onAction.next(s)}onAction(){return this._onAction.asObservable()}},yt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},bt=new rt("ToastConfig"),et=class extends X{_hostDomElement;_componentFactoryResolver;_appRef;constructor(s,t,e){super(),this._hostDomElement=s,this._componentFactoryResolver=t,this._appRef=e}attachComponentPortal(s,t){let e=this._componentFactoryResolver.resolveComponentFactory(s.component),n;return n=e.create(s.injector),this._appRef.attachView(n.hostView),this.setDisposeFn(()=>{this._appRef.detachView(n.hostView),n.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(n),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(n)),n}_getComponentRootNode(s){return s.hostView.rootNodes[0]}},$t=(()=>{class i{_document=_(K);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),it=class{_portalHost;constructor(s){this._portalHost=s}attach(s,t=!0){return this._portalHost.attach(s,t)}detach(){return this._portalHost.detach()}},Vt=(()=>{class i{_overlayContainer=_($t);_componentFactoryResolver=_(ct);_appRef=_(k);_document=_(K);_paneElements=new Map;create(t,e){return this._createOverlayRef(this.getPaneElement(t,e))}getPaneElement(t="",e){return this._paneElements.get(e)||this._paneElements.set(e,{}),this._paneElements.get(e)[t]||(this._paneElements.get(e)[t]=this._createPaneElement(t,e)),this._paneElements.get(e)[t]}_createPaneElement(t,e){let n=this._document.createElement("div");return n.id="toast-container",n.classList.add(t),n.classList.add("toast-container"),e?e.getContainerElement().appendChild(n):this._overlayContainer.getContainerElement().appendChild(n),n}_createPortalHost(t){return new et(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new it(this._createPortalHost(t))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Tt=(()=>{class i{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,e,n,o,a){this.overlay=e,this._injector=n,this.sanitizer=o,this.ngZone=a,this.toastrConfig=u(u({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=u(u({},t.default.iconClasses),t.config.iconClasses))}show(t,e,n={},o=""){return this._preBuildNotification(o,t,e,this.applyConfig(n))}success(t,e,n={}){let o=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}error(t,e,n={}){let o=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}info(t,e,n={}){let o=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}warning(t,e,n={}){let o=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(o,t,e,this.applyConfig(n))}clear(t){for(let e of this.toasts)if(t!==void 0){if(e.toastId===t){e.toastRef.manualClose();return}}else e.toastRef.manualClose()}remove(t){let e=this._findToast(t);if(!e||(e.activeToast.toastRef.close(),this.toasts.splice(e.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let n=this.toasts[this.currentlyActive].toastRef;n.isInactive()||(this.currentlyActive=this.currentlyActive+1,n.activate())}return!0}findDuplicate(t="",e="",n,o){let{includeTitleDuplicates:a}=this.toastrConfig;for(let d of this.toasts){let A=a&&d.title===t;if((!a||A)&&d.message===e)return d.toastRef.onDuplicate(n,o),d}return null}applyConfig(t={}){return u(u({},this.toastrConfig),t)}_findToast(t){for(let e=0;e<this.toasts.length;e++)if(this.toasts[e].toastId===t)return{index:e,activeToast:this.toasts[e]};return null}_preBuildNotification(t,e,n,o){return o.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,e,n,o)):this._buildNotification(t,e,n,o)}_buildNotification(t,e,n,o){if(!o.toastComponent)throw new Error("toastComponent required");let a=this.findDuplicate(n,e,this.toastrConfig.resetTimeoutOnDuplicate&&o.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&n||e)&&this.toastrConfig.preventDuplicates&&a!==null)return a;this.previousToastMessage=e;let d=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(d=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let A=this.overlay.create(o.positionClass,this.overlayContainer);this.index=this.index+1;let st=e;e&&o.enableHtml&&(st=this.sanitizer.sanitize(lt.HTML,e));let x=new tt(A),P=new I(this.index,o,st,n,t,x),Ct=[{provide:I,useValue:P}],wt=H.create({providers:Ct,parent:this._injector}),Dt=new W(o.toastComponent,wt),nt=A.attach(Dt,o.newestOnTop);x.componentInstance=nt.instance;let B={toastId:this.index,title:n||"",message:e||"",toastRef:x,onShown:x.afterActivate(),onHidden:x.afterClosed(),onTap:P.onTap(),onAction:P.onAction(),portal:nt};return d||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{B.toastRef.activate()})),this.toasts.push(B),B}static \u0275fac=function(e){return new(e||i)(w(bt),w(Vt),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),zt=(()=>{class i{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.ngZone=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o}),this.state=O({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>T(u({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>T(u({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>T(u({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),e)):this.timeout=setTimeout(()=>t(),e)}outsideInterval(t,e){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),e)):this.intervalId=setInterval(()=>t(),e)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(z))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(ht("@flyInOut",n._state),p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,St,3,0,"button",0)(1,Ft,3,5,"div",1)(2,jt,1,3,"div",2)(3,Rt,2,4,"div",3)(4,At,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,data:{animation:[_t("flyInOut",[M("inactive",N({opacity:0})),M("active",N({opacity:1})),M("removed",N({opacity:0})),J("inactive => active",Y("{{ easeTime }}ms {{ easing }}")),J("active => removed",Y("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return i})(),Lt=T(u({},yt),{toastComponent:zt}),Zt=(i={})=>at([{provide:bt,useValue:{default:Lt,config:i}}]),ye=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Zt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var qt=(()=>{class i{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=O(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=O("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,e,n){this.toastrService=t,this.toastPackage=e,this.appRef=n,this.message=e.message,this.title=e.title,this.options=e.config,this.originalTimeout=e.config.timeOut,this.toastClasses=`${e.toastType} ${e.config.toastClass}`,this.sub=e.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=e.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=e.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=e.toastRef.countDuplicate().subscribe(o=>{this.duplicatesCount=o})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),e=this.hideTime-t;this.width.set(e/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(n=>100-n),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(e){return new(e||i)(v(Tt),v(I),v(k))};static \u0275cmp=Z({type:i,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(e,n){e&1&&R("click",function(){return n.tapToast()})("mouseenter",function(){return n.stickAround()})("mouseleave",function(){return n.delayedHideToast()}),e&2&&(p(n.toastClasses),F("display",n.displayStyle))},attrs:vt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(e,n){e&1&&S(0,Ht,3,0,"button",0)(1,Nt,3,5,"div",1)(2,Mt,1,3,"div",2)(3,Pt,2,4,"div",3)(4,Bt,2,2,"div",4),e&2&&(l("ngIf",n.options.closeButton),r(),l("ngIf",n.title),r(),l("ngIf",n.message&&n.options.enableHtml),r(),l("ngIf",n.message&&!n.options.enableHtml),r(),l("ngIf",n.options.progressBar))},dependencies:[Q],encapsulation:2,changeDetection:0})}return i})(),be=T(u({},yt),{toastComponent:qt});export{D as a,Wt as b,b as c,te as d,ee as e,N as f,ft as g,gt as h,ie as i,Tt as j,ye as k};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-SK5UJRQU.js";import{d as S}from"./chunk-NZNNTHFQ.js";import{b as k}from"./chunk-V7D5U2P3.js";import{b as y,j as T}from"./chunk-WNVJPPO7.js";import{a as C,b as $}from"./chunk-3IX3CLER.js";import{Bc as p,Cc as m,Kb as _,Mb as x,Rb as c,Wb as n,Xb as r,Yb as f,db as u,dc as g,ib as e,na as a,nc as o,oc as s,rb as v}from"./chunk-TXOB7R5K.js";function b(t,h){t&1&&(n(0,"p",7),o(1),p(2,"translate"),r()),t&2&&(e(),s(m(2,1,"restart.please_wait_while_server_restarts")))}function E(t,h){if(t&1&&(n(0,"div",8),o(1),r()),t&2){let i=g();e(),s(i.error)}}function I(t,h){t&1&&(n(0,"div",9)(1,"div",10),f(2,"i",11),r()())}function R(t,h){t&1&&(n(0,"div")(1,"div",12)(2,"p"),o(3),p(4,"translate"),r(),f(5,"p",13),p(6,"translate"),r()()),t&2&&(e(3),s(m(4,2,"platform.docker.server_long_time")),e(2),x("innerHTML",m(6,4,"platform.docker.run_with_restart"),u))}var P=(()=>{class t{$api=a(y);$router=a(S);$settings=a(k);$toastr=a(T);$translate=a(C);$ws=a(w);checkTimeout;checkDelay;resp={};timeout=!1;error=!1;io;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch()}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:i=>{this.resp=i,this.checkIfServerUp()},error:i=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(i),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",i=>{(i.status==="up"||i.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}static \u0275fac=function(l){return new(l||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],decls:15,vars:10,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"grey-text"],[1,"alert","alert-error","my-4"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"alert","alert-warning","my-4"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(l,d){l&1&&(n(0,"div",0)(1,"h3",1),o(2),p(3,"translate"),r()(),n(4,"div",2)(5,"div",3),f(6,"i",4),r(),n(7,"div",5)(8,"h4",6),o(9),p(10,"translate"),r(),_(11,b,3,3,"p",7)(12,E,2,1,"div",8)(13,I,3,0,"div",9)(14,R,7,6,"div"),r()()),l&2&&(e(2),s(m(3,6,"menu.restart.title")),e(7),s(m(10,8,"platform.docker.title_restarting")),e(2),c(d.error?-1:11),e(),c(d.error?12:-1),e(),c(d.error?-1:13),e(),c(d.timeout?14:-1))},dependencies:[$],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;margin-top:15px}"]})}return t})();export{P as a};
|