homebridge-config-ui-x 5.4.2-beta.13 → 5.4.2-beta.15

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.
Files changed (53) hide show
  1. package/CHANGELOG.md +4 -1
  2. package/package.json +1 -1
  3. package/public/{chunk-BC5JLQKU.js → chunk-3NHBF4JL.js} +1 -1
  4. package/public/chunk-3O6XDTC3.js +30 -0
  5. package/public/{chunk-V2BWLBP4.js → chunk-3V25WJUL.js} +1 -1
  6. package/public/{chunk-2IWIAU2N.js → chunk-3ZGO7RSM.js} +1 -1
  7. package/public/{chunk-DMLIDE5T.js → chunk-4A7WNBPR.js} +1 -1
  8. package/public/{chunk-4LA6OGBW.js → chunk-5Y4EUG3K.js} +1 -1
  9. package/public/{chunk-PTLIFA7V.js → chunk-5ZWEALV6.js} +1 -1
  10. package/public/{chunk-TLGTO2YA.js → chunk-6GSWEUQF.js} +1 -1
  11. package/public/{chunk-QQ23HGQR.js → chunk-6ILBHH7E.js} +1 -1
  12. package/public/{chunk-DMJJTFEA.js → chunk-A5MFXPGV.js} +1 -1
  13. package/public/{chunk-VBPDM7HE.js → chunk-AAFIJPAX.js} +1 -1
  14. package/public/{chunk-B6T4XX7B.js → chunk-BRX7OHZO.js} +1 -1
  15. package/public/{chunk-RHE662Q6.js → chunk-C5DZS5QN.js} +1 -1
  16. package/public/{chunk-5VBFQBME.js → chunk-CUPWPLMM.js} +1 -1
  17. package/public/{chunk-ARGG2BC2.js → chunk-CWLBL3UV.js} +1 -1
  18. package/public/{chunk-YHZ77E6M.js → chunk-EC7I5U7F.js} +1 -1
  19. package/public/{chunk-GG6UJRI3.js → chunk-FPRMTAFD.js} +1 -1
  20. package/public/{chunk-VR6NEEC4.js → chunk-FT2I5WLY.js} +1 -1
  21. package/public/{chunk-4PWEKTPB.js → chunk-GVYVOWT5.js} +1 -1
  22. package/public/{chunk-FM4QGFLK.js → chunk-HR5LIZIB.js} +1 -1
  23. package/public/{chunk-772O3AIU.js → chunk-HSUEB7FB.js} +1 -1
  24. package/public/{chunk-NSRNEOZ5.js → chunk-JMSBGTUO.js} +1 -1
  25. package/public/{chunk-4UK45Y6B.js → chunk-KA6TZXH3.js} +1 -1
  26. package/public/{chunk-Z4QWKXZT.js → chunk-M3Y5VNLK.js} +1 -1
  27. package/public/{chunk-WNX6NDS7.js → chunk-M7EJKUE2.js} +1 -1
  28. package/public/{chunk-5QXUZNMR.js → chunk-MVIXSGWJ.js} +1 -1
  29. package/public/chunk-NEYZLX6Z.js +20 -0
  30. package/public/{chunk-VGHYKIOX.js → chunk-NYHYC2UU.js} +1 -1
  31. package/public/{chunk-QO3ZO6NT.js → chunk-O6SZHVD5.js} +1 -1
  32. package/public/{chunk-NT2IDUZH.js → chunk-OAC6TGAB.js} +1 -1
  33. package/public/{chunk-BUPLBXR6.js → chunk-P6HM2B6R.js} +1 -1
  34. package/public/{chunk-Y6EULWU5.js → chunk-PVTYM6QJ.js} +1 -1
  35. package/public/{chunk-BTBRQOOI.js → chunk-QX2PCH6F.js} +1 -1
  36. package/public/{chunk-RDBOE7IA.js → chunk-RBPAPCE4.js} +1 -1
  37. package/public/{chunk-YNGEVP3I.js → chunk-RO6PZL5G.js} +1 -1
  38. package/public/{chunk-G4WLHM4B.js → chunk-RTZNAIZS.js} +1 -1
  39. package/public/{chunk-PF7T6CNZ.js → chunk-RWD47KCF.js} +1 -1
  40. package/public/{chunk-42AMCJPR.js → chunk-SSQTFQ4Y.js} +1 -1
  41. package/public/{chunk-RSMIPIMV.js → chunk-SXJYQ3AT.js} +1 -1
  42. package/public/{chunk-QAAVQMQN.js → chunk-TZMQBWY5.js} +1 -1
  43. package/public/{chunk-EQPGHHJX.js → chunk-W4MKUB53.js} +1 -1
  44. package/public/{chunk-DJN2ZIUW.js → chunk-XEKJMIMT.js} +1 -1
  45. package/public/{chunk-6FMI6WEI.js → chunk-Y5TNNXF2.js} +1 -1
  46. package/public/{chunk-CH67GDTM.js → chunk-YGC2LZTE.js} +1 -1
  47. package/public/{chunk-IR4BD5UA.js → chunk-YJDUEIZ4.js} +1 -1
  48. package/public/{chunk-DBPQNHZE.js → chunk-ZARWTCJM.js} +1 -1
  49. package/public/{chunk-7L2FPZ3V.js → chunk-ZKNDO2YJ.js} +1 -1
  50. package/public/index.html +1 -1
  51. package/public/{main-YAEB7GU5.js → main-OJFPURA5.js} +1 -1
  52. package/public/chunk-6JF3ALTY.js +0 -20
  53. package/public/chunk-MACP3TMM.js +0 -30
