homebridge-config-ui-x 5.4.2-beta.8 → 5.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +15 -5
  2. package/dist/core/config/config.service.d.ts +1 -1
  3. package/dist/core/config/config.service.js +2 -2
  4. package/dist/core/config/config.service.js.map +1 -1
  5. package/dist/core/config/config.startup.js +3 -3
  6. package/dist/core/config/config.startup.js.map +1 -1
  7. package/package.json +8 -8
  8. package/public/3rdpartylicenses.txt +29 -1
  9. package/public/assets/hap-icons/light-bulb.svg +25 -0
  10. package/public/assets/hap-icons/outlet.svg +25 -0
  11. package/public/assets/hap-icons/switch.svg +25 -0
  12. package/public/assets/hap-icons/unknown.svg +25 -0
  13. package/public/{chunk-O3SGSKKI.js → chunk-2TN4MWRG.js} +1 -1
  14. package/public/{chunk-HG4HVFLB.js → chunk-4HE4ZOV2.js} +1 -1
  15. package/public/{chunk-55FCKDDQ.js → chunk-4VRTWDLC.js} +1 -1
  16. package/public/{chunk-I2TETZLW.js → chunk-5PCDPQTV.js} +1 -1
  17. package/public/{chunk-V2P2FPJ7.js → chunk-6BYNCIUB.js} +1 -1
  18. package/public/chunk-6NTI6OJP.js +1 -0
  19. package/public/chunk-6U5EVCLL.js +1 -0
  20. package/public/chunk-6XPBXGXL.js +1 -0
  21. package/public/{chunk-UHWT4HS2.js → chunk-6ZQMSK4C.js} +1 -1
  22. package/public/{chunk-DASXSZCK.js → chunk-APPIBA3A.js} +1 -1
  23. package/public/chunk-BLACXXS5.js +1 -0
  24. package/public/{chunk-H3PPMCMP.js → chunk-CDYGLUTV.js} +1 -1
  25. package/public/{chunk-RQFAIEO7.js → chunk-CH37ERZR.js} +1 -1
  26. package/public/{chunk-CNMM42I5.js → chunk-CHVOUSYH.js} +1 -1
  27. package/public/chunk-CNO7HM45.js +1 -0
  28. package/public/{chunk-ILM36GEA.js → chunk-COTJCJ2Q.js} +1 -1
  29. package/public/chunk-DA7RMT4Z.js +12 -0
  30. package/public/{chunk-3P4RM2BA.js → chunk-EJCUIKT3.js} +1 -1
  31. package/public/{chunk-5TCYRJ6A.js → chunk-EQZV7W2F.js} +1 -1
  32. package/public/chunk-ESVHJP54.js +1 -0
  33. package/public/{chunk-RSIANNNF.js → chunk-FWGBG4GE.js} +1 -1
  34. package/public/chunk-FY5GOYXM.js +1 -0
  35. package/public/chunk-GK2FJAIA.js +9 -0
  36. package/public/{chunk-YNFL6Q3L.js → chunk-HJJYHJFU.js} +1 -1
  37. package/public/{chunk-465U4FZV.js → chunk-IISL7R2U.js} +1 -1
  38. package/public/{chunk-F6PYAH7Z.js → chunk-JKYIXL2W.js} +1 -1
  39. package/public/{chunk-Y6KHINTU.js → chunk-JLXHBDV4.js} +2 -2
  40. package/public/{chunk-YAA5O4PJ.js → chunk-JU5TVELH.js} +1 -1
  41. package/public/{chunk-BYV54PEG.js → chunk-KYYR7BKL.js} +1 -1
  42. package/public/{chunk-TGOCI72Q.js → chunk-L2Z3AXVM.js} +1 -1
  43. package/public/chunk-LCNBB75Q.js +1 -0
  44. package/public/{chunk-PSIKVTV4.js → chunk-LJ2VDV7E.js} +1 -1
  45. package/public/{chunk-ZHPB347D.js → chunk-LVQGJ2B5.js} +1 -1
  46. package/public/{chunk-JSC6PYTD.js → chunk-LYUFPCJS.js} +1 -1
  47. package/public/{chunk-4WAU3AJS.js → chunk-MCHXOMUK.js} +1 -1
  48. package/public/{chunk-BU65ZOCD.js → chunk-MNU7VJ4F.js} +1 -1
  49. package/public/{chunk-LPHTUMGC.js → chunk-MPEVLH5I.js} +1 -1
  50. package/public/{chunk-2GB56HTN.js → chunk-MSFNTB56.js} +1 -1
  51. package/public/chunk-O4QZ4POF.js +2 -0
  52. package/public/{chunk-NFWGYMP7.js → chunk-OCIXLP3Q.js} +1 -1
  53. package/public/{chunk-2RM2ZIP4.js → chunk-OIGVYJ2D.js} +1 -1
  54. package/public/chunk-OTQCO6QF.js +4 -0
  55. package/public/{chunk-YATJTZML.js → chunk-PETLNERF.js} +2 -2
  56. package/public/{chunk-OVKGLIQA.js → chunk-PM76DNNB.js} +1 -1
  57. package/public/{chunk-WMTKD5YY.js → chunk-PSA5BJ4O.js} +1 -1
  58. package/public/{chunk-M5FWDVIL.js → chunk-PT7VJPA5.js} +1 -1
  59. package/public/chunk-PXTRJNWG.js +30 -0
  60. package/public/{chunk-LUUY2SYK.js → chunk-Q47QL6G5.js} +1 -1
  61. package/public/chunk-Q6EFZDOI.js +1 -0
  62. package/public/{chunk-6AV3Q7A4.js → chunk-QA4W42HX.js} +1 -1
  63. package/public/chunk-QBUMDNNR.js +1 -0
  64. package/public/{chunk-EA3EXGPZ.js → chunk-QUAAVQGQ.js} +2 -2
  65. package/public/{chunk-TK3Z5QBS.js → chunk-QUNHDVU7.js} +1 -1
  66. package/public/chunk-RD5FVAI2.js +4 -0
  67. package/public/{chunk-77JZBWAC.js → chunk-RKGFBHJG.js} +1 -1
  68. package/public/chunk-TGY4SBYK.js +20 -0
  69. package/public/chunk-TJXKMEJL.js +1 -0
  70. package/public/{chunk-PBA72Y7F.js → chunk-V2CYUM6X.js} +1 -1
  71. package/public/chunk-VDXOHOIZ.js +23 -0
  72. package/public/{chunk-ZMKY2XSO.js → chunk-VEO6347U.js} +1 -1
  73. package/public/{chunk-FELMUB4D.js → chunk-VPT3FTAG.js} +1 -1
  74. package/public/{chunk-SMYT4RBA.js → chunk-WBSZIAJG.js} +1 -1
  75. package/public/{chunk-NJOBXAPT.js → chunk-X4BK4EIR.js} +1 -1
  76. package/public/{chunk-2OYNBG2N.js → chunk-X5R4UHSV.js} +1 -1
  77. package/public/{chunk-FGCUDKSH.js → chunk-XFT7CDBN.js} +1 -1
  78. package/public/chunk-XNPJRZJU.js +3 -0
  79. package/public/chunk-Z5XI7ADB.js +1 -0
  80. package/public/{chunk-LVUMUQV7.js → chunk-ZEHWCP2W.js} +1 -1
  81. package/public/chunk-ZESBGGVH.js +1 -0
  82. package/public/index.html +2 -2
  83. package/public/{main-RLR5VDBK.js → main-UIFNF6J4.js} +1 -1
  84. package/public/polyfills-5KWHJ7II.js +2 -0
  85. package/public/styles-YBNX7ZGB.css +1 -0
  86. package/public/chunk-2BOBWHVT.js +0 -23
  87. package/public/chunk-4NMZRHR6.js +0 -1
  88. package/public/chunk-6GMXEQVA.js +0 -2
  89. package/public/chunk-AE7VAWOU.js +0 -9
  90. package/public/chunk-BDFT33ET.js +0 -1
  91. package/public/chunk-BI3O3AIO.js +0 -4
  92. package/public/chunk-D3JHDB7S.js +0 -1
  93. package/public/chunk-DT2WDJ2I.js +0 -1
  94. package/public/chunk-G7FA4DP4.js +0 -1
  95. package/public/chunk-GKQ4M2JD.js +0 -1
  96. package/public/chunk-H36QJYLQ.js +0 -4
  97. package/public/chunk-I5ZTZWWC.js +0 -1
  98. package/public/chunk-LJCIV6Z3.js +0 -1
  99. package/public/chunk-LWTXCMFH.js +0 -1
  100. package/public/chunk-R5BOGDS2.js +0 -30
  101. package/public/chunk-U6PYN4II.js +0 -1
  102. package/public/chunk-UOLP7IQJ.js +0 -1
  103. package/public/chunk-WFXGDJ4B.js +0 -20
  104. package/public/chunk-Y752BA6L.js +0 -1
  105. package/public/chunk-YLIPTO6D.js +0 -40
  106. package/public/chunk-YRIAJM6Y.js +0 -1
  107. package/public/chunk-ZNJ3LVKA.js +0 -3
  108. package/public/polyfills-WE4HA5DL.js +0 -2
  109. package/public/styles-AUT3PDLG.css +0 -1
