homebridge-config-ui-x 5.6.1 → 5.6.2-alpha.0

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 (183) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/core/auth/auth.controller.d.ts +5 -0
  3. package/dist/core/auth/auth.controller.js +13 -0
  4. package/dist/core/auth/auth.controller.js.map +1 -1
  5. package/dist/core/auth/auth.service.d.ts +1 -0
  6. package/dist/core/auth/auth.service.js +24 -0
  7. package/dist/core/auth/auth.service.js.map +1 -1
  8. package/dist/core/config/config.interfaces.d.ts +126 -0
  9. package/dist/core/config/config.interfaces.js +3 -0
  10. package/dist/core/config/config.interfaces.js.map +1 -0
  11. package/dist/core/config/config.service.d.ts +8 -74
  12. package/dist/core/config/config.service.js +6 -0
  13. package/dist/core/config/config.service.js.map +1 -1
  14. package/dist/core/config/config.startup.d.ts +2 -12
  15. package/dist/core/config/config.startup.js +12 -0
  16. package/dist/core/config/config.startup.js.map +1 -1
  17. package/dist/core/spa/spa-html.service.d.ts +5 -0
  18. package/dist/core/spa/spa-html.service.js +38 -0
  19. package/dist/core/spa/spa-html.service.js.map +1 -0
  20. package/dist/core/spa/spa.filter.d.ts +3 -0
  21. package/dist/core/spa/spa.filter.js +22 -2
  22. package/dist/core/spa/spa.filter.js.map +1 -1
  23. package/dist/globalDefaults.js +11 -0
  24. package/dist/globalDefaults.js.map +1 -1
  25. package/dist/main.js +62 -3
  26. package/dist/main.js.map +1 -1
  27. package/dist/modules/backup/backup.service.js +4 -1
  28. package/dist/modules/backup/backup.service.js.map +1 -1
  29. package/dist/modules/config-editor/config-editor.controller.d.ts +3 -3
  30. package/dist/modules/config-editor/config-editor.service.d.ts +3 -2
  31. package/dist/modules/config-editor/config-editor.service.js +36 -13
  32. package/dist/modules/config-editor/config-editor.service.js.map +1 -1
  33. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +1 -1
  34. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +2 -1
  35. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  36. package/dist/modules/log/log.gateway.d.ts +1 -1
  37. package/dist/modules/log/log.interfaces.d.ts +4 -0
  38. package/dist/modules/log/log.interfaces.js +3 -0
  39. package/dist/modules/log/log.interfaces.js.map +1 -0
  40. package/dist/modules/log/log.service.d.ts +1 -4
  41. package/dist/modules/log/log.service.js.map +1 -1
  42. package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +1 -1
  43. package/dist/modules/platform-tools/terminal/terminal.interfaces.d.ts +8 -0
  44. package/dist/modules/platform-tools/terminal/terminal.interfaces.js +3 -0
  45. package/dist/modules/platform-tools/terminal/terminal.interfaces.js.map +1 -0
  46. package/dist/modules/platform-tools/terminal/terminal.service.d.ts +1 -8
  47. package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
  48. package/dist/modules/plugins/plugins.controller.d.ts +5 -5
  49. package/dist/modules/plugins/plugins.interfaces.d.ts +211 -0
  50. package/dist/modules/plugins/plugins.interfaces.js +3 -0
  51. package/dist/modules/plugins/plugins.interfaces.js.map +1 -0
  52. package/dist/modules/plugins/plugins.service.d.ts +1 -1
  53. package/dist/modules/plugins/plugins.service.js +6 -0
  54. package/dist/modules/plugins/plugins.service.js.map +1 -1
  55. package/dist/modules/server/server.controller.d.ts +3 -0
  56. package/dist/modules/server/server.controller.js +13 -0
  57. package/dist/modules/server/server.controller.js.map +1 -1
  58. package/dist/modules/server/server.service.js +5 -3
  59. package/dist/modules/server/server.service.js.map +1 -1
  60. package/dist/modules/status/status.controller.d.ts +2 -2
  61. package/dist/modules/status/status.gateway.d.ts +5 -5
  62. package/dist/modules/status/status.interfaces.d.ts +27 -0
  63. package/dist/modules/status/status.interfaces.js +10 -0
  64. package/dist/modules/status/status.interfaces.js.map +1 -0
  65. package/dist/modules/status/status.service.d.ts +2 -29
  66. package/dist/modules/status/status.service.js +4 -9
  67. package/dist/modules/status/status.service.js.map +1 -1
  68. package/package.json +2 -1
  69. package/public/3rdpartylicenses.txt +13 -13
  70. package/public/chunk-257EULJG.js +1 -0
  71. package/public/chunk-2UL65UJP.js +1 -0
  72. package/public/{chunk-TLGNUWU6.js → chunk-2XYBM4MH.js} +1 -1
  73. package/public/{chunk-R5CEAGDB.js → chunk-33Z6Y2J3.js} +1 -1
  74. package/public/chunk-3BNXAGGY.js +1 -0
  75. package/public/chunk-3HLSMJUG.js +1 -0
  76. package/public/{chunk-Q5UJ7RBG.js → chunk-3ZU7ZAMP.js} +1 -1
  77. package/public/chunk-4IPC4HXQ.js +1 -0
  78. package/public/chunk-4IPI6BL2.js +2 -0
  79. package/public/chunk-5EJXXVSN.js +1 -0
  80. package/public/chunk-5PQL6CFG.js +1 -0
  81. package/public/chunk-5TUJZVVY.js +1 -0
  82. package/public/{chunk-ODN4SLC6.js → chunk-65OO6V4H.js} +1 -1
  83. package/public/chunk-66TQBJO2.js +1 -0
  84. package/public/chunk-6CPGRNTR.js +1 -0
  85. package/public/chunk-6LB7WDKS.js +1 -0
  86. package/public/chunk-6OGCU4P3.js +1 -0
  87. package/public/{chunk-AD7SNE53.js → chunk-7CNAISDX.js} +1 -1
  88. package/public/{chunk-IDW2S7VV.js → chunk-7F7ZFPDX.js} +1 -1
  89. package/public/{chunk-4A7PQXPM.js → chunk-7FDZTBHP.js} +1 -1
  90. package/public/chunk-7G66Q4SF.js +1 -0
  91. package/public/chunk-BAU2LWZL.js +1 -0
  92. package/public/{chunk-J6L2XE5U.js → chunk-BU6Y5VTM.js} +1 -1
  93. package/public/chunk-C5ZG5SXE.js +1 -0
  94. package/public/{chunk-7HHGB4JN.js → chunk-CD32SCE4.js} +1 -1
  95. package/public/chunk-D457X63N.js +1 -0
  96. package/public/{chunk-SXPAZSXC.js → chunk-EMSTWPI2.js} +1 -1
  97. package/public/chunk-EUTBQRY3.js +1 -0
  98. package/public/{chunk-SZUTWP25.js → chunk-EYCPBPKZ.js} +1 -1
  99. package/public/chunk-F3RGJGHA.js +1 -0
  100. package/public/chunk-GOAXBU4P.js +1 -0
  101. package/public/chunk-IGUY24LJ.js +1 -0
  102. package/public/chunk-IPHTRWQ5.js +49 -0
  103. package/public/chunk-J6UCXVI5.js +19 -0
  104. package/public/chunk-JOMCI2UR.js +1 -0
  105. package/public/{chunk-LY3D63PH.js → chunk-JTV2EVDP.js} +1 -1
  106. package/public/chunk-KOCLZETJ.js +1 -0
  107. package/public/chunk-KOPFAVMN.js +1 -0
  108. package/public/chunk-LRXCNF6O.js +1 -0
  109. package/public/{chunk-QJRU2AHW.js → chunk-LZ2QS3CI.js} +1 -1
  110. package/public/{chunk-GGZZFW2G.js → chunk-MCPFJTIS.js} +1 -1
  111. package/public/{chunk-YAMQWXR3.js → chunk-MCTOJ43V.js} +1 -1
  112. package/public/{chunk-QVKCJ4SR.js → chunk-MO7W4MOJ.js} +1 -1
  113. package/public/chunk-N47YCFS4.js +1 -0
  114. package/public/{chunk-D5RIMAWO.js → chunk-NBY4ULRZ.js} +1 -1
  115. package/public/chunk-NDFDCKRJ.js +1 -0
  116. package/public/{chunk-MXQEKDB7.js → chunk-NR4KD4TZ.js} +1 -1
  117. package/public/chunk-O7RYHICS.js +1 -0
  118. package/public/chunk-PSYQFUQV.js +1 -0
  119. package/public/{chunk-WIJDDKLW.js → chunk-R2QGD4ZP.js} +1 -1
  120. package/public/chunk-RGAEFBOR.js +1 -0
  121. package/public/{chunk-ALBW3CN3.js → chunk-T7ER6YSB.js} +2 -2
  122. package/public/{chunk-DSHT67FQ.js → chunk-TOVPRZVF.js} +1 -1
  123. package/public/chunk-TUN7H57E.js +1 -0
  124. package/public/chunk-UHWETVER.js +1 -0
  125. package/public/chunk-W6KKX5OS.js +1 -0
  126. package/public/{chunk-Q6UH4DEV.js → chunk-WIZAF6OS.js} +1 -1
  127. package/public/{chunk-MSSNDMBK.js → chunk-WO2FS67T.js} +1 -1
  128. package/public/chunk-WWMJUVLA.js +5 -0
  129. package/public/chunk-X7UWQHI7.js +40 -0
  130. package/public/chunk-XM4R6ITZ.js +1 -0
  131. package/public/{chunk-UUXVPC6B.js → chunk-XOZXV7OE.js} +1 -1
  132. package/public/chunk-XZFX66FJ.js +1 -0
  133. package/public/{chunk-2SMLTKN6.js → chunk-Y276Q4AC.js} +1 -1
  134. package/public/chunk-YFADXIRV.js +1 -0
  135. package/public/{chunk-LSU6AEJS.js → chunk-YRJQRJKK.js} +1 -1
  136. package/public/chunk-ZE72CIH6.js +1 -0
  137. package/public/{chunk-BWUD4MPH.js → chunk-ZLXZCS7Z.js} +1 -1
  138. package/public/index.html +2 -2
  139. package/public/main-HTT6TGDT.js +1 -0
  140. package/public/{styles-KAER7B5R.css → styles-IKV7T7ID.css} +1 -1
  141. package/public/chunk-23H472HH.js +0 -1
  142. package/public/chunk-2IG2NOH4.js +0 -49
  143. package/public/chunk-4DQEF3SY.js +0 -1
  144. package/public/chunk-52FJYRHM.js +0 -1
  145. package/public/chunk-52ZZ4IF4.js +0 -1
  146. package/public/chunk-5MWJFCCW.js +0 -1
  147. package/public/chunk-6KGJCE3V.js +0 -1
  148. package/public/chunk-7AQJWYJX.js +0 -1
  149. package/public/chunk-7N7XQXQX.js +0 -1
  150. package/public/chunk-A5X6BX5R.js +0 -1
  151. package/public/chunk-B3AJBIHT.js +0 -1
  152. package/public/chunk-BBLNIMTZ.js +0 -1
  153. package/public/chunk-BR6USPEJ.js +0 -1
  154. package/public/chunk-BZQMBZCK.js +0 -40
  155. package/public/chunk-CSU4CRXM.js +0 -1
  156. package/public/chunk-CZE6VJCO.js +0 -1
  157. package/public/chunk-EFH72TOO.js +0 -1
  158. package/public/chunk-GBGOQFTO.js +0 -1
  159. package/public/chunk-HRXJGOOF.js +0 -1
  160. package/public/chunk-HVB6HFMT.js +0 -1
  161. package/public/chunk-IRK2N2M7.js +0 -1
  162. package/public/chunk-JHUR7SXC.js +0 -1
  163. package/public/chunk-JVZO7GIO.js +0 -1
  164. package/public/chunk-JXPV6V53.js +0 -2
  165. package/public/chunk-L6NRYVMD.js +0 -1
  166. package/public/chunk-LGDYVAWH.js +0 -1
  167. package/public/chunk-M3NG5DHK.js +0 -19
  168. package/public/chunk-MJZG627D.js +0 -1
  169. package/public/chunk-NC3YB7JQ.js +0 -1
  170. package/public/chunk-NJ7NTAUG.js +0 -1
  171. package/public/chunk-OBYXJY4V.js +0 -1
  172. package/public/chunk-OMPHX32Y.js +0 -2
  173. package/public/chunk-RULAYELM.js +0 -1
  174. package/public/chunk-RW3TZQNH.js +0 -1
  175. package/public/chunk-U4JDF4NW.js +0 -1
  176. package/public/chunk-URAOB565.js +0 -1
  177. package/public/chunk-USJUSGFU.js +0 -1
  178. package/public/chunk-V2MV6MJL.js +0 -4
  179. package/public/chunk-VBTRILWF.js +0 -1
  180. package/public/chunk-WC6VTXQW.js +0 -1
  181. package/public/chunk-YBBBKFU2.js +0 -1
  182. package/public/chunk-ZCWNIAD2.js +0 -1
  183. package/public/main-U2ERWF3M.js +0 -1