package/CHANGELOG.md CHANGED
@@ -20,9 +20,12 @@ All notable changes to `homebridge-config-ui-x` will be documented in this file.
20
20
  - recommend child bridges for accessory-based plugins
21
21
  - fix for accessory control issue on android-edge/chrome
22
22
  - update `monaco-editor` from `v0.21.3` to `v0.52.2`
23
+ - allow user to choose config comparison view type
24
+ - the default view is the **new inline view**, which shows the differences together
25
+ - a new button allows switching between the inline view and the **existing side-by-side view**
23
26
 
24
27
  ### Other Changes
25
-
28
+
26
29
  - preserve custom service info for undiscovered accessories
27
30
  - minor performance updates
28
31
  - refactor function to detect changes to json config on save
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-config-ui-x",
3
3
  "displayName": "Homebridge UI",
4
- "version": "5.4.2-beta.13",
4
+ "version": "5.4.2-beta.15",
5
5
  "description": "A web based management, configuration and control platform for Homebridge.",
6
6
  "author": "oznu <dev@oz.nu>",
7
7
  "license": "MIT",
@@ -1,2 +1,2 @@
1
- import{A as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,p as J,q as Q,w as X,z as Y}from"./chunk-CNMM42I5.js";import{a as ae}from"./chunk-ARGG2BC2.js";import{b as oe}from"./chunk-VGHYKIOX.js";import{b as re}from"./chunk-QO3ZO6NT.js";import{k as ie,m as U,n as ne}from"./chunk-2IWIAU2N.js";import{a as ee,b as te}from"./chunk-G7FA4DP4.js";import{l as q}from"./chunk-6GMXEQVA.js";import{Cc as L,Dc as B,Ec as E,Hb as M,Ib as z,Jb as T,Jc as a,Kc as s,Ob as m,Pb as o,Qb as r,Rb as u,Xa as W,_b as I,ab as n,bc as x,dc as _,h as S,id as H,ka as w,ld as N,mb as V,nc as O,qa as C,qc as l,ra as b,rc as f,sc as g,w as h,yd as R}from"./chunk-H36QJYLQ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
1
+ import{A as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,p as J,q as Q,w as X,z as Y}from"./chunk-CNMM42I5.js";import{a as ae}from"./chunk-CWLBL3UV.js";import{b as oe}from"./chunk-NYHYC2UU.js";import{b as re}from"./chunk-O6SZHVD5.js";import{k as ie,m as U,n as ne}from"./chunk-3ZGO7RSM.js";import{a as ee,b as te}from"./chunk-G7FA4DP4.js";import{l as q}from"./chunk-6GMXEQVA.js";import{Cc as L,Dc as B,Ec as E,Hb as M,Ib as z,Jb as T,Jc as a,Kc as s,Ob as m,Pb as o,Qb as r,Rb as u,Xa as W,_b as I,ab as n,bc as x,dc as _,h as S,id as H,ka as w,ld as N,mb as V,nc as O,qa as C,qc as l,ra as b,rc as f,sc as g,w as h,yd as R}from"./chunk-H36QJYLQ.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
2
2
  \r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","/assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};