homebridge-config-ui-x 5.0.0-beta.35 → 5.0.0-beta.37
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 +46 -15
- package/config.schema.json +2 -2
- package/dist/bin/hb-service.js +1 -1
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/core/auth/jwt.strategy.d.ts +3 -1
- package/dist/core/config/config.service.js +1 -1
- package/dist/modules/accessories/accessories.controller.js +1 -1
- package/dist/modules/accessories/accessories.controller.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.js +1 -1
- package/dist/modules/config-editor/config-editor.controller.js.map +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js +1 -1
- package/dist/modules/platform-tools/hb-service/hb-service.controller.js.map +1 -1
- package/dist/modules/plugins/plugins.service.d.ts +2 -1
- package/dist/modules/plugins/plugins.service.js +46 -29
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.controller.d.ts +3 -0
- package/dist/modules/server/server.controller.js +12 -0
- package/dist/modules/server/server.controller.js.map +1 -1
- package/dist/modules/server/server.service.d.ts +1 -0
- package/dist/modules/server/server.service.js +10 -3
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.gateway.d.ts +1 -0
- package/dist/modules/status/status.service.d.ts +1 -0
- package/dist/modules/status/status.service.js +1 -0
- package/dist/modules/status/status.service.js.map +1 -1
- package/dist/modules/users/users.controller.js +6 -6
- package/dist/modules/users/users.controller.js.map +1 -1
- package/package.json +29 -33
- package/public/3rdpartylicenses.txt +8 -8
- package/public/chunk-2FYN4AQW.js +1 -0
- package/public/{chunk-NEL5H4ZP.js → chunk-2G5W635D.js} +16 -16
- package/public/{chunk-XQNHUDX7.js → chunk-2UAJRTNP.js} +1 -1
- package/public/chunk-2VHNXX7S.js +1 -0
- package/public/{chunk-4SJ5YXGK.js → chunk-3BOXNWOI.js} +1 -1
- package/public/chunk-3X3JN7L2.js +1 -0
- package/public/chunk-43DZUHXS.js +1 -0
- package/public/chunk-55C65QIT.js +1 -0
- package/public/chunk-5F65XVN2.js +6 -0
- package/public/{chunk-W4HHTKG5.js → chunk-5GX76JEA.js} +1 -1
- package/public/chunk-5RZMUJ6S.js +1 -0
- package/public/{chunk-Y63TC2BD.js → chunk-5ZSMI5RW.js} +1 -1
- package/public/chunk-6DSQDU6X.js +1 -0
- package/public/{chunk-7BCHGXO4.js → chunk-6LUEJV3C.js} +1 -1
- package/public/{chunk-QBQBIGHH.js → chunk-6ZW6DFXM.js} +1 -1
- package/public/chunk-7HPEGK3R.js +1 -0
- package/public/chunk-A6ASL2RK.js +1 -0
- package/public/{chunk-SQJXCJMZ.js → chunk-AFHUSYKG.js} +1 -1
- package/public/chunk-BFEMJZWI.js +14 -0
- package/public/{chunk-5KLZWFYX.js → chunk-BN42B6ZN.js} +1 -1
- package/public/chunk-BQQ7SI73.js +1 -0
- package/public/chunk-BY7XCS73.js +1 -0
- package/public/chunk-C2RICIO2.js +1 -0
- package/public/{chunk-NSCP3SOQ.js → chunk-C2UJXFYZ.js} +1 -1
- package/public/chunk-CKRLUDH6.js +1 -0
- package/public/chunk-CNUMFNDI.js +1 -0
- package/public/{chunk-CLZ6XK3S.js → chunk-D67RSISA.js} +1 -1
- package/public/chunk-E66CIXOF.js +5 -0
- package/public/chunk-ELVGIIRZ.js +7 -0
- package/public/{chunk-K5KJYFWM.js → chunk-ESV4M6MU.js} +1 -1
- package/public/chunk-FMKN5WOC.js +1 -0
- package/public/chunk-G67F4LRX.js +1 -0
- package/public/{chunk-23M23WV2.js → chunk-HIDFXEU7.js} +1 -1
- package/public/chunk-HLCA3Q2D.js +1 -0
- package/public/chunk-I7356EVZ.js +1 -0
- package/public/chunk-I7MMB7MD.js +1 -0
- package/public/chunk-ICBZE4AQ.js +1 -0
- package/public/{chunk-FN5IQFDD.js → chunk-IK7NDR5D.js} +1 -1
- package/public/chunk-ILMG4QEX.js +1 -0
- package/public/chunk-IS2FWNNK.js +1 -0
- package/public/chunk-J535GCZZ.js +1 -0
- package/public/{chunk-OVFRRCBZ.js → chunk-J6THMA7C.js} +8 -8
- package/public/{chunk-474BOAR2.js → chunk-KBQ7X43U.js} +1 -1
- package/public/chunk-KFPAD73Q.js +1 -0
- package/public/chunk-KLH3Q4Y2.js +1 -0
- package/public/{chunk-TFXCOLWH.js → chunk-KP734VBH.js} +1 -1
- package/public/{chunk-422KDBY6.js → chunk-KPSDMQ2B.js} +1 -1
- package/public/chunk-LCDLXCTN.js +1 -0
- package/public/chunk-LCZPCRGZ.js +1 -0
- package/public/{chunk-H6I47YZL.js → chunk-LPZYBAR5.js} +1 -1
- package/public/{chunk-MVXWO6QY.js → chunk-LRWWB655.js} +1 -1
- package/public/{chunk-XP7D2PRA.js → chunk-NDNNBXT7.js} +1 -1
- package/public/{chunk-BOT4S75X.js → chunk-NKOXS7BF.js} +1 -1
- package/public/chunk-OHS6VJO6.js +1 -0
- package/public/chunk-OKRGBGAT.js +1 -0
- package/public/{chunk-WJQ5NIPP.js → chunk-PZFLYD2M.js} +1 -1
- package/public/chunk-QVTW3TV2.js +1 -0
- package/public/{chunk-C2XBPNOQ.js → chunk-QZ7FBUFJ.js} +1 -1
- package/public/chunk-RNZPYTKX.js +1 -0
- package/public/{chunk-YTJNIFE4.js → chunk-RWV2PLEE.js} +1 -1
- package/public/chunk-RYTJZDC4.js +1 -0
- package/public/{chunk-DUJ3BGGS.js → chunk-SASLISZ4.js} +1 -1
- package/public/{chunk-YUIH2PS7.js → chunk-SIUO7YU6.js} +2 -2
- package/public/{chunk-QNMOJRFY.js → chunk-SRFN5JIN.js} +1 -1
- package/public/chunk-T3Y7RYJZ.js +2 -0
- package/public/{chunk-RP5TYXWG.js → chunk-TAQCEDBC.js} +1 -1
- package/public/chunk-UFQ3GRVA.js +1 -0
- package/public/chunk-UGU6PGAK.js +1 -0
- package/public/chunk-UUN6ZLIL.js +1 -0
- package/public/chunk-V7AAZRAR.js +1 -0
- package/public/{chunk-XFK2EZ3K.js → chunk-VGMRIFZA.js} +1 -1
- package/public/{chunk-JF5AT3NK.js → chunk-VOG67KUU.js} +1 -1
- package/public/chunk-W37K3EET.js +1 -0
- package/public/{chunk-MW5FLUTC.js → chunk-WK4QAH4N.js} +1 -1
- package/public/chunk-WKCJOWBB.js +20 -0
- package/public/chunk-WLL3PI56.js +1 -0
- package/public/chunk-WZSACMEZ.js +1 -0
- package/public/chunk-X33TW7UK.js +1 -0
- package/public/{chunk-IZGH4P6X.js → chunk-XBUA2BEY.js} +1 -1
- package/public/{chunk-NFG4Y4PX.js → chunk-Z4JLHDGQ.js} +1 -1
- package/public/chunk-Z6DMRX3O.js +1 -0
- package/public/chunk-ZA7ZUC3I.js +1 -0
- package/public/chunk-ZGB2LSNB.js +1 -0
- package/public/index.html +2 -2
- package/public/main-323ROD6Y.js +1 -0
- package/public/styles-IBQHST5Z.css +1 -0
- package/scripts/upgrade-install-plugin.sh +1 -1
- package/public/chunk-3ANQRJ75.js +0 -14
- package/public/chunk-3NBOT4LS.js +0 -1
- package/public/chunk-3NUILNOV.js +0 -1
- package/public/chunk-4K52REGI.js +0 -1
- package/public/chunk-675OFXLW.js +0 -1
- package/public/chunk-6PASDO7Z.js +0 -1
- package/public/chunk-6ZBSMLTF.js +0 -1
- package/public/chunk-7QIBCP7M.js +0 -1
- package/public/chunk-A4EWGMID.js +0 -1
- package/public/chunk-BMWLHPL2.js +0 -1
- package/public/chunk-C5KFW74N.js +0 -1
- package/public/chunk-CKNHTRCL.js +0 -7
- package/public/chunk-CLRNWSOV.js +0 -1
- package/public/chunk-CYTZT7JJ.js +0 -1
- package/public/chunk-CZFALVDS.js +0 -1
- package/public/chunk-DQ74FZ3Y.js +0 -1
- package/public/chunk-E5E5IQT6.js +0 -1
- package/public/chunk-EEDUUZ6J.js +0 -1
- package/public/chunk-FAJ5V6VJ.js +0 -1
- package/public/chunk-FOI6EIET.js +0 -1
- package/public/chunk-FTQGTOHC.js +0 -1
- package/public/chunk-GPDMT3AA.js +0 -1
- package/public/chunk-GQSQBG3U.js +0 -1
- package/public/chunk-GUVLPN3O.js +0 -1
- package/public/chunk-HA6CO5NZ.js +0 -2
- package/public/chunk-I54VWEMF.js +0 -1
- package/public/chunk-JAFIYTUM.js +0 -1
- package/public/chunk-KJN5AUI6.js +0 -1
- package/public/chunk-KQPBNPKN.js +0 -1
- package/public/chunk-N4F42HDL.js +0 -5
- package/public/chunk-N722B4ER.js +0 -1
- package/public/chunk-NRZYSY7C.js +0 -1
- package/public/chunk-O7VQF4E3.js +0 -1
- package/public/chunk-OKMMSTW4.js +0 -1
- package/public/chunk-OLNAFRAE.js +0 -1
- package/public/chunk-PLBUFQSF.js +0 -1
- package/public/chunk-PZ2IXNJQ.js +0 -1
- package/public/chunk-RXB7TYLO.js +0 -1
- package/public/chunk-SQYMES5W.js +0 -1
- package/public/chunk-STQ2AZLE.js +0 -20
- package/public/chunk-T3GI7KUT.js +0 -1
- package/public/chunk-UF46IMIV.js +0 -1
- package/public/chunk-WBSQUODA.js +0 -6
- package/public/chunk-WJ3IINUA.js +0 -1
- package/public/chunk-WONZP2FV.js +0 -1
- package/public/chunk-X5YRTZFZ.js +0 -1
- package/public/chunk-XGP6D3NB.js +0 -1
- package/public/chunk-XZM6BEAM.js +0 -1
- package/public/chunk-YLEC7AUG.js +0 -1
- package/public/main-P2CDEM4R.js +0 -1
- package/public/media/01-RQ3S2L53.png +0 -0
- package/public/media/02-VNCG2I2A.png +0 -0
- package/public/media/03-HI42L4ZG.png +0 -0
- package/public/media/04-FJLL55LZ.png +0 -0
- package/public/media/05-V3EO6SPT.png +0 -0
- package/public/media/06-EOJZCQZN.png +0 -0
- package/public/media/07-KMKB5PBD.png +0 -0
- package/public/media/08-UQJRF6B2.png +0 -0
- package/public/media/09-2DJQFRHH.png +0 -0
- package/public/media/arrow_left-CQT7FZM7.svg +0 -4
- package/public/media/arrow_right-SBUDRR2G.svg +0 -4
- package/public/scripts-6GVLYD7F.js +0 -62
- package/public/styles-EZS52PWT.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as N,d as w,e as T,f as O,g as q,j as x,m as G,p as Q,q as z,w as D,y as H,z as j}from"./chunk-A6ASL2RK.js";import{d as W}from"./chunk-7HPEGK3R.js";import{c as K}from"./chunk-WK4QAH4N.js";import{b as J}from"./chunk-RWV2PLEE.js";import{j as U}from"./chunk-V7AAZRAR.js";import{b as A}from"./chunk-G67F4LRX.js";import{$c as M,Ac as s,Bc as l,Kb as p,M as $,Pb as c,Ub as r,Vb as a,Wb as m,bc as L,cc as I,cd as R,gb as o,h as b,jc as v,kc as P,ma as g,mc as d,nc as C,oc as B,pb as h,sb as k,w as V,wc as f,zb as S}from"./chunk-ELVGIIRZ.js";var X=["password"],Y=["username"],Z=["otp"],ee=e=>({background:e}),E=e=>({"is-invalid":e});function te(e,_){if(e&1&&(r(0,"div",10)(1,"span",11),m(2,"i",12),a(),m(3,"input",13,0),s(5,"translate"),a(),r(6,"div",14)(7,"span",11),m(8,"i",15),a(),m(9,"input",16,1),s(11,"translate"),a()),e&2){let t=I();o(3),p("placeholder",l(5,4,"users.label_username"))("ngClass",f(8,E,t.form.controls.username.dirty&&t.form.controls.username.errors)),o(6),p("placeholder",l(11,6,"users.label_password"))("ngClass",f(10,E,t.form.controls.password.dirty&&t.form.controls.password.errors))}}function ne(e,_){if(e&1&&(r(0,"p",7),d(1),s(2,"translate"),a(),r(3,"div",14)(4,"span",11),m(5,"i",17),a(),m(6,"input",18,2),s(8,"translate"),a()),e&2){let t=I();o(),C(l(2,3,"users.setup_2fa_enter_code")),o(5),p("placeholder",l(8,5,"login.label_2fa_code"))("ngClass",f(7,E,t.form.controls.otp.dirty&&t.form.controls.otp.errors))}}function ie(e,_){e&1&&(r(0,"p",8)(1,"small"),d(2),s(3,"translate"),a()()),e&2&&(o(2),C(l(3,1,"login.invalid_credentials")))}function oe(e,_){e&1&&(r(0,"p",8)(1,"small"),d(2),s(3,"translate"),a()()),e&2&&(o(2),C(l(3,1,"login.message_invalid_2fa_code")))}var Ce=(()=>{class e{$auth=g(K);$router=g(W);$settings=g(J);passwordInput=h("password");usernameInput=h("username");otpInput=h("otp");form;backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;targetRoute;constructor(){}ngOnInit(){this.form=new q({username:new x(""),password:new x("")}),this.form.valueChanges.pipe($(500)).subscribe(t=>{var n;let i=(n=this.passwordInput())==null?void 0:n.nativeElement.value;i&&i!==t.password&&this.form.controls.password.setValue(i)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}setBackground(){return b(this,null,function*(){if(this.$settings.settingsLoaded||(yield V(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let t=this.$settings.env.customWallpaperHash?`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`:"/assets/snapshot.jpg";this.backgroundStyle=`url('${t}') center/cover`}})}onSubmit(){return b(this,null,function*(){var n,y,F;this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0;let t=(n=this.passwordInput())==null?void 0:n.nativeElement.value;t&&t!==this.form.get("password").value&&this.form.controls.password.setValue(t);let i=(y=this.usernameInput())==null?void 0:y.nativeElement.value;if(i&&i!==this.form.get("username").value&&this.form.controls.username.setValue(i),this.twoFactorCodeRequired){let u=(F=this.otpInput())==null?void 0:F.nativeElement.value;u&&u!==this.form.get("otp").value&&this.form.controls.username.setValue(u)}yield this.$auth.login(this.form.getRawValue()).then(()=>{this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}).catch(u=>{u.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new x("",[w.required,w.minLength(6),w.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}),this.inProgress=!1})}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(i,n){i&1&&(v(n.passwordInput,X,5),v(n.usernameInput,Y,5),v(n.otpInput,Z,5)),i&2&&P(3)},decls:13,vars:12,consts:[["username",""],["password",""],["otp",""],[1,"login-container","d-flex","align-items-center","justify-content-center",3,"ngStyle"],[1,"card","card-body","mx-2","login-card"],["novalidate","",3,"ngSubmit","formGroup"],[1,"h4","text-center","mb-4"],[1,"text-center"],[1,"red-text"],["tabindex","3","type","submit",1,"btn","btn-primary",3,"disabled"],[1,"md-form","input-group","mb-3"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","prefix","grey-text"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1",1,"form-control","custom-input","py-2",3,"placeholder","ngClass"],[1,"md-form","input-group","mb-4"],[1,"fas","fa-fw","fa-lock","prefix","grey-text"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2",1,"form-control","custom-input","py-2",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-key","prefix","grey-text"],["formControlName","otp","type","text","id","form-ota","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input","py-2",3,"placeholder","ngClass"]],template:function(i,n){i&1&&(r(0,"div",3)(1,"div",4)(2,"form",5),L("ngSubmit",function(){return n.onSubmit()}),r(3,"p",6),d(4,"Homebridge"),a(),S(5,te,12,12)(6,ne,9,9),r(7,"div",7),S(8,ie,4,3,"p",8)(9,oe,4,3,"p",8),r(10,"button",9),d(11),s(12,"translate"),a()()()()()),i&2&&(p("ngStyle",f(10,ee,n.backgroundStyle)),o(2),p("formGroup",n.form),o(3),c(n.twoFactorCodeRequired?-1:5),o(),c(n.twoFactorCodeRequired?6:-1),o(2),c(n.invalidCredentials?8:-1),o(),c(n.invalid2faCode?9:-1),o(),p("disabled",n.form.invalid),o(),B(" ",l(12,8,"login.button_login")," "))},dependencies:[R,H,G,N,T,O,D,j,Q,z,M,A],styles:[".login-container[_ngcontent-%COMP%]{background-color:#f4f4f4;background-size:cover;position:absolute;top:0;bottom:0;right:0;left:0}.login-card[_ngcontent-%COMP%]{max-width:500px;background-color:#ffffffe6}@media screen and (min-height: 800px){.login-card[_ngcontent-%COMP%]{margin-bottom:12em}}.login-logo[_ngcontent-%COMP%]{position:absolute;top:-35%;z-index:2000;max-width:450px}@media screen and (max-width: 450px){.login-logo[_ngcontent-%COMP%]{max-width:320px;top:-25%}}@media screen and (max-width: 320px){.login-logo[_ngcontent-%COMP%]{max-width:280px}}@media screen and (max-height: 450px){.login-logo[_ngcontent-%COMP%]{display:none}}"]})}return e})();export{Ce as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as et,k as it}from"./chunk-3NBOT4LS.js";import{l as X}from"./chunk-HA6CO5NZ.js";import{a as tt}from"./chunk-675OFXLW.js";import{U as K,e as ut,g as ct,h as Q,ha as R,n as G,na as Y,w as N}from"./chunk-CKNHTRCL.js";var nt=ut((J,Z)=>{(function(M,b){typeof J=="object"&&typeof Z<"u"?Z.exports=b():typeof define=="function"&&define.amd?define(b):(M=typeof globalThis<"u"?globalThis:M||self).dayjs=b()})(J,function(){"use strict";var M=1e3,b=6e4,o=36e5,d="millisecond",$="second",L="minute",O="hour",y="day",W="week",v="month",z="quarter",S="year",_="date",B="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,v),s=t-e<0,a=i.clone().add(n+(s?-1:1),v);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:v,y:S,w:W,d:y,D:_,h:O,m:L,s:$,ms:d,Q:z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var E="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[E])},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},f=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 f(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[E]=!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()!==B},i.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return f(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<f(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,p=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case v: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?p-A:p+(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 $: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[v]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[$]=a+"Seconds",e[d]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===v||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 p=f(s);return u.w(p.date(p.date()+Math.round(g*t)),s)};if(a===v)return this.set(v,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[$]=M,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||B;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,p=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,p,3);case"MMMM":return T(p,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=f(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,p=function(){return u.m(a,h)};switch(c){case S:s=p()/12;break;case v:s=p();break;case z:s=p()/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 $:s=g/M;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(v).$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}(),P=V.prototype;return f.prototype=P,[["$ms",d],["$s",$],["$m",L],["$H",O],["$W",y],["$M",v],["$y",S],["$D",_]].forEach(function(r){P[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),f.extend=function(r,i){return r.$i||(r(i,V,f),r.$i=!0),f},f.locale=I,f.isDayjs=U,f.unix=function(r){return f(1e3*r)},f.en=D[x],f.Ls=D,f.p={},f})});var q=ct(nt(),1);var vt=(()=>{class M{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;loginWallpaper;serverTimeOffset=0;defaultTheme="orange";themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new G;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return Q(this,null,function*(){let o=yield N(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.setMenuMode(o.menuMode),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,d){d==="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=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:o})).catch($=>console.error($)));let d=window.document.querySelector("body");d.classList.remove(`config-ui-x-${this.theme}`),d.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(d.classList.add(`config-ui-x-dark-mode-${this.theme}`),d.classList.contains("dark-mode")||d.classList.add("dark-mode")):(d.classList.add(`config-ui-x-${this.theme}`),d.classList.contains("dark-mode")&&d.classList.remove("dark-mode"))}setMenuMode(o){this.menuMode=o}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,d){this.env[o]=d}checkServerTime(o){let $=(0,q.default)(o).diff((0,q.default)(),"hour");this.serverTimeOffset=$*60*60,($>=8||$<=-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(d){return new(d||M)};static \u0275prov=R({token:M,factory:M.\u0275fac,providedIn:"root"})}return M})();export{nt as a,vt as b};
|
|
1
|
+
import{h as et,k as it}from"./chunk-V7AAZRAR.js";import{l as X}from"./chunk-T3Y7RYJZ.js";import{a as tt}from"./chunk-G67F4LRX.js";import{T as K,e as ut,g as ct,ga as R,h as Q,ma as Y,n as G,w as N}from"./chunk-ELVGIIRZ.js";var nt=ut((J,Z)=>{(function(M,b){typeof J=="object"&&typeof Z<"u"?Z.exports=b():typeof define=="function"&&define.amd?define(b):(M=typeof globalThis<"u"?globalThis:M||self).dayjs=b()})(J,function(){"use strict";var M=1e3,b=6e4,o=36e5,d="millisecond",$="second",L="minute",O="hour",y="day",W="week",v="month",z="quarter",S="year",_="date",B="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,v),s=t-e<0,a=i.clone().add(n+(s?-1:1),v);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:v,y:S,w:W,d:y,D:_,h:O,m:L,s:$,ms:d,Q:z}[r]||String(r||"").toLowerCase().replace(/s$/,"")},u:function(r){return r===void 0}},x="en",D={};D[x]=at;var E="$isDayjsObject",U=function(r){return r instanceof V||!(!r||!r[E])},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},f=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 f(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[E]=!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()!==B},i.isSame=function(t,n){var e=f(t);return this.startOf(n)<=e&&e<=this.endOf(n)},i.isAfter=function(t,n){return f(t)<this.startOf(n)},i.isBefore=function(t,n){return this.endOf(n)<f(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,p=this.$D,j="set"+(this.$u?"UTC":"");switch(a){case S:return s?c(1,0):c(31,11);case v: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?p-A:p+(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 $: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[v]=a+"Month",e[S]=a+"FullYear",e[O]=a+"Hours",e[L]=a+"Minutes",e[$]=a+"Seconds",e[d]=a+"Milliseconds",e)[s],h=s===y?this.$D+(n-this.$W):n;if(s===v||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 p=f(s);return u.w(p.date(p.date()+Math.round(g*t)),s)};if(a===v)return this.set(v,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[$]=M,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||B;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=u.z(this),c=this.$H,h=this.$m,l=this.$M,g=e.weekdays,p=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,p,3);case"MMMM":return T(p,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=f(t),l=(h.utcOffset()-this.utcOffset())*b,g=this-h,p=function(){return u.m(a,h)};switch(c){case S:s=p()/12;break;case v:s=p();break;case z:s=p()/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 $:s=g/M;break;default:s=g}return e?s:u.a(s)},i.daysInMonth=function(){return this.endOf(v).$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}(),P=V.prototype;return f.prototype=P,[["$ms",d],["$s",$],["$m",L],["$H",O],["$W",y],["$M",v],["$y",S],["$D",_]].forEach(function(r){P[r[1]]=function(i){return this.$g(i,r[0],r[1])}}),f.extend=function(r,i){return r.$i||(r(i,V,f),r.$i=!0),f},f.locale=I,f.isDayjs=U,f.unix=function(r){return f(1e3*r)},f.en=D[x],f.Ls=D,f.p={},f})});var q=ct(nt(),1);var vt=(()=>{class M{$api=Y(it);$title=Y(X);$toastr=Y(et);$translate=Y(tt);env={};formAuth=!0;uiVersion;theme;lightingMode;currentLightingMode;actualLightingMode;browserLightingMode;menuMode;loginWallpaper;serverTimeOffset=0;defaultTheme="orange";themeList=["orange","red","pink","purple","deep-purple","indigo","blue","blue-grey","cyan","green","teal","grey","brown"];rtl=!1;settingsLoadedSubject=new G;onSettingsLoaded=this.settingsLoadedSubject.pipe(K());settingsLoaded=!1;constructor(){this.getAppSettings()}getAppSettings(){return Q(this,null,function*(){let o=yield N(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.setMenuMode(o.menuMode),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,d){d==="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=this.defaultTheme,N(this.$api.put("/config-editor/ui",{key:"theme",value:o})).catch($=>console.error($)));let d=window.document.querySelector("body");d.classList.remove(`config-ui-x-${this.theme}`),d.classList.remove(`config-ui-x-dark-mode-${this.theme}`),this.theme=o,this.actualLightingMode==="dark"?(d.classList.add(`config-ui-x-dark-mode-${this.theme}`),d.classList.contains("dark-mode")||d.classList.add("dark-mode")):(d.classList.add(`config-ui-x-${this.theme}`),d.classList.contains("dark-mode")&&d.classList.remove("dark-mode"))}setMenuMode(o){this.menuMode=o}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,d){this.env[o]=d}checkServerTime(o){let $=(0,q.default)(o).diff((0,q.default)(),"hour");this.serverTimeOffset=$*60*60,($>=8||$<=-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(d){return new(d||M)};static \u0275prov=R({token:M,factory:M.\u0275fac,providedIn:"root"})}return M})();export{nt as a,vt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as we}from"./chunk-UUN6ZLIL.js";import{a as ke}from"./chunk-CNUMFNDI.js";import{v as ye}from"./chunk-2G5W635D.js";import{g as J,m as N,n as he}from"./chunk-E66CIXOF.js";import{b as G,c as oe,e as W,f as le,g as Z,j as D,k as se,l as q,m as de,n as pe,o as ce,p as me,q as _e,r as ue,s as ge,t as ve,u as be,v as xe,y as K,z as fe}from"./chunk-A6ASL2RK.js";import{d as P,e as Ce}from"./chunk-7HPEGK3R.js";import{b as Se}from"./chunk-RWV2PLEE.js";import{h as V,k as R}from"./chunk-V7AAZRAR.js";import{a as F,b as $}from"./chunk-G67F4LRX.js";import{$c as O,Ac as o,Bc as l,Cc as Y,Jb as x,Kb as g,M as Q,Pb as v,Rb as A,Sb as T,Tb as M,Ub as i,Vb as a,Wb as m,_b as k,bc as b,cb as X,cc as u,ed as j,gb as t,h as y,ma as w,mc as r,nc as p,oc as _,rc as ne,sb as B,sc as ae,tc as re,ua as C,va as S,w as E,wc as H,xc as I,yc as L,zb as h}from"./chunk-ELVGIIRZ.js";function Me(n,c){n&1&&(i(0,"div",12),m(1,"i",13),a(),i(2,"p",14),r(3),o(4,"translate"),a()),n&2&&(t(3),p(l(4,1,"reset.no_accessories")))}function Ne(n,c){n&1&&(i(0,"div",12),m(1,"i",15),a(),i(2,"ul",16)(3,"li"),r(4),o(5,"translate"),a(),i(6,"li"),r(7),o(8,"translate"),a(),i(9,"li"),r(10),o(11,"translate"),a()(),i(12,"ngb-alert",17)(13,"p",18),r(14),o(15,"translate"),a()()),n&2&&(t(4),p(l(5,5,"reset.accessory_all.list_1")),t(3),p(l(8,7,"reset.accessory_all.list_2")),t(3),p(l(11,9,"reset.accessory_all.list_3")),t(2),g("dismissible",!1),t(2),p(l(15,11,"reset.action_is_irreversible")))}function Fe(n,c){if(n&1){let e=k();i(0,"button",19),o(1,"translate"),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),a()}if(n&2){let e=u();g("disabled",e.clicked),x("aria-label",l(1,3,"form.button_close")),t(2),_(" ",l(3,5,"form.button_close")," ")}}function Ve(n,c){if(n&1){let e=k();i(0,"button",20),o(1,"translate"),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(2),o(3,"translate"),a()}n&2&&(x("aria-label",l(1,2,"form.button_close")),t(2),_(" ",l(3,4,"form.button_close")," "))}function Re(n,c){n&1&&(r(0),o(1,"translate")),n&2&&_(" ",l(1,1,"form.button_remove")," ")}function De(n,c){n&1&&m(0,"i",22)}function Pe(n,c){if(n&1){let e=k();i(0,"button",21),b("click",function(){C(e);let d=u();return S(d.onResetCachedAccessoriesClick())}),h(1,Re,2,3)(2,De,1,0,"i",22),a()}if(n&2){let e=u();g("disabled",e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Ee=(()=>{class n{$activeModal=w(N);$api=w(R);$router=w(P);$toastr=w(V);$translate=w(F);clicked=!1;cachedAccessories=[];constructor(){}ngOnInit(){this.loadCachedAccessories()}loadCachedAccessories(){return y(this,null,function*(){try{this.cachedAccessories=yield E(this.$api.get("/server/cached-accessories"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("reset.error_message"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}onResetCachedAccessoriesClick(){return this.clicked=!0,this.$api.put("/server/reset-cached-accessories",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.delete_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-network-wired","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(s,d){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),a()(),i(7,"div",4),h(8,Me,5,3)(9,Ne,16,13),a(),i(10,"div",5)(11,"div",6),h(12,Fe,4,7,"button",7),a(),i(13,"div",8),h(14,Ve,4,6,"button",9),a(),i(15,"div",10),h(16,Pe,3,3,"button",11),a()()()),s&2&&(t(3),p(l(4,8,"reset.accessory_all.title")),t(2),g("disabled",d.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(d.cachedAccessories.length===0?8:-1),t(),v(d.cachedAccessories.length>0?9:-1),t(3),v(d.cachedAccessories.length>0?12:-1),t(2),v(d.cachedAccessories.length===0?14:-1),t(2),v(d.cachedAccessories.length>0?16:-1))},dependencies:[J,$],encapsulation:2})}return n})();var He=(n,c)=>({"green-text":n,"grey-text":c}),Le=(n,c)=>({"btn-danger":n,"btn-elegant":c}),Oe=(n,c,e)=>({"fa-broom":n,"fa-undo":c,"fa-spinner fa-pulse":e});function Ue(n,c){n&1&&(i(0,"div",12),m(1,"i",13),a(),i(2,"p",14),r(3),o(4,"translate"),a()),n&2&&(t(3),p(l(4,1,"reset.bridge_accessories.empty")))}function ze(n,c){if(n&1){let e=k();i(0,"li",18)(1,"span"),r(2),m(3,"br"),i(4,"small",19),m(5,"i",20),r(6),o(7,"translate"),i(8,"span",21),r(9),a()()(),i(10,"button",22),o(11,"translate"),b("click",function(){let d=C(e).$implicit,f=u(2);return S(f.toggleList(d._id))}),m(12,"i",23),a()()}if(n&2){let e=c.$implicit,s=u(2);t(2),_(" ",e.name," "),t(3),g("ngClass",I(12,He,e._isPaired,!e._isPaired)),t(),_(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),g("disabled",s.clicked)("ngClass",I(15,Le,!s.toDelete.includes(e._id),s.toDelete.includes(e._id))),x("aria-label",l(11,10,"form.button_delete")),t(2),g("ngClass",L(18,Oe,!s.toDelete.includes(e._id),s.toDelete.includes(e._id)&&!s.clicked,s.toDelete.includes(e._id)&&s.clicked))}}function je(n,c){if(n&1&&(i(0,"div",12),m(1,"i",15),a(),i(2,"ul",16)(3,"li"),r(4),o(5,"translate"),a(),i(6,"li"),r(7),o(8,"translate"),a(),i(9,"li"),r(10),o(11,"translate"),a()(),i(12,"ul",17),T(13,ze,13,22,"li",18,A),a()),n&2){let e=u();t(4),p(l(5,3,"reset.bridge_accessories.list_1")),t(3),p(l(8,5,"reset.clear_cache_single.list_3")),t(3),p(l(11,7,"reset.bridge_accessories.list_2")),t(3),M(e.pairings)}}function Ge(n,c){if(n&1){let e=k();i(0,"button",24),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}if(n&2){let e=u();g("disabled",e.clicked),t(),_(" ",l(2,2,"form.button_close")," ")}}function We(n,c){if(n&1){let e=k();i(0,"button",25),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),_(" ",l(2,1,"form.button_close")," "))}function qe(n,c){if(n&1&&r(0),n&2){let e=u(3);_(" (",e.toDelete.length,") ")}}function Ke(n,c){if(n&1&&(r(0),o(1,"translate"),h(2,qe,1,1)),n&2){let e=u(2);_(" ",l(1,2,"form.button_remove")," "),t(2),v(e.toDelete.length>0?2:-1)}}function Je(n,c){n&1&&m(0,"i",27)}function Qe(n,c){if(n&1){let e=k();i(0,"button",26),b("click",function(){C(e);let d=u();return S(d.cleanBridges())}),h(1,Ke,3,4)(2,Je,1,0,"i",27),a()}if(n&2){let e=u();g("disabled",!e.toDelete.length||e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Be=(()=>{class n{$activeModal=w(N);$api=w(R);$router=w(P);$toastr=w(V);$translate=w(F);clicked=!1;pairings=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{this.pairings=(yield E(this.$api.get("/server/pairings"))).filter(e=>e._category==="bridge"&&!e._main).sort((e,s)=>e.name.localeCompare(s.name))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e){this.toDelete.includes(e)?this.toDelete=this.toDelete.filter(s=>s!==e):this.toDelete.push(e)}cleanBridges(){return this.clicked=!0,this.$api.delete("/server/pairings/accessories",{body:this.toDelete.map(e=>({id:e}))}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.accessory_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"mb-0","text-center"],[1,"fas","fa-fw","fa-broom","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(s,d){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),a()(),i(7,"div",4),h(8,Ue,5,3)(9,je,15,9),a(),i(10,"div",5)(11,"div",6),h(12,Ge,3,4,"button",7),a(),i(13,"div",8),h(14,We,3,3,"button",9),a(),i(15,"div",10),h(16,Qe,3,3,"button",11),a()()()),s&2&&(t(3),p(l(4,8,"reset.bridge_accessories.title")),t(2),g("disabled",d.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(d.pairings.length===0?8:-1),t(),v(d.pairings.length>0?9:-1),t(3),v(d.pairings.length>0?12:-1),t(2),v(d.pairings.length===0?14:-1),t(2),v(d.pairings.length>0?16:-1))},dependencies:[O,$],encapsulation:2})}return n})();function Xe(n,c){n&1&&(r(0),o(1,"translate")),n&2&&_(" ",l(1,1,"form.button_reset")," ")}function Ye(n,c){n&1&&m(0,"i",16)}var Ie=(()=>{class n{$activeModal=w(N);$api=w(R);$route=w(P);$toastr=w(V);$translate=w(F);clicked;constructor(){}onResetHomebridgeAccessoryClick(){return this.clicked=!0,this.$api.put("/server/reset-homebridge-accessory",{}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.accessory_reset"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$route.navigate(["/restart"])},error:e=>{console.error(e),this.$toastr.error(this.$translate.instant("reset.failed_to_reset"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:38,vars:33,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"text-center","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(s,d){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),a()(),i(7,"div",4)(8,"div",5),m(9,"i",6),a(),i(10,"ul",7)(11,"li"),r(12),o(13,"translate"),a(),i(14,"li"),r(15),o(16,"translate"),a(),i(17,"li"),r(18),o(19,"translate"),a(),i(20,"li"),r(21),o(22,"translate"),a()(),i(23,"ngb-alert",8)(24,"p",9),r(25),o(26,"translate"),a()()(),i(27,"div",10)(28,"div",11)(29,"button",12),o(30,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),r(31),o(32,"translate"),a()(),m(33,"div",13),i(34,"div",14)(35,"button",15),b("click",function(){return d.onResetHomebridgeAccessoryClick()}),h(36,Xe,2,3)(37,Ye,1,0,"i",16),a()()()()),s&2&&(t(3),p(l(4,15,"reset.bridge_all.title")),t(2),g("disabled",d.clicked),x("aria-label",l(6,17,"form.button_close")),t(7),p(l(13,19,"reset.bridge_all.list_1")),t(3),p(l(16,21,"reset.bridge_all.list_2")),t(3),p(l(19,23,"reset.bridge_all.list_3")),t(3),p(l(22,25,"reset.bridge_all.list_4")),t(2),g("dismissible",!1),t(2),p(l(26,27,"reset.action_is_irreversible")),t(4),g("disabled",d.clicked),x("aria-label",l(30,29,"form.button_close")),t(2),_(" ",l(32,31,"form.button_close")," "),t(4),g("disabled",d.clicked),t(),v(d.clicked?-1:36),t(),v(d.clicked?37:-1))},dependencies:[J,$],encapsulation:2})}return n})();var ee=(n,c)=>({"green-text":n,"grey-text":c}),te=(n,c)=>({"btn-danger":n,"btn-elegant":c}),$e=(n,c,e)=>({"fa-refresh":n,"fa-undo":c,"fa-spinner fa-pulse":e}),Ze=(n,c,e)=>({"fa-trash":n,"fa-undo":c,"fa-spinner fa-pulse":e});function et(n,c){n&1&&(i(0,"div",12),m(1,"i",13),a(),i(2,"p",14),r(3),o(4,"translate"),a()),n&2&&(t(3),p(l(4,1,"reset.bridges.empty")))}function tt(n,c){if(n&1){let e=k();i(0,"li",20)(1,"span"),r(2),m(3,"br"),i(4,"small",21),m(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a(),r(10),o(11,"titlecase"),a()(),i(12,"button",24),o(13,"translate"),b("click",function(){let d=C(e).$implicit,f=u(3);return S(f.toggleList(d._id,!1))}),m(14,"i",25),a()()}if(n&2){let e=c.$implicit,s=u(3);t(2),_(" ",e.name," "),t(3),g("ngClass",I(15,ee,e._isPaired,!e._isPaired)),t(),_(" ",l(7,9,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),_(" \xB7 ",e._main?"Homebridge":l(11,11,e._category)," "),t(2),g("disabled",s.clicked)("ngClass",I(18,te,!s.isInList(e._id),s.isInList(e._id))),x("aria-label",l(13,13,"form.button_unpair")),t(2),g("ngClass",L(21,$e,!s.isInList(e._id),s.isInList(e._id)&&!s.clicked,s.isInList(e._id)&&s.clicked))}}function it(n,c){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),T(8,tt,15,25,"li",20,A),a()),n&2){let e=u(2);t(3),p(l(4,2,"reset.bridge_ind.head_non_child")),t(3),p(l(7,4,"reset.bridge_ind.desc_non_child")),t(2),M(e.pairingsNonChild)}}function nt(n,c){if(n&1){let e=k();i(0,"li",20)(1,"span"),r(2),m(3,"br"),i(4,"small",21),m(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a()()(),i(10,"button",24),o(11,"translate"),b("click",function(){let d=C(e).$implicit,f=u(3);return S(f.toggleList(d._id,!0))}),m(12,"i",25),a()()}if(n&2){let e=c.$implicit,s=u(3);t(2),_(" ",e.name," "),t(3),g("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),_(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),g("disabled",s.clicked)("ngClass",I(15,te,!s.isInList(e._id),s.isInList(e._id))),x("aria-label",l(11,10,"form.button_unpair")),t(2),g("ngClass",L(18,$e,!s.isInList(e._id),s.isInList(e._id)&&!s.clicked,s.isInList(e._id)&&s.clicked))}}function at(n,c){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),T(8,nt,13,22,"li",20,A),a()),n&2){let e=u(2);t(3),p(l(4,2,"reset.bridge_ind.head_child_active")),t(3),p(l(7,4,"reset.bridge_ind.desc_child_active")),t(2),M(e.pairingsChildActive)}}function rt(n,c){if(n&1){let e=k();i(0,"li",20)(1,"span"),r(2),m(3,"br"),i(4,"small",21),m(5,"i",22),r(6),o(7,"translate"),i(8,"span",23),r(9),a()()(),i(10,"button",24),o(11,"translate"),b("click",function(){let d=C(e).$implicit,f=u(3);return S(f.toggleList(d._id,!1))}),m(12,"i",25),a()()}if(n&2){let e=c.$implicit,s=u(3);t(2),_(" ",e.name," "),t(3),g("ngClass",I(12,ee,e._isPaired,!e._isPaired)),t(),_(" ",l(7,8,e._isPaired?"status.widget.qr_paired":"status.widget.qr_unpaired")," \xB7 "),t(3),p(e._username),t(),g("disabled",s.clicked)("ngClass",I(15,te,!s.isInList(e._id),s.isInList(e._id))),x("aria-label",l(11,10,"form.button_unpair")),t(2),g("ngClass",L(18,Ze,!s.isInList(e._id),s.isInList(e._id)&&!s.clicked,s.isInList(e._id)&&s.clicked))}}function ot(n,c){if(n&1&&(i(0,"ul",16)(1,"li",17)(2,"h6",18),r(3),o(4,"translate"),a(),i(5,"p",19),r(6),o(7,"translate"),a()(),T(8,rt,13,22,"li",20,A),a()),n&2){let e=u(2);t(3),p(l(4,2,"reset.bridge_ind.head_child_stale")),t(3),p(l(7,4,"reset.bridge_ind.desc_child_stale")),t(2),M(e.pairingsChildStale)}}function lt(n,c){if(n&1&&(i(0,"div",12),m(1,"i",15),a(),h(2,it,10,6,"ul",16)(3,at,10,6,"ul",16)(4,ot,10,6,"ul",16)),n&2){let e=u();t(2),v(e.pairingsNonChild.length>0?2:-1),t(),v(e.pairingsChildActive.length>0?3:-1),t(),v(e.pairingsChildStale.length>0?4:-1)}}function st(n,c){if(n&1){let e=k();i(0,"button",26),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}if(n&2){let e=u();g("disabled",e.clicked),t(),_(" ",l(2,2,"form.button_close")," ")}}function dt(n,c){if(n&1){let e=k();i(0,"button",27),b("click",function(){C(e);let d=u();return S(d.$activeModal.dismiss("Dismiss"))}),r(1),o(2,"translate"),a()}n&2&&(t(),_(" ",l(2,1,"form.button_close")," "))}function pt(n,c){if(n&1&&r(0),n&2){let e=u(3);_(" (",e.toDelete.length,") ")}}function ct(n,c){if(n&1&&(r(0),o(1,"translate"),h(2,pt,1,1)),n&2){let e=u(2);_(" ",l(1,2,"form.button_reset")," "),t(2),v(e.toDelete.length>0?2:-1)}}function mt(n,c){n&1&&m(0,"i",29)}function _t(n,c){if(n&1){let e=k();i(0,"button",28),b("click",function(){C(e);let d=u();return S(d.removeBridges())}),h(1,ct,3,4)(2,mt,1,0,"i",29),a()}if(n&2){let e=u();g("disabled",!e.toDelete.length||e.clicked),t(),v(e.clicked?-1:1),t(),v(e.clicked?2:-1)}}var Ae=(()=>{class n{$activeModal=w(N);$api=w(R);$router=w(P);$toastr=w(V);$translate=w(F);clicked=!1;pairingsNonChild=[];pairingsChildActive=[];pairingsChildStale=[];toDelete=[];constructor(){}ngOnInit(){this.loadPairings()}loadPairings(){return y(this,null,function*(){try{let e=(yield E(this.$api.get("/server/pairings"))).filter(s=>!s._main).sort((s,d)=>s.name.localeCompare(d.name));this.pairingsChildActive=e.filter(s=>s._category==="bridge"&&!s._couldBeStale),this.pairingsNonChild=e.filter(s=>s._category!=="bridge"),this.pairingsChildStale=e.filter(s=>s._category==="bridge"&&s._couldBeStale)}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("settings.unpair_bridge.load_error"),this.$translate.instant("toast.title_error")),this.$activeModal.close()}})}toggleList(e,s=!1){this.toDelete.some(d=>d.id===e)?this.toDelete=this.toDelete.filter(d=>d.id!==e):this.toDelete.push({id:e,resetPairingInfo:s})}isInList(e){return this.toDelete.some(s=>s.id===e)}removeBridges(){return this.clicked=!0,this.$api.delete("/server/pairings",{body:this.toDelete}).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("reset.bridge_ind.done"),this.$translate.instant("toast.title_success")),this.$activeModal.close(),this.$router.navigate(["/restart"],{queryParams:{restarting:!0}})},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("reset.bridge_ind.fail"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:17,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"disabled"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-circle-check","primary-text",2,"font-size","75px"],[1,"text-center","mb-0"],[1,"fas","fa-fw","fa-bridge","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"mb-0","small","grey-text","text-center"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"fas","fa-fw","fa-link",3,"ngClass"],[1,"font-monospace"],[1,"btn","btn-danger","m-0","ms-3",3,"click","disabled","ngClass"],[1,"fas","fa-fw",3,"ngClass"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-danger",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"]],template:function(s,d){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),a()(),i(7,"div",4),h(8,et,5,3)(9,lt,5,3),a(),i(10,"div",5)(11,"div",6),h(12,st,3,4,"button",7),a(),i(13,"div",8),h(14,dt,3,3,"button",9),a(),i(15,"div",10),h(16,_t,3,3,"button",11),a()()()),s&2&&(t(3),p(l(4,8,"reset.bridge_ind.title")),t(2),g("disabled",d.clicked),x("aria-label",l(6,10,"form.button_close")),t(3),v(d.pairingsChildActive.length===0&&d.pairingsChildStale.length===0&&d.pairingsNonChild.length===0?8:-1),t(),v(d.pairingsChildActive.length>0||d.pairingsChildStale.length>0||d.pairingsNonChild.length>0?9:-1),t(3),v(d.pairingsChildActive.length>0||d.pairingsChildStale.length>0||d.pairingsNonChild.length>0?12:-1),t(2),v(d.pairingsChildActive.length===0&&d.pairingsChildStale.length===0&&d.pairingsNonChild.length===0?14:-1),t(2),v(d.pairingsChildActive.length>0||d.pairingsChildStale.length>0||d.pairingsNonChild.length>0?16:-1))},dependencies:[O,j,$],encapsulation:2})}return n})();function gt(n,c){if(n&1){let e=k();i(0,"li",10)(1,"span")(2,"label",17)(3,"input",18),re("ngModelChange",function(d){let f=C(e).$implicit;return ae(f.selected,d)||(f.selected=d),S(d)}),a(),i(4,"span"),r(5),a(),m(6,"span",19),a()(),i(7,"span",20),r(8),a()()}if(n&2){let e=c.$implicit;t(2),g("for","adapter"+e.iface),t(),g("id","adapter"+e.iface),ne("ngModel",e.selected),t(2),p(e.iface),t(3),p(e.ip4||e.ip6)}}var Te=(()=>{class n{$activeModal=w(N);availableNetworkAdapters=[];bridgeNetworkAdapters=[];constructor(){}submit(){this.$activeModal.close(this.availableNetworkAdapters.filter(e=>e.selected).map(e=>e.iface))}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],inputs:{availableNetworkAdapters:"availableNetworkAdapters",bridgeNetworkAdapters:"bridgeNetworkAdapters"},decls:35,vars:24,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-ethernet","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box"],[1,"list-group-item","d-flex","flex-row","justify-content-between"],[1,"list-group-item","d-flex","flex-row","flex-wrap","justify-content-between"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"],[1,"hb-uix-switch","d-inline","pe-3",3,"for"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"hb-uix-slider","hb-uix-round"],[1,"font-monospace"]],template:function(s,d){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),r(3),o(4,"translate"),a(),i(5,"button",3),o(6,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),a()(),i(7,"div",4)(8,"div",5),m(9,"i",6),a(),i(10,"ul",7)(11,"li"),r(12),o(13,"translate"),a()(),i(14,"ul",8)(15,"li",9)(16,"strong"),r(17),o(18,"translate"),a(),i(19,"strong"),r(20),o(21,"translate"),a()(),T(22,gt,9,5,"li",10,A),a()(),i(24,"div",11)(25,"div",12)(26,"button",13),o(27,"translate"),b("click",function(){return d.$activeModal.dismiss("Dismiss")}),r(28),o(29,"translate"),a()(),m(30,"div",14),i(31,"div",15)(32,"button",16),b("click",function(){return d.submit()}),r(33),o(34,"translate"),a()()()()),s&2&&(t(3),p(l(4,8,"settings.network.title_network_interfaces")),t(2),x("aria-label",l(6,10,"form.button_close")),t(7),p(l(13,12,"settings.network.message_network_interface")),t(5),p(l(18,14,"settings.network.label_interface_name")),t(3),p(l(21,16,"settings.network.label_ip_address")),t(2),M(d.availableNetworkAdapters),t(4),x("aria-label",l(27,18,"form.button_close")),t(2),_(" ",l(29,20,"form.button_close")," "),t(5),_(" ",l(34,22,"form.button_save")," "))},dependencies:[K,G,W,q,$],encapsulation:2})}return n})();var ie=n=>({"is-invalid":n}),vt=n=>({file:n}),bt=n=>({link:n}),xt=n=>({"fa-pulse":n}),ft=(n,c)=>({"badge-danger":n,"badge-info":c});function ht(n,c){n&1&&(i(0,"li",20)(1,"small",21),r(2),o(3,"translate"),a(),i(4,"button",22),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),_(" ",l(7,7,"menu.tooltip_restart")," "))}function Ct(n,c){if(n&1){let e=k();i(0,"ul",5)(1,"li",12)(2,"span"),r(3," Homebridge Name "),a(),i(4,"div",13),m(5,"input",14),o(6,"translate"),a()(),i(7,"li",15)(8,"span",16),r(9),o(10,"translate"),a(),i(11,"button",17),o(12,"translate"),b("click",function(){C(e);let d=u();return S(d.openUiSettings())}),m(13,"i",18),a()(),i(14,"li",15)(15,"span",16),r(16),o(17,"translate"),a(),i(18,"button",17),o(19,"translate"),b("click",function(){C(e);let d=u();return S(d.openBackupModal())}),m(20,"i",18),a()(),i(21,"li",15)(22,"span",16),r(23),o(24,"translate"),a(),i(25,"a",19),o(26,"translate"),m(27,"i",18),a()(),h(28,ht,8,9,"li",20),a()}if(n&2){let e=u();t(5),g("formControl",e.hbNameFormControl)("ngClass",H(24,ie,e.isInvalidHbName)),x("aria-label",l(6,10,"settings.network.port_ui")),t(4),_(" ",l(10,12,"menu.label_settings_advanced")," "),t(2),x("aria-label",l(12,14,"menu.label_settings_advanced")),t(5),_(" ",l(17,16,"backup.title_backup")," "),t(2),x("aria-label",l(19,18,"backup.title_backup")),t(5),_(" ",l(24,20,"menu.tooltip_user_accounts")," "),t(2),x("aria-label",l(26,22,"menu.tooltip_user_accounts")),t(3),v(e.hasChangedHbName&&!e.isInvalidHbName?28:-1)}}function St(n,c){n&1&&(i(0,"li",20)(1,"small",21),r(2),o(3,"translate"),a(),i(4,"button",22),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),_(" ",l(7,7,"menu.tooltip_restart")," "))}function wt(n,c){if(n&1){let e=k();i(0,"ul",6)(1,"li",12),r(2),o(3,"translate"),i(4,"div",23)(5,"select",24),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("lang",d))}),i(6,"option",25),r(7),o(8,"translate"),a(),i(9,"option",26),r(10,"Bulgarian (bg)"),a(),i(11,"option",27),r(12,"Catalan (ca)"),a(),i(13,"option",28),r(14,"Chinese - Simplified (zh-CN)"),a(),i(15,"option",29),r(16,"Chinese - Traditional (zh-TW)"),a(),i(17,"option",30),r(18,"Czech (cs)"),a(),i(19,"option",31),r(20,"Dutch (nl)"),a(),i(21,"option",32),r(22,"English (en)"),a(),i(23,"option",33),r(24,"Finnish (fi)"),a(),i(25,"option",34),r(26,"French (fr)"),a(),i(27,"option",35),r(28,"German (de)"),a(),i(29,"option",36),r(30,"Hebrew (he)"),a(),i(31,"option",37),r(32,"Hungarian (hu)"),a(),i(33,"option",38),r(34,"Indonesian (id)"),a(),i(35,"option",39),r(36,"Italian (it)"),a(),i(37,"option",40),r(38,"Japanese (ja)"),a(),i(39,"option",41),r(40,"Korean (ko)"),a(),i(41,"option",42),r(42,"Macedonian (mk)"),a(),i(43,"option",43),r(44,"Norwegian (no)"),a(),i(45,"option",44),r(46,"Polish (pl)"),a(),i(47,"option",45),r(48,"Portuguese (Brazil)"),a(),i(49,"option",46),r(50,"Portuguese (Portugal)"),a(),i(51,"option",47),r(52,"Russian (ru)"),a(),i(53,"option",48),r(54,"Slovenian (sl)"),a(),i(55,"option",49),r(56,"Spanish (es)"),a(),i(57,"option",50),r(58,"Swedish (sv)"),a(),i(59,"option",51),r(60,"Thai (th)"),a(),i(61,"option",52),r(62,"Turkish (tr)"),a(),i(63,"option",53),r(64,"Ukrainian (uk)"),a()()()(),i(65,"li",12),r(66),o(67,"translate"),i(68,"div",23)(69,"select",24),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("theme",d))}),i(70,"option",54),r(71),o(72,"translate"),a(),i(73,"option",55),r(74),o(75,"translate"),a(),i(76,"option",56),r(77),o(78,"translate"),a(),i(79,"option",57),r(80),o(81,"translate"),a(),i(82,"option",58),r(83),o(84,"translate"),a(),i(85,"option",59),r(86),o(87,"translate"),a(),i(88,"option",60),r(89),o(90,"translate"),a(),i(91,"option",61),r(92),o(93,"translate"),a(),i(94,"option",62),r(95),o(96,"translate"),a(),i(97,"option",63),r(98),o(99,"translate"),a(),i(100,"option",64),r(101),o(102,"translate"),a(),i(103,"option",65),r(104),o(105,"translate"),a(),i(106,"option",66),r(107),o(108,"translate"),a()()()(),i(109,"li",12),r(110),o(111,"translate"),i(112,"div",23)(113,"select",24),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("lightingMode",d))}),i(114,"option",25),r(115),o(116,"translate"),a(),i(117,"option",67),r(118),o(119,"translate"),a(),i(120,"option",68),r(121),o(122,"translate"),a()()()(),i(123,"li",12),r(124),o(125,"translate"),i(126,"div",23)(127,"select",24),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("menuMode",d))}),i(128,"option",69),r(129),o(130,"translate"),a(),i(131,"option",70),r(132),o(133,"translate"),a()()()(),i(134,"li",12)(135,"span"),r(136),o(137,"translate"),m(138,"br")(139,"small",71),o(140,"translate"),a(),i(141,"div",23)(142,"input",72),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("loginWallpaper",d))}),a()()(),i(143,"li",12),r(144),o(145,"translate"),i(146,"div",23)(147,"select",24),b("ngModelChange",function(d){C(e);let f=u();return S(f.saveUiSettingChange("tempUnits",d))}),i(148,"option",73),r(149),o(150,"translate"),a(),i(151,"option",74),r(152),o(153,"translate"),a()()()(),h(154,St,8,9,"li",20),a()}if(n&2){let e=u();t(2),_(" ",l(3,35,"settings.display.lang")," "),t(3),g("ngModel",e.$settings.env.lang),t(2),p(l(8,37,"form.select.auto")),t(59),_(" ",l(67,39,"settings.display.theme")," "),t(3),g("ngModel",e.$settings.theme),t(2),p(l(72,41,"settings.display.orange")),t(3),p(l(75,43,"settings.display.red")),t(3),p(l(78,45,"settings.display.pink")),t(3),p(l(81,47,"settings.display.purple")),t(3),p(l(84,49,"settings.display.deep_purple")),t(3),p(l(87,51,"settings.display.indigo")),t(3),p(l(90,53,"settings.display.blue")),t(3),p(l(93,55,"settings.display.bluegrey")),t(3),p(l(96,57,"settings.display.cyan")),t(3),p(l(99,59,"settings.display.green")),t(3),p(l(102,61,"settings.display.teal")),t(3),p(l(105,63,"settings.display.grey")),t(3),p(l(108,65,"settings.display.brown")),t(3),_(" ",l(111,67,"settings.display.lighting_mode")," "),t(3),g("ngModel",e.$settings.lightingMode),t(2),p(l(116,69,"form.select.auto")),t(3),p(l(119,71,"settings.display.light")),t(3),p(l(122,73,"settings.display.dark")),t(3),_(" ",l(125,75,"settings.display.menu_mode")," "),t(3),g("ngModel",e.$settings.menuMode),t(2),p(l(130,77,"settings.display.menu_default")),t(3),p(l(133,79,"settings.display.menu_freeze")),t(4),_(" ",l(137,81,"settings.display.login_wallpaper"),""),t(3),g("innerHTML",Y(140,83,"settings.display.login_wallpaper_desc",H(92,vt,e.file)),X),t(3),g("ngModel",e.$settings.loginWallpaper),t(2),_(" ",l(145,86,"settings.display.temp_units")," "),t(3),g("ngModel",e.$settings.env.temperatureUnits),t(2),p(l(150,88,"settings.display.temp_units.c")),t(3),p(l(153,90,"settings.display.temp_units.f")),t(2),v(e.hasChangedLoginWallpaper?154:-1)}}function kt(n,c){if(n&1&&(i(0,"li",15)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-D"),a(),m(6,"br"),i(7,"small",76),r(8),o(9,"translate"),a()(),m(10,"input",77),o(11,"translate"),m(12,"label",78),a()),n&2){let e=u(3);t(2),_(" ",l(3,3,"settings.startup.debug")," "),t(6),_(" ",l(9,5,e.isHbV2?"settings.startup.debug_desc_v2":"settings.startup.debug_desc_v1")," "),t(2),x("aria-label",l(11,7,"settings.startup.debug"))}}function yt(n,c){n&1&&(i(0,"li",15)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-I"),a(),m(6,"br"),i(7,"small",76),r(8),o(9,"translate"),a()(),m(10,"input",79),o(11,"translate"),m(12,"label",80),a()),n&2&&(t(2),_(" ",l(3,3,"settings.startup.insecure")," "),t(6),p(l(9,5,"settings.startup.insecure_desc")),t(2),x("aria-label",l(11,7,"settings.startup.insecure")))}function Et(n,c){n&1&&(i(0,"li",15)(1,"span"),r(2),o(3,"translate"),i(4,"code"),r(5,"-K"),a(),m(6,"br"),i(7,"small",76),r(8),o(9,"translate"),a()(),m(10,"input",81),o(11,"translate"),m(12,"label",82),a()),n&2&&(t(2),_(" ",l(3,3,"settings.startup.keep_accessories")," "),t(6),p(l(9,5,"settings.startup.keep_accessories_desc")),t(2),x("aria-label",l(11,7,"settings.startup.keep_accessories")))}function Bt(n,c){if(n&1&&(i(0,"li",12)(1,"span")(2,"span",83),r(3,"DEBUG"),a(),m(4,"br")(5,"small",71),o(6,"translate"),a(),i(7,"div",23),m(8,"input",84),a()()),n&2){let e=u(3);t(5),g("innerHTML",Y(6,1,"settings.service.debug_tooltip",H(4,bt,e.linkDebug)),X)}}function It(n,c){n&1&&(i(0,"li",12)(1,"span")(2,"span",83),r(3,"NODE_OPTIONS"),a(),m(4,"br"),i(5,"small",76),r(6),o(7,"translate"),a()(),i(8,"div",23),m(9,"input",85),a()()),n&2&&(t(6),p(l(7,1,"settings.service.node_tooltip")))}function $t(n,c){n&1&&(i(0,"li",15)(1,"span"),r(2),o(3,"translate"),m(4,"br"),i(5,"small",76),r(6),o(7,"translate"),a()(),i(8,"a",86),o(9,"translate"),m(10,"i",18),a()()),n&2&&(t(2),_(" ",l(3,3,"menu.docker.startup_script"),""),t(4),p(l(7,5,"platform.docker.script_help")),t(2),x("aria-label",l(9,7,"menu.docker.startup_script")))}function At(n,c){n&1&&(i(0,"li",20)(1,"small",21),r(2),o(3,"translate"),a(),i(4,"button",22),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),_(" ",l(7,7,"menu.tooltip_restart")," "))}function Tt(n,c){if(n&1&&(i(0,"ul",75),h(1,kt,13,9,"li",15)(2,yt,13,9,"li",15)(3,Et,13,9,"li",15)(4,Bt,9,6,"li",12)(5,It,10,3,"li",12)(6,$t,11,9,"li",15)(7,At,8,9,"li",20),a()),n&2){let e=u(2);t(),v(e.$settings.env.serviceMode?1:-1),t(),v(e.$settings.env.serviceMode?2:-1),t(),v(e.$settings.env.serviceMode?3:-1),t(),v(e.$settings.env.serviceMode?4:-1),t(),v(e.$settings.env.serviceMode?5:-1),t(),v(e.$settings.env.runningInDocker?6:-1),t(),v(e.hasChangedService?7:-1)}}function Mt(n,c){if(n&1){let e=k();i(0,"form",7)(1,"div",2),b("click",function(){C(e);let d=u();return S(d.toggleSection("startup"))}),i(2,"h5",3),m(3,"i",4),r(4),o(5,"translate"),a()(),h(6,Tt,8,7,"ul",75),a()}if(n&2){let e=u();g("formGroup",e.serviceForm),t(),x("aria-expanded",e.showFields.startup?"true":"false")("aria-controls","fieldsStartup"),t(2),g("ngClass",e.showFields.startup?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(5,6,"settings.title_startup_options")," "),t(2),v(e.showFields.startup?6:-1)}}function Nt(n,c){n&1&&m(0,"i",98)}function Ft(n,c){if(n&1&&(i(0,"span",88),h(1,Nt,1,0,"i",98),r(2),i(3,"span",99),r(4),o(5,"translate"),a()()),n&2){let e=c.$implicit;g("ngClass",I(6,ft,e.missing,!e.missing)),t(),v(e.missing?1:-1),t(),_(" ",e.iface,": "),t(2),p(e.missing?l(5,4,"settings.mdns_advertiser_not_connected"):e.ip4||e.ip6)}}function Vt(n,c){n&1&&(i(0,"option",92),r(1),o(2,"translate"),a()),n&2&&(t(),_("Avahi (",l(2,1,"settings.mdns_advertiser_rec"),")"))}function Rt(n,c){n&1&&(i(0,"option",95),r(1),o(2,"translate"),a()),n&2&&(t(),_("systemd-resolved (",l(2,1,"settings.mdns_advertiser_exp"),")"))}function Dt(n,c){n&1&&(i(0,"li",20)(1,"small",21),r(2),o(3,"translate"),a(),i(4,"button",22),o(5,"translate"),r(6),o(7,"translate"),a()()),n&2&&(t(2),p(l(3,3,"settings.changes.saved")),t(2),x("aria-label",l(5,5,"menu.tooltip_restart")),t(2),_(" ",l(7,7,"menu.tooltip_restart")," "))}function Pt(n,c){if(n&1){let e=k();i(0,"ul",8)(1,"li",15)(2,"span",16),r(3),o(4,"translate"),m(5,"br"),i(6,"div",87),r(7),o(8,"translate"),a(),T(9,Ft,6,9,"span",88,A),a(),i(11,"button",89),o(12,"translate"),b("click",function(){C(e);let d=u();return S(d.selectNetworkInterfaces())}),m(13,"i",90),a()(),i(14,"li",12)(15,"span"),r(16),o(17,"translate"),m(18,"br"),i(19,"small",76),r(20),o(21,"translate"),a()(),i(22,"div",23)(23,"select",91),o(24,"translate"),h(25,Vt,3,3,"option",92),i(26,"option",93),r(27),o(28,"translate"),a(),i(29,"option",94),r(30,"Bonjour HAP"),a(),h(31,Rt,3,3,"option",95),a()()(),i(32,"li",12)(33,"span"),r(34),o(35,"translate"),m(36,"br"),i(37,"small",76),r(38),o(39,"translate"),a()(),i(40,"div",23),m(41,"input",96),o(42,"translate"),a()(),i(43,"li",12)(44,"span"),r(45),o(46,"translate"),m(47,"br"),i(48,"small",76),r(49),o(50,"translate"),a()(),i(51,"div",23),m(52,"input",97),o(53,"translate"),a()(),h(54,Dt,8,9,"li",20),a()}if(n&2){let e=u();t(3),_(" ",l(4,22,"settings.network.title_network_interfaces"),""),t(4),p(l(8,24,"settings.network.message_network_interface")),t(2),M(e.bridgeNetworkAdapters),t(2),g("disabled",!e.availableNetworkAdapters.length),x("aria-label",l(12,26,"settings.network.title_network_interfaces")),t(2),g("ngClass",H(48,xt,!e.availableNetworkAdapters.length)),t(3),_(" ",l(17,28,"settings.mdns_advertiser"),""),t(4),p(l(21,30,"settings.mdns_advertiser_help")),t(3),g("formControl",e.legacyMdnsFormControl),x("aria-label",l(24,32,"settings.mdns_advertiser")),t(2),v(e.showAvahiMdnsOption?25:-1),t(2),_(" Ciao ",e.showAvahiMdnsOption?"":"("+l(28,34,"settings.mdns_advertiser_rec")+")"," "),t(4),v(e.showResolvedMdnsOption?31:-1),t(3),_(" ",l(35,36,"settings.network.port_hb"),""),t(4),p(l(39,38,"settings.network.port_hb_desc")),t(3),g("formControl",e.hbPortFormControl)("ngClass",H(50,ie,e.isInvalidHbPort)),x("aria-label",l(42,40,"settings.network.port_ui")),t(4),_(" ",l(46,42,"settings.network.port_ui"),""),t(4),p(l(50,44,"settings.network.port_ui_desc")),t(3),g("ngClass",H(52,ie,e.isInvalidHbUiPort)),x("aria-label",l(53,46,"settings.network.port_ui")),t(2),v(e.hasChangedHbPort&&!e.isInvalidHbPort||e.hasChangedUiSettings||e.hasChangedMdns||e.hasChangedBridgeNetworkAdapters?54:-1)}}function Ht(n,c){n&1&&(i(0,"p",9),r(1),o(2,"translate"),a()),n&2&&(t(),p(l(2,1,"settings.cache.desc")))}function Lt(n,c){if(n&1){let e=k();i(0,"ul",100)(1,"li",15)(2,"span",16),r(3),o(4,"translate"),m(5,"br"),i(6,"small",76),r(7),o(8,"translate"),a()(),i(9,"button",17),o(10,"translate"),b("click",function(){C(e);let d=u(2);return S(d.removeSingleCachedAccessories())}),m(11,"i",18),a()(),i(12,"li",15)(13,"span",16),r(14),o(15,"translate"),m(16,"br"),i(17,"small",76),r(18),o(19,"translate"),a()(),i(20,"button",17),o(21,"translate"),b("click",function(){C(e);let d=u(2);return S(d.removeBridgeAccessories())}),m(22,"i",18),a()(),i(23,"li",15)(24,"span",16),r(25),o(26,"translate"),m(27,"br"),i(28,"small",76),r(29),o(30,"translate"),a()(),i(31,"button",17),o(32,"translate"),b("click",function(){C(e);let d=u(2);return S(d.removeAllCachedAccessories())}),m(33,"i",18),a()()()}n&2&&(t(3),_(" ",l(4,9,"reset.accessory_ind.title"),""),t(4),p(l(8,11,"reset.accessory_ind.desc")),t(2),x("aria-label",l(10,13,"reset.accessory_ind.title")),t(5),_(" ",l(15,15,"reset.bridge_accessories.title"),""),t(4),p(l(19,17,"reset.bridge_accessories.desc")),t(2),x("aria-label",l(21,19,"reset.accessory_all.title")),t(5),_(" ",l(26,21,"reset.accessory_all.title"),""),t(4),p(l(30,23,"reset.accessory_all.desc")),t(2),x("aria-label",l(32,25,"reset.accessory_all.title")))}function Ot(n,c){if(n&1){let e=k();i(0,"div",1)(1,"div",2),b("click",function(){C(e);let d=u();return S(d.toggleSection("cache"))}),i(2,"h5",3),m(3,"i",4),r(4),o(5,"translate"),a()(),h(6,Ht,3,3,"p",9)(7,Lt,34,27,"ul",100),a()}if(n&2){let e=u();t(),x("aria-expanded",e.showFields.cache?"true":"false")("aria-controls","fieldsCache"),t(2),g("ngClass",e.showFields.cache?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(5,6,"settings.cache.title")," "),t(2),v(e.showFields.cache?6:-1),t(),v(e.showFields.cache?7:-1)}}function Ut(n,c){n&1&&(i(0,"p",9),r(1),o(2,"translate"),a()),n&2&&(t(),p(l(2,1,"reset.bridges.desc")))}function zt(n,c){if(n&1){let e=k();i(0,"li",15)(1,"span",16),r(2),o(3,"translate"),m(4,"br"),i(5,"small",76),r(6),o(7,"translate"),a()(),i(8,"button",17),o(9,"translate"),b("click",function(){C(e);let d=u(2);return S(d.unpairAccessory())}),m(10,"i",18),a()()}n&2&&(t(2),_(" ",l(3,3,"reset.bridge_ind.title"),""),t(4),p(l(7,5,"reset.bridge_ind.desc")),t(2),x("aria-label",l(9,7,"reset.bridge_ind.title")))}function jt(n,c){if(n&1){let e=k();i(0,"ul",10),h(1,zt,11,9,"li",15),i(2,"li",15)(3,"span",16),r(4),o(5,"translate"),o(6,"titlecase"),m(7,"br"),i(8,"small",76),r(9),o(10,"translate"),a()(),i(11,"button",17),o(12,"translate"),b("click",function(){C(e);let d=u();return S(d.resetHomebridgeState())}),m(13,"i",18),a()()()}if(n&2){let e=u();t(),v(e.$settings.env.serviceMode?1:-1),t(3),_(" ",l(6,6,l(5,4,"reset.bridge_all.title")),""),t(5),p(l(10,8,"reset.bridge_all.desc")),t(2),x("aria-label",l(12,10,"reset.bridge_all.title"))}}var rn=(()=>{class n{$api=w(R);$modal=w(he);$plugin=w(ye);$settings=w(Se);$toastr=w(V);$translate=w(F);originalServiceForm={HOMEBRIDGE_DEBUG:!1,HOMEBRIDGE_KEEP_ORPHANS:!1,HOMEBRIDGE_INSECURE:!0,ENV_DEBUG:"",ENV_NODE_OPTIONS:""};originalUiSettingsForm={port:0};originalLoginWallpaper="";originalMdnsSetting="";originalBridgeNetworkAdapters=[];originalHbPort=0;originalHbName="";hasChangedService=!1;hasChangedUiSettings=!1;hasChangedMdns=!1;hasChangedBridgeNetworkAdapters=!1;hasChangedHbPort=!1;hasChangedHbName=!1;hasChangedLoginWallpaper=!1;isInvalidHbPort=!1;isInvalidHbName=!1;isInvalidHbUiPort=!1;serviceForm=new Z({HOMEBRIDGE_DEBUG:new D(!1),HOMEBRIDGE_KEEP_ORPHANS:new D(!1),HOMEBRIDGE_INSECURE:new D(!0),ENV_DEBUG:new D(""),ENV_NODE_OPTIONS:new D("")});uiSettingsForm=new Z({port:new D(0)});loginWallpaper="";legacyMdnsFormControl=new se(!1);showAvahiMdnsOption=!1;showResolvedMdnsOption=!1;availableNetworkAdapters=[];bridgeNetworkAdapters=[];hbPortFormControl=new D(0);hbNameFormControl=new D("");isHbV2=!1;showFields={general:!0,display:!0,startup:!0,network:!0,reset:!0,cache:!0};file='<span class="font-monospace">ui-wallpaper.jpg</span>';linkDebug='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Debug-Common-Values" target="_blank"><i class="fa fa-fw fa-external-link-alt primary-text"></i></a>';constructor(){}ngOnInit(){this.isHbV2=this.$settings.env.homebridgeVersion.startsWith("2"),this.hbNameFormControl.patchValue(this.$settings.env.homebridgeInstanceName),this.hbNameFormControl.valueChanges.subscribe(e=>this.setHomebridgeName(e)),this.originalHbName=this.$settings.env.homebridgeInstanceName,this.initUiSettingsForm(),this.initDisplaySettingsForm(),this.initNetworkingOptions(),this.$settings.env.serviceMode&&this.initServiceModeForm()}initUiSettingsForm(){this.originalUiSettingsForm={port:this.$settings.env.port},this.uiSettingsForm.patchValue({port:this.$settings.env.port}),this.uiSettingsForm.valueChanges.pipe(Q(500)).subscribe(e=>{let s=!1;Object.keys(e).forEach(d=>{this.originalUiSettingsForm[d]!==e[d]&&(this.saveUiSettingChange(d,e[d]),s=!0)}),this.hasChangedUiSettings=s})}initServiceModeForm(){this.$api.get("/platform-tools/hb-service/homebridge-startup-settings").subscribe({next:e=>{Object.keys(e).forEach(s=>{this.originalServiceForm[s]=e[s]}),this.serviceForm.patchValue(e),this.serviceForm.valueChanges.pipe(Q(500)).subscribe(this.saveServiceModeSettings.bind(this))},error:e=>{console.error(e),this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}})}initDisplaySettingsForm(){this.originalLoginWallpaper=this.$settings.loginWallpaper,this.loginWallpaper=this.$settings.loginWallpaper}saveUiSettingChange(e,s){switch(e){case"lang":this.$settings.setLang(s);break;case"lightingMode":this.$settings.setLightingMode(s,"user");break;case"menuMode":this.$settings.setMenuMode(s),window.location.reload();break;case"theme":this.$settings.setTheme(s);break;case"tempUnits":this.$settings.setEnvItem("temperatureUnits",s);break;case"loginWallpaper":this.$settings.setEnvItem("loginWallpaper",s),this.hasChangedLoginWallpaper=s!==this.originalLoginWallpaper;break;case"port":if(!s||typeof s!="number"||s<1025||s>65533||Number.isInteger(s)===!1||s===this.hbPortFormControl.value){this.isInvalidHbUiPort=!0;return}this.$settings.setEnvItem("port",s),this.isInvalidHbUiPort=!1;break}E(this.$api.put("/config-editor/ui",{key:e,value:s})).catch(d=>{console.error(d),this.$toastr.error(d.message,this.$translate.instant("toast.title_error"))})}openUiSettings(){this.$plugin.settings({name:"homebridge-config-ui-x",displayName:"Homebridge UI",settingsSchema:!0,links:{}})}openBackupModal(){this.$modal.open(we,{size:"lg",backdrop:"static"})}saveServiceModeSettings(e=this.serviceForm.value){this.$api.put("/platform-tools/hb-service/homebridge-startup-settings",e).subscribe({next:()=>{this.hasChangedService=JSON.stringify(e)!==JSON.stringify(this.originalServiceForm)},error:s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))}})}resetHomebridgeState(){this.$modal.open(Ie,{size:"lg",backdrop:"static"})}unpairAccessory(){this.$modal.open(Ae,{size:"lg",backdrop:"static"})}removeAllCachedAccessories(){this.$modal.open(Ee,{size:"lg",backdrop:"static"})}removeSingleCachedAccessories(){this.$modal.open(ke,{size:"lg",backdrop:"static"})}removeBridgeAccessories(){this.$modal.open(Be,{size:"lg",backdrop:"static"})}initNetworkingOptions(){return y(this,null,function*(){try{this.getNetworkSettings(),(this.$settings.env.runningInLinux||this.$settings.env.runningInDocker||this.$settings.env.runningInSynologyPackage||this.$settings.env.runningInPackageMode)&&(this.showAvahiMdnsOption=!0,this.showResolvedMdnsOption=!0)}catch{}})}getNetworkSettings(){return y(this,null,function*(){return Promise.all([E(this.$api.get("/server/network-interfaces/system")),E(this.$api.get("/server/network-interfaces/bridge")),E(this.$api.get("/server/mdns-advertiser")),E(this.$api.get("/server/port"))]).then(([e,s,d,f])=>{this.availableNetworkAdapters=e,this.buildBridgeNetworkAdapterList(s),this.legacyMdnsFormControl.patchValue(d.advertiser),this.originalMdnsSetting=d.advertiser,this.originalBridgeNetworkAdapters=this.bridgeNetworkAdapters.map(U=>U.iface),this.legacyMdnsFormControl.valueChanges.subscribe(U=>{this.setHomebridgeMdnsSetting(U)}),this.hbPortFormControl.patchValue(f.port),this.hbPortFormControl.valueChanges.subscribe(U=>this.setHomebridgePort(U)),this.originalHbPort=f.port})})}setHomebridgeMdnsSetting(e){return y(this,null,function*(){this.$api.put("/server/mdns-advertiser",{advertiser:e}).subscribe({next:()=>{this.hasChangedMdns=e!==this.originalMdnsSetting},error:s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))}})})}setNetworkInterfaces(e){return y(this,null,function*(){this.$api.put("/server/network-interfaces/bridge",{adapters:e}).subscribe({next:()=>{this.hasChangedBridgeNetworkAdapters=this.originalBridgeNetworkAdapters.join(",")!==e.join(",")},error:s=>{console.error(s),this.$toastr.error(s.message,this.$translate.instant("toast.title_error"))}})})}setHomebridgeName(e){return y(this,null,function*(){if(!e||!/^[\p{L}\p{N}][\p{L}\p{N} ']*[\p{L}\p{N}]$/u.test(e)){this.isInvalidHbName=!0;return}this.$api.put("/server/name",{name:e}).subscribe({next:()=>{this.hasChangedHbName=this.originalHbName!==e,this.$settings.setEnvItem("homebridgeInstanceName",e),this.isInvalidHbName=!1},error:()=>{this.isInvalidHbName=!0}})})}setHomebridgePort(e){return y(this,null,function*(){if(e===this.uiSettingsForm.get("port").value){this.isInvalidHbPort=!0;return}this.$api.put("/server/port",{port:e}).subscribe({next:()=>{this.hasChangedHbPort=this.originalHbPort!==e,this.isInvalidHbPort=!1},error:()=>{this.isInvalidHbPort=!0}})})}buildBridgeNetworkAdapterList(e){if(!e.length){this.bridgeNetworkAdapters=[];return}this.bridgeNetworkAdapters=e.map(s=>{let d=this.availableNetworkAdapters.find(f=>f.iface===s);return d?(d.selected=!0,d.missing=!1,d):{iface:s,missing:!0}})}selectNetworkInterfaces(){let e=this.$modal.open(Te,{size:"lg",backdrop:"static"});e.componentInstance.availableNetworkAdapters=this.availableNetworkAdapters,e.componentInstance.bridgeNetworkAdapters=this.bridgeNetworkAdapters,e.result.then(s=>{this.buildBridgeNetworkAdapterList(s),this.setNetworkInterfaces(s)}).catch(()=>{})}toggleSection(e){this.showFields[e]=!this.showFields[e]}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:35,vars:35,consts:[[1,"primary-text","m-0"],[1,"my-4"],["role","button","tabindex","0",1,"mt-3","hover-pointer",3,"click"],[1,"primary-text"],[1,"fa","fa-fw",3,"ngClass"],["id","fieldsGeneral",1,"list-group","list-group-box","mt-2","mx-0"],["id","fieldsDisplay",1,"list-group","list-group-box","mt-2","mx-0"],["novalidate","",1,"my-4",3,"formGroup"],["id","fieldsNetwork",1,"list-group","list-group-box","mt-2","mx-0"],[1,"small","grey-text","mb-2","mx-0"],["id","fieldsReset",1,"list-group","list-group-box","mt-2","mx-0"],[1,"pb-3"],[1,"list-group-item","d-block","d-md-flex","justify-content-between","align-items-center"],[1,"my-3","my-md-0","pl-0","pl-md-5","w-auto"],["type","text",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"pe-2"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click"],[1,"fas","fa-fw","fa-arrow-right"],["routerLink","/users",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"list-group-item","d-flex","flex-column","align-items-center"],[1,"grey-text","my-2"],["routerLink","/restart",1,"btn","btn-primary","waves-effect","my-2"],[1,"my-3","my-md-0","ps-0","ps-md-5","w-auto"],[1,"custom-select","resp-select",3,"ngModelChange","ngModel"],["value","auto"],["value","bg"],["value","ca"],["value","zh-CN"],["value","zh-TW"],["value","cs"],["value","nl"],["value","en"],["value","fi"],["value","fr"],["value","de"],["value","he"],["value","hu"],["value","id"],["value","it"],["value","ja"],["value","ko"],["value","mk"],["value","no"],["value","pl"],["value","pt-BR"],["value","pt"],["value","ru"],["value","sl"],["value","es"],["value","sv"],["value","th"],["value","tr"],["value","uk"],["value","orange"],["value","red"],["value","pink"],["value","purple"],["value","deep-purple"],["value","indigo"],["value","blue"],["value","blue-grey"],["value","cyan"],["value","green"],["value","teal"],["value","grey"],["value","brown"],["value","light"],["value","dark"],["value","default"],["value","freeze"],[1,"grey-text","pe-2",3,"innerHTML"],["name","search_wallpaper","autocomplete","off","type","text","placeholder","/path-to/image.png",1,"form-control","custom-input","resp-input",3,"ngModelChange","ngModel"],["value","c"],["value","f"],["id","fieldsStartup",1,"list-group","list-group-box","mb-4","mx-0"],[1,"grey-text","pe-2"],["type","checkbox","id","homebridgeDebugMode","formControlName","HOMEBRIDGE_DEBUG",1,"rendux-input"],["for","homebridgeDebugMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeInsecureMode","formControlName","HOMEBRIDGE_INSECURE",1,"rendux-input"],["for","homebridgeInsecureMode",1,"rendux-label","ms-3",2,"min-width","50px"],["type","checkbox","id","homebridgeKeepOrphans","formControlName","HOMEBRIDGE_KEEP_ORPHANS",1,"rendux-input"],["for","homebridgeKeepOrphans",1,"rendux-label","ms-3",2,"min-width","50px"],[1,"font-monospace"],["formControlName","ENV_DEBUG","type","text","placeholder","HAP-NodeJS:Advertiser,HAP-NodeJS:Service",1,"form-control","custom-input","resp-input"],["formControlName","ENV_NODE_OPTIONS","type","text","placeholder","--max-old-space-size=512 --max-http-header-size=8192",1,"form-control","custom-input","resp-input"],["routerLink","/platform-tools/docker/startup-script",1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px"],[1,"small","grey-text","pe-2"],[1,"badge","badge-primary","me-1",3,"ngClass"],[1,"btn","btn-primary","waves-effect","m-0","ms-3",2,"min-width","50px",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right",3,"ngClass"],[1,"custom-select","resp-select",3,"formControl"],["value","avahi"],["value","ciao"],["value","bonjour-hap"],["value","resolved"],["type","number","min","1025","max","65533",1,"form-control","custom-input","resp-input",3,"formControl","ngClass"],["type","number","min","1025","max","65533","placeholder","8581","formControlName","port",1,"form-control","custom-input","resp-input",3,"ngClass"],[1,"fas","fa-fw","fa-exclamation-triangle"],[1,"fw-normal"],["id","fieldsCache",1,"list-group","list-group-box","mb-4","mx-0"]],template:function(s,d){s&1&&(i(0,"h3",0),r(1),o(2,"translate"),a(),i(3,"div",1)(4,"div",2),b("click",function(){return d.toggleSection("general")}),i(5,"h5",3),m(6,"i",4),r(7),o(8,"translate"),a()(),h(9,Ct,29,26,"ul",5),a(),i(10,"div",1)(11,"div",2),b("click",function(){return d.toggleSection("display")}),i(12,"h5",3),m(13,"i",4),r(14),o(15,"translate"),a()(),h(16,wt,155,94,"ul",6),a(),h(17,Mt,7,8,"form",7),i(18,"form",7)(19,"div",2),b("click",function(){return d.toggleSection("network")}),i(20,"h5",3),m(21,"i",4),r(22),o(23,"translate"),a()(),h(24,Pt,55,54,"ul",8),a(),h(25,Ot,8,8,"div",1),i(26,"div",1)(27,"div",2),b("click",function(){return d.toggleSection("reset")}),i(28,"h5",3),m(29,"i",4),r(30),o(31,"translate"),a()(),h(32,Ut,3,3,"p",9)(33,jt,14,12,"ul",10),a(),m(34,"div",11)),s&2&&(t(),p(l(2,25,"menu.settings.title")),t(3),x("aria-expanded",d.showFields.general?"true":"false")("aria-controls","fieldsGeneral"),t(2),g("ngClass",d.showFields.general?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(8,27,"settings.general.title_general")," "),t(2),v(d.showFields.general?9:-1),t(2),x("aria-expanded",d.showFields.display?"true":"false")("aria-controls","fieldsDisplay"),t(2),g("ngClass",d.showFields.display?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(15,29,"settings.general.title_display")," "),t(2),v(d.showFields.display?16:-1),t(),v(d.$settings.env.serviceMode||d.$settings.env.runningInDocker?17:-1),t(),g("formGroup",d.uiSettingsForm),t(),x("aria-expanded",d.showFields.network?"true":"false")("aria-controls","fieldsNetwork"),t(2),g("ngClass",d.showFields.network?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(23,31,"settings.network.title_network")," "),t(2),v(d.showFields.network?24:-1),t(),v(d.$settings.env.serviceMode?25:-1),t(2),x("aria-expanded",d.showFields.reset?"true":"false")("aria-controls","fieldsReset"),t(2),g("ngClass",d.showFields.reset?"fa-chevron-down":"fa-chevron-right"),t(),_(" ",l(31,33,"reset.bridges.title")," "),t(2),v(d.showFields.reset?32:-1),t(),v(d.showFields.reset?33:-1))},dependencies:[O,Ce,K,de,ge,ve,oe,pe,G,ue,W,le,xe,be,q,fe,ce,me,_e,j,$],encapsulation:2})}return n})();export{Ee as a,Ie as b,Te as c,rn as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as k}from"./chunk-
|
|
1
|
+
import{o as k}from"./chunk-E66CIXOF.js";import{d as P}from"./chunk-7HPEGK3R.js";import{b as V}from"./chunk-RWV2PLEE.js";import{h as T,k as O}from"./chunk-V7AAZRAR.js";import{a as y,b as $}from"./chunk-G67F4LRX.js";import{Ac as a,Bc as s,Kb as C,Pb as f,Ub as o,Vb as r,Wb as h,_b as v,bc as m,cc as b,gb as i,ma as c,mc as l,nc as S,oc as d,sb as w,ua as u,va as _,zb as g}from"./chunk-ELVGIIRZ.js";function B(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.restartServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_restart_server")," "))}function I(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.shutdownServer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.linux.label_shutdown_server")," "))}function H(t,x){if(t&1){let n=v();o(0,"p",5)(1,"button",6),m("click",function(){u(n);let e=b();return _(e.dockerRestartContainer())}),l(2),a(3,"translate"),r()()}t&2&&(i(2),d(" ",s(3,1,"menu.docker.restart_container")," "))}var G=(()=>{class t{$api=c(O);$router=c(P);$settings=c(V);$toastr=c(T);$translate=c(y);constructor(){}restartHomebridge(){this.$router.navigate(["/restart"])}restartHomebridgeService(){this.$api.put("/platform-tools/hb-service/set-full-service-restart-flag",{}).subscribe({next:()=>{this.$router.navigate(["/restart"])},error:n=>{console.error(n),this.$toastr.error(n.message,this.$translate.instant("toast.title_error"))}})}restartServer(){this.$router.navigate(["/platform-tools/linux/restart-server"])}shutdownServer(){this.$router.navigate(["/platform-tools/linux/shutdown-server"])}dockerRestartContainer(){this.$router.navigate(["/platform-tools/docker/restart-container"])}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=w({type:t,selectors:[["ng-component"]],decls:19,vars:15,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,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"w-100","text-center","my-5"],["type","button",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click"],["type","button","container","body","openDelay","150","triggers","hover",1,"btn","btn-primary","p-3","my-0",2,"width","85%",3,"click","ngbTooltip"]],template:function(p,e){p&1&&(o(0,"div",0)(1,"h3",1),l(2),a(3,"translate"),r()(),o(4,"div",2)(5,"div",3),h(6,"i",4),r(),o(7,"p",5)(8,"button",6),m("click",function(){return e.restartHomebridge()}),l(9),a(10,"translate"),r()(),o(11,"p",5)(12,"button",7),a(13,"translate"),m("click",function(){return e.restartHomebridgeService()}),l(14),a(15,"translate"),r()(),g(16,B,4,3,"p",5)(17,I,4,3,"p",5)(18,H,4,3,"p",5),r()),p&2&&(i(2),S(s(3,7,"menu.restart.title")),i(7),d(" ",s(10,9,"menu.hbrestart.confirm_hb")," "),i(3),C("ngbTooltip",s(13,11,"reset.force_restart_hb_help_text")),i(2),d(" ",s(15,13,"menu.hbrestart.confirm_ui")," "),i(2),f(e.$settings.env.canShutdownRestartHost?16:-1),i(),f(e.$settings.env.canShutdownRestartHost?17:-1),i(),f(e.$settings.env.runningInDocker?18:-1))},dependencies:[k,$],encapsulation:2})}return t})();export{G as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P}from"./chunk-
|
|
1
|
+
import{a as P}from"./chunk-C2UJXFYZ.js";import{a as O}from"./chunk-VOG67KUU.js";import{c as y,e as E,l as k,y as $}from"./chunk-A6ASL2RK.js";import{b as D}from"./chunk-7HPEGK3R.js";import{b as L}from"./chunk-RWV2PLEE.js";import{h as I,k as H}from"./chunk-V7AAZRAR.js";import{a as T}from"./chunk-G67F4LRX.js";import{Kb as f,Pb as d,Ub as m,Vb as l,Wb as w,_b as g,bc as _,cc as a,gb as s,h as S,ma as r,mc as v,rc as b,sb as x,sc as M,tc as V,ua as c,va as p,w as C,zb as h}from"./chunk-ELVGIIRZ.js";function z(i,u){i&1&&w(0,"i",6)}function A(i,u){i&1&&w(0,"i",7)}function F(i,u){if(i&1){let t=g();m(0,"ngx-monaco-editor",10),_("onInit",function(e){c(t);let o=a();return p(o.onEditorInit(e))})("keydown.control.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())})("keydown.meta.s",function(e){c(t);let o=a();return e.preventDefault(),p(o.onSave())}),l()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,u){if(i&1){let t=g();m(0,"textarea",11),V("ngModelChange",function(e){c(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),p(e)}),v(1," "),l()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(O);$route=r(D);$settings=r(L);$toastr=r(I);$translate=r(T);startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;lastHeight;visualViewPortEventCallback;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
|
|
2
2
|
`)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
|
|
3
3
|
|
|
4
|
-
${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","
|
|
4
|
+
${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:5,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(m(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),l()(),m(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),h(7,z,1,0,"i",6)(8,A,1,0,"i",7),l()()(),h(9,F,1,2,"ngx-monaco-editor",8)(10,W,2,1,"textarea",9),l()),n&2&&(s(6),f("disabled",e.saveInProgress),s(),d(e.saveInProgress?-1:7),s(),d(e.saveInProgress?8:-1),s(),d(e.isMobile?-1:9),s(),d(e.isMobile?10:-1))},dependencies:[P,$,y,E,k],encapsulation:2})}return i})();export{tt as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as n}from"./chunk-
|
|
1
|
+
import{d as n}from"./chunk-7HPEGK3R.js";import{b as s}from"./chunk-RWV2PLEE.js";import{ga as o,h as r,ma as e,w as i}from"./chunk-ELVGIIRZ.js";var l=(()=>{class t{$router=e(n);$settings=e(s);constructor(){}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,2 @@
|
|
|
1
|
+
import{$ as Ce,$a as Je,Ba as ce,Bb as Ye,Cb as X,Da as D,Db as G,Ea as le,Eb as fe,H as _e,Hc as Ke,Ic as qe,Ka as Ue,L as ke,La as de,Ma as Fe,Na as P,Oc as J,Pa as ue,Pc as He,Qa as Be,Qc as Qe,Rc as w,S as oe,Ta as L,Ua as N,Va as _,Wa as ze,Xa as Ve,Ya as $e,Za as Xe,_a as Ge,_c as W,a as $,ab as We,b as Se,bb as S,da as R,ea as A,ga as m,ha as ie,id as et,ja as g,jb as x,jd as tt,k as Ie,la as d,ld as pe,ma as T,mb as Ze,na as ae,nd as Z,pa as Le,q as Ne,qa as xe,r as se,ra as je,tb as he,x as C}from"./chunk-ELVGIIRZ.js";var U=class{},K=class{},I=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
|
|
2
|
+
`).forEach(e=>{let n=e.indexOf(":");if(n>0){let s=e.slice(0,n),o=e.slice(n+1).trim();this.addHeaderEntry(s,o)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let s=(t.op==="a"?this.headers.get(e):void 0)||[];s.push(...n),this.headers.set(e,s);break;case"d":let o=t.value;if(!o)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>o.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(o=>o.toString()),s=t.toLowerCase();this.headers.set(s,n),this.maybeSetNormalizedName(t,s)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var ye=class{encodeKey(t){return nt(t)}encodeValue(t){return nt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function _t(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(s=>{let o=s.indexOf("="),[i,c]=o==-1?[t.decodeKey(s),""]:[t.decodeKey(s.slice(0,o)),t.decodeValue(s.slice(o+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var kt=/%(\d[a-f0-9])/gi,Ct={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function nt(r){return encodeURIComponent(r).replace(kt,(t,e)=>{var n;return(n=Ct[e])!=null?n:t})}function Y(r){return`${r}`}var O=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new ye,t.fromString){if(t.fromObject)throw new R(2805,!1);this.map=_t(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],s=Array.isArray(n)?n.map(Y):[Y(n)];this.map.set(e,s)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let s=t[n];Array.isArray(s)?s.forEach(o=>{e.push({param:n,value:o,op:"a"})}):e.push({param:n,value:s,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(Y(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],s=n.indexOf(Y(t.value));s!==-1&&n.splice(s,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ge=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function Lt(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function rt(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function st(r){return typeof Blob<"u"&&r instanceof Blob}function ot(r){return typeof FormData<"u"&&r instanceof FormData}function xt(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var it="Content-Type",dt="X-Request-URL",ut="text/plain",ht="application/json",jt=`${ht}, ${ut}, */*`,j=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,s){var i,c;this.url=e,this.method=t.toUpperCase();let o;if(Lt(this.method)||s?(this.body=n!==void 0?n:null,o=s):o=n,o&&(this.reportProgress=!!o.reportProgress,this.withCredentials=!!o.withCredentials,o.responseType&&(this.responseType=o.responseType),o.headers&&(this.headers=o.headers),o.context&&(this.context=o.context),o.params&&(this.params=o.params),this.transferCache=o.transferCache),(i=this.headers)!=null||(this.headers=new I),(c=this.context)!=null||(this.context=new ge),!this.params)this.params=new O,this.urlWithParams=e;else{let a=this.params.toString();if(a.length===0)this.urlWithParams=e;else{let l=e.indexOf("?"),u=l===-1?"?":l<e.length-1?"&":"";this.urlWithParams=e+u+a}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||rt(this.body)||st(this.body)||ot(this.body)||xt(this.body)?this.body:this.body instanceof O?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||ot(this.body)?null:st(this.body)?this.body.type||null:rt(this.body)?null:typeof this.body=="string"?ut:this.body instanceof O?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?ht:null}clone(t={}){var M,b,v,h;let e=t.method||this.method,n=t.url||this.url,s=t.responseType||this.responseType,o=(M=t.transferCache)!=null?M:this.transferCache,i=t.body!==void 0?t.body:this.body,c=(b=t.withCredentials)!=null?b:this.withCredentials,a=(v=t.reportProgress)!=null?v:this.reportProgress,l=t.headers||this.headers,u=t.params||this.params,p=(h=t.context)!=null?h:this.context;return t.setHeaders!==void 0&&(l=Object.keys(t.setHeaders).reduce((f,E)=>f.set(E,t.setHeaders[E]),l)),t.setParams&&(u=Object.keys(t.setParams).reduce((f,E)=>f.set(E,t.setParams[E]),u)),new r(e,n,i,{params:u,headers:l,context:p,reportProgress:a,responseType:s,withCredentials:c,transferCache:o})}},k=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(k||{}),F=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new I,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},ve=class r extends F{constructor(t={}){super(t)}type=k.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},q=class r extends F{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=k.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},H=class extends F{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},Ut=200,Ft=204;function me(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Bt=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,s={}){let o;if(e instanceof j)o=e;else{let a;s.headers instanceof I?a=s.headers:a=new I(s.headers);let l;s.params&&(s.params instanceof O?l=s.params:l=new O({fromObject:s.params})),o=new j(e,n,s.body!==void 0?s.body:null,{headers:a,context:s.context,params:l,reportProgress:s.reportProgress,responseType:s.responseType||"json",withCredentials:s.withCredentials,transferCache:s.transferCache})}let i=se(o).pipe(ke(a=>this.handler.handle(a)));if(e instanceof j||s.observe==="events")return i;let c=i.pipe(_e(a=>a instanceof q));switch(s.observe||"body"){case"body":switch(o.responseType){case"arraybuffer":return c.pipe(C(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new Error("Response is not an ArrayBuffer.");return a.body}));case"blob":return c.pipe(C(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new Error("Response is not a Blob.");return a.body}));case"text":return c.pipe(C(a=>{if(a.body!==null&&typeof a.body!="string")throw new Error("Response is not a string.");return a.body}));case"json":default:return c.pipe(C(a=>a.body))}case"response":return c;default:throw new Error(`Unreachable: unhandled observe type ${s.observe}}`)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new O().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,s={}){return this.request("PATCH",e,me(s,n))}post(e,n,s={}){return this.request("POST",e,me(s,n))}put(e,n,s={}){return this.request("PUT",e,me(s,n))}static \u0275fac=function(n){return new(n||r)(d(U))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var zt=new g("");function ft(r,t){return t(r)}function Vt(r,t){return(e,n)=>t.intercept(e,{handle:s=>r(s,n)})}function $t(r,t,e){return(n,s)=>je(e,()=>t(n,o=>r(o,s)))}var Xt=new g(""),Ee=new g(""),Gt=new g(""),pt=new g("",{providedIn:"root",factory:()=>!0});function Jt(){let r=null;return(t,e)=>{var o;r===null&&(r=((o=T(Xt,{optional:!0}))!=null?o:[]).reduceRight(Vt,ft));let n=T(ce);if(T(pt)){let i=n.add();return r(t,e).pipe(oe(()=>n.remove(i)))}else return r(t,e)}}var at=(()=>{class r extends U{backend;injector;chain=null;pendingTasks=T(ce);contributeToStability=T(pt);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(Ee),...this.injector.get(Gt,[])]));this.chain=n.reduceRight((s,o)=>$t(s,o,this.injector),ft)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,s=>this.backend.handle(s)).pipe(oe(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(d(K),d(xe))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();var Wt=/^\)\]\}',?\n/,Zt=RegExp(`^${dt}:`,"m");function Yt(r){return"responseURL"in r&&r.responseURL?r.responseURL:Zt.test(r.getAllResponseHeaders())?r.getResponseHeader(dt):null}var ct=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new R(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?Ne(n.\u0275loadImpl()):se(null)).pipe(Ce(()=>new Ie(o=>{let i=n.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((h,f)=>i.setRequestHeader(h,f.join(","))),e.headers.has("Accept")||i.setRequestHeader("Accept",jt),!e.headers.has(it)){let h=e.detectContentTypeHeader();h!==null&&i.setRequestHeader(it,h)}if(e.responseType){let h=e.responseType.toLowerCase();i.responseType=h!=="json"?h:"text"}let c=e.serializeBody(),a=null,l=()=>{if(a!==null)return a;let h=i.statusText||"OK",f=new I(i.getAllResponseHeaders()),E=Yt(i)||e.url;return a=new ve({headers:f,status:i.status,statusText:h,url:E}),a},u=()=>{let{headers:h,status:f,statusText:E,url:Pe}=l(),y=null;f!==Ft&&(y=typeof i.response>"u"?i.responseText:i.response),f===0&&(f=y?Ut:0);let re=f>=200&&f<300;if(e.responseType==="json"&&typeof y=="string"){let Ot=y;y=y.replace(Wt,"");try{y=y!==""?JSON.parse(y):null}catch(Pt){y=Ot,re&&(re=!1,y={error:Pt,text:y})}}re?(o.next(new q({body:y,headers:h,status:f,statusText:E,url:Pe||void 0})),o.complete()):o.error(new H({error:y,headers:h,status:f,statusText:E,url:Pe||void 0}))},p=h=>{let{url:f}=l(),E=new H({error:h,status:i.status||0,statusText:i.statusText||"Unknown Error",url:f||void 0});o.error(E)},M=!1,b=h=>{M||(o.next(l()),M=!0);let f={type:k.DownloadProgress,loaded:h.loaded};h.lengthComputable&&(f.total=h.total),e.responseType==="text"&&i.responseText&&(f.partialText=i.responseText),o.next(f)},v=h=>{let f={type:k.UploadProgress,loaded:h.loaded};h.lengthComputable&&(f.total=h.total),o.next(f)};return i.addEventListener("load",u),i.addEventListener("error",p),i.addEventListener("timeout",p),i.addEventListener("abort",p),e.reportProgress&&(i.addEventListener("progress",b),c!==null&&i.upload&&i.upload.addEventListener("progress",v)),i.send(c),o.next({type:k.Sent}),()=>{i.removeEventListener("error",p),i.removeEventListener("abort",p),i.removeEventListener("load",u),i.removeEventListener("timeout",p),e.reportProgress&&(i.removeEventListener("progress",b),c!==null&&i.upload&&i.upload.removeEventListener("progress",v)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(n){return new(n||r)(d(Z))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),mt=new g(""),Kt="XSRF-TOKEN",qt=new g("",{providedIn:"root",factory:()=>Kt}),Ht="X-XSRF-TOKEN",Qt=new g("",{providedIn:"root",factory:()=>Ht}),Q=class{},en=(()=>{class r{doc;platform;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n,s){this.doc=e,this.platform=n,this.cookieName=s}getToken(){if(this.platform==="server")return null;let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=W(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(d(w),d(P),d(qt))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function tn(r,t){let e=r.url.toLowerCase();if(!T(mt)||r.method==="GET"||r.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(r);let n=T(Q).getToken(),s=T(Qt);return n!=null&&!r.headers.has(s)&&(r=r.clone({headers:r.headers.set(s,n)})),t(r)}var yt=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(yt||{});function nn(r,t){return{\u0275kind:r,\u0275providers:t}}function Gn(...r){let t=[Bt,ct,at,{provide:U,useExisting:at},{provide:K,useFactory:()=>{var e;return(e=T(zt,{optional:!0}))!=null?e:T(ct)}},{provide:Ee,useValue:tn,multi:!0},{provide:mt,useValue:!0},{provide:Q,useClass:en}];for(let e of r)t.push(...e.\u0275providers);return ae(t)}var lt=new g("");function Jn(){return nn(yt.LegacyInterceptors,[{provide:lt,useFactory:Jt},{provide:Ee,useExisting:lt,multi:!0}])}var we=class extends Qe{supportsDOMEvents=!0},Re=class r extends we{static makeCurrent(){He(new r)}onAndCancel(t,e,n,s){return t.addEventListener(e,n,s),()=>{t.removeEventListener(e,n,s)}}dispatchEvent(t,e){t.dispatchEvent(e)}remove(t){t.remove()}createElement(t,e){return e=e||this.getDefaultDocument(),e.createElement(t)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(t){return t.nodeType===Node.ELEMENT_NODE}isShadowRoot(t){return t instanceof DocumentFragment}getGlobalEventTarget(t,e){return e==="window"?window:e==="document"?t:e==="body"?t.body:null}getBaseHref(t){let e=sn();return e==null?null:on(e)}resetBaseElement(){B=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return W(document.cookie,t)}},B=null;function sn(){return B=B||document.querySelector("base"),B?B.getAttribute("href"):null}function on(r){return new URL(r,document.baseURI).pathname}var be=class{addToWindow(t){A.getAngularTestability=(n,s=!0)=>{let o=t.findTestabilityInTree(n,s);if(o==null)throw new R(5103,!1);return o},A.getAllAngularTestabilities=()=>t.getAllTestabilities(),A.getAllAngularRootElements=()=>t.getAllRootElements();let e=n=>{let s=A.getAllAngularTestabilities(),o=s.length,i=function(){o--,o==0&&n()};s.forEach(c=>{c.whenStable(i)})};A.frameworkStabilizers||(A.frameworkStabilizers=[]),A.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,n){if(e==null)return null;let s=t.getTestability(e);return s!=null?s:n?J().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null}},an=(()=>{class r{build(){return new XMLHttpRequest}static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Me=new g(""),Rt=(()=>{class r{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,n){this._zone=n,e.forEach(s=>{s.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,n,s,o){return this._findPluginFor(n).addEventListener(e,n,s,o)}getZone(){return this._zone}_findPluginFor(e){let n=this._eventNameToPlugin.get(e);if(n)return n;if(n=this._plugins.find(o=>o.supports(e)),!n)throw new R(5101,!1);return this._eventNameToPlugin.set(e,n),n}static \u0275fac=function(n){return new(n||r)(d(Me),d(D))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),te=class{_doc;constructor(t){this._doc=t}manager},ee="ng-app-id";function gt(r){for(let t of r)t.remove()}function vt(r,t){let e=t.createElement("style");return e.textContent=r,e}function cn(r,t,e,n){var o;let s=(o=r.head)==null?void 0:o.querySelectorAll(`style[${ee}="${t}"],link[${ee}="${t}"]`);if(s)for(let i of s)i.removeAttribute(ee),i instanceof HTMLLinkElement?n.set(i.href.slice(i.href.lastIndexOf("/")+1),{usage:0,elements:[i]}):i.textContent&&e.set(i.textContent,{usage:0,elements:[i]})}function Ae(r,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",r),e}var bt=(()=>{class r{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(e,n,s,o={}){this.doc=e,this.appId=n,this.nonce=s,this.isServer=pe(o),cn(e,n,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,n){for(let s of e)this.addUsage(s,this.inline,vt);n==null||n.forEach(s=>this.addUsage(s,this.external,Ae))}removeStyles(e,n){for(let s of e)this.removeUsage(s,this.inline);n==null||n.forEach(s=>this.removeUsage(s,this.external))}addUsage(e,n,s){let o=n.get(e);o?o.usage++:n.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,s(e,this.doc)))})}removeUsage(e,n){let s=n.get(e);s&&(s.usage--,s.usage<=0&&(gt(s.elements),n.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])gt(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[n,{elements:s}]of this.inline)s.push(this.addElement(e,vt(n,this.doc)));for(let[n,{elements:s}]of this.external)s.push(this.addElement(e,Ae(n,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,n){return this.nonce&&n.setAttribute("nonce",this.nonce),this.isServer&&n.setAttribute(ee,this.appId),e.appendChild(n)}static \u0275fac=function(n){return new(n||r)(d(w),d(de),d(ue,8),d(P))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),Te={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Oe=/%COMP%/g,Mt="%COMP%",ln=`_nghost-${Mt}`,dn=`_ngcontent-${Mt}`,un=!0,hn=new g("",{providedIn:"root",factory:()=>un});function fn(r){return dn.replace(Oe,r)}function pn(r){return ln.replace(Oe,r)}function At(r,t){return t.map(e=>e.replace(Oe,r))}var Et=(()=>{class r{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(e,n,s,o,i,c,a,l=null,u=null){this.eventManager=e,this.sharedStylesHost=n,this.appId=s,this.removeStylesOnCompDestroy=o,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=l,this.tracingService=u,this.platformIsServer=pe(c),this.defaultRenderer=new z(e,i,a,this.platformIsServer,this.tracingService)}createRenderer(e,n){if(!e||!n)return this.defaultRenderer;this.platformIsServer&&n.encapsulation===L.ShadowDom&&(n=Se($({},n),{encapsulation:L.Emulated}));let s=this.getOrCreateRenderer(e,n);return s instanceof ne?s.applyToHost(e):s instanceof V&&s.applyStyles(),s}getOrCreateRenderer(e,n){let s=this.rendererByCompId,o=s.get(n.id);if(!o){let i=this.doc,c=this.ngZone,a=this.eventManager,l=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,p=this.platformIsServer;switch(n.encapsulation){case L.Emulated:o=new ne(a,l,n,this.appId,u,i,c,p,this.tracingService);break;case L.ShadowDom:return new De(a,l,e,n,i,c,this.nonce,p,this.tracingService);default:o=new V(a,l,n,u,i,c,p,this.tracingService);break}s.set(n.id,o)}return o}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(n){return new(n||r)(d(Rt),d(bt),d(de),d(hn),d(w),d(P),d(D),d(ue),d(Be,8))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),z=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,n,s,o){this.eventManager=t,this.doc=e,this.ngZone=n,this.platformIsServer=s,this.tracingService=o}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Te[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(Tt(t)?t.content:t).appendChild(e)}insertBefore(t,e,n){t&&(Tt(t)?t.content:t).insertBefore(e,n)}removeChild(t,e){e.remove()}selectRootElement(t,e){let n=typeof t=="string"?this.doc.querySelector(t):t;if(!n)throw new R(-5104,!1);return e||(n.textContent=""),n}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,n,s){if(s){e=s+":"+e;let o=Te[s];o?t.setAttributeNS(o,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)}removeAttribute(t,e,n){if(n){let s=Te[n];s?t.removeAttributeNS(s,e):t.removeAttribute(`${n}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,n,s){s&(x.DashCase|x.Important)?t.style.setProperty(e,n,s&x.Important?"important":""):t.style[e]=n}removeStyle(t,e,n){n&x.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,n){t!=null&&(t[e]=n)}setValue(t,e){t.nodeValue=e}listen(t,e,n,s){if(typeof t=="string"&&(t=J().getGlobalEventTarget(this.doc,t),!t))throw new Error(`Unsupported event target ${t} for event ${e}`);let o=this.decoratePreventDefault(n);return this.tracingService!==null&&this.tracingService.wrapEventListener&&(o=this.tracingService.wrapEventListener(t,e,o)),this.eventManager.addEventListener(t,e,o,s)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;(this.platformIsServer?this.ngZone.runGuarded(()=>t(e)):t(e))===!1&&e.preventDefault()}}};function Tt(r){return r.tagName==="TEMPLATE"&&r.content!==void 0}var De=class extends z{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,n,s,o,i,c,a,l){var M;super(t,o,i,a,l),this.sharedStylesHost=e,this.hostEl=n,this.shadowRoot=n.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=At(s.id,s.styles);for(let b of u){let v=document.createElement("style");c&&v.setAttribute("nonce",c),v.textContent=b,this.shadowRoot.appendChild(v)}let p=(M=s.getExternalStyles)==null?void 0:M.call(s);if(p)for(let b of p){let v=Ae(b,o);c&&v.setAttribute("nonce",c),this.shadowRoot.appendChild(v)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,n){return super.insertBefore(this.nodeOrShadowRoot(t),e,n)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},V=class extends z{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(t,e,n,s,o,i,c,a,l){var u;super(t,o,i,c,a),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=s,this.styles=l?At(l,n.styles):n.styles,this.styleUrls=(u=n.getExternalStyles)==null?void 0:u.call(n,l)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},ne=class extends V{contentAttr;hostAttr;constructor(t,e,n,s,o,i,c,a,l){let u=s+"-"+n.id;super(t,e,n,o,i,c,a,l,u),this.contentAttr=fn(u),this.hostAttr=pn(u)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let n=super.createElement(t,e);return super.setAttribute(n,this.contentAttr,""),n}},mn=(()=>{class r extends te{constructor(e){super(e)}supports(e){return!0}addEventListener(e,n,s,o){return e.addEventListener(n,s,o),()=>this.removeEventListener(e,n,s,o)}removeEventListener(e,n,s,o){return e.removeEventListener(n,s,o)}static \u0275fac=function(n){return new(n||r)(d(w))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})(),wt=["alt","control","meta","shift"],yn={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},gn={alt:r=>r.altKey,control:r=>r.ctrlKey,meta:r=>r.metaKey,shift:r=>r.shiftKey},vn=(()=>{class r extends te{constructor(e){super(e)}supports(e){return r.parseEventName(e)!=null}addEventListener(e,n,s,o){let i=r.parseEventName(n),c=r.eventCallback(i.fullKey,s,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>J().onAndCancel(e,i.domEventName,c,o))}static parseEventName(e){let n=e.toLowerCase().split("."),s=n.shift();if(n.length===0||!(s==="keydown"||s==="keyup"))return null;let o=r._normalizeKey(n.pop()),i="",c=n.indexOf("code");if(c>-1&&(n.splice(c,1),i="code."),wt.forEach(l=>{let u=n.indexOf(l);u>-1&&(n.splice(u,1),i+=l+".")}),i+=o,n.length!=0||o.length===0)return null;let a={};return a.domEventName=s,a.fullKey=i,a}static matchEventFullKeyCode(e,n){let s=yn[e.key]||e.key,o="";return n.indexOf("code.")>-1&&(s=e.code,o="code."),s==null||!s?!1:(s=s.toLowerCase(),s===" "?s="space":s==="."&&(s="dot"),wt.forEach(i=>{if(i!==s){let c=gn[i];c(e)&&(o+=i+".")}}),o+=s,o===n)}static eventCallback(e,n,s){return o=>{r.matchEventFullKeyCode(o,e)&&s.runGuarded(()=>n(o))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(n){return new(n||r)(d(w))};static \u0275prov=m({token:r,factory:r.\u0275fac})}return r})();function fr(r,t){return qe($({rootComponent:r},En(t)))}function En(r){var t;return{appProviders:[...Dt,...(t=r==null?void 0:r.providers)!=null?t:[]],platformProviders:bn}}function Tn(){Re.makeCurrent()}function wn(){return new le}function Rn(){return Ue(document),document}var bn=[{provide:P,useValue:tt},{provide:Fe,useValue:Tn,multi:!0},{provide:w,useFactory:Rn,deps:[]}];var Mn=[{provide:X,useClass:be,deps:[]},{provide:Ye,useClass:G,deps:[D,fe,X]},{provide:G,useClass:G,deps:[D,fe,X]}],Dt=[{provide:Le,useValue:"root"},{provide:le,useFactory:wn,deps:[]},{provide:Me,useClass:mn,multi:!0,deps:[w,D,P]},{provide:Me,useClass:vn,multi:!0,deps:[w]},Et,bt,Rt,{provide:Ze,useExisting:Et},{provide:Z,useClass:an,deps:[]},[]],pr=(()=>{class r{constructor(){}static \u0275fac=function(n){return new(n||r)};static \u0275mod=he({type:r});static \u0275inj=ie({providers:[...Dt,...Mn],imports:[et,Ke]})}return r})();var mr=(()=>{class r{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(n){return new(n||r)(d(w))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var An=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275prov=m({token:r,factory:function(n){let s=null;return n?s=new(n||r):s=d(Dn),s},providedIn:"root"})}return r})(),Dn=(()=>{class r extends An{_doc;constructor(e){super(),this._doc=e}sanitize(e,n){if(n==null)return null;switch(e){case S.NONE:return n;case S.HTML:return _(n,"HTML")?N(n):We(this._doc,String(n)).toString();case S.STYLE:return _(n,"Style")?N(n):n;case S.SCRIPT:if(_(n,"Script"))return N(n);throw new R(5200,!1);case S.URL:return _(n,"URL")?N(n):Je(String(n));case S.RESOURCE_URL:if(_(n,"ResourceURL"))return N(n);throw new R(5201,!1);default:throw new R(5202,!1)}}bypassSecurityTrustHtml(e){return ze(e)}bypassSecurityTrustStyle(e){return Ve(e)}bypassSecurityTrustScript(e){return $e(e)}bypassSecurityTrustUrl(e){return Xe(e)}bypassSecurityTrustResourceUrl(e){return Ge(e)}static \u0275fac=function(n){return new(n||r)(d(w))};static \u0275prov=m({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{K as a,O as b,k as c,q as d,Bt as e,Xt as f,Gn as g,Jn as h,Et as i,fr as j,pr as k,mr as l,An as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as b}from"./chunk-
|
|
1
|
+
import{e as b}from"./chunk-ELVGIIRZ.js";var L=b((p,v)=>{(function(d,r){typeof define=="function"&&define.amd?define([],r):typeof p<"u"?r():(r(),d.FileSaver={})})(p,function(){"use strict";function d(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function r(e,t,i){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){l(n.response,t,i)},n.onerror=function(){console.error("could not download file")},n.send()}function w(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function s(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,m=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,i){var n=a.URL||a.webkitURL,o=document.createElement("a");t=t||e.name||"download",o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin===location.origin?s(o):w(o.href)?r(e,t,i):s(o,o.target="_blank")):(o.href=n.createObjectURL(e),setTimeout(function(){n.revokeObjectURL(o.href)},4e4),setTimeout(function(){s(o)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(d(e,i),t);else if(w(e))r(e,t,i);else{var n=document.createElement("a");n.href=e,n.target="_blank",setTimeout(function(){s(n)})}}:function(e,t,i,n){if(n=n||open("","_blank"),n&&(n.document.title=n.document.body.innerText="downloading..."),typeof e=="string")return r(e,t,i);var o=e.type==="application/octet-stream",E=/constructor/i.test(a.HTMLElement)||a.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||o&&E||m)&&typeof FileReader<"u"){var u=new FileReader;u.onloadend=function(){var c=u.result;c=y?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=c:location=c,n=null},u.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,f=h.createObjectURL(e);n?n.location=f:location.href=f,n=null,setTimeout(function(){h.revokeObjectURL(f)},4e4)}});a.saveAs=l.saveAs=l,typeof v<"u"&&(v.exports=l)})});export{L as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as l,b as u,c as a,d as g}from"./chunk-RYTJZDC4.js";import{a as f}from"./chunk-D67RSISA.js";import"./chunk-UUN6ZLIL.js";import{a as c}from"./chunk-CNUMFNDI.js";import"./chunk-2G5W635D.js";import"./chunk-BFEMJZWI.js";import"./chunk-C2UJXFYZ.js";import"./chunk-BN42B6ZN.js";import"./chunk-VOG67KUU.js";import"./chunk-PZFLYD2M.js";import"./chunk-QZ7FBUFJ.js";import"./chunk-KBQ7X43U.js";import"./chunk-TAQCEDBC.js";import"./chunk-6LUEJV3C.js";import"./chunk-VGMRIFZA.js";import"./chunk-IS2FWNNK.js";import{q as s}from"./chunk-E66CIXOF.js";import{y as n,z as p}from"./chunk-A6ASL2RK.js";import"./chunk-KP734VBH.js";import{g as i}from"./chunk-7HPEGK3R.js";import"./chunk-WK4QAH4N.js";import"./chunk-RWV2PLEE.js";import"./chunk-V7AAZRAR.js";import"./chunk-T3Y7RYJZ.js";import{c as d}from"./chunk-G67F4LRX.js";import{ha as t,id as m,tb as e}from"./chunk-ELVGIIRZ.js";var v=[{path:"",loadComponent:()=>import("./chunk-KLH3Q4Y2.js").then(o=>o.SettingsComponent),canActivate:[f]}],C=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(v),i]})}return o})();var K=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[m,n,p,d,s,C,g,u,l,c,a]})}return o})();export{K as SettingsModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-SIUO7YU6.js";import"./chunk-C2UJXFYZ.js";import"./chunk-VOG67KUU.js";import"./chunk-A6ASL2RK.js";import"./chunk-7HPEGK3R.js";import"./chunk-RWV2PLEE.js";import"./chunk-V7AAZRAR.js";import"./chunk-T3Y7RYJZ.js";import"./chunk-G67F4LRX.js";import"./chunk-ELVGIIRZ.js";export{a as StartupScriptComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as te}from"./chunk-TAQCEDBC.js";import{a as Z,b as ee}from"./chunk-6LUEJV3C.js";import{m as E,n as I,o as q}from"./chunk-E66CIXOF.js";import{a as J}from"./chunk-KP734VBH.js";import{d as G}from"./chunk-7HPEGK3R.js";import{h as M,k as D}from"./chunk-V7AAZRAR.js";import{c as O,d as U}from"./chunk-T3Y7RYJZ.js";import{a as R,b as F}from"./chunk-G67F4LRX.js";import{$c as H,Ac as s,Bc as l,Cc as y,Jb as v,Kb as _,Pb as u,Rb as A,Sb as N,Tb as W,Ub as r,Vb as o,Wb as m,_b as T,bc as f,cc as d,g as P,gb as i,gd as j,h as $,ma as x,mc as c,nc as k,oc as h,sb as S,ua as C,va as B,wc as w,xc as z,zb as g}from"./chunk-ELVGIIRZ.js";var V=P(te(),1);var L=P(Z(),1),Q=P(ee(),1);var ne=t=>({maxBackupSizeText:t});function ae(t,p){if(t&1&&m(0,"input",10),t&2){let e=d(2);_("value",e.selectedBackup.fileName)}}function oe(t,p){if(t&1){let e=T();r(0,"input",12),f("change",function(a){C(e);let b=d(2);return B(b.handleRestoreFileInput(a.target.files))}),o()}}function re(t,p){if(t&1&&(r(0,"div",4)(1,"div",7),m(2,"i",8),o(),r(3,"ul",9)(4,"li"),c(5),s(6,"translate"),o(),r(7,"li"),c(8),s(9,"translate"),o(),r(10,"li"),c(11),s(12,"translate"),o(),r(13,"li"),c(14),s(15,"translate"),o()(),g(16,ae,1,1,"input",10)(17,oe,1,0,"input",11),o()),t&2){let e=d();i(5),k(l(6,6,"backup.restore_help_one")),i(3),k(l(9,8,"backup.restore_help_two")),i(3),k(y(12,10,"backup.restore_max_size",w(15,ne,e.maxFileSizeText))),i(3),k(l(15,13,"backup.restore_warning")),i(2),u(e.selectedBackup?16:-1),i(),u(e.selectedBackup?-1:17)}}function se(t,p){if(t&1){let e=T();r(0,"button",18),s(1,"translate"),f("click",function(){C(e);let a=d(2);return B(a.$activeModal.dismiss("Dismiss"))}),c(2),s(3,"translate"),o()}if(t&2){let e=d(2);_("disabled",e.clicked),v("aria-label",l(1,3,"form.button_close")),i(2),h(" ",l(3,5,"form.button_close")," ")}}function le(t,p){if(t&1){let e=T();r(0,"button",18),s(1,"translate"),f("click",function(){C(e);let a=d(2);return B(a.reopenBackupModal())}),c(2),s(3,"translate"),o()}if(t&2){let e=d(2);_("disabled",e.clicked),v("aria-label",l(1,3,"form.button_back")),i(2),h(" ",l(3,5,"form.button_back")," ")}}function ce(t,p){t&1&&m(0,"i",19)}function pe(t,p){if(t&1&&(r(0,"span"),c(1),o()),t&2){let e=d(3);i(),h("",e.uploadPercent,"% - ")}}function de(t,p){t&1&&(r(0,"span"),c(1," Extracting Archive"),o())}function me(t,p){t&1&&(r(0,"span"),c(1),s(2,"translate"),o()),t&2&&(i(),h(" ",l(2,1,"backup.label_uploading"),""))}function ue(t,p){if(t&1&&(r(0,"span"),g(1,ce,1,0,"i",19)(2,pe,2,1,"span")(3,de,2,0,"span")(4,me,3,3,"span"),o()),t&2){let e=d(2);i(),u(!e.uploadPercent||e.uploadPercent===100?1:-1),i(),u(e.uploadPercent&&e.uploadPercent!==100?2:-1),i(),u(e.uploadPercent===100?3:-1),i(),u(e.uploadPercent!==100?4:-1)}}function _e(t,p){t&1&&(c(0),s(1,"translate")),t&2&&h(" ",l(1,1,"form.button_restore")," ")}function be(t,p){if(t&1){let e=T();r(0,"div",6)(1,"div",13),g(2,se,4,7,"button",14)(3,le,4,7,"button",14),o(),m(4,"div",15),r(5,"div",16)(6,"button",17),f("click",function(){C(e);let a=d();return B(a.onRestoreBackupClick())}),g(7,ue,5,4,"span")(8,_e,2,3),o()()()}if(t&2){let e=d();i(2),u(e.setupWizardRestore?2:-1),i(),u(e.setupWizardRestore?-1:3),i(3),_("disabled",!e.selectedBackup&&!e.selectedFile||e.clicked),i(),u(e.clicked?7:-1),i(),u(e.clicked?-1:8)}}function ke(t,p){if(t&1){let e=T();r(0,"div",6),m(1,"div",13),r(2,"div",15)(3,"button",20),f("click",function(){C(e);let a=d();return B(a.postBackupRestart())}),c(4),s(5,"translate"),o()(),m(6,"div",16),o()}t&2&&(i(4),h(" ",l(5,1,"menu.hbrestart.title")," "))}var X=(()=>{class t{$activeModal=x(E);$api=x(D);$modal=x(I);$route=x(G);$toastr=x(M);$translate=x(R);$ws=x(J);setupWizardRestore=!1;selectedBackup=null;clicked=!1;maxFileSizeText=globalThis.backup.maxBackupSizeText;selectedFile;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;restoreArchiveType="homebridge";uploadPercent=0;term=new L.Terminal;termTarget;fitAddon=new Q.FitAddon;io;constructor(){}ngOnInit(){return $(this,null,function*(){this.io=this.$ws.connectToNamespace("backup"),this.termTarget=document.getElementById("plugin-log-output"),this.term.open(this.termTarget),this.fitAddon.fit(),this.io.socket.on("stdout",e=>{this.term.write(e)}),this.setupWizardRestore&&(this.restoreStarted=!0,this.restoreInProgress=!0,this.startRestore())})}onRestoreBackupClick(){this.selectedBackup?this.restoreScheduledBackup():this.restoreArchiveType==="homebridge"?this.uploadHomebridgeArchive():this.restoreArchiveType==="hbfx"&&this.uploadHbfxArchive()}uploadHomebridgeArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore",e).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:n=>{var a;console.error(n),this.$toastr.error(((a=n.error)==null?void 0:a.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})}restoreScheduledBackup(){return $(this,null,function*(){this.term.reset(),this.clicked=!0,this.$api.post(`/backup/scheduled-backups/${this.selectedBackup.id}/restore`,{}).subscribe({next:()=>{this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startRestore()},500),this.clicked=!1},error:e=>{var n;console.error(e),this.$toastr.error(((n=e.error)==null?void 0:n.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error")),this.clicked=!1}})})}startRestore(){return $(this,null,function*(){this.io.request("do-restore").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success")),this.setupWizardRestore&&this.postBackupRestart()},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}uploadHbfxArchive(){this.term.reset(),this.clicked=!0;let e=new FormData;e.append("restoreArchive",this.selectedFile,this.selectedFile.name),this.$api.post("/backup/restore/hbfx",e,{reportProgress:!0,observe:"events"}).subscribe({next:n=>{n.type===O.UploadProgress?this.uploadPercent=Math.round(100*n.loaded/n.total):n instanceof U&&(this.restoreStarted=!0,this.restoreInProgress=!0,setTimeout(()=>{this.startHbfxRestore()},500),this.clicked=!1)},error:n=>{var a;this.clicked=!1,console.error(n),this.$toastr.error(((a=n.error)==null?void 0:a.message)||this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})}startHbfxRestore(){return $(this,null,function*(){this.io.request("do-restore-hbfx").subscribe({next:()=>{this.restoreInProgress=!1,this.$toastr.success(this.$translate.instant("backup.backup_restored"),this.$translate.instant("toast.title_success"))},error:e=>{this.restoreFailed=!0,console.error(e),this.$toastr.error(this.$translate.instant("backup.restore_failed"),this.$translate.instant("toast.title_error"))}})})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.selectedFile.name.endsWith(".hbfx")?this.restoreArchiveType="hbfx":this.restoreArchiveType="homebridge"):delete this.selectedFile}postBackupRestart(){this.$api.put("/backup/restart",{}).subscribe({next:()=>{this.$activeModal.close(!0),this.$route.navigate(["/"])},error:()=>{}})}reopenBackupModal(){this.$activeModal.dismiss(),this.$modal.open(K,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.io.end()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],inputs:{setupWizardRestore:"setupWizardRestore",selectedBackup:"selectedBackup"},decls:11,vars:11,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],["id","plugin-log-output",1,"modal-body",3,"hidden"],[1,"modal-footer","justify-content-between"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","text","disabled","",1,"form-control","custom-input",3,"value"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz, .hbfx",1,"form-control",3,"change"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"disabled"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"fa","fa-fw","fa-circle-notch","fa-spin"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click"]],template:function(n,a){n&1&&(r(0,"div",0)(1,"div",1)(2,"h5",2),c(3),s(4,"translate"),o(),r(5,"button",3),s(6,"translate"),f("click",function(){return a.$activeModal.dismiss("Dismiss")}),o()(),g(7,re,18,17,"div",4),m(8,"div",5),g(9,be,9,5,"div",6)(10,ke,7,3,"div",6),o()),n&2&&(i(3),k(l(4,7,"backup.title_backup")),i(2),_("disabled",a.restoreInProgress),v("aria-label",l(6,9,"form.button_close")),i(2),u(!a.restoreStarted&&!a.setupWizardRestore?7:-1),i(),_("hidden",!a.restoreStarted),i(),u(!a.restoreStarted||a.restoreFailed===!0?9:-1),i(),u(!a.restoreInProgress&&a.restoreStarted?10:-1))},dependencies:[F],encapsulation:2})}return t})();var fe=(t,p)=>({"fa-arrow-right":t,"fa-cog fa-spin":p}),he=t=>({backupTime:t,dayCount:7}),xe=(t,p)=>({"fa-trash":t,"fa-cog fa-spin":p}),ge=(t,p)=>({backupSize:t,maxBackupSizeText:p});function ve(t,p){if(t&1&&(c(0),s(1,"date"),s(2,"translate")),t&2){let e=d(2);h(" ",y(2,4,"backup.scheduled_backup_time",w(7,he,y(1,1,e.backupTime,"shortTime")))," ")}}function Ce(t,p){t&1&&(c(0),s(1,"translate")),t&2&&h(" ",l(1,1,"backup.scheduled_backup_disabled")," ")}function Be(t,p){if(t&1&&(r(0,"span",24),s(1,"translate"),m(2,"i",31),c(3),o()),t&2){let e=d().$implicit;_("ngbTooltip",y(1,2,"backup.backup_exceeds_max_size",z(5,ge,e.size+"MB",e.maxBackupSizeText))),i(3),h(" ",e.size,"MB ")}}function Te(t,p){if(t&1&&(r(0,"span"),c(1),o()),t&2){let e=d().$implicit;i(),h(" ",e.size,"MB ")}}function ye(t,p){if(t&1){let e=T();r(0,"li",9)(1,"span")(2,"span",23),c(3),s(4,"date"),o(),m(5,"br"),r(6,"small",10),c(7),s(8,"date"),g(9,Be,4,8,"span",24)(10,Te,2,1,"span"),o()(),r(11,"span",25)(12,"button",26),s(13,"translate"),s(14,"translate"),f("click",function(){let a=C(e).$implicit,b=d(2);return B(b.restore(a))}),m(15,"i",27),o(),r(16,"button",28),s(17,"translate"),s(18,"translate"),f("click",function(){let a=C(e).$implicit,b=d(2);return B(b.download(a))}),m(19,"i",29),o(),r(20,"button",30),s(21,"translate"),s(22,"translate"),f("click",function(){let a=C(e).$implicit,b=d(2);return B(b.delete(a))}),m(23,"i",12),o()()()}if(t&2){let e=p.$implicit,n=d(2);i(2),_("ngbTooltip",e.fileName),i(),h(" ",y(4,15,e.timestamp,"mediumDate")," "),i(4),h(" ",y(8,18,e.timestamp,"shortTime")," \xB7 "),i(2),u(e.size>e.maxBackupSize?9:-1),i(),u(e.size<=e.maxBackupSize?10:-1),i(2),_("disabled",n.clicked||n.deleting||e.size>e.maxBackupSize)("ngbTooltip",l(13,21,"form.button_restore")),v("aria-label",l(14,23,"form.button_restore")),i(4),_("disabled",n.clicked||n.deleting)("ngbTooltip",l(17,25,"form.button_download")),v("aria-label",l(18,27,"form.button_download")),i(4),_("disabled",n.clicked||n.deleting)("ngbTooltip",l(21,29,"form.button_delete")),v("aria-label",l(22,31,"form.button_delete")),i(3),_("ngClass",z(33,xe,e.id!==n.deleting,e.id===n.deleting))}}function $e(t,p){if(t&1&&(r(0,"ul",14)(1,"li",20)(2,"h6",21),c(3),s(4,"translate"),o(),r(5,"p",22),g(6,ve,3,9)(7,Ce,2,3),o()(),N(8,ye,24,36,"li",9,A),o()),t&2){let e=d();i(3),k(l(4,3,"backup.files_auto")),i(3),u(e.backupTime?6:-1),i(),u(e.backupTime?-1:7),i(),W(e.scheduledBackups)}}var K=(()=>{class t{$activeModal=x(E);$api=x(D);$modal=x(I);$toastr=x(M);$translate=x(R);clicked=!1;scheduledBackups=[];backupTime;deleting=null;constructor(){}ngOnInit(){this.getScheduledBackups(),this.getNextBackup()}getScheduledBackups(){this.$api.get("/backup/scheduled-backups").subscribe({next:e=>{this.scheduledBackups=e},error:e=>console.error(e)})}getNextBackup(){this.$api.get("/backup/scheduled-backups/next").subscribe({next:e=>{this.backupTime=e.next},error:e=>{console.error(e)}})}download(e){this.$api.get(`/backup/scheduled-backups/${e.id}`,{observe:"response",responseType:"blob"}).subscribe({next:n=>{let a=e.fileName||"homebridge-backup.tar.gz",b=n.body.size;if(b>globalThis.backup.maxBackupSize){let Y=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(b/1048576).toFixed(1)}MB`});this.$toastr.warning(Y,this.$translate.instant("toast.title_warning"))}(0,V.saveAs)(n.body,a)},error:n=>{console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})}restore(e){this.$activeModal.close();let n=this.$modal.open(X,{size:"lg",backdrop:"static"});n.componentInstance.selectedBackup=e}delete(e){this.deleting=e.id,this.$api.delete(`/backup/scheduled-backups/${e.id}`).subscribe({next:()=>{this.getScheduledBackups(),this.deleting=null},error:n=>{this.deleting=null,console.error(n),this.$toastr.error(this.$translate.instant("backup.backup_delete_failed"),this.$translate.instant("toast.title_error"))}})}onDownloadBackupClick(){return $(this,null,function*(){this.clicked=!0,this.$api.get("/backup/download",{observe:"response",responseType:"blob"}).subscribe({next:e=>{let n=e.headers.get("File-Name")||"homebridge-backup.tar.gz";this.clicked=!1;let a=e.body.size;if(a>globalThis.backup.maxBackupSize){let b=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(a/1048576).toFixed(1)}MB`});this.$toastr.warning(b,this.$translate.instant("toast.title_warning"))}(0,V.saveAs)(e.body,n)},error:e=>{this.clicked=!1,console.error(e),this.$toastr.error(this.$translate.instant("backup.backup_download_failed"),this.$translate.instant("toast.title_error"))}})})}Date=Date;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=S({type:t,selectors:[["ng-component"]],decls:53,vars:45,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-hard-drive","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw",3,"ngClass"],[1,"fas","fa-fw","fa-arrow-right"],[1,"list-group","list-group-box","mt-3","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"list-group-item"],[1,"mb-1","text-center"],[1,"small","grey-text","mb-0","text-center"],["container","modal","openDelay","150","triggers","hover",3,"ngbTooltip"],["container","modal","openDelay","150","triggers","hover",1,"red-text",3,"ngbTooltip"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-download"],["placement","bottom","container","modal","openDelay","150","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip"],[1,"fas","fa-fw","fa-exclamation-circle"]],template:function(n,a){n&1&&(r(0,"div",0)(1,"div",1)(2,"h5",2),c(3),s(4,"translate"),o(),r(5,"button",3),s(6,"translate"),f("click",function(){return a.$activeModal.dismiss("Dismiss")}),o()(),r(7,"div",4)(8,"div",5),m(9,"i",6),o(),r(10,"ul",7)(11,"li"),c(12),s(13,"translate"),o(),r(14,"li"),c(15),s(16,"translate"),o(),r(17,"li"),c(18),s(19,"translate"),o()(),r(20,"ul",8)(21,"li",9)(22,"div")(23,"span"),c(24),s(25,"translate"),o(),m(26,"br"),r(27,"small",10),c(28),s(29,"translate"),o()(),r(30,"button",11),s(31,"translate"),f("click",function(){return a.onDownloadBackupClick()}),m(32,"i",12),o()(),r(33,"li",9)(34,"div")(35,"span"),c(36),s(37,"translate"),o(),m(38,"br"),r(39,"small",10),c(40),s(41,"translate"),o()(),r(42,"button",11),s(43,"translate"),f("click",function(){return a.restore(null)}),m(44,"i",13),o()()(),g(45,$e,10,5,"ul",14),o(),r(46,"div",15),m(47,"div",16),r(48,"div",17)(49,"button",18),f("click",function(){return a.$activeModal.dismiss("Dismiss")}),c(50),s(51,"translate"),o()(),m(52,"div",19),o()()),n&2&&(i(3),k(l(4,18,"backup.title_backup")),i(2),_("disabled",a.clicked||a.deleting),v("aria-label",l(6,20,"form.button_close")),i(7),k(l(13,22,"backup.backup_help_one")),i(3),k(l(16,24,"backup.backup_help_two")),i(3),k(l(19,26,"backup.backup_warning")),i(6),k(l(25,28,"backup.backup_now")),i(4),k(l(29,30,"backup.backup_now_desc")),i(2),_("disabled",a.clicked),v("aria-label",l(31,32,"backup.backup_now")),i(2),_("ngClass",z(42,fe,!a.clicked,a.clicked)),i(4),k(l(37,34,"backup.restore_now")),i(4),k(l(41,36,"backup.restore_now_desc")),i(2),_("disabled",a.clicked),v("aria-label",l(43,38,"backup.restore_now")),i(3),u(a.scheduledBackups.length?45:-1),i(4),_("disabled",a.clicked||a.deleting),i(),h(" ",l(51,40,"form.button_close")," "))},dependencies:[q,H,j,F],encapsulation:2})}return t})();export{K as a,X as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as dt,m as pt}from"./chunk-T3Y7RYJZ.js";import{Da as z,Ib as k,Ja as O,Jb as E,Kb as l,Lb as F,Nb as p,Rc as K,Ub as h,Vb as m,Wb as j,Xb as q,Yb as G,_b as U,a as u,ac as ht,b as T,bb as lt,bc as R,bd as Q,cb as L,cc as c,e as It,ga as C,gb as r,ha as ot,hb as v,ja as rt,la as w,lb as ct,ma as _,mc as f,n as g,na as at,oc as y,sb as Z,tb as ut,ua as $,va as V,za as H,zb as S}from"./chunk-ELVGIIRZ.js";var Tt=It((fe,qt)=>{qt.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.0.0-beta.37",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:"^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":"13.0.1","@fastify/multipart":"9.0.2","@fastify/static":"8.0.4","@homebridge/hap-client":"2.0.5","@homebridge/node-pty-prebuilt-multiarch":"0.12.0-beta.5","@nestjs/axios":"4.0.0","@nestjs/common":"11.0.3","@nestjs/core":"11.0.3","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.3","@nestjs/platform-fastify":"11.0.3","@nestjs/platform-socket.io":"11.0.3","@nestjs/swagger":"11.0.2","@nestjs/websockets":"11.0.3",axios:"1.7.9","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.1",commander:"13.1.0",dayjs:"1.11.13",fastify:"5.2.1","fs-extra":"11.3.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",rxjs:"7.8.1",semver:"7.6.3",systeminformation:"5.25.11",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^3.14.0","@nestjs/testing":"^11.0.1","@prettier/plugin-xml":"^3.4.1","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.14","@types/node":"^22.10.7","@types/node-schedule":"^2.1.7","@types/passport-jwt":"^4.0.1","@types/semver":"^7.5.8","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.10","@vitest/coverage-v8":"^3.0.2",concurrently:"^9.1.2","eslint-plugin-format":"^1.0.1","form-data":"^4.0.1",nodemon:"^3.1.9",rimraf:"^6.0.1","ts-loader":"^9.5.2","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.7.3","unplugin-swc":"^1.5.1",vitest:"^3.0.2"},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"}],scarfSettings:{enabled:!1}}});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||{}),Gt="*";function gt(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 Ut(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 mt=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}},ft=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}},Kt="!";var _t=["toast-component",""];function Ot(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 St(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function Et(i,s){if(i&1&&(h(0,"div"),f(1),S(2,St,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 Ft(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function jt(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 Rt(i,s){if(i&1&&(h(0,"div"),j(1,"div",9),m()),i&2){let t=c();r(),F("width",t.width()+"%")}}function At(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 Ht(i,s){if(i&1&&(q(0),f(1),G()),i&2){let t=c(2);r(),y("[",t.duplicatesCount+1,"]")}}function kt(i,s){if(i&1&&(h(0,"div"),f(1),S(2,Ht,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 Nt(i,s){if(i&1&&j(0,"div",7),i&2){let t=c();p(t.options.messageClass),l("innerHTML",t.message,L)}}function Mt(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 Pt(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)}},D=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()}},vt={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"},yt=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]}},Bt=(()=>{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()}},$t=(()=>{class i{_overlayContainer=_(Bt);_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})(),bt=(()=>{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 D(this.index,o,st,n,t,x),Ct=[{provide:D,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(yt),w($t),w(H),w(pt),w(z))};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})(),Vt=(()=>{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(bt),v(D),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:_t,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,Ot,3,0,"button",0)(1,Et,3,5,"div",1)(2,Ft,1,3,"div",2)(3,jt,2,4,"div",3)(4,Rt,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:[gt("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})(),zt=T(u({},vt),{toastComponent:Vt}),Lt=(i={})=>at([{provide:yt,useValue:{default:zt,config:i}}]),he=(()=>{class i{static forRoot(t={}){return{ngModule:i,providers:[Lt(t)]}}static \u0275fac=function(e){return new(e||i)};static \u0275mod=ut({type:i});static \u0275inj=ot({})}return i})();var Zt=(()=>{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(bt),v(D),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:_t,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,At,3,0,"button",0)(1,kt,3,5,"div",1)(2,Nt,1,3,"div",2)(3,Mt,2,4,"div",3)(4,Pt,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})(),de=T(u({},vt),{toastComponent:Zt});var I={serverTarget:Tt().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 Te=(()=>{class i{$http=_(dt);constructor(){}get(t,e){return this.$http.get(`${I.api.base}${t}`,e)}post(t,e,n){return this.$http.post(`${I.api.base}${t}`,e,n)}put(t,e,n){return this.$http.put(`${I.api.base}${t}`,e,n)}patch(t,e,n){return this.$http.patch(`${I.api.base}${t}`,e,n)}delete(t,e){return this.$http.delete(`${I.api.base}${t}`,e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=C({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{b as a,Gt as b,Ut as c,N as d,mt as e,ft as f,Kt as g,bt as h,he as i,I as j,Te as k};
|