@@ -1,19 +0,0 @@
1
- import{a as xt}from"./chunk-AD7SNE53.js";import{b as B,e as Ct,f as vt,g as jt,h as $t}from"./chunk-DSHT67FQ.js";import{a as ht,b as bt}from"./chunk-MXQEKDB7.js";import{a as wt}from"./chunk-Q6UH4DEV.js";import{a as Rt}from"./chunk-J6L2XE5U.js";import{m as ft,n as ut,t as D}from"./chunk-Q5UJ7RBG.js";import{B as mt,C as gt,c as dt,e as ct,l as pt}from"./chunk-GGZZFW2G.js";import{b as _t,d as j}from"./chunk-BR6USPEJ.js";import{b as yt}from"./chunk-23H472HH.js";import{k as R,m as H}from"./chunk-BBLNIMTZ.js";import{a as P,b as I}from"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{Bc as ot,Cc as st,Dc as rt,Ic as L,Jb as w,Mb as v,Nb as $,Nc as r,Oc as l,Pb as tt,Pc as J,Qb as et,Rb as it,Sb as f,Tb as a,Ub as d,Vb as m,a as G,b as Y,cb as s,cc as k,d as Q,fc as b,g as X,h as C,hb as Z,hc as p,ka as g,md as at,ob as V,qa as u,ra as h,sc as nt,td as lt,uc as _,vc as E,w as S,wc as M}from"./chunk-V2MV6MJL.js";var Tt=X(jt(),1);var kt=X(Rt(),1);var Et=(o,y)=>({"fa-trash":o,"fa-cog fa-spin":y});function Ot(o,y){o&1&&(a(0,"div",13),m(1,"i",20),d())}function Ut(o,y){if(o&1){let t=k();a(0,"li",9)(1,"span"),_(2),r(3,"date"),m(4,"br"),a(5,"span",21),_(6),r(7,"date"),d()(),a(8,"span",22)(9,"button",25),r(10,"translate"),r(11,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(n.restore(i.id))}),m(12,"i",26),d(),a(13,"button",27),r(14,"translate"),r(15,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(n.download(i.id))}),m(16,"i",28),d(),a(17,"button",23),r(18,"translate"),r(19,"translate"),b("click",function(){let i=u(t).$implicit,n=p(2);return h(n.delete(i.id))}),m(20,"i",24),d()()()}if(o&2){let t=y.$implicit,e=p(2);s(2),M(" ",J(3,15,t.timestamp,"mediumDate")),s(4),E(J(7,18,t.timestamp,"shortTime")),s(3),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(10,21,"config.restore.copy_to_editor"))("openDelay",150),w("aria-label",l(11,23,"config.restore.copy_to_editor")),s(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(14,25,"form.button_download"))("openDelay",150),w("aria-label",l(15,27,"form.button_download")),s(4),f("disabled",e.clicked||e.deleting)("ngbTooltip",l(18,29,"form.button_delete"))("openDelay",150),w("aria-label",l(19,31,"form.button_delete")),s(3),f("ngClass",L(33,Et,t.id!==e.deleting,t.id===e.deleting))}}function Nt(o,y){if(o&1){let t=k();a(0,"ul",14),et(1,Ut,21,36,"li",9,tt),a(3,"li",9)(4,"span"),_(5),r(6,"translate"),m(7,"br"),a(8,"span",21),_(9),r(10,"translate"),d()(),a(11,"span",22)(12,"button",23),r(13,"translate"),r(14,"translate"),b("click",function(){u(t);let i=p();return h(i.deleteAllBackups())}),m(15,"i",24),d()()()()}if(o&2){let t=p();s(),it(t.backupList),s(4),M(" ",l(6,7,"form.button_delete_all")),s(4),M(" ",l(10,9,"common.labels.no_confirmation")," "),s(3),f("disabled",t.clicked||t.deleting)("ngbTooltip",l(13,11,"form.button_delete_all"))("openDelay",150),w("aria-label",l(14,13,"form.button_delete")),s(3),f("ngClass",L(15,Et,t.deleting!=="all",t.deleting==="all"))}}var St=(()=>{class o{$activeModal=g(ft);$api=g(H);$router=g(j);$toastr=g(R);$translate=g(P);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return C(this,null,function*(){try{let t=yield S(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=t}catch(t){this.loading=!1,console.error(t),this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(t){return this.$activeModal.close(t)}download(t){return C(this,null,function*(){this.clicked=!0;try{let e=yield S(this.$api.get(`/config-editor/backups/${t}`)),i=JSON.stringify(e,null,4),n=new Blob([i],{type:"application/json"}),x=`config-backup-${t}.json`;(0,kt.saveAs)(n,x),this.clicked=!1}catch(e){this.clicked=!1,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}downloadCurrentConfig(){let t=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,e=document.createElement("a");e.setAttribute("href",t),e.setAttribute("download","config.json"),document.body.appendChild(e),e.click(),e.remove()}delete(t){return C(this,null,function*(){this.deleting=t;try{yield S(this.$api.delete(`/config-editor/backups/${t}`)),yield this.getConfigBackups(),this.deleting=null}catch(e){this.deleting=null,this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e)}})}deleteAllBackups(){return C(this,null,function*(){this.deleting="all";try{yield S(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(t){this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,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-history","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-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[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,"fa","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-download"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),r(4,"translate"),d(),a(5,"button",3),r(6,"translate"),b("click",function(){return i.dismissModal()}),d()(),a(7,"div",4)(8,"div",5),m(9,"i",6),d(),a(10,"ul",7)(11,"li"),_(12),r(13,"translate"),d(),a(14,"li"),_(15),r(16,"translate"),d()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),r(22,"translate"),d(),m(23,"br"),a(24,"small",10),_(25),r(26,"translate"),d()(),a(27,"button",11),r(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),m(29,"i",12),d()()(),v(30,Ot,2,0,"div",13)(31,Nt,16,18,"ul",14),d(),a(32,"div",15),m(33,"div",16),a(34,"div",17)(35,"button",18),r(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),r(38,"translate"),d()(),m(39,"div",19),d()()),e&2&&(s(3),E(l(4,13,"config.restore.title")),s(2),f("disabled",i.clicked||i.deleting),w("aria-label",l(6,15,"form.button_close")),s(7),E(l(13,17,"config.restore.help_1")),s(3),E(l(16,19,"config.restore.help_2")),s(6),E(l(22,21,"form.button_download")),s(4),E(l(26,23,"config.restore.download")),s(2),f("disabled",i.clicked||i.deleting),w("aria-label",l(28,25,"backup.backup_now")),s(3),$(i.loading?30:i.backupList.length?31:-1),s(5),f("disabled",i.clicked||i.deleting),w("aria-label",l(36,27,"form.button_close")),s(2),M(" ",l(38,29,"form.button_close")," "))},dependencies:[D,at,gt,lt,I],encapsulation:2})}return o})();function Ft(o,y){if(o&1){let t=k();a(0,"button",13),r(1,"translate"),r(2,"translate"),b("click",function(){u(t);let i=p();return h(i.onCancelRestore())}),m(3,"i",14),d()}if(o&2){let t=p();f("disabled",t.saveInProgress)("openDelay",150)("ngbTooltip",l(1,4,"form.button_cancel")),w("aria-label",l(2,6,"form.button_cancel"))}}function qt(o,y){if(o&1){let t=k();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){u(t);let i=p();return h(i.onRestore())}),m(3,"i",16),d()}o&2&&(f("openDelay",150)("ngbTooltip",l(1,3,"form.button_restore")),w("aria-label",l(2,5,"form.button_restore")))}function zt(o,y){if(o&1){let t=k();a(0,"button",15),r(1,"translate"),r(2,"translate"),b("click",function(){u(t);let i=p();return h(i.toggleSideBySide())}),m(3,"i",17),d()}if(o&2){let t=p();f("openDelay",150)("ngbTooltip",l(1,7,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),w("aria-label",l(2,9,t.renderSideBySide?"config.restore.view_inline":"config.restore.view_side_by_side")),s(3),nt("fa-columns",!t.renderSideBySide)("fa-bars",t.renderSideBySide)}}function Lt(o,y){o&1&&m(0,"i",8)}function Jt(o,y){o&1&&m(0,"i",9)}function Wt(o,y){if(o&1){let t=k();a(0,"ngx-monaco-editor",18),b("onInit",function(i){u(t);let n=p();return h(n.onEditorInit(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())}),d()}if(o&2){let t=p();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function Kt(o,y){if(o&1){let t=k();a(0,"ngx-monaco-diff-editor",19),b("onInit",function(i){u(t);let n=p();return h(n.onInitDiffEditor(i))})("keydown.control.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())})("keydown.meta.s",function(i){u(t);let n=p();return i.preventDefault(),h(n.onSave())}),d()}if(o&2){let t=p();f("options",t.editorOptions)("originalModel",t.diffOriginalModel)("modifiedModel",t.diffModifiedModel)}}function Gt(o,y){if(o&1){let t=k();a(0,"textarea",20),rt("ngModelChange",function(i){u(t);let n=p();return st(n.homebridgeConfig,i)||(n.homebridgeConfig=i),h(i)}),_(1," "),d()}if(o&2){let t=p();ot("ngModel",t.homebridgeConfig)}}var Me=(()=>{class o{$api=g(H);$md=g(wt);$modal=g(ut);$monacoEditor=g(xt);$route=g(_t);$renderer=g(Z);$router=g(j);$settings=g(yt);$toastr=g(R);$translate=g(P);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;diffOriginalModel;diffModifiedModel;renderSideBySide=!1;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",renderSideBySide:this.renderSideBySide,renderIndicators:!0,ignoreTrimWhitespace:!1,glyphMargin:!0};let t=document.querySelector(".content");this.$renderer.setStyle(t,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),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(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config),this.diffModifiedModel&&this.updateDiffModels()}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},this.diffOriginalModel={code:"",language:"json"},this.diffModifiedModel={code:this.homebridgeConfig||"{}",language:"json"},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>this.setMonacoEditorModel()});let{action:e}=this.$router.parseUrl(this.$router.url).queryParams;if(e){switch(e){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(t){window.editor=t,this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(t){this.monacoEditor=t.getModifiedEditor(),this.updateDiffModels(),window.editor=t}updateDiffModels(){if(this.diffOriginalModel&&(this.diffOriginalModel.code=this.originalConfig||""),this.diffModifiedModel&&(this.diffModifiedModel.code=this.homebridgeConfig||"{}"),window.editor&&window.editor.getOriginalEditor){let t=window.editor.getOriginalEditor(),e=window.editor.getModifiedEditor();if(t&&e){let i=t.getModel(),n=e.getModel();i&&i.setValue(this.originalConfig||""),n&&n.setValue(this.homebridgeConfig||"{}")}}}onSave(){return C(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let e=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of e)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let t=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(t,null,4),typeof t.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(t.bridge.username)?t.accessories&&!Array.isArray(t.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&!Array.isArray(t.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):t.platforms&&Array.isArray(t.platforms)&&!this.validateSection(t.platforms,"platform")||t.accessories&&Array.isArray(t.accessories)&&!this.validateSection(t.accessories,"accessory")||t.plugins&&Array.isArray(t.plugins)&&!this.validatePlugins(t.plugins,"plugins")||t.disabledPlugins&&Array.isArray(t.disabledPlugins)&&!this.validatePlugins(t.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(t),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(t=!1){let e=this.$modal.open(St,{size:"lg",backdrop:"static"});e.componentInstance.currentConfig=this.homebridgeConfig,e.componentInstance.fromSettings=t,e.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig,this.updateDiffModels()),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:n=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(n,null,4),this.updateDiffModels(),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:n=>{console.error(n),this.$toastr.error(n.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){if(window.editor&&window.editor.dispose)try{window.editor.dispose(),window.editor=void 0}catch{}this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.renderSideBySide&&this.toggleSideBySide(),this.updateDiffModels(),this.onRestore()}toggleSideBySide(){this.renderSideBySide=!this.renderSideBySide,this.editorOptions=Y(G({},this.editorOptions),{renderSideBySide:this.renderSideBySide})}ngOnDestroy(){let t=document.querySelector(".content");this.$renderer.removeStyle(t,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove());try{if(window.editor&&window.editor.dispose&&(window.editor.dispose(),window.editor=void 0),window.monaco){let e=window.monaco.Uri.parse("file:///original.json"),i=window.monaco.Uri.parse("file:///modified.json"),n=window.monaco.editor.getModel(e);n&&n.dispose();let x=window.monaco.editor.getModel(i);x&&x.dispose()}this.monacoEditor&&this.monacoEditor.dispose()}catch{}}validateSection(t,e){for(let i of t){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[e])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[e]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:e}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(t,e){for(let i of t)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:e}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(t){this.monacoEditor&&(t=JSON.stringify(t,null,4).split(`
2
- `).map(e=>` ${e}`).join(`
3
- `),setTimeout(()=>{let e=this.monacoEditor.getModel().findMatches(t);if(e.length){let i=e[0].range,n=new monaco.Range(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:n,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(i=>i.uri==="http://homebridge/config.json"))return;let t=monaco.Uri.parse("a://homebridge/config.json"),e=$t(this.$translate);window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[t.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",title:this.$translate.instant("settings.name"),description:`The Homebridge instance name.
4
- This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",title:this.$translate.instant("accessories.bridge_username"),description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
5
- You should change this pin if you need to re-pair your instance with HomeKit.
6
- Example: 0E:89:49:64:91:86.`,default:"0E:89:49:64:91:86",pattern:"^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"},port:{type:"number",title:this.$translate.instant("settings.network.port_hb"),description:`The port Homebridge listens on.
7
- If running more than one instance of Homebridge on the same server make sure each instance is given a unique port.`,default:51173,minimum:1025,maximum:65534},pin:{type:"string",description:`The Homebridge instance pin.
8
- This is used when pairing Homebridge to HomeKit.
9
- Example: 630-27-655.`,default:"630-27-655",pattern:"^([0-9]{3}-[0-9]{2}-[0-9]{3})$"},manufacturer:{type:"string",title:this.$translate.instant("child_bridge.config.manufacturer"),description:"The bridge manufacturer to be displayed in HomeKit."},firmwareRevision:{type:"string",title:this.$translate.instant("child_bridge.config.firmware"),description:"The bridge firmware version to be displayed in HomeKit."},model:{type:"string",title:this.$translate.instant("child_bridge.config.model"),description:"The bridge model to be displayed in HomeKit."},bind:{title:this.$translate.instant("settings.network.title_network_interfaces"),description:`A string or an array of strings with the name(s) of the network interface(s) Homebridge should bind to.
10
- Requires Homebridge v1.3 or later.`,type:["string","array"],items:{type:"string",description:this.$translate.instant("status.widget.network.network_interface")}}},default:{name:"Homebridge",username:"0E:89:49:64:91:86",port:51173,pin:"6302-7655"}},mdns:{type:"object",properties:{interface:{type:"string",title:this.$translate.instant("status.widget.network.network_interface"),description:`The interface or IP address of the interface you want Homebridge to listen on.
11
- This is useful if your server has multiple interfaces.
12
- Deprecated as of Homebridge v1.3.0 - use bridge.bind instead.`},legacyAdvertiser:{type:"boolean",title:"Legacy mDNS Advertiser",description:"Set to false to use the new mdns library, ciao."}},default:{legacyAdvertiser:!1}},ports:{type:"object",title:"Port Range",description:"The range of ports that should be used for external accessories like cameras and TVs.",required:["start","end"],properties:{start:{type:"number",default:52100,minimum:1025,maximum:65534,title:this.$translate.instant("settings.network.port_start"),description:this.$translate.instant("settings.network.port_start_desc")},end:{type:"number",default:52150,minimum:1025,maximum:65534,title:this.$translate.instant("settings.network.port_end"),description:this.$translate.instant("settings.network.port_end_desc")}},default:{start:52100,end:52150}},platforms:{type:"array",title:"Platforms",description:`Any plugin that exposes a platform should have its config entered in this array.
13
- Separate each plugin config block using a comma.`,items:{type:"object",required:["platform"],anyOf:[{type:"object",required:["platform"],title:this.$translate.instant("plugins.button_settings"),properties:{platform:{type:"string",title:"Platform Name",description:"This is used by Homebridge to identify which plugin this platform belongs to.",not:{enum:["config"]}},name:{type:"string",title:this.$translate.instant("accessories.name"),description:"The name of the platform."},_bridge:e}},{type:"object",properties:{platform:{type:"string",title:"Platform Name",description:`Homebridge UI platform name must be set to "config".
14
- Do not change!`,const:"config"},name:{title:this.$translate.instant("accessories.name"),type:"string",default:"Homebridge UI",minLength:1,description:"The name of the Homebridge instance."},port:{title:this.$translate.instant("settings.network.port_ui"),type:"integer",default:8080,minimum:1025,maximum:65535,description:this.$translate.instant("settings.network.port_ui_desc")},auth:{type:"string",default:"form",title:this.$translate.instant("settings.security.auth"),description:this.$translate.instant("settings.security.auth_desc"),oneOf:[{title:"Require Authentication",enum:["form"]},{title:"None",enum:["none"]}]},theme:{title:this.$translate.instant("settings.display.theme"),description:"The theme used for the UI.",type:"string",default:"orange",oneOf:[{title:this.$translate.instant("settings.display.orange"),enum:["orange"]},{title:this.$translate.instant("settings.display.red"),enum:["red"]},{title:this.$translate.instant("settings.display.pink"),enum:["pink"]},{title:this.$translate.instant("settings.display.purple"),enum:["purple"]},{title:this.$translate.instant("settings.display.deep_purple"),enum:["deep-purple"]},{title:this.$translate.instant("settings.display.indigo"),enum:["indigo"]},{title:this.$translate.instant("settings.display.blue"),enum:["blue"]},{title:this.$translate.instant("settings.display.bluegrey"),enum:["blue-grey"]},{title:this.$translate.instant("settings.display.cyan"),enum:["cyan"]},{title:this.$translate.instant("settings.display.green"),enum:["green"]},{title:this.$translate.instant("settings.display.teal"),enum:["teal"]},{title:this.$translate.instant("settings.display.grey"),enum:["grey"]},{title:this.$translate.instant("settings.display.brown"),enum:["brown"]}]},lightingMode:{title:this.$translate.instant("settings.display.lighting_mode"),description:"The lighting mode used for the UI.",type:"string",default:"auto",oneOf:[{title:this.$translate.instant("accessories.control.auto"),enum:["auto"]},{title:this.$translate.instant("settings.display.light"),enum:["light"]},{title:this.$translate.instant("settings.display.dark"),enum:["dark"]}]},menuMode:{title:this.$translate.instant("settings.display.menu_mode"),description:"Modes for the UI side menu.",type:"string",default:"default",oneOf:[{title:this.$translate.instant("settings.display.menu_default"),enum:["default"]},{title:this.$translate.instant("settings.display.menu_freeze"),enum:["freeze"]}]},temp:{title:this.$translate.instant("settings.linux.temp"),type:"string",description:this.$translate.instant("settings.linux.temp_desc")},tempUnits:{title:this.$translate.instant("settings.display.temp_units"),description:"The units used to display the temperature.",type:"string",default:"c",oneOf:[{title:this.$translate.instant("settings.display.temp_units.c"),enum:["c"]},{title:this.$translate.instant("settings.display.temp_units.f"),enum:["f"]}]},lang:{title:this.$translate.instant("settings.display.lang"),type:"string",default:"auto",description:"The language used for the UI.",oneOf:[{title:this.$translate.instant("form.select.auto"),enum:["auto"]},{title:"Bulgarian (bg)",enum:["bg"]},{title:"Catalan (ca)",enum:["ca"]},{title:"Chinese - Simplified (zh-CN)",enum:["zh-CN"]},{title:"Chinese - Traditional (zh-TW)",enum:["zh-TW"]},{title:"Czech (cs)",enum:["cs"]},{title:"Dutch (nl)",enum:["nl"]},{title:"English (en)",enum:["en"]},{title:"Finnish (fi)",enum:["fi"]},{title:"French (fr)",enum:["fr"]},{title:"German (de)",enum:["de"]},{title:"Hebrew (he)",enum:["he"]},{title:"Hungarian (hu)",enum:["hu"]},{title:"Indonesian (id)",enum:["id"]},{title:"Italian (it)",enum:["it"]},{title:"Japanese (ja)",enum:["ja"]},{title:"Korean (ko)",enum:["ko"]},{title:"Macedonian (mk)",enum:["mk"]},{title:"Norwegian (no)",enum:["no"]},{title:"Polish (pl)",enum:["pl"]},{title:"Portuguese (Brazil)",enum:["pt-BR"]},{title:"Portuguese (Portugal)",enum:["pt"]},{title:"Russian (ru)",enum:["ru"]},{title:"Slovenian (sl)",enum:["sl"]},{title:"Spanish (es)",enum:["es"]},{title:"Swedish (sv)",enum:["sv"]},{title:"Thai (th)",enum:["th"]},{title:"Turkish (tr)",enum:["tr"]},{title:"Ukrainian (uk)",enum:["uk"]}]},wallpaper:{title:this.$translate.instant("settings.display.wallpaper"),description:"The full path to the .jpg file.",type:"string"},homebridgePackagePath:{title:this.$translate.instant("settings.network.hb_package"),type:"string",description:this.$translate.instant("settings.network.hb_package_desc")},host:{type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",title:this.$translate.instant("settings.network.host"),description:this.$translate.instant("settings.network.host_desc")},sessionTimeout:{type:"integer",minimum:600,maximum:864e5,title:this.$translate.instant("settings.startup.session"),description:this.$translate.instant("settings.startup.session_desc")},log:{type:"object",title:"Log Settings",description:"The log settings for the Homebridge UI.",properties:{maxSize:{type:"integer",title:this.$translate.instant("settings.terminal.log_max"),description:this.$translate.instant("settings.terminal.log_max_desc"),minimum:-1},truncateSize:{type:"integer",title:this.$translate.instant("settings.terminal.log_truncate"),description:this.$translate.instant("settings.terminal.log_truncate_desc"),minimum:0}}},ssl:{type:"object",title:this.$translate.instant("settings.security.https"),description:this.$translate.instant("settings.security.https_desc"),properties:{key:{type:"string",title:this.$translate.instant("settings.security.key"),description:"The full path to the private key file."},cert:{type:"string",title:this.$translate.instant("settings.security.cert"),description:"The full path to the certificate file."},pfx:{title:this.$translate.instant("settings.security.pfx"),type:"string",description:"The full path to the PKCS#12 certificate file."},passphrase:{title:this.$translate.instant("settings.security.pass"),type:"string",description:"The passphrase for the PKCS#12 certificate file."}}},accessoryControl:{title:"Accessory Control Setup",type:"object",description:"The accessory control settings for the Homebridge UI.",properties:{debug:{title:this.$translate.instant("settings.accessory.debug"),type:"boolean",description:this.$translate.instant("settings.accessory.debug_desc")},instanceBlacklist:{title:this.$translate.instant("settings.security.ui_control"),type:"array",description:this.$translate.instant("settings.security.ui_control_desc"),items:{title:this.$translate.instant("accessories.bridge_username"),type:"string",pattern:"^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"}}}},linux:{title:"Linux Server Commands",type:"object",description:"The Linux server commands for the Homebridge UI.",properties:{shutdown:{title:this.$translate.instant("settings.linux.shutdown"),type:"string",description:this.$translate.instant("settings.linux.shutdown_desc")},restart:{title:this.$translate.instant("settings.linux.restart"),type:"string",description:this.$translate.instant("settings.linux.restart_desc")}}},proxyHost:{title:this.$translate.instant("settings.network.proxy"),type:"string",pattern:"^[^{}/ :\\\\]+(?::\\d+)?$",description:this.$translate.instant("settings.network.proxy_desc")},scheduledBackupPath:{title:this.$translate.instant("backup.settings_path"),description:"The full path to where the service should save daily scheduled backups archives.",type:"string"},scheduledBackupDisable:{title:"Disable Scheduled Backups",type:"boolean",description:"When enabled, the Homebridge UI will not create daily scheduled backups."},disableServerMetricsMonitoring:{title:"Disable Server Metrics Monitoring",type:"boolean",description:"When enabled, the Homebridge UI will not collect or report CPU or memory stats."},plugins:{title:this.$translate.instant("menu.label_plugins"),type:"object",description:"Settings surrounding plugins used by the Homebridge UI.",properties:{hideUpdatesFor:{type:"array",title:"Hide Plugin Updates For",description:"A list of plugin names for which frontend update notifications will be hidden.",items:{type:"string",title:this.$translate.instant("accessories.plugin"),pattern:"^(?:@[\\w-]+(?:\\.[\\w-]+)*/)?homebridge-[\\w-]+$"}},alwaysShowBetas:{type:"boolean",title:this.$translate.instant("settings.display.show_betas"),description:"When enabled, beta releases will be shown as available for Homebridge, the UI and plugins."}}},terminal:{type:"object",title:"Terminal Settings",description:"The terminal settings for the Homebridge UI.",properties:{persistence:{title:this.$translate.instant("settings.terminal.persistence"),type:"boolean",description:this.$translate.instant("settings.terminal.persistence_help"),default:!1},hideWarning:{title:this.$translate.instant("settings.terminal.warning"),type:"boolean",description:this.$translate.instant("settings.terminal.warning_help"),default:!1},bufferSize:{title:this.$translate.instant("settings.terminal.buffer_size"),type:"integer",description:this.$translate.instant("settings.terminal.buffer_size_help"),default:5e4,minimum:0}}}}}]}},accessories:{type:"array",title:this.$translate.instant("menu.label_accessories"),description:`Any plugin that exposes an accessory should have its config entered in this array.
15
- Separate each plugin config block using a comma.`,items:{type:"object",required:["accessory","name"],title:this.$translate.instant("plugins.button_settings"),properties:{accessory:{type:"string",title:this.$translate.instant("child_bridge.config.accessory"),description:"This is used by Homebridge to identify which plugin this accessory belongs to."},name:{type:"string",title:this.$translate.instant("accessories.name"),description:"The name of the accessory."},_bridge:e}}},plugins:{type:"array",title:this.$translate.instant("menu.label_plugins"),description:`An array of plugins that should be selectively enabled.
16
- Remove this array to enable all plugins.`,items:{type:"string",title:this.$translate.instant("accessories.plugin"),description:`The full plugin npm package name.
17
- Example: homebridge-dummy.`},default:["homebridge-config-ui-x"]},disabledPlugins:{type:"array",description:`An array of plugins that should be disabled.
18
- Requires Homebridge v1.3 or later.`,items:{type:"string",title:this.$translate.instant("accessories.plugin"),description:`The full plugin npm package name.
19
- Example: homebridge-dummy.`},default:[]}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}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)}saveConfig(t){return C(this,null,function*(){try{let e=yield S(this.$api.post("/config-editor",t));this.homebridgeConfig=JSON.stringify(e,null,4),yield this.detectSavesChangesForRestart()}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}validateArraysEqual(t,e){if(t.length!==e.length)return!1;let i=[...t].sort(),n=[...e].sort();return i.every((x,O)=>x===n[O])}removePlatformsAndAccessories(t){let x=t,{accessories:e,platforms:i}=x;return Q(x,["accessories","platforms"])}removeEmptyBridges(t){return t.filter(e=>e._bridge&&Object.keys(e._bridge).length>0).map(e=>e._bridge)}validateBridgesEqual(t,e){return t.length!==e.length?!1:t.every(i=>e.some(n=>B(i,n)))}detectSavesChangesForRestart(){return C(this,null,function*(){let t=yield this.determineRestartType();t==="full"?yield this.performFullRestart():t==="child"&&(yield this.performChildBridgeRestart()),this.latestSavedConfig=JSON.parse(this.homebridgeConfig)})}determineRestartType(){return C(this,null,function*(){if(this.hbPendingRestart)return"full";let t=this.latestSavedConfig,e=JSON.stringify(t,null,4),i=JSON.parse(this.homebridgeConfig),n=this.homebridgeConfig;if(e===n&&!this.childBridgesToRestart.length)return this.$toastr.info(this.$translate.instant("config.no_restart"),this.$translate.instant("config.config_saved")),"none";if(!this.validateArraysEqual(Object.keys(t),Object.keys(i))||[...i.platforms||[],...i.accessories||[]].every(c=>!c._bridge||!Object.keys(c._bridge).length))return"full";let O=this.removePlatformsAndAccessories(t),Mt=this.removePlatformsAndAccessories(i);if(!B(O,Mt))return"full";let U=t.platforms||[],N=i.platforms||[],Bt=U.map(c=>c.platform),At=N.map(c=>c.platform);if(!this.validateArraysEqual(Bt,At))return"full";let F=t.accessories||[],q=i.accessories||[],Vt=F.map(c=>c.accessory),Dt=q.map(c=>c.accessory);if(!this.validateArraysEqual(Vt,Dt)||!this.validateBridgesEqual(this.removeEmptyBridges(U),this.removeEmptyBridges(N))||!this.validateBridgesEqual(this.removeEmptyBridges(F),this.removeEmptyBridges(q)))return"full";let W=U.filter(c=>!B(c,N.find(T=>T.platform===c.platform))),Pt=F.filter(c=>!B(c,q.find(T=>T.accessory===c.accessory))),K=[...W,...Pt];if(W.some(c=>c.platform==="config")||K.some(c=>c.platform==="config"?!1:!c._bridge||Object.keys(c._bridge).length===0))return"full";try{let c=yield S(this.$api.get("/status/homebridge/child-bridges"));return K.forEach(T=>{let It=T._bridge.username.toUpperCase(),A=c.find(({username:z})=>z===It);if(A)this.childBridgesToRestart.some(z=>z.username===A.username)||this.childBridgesToRestart.push({name:A.name,username:A.username});else return"full"}),"child"}catch(c){return console.error("Error fetching child bridges:",c),"full"}})}performChildBridgeRestart(){return C(this,null,function*(){let t=this.$modal.open(Ct,{size:"lg",backdrop:"static"});t.componentInstance.bridges=this.childBridgesToRestart;try{yield t.result,this.childBridgesToRestart=[]}catch{}})}performFullRestart(){return C(this,null,function*(){let t=this.$modal.open(vt,{size:"lg",backdrop:"static"});try{yield t.result,this.hbPendingRestart=!1,this.childBridgesToRestart=[]}catch{this.hbPendingRestart=!0}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let e=Tt.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(e,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),e}}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["ng-component"]],decls:18,vars:19,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"disabled","openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-floppy-disk"],[1,"fas","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModel"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-times"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-history"],[1,"fas"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),_(4),r(5,"translate"),d()(),a(6,"div",4),v(7,Ft,4,8,"button",5),v(8,qt,4,7,"button",6),v(9,zt,4,11,"button",6),a(10,"button",7),r(11,"translate"),r(12,"translate"),b("click",function(){return i.onSave()}),v(13,Lt,1,0,"i",8),v(14,Jt,1,0,"i",9),d()()(),v(15,Wt,1,2,"ngx-monaco-editor",10),v(16,Kt,1,3,"ngx-monaco-diff-editor",11),v(17,Gt,2,1,"textarea",12),d()),e&2&&(s(4),E(l(5,13,"menu.config_json_editor")),s(3),$(i.originalConfig?7:-1),s(),$(i.originalConfig?-1:8),s(),$(!i.isMobile&&i.originalConfig?9:-1),s(),f("disabled",i.saveInProgress)("openDelay",150)("ngbTooltip",l(11,15,"form.button_save")),w("aria-label",l(12,17,"form.button_save")),s(3),$(i.saveInProgress?-1:13),s(),$(i.saveInProgress?14:-1),s(),$(!i.isMobile&&!i.originalConfig?15:-1),s(),$(!i.isMobile&&i.originalConfig?16:-1),s(),$(i.isMobile?17:-1))},dependencies:[D,ht,bt,mt,dt,ct,pt,I],encapsulation:2})}return o})();export{Me as ConfigEditorComponent};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-QJRU2AHW.js";import{g as i}from"./chunk-BR6USPEJ.js";import"./chunk-23H472HH.js";import"./chunk-BBLNIMTZ.js";import"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{ga as o,pb as r}from"./chunk-V2MV6MJL.js";var a=[{path:"",loadComponent:()=>import("./chunk-JXPV6V53.js").then(t=>t.SetupWizardComponent)}],u=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({imports:[i.forChild(a),i]})}return t})();var l=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=r({type:t});static \u0275inj=o({providers:[n],imports:[u]})}return t})();export{l as SetupWizardModule};
@@ -1 +0,0 @@
1
- import{d as f,g as s}from"./chunk-BR6USPEJ.js";import{k as u,m as d}from"./chunk-BBLNIMTZ.js";import{a as l}from"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{fa as m,ga as i,h as p,ka as e,pb as a,w as c}from"./chunk-V2MV6MJL.js";var n=(()=>{class t{$api=e(d);$router=e(f);$toastr=e(u);$translate=e(l);resolve(){return p(this,null,function*(){try{return yield c(this.$api.get("/platform-tools/docker/startup-script"))}catch(r){console.error(r),this.$toastr.error(r.message,this.$translate.instant("toast.title_error")),this.$router.navigate(["/"])}})}static \u0275fac=function(o){return new(o||t)};static \u0275prov=m({token:t,factory:t.\u0275fac})}return t})();var S=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"startup-script",loadComponent:()=>import("./chunk-LY3D63PH.js").then(t=>t.StartupScriptComponent),resolve:{startupScript:n}},{path:"restart-container",loadComponent:()=>import("./chunk-L6NRYVMD.js").then(t=>t.ContainerRestartComponent)}],v=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({imports:[s.forChild(S),s]})}return t})();var T=(()=>{class t{static \u0275fac=function(o){return new(o||t)};static \u0275mod=a({type:t});static \u0275inj=i({providers:[n],imports:[v]})}return t})();export{T as DockerModule};
@@ -1 +0,0 @@
1
- import{k as _,m as h}from"./chunk-BBLNIMTZ.js";import{a as v,b as E}from"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{Mb as c,Nb as x,Nc as p,Oc as s,Wb as i,Xb as e,Yb as f,cb as n,hc as u,ka as l,ob as d,uc as o,vc as a}from"./chunk-V2MV6MJL.js";function y(t,w){if(t&1&&(i(0,"div",7),o(1),e()),t&2){let r=u();n(),a(r.error)}}function C(t,w){t&1&&(i(0,"p",8),o(1),p(2,"translate"),e()),t&2&&(n(),a(s(2,1,"platform.linux.server_will_power_down")))}var B=(()=>{class t{$api=l(h);$toastr=l(_);$translate=l(v);error=!1;ngOnInit(){this.$api.put("/platform-tools/linux/shutdown-host",{}).subscribe({error:r=>{console.error(r),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(m){return new(m||t)};static \u0275cmp=d({type:t,selectors:[["ng-component"]],decls:13,vars:7,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-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"grey-text"]],template:function(m,S){m&1&&(i(0,"div",0)(1,"h3",1),o(2),p(3,"translate"),e()(),i(4,"div",2)(5,"div",3),f(6,"i",4),e(),i(7,"div",5)(8,"h4",6),o(9),p(10,"translate"),e(),c(11,y,2,1,"div",7)(12,C,3,3,"p",8),e()()),m&2&&(n(2),a(s(3,3,"menu.restart.title")),n(7),a(s(10,5,"platform.linux.shutting_down_server")),n(2),x(S.error?11:12))},dependencies:[E],encapsulation:2})}return t})();export{B as ShutdownLinuxComponent};
@@ -1 +0,0 @@
1
- import{B as D,C as I,D as E,Ea as k,L as K,O as L,X as O,_ as A,_c as H,a as w,e as G,fa as u,ia as B,ka as o,n as T,r as m,rb as z,t as h,x as S}from"./chunk-V2MV6MJL.js";var J=G((Fe,oe)=>{oe.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.6.1",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:{"hb-service":"dist/bin/hb-service.js"},engines:{node:"^20.19.0 || ^22.12.0 || ^24.0.0",homebridge:"^1.8.0 || ^2.0.0-alpha.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.2.1","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.2","@homebridge/node-pty-prebuilt-multiarch":"0.13.1","@nestjs/axios":"4.0.1","@nestjs/common":"11.1.6","@nestjs/core":"11.1.6","@nestjs/jwt":"11.0.0","@nestjs/passport":"11.0.5","@nestjs/platform-fastify":"11.1.6","@nestjs/platform-socket.io":"11.1.6","@nestjs/swagger":"11.2.0","@nestjs/websockets":"11.1.6",axios:"1.12.1","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.1",dayjs:"1.11.18",fastify:"5.6.0","fs-extra":"11.3.1",jsonwebtoken:"9.0.2",lodash:"4.17.21","node-cache":"5.1.2","node-schedule":"2.1.1",ora:"8.2.0",otplib:"12.0.1","p-limit":"7.1.1",passport:"0.7.0","passport-jwt":"4.0.1","reflect-metadata":"0.2.2",rxjs:"7.8.2",semver:"7.7.2",systeminformation:"5.27.9",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.3.0","@nestjs/testing":"^11.1.6","@prettier/plugin-xml":"^3.4.2","@types/fs-extra":"^11.0.4","@types/lodash":"^4.17.20","@types/node":"^24.3.3","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.1","@types/tail":"^2.2.3","@types/tcp-port-used":"^1.0.4","@types/unzipper":"^0.10.11","@vitest/coverage-v8":"^3.2.4",concurrently:"^9.2.1","eslint-plugin-format":"^1.0.1","form-data":"^4.0.4",nodemon:"^3.1.10",rimraf:"^6.0.1","ts-loader":"^9.5.4","ts-node":"^10.9.2","tsconfig-paths":"^4.2.0",typescript:"^5.9.2","unplugin-swc":"^1.5.7",vitest:"^3.2.4"},overrides:{"@nestjs/platform-fastify":{fastify:"5.6.0"}},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 v=class{},W=(()=>{class t{handle(e){return e.key}static \u0275fac=function(n){return new(n||t)};static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})(),f=class{},Z=(()=>{class t extends f{compile(e,n){return e}compileTranslations(e,n){return e}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(t)))(r||t)}})();static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})(),p=class{},Q=(()=>{class t extends p{getTranslation(e){return m({})}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(t)))(r||t)}})();static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})();function F(t,a){if(t===a)return!0;if(t===null||a===null)return!1;if(t!==t&&a!==a)return!0;let e=typeof t,n=typeof a,r;if(e==n&&e=="object")if(Array.isArray(t)){if(!Array.isArray(a))return!1;if((r=t.length)==a.length){for(let s=0;s<r;s++)if(!F(t[s],a[s]))return!1;return!0}}else{if(Array.isArray(a))return!1;if(l(t)&&l(a)){let s=Object.create(null);for(let i in t){if(!F(t[i],a[i]))return!1;s[i]=!0}for(let i in a)if(!(i in s)&&typeof a[i]<"u")return!1;return!0}}return!1}function c(t){return typeof t<"u"&&t!==null}function _(t){return t!==void 0}function l(t){return y(t)&&!d(t)&&t!==null}function y(t){return typeof t=="object"&&t!==null}function d(t){return Array.isArray(t)}function x(t){return typeof t=="string"}function X(t){return typeof t=="function"}function j(t){if(d(t))return t.map(a=>j(a));if(l(t)){let a={};return Object.keys(t).forEach(e=>{a[e]=j(t[e])}),a}else return t}function V(t,a){if(!y(t))return j(a);let e=j(t);return y(e)&&y(a)&&Object.keys(a).forEach(n=>{l(a[n])?n in t?e[n]=V(t[n],a[n]):Object.assign(e,{[n]:a[n]}):Object.assign(e,{[n]:a[n]})}),e}function $(t,a){let e=a.split(".");a="";do{a+=e.shift();let n=!e.length;if(c(t)){if(l(t)&&_(t[a])&&(l(t[a])||d(t[a])||n)){t=t[a],a="";continue}if(d(t)){let r=parseInt(a,10);if(_(t[r])&&(l(t[r])||d(t[r])||n)){t=t[r],a="";continue}}}if(n){t=void 0;continue}a+="."}while(e.length);return t}function Y(t,a,e){return V(t,ee(a,e))}function ee(t,a){return t.split(".").reduceRight((e,n)=>({[n]:e}),a)}var b=class{},te=(()=>{class t extends b{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,n){if(x(e))return this.interpolateString(e,n);if(X(e))return this.interpolateFunction(e,n)}interpolateFunction(e,n){return e(n)}interpolateString(e,n){return n?e.replace(this.templateMatcher,(r,s)=>{let i=this.getInterpolationReplacement(n,s);return i!==void 0?i:r}):e}getInterpolationReplacement(e,n){return this.formatValue($(e,n))}formatValue(e){if(x(e))return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(e===null)return"null";if(d(e))return e.join(", ");if(y(e))return typeof e.toString=="function"&&e.toString!==Object.prototype.toString?e.toString():JSON.stringify(e)}static \u0275fac=(()=>{let e;return function(r){return(e||(e=k(t)))(r||t)}})();static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})(),P=(()=>{class t{_onTranslationChange=new T;_onLangChange=new T;_onFallbackLangChange=new T;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(e){return this.translations[e]}setTranslations(e,n,r){this.translations[e]=r&&this.hasTranslationFor(e)?V(this.translations[e],n):n,this.addLanguages([e]),this._onTranslationChange.next({lang:e,translations:this.getTranslations(e)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(e,n=!0){this.fallbackLang=e,n&&this._onFallbackLangChange.next({lang:e,translations:this.translations[e]})}setCurrentLang(e,n=!0){this.currentLang=e,n&&this._onLangChange.next({lang:e,translations:this.translations[e]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(e){this.languages=Array.from(new Set([...this.languages,...e]))}hasTranslationFor(e){return typeof this.translations[e]<"u"}deleteTranslations(e){delete this.translations[e]}getTranslation(e){let n=this.getValue(this.currentLang,e);return n===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(n=this.getValue(this.fallbackLang,e)),n}getValue(e,n){return $(this.getTranslations(e),n)}static \u0275fac=function(n){return new(n||t)};static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})(),R=new B("TRANSLATE_CONFIG"),C=t=>h(t)?t:m(t);var M=(()=>{class t{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=o(p);compiler=o(f);parser=o(b);missingTranslationHandler=o(v);store=o(P);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let e=w({extend:!1,fallbackLang:null},o(R,{optional:!0}));e.lang&&this.use(e.lang),e.fallbackLang&&this.setFallbackLang(e.fallbackLang),e.extend&&(this.extend=!0)}setFallbackLang(e){this.getFallbackLang()||this.store.setFallbackLang(e,!1);let n=this.loadOrExtendLanguage(e);return h(n)?(n.pipe(L(1)).subscribe({next:()=>{this.store.setFallbackLang(e)},error:()=>{}}),n):(this.store.setFallbackLang(e),m(this.store.getTranslations(e)))}use(e){this.lastUseLanguage=e,this.getCurrentLang()||this.store.setCurrentLang(e,!1);let n=this.loadOrExtendLanguage(e);return h(n)?(n.pipe(L(1)).subscribe({next:()=>{this.changeLang(e)},error:()=>{}}),n):(this.changeLang(e),m(this.store.getTranslations(e)))}loadOrExtendLanguage(e){if(!this.store.hasTranslationFor(e)||this.extend)return this._translationRequests[e]=this._translationRequests[e]||this.loadAndCompileTranslations(e),this._translationRequests[e]}changeLang(e){e===this.lastUseLanguage&&this.store.setCurrentLang(e)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(e){this.pending=!0;let n=this.currentLoader.getTranslation(e).pipe(O(1),L(1));return this.loadingTranslations=n.pipe(S(r=>this.compiler.compileTranslations(r,e)),O(1),L(1)),this.loadingTranslations.subscribe({next:r=>{this.store.setTranslations(e,r,this.extend),this.pending=!1},error:r=>{this.pending=!1}}),n}setTranslation(e,n,r=!1){let s=this.compiler.compileTranslations(n,e);this.store.setTranslations(e,s,r||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(e){this.store.addLanguages(e)}getParsedResultForKey(e,n){let r=this.getTextToInterpolate(e);if(c(r))return this.runInterpolation(r,n);let s=this.missingTranslationHandler.handle(w({key:e,translateService:this},n!==void 0&&{interpolateParams:n}));return s!==void 0?s:e}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(e){return this.store.getTranslation(e)}runInterpolation(e,n){if(c(e))return d(e)?this.runInterpolationOnArray(e,n):l(e)?this.runInterpolationOnDict(e,n):this.parser.interpolate(e,n)}runInterpolationOnArray(e,n){return e.map(r=>this.runInterpolation(r,n))}runInterpolationOnDict(e,n){let r={};for(let s in e){let i=this.runInterpolation(e[s],n);i!==void 0&&(r[s]=i)}return r}getParsedResult(e,n){return e instanceof Array?this.getParsedResultForArray(e,n):this.getParsedResultForKey(e,n)}getParsedResultForArray(e,n){let r={},s=!1;for(let g of e)r[g]=this.getParsedResultForKey(g,n),s=s||h(r[g]);if(!s)return r;let i=e.map(g=>C(r[g]));return E(i).pipe(S(g=>{let N={};return g.forEach((U,q)=>{N[e[q]]=U}),N}))}get(e,n){if(!c(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(K(()=>C(this.getParsedResult(e,n)))):C(this.getParsedResult(e,n))}getStreamOnTranslationChange(e,n){if(!c(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return D(I(()=>this.get(e,n)),this.onTranslationChange.pipe(A(()=>{let r=this.getParsedResult(e,n);return C(r)})))}stream(e,n){if(!c(e)||!e.length)throw new Error('Parameter "key" required');return D(I(()=>this.get(e,n)),this.onLangChange.pipe(A(()=>{let r=this.getParsedResult(e,n);return C(r)})))}instant(e,n){if(!c(e)||e.length===0)throw new Error('Parameter "key" is required and cannot be empty');let r=this.getParsedResult(e,n);return h(r)?Array.isArray(e)?e.reduce((s,i)=>(s[i]=i,s),{}):e:r}set(e,n,r=this.getCurrentLang()){this.store.setTranslations(r,Y(this.store.getTranslations(r),e,x(n)?this.compiler.compile(n,r):this.compiler.compileTranslations(n,r)),!1)}reloadLang(e){return this.resetLang(e),this.loadAndCompileTranslations(e)}resetLang(e){delete this._translationRequests[e],this.store.deleteTranslations(e)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let e=this.getBrowserCultureLang();return e?e.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return t.getBrowserLang()}getBrowserCultureLang(){return t.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(e){return this.setFallbackLang(e)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(n){return new(n||t)};static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})();var ve=(()=>{class t{translate=o(M);_ref=o(H);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(e,n,r){let s=i=>{this.value=i!==void 0?i:e,this.lastKey=e,this._ref.markForCheck()};if(r){let i=this.translate.getParsedResult(e,n);h(i)?i.subscribe(s):s(i)}this.translate.get(e,n).subscribe(s)}transform(e,...n){if(!e||!e.length)return e;if(F(e,this.lastKey)&&F(n,this.lastParams))return this.value;let r;if(c(n[0])&&n.length)if(x(n[0])&&n[0].length){let s=n[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{r=JSON.parse(s)}catch(i){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${n[0]}`)}}else l(n[0])&&(r=n[0]);return this.lastKey=e,this.lastParams=n,this.updateValue(e,r),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(s=>{(this.lastKey&&s.lang===this.translate.getCurrentLang()||s.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(e,r,s.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(s=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,r,s.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,r))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=z({name:"translate",type:t,pure:!1});static \u0275prov=u({token:t,factory:t.\u0275fac})}return t})();function ne(t){return{provide:p,useClass:t}}function re(t){return{provide:f,useClass:t}}function ae(t){return{provide:b,useClass:t}}function se(t){return{provide:v,useClass:t}}function we(t={}){return ie(w({compiler:re(Z),parser:ae(te),loader:ne(Q),missingTranslationHandler:se(W)},t),!0)}function ie(t={},a){let e=[];t.loader&&e.push(t.loader),t.compiler&&e.push(t.compiler),t.parser&&e.push(t.parser),t.missingTranslationHandler&&e.push(t.missingTranslationHandler),a&&e.push(P),(t.useDefaultLang||t.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),t.useDefaultLang===!0&&t.defaultLanguage&&(t.fallbackLang=t.defaultLanguage));let n={fallbackLang:t.fallbackLang??null,lang:t.lang,extend:t.extend??!1};return e.push({provide:R,useValue:n}),e.push({provide:M,useClass:M,deps:[P,p,f,b,v,R]}),e}var xe={serverTarget:J().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"}};export{M as a,ve as b,we as c,xe as d};
@@ -1,2 +0,0 @@
1
- import{$c as yt,Bb as ft,Ca as De,Cb as oe,Db as se,Eb as Se,H as Ye,Ha as rt,Ia as Ae,Ja as nt,Ka as J,Kb as pt,L as Ze,Lb as mt,Ma as Ie,Oa as Oe,Pa as j,Qa as F,Ra as ot,S as Me,Sa as st,Ta as it,Ua as at,Va as ct,Wa as dt,Xa as lt,Ya as L,_ as We,a as U,ad as gt,ca as v,da as N,db as Y,ed as B,fa as E,fd as vt,ga as re,gb as ut,gd as Et,h as Te,ia as w,ja as d,k as we,ka as R,la as be,na as Ke,oa as qe,pa as Qe,pb as ne,r as Re,ua as et,vb as ht,vd as Tt,wa as _,wd as ie,x as G,xa as tt,xb as P,xd as ae,ya as _e,zd as wt}from"./chunk-V2MV6MJL.js";var V=class{},H=class{},O=class n{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 r=e.indexOf(":");if(r>0){let o=e.slice(0,r),s=e.slice(r+1).trim();this.addHeaderEntry(o,s)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,r)=>{this.addHeaderEntry(r,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,r])=>{this.setHeaderEntries(e,r)})}: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 n?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 n;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof n?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 r=t.value;if(typeof r=="string"&&(r=[r]),r.length===0)return;this.maybeSetNormalizedName(t.name,e);let o=(t.op==="a"?this.headers.get(e):void 0)||[];o.push(...r),this.headers.set(e,o);break;case"d":let s=t.value;if(!s)this.headers.delete(e),this.normalizedNames.delete(e);else{let i=this.headers.get(e);if(!i)return;i=i.filter(c=>s.indexOf(c)===-1),i.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,i)}break}}addHeaderEntry(t,e){let r=t.toLowerCase();this.maybeSetNormalizedName(t,r),this.headers.has(r)?this.headers.get(r).push(e):this.headers.set(r,[e])}setHeaderEntries(t,e){let r=(Array.isArray(e)?e:[e]).map(s=>s.toString()),o=t.toLowerCase();this.headers.set(o,r),this.maybeSetNormalizedName(t,o)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var le=class{encodeKey(t){return Rt(t)}encodeValue(t){return Rt(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function Zt(n,t){let e=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(o=>{let s=o.indexOf("="),[i,c]=s==-1?[t.decodeKey(o),""]:[t.decodeKey(o.slice(0,s)),t.decodeValue(o.slice(s+1))],a=e.get(i)||[];a.push(c),e.set(i,a)}),e}var Wt=/%(\d[a-f0-9])/gi,Kt={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function Rt(n){return encodeURIComponent(n).replace(Wt,(t,e)=>Kt[e]??t)}function ce(n){return`${n}`}var C=class n{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new le,t.fromString){if(t.fromObject)throw new v(2805,!1);this.map=Zt(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let r=t.fromObject[e],o=Array.isArray(r)?r.map(ce):[ce(r)];this.map.set(e,o)})):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(r=>{let o=t[r];Array.isArray(o)?o.forEach(s=>{e.push({param:r,value:s,op:"a"})}):e.push({param:r,value:o,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(r=>e+"="+this.encoder.encodeValue(r)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new n({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(ce(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let r=this.map.get(t.param)||[],o=r.indexOf(ce(t.value));o!==-1&&r.splice(o,1),r.length>0?this.map.set(t.param,r):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var ue=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 qt(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function Mt(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function bt(n){return typeof Blob<"u"&&n instanceof Blob}function _t(n){return typeof FormData<"u"&&n instanceof FormData}function Qt(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}var Z="Content-Type",he="Accept",Le="X-Request-URL",It="text/plain",Ot="application/json",St=`${Ot}, ${It}, */*`,z=class n{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;credentials;keepalive=!1;cache;priority;mode;redirect;referrer;integrity;responseType="json";method;params;urlWithParams;transferCache;timeout;constructor(t,e,r,o){this.url=e,this.method=t.toUpperCase();let s;if(qt(this.method)||o?(this.body=r!==void 0?r:null,s=o):s=r,s){if(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,this.keepalive=!!s.keepalive,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),s.priority&&(this.priority=s.priority),s.cache&&(this.cache=s.cache),s.credentials&&(this.credentials=s.credentials),typeof s.timeout=="number"){if(s.timeout<1||!Number.isInteger(s.timeout))throw new v(2822,"");this.timeout=s.timeout}s.mode&&(this.mode=s.mode),s.redirect&&(this.redirect=s.redirect),s.integrity&&(this.integrity=s.integrity),s.referrer&&(this.referrer=s.referrer),this.transferCache=s.transferCache}if(this.headers??=new O,this.context??=new ue,!this.params)this.params=new C,this.urlWithParams=e;else{let i=this.params.toString();if(i.length===0)this.urlWithParams=e;else{let c=e.indexOf("?"),a=c===-1?"?":c<e.length-1?"&":"";this.urlWithParams=e+a+i}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||Mt(this.body)||bt(this.body)||_t(this.body)||Qt(this.body)?this.body:this.body instanceof C?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||_t(this.body)?null:bt(this.body)?this.body.type||null:Mt(this.body)?null:typeof this.body=="string"?It:this.body instanceof C?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?Ot:null}clone(t={}){let e=t.method||this.method,r=t.url||this.url,o=t.responseType||this.responseType,s=t.keepalive??this.keepalive,i=t.priority||this.priority,c=t.cache||this.cache,a=t.mode||this.mode,l=t.redirect||this.redirect,f=t.credentials||this.credentials,p=t.referrer||this.referrer,m=t.integrity||this.integrity,T=t.transferCache??this.transferCache,y=t.timeout??this.timeout,M=t.body!==void 0?t.body:this.body,u=t.withCredentials??this.withCredentials,h=t.reportProgress??this.reportProgress,b=t.headers||this.headers,D=t.params||this.params,g=t.context??this.context;return t.setHeaders!==void 0&&(b=Object.keys(t.setHeaders).reduce((A,S)=>A.set(S,t.setHeaders[S]),b)),t.setParams&&(D=Object.keys(t.setParams).reduce((A,S)=>A.set(S,t.setParams[S]),D)),new n(e,r,M,{params:D,headers:b,context:g,reportProgress:h,responseType:o,withCredentials:u,transferCache:T,keepalive:s,cache:c,priority:i,timeout:y,mode:a,redirect:l,credentials:f,referrer:p,integrity:m})}},k=(function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n})(k||{}),$=class{headers;status;statusText;url;ok;type;redirected;constructor(t,e=200,r="OK"){this.headers=t.headers||new O,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||r,this.url=t.url||null,this.redirected=t.redirected,this.ok=this.status>=200&&this.status<300}},W=class n extends ${constructor(t={}){super(t)}type=k.ResponseHeader;clone(t={}){return new n({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})}},X=class n extends ${body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=k.Response;clone(t={}){return new n({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,redirected:t.redirected??this.redirected})}},I=class extends ${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}},Nt=200,er=204;function Ne(n,t){return{body:t,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,credentials:n.credentials,transferCache:n.transferCache,timeout:n.timeout,keepalive:n.keepalive,priority:n.priority,cache:n.cache,mode:n.mode,redirect:n.redirect,integrity:n.integrity,referrer:n.referrer}}var Pt=(()=>{class n{handler;constructor(e){this.handler=e}request(e,r,o={}){let s;if(e instanceof z)s=e;else{let a;o.headers instanceof O?a=o.headers:a=new O(o.headers);let l;o.params&&(o.params instanceof C?l=o.params:l=new C({fromObject:o.params})),s=new z(e,r,o.body!==void 0?o.body:null,{headers:a,context:o.context,params:l,reportProgress:o.reportProgress,responseType:o.responseType||"json",withCredentials:o.withCredentials,transferCache:o.transferCache,keepalive:o.keepalive,priority:o.priority,cache:o.cache,mode:o.mode,redirect:o.redirect,credentials:o.credentials,referrer:o.referrer,integrity:o.integrity,timeout:o.timeout})}let i=Re(s).pipe(Ze(a=>this.handler.handle(a)));if(e instanceof z||o.observe==="events")return i;let c=i.pipe(Ye(a=>a instanceof X));switch(o.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return c.pipe(G(a=>{if(a.body!==null&&!(a.body instanceof ArrayBuffer))throw new v(2806,!1);return a.body}));case"blob":return c.pipe(G(a=>{if(a.body!==null&&!(a.body instanceof Blob))throw new v(2807,!1);return a.body}));case"text":return c.pipe(G(a=>{if(a.body!==null&&typeof a.body!="string")throw new v(2808,!1);return a.body}));case"json":default:return c.pipe(G(a=>a.body))}case"response":return c;default:throw new v(2809,!1)}}delete(e,r={}){return this.request("DELETE",e,r)}get(e,r={}){return this.request("GET",e,r)}head(e,r={}){return this.request("HEAD",e,r)}jsonp(e,r){return this.request("JSONP",e,{params:new C().append(r,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,r={}){return this.request("OPTIONS",e,r)}patch(e,r,o={}){return this.request("PATCH",e,Ne(o,r))}post(e,r,o={}){return this.request("POST",e,Ne(o,r))}put(e,r,o={}){return this.request("PUT",e,Ne(o,r))}static \u0275fac=function(r){return new(r||n)(d(V))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),tr=/^\)\]\}',?\n/;function Dt(n){if(n.url)return n.url;let t=Le.toLocaleLowerCase();return n.headers.get(t)}var Ct=new w(""),de=(()=>{class n{fetchImpl=R(Pe,{optional:!0})?.fetch??((...e)=>globalThis.fetch(...e));ngZone=R(P);destroyRef=R(tt);destroyed=!1;constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0})}handle(e){return new we(r=>{let o=new AbortController;this.doRequest(e,o.signal,r).then(Ce,i=>r.error(new I({error:i})));let s;return e.timeout&&(s=this.ngZone.runOutsideAngular(()=>setTimeout(()=>{o.signal.aborted||o.abort(new DOMException("signal timed out","TimeoutError"))},e.timeout))),()=>{s!==void 0&&clearTimeout(s),o.abort()}})}doRequest(e,r,o){return Te(this,null,function*(){let s=this.createRequestInit(e),i;try{let y=this.ngZone.runOutsideAngular(()=>this.fetchImpl(e.urlWithParams,U({signal:r},s)));rr(y),o.next({type:k.Sent}),i=yield y}catch(y){o.error(new I({error:y,status:y.status??0,statusText:y.statusText,url:e.urlWithParams,headers:y.headers}));return}let c=new O(i.headers),a=i.statusText,l=Dt(i)??e.urlWithParams,f=i.status,p=null;if(e.reportProgress&&o.next(new W({headers:c,status:f,statusText:a,url:l})),i.body){let y=i.headers.get("content-length"),M=[],u=i.body.getReader(),h=0,b,D,g=typeof Zone<"u"&&Zone.current,A=!1;if(yield this.ngZone.runOutsideAngular(()=>Te(this,null,function*(){for(;;){if(this.destroyed){yield u.cancel(),A=!0;break}let{done:x,value:Ee}=yield u.read();if(x)break;if(M.push(Ee),h+=Ee.length,e.reportProgress){D=e.responseType==="text"?(D??"")+(b??=new TextDecoder).decode(Ee,{stream:!0}):void 0;let Je=()=>o.next({type:k.DownloadProgress,total:y?+y:void 0,loaded:h,partialText:D});g?g.run(Je):Je()}}})),A){o.complete();return}let S=this.concatChunks(M,h);try{let x=i.headers.get(Z)??"";p=this.parseBody(e,S,x,f)}catch(x){o.error(new I({error:x,headers:new O(i.headers),status:i.status,statusText:i.statusText,url:Dt(i)??e.urlWithParams}));return}}f===0&&(f=p?Nt:0);let m=f>=200&&f<300,T=i.redirected;m?(o.next(new X({body:p,headers:c,status:f,statusText:a,url:l,redirected:T})),o.complete()):o.error(new I({error:p,headers:c,status:f,statusText:a,url:l,redirected:T}))})}parseBody(e,r,o,s){switch(e.responseType){case"json":let i=new TextDecoder().decode(r).replace(tr,"");if(i==="")return null;try{return JSON.parse(i)}catch(c){if(s<200||s>=300)return i;throw c}case"text":return new TextDecoder().decode(r);case"blob":return new Blob([r],{type:o});case"arraybuffer":return r.buffer}}createRequestInit(e){let r={},o;if(o=e.credentials,e.withCredentials&&(o="include"),e.headers.forEach((s,i)=>r[s]=i.join(",")),e.headers.has(he)||(r[he]=St),!e.headers.has(Z)){let s=e.detectContentTypeHeader();s!==null&&(r[Z]=s)}return{body:e.serializeBody(),method:e.method,headers:r,credentials:o,keepalive:e.keepalive,cache:e.cache,priority:e.priority,mode:e.mode,redirect:e.redirect,referrer:e.referrer,integrity:e.integrity}}concatChunks(e,r){let o=new Uint8Array(r),s=0;for(let i of e)o.set(i,s),s+=i.length;return o}static \u0275fac=function(r){return new(r||n)};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),Pe=class{};function Ce(){}function rr(n){n.then(Ce,Ce)}function kt(n,t){return t(n)}function nr(n,t){return(e,r)=>t.intercept(e,{handle:o=>n(o,r)})}function or(n,t,e){return(r,o)=>Qe(e,()=>t(r,s=>n(s,o)))}var xt=new w(""),Ue=new w(""),Lt=new w(""),je=new w("",{providedIn:"root",factory:()=>!0});function sr(){let n=null;return(t,e)=>{n===null&&(n=(R(xt,{optional:!0})??[]).reduceRight(nr,kt));let r=R(De);if(R(je)){let s=r.add();return n(t,e).pipe(Me(s))}else return n(t,e)}}var fe=(()=>{class n extends V{backend;injector;chain=null;pendingTasks=R(De);contributeToStability=R(je);constructor(e,r){super(),this.backend=e,this.injector=r}handle(e){if(this.chain===null){let r=Array.from(new Set([...this.injector.get(Ue),...this.injector.get(Lt,[])]));this.chain=r.reduceRight((o,s)=>or(o,s,this.injector),kt)}if(this.contributeToStability){let r=this.pendingTasks.add();return this.chain(e,o=>this.backend.handle(o)).pipe(Me(r))}else return this.chain(e,r=>this.backend.handle(r))}static \u0275fac=function(r){return new(r||n)(d(H),d(qe))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})();var ir=/^\)\]\}',?\n/,ar=RegExp(`^${Le}:`,"m");function cr(n){return"responseURL"in n&&n.responseURL?n.responseURL:ar.test(n.getAllResponseHeaders())?n.getResponseHeader(Le):null}var ke=(()=>{class n{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new v(-2800,!1);let r=this.xhrFactory;return Re(null).pipe(We(()=>new we(s=>{let i=r.build();if(i.open(e.method,e.urlWithParams),e.withCredentials&&(i.withCredentials=!0),e.headers.forEach((u,h)=>i.setRequestHeader(u,h.join(","))),e.headers.has(he)||i.setRequestHeader(he,St),!e.headers.has(Z)){let u=e.detectContentTypeHeader();u!==null&&i.setRequestHeader(Z,u)}if(e.timeout&&(i.timeout=e.timeout),e.responseType){let u=e.responseType.toLowerCase();i.responseType=u!=="json"?u:"text"}let c=e.serializeBody(),a=null,l=()=>{if(a!==null)return a;let u=i.statusText||"OK",h=new O(i.getAllResponseHeaders()),b=cr(i)||e.url;return a=new W({headers:h,status:i.status,statusText:u,url:b}),a},f=()=>{let{headers:u,status:h,statusText:b,url:D}=l(),g=null;h!==er&&(g=typeof i.response>"u"?i.responseText:i.response),h===0&&(h=g?Nt:0);let A=h>=200&&h<300;if(e.responseType==="json"&&typeof g=="string"){let S=g;g=g.replace(ir,"");try{g=g!==""?JSON.parse(g):null}catch(x){g=S,A&&(A=!1,g={error:x,text:g})}}A?(s.next(new X({body:g,headers:u,status:h,statusText:b,url:D||void 0})),s.complete()):s.error(new I({error:g,headers:u,status:h,statusText:b,url:D||void 0}))},p=u=>{let{url:h}=l(),b=new I({error:u,status:i.status||0,statusText:i.statusText||"Unknown Error",url:h||void 0});s.error(b)},m=p;e.timeout&&(m=u=>{let{url:h}=l(),b=new I({error:new DOMException("Request timed out","TimeoutError"),status:i.status||0,statusText:i.statusText||"Request timeout",url:h||void 0});s.error(b)});let T=!1,y=u=>{T||(s.next(l()),T=!0);let h={type:k.DownloadProgress,loaded:u.loaded};u.lengthComputable&&(h.total=u.total),e.responseType==="text"&&i.responseText&&(h.partialText=i.responseText),s.next(h)},M=u=>{let h={type:k.UploadProgress,loaded:u.loaded};u.lengthComputable&&(h.total=u.total),s.next(h)};return i.addEventListener("load",f),i.addEventListener("error",p),i.addEventListener("timeout",m),i.addEventListener("abort",p),e.reportProgress&&(i.addEventListener("progress",y),c!==null&&i.upload&&i.upload.addEventListener("progress",M)),i.send(c),s.next({type:k.Sent}),()=>{i.removeEventListener("error",p),i.removeEventListener("abort",p),i.removeEventListener("load",f),i.removeEventListener("timeout",m),e.reportProgress&&(i.removeEventListener("progress",y),c!==null&&i.upload&&i.upload.removeEventListener("progress",M)),i.readyState!==i.DONE&&i.abort()}})))}static \u0275fac=function(r){return new(r||n)(d(ae))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),Ut=new w(""),dr="XSRF-TOKEN",lr=new w("",{providedIn:"root",factory:()=>dr}),ur="X-XSRF-TOKEN",hr=new w("",{providedIn:"root",factory:()=>ur}),K=class{},fr=(()=>{class n{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,r){this.doc=e,this.cookieName=r}getToken(){let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=ie(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(r){return new(r||n)(d(_),d(lr))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})();function pr(n,t){let e=n.url.toLowerCase();if(!R(Ut)||n.method==="GET"||n.method==="HEAD"||e.startsWith("http://")||e.startsWith("https://"))return t(n);let r=R(K).getToken(),o=R(hr);return r!=null&&!n.headers.has(o)&&(n=n.clone({headers:n.headers.set(o,r)})),t(n)}var pe=(function(n){return n[n.Interceptors=0]="Interceptors",n[n.LegacyInterceptors=1]="LegacyInterceptors",n[n.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",n[n.NoXsrfProtection=3]="NoXsrfProtection",n[n.JsonpSupport=4]="JsonpSupport",n[n.RequestsMadeViaParent=5]="RequestsMadeViaParent",n[n.Fetch=6]="Fetch",n})(pe||{});function jt(n,t){return{\u0275kind:n,\u0275providers:t}}function mr(...n){let t=[Pt,ke,fe,{provide:V,useExisting:fe},{provide:H,useFactory:()=>R(Ct,{optional:!0})??R(ke)},{provide:Ue,useValue:pr,multi:!0},{provide:Ut,useValue:!0},{provide:K,useClass:fr}];for(let e of n)t.push(...e.\u0275providers);return be(t)}var At=new w("");function yr(){return jt(pe.LegacyInterceptors,[{provide:At,useFactory:sr},{provide:Ue,useExisting:At,multi:!0}])}function gr(){return jt(pe.Fetch,[de,{provide:Ct,useExisting:de},{provide:H,useExisting:de}])}var ye=new w(""),He=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(e,r){this._zone=r,e.forEach(o=>{o.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,r,o,s){return this._findPluginFor(r).addEventListener(e,r,o,s)}getZone(){return this._zone}_findPluginFor(e){let r=this._eventNameToPlugin.get(e);if(r)return r;if(r=this._plugins.find(s=>s.supports(e)),!r)throw new v(5101,!1);return this._eventNameToPlugin.set(e,r),r}static \u0275fac=function(r){return new(r||n)(d(ye),d(P))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),q=class{_doc;constructor(t){this._doc=t}manager},Fe="ng-app-id";function Ft(n){for(let t of n)t.remove()}function Bt(n,t){let e=t.createElement("style");return e.textContent=n,e}function vr(n,t,e,r){let o=n.head?.querySelectorAll(`style[${Fe}="${t}"],link[${Fe}="${t}"]`);if(o)for(let s of o)s.removeAttribute(Fe),s instanceof HTMLLinkElement?r.set(s.href.slice(s.href.lastIndexOf("/")+1),{usage:0,elements:[s]}):s.textContent&&e.set(s.textContent,{usage:0,elements:[s]})}function ze(n,t){let e=t.createElement("link");return e.setAttribute("rel","stylesheet"),e.setAttribute("href",n),e}var $e=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;constructor(e,r,o,s={}){this.doc=e,this.appId=r,this.nonce=o,vr(e,r,this.inline,this.external),this.hosts.add(e.head)}addStyles(e,r){for(let o of e)this.addUsage(o,this.inline,Bt);r?.forEach(o=>this.addUsage(o,this.external,ze))}removeStyles(e,r){for(let o of e)this.removeUsage(o,this.inline);r?.forEach(o=>this.removeUsage(o,this.external))}addUsage(e,r,o){let s=r.get(e);s?s.usage++:r.set(e,{usage:1,elements:[...this.hosts].map(i=>this.addElement(i,o(e,this.doc)))})}removeUsage(e,r){let o=r.get(e);o&&(o.usage--,o.usage<=0&&(Ft(o.elements),r.delete(e)))}ngOnDestroy(){for(let[,{elements:e}]of[...this.inline,...this.external])Ft(e);this.hosts.clear()}addHost(e){this.hosts.add(e);for(let[r,{elements:o}]of this.inline)o.push(this.addElement(e,Bt(r,this.doc)));for(let[r,{elements:o}]of this.external)o.push(this.addElement(e,ze(r,this.doc)))}removeHost(e){this.hosts.delete(e)}addElement(e,r){return this.nonce&&r.setAttribute("nonce",this.nonce),e.appendChild(r)}static \u0275fac=function(r){return new(r||n)(d(_),d(Ae),d(Ie,8),d(J))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),Be={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"},Xe=/%COMP%/g;var Vt="%COMP%",Er=`_nghost-${Vt}`,Tr=`_ngcontent-${Vt}`,wr=!0,Rr=new w("",{providedIn:"root",factory:()=>wr});function Mr(n){return Tr.replace(Xe,n)}function br(n){return Er.replace(Xe,n)}function Ht(n,t){return t.map(e=>e.replace(Xe,n))}var Ge=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;animationDisabled;maxAnimationTimeout;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;registry;constructor(e,r,o,s,i,c,a,l=null,f,p,m=null){this.eventManager=e,this.sharedStylesHost=r,this.appId=o,this.removeStylesOnCompDestroy=s,this.doc=i,this.platformId=c,this.ngZone=a,this.nonce=l,this.animationDisabled=f,this.maxAnimationTimeout=p,this.tracingService=m,this.platformIsServer=!1,this.defaultRenderer=new Q(e,i,a,this.platformIsServer,this.tracingService,this.registry=et(),this.maxAnimationTimeout)}createRenderer(e,r){if(!e||!r)return this.defaultRenderer;let o=this.getOrCreateRenderer(e,r);return o instanceof me?o.applyToHost(e):o instanceof ee&&o.applyStyles(),o}getOrCreateRenderer(e,r){let o=this.rendererByCompId,s=o.get(r.id);if(!s){let i=this.doc,c=this.ngZone,a=this.eventManager,l=this.sharedStylesHost,f=this.removeStylesOnCompDestroy,p=this.platformIsServer,m=this.tracingService;switch(r.encapsulation){case Oe.Emulated:s=new me(a,l,r,this.appId,f,i,c,p,m,this.registry,this.animationDisabled,this.maxAnimationTimeout);break;case Oe.ShadowDom:return new Ve(a,l,e,r,i,c,this.nonce,p,m,this.registry,this.maxAnimationTimeout);default:s=new ee(a,l,r,f,i,c,p,m,this.registry,this.animationDisabled,this.maxAnimationTimeout);break}o.set(r.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(e){this.rendererByCompId.delete(e)}static \u0275fac=function(r){return new(r||n)(d(He),d($e),d(Ae),d(Rr),d(_),d(J),d(P),d(Ie),d(pt),d(mt),d(ht,8))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),Q=class{eventManager;doc;ngZone;platformIsServer;tracingService;registry;maxAnimationTimeout;data=Object.create(null);throwOnSyntheticProps=!0;constructor(t,e,r,o,s,i,c){this.eventManager=t,this.doc=e,this.ngZone=r,this.platformIsServer=o,this.tracingService=s,this.registry=i,this.maxAnimationTimeout=c}destroy(){}destroyNode=null;createElement(t,e){return e?this.doc.createElementNS(Be[e]||e,t):this.doc.createElement(t)}createComment(t){return this.doc.createComment(t)}createText(t){return this.doc.createTextNode(t)}appendChild(t,e){(zt(t)?t.content:t).appendChild(e)}insertBefore(t,e,r){t&&(zt(t)?t.content:t).insertBefore(e,r)}removeChild(t,e){let{elements:r}=this.registry;if(r){r.animate(e,()=>e.remove(),this.maxAnimationTimeout);return}e.remove()}selectRootElement(t,e){let r=typeof t=="string"?this.doc.querySelector(t):t;if(!r)throw new v(-5104,!1);return e||(r.textContent=""),r}parentNode(t){return t.parentNode}nextSibling(t){return t.nextSibling}setAttribute(t,e,r,o){if(o){e=o+":"+e;let s=Be[o];s?t.setAttributeNS(s,e,r):t.setAttribute(e,r)}else t.setAttribute(e,r)}removeAttribute(t,e,r){if(r){let o=Be[r];o?t.removeAttributeNS(o,e):t.removeAttribute(`${r}:${e}`)}else t.removeAttribute(e)}addClass(t,e){t.classList.add(e)}removeClass(t,e){t.classList.remove(e)}setStyle(t,e,r,o){o&(Y.DashCase|Y.Important)?t.style.setProperty(e,r,o&Y.Important?"important":""):t.style[e]=r}removeStyle(t,e,r){r&Y.DashCase?t.style.removeProperty(e):t.style[e]=""}setProperty(t,e,r){t!=null&&(t[e]=r)}setValue(t,e){t.nodeValue=e}listen(t,e,r,o){if(typeof t=="string"&&(t=B().getGlobalEventTarget(this.doc,t),!t))throw new v(5102,!1);let s=this.decoratePreventDefault(r);return this.tracingService?.wrapEventListener&&(s=this.tracingService.wrapEventListener(t,e,s)),this.eventManager.addEventListener(t,e,s,o)}decoratePreventDefault(t){return e=>{if(e==="__ngUnwrap__")return t;t(e)===!1&&e.preventDefault()}}};function zt(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var Ve=class extends Q{sharedStylesHost;hostEl;shadowRoot;constructor(t,e,r,o,s,i,c,a,l,f,p){super(t,s,i,a,l,f,p),this.sharedStylesHost=e,this.hostEl=r,this.shadowRoot=r.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let m=o.styles;m=Ht(o.id,m);for(let y of m){let M=document.createElement("style");c&&M.setAttribute("nonce",c),M.textContent=y,this.shadowRoot.appendChild(M)}let T=o.getExternalStyles?.();if(T)for(let y of T){let M=ze(y,s);c&&M.setAttribute("nonce",c),this.shadowRoot.appendChild(M)}}nodeOrShadowRoot(t){return t===this.hostEl?this.shadowRoot:t}appendChild(t,e){return super.appendChild(this.nodeOrShadowRoot(t),e)}insertBefore(t,e,r){return super.insertBefore(this.nodeOrShadowRoot(t),e,r)}removeChild(t,e){return super.removeChild(null,e)}parentNode(t){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(t)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},ee=class extends Q{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;_animationDisabled;constructor(t,e,r,o,s,i,c,a,l,f,p,m){super(t,s,i,c,a,l,p),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=o,this._animationDisabled=f;let T=r.styles;this.styles=m?Ht(m,T):T,this.styleUrls=r.getExternalStyles?.(m)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){if(this.removeStylesOnCompDestroy){if(!this._animationDisabled&&this.registry.elements){this.ngZone.runOutsideAngular(()=>{setTimeout(()=>{this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)},this.maxAnimationTimeout)});return}this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}}},me=class extends ee{contentAttr;hostAttr;constructor(t,e,r,o,s,i,c,a,l,f,p,m){let T=o+"-"+r.id;super(t,e,r,s,i,c,a,l,f,p,m,T),this.contentAttr=Mr(T),this.hostAttr=br(T)}applyToHost(t){this.applyStyles(),this.setAttribute(t,this.hostAttr,"")}createElement(t,e){let r=super.createElement(t,e);return super.setAttribute(r,this.contentAttr,""),r}};var ge=class n extends Et{supportsDOMEvents=!0;static makeCurrent(){vt(new n)}onAndCancel(t,e,r,o){return t.addEventListener(e,r,o),()=>{t.removeEventListener(e,r,o)}}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=_r();return e==null?null:Dr(e)}resetBaseElement(){te=null}getUserAgent(){return window.navigator.userAgent}getCookie(t){return ie(document.cookie,t)}},te=null;function _r(){return te=te||document.head.querySelector("base"),te?te.getAttribute("href"):null}function Dr(n){return new URL(n,document.baseURI).pathname}var ve=class{addToWindow(t){N.getAngularTestability=(r,o=!0)=>{let s=t.findTestabilityInTree(r,o);if(s==null)throw new v(5103,!1);return s},N.getAllAngularTestabilities=()=>t.getAllTestabilities(),N.getAllAngularRootElements=()=>t.getAllRootElements();let e=r=>{let o=N.getAllAngularTestabilities(),s=o.length,i=function(){s--,s==0&&r()};o.forEach(c=>{c.whenStable(i)})};N.frameworkStabilizers||(N.frameworkStabilizers=[]),N.frameworkStabilizers.push(e)}findTestabilityInTree(t,e,r){if(e==null)return null;let o=t.getTestability(e);return o??(r?B().isShadowRoot(e)?this.findTestabilityInTree(t,e.host,!0):this.findTestabilityInTree(t,e.parentElement,!0):null)}},Ar=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(r){return new(r||n)};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),Xt=(()=>{class n extends q{constructor(e){super(e)}supports(e){return!0}addEventListener(e,r,o,s){return e.addEventListener(r,o,s),()=>this.removeEventListener(e,r,o,s)}removeEventListener(e,r,o,s){return e.removeEventListener(r,o,s)}static \u0275fac=function(r){return new(r||n)(d(_))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})(),$t=["alt","control","meta","shift"],Ir={"\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"},Or={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},Gt=(()=>{class n extends q{constructor(e){super(e)}supports(e){return n.parseEventName(e)!=null}addEventListener(e,r,o,s){let i=n.parseEventName(r),c=n.eventCallback(i.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>B().onAndCancel(e,i.domEventName,c,s))}static parseEventName(e){let r=e.toLowerCase().split("."),o=r.shift();if(r.length===0||!(o==="keydown"||o==="keyup"))return null;let s=n._normalizeKey(r.pop()),i="",c=r.indexOf("code");if(c>-1&&(r.splice(c,1),i="code."),$t.forEach(l=>{let f=r.indexOf(l);f>-1&&(r.splice(f,1),i+=l+".")}),i+=s,r.length!=0||s.length===0)return null;let a={};return a.domEventName=o,a.fullKey=i,a}static matchEventFullKeyCode(e,r){let o=Ir[e.key]||e.key,s="";return r.indexOf("code.")>-1&&(o=e.code,s="code."),o==null||!o?!1:(o=o.toLowerCase(),o===" "?o="space":o==="."&&(o="dot"),$t.forEach(i=>{if(i!==o){let c=Or[i];c(e)&&(s+=i+".")}}),s+=o,s===r)}static eventCallback(e,r,o){return s=>{n.matchEventFullKeyCode(s,e)&&o.runGuarded(()=>r(s))}}static _normalizeKey(e){return e==="esc"?"escape":e}static \u0275fac=function(r){return new(r||n)(d(_))};static \u0275prov=E({token:n,factory:n.\u0275fac})}return n})();function Sr(n,t,e){let r=U({rootComponent:n,platformRef:e?.platformRef},Nr(t));return gt(r)}function Nr(n){return{appProviders:[...Jt,...n?.providers??[]],platformProviders:xr}}function Pr(){ge.makeCurrent()}function Cr(){return new _e}function kr(){return rt(document),document}var xr=[{provide:J,useValue:wt},{provide:nt,useValue:Pr,multi:!0},{provide:_,useFactory:kr}];var Lr=[{provide:oe,useClass:ve},{provide:ft,useClass:se,deps:[P,Se,oe]},{provide:se,useClass:se,deps:[P,Se,oe]}],Jt=[{provide:Ke,useValue:"root"},{provide:_e,useFactory:Cr},{provide:ye,useClass:Xt,multi:!0,deps:[_]},{provide:ye,useClass:Gt,multi:!0,deps:[_]},Ge,$e,He,{provide:ut,useExisting:Ge},{provide:ae,useClass:Ar},[]],Ur=(()=>{class n{constructor(){}static \u0275fac=function(r){return new(r||n)};static \u0275mod=ne({type:n});static \u0275inj=re({providers:[...Jt,...Lr],imports:[Tt,yt]})}return n})();var no=(()=>{class n{_doc;constructor(e){this._doc=e}getTitle(){return this._doc.title}setTitle(e){this._doc.title=e||""}static \u0275fac=function(r){return new(r||n)(d(_))};static \u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Fr=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275prov=E({token:n,factory:function(r){let o=null;return r?o=new(r||n):o=d(Br),o},providedIn:"root"})}return n})(),Br=(()=>{class n extends Fr{_doc;constructor(e){super(),this._doc=e}sanitize(e,r){if(r==null)return null;switch(e){case L.NONE:return r;case L.HTML:return F(r,"HTML")?j(r):lt(this._doc,String(r)).toString();case L.STYLE:return F(r,"Style")?j(r):r;case L.SCRIPT:if(F(r,"Script"))return j(r);throw new v(5200,!1);case L.URL:return F(r,"URL")?j(r):dt(String(r));case L.RESOURCE_URL:if(F(r,"ResourceURL"))return j(r);throw new v(5201,!1);default:throw new v(5202,!1)}}bypassSecurityTrustHtml(e){return ot(e)}bypassSecurityTrustStyle(e){return st(e)}bypassSecurityTrustScript(e){return it(e)}bypassSecurityTrustUrl(e){return at(e)}bypassSecurityTrustResourceUrl(e){return ct(e)}static \u0275fac=function(r){return new(r||n)(d(_))};static \u0275prov=E({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{C as a,k as b,X as c,Pt as d,xt as e,mr as f,yr as g,gr as h,Ge as i,Sr as j,Ur as k,no as l,Fr as m};
@@ -1 +0,0 @@
1
- import{g as r}from"./chunk-BR6USPEJ.js";import"./chunk-OMPHX32Y.js";import{ga as t,pb as e}from"./chunk-V2MV6MJL.js";var u=[{path:"",loadComponent:()=>import("./chunk-HVB6HFMT.js").then(o=>o.LogsComponent)}],n=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[r.forChild(u),r]})}return o})();var p=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[n]})}return o})();export{p as LogsModule};
@@ -1 +0,0 @@
1
- import{b as n}from"./chunk-CSU4CRXM.js";import{d as u}from"./chunk-BR6USPEJ.js";import{b as m}from"./chunk-23H472HH.js";import{k as h}from"./chunk-BBLNIMTZ.js";import{a as c,d as f}from"./chunk-OBYXJY4V.js";import{fa as i,h as o,ka as r,w as s}from"./chunk-V2MV6MJL.js";var p=(()=>{class t{cache=null;CACHE_DURATION_MS=6e4;getToken(){let a=Date.now();if(this.cache&&a-this.cache.timestamp<this.CACHE_DURATION_MS)return this.cache.token;let e=window.localStorage.getItem(f.jwt.tokenKey);return this.cache={token:e,timestamp:a},e}invalidateCache(){this.cache=null}static \u0275fac=function(e){return new(e||t)};static \u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var $=(()=>{class t{$auth=r(n);$tokenCache=r(p);isAuthenticated(){return o(this,null,function*(){if(!this.$tokenCache.getToken())return this.$auth.token=null,this.$auth.user={},this.$tokenCache.invalidateCache(),!1;try{return this.$auth.isLoggedIn()}catch{return this.$auth.logout(),this.$tokenCache.invalidateCache(),!1}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var L=(()=>{class t{$auth=r(n);$authHelper=r($);$router=r(u);$settings=r(m);$translate=r(c);$toastr=r(h);canActivate(a,e){return o(this,null,function*(){return this.$settings.settingsLoaded||(yield s(this.$settings.onSettingsLoaded)),this.$settings.formAuth===!1?(yield this.$auth.noauth(),!0):(yield this.$authHelper.isAuthenticated())?this.$auth.user?.admin?!0:(this.$toastr.error(this.$translate.instant("toast.no_auth"),this.$translate.instant("toast.title_error")),yield this.$router.navigate(["/"]),!1):(window.sessionStorage.setItem("target_route",e.url),yield this.$router.navigate(["/login"]),!1)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=i({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{p as a,$ as b,L as c};
@@ -1 +0,0 @@
1
- import{a as H}from"./chunk-LSU6AEJS.js";import{a as X}from"./chunk-MSSNDMBK.js";import{a as Z}from"./chunk-2SMLTKN6.js";import"./chunk-TLGNUWU6.js";import{a as R}from"./chunk-IDW2S7VV.js";import{n as E}from"./chunk-Q5UJ7RBG.js";import"./chunk-GGZZFW2G.js";import{a as j}from"./chunk-ODN4SLC6.js";import{b as A}from"./chunk-CSU4CRXM.js";import{a as W,c as q,d as V,e as N,f as D}from"./chunk-BR6USPEJ.js";import{b as T}from"./chunk-23H472HH.js";import"./chunk-BBLNIMTZ.js";import{a as L,b as U,d as $}from"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{Cd as K,Gc as h,Hc as M,Jb as m,Mb as x,Nb as y,Nc as s,Oc as d,Sb as c,Tb as n,Ub as a,Vb as p,cb as o,cc as S,fc as _,g as Y,h as I,hb as F,hc as w,ka as u,md as O,ob as P,qa as b,ra as C,uc as g,vc as v,w as z}from"./chunk-V2MV6MJL.js";var Q=Y(Z(),1);function G(){var i;return typeof window<"u"&&(window?.matchMedia("(display-mode: standalone)").matches||((i=window.navigator)===null||i===void 0?void 0:i.standalone)||document.referrer.startsWith("android-app://")||window?.Windows||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var B=()=>["/"],te=i=>({"hamburger-icon-cross":i}),ne=i=>({expanded:i}),ie=()=>({exact:!0}),oe=()=>["/plugins"],re=()=>["/accessories"],ae=()=>["/logs"],se=()=>["/support"],de=()=>["/platform-tools/terminal"],le=()=>["/config"],pe=()=>["/settings"],ce=()=>["/power-options"];function me(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),s(3,"translate"),_("click",function(){b(e);let t=w();return C(t.openUnderVoltageModal())})("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(4,"div",12),p(5,"i",21),a(),n(6,"div",14),g(7),s(8,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"rpi.throttled.undervoltage_title")+" - "+d(3,4,"rpi.throttled.undervoltage_description")),o(6),v(d(8,6,"rpi.throttled.undervoltage_title")))}function ue(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",22),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,de))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.linux.label_terminal")),o(5),v(d(7,6,"menu.linux.label_terminal")))}function _e(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",23),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,le))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.config_json_editor")),o(5),v(d(7,6,"menu.config_json_editor")))}function ge(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",24),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,pe))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.label_settings")),o(5),v(d(7,6,"menu.label_settings")))}function fe(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",15),s(2,"translate"),_("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",25),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),c("routerLink",h(8,ce))("routerLinkActive","active"),m("aria-label",d(2,4,"menu.restart.title")),o(5),v(d(7,6,"menu.restart.title")))}function ve(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=w();return C(t.reloadPage())})("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",26),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.reload")),o(5),v(d(7,4,"menu.reload")))}function he(i,k){if(i&1){let e=S();n(0,"div",10)(1,"div",20),s(2,"translate"),_("click",function(){b(e);let t=w();return C(t.logout())})("keydown",function(t){b(e);let r=w();return C(r.handleKeydown(t))}),n(3,"div",12),p(4,"i",27),a(),n(5,"div",14),g(6),s(7,"translate"),a()()()}i&2&&(o(),m("aria-label",d(2,2,"menu.tooltip_logout")),o(5),v(d(7,4,"menu.tooltip_logout")))}var J=(()=>{class i{$auth=u(A);$settings=u(T);$modal=u(E);$notification=u(X);$renderer=u(F);$router=u(V);$translate=u(L);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(l=>{l instanceof W&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))})}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(r=>{r["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),r["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(r=>{this.formAuth=r});let e=document.querySelector(".sidebar"),l=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",r=>{if(t.contains(r.target)&&this.isExpanded){r.preventDefault(),this.toggleSidebar();return}!e.contains(r.target)&&!l.contains(r.target)&&this.isExpanded&&(r.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),l.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),l.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}),document.addEventListener("click",r=>{e.contains(r.target)&&r.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(H,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let l=e.target;["menuitem","button"].includes(l.getAttribute("role"))&&l.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeAllListeners(),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",()=>this.openSidebar(),{passive:!1}),e.addEventListener("mouseleave",()=>this.closeSidebar(),{passive:!1}))}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","../../../../assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-plug"],[1,"fa","fa-lightbulb"],[1,"fa","fa-wave-square"],[1,"fa","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-terminal"],[1,"fa","fa-code"],[1,"fa","fa-cog"],[1,"fa","fa-power-off"],[1,"fa","fa-refresh"],[1,"fa","fa-right-from-bracket"]],template:function(l,t){l&1&&(n(0,"div",0),s(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),p(2,"span",1),n(3,"a",2),s(4,"translate"),p(5,"img",3),n(6,"div",4),g(7,"Homebridge"),a()(),n(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),a()(),n(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),n(15,"a",2),s(16,"translate"),p(17,"img",3),n(18,"div",8),g(19,"Homebridge"),a()()(),n(20,"div",9)(21,"div",10)(22,"div",11),s(23,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),n(24,"div",12),p(25,"i",13),a(),n(26,"div",14),g(27),s(28,"translate"),a()()(),x(29,me,9,8,"div",10),n(30,"div",10)(31,"div",15),s(32,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),n(33,"div",12),p(34,"i",16),a(),n(35,"div",14),g(36),s(37,"translate"),a()()(),n(38,"div",10)(39,"div",15),s(40,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),n(41,"div",12),p(42,"i",17),a(),n(43,"div",14),g(44),s(45,"translate"),a()()(),n(46,"div",10)(47,"div",15),s(48,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),n(49,"div",12),p(50,"i",18),a(),n(51,"div",14),g(52),s(53,"translate"),a()()(),x(54,ue,8,9,"div",10),x(55,_e,8,9,"div",10),x(56,ge,8,9,"div",10),n(57,"div",10)(58,"div",15),s(59,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),n(60,"div",12),p(61,"i",19),a(),n(62,"div",14),g(63),s(64,"translate"),a()()(),x(65,fe,8,9,"div",10),x(66,ve,8,6,"div",10),x(67,he,8,6,"div",10),a()()),l&2&&(m("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",d(1,37,"menu.sidebar.aria_menu")),o(3),c("routerLink",h(63,B)),m("aria-label",d(4,39,"menu.label_status")),o(5),c("ngClass",M(64,te,t.isExpanded)),o(5),c("ngClass",M(66,ne,t.isExpanded)),o(2),c("routerLink",h(68,B)),m("aria-label",d(16,41,"menu.label_status")),o(7),c("routerLink",h(69,B))("routerLinkActive","active")("routerLinkActiveOptions",h(70,ie)),m("aria-label",d(23,43,"menu.label_status")),o(5),v(d(28,45,"menu.label_status")),o(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),o(2),c("routerLink",h(71,oe))("routerLinkActive","active"),m("aria-label",d(32,47,"menu.label_plugins")),o(5),v(d(37,49,"menu.label_plugins")),o(3),c("routerLink",h(72,re))("routerLinkActive","active"),m("aria-label",d(40,51,"menu.label_accessories")),o(5),v(d(45,53,"menu.label_accessories")),o(3),c("routerLink",h(73,ae))("routerLinkActive","active"),m("aria-label",d(48,55,"menu.linux.label_logs")),o(5),v(d(53,57,"menu.linux.label_logs")),o(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),o(),y(t.isAdmin?55:-1),o(),y(t.isAdmin?56:-1),o(2),c("routerLink",h(74,se))("routerLinkActive","active"),m("aria-label",d(59,59,"support.title")),o(5),v(d(64,61,"support.title")),o(2),y(t.isAdmin?65:-1),o(),y(t.isPwa?66:-1),o(),y(t.formAuth?67:-1))},dependencies:[N,K,O,D,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-y:auto;max-height:calc(100vh - 80px)!important}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{padding-bottom:60px}}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.5s ease-in-out;-moz-transition:.5s ease-in-out;-o-transition:.5s ease-in-out;transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transform:rotate(0);-webkit-transition:.25s ease-in-out;-moz-transition:.25s ease-in-out;-o-transition:.25s ease-in-out;transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return i})();var be=i=>({sidebarExpanded:i}),He=(()=>{class i{$auth=u(A);$modal=u(E);$router=u(V);$settings=u(T);$translate=u(L);$ws=u(j);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return I(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),this.$router.url!=="/restart"&&(0,Q.lt)(this.$settings.uiVersion,$.serverTarget)){console.log(`Server restart required. UI Version: ${$.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(R,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:$.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=P({type:i,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(l,t){l&1&&(p(0,"app-sidebar",0),n(1,"div",1),p(2,"router-outlet"),a()),l&2&&(c("isExpanded",t.sidebarExpanded),o(),c("ngClass",M(2,be,t.sidebarExpanded)))},dependencies:[J,O,q],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return i})();export{He as LayoutComponent};
@@ -1 +0,0 @@
1
- import{a as de}from"./chunk-BZQMBZCK.js";import{a as ie,b as ne,c as oe}from"./chunk-D5RIMAWO.js";import{c as ce}from"./chunk-6KGJCE3V.js";import"./chunk-4DQEF3SY.js";import{a as me}from"./chunk-SXPAZSXC.js";import{a as le}from"./chunk-WIJDDKLW.js";import{a as pe}from"./chunk-Q6UH4DEV.js";import{m as I,n as ee,t as te}from"./chunk-Q5UJ7RBG.js";import{B as Z,c as J,e as K,f as Q,i as U,l as X,m as Y}from"./chunk-GGZZFW2G.js";import"./chunk-ODN4SLC6.js";import{b as se}from"./chunk-CSU4CRXM.js";import"./chunk-BR6USPEJ.js";import{b as re}from"./chunk-23H472HH.js";import{m as ae}from"./chunk-BBLNIMTZ.js";import{b as S}from"./chunk-OBYXJY4V.js";import"./chunk-OMPHX32Y.js";import{Bc as A,Cc as E,Dc as T,Gc as z,Hc as B,Ic as j,Jb as C,Mb as h,Nb as y,Nc as s,Oc as l,Pb as P,Pc as q,Qb as V,Rb as $,Sb as g,Tb as a,Ub as r,Vb as p,Wb as F,Xb as O,Yb as R,Za as W,cb as i,cc as k,fc as b,h as L,hc as d,ka as f,md as G,ob as M,qa as v,ra as x,uc as c,vc as m,w as H,wc as w}from"./chunk-V2MV6MJL.js";var _e=(()=>{class t{$activeModal=f(I);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],decls:42,vars:30,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,"fa","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"ms-2","mt-2"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-end"]],template:function(n,o){n&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),r(),a(6,"button",3),s(7,"translate"),b("click",function(){return o.dismissModal()}),r()(),a(8,"div",4)(9,"div",5),p(10,"i",6),r(),a(11,"h5",7),c(12),s(13,"translate"),r(),a(14,"ul",8)(15,"li"),c(16),s(17,"translate"),r(),a(18,"li"),c(19),s(20,"translate"),r()(),a(21,"h5",9),c(22),s(23,"translate"),r(),a(24,"ul",8)(25,"li"),c(26),s(27,"translate"),r(),a(28,"li"),c(29),s(30,"translate"),r(),a(31,"li"),c(32),s(33,"translate"),r()(),p(34,"app-support-banner"),r(),a(35,"div",10),p(36,"div",11),a(37,"div",12)(38,"button",13),b("click",function(){return o.dismissModal()}),c(39),s(40,"translate"),r()(),p(41,"div",14),r()()()),n&2&&(i(4),m(l(5,10,"support.title")),i(2),C("aria-label",l(7,12,"form.button_close")),i(6),m(l(13,14,"menu.label_accessories")),i(4),m(l(17,16,"accessories.support.acc_1")),i(3),m(l(20,18,"accessories.support.acc_2")),i(3),m(l(23,20,"accessories.title_rooms")),i(4),m(l(27,22,"accessories.support.rooms_1")),i(3),m(l(30,24,"accessories.support.rooms_2")),i(3),m(l(33,26,"accessories.support.rooms_3")),i(7),w(" ",l(40,28,"form.button_close")," "))},dependencies:[me,S],encapsulation:2})}return t})();var be=()=>({standalone:!0}),ue=(()=>{class t{$activeModal=f(I);roomName;dismissModal(){this.$activeModal.dismiss("Dismiss")}closeModal(e){this.$activeModal.close(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=M({type:t,selectors:[["ng-component"]],inputs:{roomName:"roomName"},decls:28,vars:19,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-folder-plus","primary-text",2,"font-size","75px"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["autocomplete","off","type","text","id","form-name","autofocus","",1,"form-control","custom-input",3,"ngModelChange","keyup.enter","ngModel","ngModelOptions"],[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","disabled"]],template:function(n,o){n&1&&(a(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),c(4),s(5,"translate"),r(),a(6,"button",3),s(7,"translate"),b("click",function(){return o.dismissModal()}),r()(),a(8,"div",4)(9,"div",5),p(10,"i",6),r(),a(11,"ul",7)(12,"li",8)(13,"label",9),c(14),s(15,"translate"),r(),a(16,"div",10)(17,"input",11),T("ngModelChange",function(D){return E(o.roomName,D)||(o.roomName=D),D}),b("keyup.enter",function(){return o.closeModal(o.roomName)}),r()()()()(),a(18,"div",12)(19,"div",13)(20,"button",14),b("click",function(){return o.dismissModal()}),c(21),s(22,"translate"),r()(),p(23,"div",15),a(24,"div",16)(25,"button",17),b("click",function(){return o.closeModal(o.roomName)}),c(26),s(27,"translate"),r()()()()()),n&2&&(i(4),m(l(5,8,"accessories.button_add_room")),i(2),C("aria-label",l(7,10,"form.button_close")),i(8),m(l(15,12,"accessories.room_name")),i(3),A("ngModel",o.roomName),g("ngModelOptions",z(18,be)),i(4),w(" ",l(22,14,"form.button_close")," "),i(4),g("disabled",!o.roomName),i(),w(" ",l(27,16,"form.button_save")," "))},dependencies:[Z,Y,J,K,Q,X,U,S],encapsulation:2})}return t})();var ge=(()=>{class t{static \u0275fac=function(n){return new(n||t)};static \u0275cmp=M({type:t,selectors:[["app-drag-here-placeholder"]],decls:5,vars:3,consts:[[1,"accessory-box"],[1,"fas","fa-arrow-alt-circle-down","accessory-icon"],[1,"accessory-label"]],template:function(n,o){n&1&&(F(0,"div",0),R(1,"i",1),F(2,"div",2),c(3),s(4,"translate"),O()()),n&2&&(i(3),m(l(4,1,"accessories.control.drag_here")))},dependencies:[S],styles:[".accessory-box[_ngcontent-%COMP%]{opacity:.2}"]})}return t})();var fe=(t,u)=>({"fa-eye":t,"fa-eye-slash":u}),Ce=t=>({"cursor-move":t}),ve=t=>({"justify-content-between":t}),xe=t=>({link:t});function he(t,u){if(t&1){let e=k();a(0,"button",8),s(1,"translate"),s(2,"translate"),b("click",function(){v(e);let o=d(2);return x(o.addRoom())}),p(3,"i",9),r(),a(4,"button",8),s(5,"translate"),s(6,"translate"),s(7,"translate"),s(8,"translate"),b("click",function(){v(e);let o=d(2);return x(o.hideHidden=!o.hideHidden)}),p(9,"i",10),r(),a(10,"div",11)(11,"button",12),s(12,"translate"),s(13,"translate"),b("click",function(){v(e);let o=d(2);return x(o.toggleLayoutLock())}),p(14,"i",13),r(),a(15,"button",12),s(16,"translate"),s(17,"translate"),b("click",function(){v(e);let o=d(2);return x(o.toggleLayoutLock())}),p(18,"i",14),r()()}if(t&2){let e=d(2);g("hidden",e.isMobile)("openDelay",150)("ngbTooltip",l(1,17,"accessories.button_add_room")),C("aria-label",l(2,19,"accessories.button_add_room")),i(4),g("hidden",e.isMobile)("openDelay",150)("ngbTooltip",e.hideHidden?l(5,21,"accessories.button_hidden_show"):l(6,23,"accessories.button_hidden_hide")),C("aria-label",e.hideHidden?l(7,25,"accessories.button_hidden_show"):l(8,27,"accessories.button_hidden_hide")),i(5),g("ngClass",j(37,fe,!e.hideHidden,e.hideHidden)),i(2),g("disabled",!e.isMobile)("openDelay",150)("ngbTooltip",l(12,29,"form.button_unlock")),C("aria-label",l(13,31,"form.button_unlock")),i(4),g("disabled",e.isMobile)("openDelay",150)("ngbTooltip",l(16,33,"form.button_lock")),C("aria-label",l(17,35,"form.button_lock"))}}function ye(t,u){t&1&&p(0,"app-spinner")}function Me(t,u){if(t&1&&(a(0,"div",0)(1,"div",21)(2,"h5",22),c(3),s(4,"translate"),r()()()),t&2){let e=d().$implicit,n=d(4);i(2),g("ngClass",B(4,Ce,!n.isMobile)),i(),w(" ",e.name==="Default Room"?l(4,2,"accessories.control.default_room"):e.name," ")}}function Se(t,u){if(t&1&&(a(0,"div",25),p(1,"app-accessory-tile",26),r()),t&2){let e=d().$implicit;i(),g("service",e)}}function we(t,u){if(t&1&&h(0,Se,2,1,"div",25),t&2){let e=u.$implicit,n=d(6);y(!n.hideHidden||!e.hidden?0:-1)}}function ke(t,u){if(t&1){let e=k();a(0,"div",23),T("dragulaModelChange",function(o){v(e);let _=d().$implicit;return E(_.services,o)||(_.services=o),x(o)}),V(1,we,1,1,null,null,P),p(3,"div",24)(4,"div",24)(5,"div",24)(6,"div",24)(7,"div",24)(8,"div",24)(9,"div",24)(10,"div",24)(11,"div",24)(12,"div",24),r()}if(t&2){let e=d().$implicit,n=d(4);g("ngClass",B(3,ve,n.isMobile))("dragula","services-bag"),A("dragulaModel",e.services),i(),$(e.services)}}function Ae(t,u){if(t&1){let e=k();a(0,"div",27),T("dragulaModelChange",function(o){v(e);let _=d().$implicit;return E(_.services,o)||(_.services=o),x(o)}),p(1,"app-drag-here-placeholder",28),r()}if(t&2){let e=d().$implicit;g("dragula","services-bag"),A("dragulaModel",e.services)}}function Ee(t,u){if(t&1&&(a(0,"div"),h(1,Me,5,6,"div",0),a(2,"div",18),h(3,ke,13,5,"div",19),h(4,Ae,2,2,"div",20),r()()),t&2){let e=u.$implicit,n=d(4);i(),y(!n.isMobile||e.services.length?1:-1),i(2),y(e.services.length?3:-1),i(),y(!e.services.length&&!n.isMobile?4:-1)}}function Te(t,u){if(t&1){let e=k();a(0,"div",17),T("dragulaModelChange",function(o){v(e);let _=d(3);return E(_.$accessories.rooms,o)||(_.$accessories.rooms=o),x(o)}),V(1,Ee,5,3,"div",null,P),r()}if(t&2){let e=d(3);g("dragula","rooms-bag"),A("dragulaModel",e.$accessories.rooms),i(),$(e.$accessories.rooms)}}function Be(t,u){t&1&&(a(0,"div",16)(1,"div",29)(2,"div",30),p(3,"i",31),r(),a(4,"h5",32),c(5),s(6,"translate"),r(),a(7,"p",33),c(8),s(9,"translate"),r(),a(10,"p",34),c(11),s(12,"translate"),r()()()),t&2&&(i(5),m(l(6,3,"accessories.no_plugins.title")),i(3),m(l(9,5,"accessories.no_plugins.message_1")),i(3),m(l(12,7,"accessories.no_plugins.message_2")))}function Ie(t,u){if(t&1&&h(0,Te,3,2,"div",15)(1,Be,13,9,"div",16),t&2){let e=d(2);y(e.hasPlugins?0:1)}}function De(t,u){if(t&1){let e=k();a(0,"div",1)(1,"div",2)(2,"h3",3),c(3),s(4,"translate"),r()(),a(5,"div",4)(6,"button",5),s(7,"translate"),b("click",function(){v(e);let o=d();return x(o.openSupport())}),p(8,"i",6),r()(),a(9,"div",7),h(10,he,19,40),a(11,"button",5),s(12,"translate"),b("click",function(){v(e);let o=d();return x(o.openSupport())}),p(13,"i",6),r()()(),h(14,ye,1,0,"app-spinner")(15,Ie,2,1)}if(t&2){let e=d();i(3),m(l(4,5,"menu.label_accessories")),i(3),C("aria-label",l(7,7,"support.title")),i(4),y(e.hasPlugins?10:-1),i(),C("aria-label",l(12,9,"support.title")),i(3),y(e.loading?14:15)}}function Pe(t,u){t&1&&(a(0,"p",39),c(1),s(2,"translate"),r()),t&2&&(i(),m(l(2,1,"accessories.settings_link")))}function Ve(t,u){if(t&1&&(a(0,"div",0)(1,"div",35)(2,"h3",36),c(3),s(4,"translate"),r()(),a(5,"div",16)(6,"div",29)(7,"div",30),p(8,"i",37),r(),a(9,"h5",32),c(10),s(11,"translate"),r(),p(12,"p",38),s(13,"translate"),h(14,Pe,3,3,"p",39),r()()()),t&2){let e=d();i(3),m(l(4,4,"menu.label_accessories")),i(7),m(l(11,6,"accessories.control_disabled")),i(2),g("innerHTML",q(13,8,"accessories.message_must_use_insecure_mode",B(11,xe,e.linkInsecure)),W),i(2),y(e.isAdmin?14:-1)}}var gt=(()=>{class t{$accessories=f(ce);$api=f(ae);$auth=f(se);dragulaService=f(ie);$modal=f(ee);$settings=f(re);$md=f(pe);orderSubscription;isAdmin=this.$auth.user.admin;enableAccessories=this.$settings.env.enableAccessories;isMobile=!1;hideHidden=!0;linkInsecure='<a href="https://github.com/homebridge/homebridge-config-ui-x/wiki/Enabling-Accessory-Control" target="_blank"><i class="fa fa-external-link-alt primary-text"></i></a>';hasPlugins=!1;loading=!0;constructor(){let e=this.dragulaService;this.isMobile=this.$md.detect.mobile(),e.createGroup("rooms-bag",{moves:(n,o,_)=>!this.isMobile&&_.classList.contains("drag-handle")}),e.createGroup("services-bag",{moves:n=>!this.isMobile&&!n.classList.contains("no-drag")}),this.orderSubscription=e.drop().subscribe(()=>{setTimeout(()=>{this.$accessories.saveLayout()})}),this.isMobile=!0}ngOnInit(){this.$accessories.start(),this.checkForPlugins()}addRoom(){this.$modal.open(ue,{size:"lg",backdrop:"static"}).result.then(e=>{!e||!e.length||this.$accessories.rooms.find(n=>n.name===e)||(this.$accessories.rooms.push({name:e,services:[]}),this.isMobile&&this.toggleLayoutLock())}).catch(()=>{})}toggleLayoutLock(){this.isMobile=!this.isMobile,this.isMobile?document.querySelectorAll(".services-bag").forEach(n=>{for(let o=0;o<10;o+=1){let _=document.createElement("div");_.className="accessory-box invisible py-0 my-0",_.style.height="0",n.appendChild(_)}}):document.querySelectorAll(".invisible").forEach(n=>n.remove())}openSupport(){this.$modal.open(_e,{size:"lg",backdrop:"static"})}ngOnDestroy(){this.$accessories.stop(),this.orderSubscription.unsubscribe(),this.dragulaService.destroy("rooms-bag"),this.dragulaService.destroy("services-bag")}checkForPlugins(){return L(this,null,function*(){try{let e=yield H(this.$api.get("/plugins"));this.hasPlugins=e.length>1}catch(e){console.error(e),this.hasPlugins=!0}finally{this.loading=!1}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=M({type:t,selectors:[["app-accessories"]],decls:2,vars:1,consts:[[1,"row"],[1,"row","mb-3"],[1,"col-9","col-sm-6"],[1,"primary-text","m-0"],[1,"col-3","col-sm-6","text-end","d-inline-block","d-sm-none"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-question-circle-o"],[1,"col-3","col-sm-6","text-end","d-none","d-sm-inline-block"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0","me-2",3,"click","hidden","openDelay","ngbTooltip"],[1,"fas","fa-folder-plus"],[1,"fas",3,"ngClass"],["role","group",1,"btn-group","me-2"],["type","button","container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","my-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-unlock"],[1,"fas","fa-lock"],[3,"dragula","dragulaModel"],[1,"col-12","text-center"],[3,"dragulaModelChange","dragula","dragulaModel"],[1,"row","mb-4"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"ngClass","dragula","dragulaModel"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragula","dragulaModel"],[1,"col-md-12"],[1,"primary-text","drag-handle","room-title","m-0","mb-1","mb-sm-0",3,"ngClass"],[1,"col-md-12","d-flex","flex-wrap","noselect","services-bag",3,"dragulaModelChange","ngClass","dragula","dragulaModel"],[1,"accessory-box","invisible","py-0","my-0",2,"height","0"],[1,"accessory-item","accessory-tab"],[3,"service"],[1,"col-md-12","d-flex","flex-wrap","noselect",3,"dragulaModelChange","dragula","dragulaModel"],[1,"no-drag"],["role","alert",1,"alert","alert-warning","p-4"],[1,"text-center","mb-3"],[1,"fas","fa-plug","primary-text",2,"font-size","75px"],[1,"mb-3","mt-0"],[1,"mb-0","small"],[1,"mb-0","small","mt-2"],[1,"col-12"],[1,"primary-text","m-0","mb-3"],[1,"fas","fa-lightbulb","primary-text",2,"font-size","75px"],[1,"mb-0","small",3,"innerHTML"],[1,"mt-2","mb-0","small"]],template:function(n,o){n&1&&h(0,De,16,11)(1,Ve,15,13,"div",0),n&2&&y(o.enableAccessories?0:1)},dependencies:[te,G,oe,ne,de,ge,le,S],styles:[".room-title[_ngcontent-%COMP%]{margin-left:10px}@media (max-width: 575px){.room-title[_ngcontent-%COMP%]{margin-left:7px}}.services-bag[_ngcontent-%COMP%]{min-height:170px}@media (max-width: 575px){.services-bag[_ngcontent-%COMP%]{min-height:initial}}.cursor-move[_ngcontent-%COMP%]{cursor:move}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return t})();export{gt as AccessoriesComponent};
@@ -1 +0,0 @@
1
- import{a as u}from"./chunk-J6L2XE5U.js";import{k as p,m}from"./chunk-BBLNIMTZ.js";import{a as c}from"./chunk-OBYXJY4V.js";import{fa as n,g as f,h as r,ka as a,w as s}from"./chunk-V2MV6MJL.js";var l=f(u(),1);var $=(()=>{class e{$api=a(m);$toastr=a(p);$translate=a(c);downloadBackup(){return r(this,null,function*(){let t=yield s(this.$api.get("/backup/download",{observe:"response",responseType:"blob"})),i=t.headers.get("File-Name")||"homebridge-backup.tar.gz",o=t.body.size;if(o>globalThis.backup.maxBackupSize){let b=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(o/1048576).toFixed(1)}MB`});this.$toastr.warning(b,this.$translate.instant("toast.title_warning"))}(0,l.saveAs)(t.body,i)})}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$ as a};