homebridge-config-ui-x 5.4.2-beta.34 → 5.4.2-beta.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/bin/hb-service.js +1 -1
- package/dist/bin/hb-service.js.map +1 -1
- package/dist/core/auth/auth.controller.d.ts +1 -0
- package/dist/core/config/config.interfaces.d.ts +64 -0
- package/dist/core/config/config.interfaces.js +3 -0
- package/dist/core/config/config.interfaces.js.map +1 -0
- package/dist/core/config/config.service.d.ts +4 -21
- package/dist/core/config/config.service.js +4 -0
- package/dist/core/config/config.service.js.map +1 -1
- package/dist/core/config/config.startup.d.ts +2 -13
- package/dist/core/config/config.startup.js.map +1 -1
- package/dist/core/spa/spa.filter.d.ts +2 -1
- package/dist/core/spa/spa.filter.js +4 -1
- package/dist/core/spa/spa.filter.js.map +1 -1
- package/dist/globalDefaults.js +3 -0
- package/dist/globalDefaults.js.map +1 -1
- package/dist/main.js +15 -13
- package/dist/main.js.map +1 -1
- package/dist/modules/backup/backup.service.js +4 -1
- package/dist/modules/backup/backup.service.js.map +1 -1
- package/dist/modules/config-editor/config-editor.controller.d.ts +3 -3
- package/dist/modules/config-editor/config-editor.service.d.ts +3 -2
- package/dist/modules/config-editor/config-editor.service.js +38 -15
- package/dist/modules/config-editor/config-editor.service.js.map +1 -1
- package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.d.ts +1 -1
- package/dist/modules/log/log.gateway.d.ts +1 -1
- package/dist/modules/log/log.interfaces.d.ts +4 -0
- package/dist/modules/log/log.interfaces.js +3 -0
- package/dist/modules/log/log.interfaces.js.map +1 -0
- package/dist/modules/log/log.service.d.ts +1 -4
- package/dist/modules/log/log.service.js.map +1 -1
- package/dist/modules/platform-tools/terminal/terminal.gateway.d.ts +1 -1
- package/dist/modules/platform-tools/terminal/terminal.interfaces.d.ts +8 -0
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js +3 -0
- package/dist/modules/platform-tools/terminal/terminal.interfaces.js.map +1 -0
- package/dist/modules/platform-tools/terminal/terminal.service.d.ts +1 -8
- package/dist/modules/platform-tools/terminal/terminal.service.js.map +1 -1
- package/dist/modules/plugins/plugins.controller.d.ts +5 -5
- package/dist/modules/plugins/plugins.interfaces.d.ts +211 -0
- package/dist/modules/plugins/plugins.interfaces.js +3 -0
- package/dist/modules/plugins/plugins.interfaces.js.map +1 -0
- package/dist/modules/plugins/plugins.service.d.ts +1 -1
- package/dist/modules/plugins/plugins.service.js.map +1 -1
- package/dist/modules/server/server.service.js +6 -4
- package/dist/modules/server/server.service.js.map +1 -1
- package/dist/modules/status/status.controller.d.ts +2 -2
- package/dist/modules/status/status.gateway.d.ts +5 -5
- package/dist/modules/status/status.interfaces.d.ts +27 -0
- package/dist/modules/status/status.interfaces.js +10 -0
- package/dist/modules/status/status.interfaces.js.map +1 -0
- package/dist/modules/status/status.service.d.ts +2 -29
- package/dist/modules/status/status.service.js +4 -9
- package/dist/modules/status/status.service.js.map +1 -1
- package/package.json +2 -2
- package/public/3rdpartylicenses.txt +3 -1
- package/public/{chunk-7NV4KY6W.js → chunk-22UVENNJ.js} +1 -1
- package/public/chunk-26GMIPRJ.js +19 -0
- package/public/{chunk-BDITCHXY.js → chunk-33RLTKP7.js} +1 -1
- package/public/{chunk-4QMPZEU2.js → chunk-37M3WNYK.js} +1 -1
- package/public/{chunk-JMWLREAW.js → chunk-3Y22MKX5.js} +1 -1
- package/public/{chunk-NVM7LIBV.js → chunk-54LW2EIT.js} +1 -1
- package/public/{chunk-AEDYX7QW.js → chunk-6A65Q45W.js} +1 -1
- package/public/{chunk-KCDOWEBJ.js → chunk-6FDD5CCJ.js} +1 -1
- package/public/{chunk-R2L5QSSW.js → chunk-AKRQOBH5.js} +1 -1
- package/public/{chunk-4VANYPAJ.js → chunk-AOF6N6LI.js} +1 -1
- package/public/{chunk-S7XHIZ2C.js → chunk-ATWZNPLH.js} +1 -1
- package/public/{chunk-HC6M5EBC.js → chunk-AZKNOMJL.js} +1 -1
- package/public/{chunk-AHMEX5XD.js → chunk-BYYHHD35.js} +1 -1
- package/public/{chunk-NHBQVYGJ.js → chunk-CEJ47ACH.js} +1 -1
- package/public/{chunk-RZHE43I6.js → chunk-DF6AC7BX.js} +1 -1
- package/public/{chunk-3YTDUGW7.js → chunk-E4H6ESG4.js} +1 -1
- package/public/{chunk-JFZ2A252.js → chunk-E6FL6SQ2.js} +1 -1
- package/public/{chunk-4KCBR6KN.js → chunk-GGG55BFS.js} +1 -1
- package/public/{chunk-NRHD2BXN.js → chunk-IOMKPASZ.js} +1 -1
- package/public/{chunk-6LIDOYQ5.js → chunk-ITLWDLYI.js} +1 -1
- package/public/{chunk-U6RUTZFH.js → chunk-JDULYXIE.js} +1 -1
- package/public/{chunk-SQLHNVND.js → chunk-JOPEEASP.js} +1 -1
- package/public/{chunk-QMNQ4FAL.js → chunk-JTIFGXIK.js} +1 -1
- package/public/{chunk-HFGCMLED.js → chunk-KWHMJ4TN.js} +1 -1
- package/public/chunk-L2BZEZMS.js +49 -0
- package/public/{chunk-B4YN4FBB.js → chunk-LIAR6SEI.js} +1 -1
- package/public/chunk-LRP4UK2C.js +1 -0
- package/public/{chunk-TST4TLQB.js → chunk-LRUNOWMY.js} +11 -9
- package/public/{chunk-ZJHKGKFK.js → chunk-LWVHPBRV.js} +1 -1
- package/public/{chunk-W4QA6YCR.js → chunk-LZRP7D6M.js} +1 -1
- package/public/{chunk-4X7L4KQL.js → chunk-N3CMGFGQ.js} +1 -1
- package/public/{chunk-AVBJ5EMT.js → chunk-NVVXFX5K.js} +1 -1
- package/public/{chunk-LI7O67NH.js → chunk-O5Z6RUN6.js} +1 -1
- package/public/{chunk-RCM5XFVU.js → chunk-OXQK4UWV.js} +1 -1
- package/public/{chunk-4DKOKZK5.js → chunk-PNUGTSUC.js} +1 -1
- package/public/{chunk-45OZYP45.js → chunk-QISDIMSQ.js} +1 -1
- package/public/{chunk-7F4X6BE3.js → chunk-QXPVXXPG.js} +1 -1
- package/public/{chunk-KRWZHVHO.js → chunk-R5NMQ5HW.js} +1 -1
- package/public/{chunk-2QIBEJ2P.js → chunk-RL2DXT2X.js} +1 -1
- package/public/{chunk-5CK36DGM.js → chunk-SVBCVHA6.js} +1 -1
- package/public/{chunk-XY46FVZF.js → chunk-SWXXH4T2.js} +1 -1
- package/public/{chunk-ET6IVHAD.js → chunk-T3AZK3NW.js} +1 -1
- package/public/chunk-T6QH6SOM.js +1 -0
- package/public/{chunk-ENYL2YPO.js → chunk-UAXFFECE.js} +1 -1
- package/public/{chunk-Z3AQIRMS.js → chunk-UK6SMZQH.js} +1 -1
- package/public/{chunk-XRASUEWC.js → chunk-UY7WTZES.js} +1 -1
- package/public/{chunk-YM7YGOQM.js → chunk-XJLJFGGS.js} +1 -1
- package/public/{chunk-F54OPRBZ.js → chunk-XPIOM6KJ.js} +1 -1
- package/public/{chunk-BJAULSY4.js → chunk-XS7PL6OK.js} +1 -1
- package/public/{chunk-O5GV34LY.js → chunk-XZWJ6UIN.js} +1 -1
- package/public/{chunk-64F5HSDQ.js → chunk-YBIXKSXT.js} +1 -1
- package/public/{chunk-WFDBV66D.js → chunk-YVQQ2QBB.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-X3XBQQT2.js → main-SRK6IBZL.js} +1 -1
- package/config.schema.json +0 -596
- package/public/chunk-AWE7H5PY.js +0 -20
- package/public/chunk-GTZIY7WT.js +0 -1
- package/public/chunk-HSA6M4GG.js +0 -1
- package/public/chunk-QTZTX2XP.js +0 -49
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as H}from"./chunk-ZZ3PNQCV.js";import{a as L,b as S}from"./chunk-74ETBIBO.js";import{m as T}from"./chunk-LXFVNKLD.js";import{l as B}from"./chunk-
|
|
1
|
+
import{b as H}from"./chunk-ZZ3PNQCV.js";import{a as L,b as S}from"./chunk-74ETBIBO.js";import{m as T}from"./chunk-LXFVNKLD.js";import{l as B}from"./chunk-IOMKPASZ.js";import{Db as k,Ga as u,Gb as b,Ha as O,Ib as d,La as o,Ub as y,Vb as f,Wa as v,Wb as w,Xb as M,dc as I,ja as h,kb as C,lb as r,mb as l,mc as g,nc as _,oa as x,pa as P,rb as p,sb as i,tb as a,ub as m}from"./chunk-V2XN5VIX.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(I("fas fa-fw ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,u)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,u)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),f(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),f(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-fw","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),f(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),w(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,u),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as i}from"./chunk-YMAWYUA6.js";import{Xa as e,fa as t}from"./chunk-V2XN5VIX.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-
|
|
1
|
+
import{g as i}from"./chunk-YMAWYUA6.js";import{Xa as e,fa as t}from"./chunk-V2XN5VIX.js";var d=[{path:"",redirectTo:"/",pathMatch:"full"},{path:"docker",loadChildren:()=>import("./chunk-AZKNOMJL.js").then(o=>o.DockerModule)},{path:"linux",loadChildren:()=>import("./chunk-OXQK4UWV.js").then(o=>o.LinuxModule)},{path:"terminal",loadChildren:()=>import("./chunk-33RLTKP7.js").then(o=>o.TerminalModule)}],l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[i.forChild(d),i]})}return o})();var p=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=e({type:o});static \u0275inj=t({imports:[l]})}return o})();export{p as PlatformToolsModule};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{B as Y,C as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-F7ZV2JBO.js";import{a as ae}from"./chunk-
|
|
1
|
+
import{B as Y,C as Z,c as G,d as k,e as j,f as D,g as K,j as $,m as A,q as J,r as Q,y as X}from"./chunk-F7ZV2JBO.js";import{a as ae}from"./chunk-O5Z6RUN6.js";import{b as oe}from"./chunk-N3CMGFGQ.js";import{b as re}from"./chunk-YBIXKSXT.js";import{k as ee,l as te,n as ie,p as U,q as ne}from"./chunk-IOMKPASZ.js";import{Db as I,Ga as W,Gb as x,Ib as _,Kc as H,La as n,Nc as N,Sb as O,Vb as l,Wa as V,Wb as f,Xb as g,Xc as R,fc as L,gc as B,h as S,hc as E,hd as q,ja as w,kb as M,lb as z,mb as T,mc as a,nc as s,oa as C,pa as b,rb as m,sb as o,tb as r,ub as u,w as h}from"./chunk-V2XN5VIX.js";var pe=t=>({background:t}),de=t=>({anim:t}),ce=t=>({"progress-bar-animated":t}),me=()=>["restoring","restarting","restore-complete"],P=(t,d)=>({"is-valid":t,"is-invalid":d});function ue(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),u(4,"div",7),a(5,"translate"),o(6,"button",8),x("click",function(){C(e);let i=_();return b(i.onClickGettingStarted())}),l(7),a(8,"translate"),r(),o(9,"a",9),x("click",function(){C(e);let i=_();return b(i.onClickRestoreBackup())}),l(10),a(11,"translate"),r()()}t&2&&(n(2),f(s(3,4,"setup.welcome_to_homebridge")),n(2),m("innerHTML",s(5,6,"setup.intro"),W),n(3),g(" ",s(8,8,"setup.button_get_started")," "),n(3),f(s(11,10,"setup_wizard_restore")))}function ge(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"div",11)(8,"form",12),x("ngSubmit",function(){C(e);let i=_();return b(i.createFirstUser())}),o(9,"div",13)(10,"span",14),u(11,"i",15),r(),u(12,"input",16),a(13,"translate"),r(),o(14,"div",13)(15,"span",14),u(16,"i",17),r(),u(17,"input",18),a(18,"translate"),r(),o(19,"div",13)(20,"span",14),u(21,"i",17),r(),u(22,"input",19),a(23,"translate"),r(),o(24,"div",20)(25,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(26),a(27,"translate"),r(),o(28,"button",22),l(29),a(30,"translate"),r()()()()()}if(t&2){let e=_();n(2),f(s(3,16,"setup.create_account")),n(3),f(s(6,18,"setup_wizard_create_info")),n(3),m("formGroup",e.createUserForm),n(4),m("readonly",e.loading)("ngClass",E(30,P,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.valid,e.createUserForm.controls.username.dirty&&e.createUserForm.controls.username.invalid))("placeholder",s(13,20,"users.label_username")),n(5),m("readonly",e.loading)("ngClass",E(33,P,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.valid,e.createUserForm.controls.password.dirty&&e.createUserForm.controls.password.errors))("placeholder",s(18,22,"users.label_password")),n(5),m("readonly",e.loading)("ngClass",E(36,P,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.valid,e.createUserForm.controls.passwordConfirm.dirty&&e.createUserForm.controls.passwordConfirm.errors))("placeholder",s(23,24,"users.label_confirm_password")),n(3),m("disabled",e.restoreUploading),n(),g(" ",s(27,26,"form.button_back")," "),n(2),m("disabled",e.createUserForm.invalid||e.loading),n(),g(" ",s(30,28,"form.button_continue")," ")}}function _e(t,d){t&1&&(u(0,"i",25),l(1),a(2,"translate")),t&2&&(n(),g(" ",s(2,1,"backup.label_uploading")," "))}function fe(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"form.button_continue")," ")}function he(t,d){if(t&1){let e=I();o(0,"div",5)(1,"h4",6),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"input",23),x("change",function(i){C(e);let F=_();return b(F.handleRestoreFileInput(i.target.files))}),r(),o(8,"div",20)(9,"button",21),x("click",function(){C(e);let i=_();return b(i.onClickCancelRestore())}),l(10),a(11,"translate"),r(),o(12,"button",24),x("click",function(){C(e);let i=_();return b(i.onRestoreBackupClick())}),z(13,_e,3,3)(14,fe,2,3),r()()()}if(t&2){let e=_();n(2),f(s(3,6,"setup_wizard_restore")),n(3),f(s(6,8,"backup.restore_help_one")),n(4),m("disabled",e.restoreUploading),n(),g(" ",s(11,10,"form.button_back")," "),n(2),m("disabled",e.restoreUploading||!e.selectedFile),n(),T(e.restoreUploading?13:14)}}function we(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_restoring")," ")}function Ce(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_starting")," ")}function be(t,d){t&1&&(l(0),a(1,"translate")),t&2&&g(" ",s(1,1,"setup_wizard_complete")," ")}function xe(t,d){t&1&&(o(0,"a",27),l(1),a(2,"translate"),r()),t&2&&(n(),g(" ",s(2,1,"form.button_continue")," "))}function ve(t,d){if(t&1&&(o(0,"div",5)(1,"h4",6),z(2,we,2,3)(3,Ce,2,3)(4,be,2,3),r(),u(5,"div",26),z(6,xe,3,3,"a",27),r()),t&2){let e=_();n(2),T(e.step==="restoring"?2:e.step==="restarting"?3:e.step==="restore-complete"?4:-1),n(4),T(e.step==="restore-complete"?6:-1)}}function ye(t,d){t&1&&(o(0,"div",5)(1,"h4",28),l(2),a(3,"translate"),r(),o(4,"div",10),l(5),a(6,"translate"),r(),o(7,"a",29),l(8),a(9,"translate"),r()()),t&2&&(n(2),f(s(3,3,"setup_wizard_complete_title")),n(3),f(s(6,5,"setup_wizard_completed")),n(3),g(" ",s(9,7,"form.button_continue")," "))}var He=(()=>{class t{$api=w(ne);$auth=w(oe);$settings=w(re);$title=w(q);$toastr=w(ie);$translate=w(ee);$ws=w(ae);io;step="welcome";backgroundStyle;progress=1;restoreInProgress=!1;restoreStarted=!1;restoreFailed=!1;loading=!1;selectedFile;restoreUploading=!1;createUserForm=new K({username:new $("",[k.required]),password:new $("",[k.compose([k.required,k.minLength(4)])]),passwordConfirm:new $("",[k.required])},this.matchPassword);ngOnInit(){return S(this,null,function*(){this.$title.setTitle(this.$translate.instant("setup_wizard_page_title")),yield this.setBackground()})}onClickGettingStarted(){this.step="create-account",this.progress=50}onClickRestoreBackup(){this.step="restore-backup",this.progress=20}onClickCancelRestore(){this.selectedFile=null,this.step="welcome",this.progress=1}createFirstUser(){return S(this,null,function*(){this.loading=!0,this.progress=75;let e=this.createUserForm.getRawValue();e.name=e.username;try{yield h(this.$api.post("/setup-wizard/create-first-user",e)),this.$settings.env.setupWizardComplete=!0,this.progress=100,this.loading=!1,yield this.$auth.login({username:e.username,password:e.password}),this.step="setup-complete"}catch(p){this.loading=!1,this.progress=50,console.error(p),this.$toastr.error(p.message,this.$translate.instant("toast.title_error"))}})}handleRestoreFileInput(e){e.length?(this.selectedFile=e[0],this.progress=40):(delete this.selectedFile,this.progress=20)}onRestoreBackupClick(){return S(this,null,function*(){this.restoreUploading=!0,this.step="restoring",this.progress=60;try{let e=yield h(this.$api.get("/setup-wizard/get-setup-wizard-token"));window.localStorage.setItem(U.jwt.tokenKey,e.access_token),this.$auth.token=e.access_token,this.progress=65;let p=new FormData;p.append("restoreArchive",this.selectedFile,this.selectedFile.name),yield h(this.$api.post("/backup/restore",p)),this.progress=70,this.io=this.$ws.connectToNamespace("backup");let i=document.getElementById("output");this.io.socket.on("stdout",c=>{c.split(`
|
|
2
2
|
\r`).forEach(v=>{if(v&&!/^[⠇⠏⠋⠙⠹⠸]+$/.test(v)){let y=document.createElement("div"),le=/\x1B\[(\d{1,2}(;\d{1,2})?)?[mGK]/g;y.innerHTML=v.replace(le,""),v.includes("[0;31m")?y.classList.add("red-text"):v.includes("[0;32m")?y.classList.add("green-text"):v.includes("[0;33m")?y.classList.add("orange-text"):v.includes("[0;36m")&&y.classList.add("cyan-text"),i.appendChild(y),i.scrollTop=i.scrollHeight}})}),this.restoreStarted=!0,this.restoreInProgress=!0,this.progress=75,yield h(this.io.request("do-restore")),this.progress=80,this.restoreInProgress=!1,yield h(this.$api.put("/backup/restart",{})),this.step="restarting",this.progress=85,window.localStorage.removeItem(U.jwt.tokenKey),this.$auth.token=null;let F=document.createElement("div");F.classList.add("orange-text"),F.innerHTML="Starting Homebridge, please wait...",i.appendChild(F),i.scrollTop=i.scrollHeight,yield new Promise(c=>setTimeout(c,3e3)),this.progress=88,yield new Promise(c=>setTimeout(c,3e3)),this.progress=91,yield new Promise(c=>setTimeout(c,3e3)),this.progress=94,yield new Promise(c=>setTimeout(c,3e3)),this.progress=97,yield new Promise(c=>setTimeout(c,3e3)),this.progress=99;let se=setInterval(()=>S(this,null,function*(){try{yield h(this.$api.get("/auth/settings")),clearInterval(se),this.progress=100,this.restoreUploading=!1,this.step="restore-complete"}catch{}}),1e3)}catch(e){console.error(e),this.restoreUploading=!1,this.restoreFailed=!0,this.progress=20,this.step="restore-backup",this.$toastr.error(e.message,this.$translate.instant("toast.title_error"))}finally{this.io&&this.io.end()}})}setBackground(){return S(this,null,function*(){if(this.$settings.settingsLoaded||(yield h(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let e=`${U.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${e}') center/cover`}})}matchPassword(e){let p=e.get("password").value,i=e.get("passwordConfirm").value;if(p!==i)e.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=V({type:t,selectors:[["ng-component"]],decls:10,vars:14,consts:[[1,"setup-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","setup-card","d-flex","py-4","flex-column"],["ngSrc","assets/homebridge-color-round.svg","alt","Homebridge Logo","height","100","width","100","priority","true",1,"homebridge-logo","mx-auto","my-3"],[1,"progress","w-100","my-4"],["role","progressbar","aria-valuemin","0","aria-valuemax","100",1,"progress-bar","progress-bar-striped","bg-success",3,"ngClass"],[1,"w-100","d-flex","flex-column","align-items-center","mb-2"],[1,"mb-3","text-center"],[1,"mb-4","small","grey-text","text-center",3,"innerHTML"],["type","button",1,"btn","btn-lg","btn-primary","mb-4",3,"click"],["href","javascript:void(0)",1,"grey-text",3,"click"],[1,"mb-4","small","grey-text","text-center"],[1,"w-100"],["novalidate","",3,"ngSubmit","formGroup"],[1,"input-group","mb-4"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],["formControlName","passwordConfirm","type","password","id","form-pass-confirm","autocomplete","new-password","tabindex","2","required","",1,"form-control","custom-input",3,"readonly","ngClass","placeholder"],[1,"mt-3","w-100","d-flex","justify-content-between"],["type","button",1,"btn","btn-elegant","ms-0",3,"click","disabled"],["type","submit",1,"btn","btn-primary",3,"disabled"],["type","file","id","restoreFileUpload","accept","application/gzip, .gz",1,"form-control","custom-input","mb-3",3,"change"],["type","button",1,"btn","btn-primary","me-0",3,"click","disabled"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],["id","output",1,"font-monospace","small","alert","alert-info","w-100","text-start","mt-1","mb-0"],["href","/login",1,"btn","btn-lg","btn-primary","mt-4"],[1,"mb-3"],["href","/",1,"btn","btn-lg","btn-primary"]],template:function(p,i){p&1&&(o(0,"div",0)(1,"div",1),u(2,"img",2),o(3,"div",3),u(4,"div",4),r(),z(5,ue,12,12,"div",5)(6,ge,31,39,"div",5)(7,he,15,12,"div",5)(8,ve,7,2,"div",5)(9,ye,10,9,"div",5),r()()),p&2&&(m("ngStyle",B(7,pe,i.backgroundStyle))("ngClass",B(9,de,!i.backgroundStyle)),n(4),O("width",i.progress+"%"),m("ngClass",B(11,ce,i.loading||i.restoreUploading)),M("aria-valuenow",i.progress),n(),T(i.step==="welcome"?5:i.step==="create-account"?6:i.step==="restore-backup"?7:L(13,me).includes(i.step)?8:i.step==="setup-complete"?9:-1))},dependencies:[H,R,Y,A,G,j,D,X,Z,J,Q,N,te],styles:["body{overflow:scroll!important} body.dark-mode .setup-card{background-color:#2b2b2b;color:#fff}.setup-container[_ngcontent-%COMP%]{z-index:-1;padding-top:2em;padding-bottom:2em;min-height:100%;background-size:300% 300%}.anim[_ngcontent-%COMP%]{-webkit-animation:_ngcontent-%COMP%_gradient 20s ease infinite;-moz-animation:gradient 20s ease infinite;-o-animation:gradient 20s ease infinite;animation:_ngcontent-%COMP%_gradient 20s ease infinite}@keyframes _ngcontent-%COMP%_gradient{0%{background-position:0 50%}50%{background-position:100% 50%}to{background-position:0 50%}}.setup-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.setup-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.setup-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}.progress[_ngcontent-%COMP%]{background-color:#ddd}#output[_ngcontent-%COMP%]{height:200px;overflow-y:scroll;white-space:pre-wrap}"]})}return t})();export{He as SetupWizardComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n}from"./chunk-
|
|
1
|
+
import{b as n}from"./chunk-N3CMGFGQ.js";import{d as u}from"./chunk-YMAWYUA6.js";import{b as m}from"./chunk-YBIXKSXT.js";import{k as c,n as h,p as f}from"./chunk-IOMKPASZ.js";import{ea as i,h as o,ja as r,w as s}from"./chunk-V2XN5VIX.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 +1 @@
|
|
|
1
|
-
import{$c as zt,Ac as Kt,B as at,C as lt,D as Pt,Db as Tt,Fa as Ht,Fb as $t,Ga as gt,Gb as V,Ib as f,L as Mt,La as a,Mc as Ct,Na as Bt,O as P,Qa as L,Sb as $,Ub as v,Vb as b,Wa as mt,X as ut,Xa as vt,Xb as x,Za as Vt,_ as ct,a as c,ab as N,b as F,cb as bt,e as ne,ea as d,fa as ht,ha as Y,ia as S,id as qt,ja as u,jb as W,ka as Nt,kb as H,n as p,oa as dt,pa as ft,r as k,rb as h,sa as J,sb as g,t as D,ta as pt,tb as m,ub as B,wa as M,x as ot,yb as _t,za as Q,zb as yt}from"./chunk-V2XN5VIX.js";var Xt=ne((Li,Ne)=>{Ne.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.4.2-beta.34",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-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"13.0.1","@fastify/multipart":"9.0.3","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.1","@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.11.0","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.0",dayjs:"1.11.13",fastify:"5.5.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.0",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.7",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.2.1","@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.0","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.0","@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.0","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.5.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 y=(function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e})(y||{}),se="*";function Lt(e,n){return{type:y.Trigger,name:e,definitions:n,options:{}}}function X(e,n=null){return{type:y.Animate,styles:n,timings:e}}function He(e,n=null){return{type:y.Sequence,steps:e,options:n}}function K(e){return{type:y.Style,styles:e,offset:null}}function z(e,n,t){return{type:y.State,name:e,styles:n,options:t}}function tt(e,n,t=null){return{type:y.Transition,expr:e,animation:n,options:t}}var wt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(n=0,t=0){this.totalTime=n+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Dt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(n){this.players=n;let t=0,i=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++i==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,l)=>Math.max(o,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){let t=n*this.totalTime;this.players.forEach(i=>{let s=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(s)})}getPosition(){let n=this.players.reduce((t,i)=>t===null||i.totalTime>t.totalTime?i:t,null);return n!=null?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},re="!";var G=class{},le=(()=>{class e{handle(t){return t.key}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),O=class{},ue=(()=>{class e extends O{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),E=class{},ce=(()=>{class e extends E{getTranslation(t){return k({})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function et(e,n){if(e===n)return!0;if(e===null||n===null)return!1;if(e!==e&&n!==n)return!0;let t=typeof e,i=typeof n,s;if(t==i&&t=="object")if(Array.isArray(e)){if(!Array.isArray(n))return!1;if((s=e.length)==n.length){for(let r=0;r<s;r++)if(!et(e[r],n[r]))return!1;return!0}}else{if(Array.isArray(n))return!1;if(_(e)&&_(n)){let r=Object.create(null);for(let o in e){if(!et(e[o],n[o]))return!1;r[o]=!0}for(let o in n)if(!(o in r)&&typeof n[o]<"u")return!1;return!0}}return!1}function T(e){return typeof e<"u"&&e!==null}function Zt(e){return e!==void 0}function _(e){return Z(e)&&!I(e)&&e!==null}function Z(e){return typeof e=="object"&&e!==null}function I(e){return Array.isArray(e)}function it(e){return typeof e=="string"}function he(e){return typeof e=="function"}function nt(e){if(I(e))return e.map(n=>nt(n));if(_(e)){let n={};return Object.keys(e).forEach(t=>{n[t]=nt(e[t])}),n}else return e}function St(e,n){if(!Z(e))return nt(n);let t=nt(e);return Z(t)&&Z(n)&&Object.keys(n).forEach(i=>{_(n[i])?i in e?t[i]=St(e[i],n[i]):Object.assign(t,{[i]:n[i]}):Object.assign(t,{[i]:n[i]})}),t}function Ut(e,n){let t=n.split(".");n="";do{n+=t.shift();let i=!t.length;if(T(e)){if(_(e)&&Zt(e[n])&&(_(e[n])||I(e[n])||i)){e=e[n],n="";continue}if(I(e)){let s=parseInt(n,10);if(Zt(e[s])&&(_(e[s])||I(e[s])||i)){e=e[s],n="";continue}}}if(i){e=void 0;continue}n+="."}while(t.length);return e}function de(e,n,t){return St(e,fe(n,t))}function fe(e,n){return e.split(".").reduceRight((t,i)=>({[i]:t}),n)}var A=class{},pe=(()=>{class e extends A{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(it(t))return this.interpolateString(t,i);if(he(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(s,r)=>{let o=this.getInterpolationReplacement(i,r);return o!==void 0?o:s}):t}getInterpolationReplacement(t,i){return this.formatValue(Ut(t,i))}formatValue(t){if(it(t))return t;if(typeof t=="number"||typeof t=="boolean")return t.toString();if(t===null)return"null";if(I(t))return t.join(", ");if(Z(t))return typeof t.toString=="function"&&t.toString!==Object.prototype.toString?t.toString():JSON.stringify(t)}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),xt=(()=>{class e{_onTranslationChange=new p;_onLangChange=new p;_onFallbackLangChange=new p;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(t){return this.translations[t]}setTranslations(t,i,s){this.translations[t]=s&&this.hasTranslationFor(t)?St(this.translations[t],i):i,this.addLanguages([t]),this._onTranslationChange.next({lang:t,translations:this.getTranslations(t)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(t,i=!0){this.fallbackLang=t,i&&this._onFallbackLangChange.next({lang:t,translations:this.translations[t]})}setCurrentLang(t,i=!0){this.currentLang=t,i&&this._onLangChange.next({lang:t,translations:this.translations[t]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(t){this.languages=Array.from(new Set([...this.languages,...t]))}hasTranslationFor(t){return typeof this.translations[t]<"u"}deleteTranslations(t){delete this.translations[t]}getTranslation(t){let i=this.getValue(this.currentLang,t);return i===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(i=this.getValue(this.fallbackLang,t)),i}getValue(t,i){return Ut(this.getTranslations(t),i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),It=new Y("TRANSLATE_CONFIG"),q=e=>D(e)?e:k(e);var Ft=(()=>{class e{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=u(E);compiler=u(O);parser=u(A);missingTranslationHandler=u(G);store=u(xt);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 t=c({extend:!1,fallbackLang:null},u(It,{optional:!0}));t.lang&&this.use(t.lang),t.fallbackLang&&this.setFallbackLang(t.fallbackLang),t.extend&&(this.extend=!0)}setFallbackLang(t){this.getFallbackLang()||this.store.setFallbackLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.store.setFallbackLang(t)},error:()=>{}}),i):(this.store.setFallbackLang(t),k(this.store.getTranslations(t)))}use(t){this.lastUseLanguage=t,this.getCurrentLang()||this.store.setCurrentLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.changeLang(t)},error:()=>{}}),i):(this.changeLang(t),k(this.store.getTranslations(t)))}loadOrExtendLanguage(t){if(!this.store.hasTranslationFor(t)||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}changeLang(t){t===this.lastUseLanguage&&this.store.setCurrentLang(t)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(ut(1),P(1));return this.loadingTranslations=i.pipe(ot(s=>this.compiler.compileTranslations(s,t)),ut(1),P(1)),this.loadingTranslations.subscribe({next:s=>{this.store.setTranslations(t,s,this.extend),this.pending=!1},error:s=>{this.pending=!1}}),i}setTranslation(t,i,s=!1){let r=this.compiler.compileTranslations(i,t);this.store.setTranslations(t,r,s||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(t){this.store.addLanguages(t)}getParsedResultForKey(t,i){let s=this.getTextToInterpolate(t);if(T(s))return this.runInterpolation(s,i);let r=this.missingTranslationHandler.handle(c({key:t,translateService:this},i!==void 0&&{interpolateParams:i}));return r!==void 0?r:t}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(t){return this.store.getTranslation(t)}runInterpolation(t,i){if(T(t))return I(t)?this.runInterpolationOnArray(t,i):_(t)?this.runInterpolationOnDict(t,i):this.parser.interpolate(t,i)}runInterpolationOnArray(t,i){return t.map(s=>this.runInterpolation(s,i))}runInterpolationOnDict(t,i){let s={};for(let r in t){let o=this.runInterpolation(t[r],i);o!==void 0&&(s[r]=o)}return s}getParsedResult(t,i){return t instanceof Array?this.getParsedResultForArray(t,i):this.getParsedResultForKey(t,i)}getParsedResultForArray(t,i){let s={},r=!1;for(let l of t)s[l]=this.getParsedResultForKey(l,i),r=r||D(s[l]);if(!r)return s;let o=t.map(l=>q(s[l]));return Pt(o).pipe(ot(l=>{let C={};return l.forEach((U,w)=>{C[t[w]]=U}),C}))}get(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(Mt(()=>q(this.getParsedResult(t,i)))):q(this.getParsedResult(t,i))}getStreamOnTranslationChange(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return at(lt(()=>this.get(t,i)),this.onTranslationChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}stream(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" required');return at(lt(()=>this.get(t,i)),this.onLangChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}instant(t,i){if(!T(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(t,i);return D(s)?Array.isArray(t)?t.reduce((r,o)=>(r[o]=o,r),{}):t:s}set(t,i,s=this.getCurrentLang()){this.store.setTranslations(s,de(this.store.getTranslations(s),t,it(i)?this.compiler.compile(i,s):this.compiler.compileTranslations(i,s)),!1)}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],this.store.deleteTranslations(t)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.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 e.getBrowserLang()}getBrowserCultureLang(){return e.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(t){return this.setFallbackLang(t)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();var Ye=(()=>{class e{translate=u(Ft);_ref=u(Kt);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(t,i,s){let r=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(s){let o=this.translate.getParsedResult(t,i);D(o)?o.subscribe(r):r(o)}this.translate.get(t,i).subscribe(r)}transform(t,...i){if(!t||!t.length)return t;if(et(t,this.lastKey)&&et(i,this.lastParams))return this.value;let s;if(T(i[0])&&i.length)if(it(i[0])&&i[0].length){let r=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(r)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else _(i[0])&&(s=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(r=>{(this.lastKey&&r.lang===this.translate.getCurrentLang()||r.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(r=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s))})),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(i){return new(i||e)};static \u0275pipe=Vt({name:"translate",type:e,pure:!1});static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function ge(e){return{provide:E,useClass:e}}function me(e){return{provide:O,useClass:e}}function ve(e){return{provide:A,useClass:e}}function be(e){return{provide:G,useClass:e}}function Je(e={}){return _e(c({compiler:me(ue),parser:ve(pe),loader:ge(ce),missingTranslationHandler:be(le)},e),!0)}function _e(e={},n){let t=[];e.loader&&t.push(e.loader),e.compiler&&t.push(e.compiler),e.parser&&t.push(e.parser),e.missingTranslationHandler&&t.push(e.missingTranslationHandler),n&&t.push(xt),(e.useDefaultLang||e.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),e.useDefaultLang===!0&&e.defaultLanguage&&(e.fallbackLang=e.defaultLanguage));let i={fallbackLang:e.fallbackLang??null,lang:e.lang,extend:e.extend??!1};return t.push({provide:It,useValue:i}),t.push({provide:Ft,useClass:Ft,deps:[xt,E,O,A,G,It]}),t}var Yt=["toast-component",""];function ye(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Te(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Ce(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Te,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function we(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function De(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Le(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}function xe(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Ie(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Fe(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Ie,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function Se(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function Oe(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Ee(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}var Ot=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Et=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},At=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new p;_activate=new p;_manualClose=new p;_resetTimeout=new p;_countDuplicate=new p;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},R=class{toastId;config;message;title;toastType;toastRef;_onTap=new p;_onAction=new p;constructor(n,t,i,s,r,o){this.toastId=n,this.config=t,this.message=i,this.title=s,this.toastType=r,this.toastRef=o,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},Jt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Qt=new Y("ToastConfig"),Rt=class extends Et{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,i){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=i}attachComponentPortal(n,t){let i=this._componentFactoryResolver.resolveComponentFactory(n.component),s;return s=i.create(n.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ae=(()=>{class e{_document=u(pt);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),jt=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},Re=(()=>{class e{_overlayContainer=u(Ae);_componentFactoryResolver=u(Bt);_appRef=u(W);_document=u(pt);_paneElements=new Map;create(t,i){return this._createOverlayRef(this.getPaneElement(t,i))}getPaneElement(t="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[t]||(this._paneElements.get(i)[t]=this._createPaneElement(t,i)),this._paneElements.get(i)[t]}_createPaneElement(t,i){let s=this._document.createElement("div");return s.id="toast-container",s.classList.add(t),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(t){return new Rt(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new jt(this._createPortalHost(t))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Wt=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,i,s,r,o){this.overlay=i,this._injector=s,this.sanitizer=r,this.ngZone=o,this.toastrConfig=c(c({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=c(c({},t.default.iconClasses),t.config.iconClasses))}show(t,i,s={},r=""){return this._preBuildNotification(r,t,i,this.applyConfig(s))}success(t,i,s={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}error(t,i,s={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}info(t,i,s={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}warning(t,i,s={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}clear(t){for(let i of this.toasts)if(t!==void 0){if(i.toastId===t){i.toastRef.manualClose();return}}else i.toastRef.manualClose()}remove(t){let i=this._findToast(t);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let s=this.toasts[this.currentlyActive].toastRef;s.isInactive()||(this.currentlyActive=this.currentlyActive+1,s.activate())}return!0}findDuplicate(t="",i="",s,r){let{includeTitleDuplicates:o}=this.toastrConfig;for(let l of this.toasts){let C=o&&l.title===t;if((!o||C)&&l.message===i)return l.toastRef.onDuplicate(s,r),l}return null}applyConfig(t={}){return c(c({},this.toastrConfig),t)}_findToast(t){for(let i=0;i<this.toasts.length;i++)if(this.toasts[i].toastId===t)return{index:i,activeToast:this.toasts[i]};return null}_preBuildNotification(t,i,s,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,i,s,r)):this._buildNotification(t,i,s,r)}_buildNotification(t,i,s,r){if(!r.toastComponent)throw new Error("toastComponent required");let o=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&o!==null)return o;this.previousToastMessage=i;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let C=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let U=i;i&&r.enableHtml&&(U=this.sanitizer.sanitize(Ht.HTML,i));let w=new At(C),st=new R(this.index,r,U,s,t,w),te=[{provide:R,useValue:st}],ee=J.create({providers:te,parent:this._injector}),ie=new Ot(r.toastComponent,ee),kt=C.attach(ie,r.newestOnTop);w.componentInstance=kt.instance;let rt={toastId:this.index,title:s||"",message:i||"",toastRef:w,onShown:w.afterActivate(),onHidden:w.afterClosed(),onTap:st.onTap(),onAction:st.onAction(),portal:kt};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{rt.toastRef.activate()})),this.toasts.push(rt),rt}static \u0275fac=function(i){return new(i||e)(S(Qt),S(Re),S(J),S(qt),S(bt))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),je=(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state=M({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>F(c({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>F(c({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>F(c({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),i)):this.timeout=setTimeout(()=>t(),i)}outsideInterval(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),i)):this.intervalId=setInterval(()=>t(),i)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(bt))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&($t("@flyInOut",s._state),v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,ye,3,0,"button",0)(1,Ce,3,5,"div",1)(2,we,1,3,"div",2)(3,De,2,4,"div",3)(4,Le,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,data:{animation:[Lt("flyInOut",[z("inactive",K({opacity:0})),z("active",K({opacity:1})),z("removed",K({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})(),ke=F(c({},Jt),{toastComponent:je}),Pe=(e={})=>Nt([{provide:Qt,useValue:{default:ke,config:e}}]),Ti=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[Pe(t)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=vt({type:e});static \u0275inj=ht({})}return e})();var Me=(()=>{class e{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=M("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.appRef=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(W))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&(v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,xe,3,0,"button",0)(1,Fe,3,5,"div",1)(2,Se,1,3,"div",2)(3,Oe,2,4,"div",3)(4,Ee,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,changeDetection:0})}return e})(),Ci=F(c({},Jt),{toastComponent:Me});var j={serverTarget:Xt().version,production:!0,socket:"",api:{base:(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/";return n.endsWith("/")?`${n}api`:`${n}/api`})(),socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/",t=n.endsWith("/")?`${n}api`:`${n}/api`;return`${window.location.protocol}//${document.location.host}${t}/auth/login`})()]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Ei=(()=>{class e{$http=u(zt);get(t,i){return this.$http.get(`${j.api.base}${t}`,i)}post(t,i,s){return this.$http.post(`${j.api.base}${t}`,i,s)}put(t,i,s){return this.$http.put(`${j.api.base}${t}`,i,s)}patch(t,i,s){return this.$http.patch(`${j.api.base}${t}`,i,s)}delete(t,i){return this.$http.delete(`${j.api.base}${t}`,i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{y as a,se as b,Lt as c,X as d,He as e,K as f,tt as g,wt as h,Dt as i,re as j,Ft as k,Ye as l,Je as m,Wt as n,Ti as o,j as p,Ei as q};
|
|
1
|
+
import{$c as zt,Ac as Kt,B as at,C as lt,D as Pt,Db as Tt,Fa as Ht,Fb as $t,Ga as gt,Gb as V,Ib as f,L as Mt,La as a,Mc as Ct,Na as Bt,O as P,Qa as L,Sb as $,Ub as v,Vb as b,Wa as mt,X as ut,Xa as vt,Xb as x,Za as Vt,_ as ct,a as c,ab as N,b as F,cb as bt,e as ne,ea as d,fa as ht,ha as Y,ia as S,id as qt,ja as u,jb as W,ka as Nt,kb as H,n as p,oa as dt,pa as ft,r as k,rb as h,sa as J,sb as g,t as D,ta as pt,tb as m,ub as B,wa as M,x as ot,yb as _t,za as Q,zb as yt}from"./chunk-V2XN5VIX.js";var Xt=ne((Li,Ne)=>{Ne.exports={name:"homebridge-config-ui-x",displayName:"Homebridge UI",version:"5.4.2-beta.36",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-beta.0"},scripts:{build:"npm run build:server && npm run build:ui","build:server":"rimraf dist && tsc -p tsconfig.build.json","build:ui":"npm run build --prefix ui",check:"npm run check:server && npm run check:ui","check:server":"npm install && npm outdated","check:ui":"npm install --prefix ui && npm outdated --prefix ui","lang-sync":"ts-node scripts/lang-sync.ts",lint:"eslint . --max-warnings=0","lint:fix":"npm run lint -- --fix",prepublishOnly:"npm i --package-lock-only && npm run lint && npm run build",start:"ts-node -r tsconfig-paths/register src/main.ts",test:"vitest run","test-coverage":"npm run test -- --coverage","upgrade-install":"./scripts/upgrade-install.sh",watch:'concurrently "npm run watch:ui" "npm run watch:server"',"watch:server":"nodemon","watch:ui":"npm run start --prefix ui"},dependencies:{"@fastify/helmet":"13.0.1","@fastify/multipart":"9.0.3","@fastify/static":"8.2.0","@homebridge/hap-client":"3.1.1","@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.11.0","bash-color":"0.0.4","class-transformer":"0.5.1","class-validator":"0.14.2",commander:"14.0.0",dayjs:"1.11.13",fastify:"5.5.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.0",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.7",tail:"2.2.6",tar:"7.4.3","tcp-port-used":"1.0.2",unzipper:"0.12.3"},devDependencies:{"@antfu/eslint-config":"^5.2.1","@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.0","@types/node-schedule":"^2.1.8","@types/passport-jwt":"^4.0.1","@types/semver":"^7.7.0","@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.5.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 y=(function(e){return e[e.State=0]="State",e[e.Transition=1]="Transition",e[e.Sequence=2]="Sequence",e[e.Group=3]="Group",e[e.Animate=4]="Animate",e[e.Keyframes=5]="Keyframes",e[e.Style=6]="Style",e[e.Trigger=7]="Trigger",e[e.Reference=8]="Reference",e[e.AnimateChild=9]="AnimateChild",e[e.AnimateRef=10]="AnimateRef",e[e.Query=11]="Query",e[e.Stagger=12]="Stagger",e})(y||{}),se="*";function Lt(e,n){return{type:y.Trigger,name:e,definitions:n,options:{}}}function X(e,n=null){return{type:y.Animate,styles:n,timings:e}}function He(e,n=null){return{type:y.Sequence,steps:e,options:n}}function K(e){return{type:y.Style,styles:e,offset:null}}function z(e,n,t){return{type:y.State,name:e,styles:n,options:t}}function tt(e,n,t=null){return{type:y.Transition,expr:e,animation:n,options:t}}var wt=class{_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_originalOnDoneFns=[];_originalOnStartFns=[];_started=!1;_destroyed=!1;_finished=!1;_position=0;parentPlayer=null;totalTime;constructor(n=0,t=0){this.totalTime=n+t}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}init(){}play(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0}triggerMicrotask(){queueMicrotask(()=>this._onFinish())}_onStart(){this._onStartFns.forEach(n=>n()),this._onStartFns=[]}pause(){}restart(){}finish(){this._onFinish()}destroy(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this._started=!1,this._finished=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}setPosition(n){this._position=this.totalTime?n*this.totalTime:1}getPosition(){return this.totalTime?this._position/this.totalTime:1}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},Dt=class{_onDoneFns=[];_onStartFns=[];_finished=!1;_started=!1;_destroyed=!1;_onDestroyFns=[];parentPlayer=null;totalTime=0;players;constructor(n){this.players=n;let t=0,i=0,s=0,r=this.players.length;r==0?queueMicrotask(()=>this._onFinish()):this.players.forEach(o=>{o.onDone(()=>{++t==r&&this._onFinish()}),o.onDestroy(()=>{++i==r&&this._onDestroy()}),o.onStart(()=>{++s==r&&this._onStart()})}),this.totalTime=this.players.reduce((o,l)=>Math.max(o,l.totalTime),0)}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this.players.forEach(n=>n.init())}onStart(n){this._onStartFns.push(n)}_onStart(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(n=>n()),this._onStartFns=[])}onDone(n){this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}hasStarted(){return this._started}play(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(n=>n.play())}pause(){this.players.forEach(n=>n.pause())}restart(){this.players.forEach(n=>n.restart())}finish(){this._onFinish(),this.players.forEach(n=>n.finish())}destroy(){this._onDestroy()}_onDestroy(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(n=>n.destroy()),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}reset(){this.players.forEach(n=>n.reset()),this._destroyed=!1,this._finished=!1,this._started=!1}setPosition(n){let t=n*this.totalTime;this.players.forEach(i=>{let s=i.totalTime?Math.min(1,t/i.totalTime):1;i.setPosition(s)})}getPosition(){let n=this.players.reduce((t,i)=>t===null||i.totalTime>t.totalTime?i:t,null);return n!=null?n.getPosition():0}beforeDestroy(){this.players.forEach(n=>{n.beforeDestroy&&n.beforeDestroy()})}triggerCallback(n){let t=n=="start"?this._onStartFns:this._onDoneFns;t.forEach(i=>i()),t.length=0}},re="!";var G=class{},le=(()=>{class e{handle(t){return t.key}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),O=class{},ue=(()=>{class e extends O{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),E=class{},ce=(()=>{class e extends E{getTranslation(t){return k({})}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function et(e,n){if(e===n)return!0;if(e===null||n===null)return!1;if(e!==e&&n!==n)return!0;let t=typeof e,i=typeof n,s;if(t==i&&t=="object")if(Array.isArray(e)){if(!Array.isArray(n))return!1;if((s=e.length)==n.length){for(let r=0;r<s;r++)if(!et(e[r],n[r]))return!1;return!0}}else{if(Array.isArray(n))return!1;if(_(e)&&_(n)){let r=Object.create(null);for(let o in e){if(!et(e[o],n[o]))return!1;r[o]=!0}for(let o in n)if(!(o in r)&&typeof n[o]<"u")return!1;return!0}}return!1}function T(e){return typeof e<"u"&&e!==null}function Zt(e){return e!==void 0}function _(e){return Z(e)&&!I(e)&&e!==null}function Z(e){return typeof e=="object"&&e!==null}function I(e){return Array.isArray(e)}function it(e){return typeof e=="string"}function he(e){return typeof e=="function"}function nt(e){if(I(e))return e.map(n=>nt(n));if(_(e)){let n={};return Object.keys(e).forEach(t=>{n[t]=nt(e[t])}),n}else return e}function St(e,n){if(!Z(e))return nt(n);let t=nt(e);return Z(t)&&Z(n)&&Object.keys(n).forEach(i=>{_(n[i])?i in e?t[i]=St(e[i],n[i]):Object.assign(t,{[i]:n[i]}):Object.assign(t,{[i]:n[i]})}),t}function Ut(e,n){let t=n.split(".");n="";do{n+=t.shift();let i=!t.length;if(T(e)){if(_(e)&&Zt(e[n])&&(_(e[n])||I(e[n])||i)){e=e[n],n="";continue}if(I(e)){let s=parseInt(n,10);if(Zt(e[s])&&(_(e[s])||I(e[s])||i)){e=e[s],n="";continue}}}if(i){e=void 0;continue}n+="."}while(t.length);return e}function de(e,n,t){return St(e,fe(n,t))}function fe(e,n){return e.split(".").reduceRight((t,i)=>({[i]:t}),n)}var A=class{},pe=(()=>{class e extends A{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(it(t))return this.interpolateString(t,i);if(he(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(s,r)=>{let o=this.getInterpolationReplacement(i,r);return o!==void 0?o:s}):t}getInterpolationReplacement(t,i){return this.formatValue(Ut(t,i))}formatValue(t){if(it(t))return t;if(typeof t=="number"||typeof t=="boolean")return t.toString();if(t===null)return"null";if(I(t))return t.join(", ");if(Z(t))return typeof t.toString=="function"&&t.toString!==Object.prototype.toString?t.toString():JSON.stringify(t)}static \u0275fac=(()=>{let t;return function(s){return(t||(t=Q(e)))(s||e)}})();static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),xt=(()=>{class e{_onTranslationChange=new p;_onLangChange=new p;_onFallbackLangChange=new p;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(t){return this.translations[t]}setTranslations(t,i,s){this.translations[t]=s&&this.hasTranslationFor(t)?St(this.translations[t],i):i,this.addLanguages([t]),this._onTranslationChange.next({lang:t,translations:this.getTranslations(t)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(t,i=!0){this.fallbackLang=t,i&&this._onFallbackLangChange.next({lang:t,translations:this.translations[t]})}setCurrentLang(t,i=!0){this.currentLang=t,i&&this._onLangChange.next({lang:t,translations:this.translations[t]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(t){this.languages=Array.from(new Set([...this.languages,...t]))}hasTranslationFor(t){return typeof this.translations[t]<"u"}deleteTranslations(t){delete this.translations[t]}getTranslation(t){let i=this.getValue(this.currentLang,t);return i===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(i=this.getValue(this.fallbackLang,t)),i}getValue(t,i){return Ut(this.getTranslations(t),i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})(),It=new Y("TRANSLATE_CONFIG"),q=e=>D(e)?e:k(e);var Ft=(()=>{class e{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=u(E);compiler=u(O);parser=u(A);missingTranslationHandler=u(G);store=u(xt);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 t=c({extend:!1,fallbackLang:null},u(It,{optional:!0}));t.lang&&this.use(t.lang),t.fallbackLang&&this.setFallbackLang(t.fallbackLang),t.extend&&(this.extend=!0)}setFallbackLang(t){this.getFallbackLang()||this.store.setFallbackLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.store.setFallbackLang(t)},error:()=>{}}),i):(this.store.setFallbackLang(t),k(this.store.getTranslations(t)))}use(t){this.lastUseLanguage=t,this.getCurrentLang()||this.store.setCurrentLang(t,!1);let i=this.loadOrExtendLanguage(t);return D(i)?(i.pipe(P(1)).subscribe({next:()=>{this.changeLang(t)},error:()=>{}}),i):(this.changeLang(t),k(this.store.getTranslations(t)))}loadOrExtendLanguage(t){if(!this.store.hasTranslationFor(t)||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}changeLang(t){t===this.lastUseLanguage&&this.store.setCurrentLang(t)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(ut(1),P(1));return this.loadingTranslations=i.pipe(ot(s=>this.compiler.compileTranslations(s,t)),ut(1),P(1)),this.loadingTranslations.subscribe({next:s=>{this.store.setTranslations(t,s,this.extend),this.pending=!1},error:s=>{this.pending=!1}}),i}setTranslation(t,i,s=!1){let r=this.compiler.compileTranslations(i,t);this.store.setTranslations(t,r,s||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(t){this.store.addLanguages(t)}getParsedResultForKey(t,i){let s=this.getTextToInterpolate(t);if(T(s))return this.runInterpolation(s,i);let r=this.missingTranslationHandler.handle(c({key:t,translateService:this},i!==void 0&&{interpolateParams:i}));return r!==void 0?r:t}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(t){return this.store.getTranslation(t)}runInterpolation(t,i){if(T(t))return I(t)?this.runInterpolationOnArray(t,i):_(t)?this.runInterpolationOnDict(t,i):this.parser.interpolate(t,i)}runInterpolationOnArray(t,i){return t.map(s=>this.runInterpolation(s,i))}runInterpolationOnDict(t,i){let s={};for(let r in t){let o=this.runInterpolation(t[r],i);o!==void 0&&(s[r]=o)}return s}getParsedResult(t,i){return t instanceof Array?this.getParsedResultForArray(t,i):this.getParsedResultForKey(t,i)}getParsedResultForArray(t,i){let s={},r=!1;for(let l of t)s[l]=this.getParsedResultForKey(l,i),r=r||D(s[l]);if(!r)return s;let o=t.map(l=>q(s[l]));return Pt(o).pipe(ot(l=>{let C={};return l.forEach((U,w)=>{C[t[w]]=U}),C}))}get(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(Mt(()=>q(this.getParsedResult(t,i)))):q(this.getParsedResult(t,i))}getStreamOnTranslationChange(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return at(lt(()=>this.get(t,i)),this.onTranslationChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}stream(t,i){if(!T(t)||!t.length)throw new Error('Parameter "key" required');return at(lt(()=>this.get(t,i)),this.onLangChange.pipe(ct(()=>{let s=this.getParsedResult(t,i);return q(s)})))}instant(t,i){if(!T(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let s=this.getParsedResult(t,i);return D(s)?Array.isArray(t)?t.reduce((r,o)=>(r[o]=o,r),{}):t:s}set(t,i,s=this.getCurrentLang()){this.store.setTranslations(s,de(this.store.getTranslations(s),t,it(i)?this.compiler.compile(i,s):this.compiler.compileTranslations(i,s)),!1)}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],this.store.deleteTranslations(t)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.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 e.getBrowserLang()}getBrowserCultureLang(){return e.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(t){return this.setFallbackLang(t)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();var Ye=(()=>{class e{translate=u(Ft);_ref=u(Kt);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(t,i,s){let r=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(s){let o=this.translate.getParsedResult(t,i);D(o)?o.subscribe(r):r(o)}this.translate.get(t,i).subscribe(r)}transform(t,...i){if(!t||!t.length)return t;if(et(t,this.lastKey)&&et(i,this.lastParams))return this.value;let s;if(T(i[0])&&i.length)if(it(i[0])&&i[0].length){let r=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{s=JSON.parse(r)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else _(i[0])&&(s=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,s),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(r=>{(this.lastKey&&r.lang===this.translate.getCurrentLang()||r.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(r=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s,r.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,s))})),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(i){return new(i||e)};static \u0275pipe=Vt({name:"translate",type:e,pure:!1});static \u0275prov=d({token:e,factory:e.\u0275fac})}return e})();function ge(e){return{provide:E,useClass:e}}function me(e){return{provide:O,useClass:e}}function ve(e){return{provide:A,useClass:e}}function be(e){return{provide:G,useClass:e}}function Je(e={}){return _e(c({compiler:me(ue),parser:ve(pe),loader:ge(ce),missingTranslationHandler:be(le)},e),!0)}function _e(e={},n){let t=[];e.loader&&t.push(e.loader),e.compiler&&t.push(e.compiler),e.parser&&t.push(e.parser),e.missingTranslationHandler&&t.push(e.missingTranslationHandler),n&&t.push(xt),(e.useDefaultLang||e.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),e.useDefaultLang===!0&&e.defaultLanguage&&(e.fallbackLang=e.defaultLanguage));let i={fallbackLang:e.fallbackLang??null,lang:e.lang,extend:e.extend??!1};return t.push({provide:It,useValue:i}),t.push({provide:Ft,useClass:Ft,deps:[xt,E,O,A,G,It]}),t}var Yt=["toast-component",""];function ye(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Te(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Ce(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Te,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function we(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function De(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Le(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}function xe(e,n){if(e&1){let t=Tt();g(0,"button",5),V("click",function(){dt(t);let s=f();return ft(s.remove())}),g(1,"span",6),b(2,"\xD7"),m()()}}function Ie(e,n){if(e&1&&(_t(0),b(1),yt()),e&2){let t=f(2);a(),x("[",t.duplicatesCount+1,"]")}}function Fe(e,n){if(e&1&&(g(0,"div"),b(1),N(2,Ie,2,1,"ng-container",4),m()),e&2){let t=f();v(t.options.titleClass),H("aria-label",t.title),a(),x(" ",t.title," "),a(),h("ngIf",t.duplicatesCount)}}function Se(e,n){if(e&1&&B(0,"div",7),e&2){let t=f();v(t.options.messageClass),h("innerHTML",t.message,gt)}}function Oe(e,n){if(e&1&&(g(0,"div",8),b(1),m()),e&2){let t=f();v(t.options.messageClass),H("aria-label",t.message),a(),x(" ",t.message," ")}}function Ee(e,n){if(e&1&&(g(0,"div"),B(1,"div",9),m()),e&2){let t=f();a(),$("width",t.width()+"%")}}var Ot=class{_attachedHost;component;viewContainerRef;injector;constructor(n,t){this.component=n,this.injector=t}attach(n,t){return this._attachedHost=n,n.attach(this,t)}detach(){let n=this._attachedHost;if(n)return this._attachedHost=void 0,n.detach()}get isAttached(){return this._attachedHost!=null}setAttachedHost(n){this._attachedHost=n}},Et=class{_attachedPortal;_disposeFn;attach(n,t){return this._attachedPortal=n,this.attachComponentPortal(n,t)}detach(){this._attachedPortal&&this._attachedPortal.setAttachedHost(),this._attachedPortal=void 0,this._disposeFn&&(this._disposeFn(),this._disposeFn=void 0)}setDisposeFn(n){this._disposeFn=n}},At=class{_overlayRef;componentInstance;duplicatesCount=0;_afterClosed=new p;_activate=new p;_manualClose=new p;_resetTimeout=new p;_countDuplicate=new p;constructor(n){this._overlayRef=n}manualClose(){this._manualClose.next(),this._manualClose.complete()}manualClosed(){return this._manualClose.asObservable()}timeoutReset(){return this._resetTimeout.asObservable()}countDuplicate(){return this._countDuplicate.asObservable()}close(){this._overlayRef.detach(),this._afterClosed.next(),this._manualClose.next(),this._afterClosed.complete(),this._manualClose.complete(),this._activate.complete(),this._resetTimeout.complete(),this._countDuplicate.complete()}afterClosed(){return this._afterClosed.asObservable()}isInactive(){return this._activate.isStopped}activate(){this._activate.next(),this._activate.complete()}afterActivate(){return this._activate.asObservable()}onDuplicate(n,t){n&&this._resetTimeout.next(),t&&this._countDuplicate.next(++this.duplicatesCount)}},R=class{toastId;config;message;title;toastType;toastRef;_onTap=new p;_onAction=new p;constructor(n,t,i,s,r,o){this.toastId=n,this.config=t,this.message=i,this.title=s,this.toastType=r,this.toastRef=o,this.toastRef.afterClosed().subscribe(()=>{this._onAction.complete(),this._onTap.complete()})}triggerTap(){this._onTap.next(),this.config.tapToDismiss&&this._onTap.complete()}onTap(){return this._onTap.asObservable()}triggerAction(n){this._onAction.next(n)}onAction(){return this._onAction.asObservable()}},Jt={maxOpened:0,autoDismiss:!1,newestOnTop:!0,preventDuplicates:!1,countDuplicates:!1,resetTimeoutOnDuplicate:!1,includeTitleDuplicates:!1,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},closeButton:!1,disableTimeOut:!1,timeOut:5e3,extendedTimeOut:1e3,enableHtml:!1,progressBar:!1,toastClass:"ngx-toastr",positionClass:"toast-top-right",titleClass:"toast-title",messageClass:"toast-message",easing:"ease-in",easeTime:300,tapToDismiss:!0,onActivateTick:!1,progressAnimation:"decreasing"},Qt=new Y("ToastConfig"),Rt=class extends Et{_hostDomElement;_componentFactoryResolver;_appRef;constructor(n,t,i){super(),this._hostDomElement=n,this._componentFactoryResolver=t,this._appRef=i}attachComponentPortal(n,t){let i=this._componentFactoryResolver.resolveComponentFactory(n.component),s;return s=i.create(n.injector),this._appRef.attachView(s.hostView),this.setDisposeFn(()=>{this._appRef.detachView(s.hostView),s.destroy()}),t?this._hostDomElement.insertBefore(this._getComponentRootNode(s),this._hostDomElement.firstChild):this._hostDomElement.appendChild(this._getComponentRootNode(s)),s}_getComponentRootNode(n){return n.hostView.rootNodes[0]}},Ae=(()=>{class e{_document=u(pt);_containerElement;ngOnDestroy(){this._containerElement&&this._containerElement.parentNode&&this._containerElement.parentNode.removeChild(this._containerElement)}getContainerElement(){return this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let t=this._document.createElement("div");t.classList.add("overlay-container"),t.setAttribute("aria-live","polite"),this._document.body.appendChild(t),this._containerElement=t}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),jt=class{_portalHost;constructor(n){this._portalHost=n}attach(n,t=!0){return this._portalHost.attach(n,t)}detach(){return this._portalHost.detach()}},Re=(()=>{class e{_overlayContainer=u(Ae);_componentFactoryResolver=u(Bt);_appRef=u(W);_document=u(pt);_paneElements=new Map;create(t,i){return this._createOverlayRef(this.getPaneElement(t,i))}getPaneElement(t="",i){return this._paneElements.get(i)||this._paneElements.set(i,{}),this._paneElements.get(i)[t]||(this._paneElements.get(i)[t]=this._createPaneElement(t,i)),this._paneElements.get(i)[t]}_createPaneElement(t,i){let s=this._document.createElement("div");return s.id="toast-container",s.classList.add(t),s.classList.add("toast-container"),i?i.getContainerElement().appendChild(s):this._overlayContainer.getContainerElement().appendChild(s),s}_createPortalHost(t){return new Rt(t,this._componentFactoryResolver,this._appRef)}_createOverlayRef(t){return new jt(this._createPortalHost(t))}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),Wt=(()=>{class e{overlay;_injector;sanitizer;ngZone;toastrConfig;currentlyActive=0;toasts=[];overlayContainer;previousToastMessage;index=0;constructor(t,i,s,r,o){this.overlay=i,this._injector=s,this.sanitizer=r,this.ngZone=o,this.toastrConfig=c(c({},t.default),t.config),t.config.iconClasses&&(this.toastrConfig.iconClasses=c(c({},t.default.iconClasses),t.config.iconClasses))}show(t,i,s={},r=""){return this._preBuildNotification(r,t,i,this.applyConfig(s))}success(t,i,s={}){let r=this.toastrConfig.iconClasses.success||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}error(t,i,s={}){let r=this.toastrConfig.iconClasses.error||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}info(t,i,s={}){let r=this.toastrConfig.iconClasses.info||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}warning(t,i,s={}){let r=this.toastrConfig.iconClasses.warning||"";return this._preBuildNotification(r,t,i,this.applyConfig(s))}clear(t){for(let i of this.toasts)if(t!==void 0){if(i.toastId===t){i.toastRef.manualClose();return}}else i.toastRef.manualClose()}remove(t){let i=this._findToast(t);if(!i||(i.activeToast.toastRef.close(),this.toasts.splice(i.index,1),this.currentlyActive=this.currentlyActive-1,!this.toastrConfig.maxOpened||!this.toasts.length))return!1;if(this.currentlyActive<this.toastrConfig.maxOpened&&this.toasts[this.currentlyActive]){let s=this.toasts[this.currentlyActive].toastRef;s.isInactive()||(this.currentlyActive=this.currentlyActive+1,s.activate())}return!0}findDuplicate(t="",i="",s,r){let{includeTitleDuplicates:o}=this.toastrConfig;for(let l of this.toasts){let C=o&&l.title===t;if((!o||C)&&l.message===i)return l.toastRef.onDuplicate(s,r),l}return null}applyConfig(t={}){return c(c({},this.toastrConfig),t)}_findToast(t){for(let i=0;i<this.toasts.length;i++)if(this.toasts[i].toastId===t)return{index:i,activeToast:this.toasts[i]};return null}_preBuildNotification(t,i,s,r){return r.onActivateTick?this.ngZone.run(()=>this._buildNotification(t,i,s,r)):this._buildNotification(t,i,s,r)}_buildNotification(t,i,s,r){if(!r.toastComponent)throw new Error("toastComponent required");let o=this.findDuplicate(s,i,this.toastrConfig.resetTimeoutOnDuplicate&&r.timeOut>0,this.toastrConfig.countDuplicates);if((this.toastrConfig.includeTitleDuplicates&&s||i)&&this.toastrConfig.preventDuplicates&&o!==null)return o;this.previousToastMessage=i;let l=!1;this.toastrConfig.maxOpened&&this.currentlyActive>=this.toastrConfig.maxOpened&&(l=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));let C=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;let U=i;i&&r.enableHtml&&(U=this.sanitizer.sanitize(Ht.HTML,i));let w=new At(C),st=new R(this.index,r,U,s,t,w),te=[{provide:R,useValue:st}],ee=J.create({providers:te,parent:this._injector}),ie=new Ot(r.toastComponent,ee),kt=C.attach(ie,r.newestOnTop);w.componentInstance=kt.instance;let rt={toastId:this.index,title:s||"",message:i||"",toastRef:w,onShown:w.afterActivate(),onHidden:w.afterClosed(),onTap:st.onTap(),onAction:st.onAction(),portal:kt};return l||(this.currentlyActive=this.currentlyActive+1,setTimeout(()=>{rt.toastRef.activate()})),this.toasts.push(rt),rt}static \u0275fac=function(i){return new(i||e)(S(Qt),S(Re),S(J),S(qt),S(bt))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),je=(()=>{class e{toastrService;toastPackage;ngZone;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";state;get _state(){return this.state()}get displayStyle(){if(this.state().value==="inactive")return"none"}timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.ngZone=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r}),this.state=M({value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.update(t=>F(c({},t),{value:"active"})),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.outsideTimeout(()=>this.remove(),this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.update(t=>F(c({},t),{value:"active"})),this.outsideTimeout(()=>this.remove(),this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10)}remove(){this.state().value!=="removed"&&(clearTimeout(this.timeout),this.state.update(t=>F(c({},t),{value:"removed"})),this.outsideTimeout(()=>this.toastrService.remove(this.toastPackage.toastId),+this.toastPackage.config.easeTime))}tapToast(){this.state().value!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state().value!=="removed"&&this.options.disableTimeOut!=="extendedTimeOut"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state().value==="removed"||(this.outsideTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&this.outsideInterval(()=>this.updateProgress(),10))}outsideTimeout(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.timeout=setTimeout(()=>this.runInsideAngular(t),i)):this.timeout=setTimeout(()=>t(),i)}outsideInterval(t,i){this.ngZone?this.ngZone.runOutsideAngular(()=>this.intervalId=setInterval(()=>this.runInsideAngular(t),i)):this.intervalId=setInterval(()=>t(),i)}runInsideAngular(t){this.ngZone?this.ngZone.run(()=>t()):t()}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(bt))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:5,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&($t("@flyInOut",s._state),v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,ye,3,0,"button",0)(1,Ce,3,5,"div",1)(2,we,1,3,"div",2)(3,De,2,4,"div",3)(4,Le,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,data:{animation:[Lt("flyInOut",[z("inactive",K({opacity:0})),z("active",K({opacity:1})),z("removed",K({opacity:0})),tt("inactive => active",X("{{ easeTime }}ms {{ easing }}")),tt("active => removed",X("{{ easeTime }}ms {{ easing }}"))])]},changeDetection:0})}return e})(),ke=F(c({},Jt),{toastComponent:je}),Pe=(e={})=>Nt([{provide:Qt,useValue:{default:ke,config:e}}]),Ti=(()=>{class e{static forRoot(t={}){return{ngModule:e,providers:[Pe(t)]}}static \u0275fac=function(i){return new(i||e)};static \u0275mod=vt({type:e});static \u0275inj=ht({})}return e})();var Me=(()=>{class e{toastrService;toastPackage;appRef;message;title;options;duplicatesCount;originalTimeout;width=M(-1);toastClasses="";get displayStyle(){return this.state()==="inactive"?"none":null}state=M("inactive");timeout;intervalId;hideTime;sub;sub1;sub2;sub3;constructor(t,i,s){this.toastrService=t,this.toastPackage=i,this.appRef=s,this.message=i.message,this.title=i.title,this.options=i.config,this.originalTimeout=i.config.timeOut,this.toastClasses=`${i.toastType} ${i.config.toastClass}`,this.sub=i.toastRef.afterActivate().subscribe(()=>{this.activateToast()}),this.sub1=i.toastRef.manualClosed().subscribe(()=>{this.remove()}),this.sub2=i.toastRef.timeoutReset().subscribe(()=>{this.resetTimeout()}),this.sub3=i.toastRef.countDuplicate().subscribe(r=>{this.duplicatesCount=r})}ngOnDestroy(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),this.sub3.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)}activateToast(){this.state.set("active"),!(this.options.disableTimeOut===!0||this.options.disableTimeOut==="timeOut")&&this.options.timeOut&&(this.timeout=setTimeout(()=>{this.remove()},this.options.timeOut),this.hideTime=new Date().getTime()+this.options.timeOut,this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))),this.options.onActivateTick&&this.appRef.tick()}updateProgress(){if(this.width()===0||this.width()===100||!this.options.timeOut)return;let t=new Date().getTime(),i=this.hideTime-t;this.width.set(i/this.options.timeOut*100),this.options.progressAnimation==="increasing"&&this.width.update(s=>100-s),this.width()<=0&&this.width.set(0),this.width()>=100&&this.width.set(100)}resetTimeout(){clearTimeout(this.timeout),clearInterval(this.intervalId),this.state.set("active"),this.options.timeOut=this.originalTimeout,this.timeout=setTimeout(()=>this.remove(),this.originalTimeout),this.hideTime=new Date().getTime()+(this.originalTimeout||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10))}remove(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.state.set("removed"),this.timeout=setTimeout(()=>this.toastrService.remove(this.toastPackage.toastId)))}tapToast(){this.state()!=="removed"&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())}stickAround(){this.state()!=="removed"&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width.set(0))}delayedHideToast(){this.options.disableTimeOut===!0||this.options.disableTimeOut==="extendedTimeOut"||this.options.extendedTimeOut===0||this.state()==="removed"||(this.timeout=setTimeout(()=>this.remove(),this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=new Date().getTime()+(this.options.timeOut||0),this.width.set(-1),this.options.progressBar&&(this.intervalId=setInterval(()=>this.updateProgress(),10)))}static \u0275fac=function(i){return new(i||e)(L(Wt),L(R),L(W))};static \u0275cmp=mt({type:e,selectors:[["","toast-component",""]],hostVars:4,hostBindings:function(i,s){i&1&&V("click",function(){return s.tapToast()})("mouseenter",function(){return s.stickAround()})("mouseleave",function(){return s.delayedHideToast()}),i&2&&(v(s.toastClasses),$("display",s.displayStyle))},attrs:Yt,decls:5,vars:5,consts:[["type","button","class","toast-close-button","aria-label","Close",3,"click",4,"ngIf"],[3,"class",4,"ngIf"],["role","alert",3,"class","innerHTML",4,"ngIf"],["role","alert",3,"class",4,"ngIf"],[4,"ngIf"],["type","button","aria-label","Close",1,"toast-close-button",3,"click"],["aria-hidden","true"],["role","alert",3,"innerHTML"],["role","alert"],[1,"toast-progress"]],template:function(i,s){i&1&&N(0,xe,3,0,"button",0)(1,Fe,3,5,"div",1)(2,Se,1,3,"div",2)(3,Oe,2,4,"div",3)(4,Ee,2,2,"div",4),i&2&&(h("ngIf",s.options.closeButton),a(),h("ngIf",s.title),a(),h("ngIf",s.message&&s.options.enableHtml),a(),h("ngIf",s.message&&!s.options.enableHtml),a(),h("ngIf",s.options.progressBar))},dependencies:[Ct],encapsulation:2,changeDetection:0})}return e})(),Ci=F(c({},Jt),{toastComponent:Me});var j={serverTarget:Xt().version,production:!0,socket:"",api:{base:(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/";return n.endsWith("/")?`${n}api`:`${n}/api`})(),socket:`${window.location.protocol==="http:"?"ws://":"wss://"}${window.location.host}`,origin:window.location.origin},jwt:{tokenKey:"access_token",allowedDomains:[document.location.host],disallowedRoutes:[(()=>{let n=document.querySelector("base")?.getAttribute("href")||"/",t=n.endsWith("/")?`${n}api`:`${n}/api`;return`${window.location.protocol}//${document.location.host}${t}/auth/login`})()]},apiHttpOptions:{},owm:{appid:"fec67b55f7f74deaa28df89ba6a60821"}};var Ei=(()=>{class e{$http=u(zt);get(t,i){return this.$http.get(`${j.api.base}${t}`,i)}post(t,i,s){return this.$http.post(`${j.api.base}${t}`,i,s)}put(t,i,s){return this.$http.put(`${j.api.base}${t}`,i,s)}patch(t,i,s){return this.$http.patch(`${j.api.base}${t}`,i,s)}delete(t,i){return this.$http.delete(`${j.api.base}${t}`,i)}static \u0275fac=function(i){return new(i||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{y as a,se as b,Lt as c,X as d,He as e,K as f,tt as g,wt as h,Dt as i,re as j,Ft as k,Ye as l,Je as m,Wt as n,Ti as o,j as p,Ei as q};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as n}from"./chunk-YMAWYUA6.js";import{b as s}from"./chunk-
|
|
1
|
+
import{d as n}from"./chunk-YMAWYUA6.js";import{b as s}from"./chunk-YBIXKSXT.js";import{ea as o,h as r,ja as e,w as i}from"./chunk-V2XN5VIX.js";var l=(()=>{class t{$router=e(n);$settings=e(s);canActivate(){return r(this,null,function*(){return this.$settings.settingsLoaded||(yield i(this.$settings.onSettingsLoaded)),this.$settings.env.setupWizardComplete===!1||this.$router.navigate(["/"]),!0})}static \u0275fac=function(a){return new(a||t)};static \u0275prov=o({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as t}from"./chunk-
|
|
1
|
+
import{c as t}from"./chunk-22UVENNJ.js";import{b as i}from"./chunk-74ETBIBO.js";import{Xa as r,fa as o}from"./chunk-V2XN5VIX.js";var f=(()=>{class e{static \u0275fac=function(s){return new(s||e)};static \u0275mod=r({type:e});static \u0275inj=o({providers:[t],imports:[i]})}return e})();export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as n}from"./chunk-
|
|
1
|
+
import{c as n}from"./chunk-GGG55BFS.js";import"./chunk-N3CMGFGQ.js";import{g as r}from"./chunk-YMAWYUA6.js";import"./chunk-YBIXKSXT.js";import"./chunk-IOMKPASZ.js";import{Xa as e,fa as o}from"./chunk-V2XN5VIX.js";var c=[{path:"",loadComponent:()=>import("./chunk-54LW2EIT.js").then(t=>t.SettingsComponent),canActivate:[n]}],m=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[r.forChild(c),r]})}return t})();var l=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=e({type:t});static \u0275inj=o({imports:[m]})}return t})();export{l as SettingsModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-O5Z6RUN6.js";import"./chunk-N3CMGFGQ.js";import{d as $}from"./chunk-YMAWYUA6.js";import{b as S}from"./chunk-YBIXKSXT.js";import{k as g,l as _,n as E,q as y}from"./chunk-IOMKPASZ.js";import{Ib as v,La as n,Vb as a,Wa as h,Wb as s,ja as o,lb as c,mb as d,mc as m,nc as l,vb as r,wb as i,xb as f}from"./chunk-V2XN5VIX.js";function T(t,u){if(t&1&&(r(0,"div",7),a(1),i()),t&2){let e=v();n(),s(e.error)}}function C(t,u){t&1&&(r(0,"p",9),a(1),m(2,"translate"),i(),r(3,"div",10)(4,"div",11),f(5,"i",12),i()()),t&2&&(n(),s(l(2,1,"restart.please_wait_while_server_restarts")))}function k(t,u){t&1&&(r(0,"div",8),a(1),m(2,"translate"),i()),t&2&&(n(),s(l(2,1,"platform.linux.long_time")))}var z=(()=>{class t{$api=o(y);$router=o($);$settings=o(S);$toastr=o(E);$translate=o(g);$ws=o(w);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/linux/restart-host",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{console.error(e),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"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.linux.server_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"]))})},3e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("platform.linux.server_taking_long_time"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},12e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=h({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-fw","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"]],template:function(p,x){p&1&&(r(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),r(4,"div",2)(5,"div",3),f(6,"i",4),i(),r(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),c(11,T,2,1,"div",7)(12,C,6,3),c(13,k,3,3,"div",8),i()()),p&2&&(n(2),s(l(3,4,"menu.restart.title")),n(7),s(l(10,6,"platform.linux.restarting_server")),n(2),d(x.error?11:12),n(2),d(x.timeout?13:-1))},dependencies:[_],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{z as RestartLinuxComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-AVBJ5EMT.js";import{a as se}from"./chunk-SGN6BUCA.js";import{g as Q,m as k,n as ae}from"./chunk-LXFVNKLD.js";import{B as A,C as G,b as q,c as F,d as g,e as V,f as z,g as N,j as S,m as R,p as O,q as L,r as J,z as re}from"./chunk-F7ZV2JBO.js";import{b as H}from"./chunk-4X7L4KQL.js";import{b as oe}from"./chunk-YMAWYUA6.js";import{a as xe}from"./chunk-64F5HSDQ.js";import{k as T,l as E,n as B,q as M}from"./chunk-NRHD2BXN.js";import{Ac as ne,Db as I,Gb as f,Ib as _,Kc as j,La as e,Vb as m,Wa as y,Wb as d,Xb as x,Yb as ee,g as ve,gc as D,h as W,hc as te,ja as c,kb as u,lb as w,mb as h,mc as a,nc as o,oa as $,ob as X,oc as ie,pa as U,pb as Y,qb as Z,rb as b,sb as i,tb as t,ub as p}from"./chunk-V2XN5VIX.js";function Ce(r,C){r&1&&(i(0,"ngb-alert",13)(1,"p",20),m(2),a(3,"translate"),t()()),r&2&&(b("dismissible",!1),e(2),d(o(3,2,"login.invalid_password")))}var me=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);invalidCredentials=!1;formGroup=new N({password:new S("",[g.required])});disable2fa(){this.invalidCredentials=!1,this.$api.post("/users/otp/deactivate",this.formGroup.value).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.setup_2fa_disable_success"),this.$translate.instant("toast.title_success"))},error:()=>{this.formGroup.setValue({password:""}),this.invalidCredentials=!0}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:34,vars:27,consts:[[1,"modal-content",2,"min-height","300px"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-key","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","password","autocomplete","current-password",1,"form-control","custom-input",3,"formControl","placeholder"],["type","error",1,"mt-3","mb-0",3,"dismissible"],[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-danger",3,"click","disabled"],[1,"mb-0"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),m(3),a(4,"translate"),t(),i(5,"button",3),a(6,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(7,"div",4)(8,"div",5),p(9,"i",6),t(),i(10,"ul",7)(11,"li"),m(12),a(13,"translate"),t()(),i(14,"ul",8)(15,"li",9)(16,"label",10),m(17),a(18,"translate"),t(),i(19,"div",11),p(20,"input",12),a(21,"translate"),t()()(),w(22,Ce,4,4,"ngb-alert",13),t(),i(23,"div",14)(24,"div",15)(25,"button",16),a(26,"translate"),f("click",function(){return l.dismissModal()}),m(27),a(28,"translate"),t()(),p(29,"div",17),i(30,"div",18)(31,"button",19),f("click",function(){return l.disable2fa()}),m(32),a(33,"translate"),t()()()()),s&2&&(e(3),d(o(4,11,"users.setup_2fa_disable")),e(2),u("aria-label",o(6,13,"form.button_close")),e(7),d(o(13,15,"users.setup_2fa_disable_current_password")),e(5),d(o(18,17,"users.label_password")),e(3),b("formControl",l.formGroup.controls.password)("placeholder",o(21,19,"users.label_password")),e(2),h(l.invalidCredentials&&!l.formGroup.controls.password.value?22:-1),e(3),u("aria-label",o(26,21,"form.button_close")),e(2),x(" ",o(28,23,"form.button_close")," "),e(4),b("disabled",l.formGroup.invalid),e(),x(" ",o(33,25,"form.button_disable")," "))},dependencies:[A,F,V,G,O,Q,E],encapsulation:2})}return r})();var pe=ve(xe(),1);var we=r=>({timeDiffError:r});function he(r,C){r&1&&(i(0,"li"),m(1),a(2,"translate"),t()),r&2&&(e(),d(o(2,1,"users.setup_2fa_scan_qr_code")))}function ge(r,C){if(r&1&&(i(0,"ngb-alert",8)(1,"p",16),m(2),a(3,"translate"),t(),i(4,"p",17),m(5),a(6,"translate"),t()()),r&2){let n=_();b("dismissible",!1),e(2),d(o(3,3,"users.setup_2fa_cannot_setup_2fa")),e(3),d(ie(6,5,"users.setup_2fa_server_time_out",D(8,we,n.timeDiffError)))}}function Se(r,C){r&1&&p(0,"i",27)}function ye(r,C){r&1&&p(0,"i",28)}function Ee(r,C){if(r&1){let n=I();i(0,"div",21),m(1),a(2,"translate"),p(3,"br"),m(4),i(5,"a",26),f("click",function(){$(n);let l=_(2);return U(l.copySecretToClipboard())}),w(6,Se,1,0,"i",27)(7,ye,1,0,"i",28),t()()}if(r&2){let n=_(2);e(),x(" ",o(2,3,"users.setup_2fa_scan_qr_manual")),e(3),x(" ",n.otpSecret," "),e(2),h(n.secretCopied?6:7)}}function $e(r,C){if(r&1&&(i(0,"ul",9)(1,"li",18)(2,"div",19),p(3,"app-qrcode",20),t(),w(4,Ee,8,5,"div",21),t(),i(5,"li",22)(6,"label",23),m(7),a(8,"translate"),t(),i(9,"div",24),p(10,"input",25),t()()()),r&2){let n=_();e(3),b("data",n.otpString),e(),h(n.otpSecret?4:-1),e(3),d(o(8,4,"users.setup_2fa_enter_code")),e(3),b("formControl",n.formGroup.controls.code)}}function Ue(r,C){if(r&1){let n=I();i(0,"button",29),a(1,"translate"),f("click",function(){$(n);let l=_();return U(l.dismissModal())}),m(2),a(3,"translate"),t()}r&2&&(u("aria-label",o(1,2,"form.button_close")),e(2),x(" ",o(3,4,"form.button_close")," "))}function ke(r,C){if(r&1){let n=I();i(0,"button",29),a(1,"translate"),f("click",function(){$(n);let l=_();return U(l.dismissModal())}),m(2),a(3,"translate"),t()}r&2&&(u("aria-label",o(1,2,"form.button_close")),e(2),x(" ",o(3,4,"form.button_close")," "))}function Te(r,C){if(r&1){let n=I();i(0,"button",30),f("click",function(){$(n);let l=_();return U(l.enable2fa())}),m(1),a(2,"translate"),t()}if(r&2){let n=_();b("disabled",n.formGroup.invalid),e(),x(" ",o(2,2,"form.button_enable")," ")}}var de=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);copyTimeout=null;user;timeDiffError=null;otpString;otpSecret;secretCopied=!1;formGroup=new N({code:new S("",[g.required,g.minLength(6),g.maxLength(6)])});ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:n=>{this.checkTimeDiff(n.timestamp),this.timeDiffError||(this.otpString=n.otpauth,this.otpSecret=new URL(this.otpString).searchParams.get("secret")||"")},error:n=>{this.$activeModal.dismiss(),console.error(n),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}enable2fa(){this.$api.post("/users/otp/activate",this.formGroup.value).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.setup_2fa_enabled_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close()},error:n=>{console.error(n),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}copySecretToClipboard(){return W(this,null,function*(){yield navigator.clipboard.writeText(this.otpSecret),this.secretCopied=!0,this.copyTimeout&&clearTimeout(this.copyTimeout),this.copyTimeout=setTimeout(()=>{this.secretCopied=!1},3e3)})}dismissModal(){this.$activeModal.dismiss("Dismiss")}checkTimeDiff(n){let s=(0,pe.default)(n).diff(new Date,"millisecond");s<-5e3||s>5e3?this.timeDiffError=s:this.timeDiffError=null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],inputs:{user:"user"},decls:24,vars:15,consts:[[1,"modal-content","setup2fa"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-key","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"list-group","list-group-box","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"disabled"],[1,"fw-bold","mb-1"],[1,"mb-0"],[1,"list-group-item","text-center"],[1,"text-center","w-100","d-flex","justify-content-center","my-2"],[1,"mx-auto",2,"width","175px","height","175px",3,"data"],[1,"grey-text","small","mt-0","mb-1"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","text","placeholder","eg. 123456","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*",1,"form-control","custom-input",3,"formControl"],["href","javascript:void(0)",1,"ms-1","text-primary",3,"click"],[1,"fas","fa-fw","fa-check","green-text"],[1,"fas","fa-fw","fa-copy"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),m(3),a(4,"translate"),t(),i(5,"button",3),a(6,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(7,"div",4)(8,"div",5),p(9,"i",6),t(),i(10,"ul",7)(11,"li"),m(12),a(13,"translate"),t(),w(14,he,3,3,"li"),t(),w(15,ge,7,10,"ngb-alert",8),w(16,$e,11,6,"ul",9),t(),i(17,"div",10)(18,"div",11),w(19,Ue,4,6,"button",12),t(),i(20,"div",13),w(21,ke,4,6,"button",12),t(),i(22,"div",14),w(23,Te,3,4,"button",15),t()()()),s&2&&(e(3),d(o(4,9,"users.setup_2fa")),e(2),u("aria-label",o(6,11,"form.button_close")),e(7),d(o(13,13,"users.setup_2fa_warning")),e(2),h(l.timeDiffError?-1:14),e(),h(l.timeDiffError?15:-1),e(),h(l.timeDiffError?-1:16),e(3),h(l.timeDiffError?-1:19),e(2),h(l.timeDiffError?21:-1),e(2),h(l.timeDiffError?-1:23))},dependencies:[Q,se,A,F,V,re,G,O,E],encapsulation:2})}return r})();var ce=r=>({"is-invalid":r}),ue=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);form=new N({username:new S("",[g.required]),name:new S("",[g.required]),password:new S("",[g.compose([g.required,g.minLength(4)])]),passwordConfirm:new S("",[g.required]),admin:new S(!0)},this.matchPassword);onSubmit({value:n}){this.$api.post("/users",n).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:s=>{this.$toastr.error(s.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}matchPassword(n){let s=n.get("password").value,l=n.get("passwordConfirm").value;if(s!==l)n.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:58,vars:50,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-user-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-username",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none",1,"form-control","custom-input"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","custom-input"],["for","form-pass",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","custom-input",3,"ngClass"],["for","form-pass-confirm",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","custom-input",3,"ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"text-end","grey-text","d-flex","align-items-center"],["formControlName","admin","type","checkbox","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"form",1),f("ngSubmit",function(){return l.onSubmit(l.form)}),i(2,"div",2)(3,"h5",3),m(4),a(5,"translate"),t(),i(6,"button",4),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",5)(9,"div",6),p(10,"i",7),t(),i(11,"ul",8)(12,"li",9)(13,"label",10),m(14),a(15,"translate"),t(),i(16,"div",11),p(17,"input",12),a(18,"translate"),t()(),i(19,"li",9)(20,"label",13),m(21),a(22,"translate"),t(),i(23,"div",11),p(24,"input",14),a(25,"translate"),t()(),i(26,"li",9)(27,"label",15),m(28),a(29,"translate"),t(),i(30,"div",11),p(31,"input",16),a(32,"translate"),t()(),i(33,"li",9)(34,"label",17),m(35),a(36,"translate"),t(),i(37,"div",11),p(38,"input",18),a(39,"translate"),t()(),i(40,"li",19)(41,"span",20),m(42),a(43,"translate"),t(),i(44,"div",21),p(45,"input",22),a(46,"translate"),p(47,"label",23),t()()()(),i(48,"div",24)(49,"div",20)(50,"button",25),f("click",function(){return l.dismissModal()}),m(51),a(52,"translate"),t()(),p(53,"div",26),i(54,"div",27)(55,"button",28),m(56),a(57,"translate"),t()()()()()),s&2&&(e(),b("formGroup",l.form),e(3),d(o(5,18,"users.title_add_user")),e(2),u("aria-label",o(7,20,"form.button_close")),e(8),d(o(15,22,"users.label_username")),e(3),u("aria-label",o(18,24,"users.label_username")),e(4),d(o(22,26,"users.label_full_name")),e(3),u("aria-label",o(25,28,"users.label_full_name")),e(4),d(o(29,30,"users.label_password")),e(3),b("ngClass",D(46,ce,l.form.controls.password.dirty&&l.form.controls.password.errors)),u("aria-label",o(32,32,"users.label_password")),e(4),d(o(36,34,"users.label_confirm_password")),e(3),b("ngClass",D(48,ce,l.form.controls.passwordConfirm.dirty&&l.form.controls.passwordConfirm.errors)),u("aria-label",o(39,36,"users.label_confirm_password")),e(4),d(o(43,38,"users.label_admin_user")),e(3),u("aria-label",o(46,40,"users.label_admin_user")),e(6),x(" ",o(52,42,"form.button_close")," "),e(4),b("disabled",!l.form.valid),e(),x(" ",o(57,44,"form.button_save")," "))},dependencies:[A,R,F,q,V,z,G,L,J,j,E],encapsulation:2})}return r})();var fe=r=>({"is-invalid":r});function Be(r,C){if(r&1&&(i(0,"li",9)(1,"label",27),m(2),a(3,"translate"),t(),i(4,"div",11),p(5,"input",28),a(6,"translate"),t()()),r&2){let n=_();e(2),d(o(3,3,"users.label_confirm_password")),e(3),b("ngClass",D(7,fe,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),u("aria-label",o(6,5,"users.label_confirm_password"))}}var be=(()=>{class r{$activeModal=c(k);$api=c(M);$auth=c(H);$cdr=c(ne);$toastr=c(B);$translate=c(T);initialFormValue={};user;isCurrentUser=!1;form=new N({username:new S("",[g.required]),name:new S("",[g.required]),password:new S(""),passwordConfirm:new S(""),admin:new S(!0)},this.matchPassword);ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user),this.initialFormValue=this.form.getRawValue(),this.form.valueChanges.subscribe(()=>this.$cdr.detectChanges())}onSubmit({value:n}){this.$api.patch(`/users/${this.user.id}`,n).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&n.username!==this.$auth.user.username&&this.$auth.logout()},error:s=>{console.error(s),this.$toastr.error(s.error?.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}isFormUnchanged(){return this.form.controls.password.value?!1:JSON.stringify(this.form.getRawValue())===JSON.stringify(this.initialFormValue)}dismissModal(){this.$activeModal.dismiss("Dismiss")}matchPassword(n){let s=n.get("password").value,l=n.get("passwordConfirm").value;if(s!==l)n.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],inputs:{user:"user"},decls:52,vars:42,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-user-pen","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-username",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["formControlName","username","type","text","id","form-username","autocomplete","off","autocapitalize","none",1,"form-control","custom-input"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","custom-input"],["for","form-pass",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","custom-input",3,"ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"],["for","form-pass-confirm",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","custom-input",3,"ngClass"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"form",1),f("ngSubmit",function(){return l.onSubmit(l.form)}),i(2,"div",2)(3,"h5",3),m(4),a(5,"translate"),t(),i(6,"button",4),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",5)(9,"div",6),p(10,"i",7),t(),i(11,"ul",8)(12,"li",9)(13,"label",10),m(14),a(15,"translate"),t(),i(16,"div",11),p(17,"input",12),a(18,"translate"),t()(),i(19,"li",9)(20,"label",13),m(21),a(22,"translate"),t(),i(23,"div",11),p(24,"input",14),a(25,"translate"),t()(),i(26,"li",9)(27,"label",15),m(28),a(29,"translate"),t(),i(30,"div",11),p(31,"input",16),a(32,"translate"),t()(),w(33,Be,7,9,"li",9),i(34,"li",17)(35,"span",18),m(36),a(37,"translate"),t(),i(38,"div",19),p(39,"input",20),a(40,"translate"),p(41,"label",21),t()()()(),i(42,"div",22)(43,"div",18)(44,"button",23),f("click",function(){return l.dismissModal()}),m(45),a(46,"translate"),t()(),p(47,"div",24),i(48,"div",25)(49,"button",26),m(50),a(51,"translate"),t()()()()()),s&2&&(e(),b("formGroup",l.form),e(3),d(o(5,16,"users.title_edit_user")),e(2),u("aria-label",o(7,18,"form.button_close")),e(8),d(o(15,20,"users.label_username")),e(3),u("aria-label",o(18,22,"users.label_username")),e(4),d(o(22,24,"users.label_full_name")),e(3),u("aria-label",o(25,26,"users.label_full_name")),e(4),d(o(29,28,"users.label_new_password")),e(3),b("ngClass",D(40,fe,l.form.controls.password.dirty&&l.form.controls.password.errors)),u("aria-label",o(32,30,"users.label_new_password")),e(2),h(l.form.controls.password.value?33:-1),e(3),d(o(37,32,"users.label_admin_user")),e(3),u("aria-label",o(40,34,"users.label_admin_user")),e(6),x(" ",o(46,36,"form.button_close")," "),e(4),b("disabled",!l.form.valid||l.isFormUnchanged()),e(),x(" ",o(51,38,"form.button_save")," "))},dependencies:[A,R,F,q,V,z,G,L,J,j,E],encapsulation:2})}return r})();var _e=(()=>{class r{$activeModal=c(k);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:46,vars:36,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-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"mb-2","grey-text"],[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(s,l){s&1&&(i(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),m(4),a(5,"translate"),t(),i(6,"button",3),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",4)(9,"div",5),p(10,"i",6),t(),i(11,"h5",7),m(12),a(13,"translate"),t(),i(14,"ul",8)(15,"li"),m(16),a(17,"translate"),t(),i(18,"ul",9)(19,"li"),m(20),a(21,"translate"),t(),i(22,"li"),m(23),a(24,"translate"),t(),i(25,"li"),m(26),a(27,"translate"),a(28,"translate"),t(),i(29,"li"),m(30),a(31,"translate"),t(),i(32,"li"),m(33),a(34,"translate"),t()(),i(35,"li"),m(36),a(37,"translate"),t()(),p(38,"app-support-banner"),t(),i(39,"div",10),p(40,"div",11),i(41,"div",12)(42,"button",13),f("click",function(){return l.dismissModal()}),m(43),a(44,"translate"),t()(),p(45,"div",14),t()()()),s&2&&(e(4),d(o(5,12,"support.title")),e(2),u("aria-label",o(7,14,"form.button_close")),e(6),d(o(13,16,"users.title_users")),e(4),d(o(17,18,"users.support.acc_1")),e(4),d(o(21,20,"menu.label_status")),e(3),d(o(24,22,"menu.label_plugins")),e(3),ee("",o(27,24,"menu.label_accessories")," (",o(28,26,"users.support.control"),")"),e(4),d(o(31,28,"menu.linux.label_logs")),e(3),d(o(34,30,"support.title")),e(3),d(o(37,32,"users.support.acc_2")),e(7),x(" ",o(44,34,"form.button_close")," "))},dependencies:[le,E],encapsulation:2})}return r})();var Me=(r,C)=>({"fa-user-secret":r,"fa-user":C});function Ie(r,C){if(r&1){let n=I();i(0,"button",23),f("click",function(){$(n);let l=_(2).$implicit,v=_();return U(v.disable2fa(l))}),m(1),a(2,"translate"),t()}if(r&2){let n=_(2).$implicit,s=_();b("disabled",n.username!==s.username),e(),x(" ",o(2,2,"users.setup_2fa_disable")," ")}}function De(r,C){if(r&1){let n=I();i(0,"button",24),f("click",function(){$(n);let l=_(2).$implicit,v=_();return U(v.setup2fa(l))}),m(1),a(2,"translate"),t()}if(r&2){let n=_(2).$implicit,s=_();b("disabled",n.username!==s.username),e(),x(" ",o(2,2,"users.setup_2fa")," ")}}function Fe(r,C){if(r&1&&w(0,Ie,3,4,"button",21)(1,De,3,4,"button",22),r&2){let n=_().$implicit;h(n.otpActive?0:1)}}function Ve(r,C){r&1&&p(0,"div")}function Ne(r,C){if(r&1){let n=I();i(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"span",13)(5,"h4"),m(6),t(),i(7,"h5",14),p(8,"i",15),m(9),t()()(),i(10,"div",16),w(11,Fe,2,1)(12,Ve,1,0,"div"),i(13,"div")(14,"button",17),a(15,"translate"),f("click",function(){let l=$(n).$implicit,v=_();return U(v.openEditUser(l))}),p(16,"i",18),t(),i(17,"button",19),a(18,"translate"),f("click",function(){let l=$(n).$implicit,v=_();return U(v.deleteUser(l.id))}),p(19,"i",20),t()()()()()()}if(r&2){let n=C.$implicit,s=_();e(6),d(n.name),e(2),b("ngClass",te(11,Me,n.admin,!n.admin)),e(),x(" ",n.username," "),e(2),h(n.admin?11:12),e(3),u("aria-label",o(15,7,"form.button_edit")),e(3),b("disabled",s.username===n.username),u("aria-label",o(18,9,"form.button_delete"))}}var zt=(()=>{class r{$api=c(M);$auth=c(H);$modal=c(ae);$route=c(oe);$toastr=c(B);$translate=c(T);homebridgeUsers=[];username=this.$auth.user.username;isAdmin=this.$auth.user.admin;ngOnInit(){this.$route.data.subscribe(n=>{this.homebridgeUsers=n.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(n=>{this.homebridgeUsers=n})}openAddNewUser(){this.$modal.open(ue,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(n){let s=this.$modal.open(be,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}deleteUser(n){this.$api.delete(`/users/${n}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:s=>{console.error(s),this.$toastr.error(s.error?.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(n){let s=this.$modal.open(de,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}disable2fa(n){let s=this.$modal.open(me,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}openSupport(){this.$modal.open(_e,{size:"lg",backdrop:"static"})}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["app-users"]],decls:15,vars:9,consts:[[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"btn","btn-elegant","waves-effect","m-0","me-2",3,"click"],[1,"fas","fa-fw","fa-user-plus"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"row"],[1,"col-md-6","mb-4"],[1,"card","card-body"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row","mb-3"],[1,"me-auto","my-0"],[1,"small","text-truncate","grey-text"],[1,"fas","fa-fw",3,"ngClass"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-elegant","m-0",3,"click"],[1,"fas","fa-fw","fa-user-pen"],[1,"btn","btn-danger","m-0","ms-2",3,"click","disabled"],[1,"fas","fa-fw","fa-trash"],[1,"btn","btn-elegant","m-0",3,"disabled"],[1,"btn","btn-primary","m-0",3,"disabled"],[1,"btn","btn-elegant","m-0",3,"click","disabled"],[1,"btn","btn-primary","m-0",3,"click","disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h3",2),m(3),a(4,"translate"),t()(),i(5,"div",3)(6,"button",4),a(7,"translate"),f("click",function(){return l.openAddNewUser()}),p(8,"i",5),t(),i(9,"button",6),a(10,"translate"),f("click",function(){return l.openSupport()}),p(11,"i",7),t()()(),i(12,"div",8),Y(13,Ne,20,14,"div",9,X),t()),s&2&&(e(3),d(o(4,3,"users.title_users")),e(3),u("aria-label",o(7,5,"users.button_add_user")),e(3),u("aria-label",o(10,7,"support.title")),e(4),Z(l.homebridgeUsers))},dependencies:[j,E],encapsulation:2})}return r})();export{zt as UsersComponent};
|
|
1
|
+
import{a as le}from"./chunk-NVVXFX5K.js";import{a as se}from"./chunk-SGN6BUCA.js";import{g as Q,m as k,n as ae}from"./chunk-LXFVNKLD.js";import{B as A,C as G,b as q,c as F,d as g,e as V,f as z,g as N,j as S,m as R,p as O,q as L,r as J,z as re}from"./chunk-F7ZV2JBO.js";import{b as H}from"./chunk-N3CMGFGQ.js";import{b as oe}from"./chunk-YMAWYUA6.js";import{a as xe}from"./chunk-YBIXKSXT.js";import{k as T,l as E,n as B,q as M}from"./chunk-IOMKPASZ.js";import{Ac as ne,Db as I,Gb as f,Ib as _,Kc as j,La as e,Vb as m,Wa as y,Wb as d,Xb as x,Yb as ee,g as ve,gc as D,h as W,hc as te,ja as c,kb as u,lb as w,mb as h,mc as a,nc as o,oa as $,ob as X,oc as ie,pa as U,pb as Y,qb as Z,rb as b,sb as i,tb as t,ub as p}from"./chunk-V2XN5VIX.js";function Ce(r,C){r&1&&(i(0,"ngb-alert",13)(1,"p",20),m(2),a(3,"translate"),t()()),r&2&&(b("dismissible",!1),e(2),d(o(3,2,"login.invalid_password")))}var me=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);invalidCredentials=!1;formGroup=new N({password:new S("",[g.required])});disable2fa(){this.invalidCredentials=!1,this.$api.post("/users/otp/deactivate",this.formGroup.value).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.setup_2fa_disable_success"),this.$translate.instant("toast.title_success"))},error:()=>{this.formGroup.setValue({password:""}),this.invalidCredentials=!0}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:34,vars:27,consts:[[1,"modal-content",2,"min-height","300px"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-key","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","password","autocomplete","current-password",1,"form-control","custom-input",3,"formControl","placeholder"],["type","error",1,"mt-3","mb-0",3,"dismissible"],[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-danger",3,"click","disabled"],[1,"mb-0"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),m(3),a(4,"translate"),t(),i(5,"button",3),a(6,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(7,"div",4)(8,"div",5),p(9,"i",6),t(),i(10,"ul",7)(11,"li"),m(12),a(13,"translate"),t()(),i(14,"ul",8)(15,"li",9)(16,"label",10),m(17),a(18,"translate"),t(),i(19,"div",11),p(20,"input",12),a(21,"translate"),t()()(),w(22,Ce,4,4,"ngb-alert",13),t(),i(23,"div",14)(24,"div",15)(25,"button",16),a(26,"translate"),f("click",function(){return l.dismissModal()}),m(27),a(28,"translate"),t()(),p(29,"div",17),i(30,"div",18)(31,"button",19),f("click",function(){return l.disable2fa()}),m(32),a(33,"translate"),t()()()()),s&2&&(e(3),d(o(4,11,"users.setup_2fa_disable")),e(2),u("aria-label",o(6,13,"form.button_close")),e(7),d(o(13,15,"users.setup_2fa_disable_current_password")),e(5),d(o(18,17,"users.label_password")),e(3),b("formControl",l.formGroup.controls.password)("placeholder",o(21,19,"users.label_password")),e(2),h(l.invalidCredentials&&!l.formGroup.controls.password.value?22:-1),e(3),u("aria-label",o(26,21,"form.button_close")),e(2),x(" ",o(28,23,"form.button_close")," "),e(4),b("disabled",l.formGroup.invalid),e(),x(" ",o(33,25,"form.button_disable")," "))},dependencies:[A,F,V,G,O,Q,E],encapsulation:2})}return r})();var pe=ve(xe(),1);var we=r=>({timeDiffError:r});function he(r,C){r&1&&(i(0,"li"),m(1),a(2,"translate"),t()),r&2&&(e(),d(o(2,1,"users.setup_2fa_scan_qr_code")))}function ge(r,C){if(r&1&&(i(0,"ngb-alert",8)(1,"p",16),m(2),a(3,"translate"),t(),i(4,"p",17),m(5),a(6,"translate"),t()()),r&2){let n=_();b("dismissible",!1),e(2),d(o(3,3,"users.setup_2fa_cannot_setup_2fa")),e(3),d(ie(6,5,"users.setup_2fa_server_time_out",D(8,we,n.timeDiffError)))}}function Se(r,C){r&1&&p(0,"i",27)}function ye(r,C){r&1&&p(0,"i",28)}function Ee(r,C){if(r&1){let n=I();i(0,"div",21),m(1),a(2,"translate"),p(3,"br"),m(4),i(5,"a",26),f("click",function(){$(n);let l=_(2);return U(l.copySecretToClipboard())}),w(6,Se,1,0,"i",27)(7,ye,1,0,"i",28),t()()}if(r&2){let n=_(2);e(),x(" ",o(2,3,"users.setup_2fa_scan_qr_manual")),e(3),x(" ",n.otpSecret," "),e(2),h(n.secretCopied?6:7)}}function $e(r,C){if(r&1&&(i(0,"ul",9)(1,"li",18)(2,"div",19),p(3,"app-qrcode",20),t(),w(4,Ee,8,5,"div",21),t(),i(5,"li",22)(6,"label",23),m(7),a(8,"translate"),t(),i(9,"div",24),p(10,"input",25),t()()()),r&2){let n=_();e(3),b("data",n.otpString),e(),h(n.otpSecret?4:-1),e(3),d(o(8,4,"users.setup_2fa_enter_code")),e(3),b("formControl",n.formGroup.controls.code)}}function Ue(r,C){if(r&1){let n=I();i(0,"button",29),a(1,"translate"),f("click",function(){$(n);let l=_();return U(l.dismissModal())}),m(2),a(3,"translate"),t()}r&2&&(u("aria-label",o(1,2,"form.button_close")),e(2),x(" ",o(3,4,"form.button_close")," "))}function ke(r,C){if(r&1){let n=I();i(0,"button",29),a(1,"translate"),f("click",function(){$(n);let l=_();return U(l.dismissModal())}),m(2),a(3,"translate"),t()}r&2&&(u("aria-label",o(1,2,"form.button_close")),e(2),x(" ",o(3,4,"form.button_close")," "))}function Te(r,C){if(r&1){let n=I();i(0,"button",30),f("click",function(){$(n);let l=_();return U(l.enable2fa())}),m(1),a(2,"translate"),t()}if(r&2){let n=_();b("disabled",n.formGroup.invalid),e(),x(" ",o(2,2,"form.button_enable")," ")}}var de=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);copyTimeout=null;user;timeDiffError=null;otpString;otpSecret;secretCopied=!1;formGroup=new N({code:new S("",[g.required,g.minLength(6),g.maxLength(6)])});ngOnInit(){this.$api.post("/users/otp/setup",{}).subscribe({next:n=>{this.checkTimeDiff(n.timestamp),this.timeDiffError||(this.otpString=n.otpauth,this.otpSecret=new URL(this.otpString).searchParams.get("secret")||"")},error:n=>{this.$activeModal.dismiss(),console.error(n),this.$toastr.error(this.$translate.instant("users.setup_2fa_enable_error"),this.$translate.instant("toast.title_error"))}})}enable2fa(){this.$api.post("/users/otp/activate",this.formGroup.value).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.setup_2fa_enabled_success"),this.$translate.instant("toast.title_success")),this.$activeModal.close()},error:n=>{console.error(n),this.$toastr.error(this.$translate.instant("users.setup_2fa_activate_error"),this.$translate.instant("toast.title_error"))}})}copySecretToClipboard(){return W(this,null,function*(){yield navigator.clipboard.writeText(this.otpSecret),this.secretCopied=!0,this.copyTimeout&&clearTimeout(this.copyTimeout),this.copyTimeout=setTimeout(()=>{this.secretCopied=!1},3e3)})}dismissModal(){this.$activeModal.dismiss("Dismiss")}checkTimeDiff(n){let s=(0,pe.default)(n).diff(new Date,"millisecond");s<-5e3||s>5e3?this.timeDiffError=s:this.timeDiffError=null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],inputs:{user:"user"},decls:24,vars:15,consts:[[1,"modal-content","setup2fa"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-key","primary-text",2,"font-size","75px"],[1,"mb-3"],["type","error",1,"mb-0",3,"dismissible"],[1,"list-group","list-group-box","mb-0"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"disabled"],[1,"fw-bold","mb-1"],[1,"mb-0"],[1,"list-group-item","text-center"],[1,"text-center","w-100","d-flex","justify-content-center","my-2"],[1,"mx-auto",2,"width","175px","height","175px",3,"data"],[1,"grey-text","small","mt-0","mb-1"],[1,"list-group-item","d-flex","flex-column","flex-md-row","align-items-center"],[1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["type","text","placeholder","eg. 123456","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*",1,"form-control","custom-input",3,"formControl"],["href","javascript:void(0)",1,"ms-1","text-primary",3,"click"],[1,"fas","fa-fw","fa-check","green-text"],[1,"fas","fa-fw","fa-copy"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],["type","button","data-bs-dismiss","modal",1,"btn","btn-primary",3,"click","disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),m(3),a(4,"translate"),t(),i(5,"button",3),a(6,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(7,"div",4)(8,"div",5),p(9,"i",6),t(),i(10,"ul",7)(11,"li"),m(12),a(13,"translate"),t(),w(14,he,3,3,"li"),t(),w(15,ge,7,10,"ngb-alert",8),w(16,$e,11,6,"ul",9),t(),i(17,"div",10)(18,"div",11),w(19,Ue,4,6,"button",12),t(),i(20,"div",13),w(21,ke,4,6,"button",12),t(),i(22,"div",14),w(23,Te,3,4,"button",15),t()()()),s&2&&(e(3),d(o(4,9,"users.setup_2fa")),e(2),u("aria-label",o(6,11,"form.button_close")),e(7),d(o(13,13,"users.setup_2fa_warning")),e(2),h(l.timeDiffError?-1:14),e(),h(l.timeDiffError?15:-1),e(),h(l.timeDiffError?-1:16),e(3),h(l.timeDiffError?-1:19),e(2),h(l.timeDiffError?21:-1),e(2),h(l.timeDiffError?-1:23))},dependencies:[Q,se,A,F,V,re,G,O,E],encapsulation:2})}return r})();var ce=r=>({"is-invalid":r}),ue=(()=>{class r{$activeModal=c(k);$api=c(M);$toastr=c(B);$translate=c(T);form=new N({username:new S("",[g.required]),name:new S("",[g.required]),password:new S("",[g.compose([g.required,g.minLength(4)])]),passwordConfirm:new S("",[g.required]),admin:new S(!0)},this.matchPassword);onSubmit({value:n}){this.$api.post("/users",n).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_added_new_user"),this.$translate.instant("toast.title_success"))},error:s=>{this.$toastr.error(s.error.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}dismissModal(){this.$activeModal.dismiss("Dismiss")}matchPassword(n){let s=n.get("password").value,l=n.get("passwordConfirm").value;if(s!==l)n.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:58,vars:50,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-user-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-username",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["formControlName","username","type","text","id","form-username","autocomplete","username","autocapitalize","none",1,"form-control","custom-input"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","custom-input"],["for","form-pass",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","custom-input",3,"ngClass"],["for","form-pass-confirm",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","custom-input",3,"ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"text-end","grey-text","d-flex","align-items-center"],["formControlName","admin","type","checkbox","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"form",1),f("ngSubmit",function(){return l.onSubmit(l.form)}),i(2,"div",2)(3,"h5",3),m(4),a(5,"translate"),t(),i(6,"button",4),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",5)(9,"div",6),p(10,"i",7),t(),i(11,"ul",8)(12,"li",9)(13,"label",10),m(14),a(15,"translate"),t(),i(16,"div",11),p(17,"input",12),a(18,"translate"),t()(),i(19,"li",9)(20,"label",13),m(21),a(22,"translate"),t(),i(23,"div",11),p(24,"input",14),a(25,"translate"),t()(),i(26,"li",9)(27,"label",15),m(28),a(29,"translate"),t(),i(30,"div",11),p(31,"input",16),a(32,"translate"),t()(),i(33,"li",9)(34,"label",17),m(35),a(36,"translate"),t(),i(37,"div",11),p(38,"input",18),a(39,"translate"),t()(),i(40,"li",19)(41,"span",20),m(42),a(43,"translate"),t(),i(44,"div",21),p(45,"input",22),a(46,"translate"),p(47,"label",23),t()()()(),i(48,"div",24)(49,"div",20)(50,"button",25),f("click",function(){return l.dismissModal()}),m(51),a(52,"translate"),t()(),p(53,"div",26),i(54,"div",27)(55,"button",28),m(56),a(57,"translate"),t()()()()()),s&2&&(e(),b("formGroup",l.form),e(3),d(o(5,18,"users.title_add_user")),e(2),u("aria-label",o(7,20,"form.button_close")),e(8),d(o(15,22,"users.label_username")),e(3),u("aria-label",o(18,24,"users.label_username")),e(4),d(o(22,26,"users.label_full_name")),e(3),u("aria-label",o(25,28,"users.label_full_name")),e(4),d(o(29,30,"users.label_password")),e(3),b("ngClass",D(46,ce,l.form.controls.password.dirty&&l.form.controls.password.errors)),u("aria-label",o(32,32,"users.label_password")),e(4),d(o(36,34,"users.label_confirm_password")),e(3),b("ngClass",D(48,ce,l.form.controls.passwordConfirm.dirty&&l.form.controls.passwordConfirm.errors)),u("aria-label",o(39,36,"users.label_confirm_password")),e(4),d(o(43,38,"users.label_admin_user")),e(3),u("aria-label",o(46,40,"users.label_admin_user")),e(6),x(" ",o(52,42,"form.button_close")," "),e(4),b("disabled",!l.form.valid),e(),x(" ",o(57,44,"form.button_save")," "))},dependencies:[A,R,F,q,V,z,G,L,J,j,E],encapsulation:2})}return r})();var fe=r=>({"is-invalid":r});function Be(r,C){if(r&1&&(i(0,"li",9)(1,"label",27),m(2),a(3,"translate"),t(),i(4,"div",11),p(5,"input",28),a(6,"translate"),t()()),r&2){let n=_();e(2),d(o(3,3,"users.label_confirm_password")),e(3),b("ngClass",D(7,fe,n.form.controls.passwordConfirm.dirty&&n.form.controls.passwordConfirm.errors)),u("aria-label",o(6,5,"users.label_confirm_password"))}}var be=(()=>{class r{$activeModal=c(k);$api=c(M);$auth=c(H);$cdr=c(ne);$toastr=c(B);$translate=c(T);initialFormValue={};user;isCurrentUser=!1;form=new N({username:new S("",[g.required]),name:new S("",[g.required]),password:new S(""),passwordConfirm:new S(""),admin:new S(!0)},this.matchPassword);ngOnInit(){this.isCurrentUser=this.$auth.user.username===this.user.username,this.form.patchValue(this.user),this.initialFormValue=this.form.getRawValue(),this.form.valueChanges.subscribe(()=>this.$cdr.detectChanges())}onSubmit({value:n}){this.$api.patch(`/users/${this.user.id}`,n).subscribe({next:()=>{this.$activeModal.close(),this.$toastr.success(this.$translate.instant("users.toast_updated_user"),this.$translate.instant("toast.title_success")),this.isCurrentUser&&n.username!==this.$auth.user.username&&this.$auth.logout()},error:s=>{console.error(s),this.$toastr.error(s.error?.message||this.$translate.instant("users.toast_failed_to_add_user"),this.$translate.instant("toast.title_error"))}})}isFormUnchanged(){return this.form.controls.password.value?!1:JSON.stringify(this.form.getRawValue())===JSON.stringify(this.initialFormValue)}dismissModal(){this.$activeModal.dismiss("Dismiss")}matchPassword(n){let s=n.get("password").value,l=n.get("passwordConfirm").value;if(s!==l)n.get("passwordConfirm").setErrors({matchPassword:!0});else return null}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],inputs:{user:"user"},decls:52,vars:42,consts:[[1,"modal-content"],["novalidate","",3,"ngSubmit","formGroup"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-user-pen","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-username",1,"mb-2","mb-md-0","w-100","w-md-50"],[1,"text-start","text-md-end","w-100","w-md-50"],["formControlName","username","type","text","id","form-username","autocomplete","off","autocapitalize","none",1,"form-control","custom-input"],["for","form-name",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","name","type","text","id","form-name","autocomplete","name",1,"form-control","custom-input"],["for","form-pass",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","password","type","password","autocomplete","new-password","id","form-pass",1,"form-control","custom-input",3,"ngClass"],[1,"list-group-item","d-flex","justify-content-between","align-items-center","flex-row","pb-2"],[1,"text-start"],[1,"text-end","grey-text","d-flex","align-items-center"],["type","checkbox","formControlName","admin","id","isAdmin",1,"rendux-input"],["for","isAdmin",1,"rendux-label","ms-3"],[1,"modal-footer","justify-content-between"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"text-center"],[1,"text-end"],["type","submit",1,"btn","btn-primary",3,"disabled"],["for","form-pass-confirm",1,"mb-2","mb-md-0","w-100","w-md-50"],["formControlName","passwordConfirm","type","password","autocomplete","new-password","id","form-pass-confirm",1,"form-control","custom-input",3,"ngClass"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"form",1),f("ngSubmit",function(){return l.onSubmit(l.form)}),i(2,"div",2)(3,"h5",3),m(4),a(5,"translate"),t(),i(6,"button",4),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",5)(9,"div",6),p(10,"i",7),t(),i(11,"ul",8)(12,"li",9)(13,"label",10),m(14),a(15,"translate"),t(),i(16,"div",11),p(17,"input",12),a(18,"translate"),t()(),i(19,"li",9)(20,"label",13),m(21),a(22,"translate"),t(),i(23,"div",11),p(24,"input",14),a(25,"translate"),t()(),i(26,"li",9)(27,"label",15),m(28),a(29,"translate"),t(),i(30,"div",11),p(31,"input",16),a(32,"translate"),t()(),w(33,Be,7,9,"li",9),i(34,"li",17)(35,"span",18),m(36),a(37,"translate"),t(),i(38,"div",19),p(39,"input",20),a(40,"translate"),p(41,"label",21),t()()()(),i(42,"div",22)(43,"div",18)(44,"button",23),f("click",function(){return l.dismissModal()}),m(45),a(46,"translate"),t()(),p(47,"div",24),i(48,"div",25)(49,"button",26),m(50),a(51,"translate"),t()()()()()),s&2&&(e(),b("formGroup",l.form),e(3),d(o(5,16,"users.title_edit_user")),e(2),u("aria-label",o(7,18,"form.button_close")),e(8),d(o(15,20,"users.label_username")),e(3),u("aria-label",o(18,22,"users.label_username")),e(4),d(o(22,24,"users.label_full_name")),e(3),u("aria-label",o(25,26,"users.label_full_name")),e(4),d(o(29,28,"users.label_new_password")),e(3),b("ngClass",D(40,fe,l.form.controls.password.dirty&&l.form.controls.password.errors)),u("aria-label",o(32,30,"users.label_new_password")),e(2),h(l.form.controls.password.value?33:-1),e(3),d(o(37,32,"users.label_admin_user")),e(3),u("aria-label",o(40,34,"users.label_admin_user")),e(6),x(" ",o(46,36,"form.button_close")," "),e(4),b("disabled",!l.form.valid||l.isFormUnchanged()),e(),x(" ",o(51,38,"form.button_save")," "))},dependencies:[A,R,F,q,V,z,G,L,J,j,E],encapsulation:2})}return r})();var _e=(()=>{class r{$activeModal=c(k);dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["ng-component"]],decls:46,vars:36,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-fw","fa-question-circle-o","primary-text",2,"font-size","75px"],[1,"ms-2"],[1,"mb-0"],[1,"mb-2","grey-text"],[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(s,l){s&1&&(i(0,"div",0)(1,"form")(2,"div",1)(3,"h5",2),m(4),a(5,"translate"),t(),i(6,"button",3),a(7,"translate"),f("click",function(){return l.dismissModal()}),t()(),i(8,"div",4)(9,"div",5),p(10,"i",6),t(),i(11,"h5",7),m(12),a(13,"translate"),t(),i(14,"ul",8)(15,"li"),m(16),a(17,"translate"),t(),i(18,"ul",9)(19,"li"),m(20),a(21,"translate"),t(),i(22,"li"),m(23),a(24,"translate"),t(),i(25,"li"),m(26),a(27,"translate"),a(28,"translate"),t(),i(29,"li"),m(30),a(31,"translate"),t(),i(32,"li"),m(33),a(34,"translate"),t()(),i(35,"li"),m(36),a(37,"translate"),t()(),p(38,"app-support-banner"),t(),i(39,"div",10),p(40,"div",11),i(41,"div",12)(42,"button",13),f("click",function(){return l.dismissModal()}),m(43),a(44,"translate"),t()(),p(45,"div",14),t()()()),s&2&&(e(4),d(o(5,12,"support.title")),e(2),u("aria-label",o(7,14,"form.button_close")),e(6),d(o(13,16,"users.title_users")),e(4),d(o(17,18,"users.support.acc_1")),e(4),d(o(21,20,"menu.label_status")),e(3),d(o(24,22,"menu.label_plugins")),e(3),ee("",o(27,24,"menu.label_accessories")," (",o(28,26,"users.support.control"),")"),e(4),d(o(31,28,"menu.linux.label_logs")),e(3),d(o(34,30,"support.title")),e(3),d(o(37,32,"users.support.acc_2")),e(7),x(" ",o(44,34,"form.button_close")," "))},dependencies:[le,E],encapsulation:2})}return r})();var Me=(r,C)=>({"fa-user-secret":r,"fa-user":C});function Ie(r,C){if(r&1){let n=I();i(0,"button",23),f("click",function(){$(n);let l=_(2).$implicit,v=_();return U(v.disable2fa(l))}),m(1),a(2,"translate"),t()}if(r&2){let n=_(2).$implicit,s=_();b("disabled",n.username!==s.username),e(),x(" ",o(2,2,"users.setup_2fa_disable")," ")}}function De(r,C){if(r&1){let n=I();i(0,"button",24),f("click",function(){$(n);let l=_(2).$implicit,v=_();return U(v.setup2fa(l))}),m(1),a(2,"translate"),t()}if(r&2){let n=_(2).$implicit,s=_();b("disabled",n.username!==s.username),e(),x(" ",o(2,2,"users.setup_2fa")," ")}}function Fe(r,C){if(r&1&&w(0,Ie,3,4,"button",21)(1,De,3,4,"button",22),r&2){let n=_().$implicit;h(n.otpActive?0:1)}}function Ve(r,C){r&1&&p(0,"div")}function Ne(r,C){if(r&1){let n=I();i(0,"div",9)(1,"div",10)(2,"div",11)(3,"div",12)(4,"span",13)(5,"h4"),m(6),t(),i(7,"h5",14),p(8,"i",15),m(9),t()()(),i(10,"div",16),w(11,Fe,2,1)(12,Ve,1,0,"div"),i(13,"div")(14,"button",17),a(15,"translate"),f("click",function(){let l=$(n).$implicit,v=_();return U(v.openEditUser(l))}),p(16,"i",18),t(),i(17,"button",19),a(18,"translate"),f("click",function(){let l=$(n).$implicit,v=_();return U(v.deleteUser(l.id))}),p(19,"i",20),t()()()()()()}if(r&2){let n=C.$implicit,s=_();e(6),d(n.name),e(2),b("ngClass",te(11,Me,n.admin,!n.admin)),e(),x(" ",n.username," "),e(2),h(n.admin?11:12),e(3),u("aria-label",o(15,7,"form.button_edit")),e(3),b("disabled",s.username===n.username),u("aria-label",o(18,9,"form.button_delete"))}}var zt=(()=>{class r{$api=c(M);$auth=c(H);$modal=c(ae);$route=c(oe);$toastr=c(B);$translate=c(T);homebridgeUsers=[];username=this.$auth.user.username;isAdmin=this.$auth.user.admin;ngOnInit(){this.$route.data.subscribe(n=>{this.homebridgeUsers=n.homebridgeUsers})}reloadUsers(){return this.$api.get("/users").subscribe(n=>{this.homebridgeUsers=n})}openAddNewUser(){this.$modal.open(ue,{size:"lg",backdrop:"static"}).result.finally(()=>{this.reloadUsers()})}openEditUser(n){let s=this.$modal.open(be,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}deleteUser(n){this.$api.delete(`/users/${n}`).subscribe({next:()=>{this.$toastr.success(this.$translate.instant("users.toast_user_deleted"),this.$translate.instant("toast.title_success")),this.reloadUsers()},error:s=>{console.error(s),this.$toastr.error(s.error?.message||this.$translate.instant("users.toast_failed_to_delete_user"),this.$translate.instant("toast.title_error"))}})}setup2fa(n){let s=this.$modal.open(de,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}disable2fa(n){let s=this.$modal.open(me,{size:"lg",backdrop:"static"});s.componentInstance.user=n,s.result.finally(()=>{this.reloadUsers()})}openSupport(){this.$modal.open(_e,{size:"lg",backdrop:"static"})}static \u0275fac=function(s){return new(s||r)};static \u0275cmp=y({type:r,selectors:[["app-users"]],decls:15,vars:9,consts:[[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],[1,"btn","btn-elegant","waves-effect","m-0","me-2",3,"click"],[1,"fas","fa-fw","fa-user-plus"],["type","button",1,"btn","btn-elegant","my-0","me-0",3,"click"],[1,"fa","fa-fw","fa-question-circle-o"],[1,"row"],[1,"col-md-6","mb-4"],[1,"card","card-body"],[1,"d-flex","flex-column"],[1,"d-flex","flex-row","mb-3"],[1,"me-auto","my-0"],[1,"small","text-truncate","grey-text"],[1,"fas","fa-fw",3,"ngClass"],[1,"d-flex","flex-row","justify-content-between"],[1,"btn","btn-elegant","m-0",3,"click"],[1,"fas","fa-fw","fa-user-pen"],[1,"btn","btn-danger","m-0","ms-2",3,"click","disabled"],[1,"fas","fa-fw","fa-trash"],[1,"btn","btn-elegant","m-0",3,"disabled"],[1,"btn","btn-primary","m-0",3,"disabled"],[1,"btn","btn-elegant","m-0",3,"click","disabled"],[1,"btn","btn-primary","m-0",3,"click","disabled"]],template:function(s,l){s&1&&(i(0,"div",0)(1,"div",1)(2,"h3",2),m(3),a(4,"translate"),t()(),i(5,"div",3)(6,"button",4),a(7,"translate"),f("click",function(){return l.openAddNewUser()}),p(8,"i",5),t(),i(9,"button",6),a(10,"translate"),f("click",function(){return l.openSupport()}),p(11,"i",7),t()()(),i(12,"div",8),Y(13,Ne,20,14,"div",9,X),t()),s&2&&(e(3),d(o(4,3,"users.title_users")),e(3),u("aria-label",o(7,5,"users.button_add_user")),e(3),u("aria-label",o(10,7,"support.title")),e(4),Z(l.homebridgeUsers))},dependencies:[j,E],encapsulation:2})}return r})();export{zt as UsersComponent};
|