@@ -1 +0,0 @@
1
- import{A as Q,c as $,d as C,e as B,f as O,g as T,j as w,m as q,p as z,q as D,w as H,x as A,z as G}from"./chunk-CNMM42I5.js";import{b as K}from"./chunk-Y752BA6L.js";import{d as U}from"./chunk-UOLP7IQJ.js";import{b as J}from"./chunk-LJCIV6Z3.js";import{m as W}from"./chunk-YRIAJM6Y.js";import{b as j}from"./chunk-G7FA4DP4.js";import"./chunk-6GMXEQVA.js";import{Dc as f,Ib as u,Jb as c,Jc as l,Kc as d,M as I,Ob as m,Pb as r,Qb as a,Rb as s,Uc as b,Wc as L,Xa as x,ab as i,bc as E,dc as M,h as y,id as N,ka as p,kc as v,lc as F,ld as V,mb as k,qc as g,rc as h,sc as R,w as S,yd as P}from"./chunk-H36QJYLQ.js";var Y=["password"],Z=["username"],ee=["otp"],te=e=>({background:e}),ie=e=>({anim:e}),X=e=>({"is-invalid":e});function ne(e,_){if(e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",13),a(),s(3,"input",14,0),l(5,"translate"),a(),r(6,"div",8)(7,"span",12),s(8,"i",15),a(),s(9,"input",16,1),l(11,"translate"),a()),e&2){let n=M();i(3),m("placeholder",d(5,4,"users.label_username"))("ngClass",f(8,X,n.form.controls.username.dirty&&n.form.controls.username.errors)),i(6),m("placeholder",d(11,6,"users.label_password"))("ngClass",f(10,X,n.form.controls.password.dirty&&n.form.controls.password.errors))}}function oe(e,_){e&1&&(r(0,"div",8)(1,"span",12),s(2,"i",17),a(),s(3,"input",18,2),l(5,"translate"),a()),e&2&&(i(3),m("placeholder",d(5,1,"login.label_2fa_code")))}function ae(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_credentials")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}function re(e,_){e&1&&(r(0,"div",9)(1,"div",12),s(2,"i",19),a(),r(3,"div",20)(4,"div",21),g(5),l(6,"translate"),a(),s(7,"div",22),l(8,"translate"),a()()),e&2&&(i(5),h(d(6,2,"login.invalid_code")),i(2),m("innerHTML",d(8,4,"login.invalid_credentials_2"),x))}var _e=(()=>{class e{$auth=p(K);$cdr=p(L);$router=p(U);$settings=p(J);targetRoute;validNonAdminRoutes=["/accessories","/plugins","/logs","/support"];passwordInput=b("password");usernameInput=b("username");otpInput=b("otp");backgroundStyle;invalidCredentials=!1;invalid2faCode=!1;twoFactorCodeRequired=!1;inProgress=!1;form;ngOnInit(){this.form=new T({username:new w(""),password:new w("")}),this.form.valueChanges.pipe(I(500)).subscribe(n=>{let o=this.passwordInput()?.nativeElement.value;o&&o!==n.password&&this.form.controls.password.setValue(o)}),this.targetRoute=window.sessionStorage.getItem("target_route")||"",this.setBackground()}ngAfterViewChecked(){this.$cdr.detectChanges()}onSubmit(){return y(this,null,function*(){this.invalidCredentials=!1,this.invalid2faCode=!1,this.inProgress=!0,document.getElementById("submit-button")?.blur();let n=this.passwordInput()?.nativeElement.value;n&&n!==this.form.get("password").value&&this.form.controls.password.setValue(n);let o=this.usernameInput()?.nativeElement.value;if(o&&o!==this.form.get("username").value&&this.form.controls.username.setValue(o),this.twoFactorCodeRequired){let t=this.otpInput()?.nativeElement.value;t&&t!==this.form.get("otp").value&&this.form.controls.username.setValue(t)}try{yield this.$auth.login(this.form.getRawValue()),!this.$auth.user.admin&&!this.validNonAdminRoutes.includes(this.targetRoute)&&(this.targetRoute="/"),this.$router.navigateByUrl(this.targetRoute),window.sessionStorage.removeItem("target_route")}catch(t){t.status===412?(this.form.controls.otp?(this.form.controls.otp.setErrors(["Invalid Code"]),this.invalid2faCode=!0):this.form.addControl("otp",new w("",[C.required,C.minLength(6),C.maxLength(6)])),this.twoFactorCodeRequired=!0,setTimeout(()=>{document.getElementById("form-ota").focus()},100)):this.invalidCredentials=!0}this.inProgress=!1})}setBackground(){return y(this,null,function*(){if(this.$settings.settingsLoaded||(yield S(this.$settings.onSettingsLoaded)),this.$settings.env.customWallpaperHash){let n=`${W.api.base}/auth/wallpaper/${this.$settings.env.customWallpaperHash}`;this.backgroundStyle=`url('${n}') center/cover`}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=k({type:e,selectors:[["ng-component"]],viewQuery:function(o,t){o&1&&(v(t.passwordInput,Y,5),v(t.usernameInput,Z,5),v(t.otpInput,ee,5)),o&2&&F(3)},decls:15,vars:18,consts:[["username",""],["password",""],["otp",""],[1,"login-container","gradient","d-flex","align-items-start","justify-content-center",3,"ngStyle","ngClass"],[1,"w-100","login-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"],["novalidate","",3,"ngSubmit","formGroup"],[1,"mb-4","text-center"],[1,"input-group","mb-4"],[1,"input-group","no-border","mb-4"],[1,"text-center"],["tabindex","3","id","submit-button","type","submit",1,"btn","btn-primary","mb-2",3,"disabled"],[1,"input-group-text","custom-input"],[1,"fas","fa-fw","fa-user","primary-text","fa-lg"],["formControlName","username","type","text","id","form-username","autofocus","","autocomplete","username","autocapitalize","none","tabindex","1","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-lock","primary-text","fa-lg"],["formControlName","password","type","password","id","form-pass","autocomplete","current-password","tabindex","2","required","",1,"form-control","custom-input",3,"placeholder","ngClass"],[1,"fas","fa-fw","fa-key","primary-text","fa-lg"],["formControlName","otp","type","text","id","form-ota","autofocus","","autocomplete","one-time-code","autocapitalize","none","inputmode","numeric","pattern","[0-9]*","tabindex","1",1,"form-control","custom-input",3,"placeholder"],[1,"fas","fa-fw","fa-exclamation-triangle","pink-text","fa-lg"],[1,"form-control","custom-input"],[1,"small","grey-text","fw-semibold"],[1,"small","grey-text",3,"innerHTML"]],template:function(o,t){o&1&&(r(0,"div",3)(1,"div",4),s(2,"img",5),r(3,"form",6),E("ngSubmit",function(){return t.onSubmit()}),r(4,"h4",7),g(5),l(6,"translate"),a(),u(7,ne,12,12),u(8,oe,6,3,"div",8),u(9,ae,9,6,"div",9),u(10,re,9,6,"div",9),r(11,"div",10)(12,"button",11),g(13),l(14,"translate"),a()()()()()),o&2&&(m("ngStyle",f(14,te,t.backgroundStyle))("ngClass",f(16,ie,!t.backgroundStyle)),i(3),m("formGroup",t.form),i(2),h(d(6,10,"setup.welcome_to_homebridge")),i(2),c(t.twoFactorCodeRequired?-1:7),i(),c(t.twoFactorCodeRequired?8:-1),i(),c(t.invalidCredentials?9:-1),i(),c(t.invalid2faCode?10:-1),i(2),m("disabled",t.form.invalid),i(),R(" ",d(14,12,"form.button_continue")," "))},dependencies:[V,G,q,$,B,O,H,A,Q,z,D,N,P,j],styles:["body{overflow:scroll!important} body.dark-mode .login-card{background-color:#2b2b2b;color:#fff}.login-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%}}.login-card[_ngcontent-%COMP%]{max-width:550px;border-radius:1rem;padding-right:25px;padding-left:25px;background-color:#ffffffe6}.login-card[_ngcontent-%COMP%] .form-control[_ngcontent-%COMP%]:focus{background-color:inherit!important}@media screen and (max-width: 575px){.login-card[_ngcontent-%COMP%]{margin-left:1em;margin-right:1em}}.homebridge-logo[_ngcontent-%COMP%]{margin-bottom:10px}"]})}return e})();export{_e as LoginComponent};
@@ -1 +0,0 @@
1
- import{l as hn}from"./chunk-6GMXEQVA.js";import{$ as kt,$c as sn,A as Oe,Aa as xr,B as Ar,C as Ze,Ca as Me,Da as zt,Db as Wr,Ea as _r,Eb as Bt,Fa as Ft,Fb as Gr,Gb as Qr,H,Hb as Kr,K as re,L as ne,N as Lt,Nc as tn,O as he,Pc as rn,Rb as Yr,Rc as nn,S as Je,T as Q,Tc as on,U as jt,V as Tr,W as Er,Wc as tt,Z as Or,Zc as rt,_ as A,_a as Lr,a as l,aa as S,b as N,bc as Zr,ca as C,dd as an,ed as Ne,fa as R,fb as qt,fd as un,ga as Mr,gb as _,gc as Jr,gd as de,h as yr,ha as Dr,hb as jr,hd as cn,i as Sr,ia as T,ib as kr,ic as Xr,j as Cr,ja as K,jb as $r,jc as en,k as wr,ka as d,kb as zr,l as xt,lb as et,m as _t,mb as Fr,n as q,nb as qr,o as U,oa as ie,ob as De,p as B,pa as P,q as w,r as h,s as Ee,t as br,u as Ir,ua as $t,ub as oe,va as Nr,vb as Br,wa as Ur,x as v,xb as Hr,xd as ln,y as Ye,ya as Xe,yb as Vr,z as I,za as Pr}from"./chunk-H36QJYLQ.js";var f="primary",He=Symbol("RouteTitle"),Qt=class{params;constructor(n){this.params=n||{}}has(n){return Object.prototype.hasOwnProperty.call(this.params,n)}get(n){if(this.has(n)){let e=this.params[n];return Array.isArray(e)?e[0]:e}return null}getAll(n){if(this.has(n)){let e=this.params[n];return Array.isArray(e)?e:[e]}return[]}get keys(){return Object.keys(this.params)}};function ue(t){return new Qt(t)}function yn(t,n,e){let r=e.path.split("/");if(r.length>t.length||e.pathMatch==="full"&&(n.hasChildren()||r.length<t.length))return null;let i={};for(let o=0;o<r.length;o++){let s=r[o],a=t[o];if(s[0]===":")i[s.substring(1)]=a;else if(s!==a.path)return null}return{consumed:t.slice(0,r.length),posParams:i}}function di(t,n){if(t.length!==n.length)return!1;for(let e=0;e<t.length;++e)if(!j(t[e],n[e]))return!1;return!0}function j(t,n){let e=t?Kt(t):void 0,r=n?Kt(n):void 0;if(!e||!r||e.length!=r.length)return!1;let i;for(let o=0;o<e.length;o++)if(i=e[o],!Sn(t[i],n[i]))return!1;return!0}function Kt(t){return[...Object.keys(t),...Object.getOwnPropertySymbols(t)]}function Sn(t,n){if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;let e=[...t].sort(),r=[...n].sort();return e.every((i,o)=>r[o]===i)}else return t===n}function Cn(t){return t.length>0?t[t.length-1]:null}function W(t){return br(t)?t:Wr(t)?w(Promise.resolve(t)):h(t)}var fi={exact:bn,subset:In},wn={exact:pi,subset:gi,ignored:()=>!0};function dn(t,n,e){return fi[e.paths](t.root,n.root,e.matrixParams)&&wn[e.queryParams](t.queryParams,n.queryParams)&&!(e.fragment==="exact"&&t.fragment!==n.fragment)}function pi(t,n){return j(t,n)}function bn(t,n,e){if(!se(t.segments,n.segments)||!ot(t.segments,n.segments,e)||t.numberOfChildren!==n.numberOfChildren)return!1;for(let r in n.children)if(!t.children[r]||!bn(t.children[r],n.children[r],e))return!1;return!0}function gi(t,n){return Object.keys(n).length<=Object.keys(t).length&&Object.keys(n).every(e=>Sn(t[e],n[e]))}function In(t,n,e){return An(t,n,n.segments,e)}function An(t,n,e,r){if(t.segments.length>e.length){let i=t.segments.slice(0,e.length);return!(!se(i,e)||n.hasChildren()||!ot(i,e,r))}else if(t.segments.length===e.length){if(!se(t.segments,e)||!ot(t.segments,e,r))return!1;for(let i in n.children)if(!t.children[i]||!In(t.children[i],n.children[i],r))return!1;return!0}else{let i=e.slice(0,t.segments.length),o=e.slice(t.segments.length);return!se(t.segments,i)||!ot(t.segments,i,r)||!t.children[f]?!1:An(t.children[f],n,o,r)}}function ot(t,n,e){return n.every((r,i)=>wn[e](t[i].parameters,r.parameters))}var $=class{root;queryParams;fragment;_queryParamMap;constructor(n=new p([],{}),e={},r=null){this.root=n,this.queryParams=e,this.fragment=r}get queryParamMap(){return this._queryParamMap??=ue(this.queryParams),this._queryParamMap}toString(){return Ri.serialize(this)}},p=class{segments;children;parent=null;constructor(n,e){this.segments=n,this.children=e,Object.values(e).forEach(r=>r.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return st(this)}},Y=class{path;parameters;_parameterMap;constructor(n,e){this.path=n,this.parameters=e}get parameterMap(){return this._parameterMap??=ue(this.parameters),this._parameterMap}toString(){return En(this)}};function vi(t,n){return se(t,n)&&t.every((e,r)=>j(e.parameters,n[r].parameters))}function se(t,n){return t.length!==n.length?!1:t.every((e,r)=>e.path===n[r].path)}function mi(t,n){let e=[];return Object.entries(t.children).forEach(([r,i])=>{r===f&&(e=e.concat(n(i,r)))}),Object.entries(t.children).forEach(([r,i])=>{r!==f&&(e=e.concat(n(i,r)))}),e}var ce=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:()=>new Z,providedIn:"root"})}return t})(),Z=class{parse(n){let e=new Zt(n);return new $(e.parseRootSegment(),e.parseQueryParams(),e.parseFragment())}serialize(n){let e=`/${Ue(n.root,!0)}`,r=Ci(n.queryParams),i=typeof n.fragment=="string"?`#${yi(n.fragment)}`:"";return`${e}${r}${i}`}},Ri=new Z;function st(t){return t.segments.map(n=>En(n)).join("/")}function Ue(t,n){if(!t.hasChildren())return st(t);if(n){let e=t.children[f]?Ue(t.children[f],!1):"",r=[];return Object.entries(t.children).forEach(([i,o])=>{i!==f&&r.push(`${i}:${Ue(o,!1)}`)}),r.length>0?`${e}(${r.join("//")})`:e}else{let e=mi(t,(r,i)=>i===f?[Ue(t.children[f],!1)]:[`${i}:${Ue(r,!1)}`]);return Object.keys(t.children).length===1&&t.children[f]!=null?`${st(t)}/${e[0]}`:`${st(t)}/(${e.join("//")})`}}function Tn(t){return encodeURIComponent(t).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function nt(t){return Tn(t).replace(/%3B/gi,";")}function yi(t){return encodeURI(t)}function Yt(t){return Tn(t).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function at(t){return decodeURIComponent(t)}function fn(t){return at(t.replace(/\+/g,"%20"))}function En(t){return`${Yt(t.path)}${Si(t.parameters)}`}function Si(t){return Object.entries(t).map(([n,e])=>`;${Yt(n)}=${Yt(e)}`).join("")}function Ci(t){let n=Object.entries(t).map(([e,r])=>Array.isArray(r)?r.map(i=>`${nt(e)}=${nt(i)}`).join("&"):`${nt(e)}=${nt(r)}`).filter(e=>e);return n.length?`?${n.join("&")}`:""}var wi=/^[^\/()?;#]+/;function Ht(t){let n=t.match(wi);return n?n[0]:""}var bi=/^[^\/()?;=#]+/;function Ii(t){let n=t.match(bi);return n?n[0]:""}var Ai=/^[^=?&#]+/;function Ti(t){let n=t.match(Ai);return n?n[0]:""}var Ei=/^[^&#]+/;function Oi(t){let n=t.match(Ei);return n?n[0]:""}var Zt=class{url;remaining;constructor(n){this.url=n,this.remaining=n}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new p([],{}):new p([],this.parseChildren())}parseQueryParams(){let n={};if(this.consumeOptional("?"))do this.parseQueryParam(n);while(this.consumeOptional("&"));return n}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let n=[];for(this.peekStartsWith("(")||n.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),n.push(this.parseSegment());let e={};this.peekStartsWith("/(")&&(this.capture("/"),e=this.parseParens(!0));let r={};return this.peekStartsWith("(")&&(r=this.parseParens(!1)),(n.length>0||Object.keys(e).length>0)&&(r[f]=new p(n,e)),r}parseSegment(){let n=Ht(this.remaining);if(n===""&&this.peekStartsWith(";"))throw new C(4009,!1);return this.capture(n),new Y(at(n),this.parseMatrixParams())}parseMatrixParams(){let n={};for(;this.consumeOptional(";");)this.parseParam(n);return n}parseParam(n){let e=Ii(this.remaining);if(!e)return;this.capture(e);let r="";if(this.consumeOptional("=")){let i=Ht(this.remaining);i&&(r=i,this.capture(r))}n[at(e)]=at(r)}parseQueryParam(n){let e=Ti(this.remaining);if(!e)return;this.capture(e);let r="";if(this.consumeOptional("=")){let s=Oi(this.remaining);s&&(r=s,this.capture(r))}let i=fn(e),o=fn(r);if(n.hasOwnProperty(i)){let s=n[i];Array.isArray(s)||(s=[s],n[i]=s),s.push(o)}else n[i]=o}parseParens(n){let e={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let r=Ht(this.remaining),i=this.remaining[r.length];if(i!=="/"&&i!==")"&&i!==";")throw new C(4010,!1);let o;r.indexOf(":")>-1?(o=r.slice(0,r.indexOf(":")),this.capture(o),this.capture(":")):n&&(o=f);let s=this.parseChildren();e[o]=Object.keys(s).length===1?s[f]:new p([],s),this.consumeOptional("//")}return e}peekStartsWith(n){return this.remaining.startsWith(n)}consumeOptional(n){return this.peekStartsWith(n)?(this.remaining=this.remaining.substring(n.length),!0):!1}capture(n){if(!this.consumeOptional(n))throw new C(4011,!1)}};function On(t){return t.segments.length>0?new p([],{[f]:t}):t}function Mn(t){let n={};for(let[r,i]of Object.entries(t.children)){let o=Mn(i);if(r===f&&o.segments.length===0&&o.hasChildren())for(let[s,a]of Object.entries(o.children))n[s]=a;else(o.segments.length>0||o.hasChildren())&&(n[r]=o)}let e=new p(t.segments,n);return Mi(e)}function Mi(t){if(t.numberOfChildren===1&&t.children[f]){let n=t.children[f];return new p(t.segments.concat(n.segments),n.children)}return t}function J(t){return t instanceof $}function Dn(t,n,e=null,r=null){let i=Nn(t);return Un(i,n,e,r)}function Nn(t){let n;function e(o){let s={};for(let u of o.children){let c=e(u);s[u.outlet]=c}let a=new p(o.url,s);return o===t&&(n=a),a}let r=e(t.root),i=On(r);return n??i}function Un(t,n,e,r){let i=t;for(;i.parent;)i=i.parent;if(n.length===0)return Vt(i,i,i,e,r);let o=Di(n);if(o.toRoot())return Vt(i,i,new p([],{}),e,r);let s=Ni(o,i,t),a=s.processChildren?xe(s.segmentGroup,s.index,o.commands):xn(s.segmentGroup,s.index,o.commands);return Vt(i,s.segmentGroup,a,e,r)}function ut(t){return typeof t=="object"&&t!=null&&!t.outlets&&!t.segmentPath}function Le(t){return typeof t=="object"&&t!=null&&t.outlets}function Vt(t,n,e,r,i){let o={};r&&Object.entries(r).forEach(([u,c])=>{o[u]=Array.isArray(c)?c.map(g=>`${g}`):`${c}`});let s;t===n?s=e:s=Pn(t,n,e);let a=On(Mn(s));return new $(a,o,i)}function Pn(t,n,e){let r={};return Object.entries(t.children).forEach(([i,o])=>{o===n?r[i]=e:r[i]=Pn(o,n,e)}),new p(t.segments,r)}var ct=class{isAbsolute;numberOfDoubleDots;commands;constructor(n,e,r){if(this.isAbsolute=n,this.numberOfDoubleDots=e,this.commands=r,n&&r.length>0&&ut(r[0]))throw new C(4003,!1);let i=r.find(Le);if(i&&i!==Cn(r))throw new C(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function Di(t){if(typeof t[0]=="string"&&t.length===1&&t[0]==="/")return new ct(!0,0,t);let n=0,e=!1,r=t.reduce((i,o,s)=>{if(typeof o=="object"&&o!=null){if(o.outlets){let a={};return Object.entries(o.outlets).forEach(([u,c])=>{a[u]=typeof c=="string"?c.split("/"):c}),[...i,{outlets:a}]}if(o.segmentPath)return[...i,o.segmentPath]}return typeof o!="string"?[...i,o]:s===0?(o.split("/").forEach((a,u)=>{u==0&&a==="."||(u==0&&a===""?e=!0:a===".."?n++:a!=""&&i.push(a))}),i):[...i,o]},[]);return new ct(e,n,r)}var ge=class{segmentGroup;processChildren;index;constructor(n,e,r){this.segmentGroup=n,this.processChildren=e,this.index=r}};function Ni(t,n,e){if(t.isAbsolute)return new ge(n,!0,0);if(!e)return new ge(n,!1,NaN);if(e.parent===null)return new ge(e,!0,0);let r=ut(t.commands[0])?0:1,i=e.segments.length-1+r;return Ui(e,i,t.numberOfDoubleDots)}function Ui(t,n,e){let r=t,i=n,o=e;for(;o>i;){if(o-=i,r=r.parent,!r)throw new C(4005,!1);i=r.segments.length}return new ge(r,!1,i-o)}function Pi(t){return Le(t[0])?t[0].outlets:{[f]:t}}function xn(t,n,e){if(t??=new p([],{}),t.segments.length===0&&t.hasChildren())return xe(t,n,e);let r=xi(t,n,e),i=e.slice(r.commandIndex);if(r.match&&r.pathIndex<t.segments.length){let o=new p(t.segments.slice(0,r.pathIndex),{});return o.children[f]=new p(t.segments.slice(r.pathIndex),t.children),xe(o,0,i)}else return r.match&&i.length===0?new p(t.segments,{}):r.match&&!t.hasChildren()?Jt(t,n,e):r.match?xe(t,0,i):Jt(t,n,e)}function xe(t,n,e){if(e.length===0)return new p(t.segments,{});{let r=Pi(e),i={};if(Object.keys(r).some(o=>o!==f)&&t.children[f]&&t.numberOfChildren===1&&t.children[f].segments.length===0){let o=xe(t.children[f],n,e);return new p(t.segments,o.children)}return Object.entries(r).forEach(([o,s])=>{typeof s=="string"&&(s=[s]),s!==null&&(i[o]=xn(t.children[o],n,s))}),Object.entries(t.children).forEach(([o,s])=>{r[o]===void 0&&(i[o]=s)}),new p(t.segments,i)}}function xi(t,n,e){let r=0,i=n,o={match:!1,pathIndex:0,commandIndex:0};for(;i<t.segments.length;){if(r>=e.length)return o;let s=t.segments[i],a=e[r];if(Le(a))break;let u=`${a}`,c=r<e.length-1?e[r+1]:null;if(i>0&&u===void 0)break;if(u&&c&&typeof c=="object"&&c.outlets===void 0){if(!gn(u,c,s))return o;r+=2}else{if(!gn(u,{},s))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}function Jt(t,n,e){let r=t.segments.slice(0,n),i=0;for(;i<e.length;){let o=e[i];if(Le(o)){let u=_i(o.outlets);return new p(r,u)}if(i===0&&ut(e[0])){let u=t.segments[n];r.push(new Y(u.path,pn(e[0]))),i++;continue}let s=Le(o)?o.outlets[f]:`${o}`,a=i<e.length-1?e[i+1]:null;s&&a&&ut(a)?(r.push(new Y(s,pn(a))),i+=2):(r.push(new Y(s,{})),i++)}return new p(r,{})}function _i(t){let n={};return Object.entries(t).forEach(([e,r])=>{typeof r=="string"&&(r=[r]),r!==null&&(n[e]=Jt(new p([],{}),0,r))}),n}function pn(t){let n={};return Object.entries(t).forEach(([e,r])=>n[e]=`${r}`),n}function gn(t,n,e){return t==e.path&&j(n,e.parameters)}var ve="imperative",m=function(t){return t[t.NavigationStart=0]="NavigationStart",t[t.NavigationEnd=1]="NavigationEnd",t[t.NavigationCancel=2]="NavigationCancel",t[t.NavigationError=3]="NavigationError",t[t.RoutesRecognized=4]="RoutesRecognized",t[t.ResolveStart=5]="ResolveStart",t[t.ResolveEnd=6]="ResolveEnd",t[t.GuardsCheckStart=7]="GuardsCheckStart",t[t.GuardsCheckEnd=8]="GuardsCheckEnd",t[t.RouteConfigLoadStart=9]="RouteConfigLoadStart",t[t.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",t[t.ChildActivationStart=11]="ChildActivationStart",t[t.ChildActivationEnd=12]="ChildActivationEnd",t[t.ActivationStart=13]="ActivationStart",t[t.ActivationEnd=14]="ActivationEnd",t[t.Scroll=15]="Scroll",t[t.NavigationSkipped=16]="NavigationSkipped",t}(m||{}),M=class{id;url;constructor(n,e){this.id=n,this.url=e}},X=class extends M{type=m.NavigationStart;navigationTrigger;restoredState;constructor(n,e,r="imperative",i=null){super(n,e),this.navigationTrigger=r,this.restoredState=i}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},D=class extends M{urlAfterRedirects;type=m.NavigationEnd;constructor(n,e,r){super(n,e),this.urlAfterRedirects=r}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},b=function(t){return t[t.Redirect=0]="Redirect",t[t.SupersededByNewNavigation=1]="SupersededByNewNavigation",t[t.NoDataFromResolver=2]="NoDataFromResolver",t[t.GuardRejected=3]="GuardRejected",t[t.Aborted=4]="Aborted",t}(b||{}),Re=function(t){return t[t.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",t[t.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",t}(Re||{}),k=class extends M{reason;code;type=m.NavigationCancel;constructor(n,e,r,i){super(n,e),this.reason=r,this.code=i}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},z=class extends M{reason;code;type=m.NavigationSkipped;constructor(n,e,r,i){super(n,e),this.reason=r,this.code=i}},ye=class extends M{error;target;type=m.NavigationError;constructor(n,e,r,i){super(n,e),this.error=r,this.target=i}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},je=class extends M{urlAfterRedirects;state;type=m.RoutesRecognized;constructor(n,e,r,i){super(n,e),this.urlAfterRedirects=r,this.state=i}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},lt=class extends M{urlAfterRedirects;state;type=m.GuardsCheckStart;constructor(n,e,r,i){super(n,e),this.urlAfterRedirects=r,this.state=i}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},ht=class extends M{urlAfterRedirects;state;shouldActivate;type=m.GuardsCheckEnd;constructor(n,e,r,i,o){super(n,e),this.urlAfterRedirects=r,this.state=i,this.shouldActivate=o}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},dt=class extends M{urlAfterRedirects;state;type=m.ResolveStart;constructor(n,e,r,i){super(n,e),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},ft=class extends M{urlAfterRedirects;state;type=m.ResolveEnd;constructor(n,e,r,i){super(n,e),this.urlAfterRedirects=r,this.state=i}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},pt=class{route;type=m.RouteConfigLoadStart;constructor(n){this.route=n}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},gt=class{route;type=m.RouteConfigLoadEnd;constructor(n){this.route=n}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},vt=class{snapshot;type=m.ChildActivationStart;constructor(n){this.snapshot=n}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},mt=class{snapshot;type=m.ChildActivationEnd;constructor(n){this.snapshot=n}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Rt=class{snapshot;type=m.ActivationStart;constructor(n){this.snapshot=n}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},yt=class{snapshot;type=m.ActivationEnd;constructor(n){this.snapshot=n}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Se=class{routerEvent;position;anchor;type=m.Scroll;constructor(n,e,r){this.routerEvent=n,this.position=e,this.anchor=r}toString(){let n=this.position?`${this.position[0]}, ${this.position[1]}`:null;return`Scroll(anchor: '${this.anchor}', position: '${n}')`}},ke=class{},Ce=class{url;navigationBehaviorOptions;constructor(n,e){this.url=n,this.navigationBehaviorOptions=e}};function Li(t){return!(t instanceof ke)&&!(t instanceof Ce)}function ji(t,n){return t.providers&&!t._injector&&(t._injector=et(t.providers,n,`Route: ${t.path}`)),t._injector??n}function L(t){return t.outlet||f}function ki(t,n){let e=t.filter(r=>L(r)===n);return e.push(...t.filter(r=>L(r)!==n)),e}function Ie(t){if(!t)return null;if(t.routeConfig?._injector)return t.routeConfig._injector;for(let n=t.parent;n;n=n.parent){let e=n.routeConfig;if(e?._loadedInjector)return e._loadedInjector;if(e?._injector)return e._injector}return null}var St=class{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return Ie(this.route?.snapshot)??this.rootInjector}constructor(n){this.rootInjector=n,this.children=new le(this.rootInjector)}},le=(()=>{class t{rootInjector;contexts=new Map;constructor(e){this.rootInjector=e}onChildOutletCreated(e,r){let i=this.getOrCreateContext(e);i.outlet=r,this.contexts.set(e,i)}onChildOutletDestroyed(e){let r=this.getContext(e);r&&(r.outlet=null,r.attachRef=null)}onOutletDeactivated(){let e=this.contexts;return this.contexts=new Map,e}onOutletReAttached(e){this.contexts=e}getOrCreateContext(e){let r=this.getContext(e);return r||(r=new St(this.rootInjector),this.contexts.set(e,r)),r}getContext(e){return this.contexts.get(e)||null}static \u0275fac=function(r){return new(r||t)(K(ie))};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Ct=class{_root;constructor(n){this._root=n}get root(){return this._root.value}parent(n){let e=this.pathFromRoot(n);return e.length>1?e[e.length-2]:null}children(n){let e=Xt(n,this._root);return e?e.children.map(r=>r.value):[]}firstChild(n){let e=Xt(n,this._root);return e&&e.children.length>0?e.children[0].value:null}siblings(n){let e=er(n,this._root);return e.length<2?[]:e[e.length-2].children.map(i=>i.value).filter(i=>i!==n)}pathFromRoot(n){return er(n,this._root).map(e=>e.value)}};function Xt(t,n){if(t===n.value)return n;for(let e of n.children){let r=Xt(t,e);if(r)return r}return null}function er(t,n){if(t===n.value)return[n];for(let e of n.children){let r=er(t,e);if(r.length)return r.unshift(n),r}return[]}var O=class{value;children;constructor(n,e){this.value=n,this.children=e}toString(){return`TreeNode(${this.value})`}};function pe(t){let n={};return t&&t.children.forEach(e=>n[e.value.outlet]=e),n}var $e=class extends Ct{snapshot;constructor(n,e){super(n),this.snapshot=e,ur(this,n)}toString(){return this.snapshot.toString()}};function _n(t){let n=$i(t),e=new U([new Y("",{})]),r=new U({}),i=new U({}),o=new U({}),s=new U(""),a=new V(e,r,o,s,i,f,t,n.root);return a.snapshot=n.root,new $e(new O(a,[]),n)}function $i(t){let n={},e={},r={},i="",o=new ae([],n,r,i,e,f,t,null,{});return new ze("",new O(o,[]))}var V=class{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(n,e,r,i,o,s,a,u){this.urlSubject=n,this.paramsSubject=e,this.queryParamsSubject=r,this.fragmentSubject=i,this.dataSubject=o,this.outlet=s,this.component=a,this._futureSnapshot=u,this.title=this.dataSubject?.pipe(v(c=>c[He]))??h(void 0),this.url=n,this.params=e,this.queryParams=r,this.fragment=i,this.data=o}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(v(n=>ue(n))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(v(n=>ue(n))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function wt(t,n,e="emptyOnly"){let r,{routeConfig:i}=t;return n!==null&&(e==="always"||i?.path===""||!n.component&&!n.routeConfig?.loadComponent)?r={params:l(l({},n.params),t.params),data:l(l({},n.data),t.data),resolve:l(l(l(l({},t.data),n.data),i?.data),t._resolvedData)}:r={params:l({},t.params),data:l({},t.data),resolve:l(l({},t.data),t._resolvedData??{})},i&&jn(i)&&(r.resolve[He]=i.title),r}var ae=class{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[He]}constructor(n,e,r,i,o,s,a,u,c){this.url=n,this.params=e,this.queryParams=r,this.fragment=i,this.data=o,this.outlet=s,this.component=a,this.routeConfig=u,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=ue(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=ue(this.queryParams),this._queryParamMap}toString(){let n=this.url.map(r=>r.toString()).join("/"),e=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${n}', path:'${e}')`}},ze=class extends Ct{url;constructor(n,e){super(e),this.url=n,ur(this,e)}toString(){return Ln(this._root)}};function ur(t,n){n.value._routerState=t,n.children.forEach(e=>ur(t,e))}function Ln(t){let n=t.children.length>0?` { ${t.children.map(Ln).join(", ")} } `:"";return`${t.value}${n}`}function Wt(t){if(t.snapshot){let n=t.snapshot,e=t._futureSnapshot;t.snapshot=e,j(n.queryParams,e.queryParams)||t.queryParamsSubject.next(e.queryParams),n.fragment!==e.fragment&&t.fragmentSubject.next(e.fragment),j(n.params,e.params)||t.paramsSubject.next(e.params),di(n.url,e.url)||t.urlSubject.next(e.url),j(n.data,e.data)||t.dataSubject.next(e.data)}else t.snapshot=t._futureSnapshot,t.dataSubject.next(t._futureSnapshot.data)}function tr(t,n){let e=j(t.params,n.params)&&vi(t.url,n.url),r=!t.parent!=!n.parent;return e&&!r&&(!t.parent||tr(t.parent,n.parent))}function jn(t){return typeof t.title=="string"||t.title===null}var kn=new T(""),cr=(()=>{class t{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=f;activateEvents=new oe;deactivateEvents=new oe;attachEvents=new oe;detachEvents=new oe;routerOutletData=on(void 0);parentContexts=d(le);location=d(kr);changeDetector=d(tt);inputBinder=d(Ve,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(e){if(e.name){let{firstChange:r,previousValue:i}=e.name;if(r)return;this.isTrackedInParentContexts(i)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(i)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(e){return this.parentContexts.getContext(e)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let e=this.parentContexts.getContext(this.name);e?.route&&(e.attachRef?this.attach(e.attachRef,e.route):this.activateWith(e.route,e.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new C(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new C(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new C(4012,!1);this.location.detach();let e=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(e.instance),e}attach(e,r){this.activated=e,this._activatedRoute=r,this.location.insert(e.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(e.instance)}deactivate(){if(this.activated){let e=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(e)}}activateWith(e,r){if(this.isActivated)throw new C(4013,!1);this._activatedRoute=e;let i=this.location,s=e.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,u=new rr(e,a,i.injector,this.routerOutletData);this.activated=i.createComponent(s,{index:i.length,injector:u,environmentInjector:r}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(r){return new(r||t)};static \u0275dir=De({type:t,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[Me]})}return t})(),rr=class{route;childContexts;parent;outletData;constructor(n,e,r,i){this.route=n,this.childContexts=e,this.parent=r,this.outletData=i}get(n,e){return n===V?this.route:n===le?this.childContexts:n===kn?this.outletData:this.parent.get(n,e)}},Ve=new T(""),lr=(()=>{class t{outletDataSubscriptions=new Map;bindActivatedRouteToOutletComponent(e){this.unsubscribeFromRouteData(e),this.subscribeToRouteData(e)}unsubscribeFromRouteData(e){this.outletDataSubscriptions.get(e)?.unsubscribe(),this.outletDataSubscriptions.delete(e)}subscribeToRouteData(e){let{activatedRoute:r}=e,i=Ye([r.queryParams,r.params,r.data]).pipe(A(([o,s,a],u)=>(a=l(l(l({},o),s),a),u===0?h(a):Promise.resolve(a)))).subscribe(o=>{if(!e.isActivated||!e.activatedComponentRef||e.activatedRoute!==r||r.component===null){this.unsubscribeFromRouteData(e);return}let s=sn(r.component);if(!s){this.unsubscribeFromRouteData(e);return}for(let{templateName:a}of s.inputs)e.activatedComponentRef.setInput(a,o[a])});this.outletDataSubscriptions.set(e,i)}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:t.\u0275fac})}return t})(),hr=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275cmp=Fr({type:t,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(r,i){r&1&&Yr(0,"router-outlet")},dependencies:[cr],encapsulation:2})}return t})();function dr(t){let n=t.children&&t.children.map(dr),e=n?N(l({},t),{children:n}):l({},t);return!e.component&&!e.loadComponent&&(n||e.loadChildren)&&e.outlet&&e.outlet!==f&&(e.component=hr),e}function zi(t,n,e){let r=Fe(t,n._root,e?e._root:void 0);return new $e(r,n)}function Fe(t,n,e){if(e&&t.shouldReuseRoute(n.value,e.value.snapshot)){let r=e.value;r._futureSnapshot=n.value;let i=Fi(t,n,e);return new O(r,i)}else{if(t.shouldAttach(n.value)){let o=t.retrieve(n.value);if(o!==null){let s=o.route;return s.value._futureSnapshot=n.value,s.children=n.children.map(a=>Fe(t,a)),s}}let r=qi(n.value),i=n.children.map(o=>Fe(t,o));return new O(r,i)}}function Fi(t,n,e){return n.children.map(r=>{for(let i of e.children)if(t.shouldReuseRoute(r.value,i.value.snapshot))return Fe(t,r,i);return Fe(t,r)})}function qi(t){return new V(new U(t.url),new U(t.params),new U(t.queryParams),new U(t.fragment),new U(t.data),t.outlet,t.component,t)}var we=class{redirectTo;navigationBehaviorOptions;constructor(n,e){this.redirectTo=n,this.navigationBehaviorOptions=e}},$n="ngNavigationCancelingError";function bt(t,n){let{redirectTo:e,navigationBehaviorOptions:r}=J(n)?{redirectTo:n,navigationBehaviorOptions:void 0}:n,i=zn(!1,b.Redirect);return i.url=e,i.navigationBehaviorOptions=r,i}function zn(t,n){let e=new Error(`NavigationCancelingError: ${t||""}`);return e[$n]=!0,e.cancellationCode=n,e}function Bi(t){return Fn(t)&&J(t.url)}function Fn(t){return!!t&&t[$n]}var Hi=(t,n,e,r)=>v(i=>(new nr(n,i.targetRouterState,i.currentRouterState,e,r).activate(t),i)),nr=class{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(n,e,r,i,o){this.routeReuseStrategy=n,this.futureState=e,this.currState=r,this.forwardEvent=i,this.inputBindingEnabled=o}activate(n){let e=this.futureState._root,r=this.currState?this.currState._root:null;this.deactivateChildRoutes(e,r,n),Wt(this.futureState.root),this.activateChildRoutes(e,r,n)}deactivateChildRoutes(n,e,r){let i=pe(e);n.children.forEach(o=>{let s=o.value.outlet;this.deactivateRoutes(o,i[s],r),delete i[s]}),Object.values(i).forEach(o=>{this.deactivateRouteAndItsChildren(o,r)})}deactivateRoutes(n,e,r){let i=n.value,o=e?e.value:null;if(i===o)if(i.component){let s=r.getContext(i.outlet);s&&this.deactivateChildRoutes(n,e,s.children)}else this.deactivateChildRoutes(n,e,r);else o&&this.deactivateRouteAndItsChildren(e,r)}deactivateRouteAndItsChildren(n,e){n.value.component&&this.routeReuseStrategy.shouldDetach(n.value.snapshot)?this.detachAndStoreRouteSubtree(n,e):this.deactivateRouteAndOutlet(n,e)}detachAndStoreRouteSubtree(n,e){let r=e.getContext(n.value.outlet),i=r&&n.value.component?r.children:e,o=pe(n);for(let s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);if(r&&r.outlet){let s=r.outlet.detach(),a=r.children.onOutletDeactivated();this.routeReuseStrategy.store(n.value.snapshot,{componentRef:s,route:n,contexts:a})}}deactivateRouteAndOutlet(n,e){let r=e.getContext(n.value.outlet),i=r&&n.value.component?r.children:e,o=pe(n);for(let s of Object.values(o))this.deactivateRouteAndItsChildren(s,i);r&&(r.outlet&&(r.outlet.deactivate(),r.children.onOutletDeactivated()),r.attachRef=null,r.route=null)}activateChildRoutes(n,e,r){let i=pe(e);n.children.forEach(o=>{this.activateRoutes(o,i[o.value.outlet],r),this.forwardEvent(new yt(o.value.snapshot))}),n.children.length&&this.forwardEvent(new mt(n.value.snapshot))}activateRoutes(n,e,r){let i=n.value,o=e?e.value:null;if(Wt(i),i===o)if(i.component){let s=r.getOrCreateContext(i.outlet);this.activateChildRoutes(n,e,s.children)}else this.activateChildRoutes(n,e,r);else if(i.component){let s=r.getOrCreateContext(i.outlet);if(this.routeReuseStrategy.shouldAttach(i.snapshot)){let a=this.routeReuseStrategy.retrieve(i.snapshot);this.routeReuseStrategy.store(i.snapshot,null),s.children.onOutletReAttached(a.contexts),s.attachRef=a.componentRef,s.route=a.route.value,s.outlet&&s.outlet.attach(a.componentRef,a.route.value),Wt(a.route.value),this.activateChildRoutes(n,null,s.children)}else s.attachRef=null,s.route=i,s.outlet&&s.outlet.activateWith(i,s.injector),this.activateChildRoutes(n,null,s.children)}else this.activateChildRoutes(n,null,r)}},It=class{path;route;constructor(n){this.path=n,this.route=this.path[this.path.length-1]}},me=class{component;route;constructor(n,e){this.component=n,this.route=e}};function Vi(t,n,e){let r=t._root,i=n?n._root:null;return Pe(r,i,e,[r.value])}function Wi(t){let n=t.routeConfig?t.routeConfig.canActivateChild:null;return!n||n.length===0?null:{node:t,guards:n}}function Ae(t,n){let e=Symbol(),r=n.get(t,e);return r===e?typeof t=="function"&&!Dr(t)?t:n.get(t):r}function Pe(t,n,e,r,i={canDeactivateChecks:[],canActivateChecks:[]}){let o=pe(n);return t.children.forEach(s=>{Gi(s,o[s.value.outlet],e,r.concat([s.value]),i),delete o[s.value.outlet]}),Object.entries(o).forEach(([s,a])=>_e(a,e.getContext(s),i)),i}function Gi(t,n,e,r,i={canDeactivateChecks:[],canActivateChecks:[]}){let o=t.value,s=n?n.value:null,a=e?e.getContext(t.value.outlet):null;if(s&&o.routeConfig===s.routeConfig){let u=Qi(s,o,o.routeConfig.runGuardsAndResolvers);u?i.canActivateChecks.push(new It(r)):(o.data=s.data,o._resolvedData=s._resolvedData),o.component?Pe(t,n,a?a.children:null,r,i):Pe(t,n,e,r,i),u&&a&&a.outlet&&a.outlet.isActivated&&i.canDeactivateChecks.push(new me(a.outlet.component,s))}else s&&_e(n,a,i),i.canActivateChecks.push(new It(r)),o.component?Pe(t,null,a?a.children:null,r,i):Pe(t,null,e,r,i);return i}function Qi(t,n,e){if(typeof e=="function")return e(t,n);switch(e){case"pathParamsChange":return!se(t.url,n.url);case"pathParamsOrQueryParamsChange":return!se(t.url,n.url)||!j(t.queryParams,n.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!tr(t,n)||!j(t.queryParams,n.queryParams);case"paramsChange":default:return!tr(t,n)}}function _e(t,n,e){let r=pe(t),i=t.value;Object.entries(r).forEach(([o,s])=>{i.component?n?_e(s,n.children.getContext(o),e):_e(s,null,e):_e(s,n,e)}),i.component?n&&n.outlet&&n.outlet.isActivated?e.canDeactivateChecks.push(new me(n.outlet.component,i)):e.canDeactivateChecks.push(new me(null,i)):e.canDeactivateChecks.push(new me(null,i))}function We(t){return typeof t=="function"}function Ki(t){return typeof t=="boolean"}function Yi(t){return t&&We(t.canLoad)}function Zi(t){return t&&We(t.canActivate)}function Ji(t){return t&&We(t.canActivateChild)}function Xi(t){return t&&We(t.canDeactivate)}function eo(t){return t&&We(t.canMatch)}function qn(t){return t instanceof Ir||t?.name==="EmptyError"}var it=Symbol("INITIAL_VALUE");function be(){return A(t=>Ye(t.map(n=>n.pipe(he(1),Or(it)))).pipe(v(n=>{for(let e of n)if(e!==!0){if(e===it)return it;if(e===!1||to(e))return e}return!0}),H(n=>n!==it),he(1)))}function to(t){return J(t)||t instanceof we}function ro(t,n){return I(e=>{let{targetSnapshot:r,currentSnapshot:i,guards:{canActivateChecks:o,canDeactivateChecks:s}}=e;return s.length===0&&o.length===0?h(N(l({},e),{guardsResult:!0})):no(s,r,i,t).pipe(I(a=>a&&Ki(a)?io(r,o,t,n):h(a)),v(a=>N(l({},e),{guardsResult:a})))})}function no(t,n,e,r){return w(t).pipe(I(i=>co(i.component,i.route,e,n,r)),Q(i=>i!==!0,!0))}function io(t,n,e,r){return w(n).pipe(ne(i=>Ar(so(i.route.parent,r),oo(i.route,r),uo(t,i.path,e),ao(t,i.route,e))),Q(i=>i!==!0,!0))}function oo(t,n){return t!==null&&n&&n(new Rt(t)),h(!0)}function so(t,n){return t!==null&&n&&n(new vt(t)),h(!0)}function ao(t,n,e){let r=n.routeConfig?n.routeConfig.canActivate:null;if(!r||r.length===0)return h(!0);let i=r.map(o=>Ze(()=>{let s=Ie(n)??e,a=Ae(o,s),u=Zi(a)?a.canActivate(n,t):P(s,()=>a(n,t));return W(u).pipe(Q())}));return h(i).pipe(be())}function uo(t,n,e){let r=n[n.length-1],o=n.slice(0,n.length-1).reverse().map(s=>Wi(s)).filter(s=>s!==null).map(s=>Ze(()=>{let a=s.guards.map(u=>{let c=Ie(s.node)??e,g=Ae(u,c),y=Ji(g)?g.canActivateChild(r,t):P(c,()=>g(r,t));return W(y).pipe(Q())});return h(a).pipe(be())}));return h(o).pipe(be())}function co(t,n,e,r,i){let o=n&&n.routeConfig?n.routeConfig.canDeactivate:null;if(!o||o.length===0)return h(!0);let s=o.map(a=>{let u=Ie(n)??i,c=Ae(a,u),g=Xi(c)?c.canDeactivate(t,n,e,r):P(u,()=>c(t,n,e,r));return W(g).pipe(Q())});return h(s).pipe(be())}function lo(t,n,e,r){let i=n.canLoad;if(i===void 0||i.length===0)return h(!0);let o=i.map(s=>{let a=Ae(s,t),u=Yi(a)?a.canLoad(n,e):P(t,()=>a(n,e));return W(u)});return h(o).pipe(be(),Bn(r))}function Bn(t){return Cr(S(n=>{if(typeof n!="boolean")throw bt(t,n)}),v(n=>n===!0))}function ho(t,n,e,r){let i=n.canMatch;if(!i||i.length===0)return h(!0);let o=i.map(s=>{let a=Ae(s,t),u=eo(a)?a.canMatch(n,e):P(t,()=>a(n,e));return W(u)});return h(o).pipe(be(),Bn(r))}var qe=class{segmentGroup;constructor(n){this.segmentGroup=n||null}},Be=class extends Error{urlTree;constructor(n){super(),this.urlTree=n}};function fe(t){return Ee(new qe(t))}function fo(t){return Ee(new C(4e3,!1))}function po(t){return Ee(zn(!1,b.GuardRejected))}var ir=class{urlSerializer;urlTree;constructor(n,e){this.urlSerializer=n,this.urlTree=e}lineralizeSegments(n,e){let r=[],i=e.root;for(;;){if(r=r.concat(i.segments),i.numberOfChildren===0)return h(r);if(i.numberOfChildren>1||!i.children[f])return fo(`${n.redirectTo}`);i=i.children[f]}}applyRedirectCommands(n,e,r,i,o){return go(e,i,o).pipe(v(s=>{if(s instanceof $)throw new Be(s);let a=this.applyRedirectCreateUrlTree(s,this.urlSerializer.parse(s),n,r);if(s[0]==="/")throw new Be(a);return a}))}applyRedirectCreateUrlTree(n,e,r,i){let o=this.createSegmentGroup(n,e.root,r,i);return new $(o,this.createQueryParams(e.queryParams,this.urlTree.queryParams),e.fragment)}createQueryParams(n,e){let r={};return Object.entries(n).forEach(([i,o])=>{if(typeof o=="string"&&o[0]===":"){let a=o.substring(1);r[i]=e[a]}else r[i]=o}),r}createSegmentGroup(n,e,r,i){let o=this.createSegments(n,e.segments,r,i),s={};return Object.entries(e.children).forEach(([a,u])=>{s[a]=this.createSegmentGroup(n,u,r,i)}),new p(o,s)}createSegments(n,e,r,i){return e.map(o=>o.path[0]===":"?this.findPosParam(n,o,i):this.findOrReturn(o,r))}findPosParam(n,e,r){let i=r[e.path.substring(1)];if(!i)throw new C(4001,!1);return i}findOrReturn(n,e){let r=0;for(let i of e){if(i.path===n.path)return e.splice(r),i;r++}return n}};function go(t,n,e){if(typeof t=="string")return h(t);let r=t,{queryParams:i,fragment:o,routeConfig:s,url:a,outlet:u,params:c,data:g,title:y}=n;return W(P(e,()=>r({params:c,data:g,queryParams:i,fragment:o,routeConfig:s,url:a,outlet:u,title:y})))}var or={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function vo(t,n,e,r,i){let o=Hn(t,n,e);return o.matched?(r=ji(n,r),ho(r,n,e,i).pipe(v(s=>s===!0?o:l({},or)))):h(o)}function Hn(t,n,e){if(n.path==="**")return mo(e);if(n.path==="")return n.pathMatch==="full"&&(t.hasChildren()||e.length>0)?l({},or):{matched:!0,consumedSegments:[],remainingSegments:e,parameters:{},positionalParamSegments:{}};let i=(n.matcher||yn)(e,t,n);if(!i)return l({},or);let o={};Object.entries(i.posParams??{}).forEach(([a,u])=>{o[a]=u.path});let s=i.consumed.length>0?l(l({},o),i.consumed[i.consumed.length-1].parameters):o;return{matched:!0,consumedSegments:i.consumed,remainingSegments:e.slice(i.consumed.length),parameters:s,positionalParamSegments:i.posParams??{}}}function mo(t){return{matched:!0,parameters:t.length>0?Cn(t).parameters:{},consumedSegments:t,remainingSegments:[],positionalParamSegments:{}}}function vn(t,n,e,r){return e.length>0&&So(t,e,r)?{segmentGroup:new p(n,yo(r,new p(e,t.children))),slicedSegments:[]}:e.length===0&&Co(t,e,r)?{segmentGroup:new p(t.segments,Ro(t,e,r,t.children)),slicedSegments:e}:{segmentGroup:new p(t.segments,t.children),slicedSegments:e}}function Ro(t,n,e,r){let i={};for(let o of e)if(Tt(t,n,o)&&!r[L(o)]){let s=new p([],{});i[L(o)]=s}return l(l({},r),i)}function yo(t,n){let e={};e[f]=n;for(let r of t)if(r.path===""&&L(r)!==f){let i=new p([],{});e[L(r)]=i}return e}function So(t,n,e){return e.some(r=>Tt(t,n,r)&&L(r)!==f)}function Co(t,n,e){return e.some(r=>Tt(t,n,r))}function Tt(t,n,e){return(t.hasChildren()||n.length>0)&&e.pathMatch==="full"?!1:e.path===""}function wo(t,n,e){return n.length===0&&!t.children[e]}var sr=class{};function bo(t,n,e,r,i,o,s="emptyOnly"){return new ar(t,n,e,r,i,s,o).recognize()}var Io=31,ar=class{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(n,e,r,i,o,s,a){this.injector=n,this.configLoader=e,this.rootComponentType=r,this.config=i,this.urlTree=o,this.paramsInheritanceStrategy=s,this.urlSerializer=a,this.applyRedirects=new ir(this.urlSerializer,this.urlTree)}noMatchError(n){return new C(4002,`'${n.segmentGroup}'`)}recognize(){let n=vn(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(n).pipe(v(({children:e,rootSnapshot:r})=>{let i=new O(r,e),o=new ze("",i),s=Dn(r,[],this.urlTree.queryParams,this.urlTree.fragment);return s.queryParams=this.urlTree.queryParams,o.url=this.urlSerializer.serialize(s),{state:o,tree:s}}))}match(n){let e=new ae([],Object.freeze({}),Object.freeze(l({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),f,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,n,f,e).pipe(v(r=>({children:r,rootSnapshot:e})),re(r=>{if(r instanceof Be)return this.urlTree=r.urlTree,this.match(r.urlTree.root);throw r instanceof qe?this.noMatchError(r):r}))}processSegmentGroup(n,e,r,i,o){return r.segments.length===0&&r.hasChildren()?this.processChildren(n,e,r,o):this.processSegment(n,e,r,r.segments,i,!0,o).pipe(v(s=>s instanceof O?[s]:[]))}processChildren(n,e,r,i){let o=[];for(let s of Object.keys(r.children))s==="primary"?o.unshift(s):o.push(s);return w(o).pipe(ne(s=>{let a=r.children[s],u=ki(e,s);return this.processSegmentGroup(n,u,a,s,i)}),Er((s,a)=>(s.push(...a),s)),Lt(null),Tr(),I(s=>{if(s===null)return fe(r);let a=Vn(s);return Ao(a),h(a)}))}processSegment(n,e,r,i,o,s,a){return w(e).pipe(ne(u=>this.processSegmentAgainstRoute(u._injector??n,e,u,r,i,o,s,a).pipe(re(c=>{if(c instanceof qe)return h(null);throw c}))),Q(u=>!!u),re(u=>{if(qn(u))return wo(r,i,o)?h(new sr):fe(r);throw u}))}processSegmentAgainstRoute(n,e,r,i,o,s,a,u){return L(r)!==s&&(s===f||!Tt(i,o,r))?fe(i):r.redirectTo===void 0?this.matchSegmentAgainstRoute(n,i,r,o,s,u):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(n,i,e,r,o,s,u):fe(i)}expandSegmentAgainstRouteUsingRedirect(n,e,r,i,o,s,a){let{matched:u,parameters:c,consumedSegments:g,positionalParamSegments:y,remainingSegments:x}=Hn(e,i,o);if(!u)return fe(e);typeof i.redirectTo=="string"&&i.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>Io&&(this.allowRedirects=!1));let G=new ae(o,c,Object.freeze(l({},this.urlTree.queryParams)),this.urlTree.fragment,mn(i),L(i),i.component??i._loadedComponent??null,i,Rn(i)),E=wt(G,a,this.paramsInheritanceStrategy);return G.params=Object.freeze(E.params),G.data=Object.freeze(E.data),this.applyRedirects.applyRedirectCommands(g,i.redirectTo,y,G,n).pipe(A(te=>this.applyRedirects.lineralizeSegments(i,te)),I(te=>this.processSegment(n,r,e,te.concat(x),s,!1,a)))}matchSegmentAgainstRoute(n,e,r,i,o,s){let a=vo(e,r,i,n,this.urlSerializer);return r.path==="**"&&(e.children={}),a.pipe(A(u=>u.matched?(n=r._injector??n,this.getChildConfig(n,r,i).pipe(A(({routes:c})=>{let g=r._loadedInjector??n,{parameters:y,consumedSegments:x,remainingSegments:G}=u,E=new ae(x,y,Object.freeze(l({},this.urlTree.queryParams)),this.urlTree.fragment,mn(r),L(r),r.component??r._loadedComponent??null,r,Rn(r)),Ut=wt(E,s,this.paramsInheritanceStrategy);E.params=Object.freeze(Ut.params),E.data=Object.freeze(Ut.data);let{segmentGroup:te,slicedSegments:Pt}=vn(e,x,G,c);if(Pt.length===0&&te.hasChildren())return this.processChildren(g,c,te,E).pipe(v(Ke=>new O(E,Ke)));if(c.length===0&&Pt.length===0)return h(new O(E,[]));let li=L(r)===o;return this.processSegment(g,c,te,Pt,li?f:o,!0,E).pipe(v(Ke=>new O(E,Ke instanceof O?[Ke]:[])))}))):fe(e)))}getChildConfig(n,e,r){return e.children?h({routes:e.children,injector:n}):e.loadChildren?e._loadedRoutes!==void 0?h({routes:e._loadedRoutes,injector:e._loadedInjector}):lo(n,e,r,this.urlSerializer).pipe(I(i=>i?this.configLoader.loadChildren(n,e).pipe(S(o=>{e._loadedRoutes=o.routes,e._loadedInjector=o.injector})):po(e))):h({routes:[],injector:n})}};function Ao(t){t.sort((n,e)=>n.value.outlet===f?-1:e.value.outlet===f?1:n.value.outlet.localeCompare(e.value.outlet))}function To(t){let n=t.value.routeConfig;return n&&n.path===""}function Vn(t){let n=[],e=new Set;for(let r of t){if(!To(r)){n.push(r);continue}let i=n.find(o=>r.value.routeConfig===o.value.routeConfig);i!==void 0?(i.children.push(...r.children),e.add(i)):n.push(r)}for(let r of e){let i=Vn(r.children);n.push(new O(r.value,i))}return n.filter(r=>!e.has(r))}function mn(t){return t.data||{}}function Rn(t){return t.resolve||{}}function Eo(t,n,e,r,i,o){return I(s=>bo(t,n,e,r,s.extractedUrl,i,o).pipe(v(({state:a,tree:u})=>N(l({},s),{targetSnapshot:a,urlAfterRedirects:u}))))}function Oo(t,n){return I(e=>{let{targetSnapshot:r,guards:{canActivateChecks:i}}=e;if(!i.length)return h(e);let o=new Set(i.map(u=>u.route)),s=new Set;for(let u of o)if(!s.has(u))for(let c of Wn(u))s.add(c);let a=0;return w(s).pipe(ne(u=>o.has(u)?Mo(u,r,t,n):(u.data=wt(u,u.parent,t).resolve,h(void 0))),S(()=>a++),jt(1),I(u=>a===s.size?h(e):B))})}function Wn(t){let n=t.children.map(e=>Wn(e)).flat();return[t,...n]}function Mo(t,n,e,r){let i=t.routeConfig,o=t._resolve;return i?.title!==void 0&&!jn(i)&&(o[He]=i.title),Ze(()=>(t.data=wt(t,t.parent,e).resolve,Do(o,t,n,r).pipe(v(s=>(t._resolvedData=s,t.data=l(l({},t.data),s),null)))))}function Do(t,n,e,r){let i=Kt(t);if(i.length===0)return h({});let o={};return w(i).pipe(I(s=>No(t[s],n,e,r).pipe(Q(),S(a=>{if(a instanceof we)throw bt(new Z,a);o[s]=a}))),jt(1),v(()=>o),re(s=>qn(s)?B:Ee(s)))}function No(t,n,e,r){let i=Ie(n)??r,o=Ae(t,i),s=o.resolve?o.resolve(n,e):P(i,()=>o(n,e));return W(s)}function Gt(t){return A(n=>{let e=t(n);return e?w(e).pipe(v(()=>n)):h(n)})}var fr=(()=>{class t{buildTitle(e){let r,i=e.root;for(;i!==void 0;)r=this.getResolvedTitleForRoute(i)??r,i=i.children.find(o=>o.outlet===f);return r}getResolvedTitleForRoute(e){return e.data[He]}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:()=>d(Gn),providedIn:"root"})}return t})(),Gn=(()=>{class t extends fr{title;constructor(e){super(),this.title=e}updateTitle(e){let r=this.buildTitle(e);r!==void 0&&this.title.setTitle(r)}static \u0275fac=function(r){return new(r||t)(K(hn))};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ee=new T("",{providedIn:"root",factory:()=>({})}),Te=new T(""),Et=(()=>{class t{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=d(tn);loadComponent(e,r){if(this.componentLoaders.get(r))return this.componentLoaders.get(r);if(r._loadedComponent)return h(r._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(r);let i=W(P(e,()=>r.loadComponent())).pipe(v(Kn),A(Yn),S(s=>{this.onLoadEndListener&&this.onLoadEndListener(r),r._loadedComponent=s}),Je(()=>{this.componentLoaders.delete(r)})),o=new _t(i,()=>new q).pipe(xt());return this.componentLoaders.set(r,o),o}loadChildren(e,r){if(this.childrenLoaders.get(r))return this.childrenLoaders.get(r);if(r._loadedRoutes)return h({routes:r._loadedRoutes,injector:r._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(r);let o=Qn(r,this.compiler,e,this.onLoadEndListener).pipe(Je(()=>{this.childrenLoaders.delete(r)})),s=new _t(o,()=>new q).pipe(xt());return this.childrenLoaders.set(r,s),s}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Qn(t,n,e,r){return W(P(e,()=>t.loadChildren())).pipe(v(Kn),A(Yn),I(i=>i instanceof zr||Array.isArray(i)?h(i):w(n.compileModuleAsync(i))),v(i=>{r&&r(t);let o,s,a=!1;return Array.isArray(i)?(s=i,a=!0):(o=i.create(e).injector,s=o.get(Te,[],{optional:!0,self:!0}).flat()),{routes:s.map(dr),injector:o}}))}function Uo(t){return t&&typeof t=="object"&&"default"in t}function Kn(t){return Uo(t)?t.default:t}function Yn(t){return h(t)}var Ot=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:()=>d(Po),providedIn:"root"})}return t})(),Po=(()=>{class t{shouldProcessUrl(e){return!0}extract(e){return e}merge(e,r){return e}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),pr=new T(""),gr=new T("");function Zn(t,n,e){let r=t.get(gr),i=t.get(Nr);if(!i.startViewTransition||r.skipNextTransition)return r.skipNextTransition=!1,new Promise(c=>setTimeout(c));let o,s=new Promise(c=>{o=c}),a=i.startViewTransition(()=>(o(),xo(t)));a.ready.catch(c=>{});let{onViewTransitionCreated:u}=r;return u&&P(t,()=>u({transition:a,from:n,to:e})),s}function xo(t){return new Promise(n=>{Hr({read:()=>setTimeout(n)},{injector:t})})}var vr=new T(""),Mt=(()=>{class t{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new q;transitionAbortWithErrorSubject=new q;configLoader=d(Et);environmentInjector=d(ie);destroyRef=d(Ur);urlSerializer=d(ce);rootContexts=d(le);location=d(de);inputBindingEnabled=d(Ve,{optional:!0})!==null;titleStrategy=d(fr);options=d(ee,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=d(Ot);createViewTransition=d(pr,{optional:!0});navigationErrorHandler=d(vr,{optional:!0});navigationId=0;get hasRequestedNavigation(){return this.navigationId!==0}transitions;afterPreactivation=()=>h(void 0);rootComponentType=null;destroyed=!1;constructor(){let e=i=>this.events.next(new pt(i)),r=i=>this.events.next(new gt(i));this.configLoader.onLoadEndListener=r,this.configLoader.onLoadStartListener=e,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(e){let r=++this.navigationId;this.transitions?.next(N(l({},e),{extractedUrl:this.urlHandlingStrategy.extract(e.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,abortController:new AbortController,id:r}))}setupNavigations(e){return this.transitions=new U(null),this.transitions.pipe(H(r=>r!==null),A(r=>{let i=!1;return h(r).pipe(A(o=>{if(this.navigationId>r.id)return this.cancelNavigationTransition(r,"",b.SupersededByNewNavigation),B;this.currentTransition=r,this.currentNavigation={id:o.id,initialUrl:o.rawUrl,extractedUrl:o.extractedUrl,targetBrowserUrl:typeof o.extras.browserUrl=="string"?this.urlSerializer.parse(o.extras.browserUrl):o.extras.browserUrl,trigger:o.source,extras:o.extras,previousNavigation:this.lastSuccessfulNavigation?N(l({},this.lastSuccessfulNavigation),{previousNavigation:null}):null,abort:()=>o.abortController.abort()};let s=!e.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),a=o.extras.onSameUrlNavigation??e.onSameUrlNavigation;if(!s&&a!=="reload"){let u="";return this.events.next(new z(o.id,this.urlSerializer.serialize(o.rawUrl),u,Re.IgnoredSameUrlNavigation)),o.resolve(!1),B}if(this.urlHandlingStrategy.shouldProcessUrl(o.rawUrl))return h(o).pipe(A(u=>(this.events.next(new X(u.id,this.urlSerializer.serialize(u.extractedUrl),u.source,u.restoredState)),u.id!==this.navigationId?B:Promise.resolve(u))),Eo(this.environmentInjector,this.configLoader,this.rootComponentType,e.config,this.urlSerializer,this.paramsInheritanceStrategy),S(u=>{r.targetSnapshot=u.targetSnapshot,r.urlAfterRedirects=u.urlAfterRedirects,this.currentNavigation=N(l({},this.currentNavigation),{finalUrl:u.urlAfterRedirects});let c=new je(u.id,this.urlSerializer.serialize(u.extractedUrl),this.urlSerializer.serialize(u.urlAfterRedirects),u.targetSnapshot);this.events.next(c)}));if(s&&this.urlHandlingStrategy.shouldProcessUrl(o.currentRawUrl)){let{id:u,extractedUrl:c,source:g,restoredState:y,extras:x}=o,G=new X(u,this.urlSerializer.serialize(c),g,y);this.events.next(G);let E=_n(this.rootComponentType).snapshot;return this.currentTransition=r=N(l({},o),{targetSnapshot:E,urlAfterRedirects:c,extras:N(l({},x),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=c,h(r)}else{let u="";return this.events.next(new z(o.id,this.urlSerializer.serialize(o.extractedUrl),u,Re.IgnoredByUrlHandlingStrategy)),o.resolve(!1),B}}),S(o=>{let s=new lt(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot);this.events.next(s)}),v(o=>(this.currentTransition=r=N(l({},o),{guards:Vi(o.targetSnapshot,o.currentSnapshot,this.rootContexts)}),r)),ro(this.environmentInjector,o=>this.events.next(o)),S(o=>{if(r.guardsResult=o.guardsResult,o.guardsResult&&typeof o.guardsResult!="boolean")throw bt(this.urlSerializer,o.guardsResult);let s=new ht(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot,!!o.guardsResult);this.events.next(s)}),H(o=>o.guardsResult?!0:(this.cancelNavigationTransition(o,"",b.GuardRejected),!1)),Gt(o=>{if(o.guards.canActivateChecks.length!==0)return h(o).pipe(S(s=>{let a=new dt(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}),A(s=>{let a=!1;return h(s).pipe(Oo(this.paramsInheritanceStrategy,this.environmentInjector),S({next:()=>a=!0,complete:()=>{a||this.cancelNavigationTransition(s,"",b.NoDataFromResolver)}}))}),S(s=>{let a=new ft(s.id,this.urlSerializer.serialize(s.extractedUrl),this.urlSerializer.serialize(s.urlAfterRedirects),s.targetSnapshot);this.events.next(a)}))}),Gt(o=>{let s=a=>{let u=[];if(a.routeConfig?.loadComponent&&!a.routeConfig._loadedComponent){let c=Ie(a)??this.environmentInjector;u.push(this.configLoader.loadComponent(c,a.routeConfig).pipe(S(g=>{a.component=g}),v(()=>{})))}for(let c of a.children)u.push(...s(c));return u};return Ye(s(o.targetSnapshot.root)).pipe(Lt(null),he(1))}),Gt(()=>this.afterPreactivation()),A(()=>{let{currentSnapshot:o,targetSnapshot:s}=r,a=this.createViewTransition?.(this.environmentInjector,o.root,s.root);return a?w(a).pipe(v(()=>r)):h(r)}),v(o=>{let s=zi(e.routeReuseStrategy,o.targetSnapshot,o.currentRouterState);return this.currentTransition=r=N(l({},o),{targetRouterState:s}),this.currentNavigation.targetRouterState=s,r}),S(()=>{this.events.next(new ke)}),Hi(this.rootContexts,e.routeReuseStrategy,o=>this.events.next(o),this.inputBindingEnabled),he(1),kt(new wr(o=>{let s=r.abortController.signal,a=()=>o.next();return s.addEventListener("abort",a),()=>s.removeEventListener("abort",a)}).pipe(H(()=>!i&&!r.targetRouterState),S(()=>{this.cancelNavigationTransition(r,r.abortController.signal.reason+"",b.Aborted)}))),S({next:o=>{i=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new D(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects))),this.titleStrategy?.updateTitle(o.targetRouterState.snapshot),o.resolve(!0)},complete:()=>{i=!0}}),kt(this.transitionAbortWithErrorSubject.pipe(S(o=>{throw o}))),Je(()=>{i||this.cancelNavigationTransition(r,"",b.SupersededByNewNavigation),this.currentTransition?.id===r.id&&(this.currentNavigation=null,this.currentTransition=null)}),re(o=>{if(this.destroyed)return r.resolve(!1),B;if(i=!0,Fn(o))this.events.next(new k(r.id,this.urlSerializer.serialize(r.extractedUrl),o.message,o.cancellationCode)),Bi(o)?this.events.next(new Ce(o.url,o.navigationBehaviorOptions)):r.resolve(!1);else{let s=new ye(r.id,this.urlSerializer.serialize(r.extractedUrl),o,r.targetSnapshot??void 0);try{let a=P(this.environmentInjector,()=>this.navigationErrorHandler?.(s));if(a instanceof we){let{message:u,cancellationCode:c}=bt(this.urlSerializer,a);this.events.next(new k(r.id,this.urlSerializer.serialize(r.extractedUrl),u,c)),this.events.next(new Ce(a.redirectTo,a.navigationBehaviorOptions))}else throw this.events.next(s),o}catch(a){this.options.resolveNavigationPromiseOnError?r.resolve(!1):r.reject(a)}}return B}))}))}cancelNavigationTransition(e,r,i){let o=new k(e.id,this.urlSerializer.serialize(e.extractedUrl),r,i);this.events.next(o),e.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let e=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),r=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return e.toString()!==r?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function _o(t){return t!==ve}var Jn=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:()=>d(Lo),providedIn:"root"})}return t})(),At=class{shouldDetach(n){return!1}store(n,e){}shouldAttach(n){return!1}retrieve(n){return null}shouldReuseRoute(n,e){return n.routeConfig===e.routeConfig}},Lo=(()=>{class t extends At{static \u0275fac=(()=>{let e;return function(i){return(e||(e=zt(t)))(i||t)}})();static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Xn=(()=>{class t{urlSerializer=d(ce);options=d(ee,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=d(de);urlHandlingStrategy=d(Ot);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new $;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:e,initialUrl:r,targetBrowserUrl:i}){let o=e!==void 0?this.urlHandlingStrategy.merge(e,r):r,s=i??o;return s instanceof $?this.urlSerializer.serialize(s):s}commitTransition({targetRouterState:e,finalUrl:r,initialUrl:i}){r&&e?(this.currentUrlTree=r,this.rawUrlTree=this.urlHandlingStrategy.merge(r,i),this.routerState=e):this.rawUrlTree=i}routerState=_n(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:e}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,e??this.rawUrlTree)}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:()=>d(jo),providedIn:"root"})}return t})(),jo=(()=>{class t extends Xn{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(e){return this.location.subscribe(r=>{r.type==="popstate"&&setTimeout(()=>{e(r.url,r.state,"popstate")})})}handleRouterEvent(e,r){e instanceof X?this.updateStateMemento():e instanceof z?this.commitTransition(r):e instanceof je?this.urlUpdateStrategy==="eager"&&(r.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(r),r)):e instanceof ke?(this.commitTransition(r),this.urlUpdateStrategy==="deferred"&&!r.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(r),r)):e instanceof k&&e.code!==b.SupersededByNewNavigation&&e.code!==b.Redirect?this.restoreHistory(r):e instanceof ye?this.restoreHistory(r,!0):e instanceof D&&(this.lastSuccessfulId=e.id,this.currentPageId=this.browserPageId)}setBrowserUrl(e,{extras:r,id:i}){let{replaceUrl:o,state:s}=r;if(this.location.isCurrentPathEqualTo(e)||o){let a=this.browserPageId,u=l(l({},s),this.generateNgRouterState(i,a));this.location.replaceState(e,"",u)}else{let a=l(l({},s),this.generateNgRouterState(i,this.browserPageId+1));this.location.go(e,"",a)}}restoreHistory(e,r=!1){if(this.canceledNavigationResolution==="computed"){let i=this.browserPageId,o=this.currentPageId-i;o!==0?this.location.historyGo(o):this.getCurrentUrlTree()===e.finalUrl&&o===0&&(this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(r&&this.resetInternalState(e),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(e,r){return this.canceledNavigationResolution==="computed"?{navigationId:e,\u0275routerPageId:r}:{navigationId:e}}static \u0275fac=(()=>{let e;return function(i){return(e||(e=zt(t)))(i||t)}})();static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Dt(t,n){t.events.pipe(H(e=>e instanceof D||e instanceof k||e instanceof ye||e instanceof z),v(e=>e instanceof D||e instanceof z?0:(e instanceof k?e.code===b.Redirect||e.code===b.SupersededByNewNavigation:!1)?2:1),H(e=>e!==2),he(1)).subscribe(()=>{n()})}var ko={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},$o={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},F=(()=>{class t{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=d(Vr);stateManager=d(Xn);options=d(ee,{optional:!0})||{};pendingTasks=d(xr);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=d(Mt);urlSerializer=d(ce);location=d(de);urlHandlingStrategy=d(Ot);injector=d(ie);_events=new q;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=d(Jn);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=d(Te,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!d(Ve,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:e=>{this.console.warn(e)}}),this.subscribeToNavigationEvents()}eventsSubscription=new Sr;subscribeToNavigationEvents(){let e=this.navigationTransitions.events.subscribe(r=>{try{let i=this.navigationTransitions.currentTransition,o=this.navigationTransitions.currentNavigation;if(i!==null&&o!==null){if(this.stateManager.handleRouterEvent(r,o),r instanceof k&&r.code!==b.Redirect&&r.code!==b.SupersededByNewNavigation)this.navigated=!0;else if(r instanceof D)this.navigated=!0;else if(r instanceof Ce){let s=r.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(r.url,i.currentRawUrl),u=l({browserUrl:i.extras.browserUrl,info:i.extras.info,skipLocationChange:i.extras.skipLocationChange,replaceUrl:i.extras.replaceUrl||this.urlUpdateStrategy==="eager"||_o(i.source)},s);this.scheduleNavigation(a,ve,null,u,{resolve:i.resolve,reject:i.reject,promise:i.promise})}}Li(r)&&this._events.next(r)}catch(i){this.navigationTransitions.transitionAbortWithErrorSubject.next(i)}});this.eventsSubscription.add(e)}resetRootComponentType(e){this.routerState.root.component=e,this.navigationTransitions.rootComponentType=e}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),ve,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((e,r,i)=>{this.navigateToSyncWithBrowser(e,i,r)})}navigateToSyncWithBrowser(e,r,i){let o={replaceUrl:!0},s=i?.navigationId?i:null;if(i){let u=l({},i);delete u.navigationId,delete u.\u0275routerPageId,Object.keys(u).length!==0&&(o.state=u)}let a=this.parseUrl(e);this.scheduleNavigation(a,r,s,o).catch(u=>{this.disposed||this.injector.get(Xe)(u)})}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(e){this.config=e.map(dr),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(e,r={}){let{relativeTo:i,queryParams:o,fragment:s,queryParamsHandling:a,preserveFragment:u}=r,c=u?this.currentUrlTree.fragment:s,g=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":g=l(l({},this.currentUrlTree.queryParams),o);break;case"preserve":g=this.currentUrlTree.queryParams;break;default:g=o||null}g!==null&&(g=this.removeEmptyProps(g));let y;try{let x=i?i.snapshot:this.routerState.snapshot.root;y=Nn(x)}catch{(typeof e[0]!="string"||e[0][0]!=="/")&&(e=[]),y=this.currentUrlTree.root}return Un(y,e,g,c??null)}navigateByUrl(e,r={skipLocationChange:!1}){let i=J(e)?e:this.parseUrl(e),o=this.urlHandlingStrategy.merge(i,this.rawUrlTree);return this.scheduleNavigation(o,ve,null,r)}navigate(e,r={skipLocationChange:!1}){return zo(e),this.navigateByUrl(this.createUrlTree(e,r),r)}serializeUrl(e){return this.urlSerializer.serialize(e)}parseUrl(e){try{return this.urlSerializer.parse(e)}catch{return this.urlSerializer.parse("/")}}isActive(e,r){let i;if(r===!0?i=l({},ko):r===!1?i=l({},$o):i=r,J(e))return dn(this.currentUrlTree,e,i);let o=this.parseUrl(e);return dn(this.currentUrlTree,o,i)}removeEmptyProps(e){return Object.entries(e).reduce((r,[i,o])=>(o!=null&&(r[i]=o),r),{})}scheduleNavigation(e,r,i,o,s){if(this.disposed)return Promise.resolve(!1);let a,u,c;s?(a=s.resolve,u=s.reject,c=s.promise):c=new Promise((y,x)=>{a=y,u=x});let g=this.pendingTasks.add();return Dt(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(g))}),this.navigationTransitions.handleNavigationRequest({source:r,restoredState:i,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:e,extras:o,resolve:a,reject:u,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(y=>Promise.reject(y))}static \u0275fac=function(r){return new(r||t)};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function zo(t){for(let n=0;n<t.length;n++)if(t[n]==null)throw new C(4008,!1)}var Nt=(()=>{class t{router;route;tabIndexAttribute;renderer;el;locationStrategy;reactiveHref=Pr(null);get href(){return rn(this.reactiveHref)}set href(e){this.reactiveHref.set(e)}target;queryParams;fragment;queryParamsHandling;state;info;relativeTo;isAnchorElement;subscription;onChanges=new q;applicationErrorHandler=d(Xe);options=d(ee,{optional:!0});constructor(e,r,i,o,s,a){this.router=e,this.route=r,this.tabIndexAttribute=i,this.renderer=o,this.el=s,this.locationStrategy=a,this.reactiveHref.set(d(new nn("href"),{optional:!0}));let u=s.nativeElement.tagName?.toLowerCase();this.isAnchorElement=u==="a"||u==="area"||!!(typeof customElements=="object"&&customElements.get(u)?.observedAttributes?.includes?.("href")),this.isAnchorElement?this.setTabIndexIfNotOnNativeEl("0"):this.subscribeToNavigationEventsIfNecessary()}subscribeToNavigationEventsIfNecessary(){if(this.subscription!==void 0||!this.isAnchorElement)return;let e=this.preserveFragment,r=i=>i==="merge"||i==="preserve";e||=r(this.queryParamsHandling),e||=!this.queryParamsHandling&&!r(this.options?.defaultQueryParamsHandling),e&&(this.subscription=this.router.events.subscribe(i=>{i instanceof D&&this.updateHref()}))}preserveFragment=!1;skipLocationChange=!1;replaceUrl=!1;setTabIndexIfNotOnNativeEl(e){this.tabIndexAttribute!=null||this.isAnchorElement||this.applyAttributeValue("tabindex",e)}ngOnChanges(e){this.isAnchorElement&&(this.updateHref(),this.subscribeToNavigationEventsIfNecessary()),this.onChanges.next(this)}routerLinkInput=null;set routerLink(e){e==null?(this.routerLinkInput=null,this.setTabIndexIfNotOnNativeEl(null)):(J(e)?this.routerLinkInput=e:this.routerLinkInput=Array.isArray(e)?e:[e],this.setTabIndexIfNotOnNativeEl("0"))}onClick(e,r,i,o,s){let a=this.urlTree;if(a===null||this.isAnchorElement&&(e!==0||r||i||o||s||typeof this.target=="string"&&this.target!="_self"))return!0;let u={skipLocationChange:this.skipLocationChange,replaceUrl:this.replaceUrl,state:this.state,info:this.info};return this.router.navigateByUrl(a,u)?.catch(c=>{this.applicationErrorHandler(c)}),!this.isAnchorElement}ngOnDestroy(){this.subscription?.unsubscribe()}updateHref(){let e=this.urlTree;this.reactiveHref.set(e!==null&&this.locationStrategy?this.locationStrategy?.prepareExternalUrl(this.router.serializeUrl(e))??"":null)}applyAttributeValue(e,r){let i=this.renderer,o=this.el.nativeElement;r!==null?i.setAttribute(o,e,r):i.removeAttribute(o,e)}get urlTree(){return this.routerLinkInput===null?null:J(this.routerLinkInput)?this.routerLinkInput:this.router.createUrlTree(this.routerLinkInput,{relativeTo:this.relativeTo!==void 0?this.relativeTo:this.route,queryParams:this.queryParams,fragment:this.fragment,queryParamsHandling:this.queryParamsHandling,preserveFragment:this.preserveFragment})}static \u0275fac=function(r){return new(r||t)(_(F),_(V),_r("tabindex"),_(qt),_(Ft),_(Ne))};static \u0275dir=De({type:t,selectors:[["","routerLink",""]],hostVars:2,hostBindings:function(r,i){r&1&&Zr("click",function(s){return i.onClick(s.button,s.ctrlKey,s.shiftKey,s.altKey,s.metaKey)}),r&2&&Kr("href",i.reactiveHref(),Lr)("target",i.target)},inputs:{target:"target",queryParams:"queryParams",fragment:"fragment",queryParamsHandling:"queryParamsHandling",state:"state",info:"info",relativeTo:"relativeTo",preserveFragment:[2,"preserveFragment","preserveFragment",rt],skipLocationChange:[2,"skipLocationChange","skipLocationChange",rt],replaceUrl:[2,"replaceUrl","replaceUrl",rt],routerLink:"routerLink"},features:[Me]})}return t})(),Fo=(()=>{class t{router;element;renderer;cdr;link;links;classes=[];routerEventsSubscription;linkInputChangesSubscription;_isActive=!1;get isActive(){return this._isActive}routerLinkActiveOptions={exact:!1};ariaCurrentWhenActive;isActiveChange=new oe;constructor(e,r,i,o,s){this.router=e,this.element=r,this.renderer=i,this.cdr=o,this.link=s,this.routerEventsSubscription=e.events.subscribe(a=>{a instanceof D&&this.update()})}ngAfterContentInit(){h(this.links.changes,h(null)).pipe(Oe()).subscribe(e=>{this.update(),this.subscribeToEachLinkOnChanges()})}subscribeToEachLinkOnChanges(){this.linkInputChangesSubscription?.unsubscribe();let e=[...this.links.toArray(),this.link].filter(r=>!!r).map(r=>r.onChanges);this.linkInputChangesSubscription=w(e).pipe(Oe()).subscribe(r=>{this._isActive!==this.isLinkActive(this.router)(r)&&this.update()})}set routerLinkActive(e){let r=Array.isArray(e)?e:e.split(" ");this.classes=r.filter(i=>!!i)}ngOnChanges(e){this.update()}ngOnDestroy(){this.routerEventsSubscription.unsubscribe(),this.linkInputChangesSubscription?.unsubscribe()}update(){!this.links||!this.router.navigated||queueMicrotask(()=>{let e=this.hasActiveLinks();this.classes.forEach(r=>{e?this.renderer.addClass(this.element.nativeElement,r):this.renderer.removeClass(this.element.nativeElement,r)}),e&&this.ariaCurrentWhenActive!==void 0?this.renderer.setAttribute(this.element.nativeElement,"aria-current",this.ariaCurrentWhenActive.toString()):this.renderer.removeAttribute(this.element.nativeElement,"aria-current"),this._isActive!==e&&(this._isActive=e,this.cdr.markForCheck(),this.isActiveChange.emit(e))})}isLinkActive(e){let r=qo(this.routerLinkActiveOptions)?this.routerLinkActiveOptions:this.routerLinkActiveOptions.exact||!1;return i=>{let o=i.urlTree;return o?e.isActive(o,r):!1}}hasActiveLinks(){let e=this.isLinkActive(this.router);return this.link&&e(this.link)||this.links.some(e)}static \u0275fac=function(r){return new(r||t)(_(F),_(Ft),_(qt),_(tt),_(Nt,8))};static \u0275dir=De({type:t,selectors:[["","routerLinkActive",""]],contentQueries:function(r,i,o){if(r&1&&Jr(o,Nt,5),r&2){let s;Xr(s=en())&&(i.links=s)}},inputs:{routerLinkActiveOptions:"routerLinkActiveOptions",ariaCurrentWhenActive:"ariaCurrentWhenActive",routerLinkActive:"routerLinkActive"},outputs:{isActiveChange:"isActiveChange"},exportAs:["routerLinkActive"],features:[Me]})}return t})();function qo(t){return!!t.paths}var Ge=class{};var ei=(()=>{class t{router;injector;preloadingStrategy;loader;subscription;constructor(e,r,i,o){this.router=e,this.injector=r,this.preloadingStrategy=i,this.loader=o}setUpPreloading(){this.subscription=this.router.events.pipe(H(e=>e instanceof D),ne(()=>this.preload())).subscribe(()=>{})}preload(){return this.processRoutes(this.injector,this.router.config)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}processRoutes(e,r){let i=[];for(let o of r){o.providers&&!o._injector&&(o._injector=et(o.providers,e,`Route: ${o.path}`));let s=o._injector??e,a=o._loadedInjector??s;(o.loadChildren&&!o._loadedRoutes&&o.canLoad===void 0||o.loadComponent&&!o._loadedComponent)&&i.push(this.preloadConfig(s,o)),(o.children||o._loadedRoutes)&&i.push(this.processRoutes(a,o.children??o._loadedRoutes))}return w(i).pipe(Oe())}preloadConfig(e,r){return this.preloadingStrategy.preload(r,()=>{let i;r.loadChildren&&r.canLoad===void 0?i=this.loader.loadChildren(e,r):i=h(null);let o=i.pipe(I(s=>s===null?h(void 0):(r._loadedRoutes=s.routes,r._loadedInjector=s.injector,this.processRoutes(s.injector??e,s.routes))));if(r.loadComponent&&!r._loadedComponent){let s=this.loader.loadComponent(e,r);return w([o,s]).pipe(Oe())}else return o})}static \u0275fac=function(r){return new(r||t)(K(F),K(ie),K(Ge),K(Et))};static \u0275prov=R({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ti=new T(""),Bo=(()=>{class t{urlSerializer;transitions;viewportScroller;zone;options;routerEventsSubscription;scrollEventsSubscription;lastId=0;lastSource=ve;restoredId=0;store={};constructor(e,r,i,o,s={}){this.urlSerializer=e,this.transitions=r,this.viewportScroller=i,this.zone=o,this.options=s,s.scrollPositionRestoration||="disabled",s.anchorScrolling||="disabled"}init(){this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.setHistoryScrollRestoration("manual"),this.routerEventsSubscription=this.createScrollEvents(),this.scrollEventsSubscription=this.consumeScrollEvents()}createScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof X?(this.store[this.lastId]=this.viewportScroller.getScrollPosition(),this.lastSource=e.navigationTrigger,this.restoredId=e.restoredState?e.restoredState.navigationId:0):e instanceof D?(this.lastId=e.id,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.urlAfterRedirects).fragment)):e instanceof z&&e.code===Re.IgnoredSameUrlNavigation&&(this.lastSource=void 0,this.restoredId=0,this.scheduleScrollEvent(e,this.urlSerializer.parse(e.url).fragment))})}consumeScrollEvents(){return this.transitions.events.subscribe(e=>{e instanceof Se&&(e.position?this.options.scrollPositionRestoration==="top"?this.viewportScroller.scrollToPosition([0,0]):this.options.scrollPositionRestoration==="enabled"&&this.viewportScroller.scrollToPosition(e.position):e.anchor&&this.options.anchorScrolling==="enabled"?this.viewportScroller.scrollToAnchor(e.anchor):this.options.scrollPositionRestoration!=="disabled"&&this.viewportScroller.scrollToPosition([0,0]))})}scheduleScrollEvent(e,r){this.zone.runOutsideAngular(()=>yr(this,null,function*(){yield new Promise(i=>{setTimeout(i),typeof requestAnimationFrame<"u"&&requestAnimationFrame(i)}),this.zone.run(()=>{this.transitions.events.next(new Se(e,this.lastSource==="popstate"?this.store[this.restoredId]:null,r))})}))}ngOnDestroy(){this.routerEventsSubscription?.unsubscribe(),this.scrollEventsSubscription?.unsubscribe()}static \u0275fac=function(r){jr()};static \u0275prov=R({token:t,factory:t.\u0275fac})}return t})();function Ho(t){return t.routerState.root}function Qe(t,n){return{\u0275kind:t,\u0275providers:n}}function Vo(){let t=d($t);return n=>{let e=t.get(Qr);if(n!==e.components[0])return;let r=t.get(F),i=t.get(ri);t.get(Rr)===1&&r.initialNavigation(),t.get(oi,null,{optional:!0})?.setUpPreloading(),t.get(ti,null,{optional:!0})?.init(),r.resetRootComponentType(e.componentTypes[0]),i.closed||(i.next(),i.complete(),i.unsubscribe())}}var ri=new T("",{factory:()=>new q}),Rr=new T("",{providedIn:"root",factory:()=>1});function ni(){let t=[{provide:Rr,useValue:0},Bt(()=>{let n=d($t);return n.get(an,Promise.resolve()).then(()=>new Promise(r=>{let i=n.get(F),o=n.get(ri);Dt(i,()=>{r(!0)}),n.get(Mt).afterPreactivation=()=>(r(!0),o.closed?h(void 0):o),i.initialNavigation()}))})];return Qe(2,t)}function ii(){let t=[Bt(()=>{d(F).setUpLocationChangeListener()}),{provide:Rr,useValue:2}];return Qe(3,t)}var oi=new T("");function si(t){return Qe(0,[{provide:oi,useExisting:ei},{provide:Ge,useExisting:t}])}function ai(){return Qe(8,[lr,{provide:Ve,useExisting:lr}])}function ui(t){$r("NgRouterViewTransitions");let n=[{provide:pr,useValue:Zn},{provide:gr,useValue:l({skipNextTransition:!!t?.skipInitialTransition},t)}];return Qe(9,n)}var ci=[de,{provide:ce,useClass:Z},F,le,{provide:V,useFactory:Ho,deps:[F]},Et,[]],Wo=(()=>{class t{constructor(){}static forRoot(e,r){return{ngModule:t,providers:[ci,[],{provide:Te,multi:!0,useValue:e},[],r?.errorHandler?{provide:vr,useValue:r.errorHandler}:[],{provide:ee,useValue:r||{}},r?.useHash?Qo():Ko(),Go(),r?.preloadingStrategy?si(r.preloadingStrategy).\u0275providers:[],r?.initialNavigation?Yo(r):[],r?.bindToComponentInputs?ai().\u0275providers:[],r?.enableViewTransitions?ui().\u0275providers:[],Zo()]}}static forChild(e){return{ngModule:t,providers:[{provide:Te,multi:!0,useValue:e}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=qr({type:t});static \u0275inj=Mr({})}return t})();function Go(){return{provide:ti,useFactory:()=>{let t=d(ln),n=d(Br),e=d(ee),r=d(Mt),i=d(ce);return e.scrollOffset&&t.setOffset(e.scrollOffset),new Bo(i,r,t,n,e)}}}function Qo(){return{provide:Ne,useClass:cn}}function Ko(){return{provide:Ne,useClass:un}}function Yo(t){return[t.initialNavigation==="disabled"?ii().\u0275providers:[],t.initialNavigation==="enabledBlocking"?ni().\u0275providers:[]]}var mr=new T("");function Zo(){return[{provide:mr,useFactory:Vo},{provide:Gr,multi:!0,useExisting:mr}]}export{D as a,V as b,cr as c,F as d,Nt as e,Fo as f,Wo as g};
@@ -1,20 +0,0 @@
1
- import{a as we}from"./chunk-5TCYRJ6A.js";import{b as A,e as ye,f as Ce,g as Re}from"./chunk-Y6KHINTU.js";import{a as fe,b as he}from"./chunk-NFWGYMP7.js";import{a as _e}from"./chunk-77JZBWAC.js";import{a as De}from"./chunk-V2P2FPJ7.js";import{m as pe,n as ge,t as D}from"./chunk-EA3EXGPZ.js";import{A as me,c as se,e as le,l as de,z as ce}from"./chunk-CNMM42I5.js";import{b as ue,d as j}from"./chunk-UOLP7IQJ.js";import{b as be}from"./chunk-LJCIV6Z3.js";import{k as I,n as H}from"./chunk-YRIAJM6Y.js";import{a as R,b as P}from"./chunk-G7FA4DP4.js";import"./chunk-6GMXEQVA.js";import{Ec as z,Hb as C,Ib as w,Jb as v,Jc as s,Kc as d,Lb as Z,Lc as K,Mb as ee,Nb as te,Ob as f,Pb as a,Qb as l,Rb as p,_b as x,ab as r,bc as b,d as G,dc as m,fb as X,g as Q,h as E,id as re,ka as g,mb as B,pd as ae,qa as h,qc as _,ra as u,rc as k,sc as M,w as $,xc as ie,yc as oe,zc as ne}from"./chunk-H36QJYLQ.js";var ke=Q(Re(),1);var ve=Q(De(),1);var Ee=(n,y)=>({"fa-trash":n,"fa-cog fa-spin":y});function Ie(n,y){n&1&&(a(0,"div",13),p(1,"i",20),l())}function je(n,y){if(n&1){let e=x();a(0,"li",9)(1,"span"),_(2),s(3,"date"),p(4,"br"),a(5,"span",21),_(6),s(7,"date"),l()(),a(8,"span",22)(9,"button",25),s(10,"translate"),s(11,"translate"),b("click",function(){let i=h(e).$implicit,o=m(2);return u(o.restore(i.id))}),p(12,"i",26),l(),a(13,"button",27),s(14,"translate"),s(15,"translate"),b("click",function(){let i=h(e).$implicit,o=m(2);return u(o.download(i.id))}),p(16,"i",28),l(),a(17,"button",23),s(18,"translate"),s(19,"translate"),b("click",function(){let i=h(e).$implicit,o=m(2);return u(o.delete(i.id))}),p(20,"i",24),l()()()}if(n&2){let e=y.$implicit,t=m(2);r(2),M(" ",K(3,15,e.timestamp,"mediumDate")),r(4),k(K(7,18,e.timestamp,"shortTime")),r(3),f("disabled",t.clicked||t.deleting)("ngbTooltip",d(10,21,"config.restore.copy_to_editor"))("openDelay",150),C("aria-label",d(11,23,"config.restore.copy_to_editor")),r(4),f("disabled",t.clicked||t.deleting)("ngbTooltip",d(14,25,"form.button_download"))("openDelay",150),C("aria-label",d(15,27,"form.button_download")),r(4),f("disabled",t.clicked||t.deleting)("ngbTooltip",d(18,29,"form.button_delete"))("openDelay",150),C("aria-label",d(19,31,"form.button_delete")),r(3),f("ngClass",z(33,Ee,e.id!==t.deleting,e.id===t.deleting))}}function He(n,y){if(n&1){let e=x();a(0,"ul",14),ee(1,je,21,36,"li",9,Z),a(3,"li",9)(4,"span"),_(5),s(6,"translate"),p(7,"br"),a(8,"span",21),_(9),s(10,"translate"),l()(),a(11,"span",22)(12,"button",23),s(13,"translate"),s(14,"translate"),b("click",function(){h(e);let i=m();return u(i.deleteAllBackups())}),p(15,"i",24),l()()()()}if(n&2){let e=m();r(),te(e.backupList),r(4),M(" ",d(6,7,"form.button_delete_all")),r(4),M(" ",d(10,9,"common.labels.no_confirmation")," "),r(3),f("disabled",e.clicked||e.deleting)("ngbTooltip",d(13,11,"form.button_delete_all"))("openDelay",150),C("aria-label",d(14,13,"form.button_delete")),r(3),f("ngClass",z(15,Ee,e.deleting!=="all",e.deleting==="all"))}}var xe=(()=>{class n{$activeModal=g(pe);$api=g(H);$router=g(j);$toastr=g(I);$translate=g(R);currentConfig;fromSettings=!1;loading=!0;backupList=[];clicked=!1;deleting=null;ngOnInit(){this.getConfigBackups()}getConfigBackups(){return E(this,null,function*(){try{let e=yield $(this.$api.get("/config-editor/backups"));this.loading=!1,this.backupList=e}catch(e){this.loading=!1,console.error(e),this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),this.dismissModal()}})}restore(e){return this.$activeModal.close(e)}download(e){return E(this,null,function*(){this.clicked=!0;try{let t=yield $(this.$api.get(`/config-editor/backups/${e}`)),i=JSON.stringify(t,null,4),o=new Blob([i],{type:"application/json"}),T=`config-backup-${e}.json`;(0,ve.saveAs)(o,T),this.clicked=!1}catch(t){this.clicked=!1,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}downloadCurrentConfig(){let e=`data:text/json;charset=utf-8,${encodeURIComponent(this.currentConfig)}`,t=document.createElement("a");t.setAttribute("href",e),t.setAttribute("download","config.json"),document.body.appendChild(t),t.click(),t.remove()}delete(e){return E(this,null,function*(){this.deleting=e;try{yield $(this.$api.delete(`/config-editor/backups/${e}`)),yield this.getConfigBackups(),this.deleting=null}catch(t){this.deleting=null,this.$toastr.error(t.error?.message||t.message,this.$translate.instant("toast.title_error")),console.error(t)}})}deleteAllBackups(){return E(this,null,function*(){this.deleting="all";try{yield $(this.$api.delete("/config-editor/backups")),this.$toastr.success(this.$translate.instant("config.restore.toast_backups_deleted"),this.$translate.instant("toast.title_success")),this.backupList=[],this.deleting=null}catch(e){this.$toastr.error(e.error?.message||e.message,this.$translate.instant("toast.title_error")),console.error(e),this.deleting=null}})}dismissModal(){this.fromSettings&&this.$router.navigate(["/settings"]),this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],inputs:{currentConfig:"currentConfig",fromSettings:"fromSettings"},decls:40,vars:31,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click","disabled"],[1,"modal-body"],[1,"text-center","mb-3"],[1,"fas","fa-fw","fa-history","primary-text",2,"font-size","75px"],[1,"mb-3"],[1,"list-group","list-group-box","mb-0"],[1,"list-group-item","d-flex","justify-content-between","align-items-center"],[1,"grey-text"],[1,"btn","btn-primary","m-0","ms-3",3,"click","disabled"],[1,"fas","fa-fw","fa-arrow-right"],[1,"text-center","primary-text"],[1,"list-group","list-group-box","mt-3"],[1,"modal-footer","justify-content-between"],[1,"text-start"],[1,"text-center"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click","disabled"],[1,"text-end"],[1,"fa","fa-fw","fa-cog","fa-spin","mt-3",2,"font-size","75px"],[1,"grey-text","small"],[2,"display","flex","flex-wrap","nowrap"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-danger","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw",3,"ngClass"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-3",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-history"],["placement","bottom","container","modal","triggers","hover",1,"btn","btn-primary","m-0","ms-2",3,"click","disabled","ngbTooltip","openDelay"],[1,"fas","fa-fw","fa-download"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"h5",2),_(3),s(4,"translate"),l(),a(5,"button",3),s(6,"translate"),b("click",function(){return i.dismissModal()}),l()(),a(7,"div",4)(8,"div",5),p(9,"i",6),l(),a(10,"ul",7)(11,"li"),_(12),s(13,"translate"),l(),a(14,"li"),_(15),s(16,"translate"),l()(),a(17,"ul",8)(18,"li",9)(19,"div")(20,"span"),_(21),s(22,"translate"),l(),p(23,"br"),a(24,"small",10),_(25),s(26,"translate"),l()(),a(27,"button",11),s(28,"translate"),b("click",function(){return i.downloadCurrentConfig()}),p(29,"i",12),l()()(),w(30,Ie,2,0,"div",13)(31,He,16,18,"ul",14),l(),a(32,"div",15),p(33,"div",16),a(34,"div",17)(35,"button",18),s(36,"translate"),b("click",function(){return i.dismissModal()}),_(37),s(38,"translate"),l()(),p(39,"div",19),l()()),t&2&&(r(3),k(d(4,13,"config.restore.title")),r(2),f("disabled",i.clicked||i.deleting),C("aria-label",d(6,15,"form.button_close")),r(7),k(d(13,17,"config.restore.help_1")),r(3),k(d(16,19,"config.restore.help_2")),r(6),k(d(22,21,"form.button_download")),r(4),k(d(26,23,"config.restore.download")),r(2),f("disabled",i.clicked||i.deleting),C("aria-label",d(28,25,"backup.backup_now")),r(3),v(i.loading?30:i.backupList.length?31:-1),r(5),f("disabled",i.clicked||i.deleting),C("aria-label",d(36,27,"form.button_close")),r(2),M(" ",d(38,29,"form.button_close")," "))},dependencies:[D,re,me,ae,P],encapsulation:2})}return n})();function Oe(n,y){if(n&1){let e=x();a(0,"button",13),s(1,"translate"),s(2,"translate"),b("click",function(){h(e);let i=m();return u(i.onCancelRestore())}),p(3,"i",14),l()}if(n&2){let e=m();f("disabled",e.saveInProgress)("openDelay",150)("ngbTooltip",d(1,4,"form.button_cancel")),C("aria-label",d(2,6,"form.button_cancel"))}}function Ne(n,y){if(n&1){let e=x();a(0,"button",15),s(1,"translate"),s(2,"translate"),b("click",function(){h(e);let i=m();return u(i.onRestore())}),p(3,"i",16),l()}n&2&&(f("openDelay",150)("ngbTooltip",d(1,3,"form.button_restore")),C("aria-label",d(2,5,"form.button_restore")))}function qe(n,y){n&1&&p(0,"i",8)}function Fe(n,y){n&1&&p(0,"i",9)}function Le(n,y){if(n&1){let e=x();a(0,"ngx-monaco-editor",17),b("onInit",function(i){h(e);let o=m();return u(o.onEditorInit(i))})("keydown.control.s",function(i){h(e);let o=m();return i.preventDefault(),u(o.onSave())})("keydown.meta.s",function(i){h(e);let o=m();return i.preventDefault(),u(o.onSave())}),l()}if(n&2){let e=m();f("options",e.editorOptions)("model",e.monacoEditorModel)}}function Je(n,y){if(n&1){let e=x();a(0,"ngx-monaco-diff-editor",18),b("onInit",function(i){h(e);let o=m();return u(o.onInitDiffEditor(i))})("keydown.control.s",function(i){h(e);let o=m();return i.preventDefault(),u(o.onSave())})("keydown.meta.s",function(i){h(e);let o=m();return i.preventDefault(),u(o.onSave())}),l()}if(n&2){let e=m();f("options",e.editorOptions)("originalModel",e.monacoEditorModel)("modifiedModel",e.monacoEditorModel)}}function ze(n,y){if(n&1){let e=x();a(0,"textarea",19),ne("ngModelChange",function(i){h(e);let o=m();return oe(o.homebridgeConfig,i)||(o.homebridgeConfig=i),u(i)}),_(1," "),l()}if(n&2){let e=m();ie("ngModel",e.homebridgeConfig)}}var xt=(()=>{class n{$api=g(H);$md=g(_e);$modal=g(ge);$monacoEditor=g(we);$route=g(ue);$renderer=g(X);$router=g(j);$settings=g(be);$toastr=g(I);$translate=g(R);editorDecorations=[];lastHeight;visualViewPortEventCallback;latestSavedConfig;childBridgesToRestart=[];hbPendingRestart=!1;homebridgeConfig;originalConfig;saveInProgress;isMobile=!1;monacoEditor;editorOptions;monacoEditorModel;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"json",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light",automaticLayout:!0};let e=document.querySelector(".content");this.$renderer.setStyle(e,"height","100%"),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(i=>{this.homebridgeConfig=i.config,this.latestSavedConfig=JSON.parse(i.config)}),this.monacoEditorModel={value:"{}",language:"json",uri:window.monaco?window.monaco.Uri.parse("a://homebridge/config.json"):void 0},window.monaco?this.setMonacoEditorModel():this.$monacoEditor.readyEvent.subscribe({next:()=>{this.setMonacoEditorModel()}});let{action:t}=this.$router.parseUrl(this.$router.url).queryParams;if(t){switch(t){case"restore":{this.onRestore(!0);break}}this.$router.navigate([],{queryParams:{},replaceUrl:!0,queryParamsHandling:""})}}onEditorInit(e){window.editor=e,this.monacoEditor=e,this.monacoEditor.getModel().setValue(this.homebridgeConfig)}onInitDiffEditor(e){this.monacoEditor=e.modifiedEditor,e.getModel().original.setValue(this.originalConfig),e.getModel().modified.setValue(this.homebridgeConfig),window.editor=e}onSave(){return E(this,null,function*(){if(!this.saveInProgress){this.monacoEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[])),this.saveInProgress=!0;try{if(!this.isMobile){yield this.monacoEditor.getAction("editor.action.formatDocument").run();let t=window.monaco.editor.getModelMarkers({owner:"json"});for(let i of t)if(i.message==="Duplicate object key"){this.saveInProgress=!1,this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"));return}this.homebridgeConfig=this.monacoEditor.getModel().getValue()}let e=this.parseConfigFromEditor();this.homebridgeConfig=JSON.stringify(e,null,4),typeof e.bridge!="object"?this.$toastr.error(this.$translate.instant("config.config_bridge_missing"),this.$translate.instant("toast.title_error")):/^(?:[0-9A-F]{2}:){5}[0-9A-F]{2}$/i.test(e.bridge.username)?e.accessories&&!Array.isArray(e.accessories)?this.$toastr.error(this.$translate.instant("config.config_accessory_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&!Array.isArray(e.platforms)?this.$toastr.error(this.$translate.instant("config.config_platform_must_be_array"),this.$translate.instant("toast.title_error")):e.platforms&&Array.isArray(e.platforms)&&!this.validateSection(e.platforms,"platform")||e.accessories&&Array.isArray(e.accessories)&&!this.validateSection(e.accessories,"accessory")||e.plugins&&Array.isArray(e.plugins)&&!this.validatePlugins(e.plugins,"plugins")||e.disabledPlugins&&Array.isArray(e.disabledPlugins)&&!this.validatePlugins(e.disabledPlugins,"disabledPlugins")||(yield this.saveConfig(e),this.originalConfig=""):this.$toastr.error(this.$translate.instant("config.config_username_error"),this.$translate.instant("toast.title_error"))}catch(e){console.error(e),this.$toastr.error(this.$translate.instant("config.config_invalid_json"),this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}onRestore(e=!1){let t=this.$modal.open(xe,{size:"lg",backdrop:"static"});t.componentInstance.currentConfig=this.homebridgeConfig,t.componentInstance.fromSettings=e,t.result.then(i=>{this.originalConfig||(this.originalConfig=this.homebridgeConfig),this.$api.get(`/config-editor/backups/${i}`).subscribe({next:o=>{this.$toastr.info(this.$translate.instant("config.restore.confirm"),this.$translate.instant("config.title_backup_loaded")),this.homebridgeConfig=JSON.stringify(o,null,4),this.monacoEditor&&window.editor.modifiedEditor&&(this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[]),this.monacoEditor.executeEdits("beautifier",[{identifier:"delete",range:new monaco.Range(1,1,this.monacoEditor.getModel().getLineCount()+10,1),text:"",forceMoveMarkers:!0}]),this.monacoEditor.executeEdits("beautifier",[{identifier:"insert",range:new monaco.Range(1,1,1,1),text:this.homebridgeConfig,forceMoveMarkers:!0}]))},error:o=>{console.error(o),this.$toastr.error(o.error?.message||this.$translate.instant("backup.load_error"),this.$translate.instant("toast.title_error"))}})}).catch(()=>{})}onCancelRestore(){this.homebridgeConfig=this.originalConfig,this.originalConfig="",this.onRestore()}ngOnDestroy(){let e=document.querySelector(".content");this.$renderer.removeStyle(e,"height"),window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}validateSection(e,t){for(let i of e){if(typeof i!="object"||Array.isArray(i))return this.$toastr.error(this.$translate.instant("config.error_blocks_objects",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(!i[t])return this.$toastr.error(this.$translate.instant("config.error_blocks_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1;if(typeof i[t]!="string")return this.$toastr.error(this.$translate.instant("config.error_string_type",{type:t}),this.$translate.instant("toast.title_error")),this.highlightOffendingArrayItem(i),!1}return!0}validatePlugins(e,t){for(let i of e)if(typeof i!="string")return this.$toastr.error(this.$translate.instant("config.error_string_array",{key:t}),this.$translate.instant("toast.title_error")),!1;return!0}highlightOffendingArrayItem(e){this.monacoEditor&&(e=JSON.stringify(e,null,4).split(`
2
- `).map(t=>` ${t}`).join(`
3
- `),setTimeout(()=>{let t=this.monacoEditor.getModel().findMatches(e);if(t.length){let i=t[0].range,o=new monaco.Range(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn);this.editorDecorations=this.monacoEditor.deltaDecorations(this.editorDecorations,[{range:o,options:{isWholeLine:!0,linesDecorationsClassName:"hb-monaco-editor-line-error"}}])}},200))}setMonacoEditorModel(){if(window.monaco.languages.json.jsonDefaults.diagnosticsOptions.schemas.some(t=>t.uri==="http://homebridge/config.json"))return;let e=monaco.Uri.parse("a://homebridge/config.json");window.monaco.languages.json.jsonDefaults.setDiagnosticsOptions({allowComments:!1,validate:!0,schemas:[{uri:"http://homebridge/config.json",fileMatch:[e.toString()],schema:{type:"object",required:["bridge"],properties:{bridge:{type:"object",required:["name","username","port","pin"],properties:{name:{type:"string",description:`The Homebridge instance name.
4
- This should be unique if you are running multiple instances of Homebridge.`,default:"Homebridge"},username:{type:"string",description:`Homebridge username must be 6 pairs of colon-separated hexadecimal characters (A-F 0-9).
5
- You should change this pin if you need to re-pair your instance with HomeKit.
6
- Example: 0E:89:49:64:91:86`,default:"0E:89:49:64:91:86",pattern:"^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$"},port:{type:"number",description:`The port Homebridge listens on.
7
- If running more than one instance of Homebridge on the same server make sure each instance is given a unique port.`,default:51173,minimum:1025,maximum:65534},pin:{type:"string",description:`The Homebridge instance pin.
8
- This is used when pairing Homebridge to HomeKit.
9
- Example: 630-27-655`,default:"630-27-655",pattern:"^([0-9]{3}-[0-9]{2}-[0-9]{3})$"},manufacturer:{type:"string",description:"The bridge manufacturer to be displayed in HomeKit"},firmwareRevision:{type:"string",description:"The bridge firmware version to be displayed in HomeKit"},model:{type:"string",description:"The bridge model to be displayed in HomeKit"},bind:{description:`A string or an array of strings with the name(s) of the network interface(s) Homebridge should bind to.
10
-
11
- Requires Homebridge v1.3 or later.`,type:["string","array"],items:{type:"string",description:"Network Interface name that Homebridge should bind to."}}},default:{name:"Homebridge",username:"0E:89:49:64:91:86",port:51173,pin:"6302-7655"}},mdns:{type:"object",properties:{interface:{type:"string",description:`The interface or IP address of the interface you want Homebridge to listen on. This is useful if your server has multiple interfaces.
12
-
13
- Deprecated as of Homebridge v1.3.0 - use bridge.bind instead.`},legacyAdvertiser:{type:"boolean",description:"Set to `false` to use the new mdns library, ciao."}},default:{legacyAdvertiser:!1}},plugins:{type:"array",description:"An array of plugins that should be selectively enabled. Remove this array to enable all plugins.",items:{type:"string",description:`The full plugin npm package name.
14
- Example: homebridge-dummy`},default:["homebridge-config-ui-x"]},disabledPlugins:{type:"array",description:`An array of plugins that should be disabled.
15
-
16
- Requires Homebridge v1.3 or later.`,items:{type:"string",description:`The full plugin npm package name.
17
- Example: homebridge-dummy`},default:[]},ports:{type:"object",description:"The range of ports that should be used for certain accessories like cameras and TVs",required:["start","end"],properties:{start:{type:"number",default:52100,minimum:1025,maximum:65534},end:{type:"number",default:52150,minimum:1025,maximum:65534}},default:{start:52100,end:52150}},platforms:{type:"array",description:`Any plugin that exposes a platform should have its config entered in this array.
18
- Separate each plugin config block using a comma.`,items:{type:"object",required:["platform"],anyOf:[{type:"object",required:["platform"],properties:{platform:{type:"string",description:"This is used by Homebridge to identify which plugin this platform belongs to.",not:{enum:["config"]}},name:{type:"string",description:"The name of the platform."}}},{type:"object",properties:{platform:{type:"string",description:`Homebridge UI platform name must be set to "config".
19
- Do Not Change!`,oneOf:[{enum:"config"}]},name:{type:"string",description:"The name used in the Homebridge log."}}}]}},accessories:{type:"array",description:`Any plugin that exposes an accessory should have its config entered in this array.
20
- Separate each plugin config block using a comma.`,items:{type:"object",required:["accessory","name"],properties:{accessory:{type:"string",description:"This is used by Homebridge to identify which plugin this accessory belongs to."},name:{type:"string",description:"The name of the accessory."}}}}}}}]}),this.monacoEditorModel.uri=monaco.Uri.parse("a://homebridge/config.json")}visualViewPortChanged(){this.lastHeight<window.visualViewport.height&&document.activeElement.blur(),window.visualViewport.height<window.innerHeight?(this.$md.enableTouchMove(),this.lastHeight=window.visualViewport.height):window.visualViewport.height===window.innerHeight&&(this.$md.disableTouchMove(),this.lastHeight=window.visualViewport.height)}saveConfig(e){return E(this,null,function*(){try{let t=yield $(this.$api.post("/config-editor",e));this.homebridgeConfig=JSON.stringify(t,null,4),yield this.detectSavesChangesForRestart()}catch(t){console.error(t),this.$toastr.error(this.$translate.instant("config.failed_to_save_config"),this.$translate.instant("toast.title_error"))}})}validateArraysEqual(e,t){if(e.length!==t.length)return!1;let i=[...e].sort(),o=[...t].sort();return i.every((T,O)=>T===o[O])}removePlatformsAndAccessories(e){let T=e,{accessories:t,platforms:i}=T;return G(T,["accessories","platforms"])}removeEmptyBridges(e){return e.filter(t=>t._bridge&&Object.keys(t._bridge).length>0).map(t=>t._bridge)}validateBridgesEqual(e,t){return e.length!==t.length?!1:e.every(i=>t.some(o=>A(i,o)))}detectSavesChangesForRestart(){return E(this,null,function*(){try{if(this.hbPendingRestart)throw new Error("homebridge already pending a restart");let e=this.latestSavedConfig,t=JSON.stringify(e,null,4),i=JSON.parse(this.homebridgeConfig),o=this.homebridgeConfig;if(t===o&&!this.childBridgesToRestart.length)this.$toastr.info(this.$translate.instant("config.no_restart"),this.$translate.instant("config.config_saved"));else{if(!this.validateArraysEqual(Object.keys(e),Object.keys(i)))throw new Error("top level keys have changed");if([...i.platforms||[],...i.accessories||[]].every(c=>!c._bridge||!Object.keys(c._bridge).length))throw new Error("All platforms and accessories are missing a valid _bridge property.");let O=this.removePlatformsAndAccessories(e),$e=this.removePlatformsAndAccessories(i);if(!A(O,$e))throw new Error("top level properties have changed (except accessories and platforms)");let N=e.platforms||[],q=i.platforms||[],Te=N.map(c=>c.platform),Se=q.map(c=>c.platform);if(!this.validateArraysEqual(Te,Se))throw new Error("platform keys have changed");let F=e.accessories||[],L=i.accessories||[],Me=F.map(c=>c.accessory),Ae=L.map(c=>c.accessory);if(!this.validateArraysEqual(Me,Ae))throw new Error("accessory keys have changed");if(!this.validateBridgesEqual(this.removeEmptyBridges(N),this.removeEmptyBridges(q)))throw new Error("platform bridges have changed");if(!this.validateBridgesEqual(this.removeEmptyBridges(F),this.removeEmptyBridges(L)))throw new Error("accessory bridges have changed");let U=N.filter(c=>!A(c,q.find(S=>S.platform===c.platform))),Ve=F.filter(c=>!A(c,L.find(S=>S.accessory===c.accessory))),W=[...U,...Ve];if(U.some(c=>c.platform==="config"))throw new Error("homebridge ui config has changed");if(W.some(c=>c.platform==="config"?!1:!c._bridge||Object.keys(c._bridge).length===0))throw new Error("some changed entry does not have a _bridge key");let Be=yield $(this.$api.get("/status/homebridge/child-bridges"));W.forEach(c=>{let S=c._bridge.username.toUpperCase(),V=Be.find(({username:J})=>J===S);if(V)this.childBridgesToRestart.some(J=>J.username===V.username)||this.childBridgesToRestart.push({name:V.name,username:V.username});else throw new Error(`no child bridge found for username: ${S}`)});let Y=this.$modal.open(ye,{size:"lg",backdrop:"static"});Y.componentInstance.bridges=this.childBridgesToRestart;try{yield Y.result,this.childBridgesToRestart=[]}catch{}}}catch(e){console.error(e);let t=this.$modal.open(Ce,{size:"lg",backdrop:"static"});try{yield t.result,this.hbPendingRestart=!1,this.childBridgesToRestart=[]}catch{this.hbPendingRestart=!0}}finally{this.latestSavedConfig=JSON.parse(this.homebridgeConfig)}})}parseConfigFromEditor(){try{return JSON.parse(this.homebridgeConfig)}catch{let t=ke.default.parse(this.homebridgeConfig);return this.homebridgeConfig=JSON.stringify(t,null,4),this.monacoEditor&&this.monacoEditor.getModel().setValue(this.homebridgeConfig),t}}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=B({type:n,selectors:[["ng-component"]],decls:17,vars:18,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row"],[1,"col-6"],[1,"primary-text","m-0"],[1,"col-6","text-end"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"disabled","openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"openDelay","ngbTooltip"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-0",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-floppy-disk"],[1,"fas","fa-fw","fa-spinner","fa-pulse"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModel"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-danger","waves-effect","my-0","me-2",3,"click","disabled","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-times"],["container","body","placement","bottom","triggers","hover",1,"btn","btn-elegant","waves-effect","my-0","me-2",3,"click","openDelay","ngbTooltip"],[1,"fas","fa-fw","fa-history"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],[1,"flex-grow-1","h-100","w-100","mt-3","mb-0",3,"onInit","keydown.control.s","keydown.meta.s","options","originalModel","modifiedModel"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-3",3,"ngModelChange","ngModel"]],template:function(t,i){t&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),_(4),s(5,"translate"),l()(),a(6,"div",4),w(7,Oe,4,8,"button",5),w(8,Ne,4,7,"button",6),a(9,"button",7),s(10,"translate"),s(11,"translate"),b("click",function(){return i.onSave()}),w(12,qe,1,0,"i",8),w(13,Fe,1,0,"i",9),l()()(),w(14,Le,1,2,"ngx-monaco-editor",10),w(15,Je,1,3,"ngx-monaco-diff-editor",11),w(16,ze,2,1,"textarea",12),l()),t&2&&(r(4),k(d(5,12,"menu.config_json_editor")),r(3),v(i.originalConfig?7:-1),r(),v(i.originalConfig?-1:8),r(),f("disabled",i.saveInProgress)("openDelay",150)("ngbTooltip",d(10,14,"form.button_save")),C("aria-label",d(11,16,"form.button_save")),r(3),v(i.saveInProgress?-1:12),r(),v(i.saveInProgress?13:-1),r(),v(!i.isMobile&&!i.originalConfig?14:-1),r(),v(!i.isMobile&&i.originalConfig?15:-1),r(),v(i.isMobile?16:-1))},dependencies:[D,fe,he,ce,se,le,de,P],encapsulation:2})}return n})();export{xt as ConfigEditorComponent};
@@ -1 +0,0 @@
1
- import{a as _,b as D}from"./chunk-LJCIV6Z3.js";import{m as c,n as S}from"./chunk-YRIAJM6Y.js";import{e as x}from"./chunk-6GMXEQVA.js";import{C as v,fa as h,g as O,ga as E,h as a,ia as y,ja as l,ka as f,nb as I,r as p,va as j,w as d,x as T,z as w}from"./chunk-H36QJYLQ.js";var g=new y("JWT_OPTIONS"),m=(()=>{class r{constructor(e=null){this.tokenGetter=e&&e.tokenGetter||function(){}}urlBase64Decode(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:{t+="==";break}case 3:{t+="=";break}default:throw new Error("Illegal base64url string!")}return this.b64DecodeUnicode(t)}b64decode(e){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o="";if(e=String(e).replace(/=+$/,""),e.length%4===1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(let i=0,s,n,b=0;n=e.charAt(b++);~n&&(s=i%4?s*64+n:n,i++%4)?o+=String.fromCharCode(255&s>>(-2*i&6)):0)n=t.indexOf(n);return o}b64DecodeUnicode(e){return decodeURIComponent(Array.prototype.map.call(this.b64decode(e),t=>"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)).join(""))}decodeToken(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._decodeToken(t)):this._decodeToken(e)}_decodeToken(e){if(!e||e==="")return null;let t=e.split(".");if(t.length!==3)throw new Error("The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.");let o=this.urlBase64Decode(t[1]);if(!o)throw new Error("Cannot decode the token.");return JSON.parse(o)}getTokenExpirationDate(e=this.tokenGetter()){return e instanceof Promise?e.then(t=>this._getTokenExpirationDate(t)):this._getTokenExpirationDate(e)}_getTokenExpirationDate(e){let t;if(t=this.decodeToken(e),!t||!t.hasOwnProperty("exp"))return null;let o=new Date(0);return o.setUTCSeconds(t.exp),o}isTokenExpired(e=this.tokenGetter(),t){return e instanceof Promise?e.then(o=>this._isTokenExpired(o,t)):this._isTokenExpired(e,t)}_isTokenExpired(e,t){if(!e||e==="")return!0;let o=this.getTokenExpirationDate(e);return t=t||0,o===null?!1:!(o.valueOf()>new Date().valueOf()+t*1e3)}getAuthScheme(e,t){return typeof e=="function"?e(t):e}}return r.\u0275fac=function(e){return new(e||r)(l(g))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),$=r=>r instanceof Promise?v(()=>r):p(r),R=(()=>{class r{constructor(e,t,o){this.jwtHelper=t,this.document=o,this.standardPorts=["80","443"],this.tokenGetter=e.tokenGetter,this.headerName=e.headerName||"Authorization",this.authScheme=e.authScheme||e.authScheme===""?e.authScheme:"Bearer ",this.allowedDomains=e.allowedDomains||[],this.disallowedRoutes=e.disallowedRoutes||[],this.throwNoTokenError=e.throwNoTokenError||!1,this.skipWhenExpired=e.skipWhenExpired}isAllowedDomain(e){let t=new URL(e.url,this.document.location.origin);if(t.host===this.document.location.host)return!0;let o=`${t.hostname}${t.port&&!this.standardPorts.includes(t.port)?":"+t.port:""}`;return this.allowedDomains.findIndex(i=>typeof i=="string"?i===o:i instanceof RegExp?i.test(o):!1)>-1}isDisallowedRoute(e){let t=new URL(e.url,this.document.location.origin);return this.disallowedRoutes.findIndex(o=>{if(typeof o=="string"){let i=new URL(o,this.document.location.origin);return i.hostname===t.hostname&&i.pathname===t.pathname}return o instanceof RegExp?o.test(e.url):!1})>-1}handleInterception(e,t,o){let i=this.jwtHelper.getAuthScheme(this.authScheme,t);if(!e&&this.throwNoTokenError)throw new Error("Could not get token from tokenGetter function.");let s=p(!1);return this.skipWhenExpired&&(s=e?$(this.jwtHelper.isTokenExpired(e)):p(!0)),e?s.pipe(T(n=>n&&this.skipWhenExpired?t.clone():t.clone({setHeaders:{[this.headerName]:`${i}${e}`}})),w(n=>o.handle(n))):o.handle(t)}intercept(e,t){if(!this.isAllowedDomain(e)||this.isDisallowedRoute(e))return t.handle(e);let o=this.tokenGetter(e);return $(o).pipe(w(i=>this.handleInterception(i,e,t)))}}return r.\u0275fac=function(e){return new(e||r)(l(g),l(m),l(j))},r.\u0275prov=h({token:r,factory:r.\u0275fac}),r})(),F=(()=>{class r{constructor(e){if(e)throw new Error("JwtModule is already loaded. It should only be imported in your application's main module.")}static forRoot(e){return{ngModule:r,providers:[{provide:x,useClass:R,multi:!0},e.jwtOptionsProvider||{provide:g,useValue:e.config},m]}}}return r.\u0275fac=function(e){return new(e||r)(l(r,12))},r.\u0275mod=I({type:r}),r.\u0275inj=E({}),r})();var k=O(_(),1);var q=(()=>{class r{$api=f(S);$jwtHelper=f(m);$settings=f(D);token;user={};logoutTimer;constructor(){this.loadToken()}login(e){return a(this,null,function*(){let t=yield d(this.$api.post("/auth/login",e));if(!this.validateToken(t.access_token))throw new Error("Invalid username or password.");window.localStorage.setItem(c.jwt.tokenKey,t.access_token),yield this.$settings.getAppSettings()})}noauth(){return a(this,null,function*(){let e=yield d(this.$api.post("/auth/noauth",{}));if(this.validateToken(e.access_token))window.localStorage.setItem(c.jwt.tokenKey,e.access_token),yield this.$settings.getAppSettings();else throw new Error("Invalid username or password.")})}logout(){this.user=null,this.token=null,window.localStorage.removeItem(c.jwt.tokenKey),window.location.reload()}loadToken(){return a(this,null,function*(){this.$settings.settingsLoaded||(yield d(this.$settings.onSettingsLoaded));let e=window.localStorage.getItem(c.jwt.tokenKey);e&&this.validateToken(e)})}checkToken(){return a(this,null,function*(){try{return yield d(this.$api.get("/auth/check"))}catch(e){e.status===401&&(console.error("Current token is not valid"),this.logout())}})}isLoggedIn(){return this.$settings.env.instanceId!==this.user.instanceId?(console.error("Token does not match instance"),!1):this.user&&this.token&&!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)}validateToken(e){try{return this.$jwtHelper.isTokenExpired(e,this.$settings.serverTimeOffset)&&this.logout(),this.user=this.$jwtHelper.decodeToken(e),this.token=e,this.setLogoutTimer(),!0}catch{return window.localStorage.removeItem(c.jwt.tokenKey),this.token=null,!1}}setLogoutTimer(){if(clearTimeout(this.logoutTimer),!this.$jwtHelper.isTokenExpired(this.token,this.$settings.serverTimeOffset)){let t=(0,k.default)(this.$jwtHelper.getTokenExpirationDate(this.token)).diff((0,k.default)().add(this.$settings.serverTimeOffset,"s"),"millisecond");t<=2147483647&&(this.logoutTimer=setTimeout(()=>a(this,null,function*(){this.$settings.formAuth===!1?(yield this.noauth(),window.location.reload()):this.logout()}),t))}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac})}return r})();export{F as a,q as b};