homebridge-config-ui-x 5.12.1-alpha.0 → 5.12.1-alpha.2

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 (60) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/package.json +8 -3
  3. package/public/{chunk-FRQW55RH.js → chunk-2AJXG25V.js} +1 -1
  4. package/public/{chunk-VVQDBX54.js → chunk-2ZAXV4YC.js} +1 -1
  5. package/public/{chunk-ETPA4W22.js → chunk-3OHVXX6B.js} +1 -1
  6. package/public/{chunk-2C24YPBT.js → chunk-4BEKQY2O.js} +1 -1
  7. package/public/{chunk-VT7JPEPM.js → chunk-4BWNO6KH.js} +1 -1
  8. package/public/{chunk-RFZWSS3U.js → chunk-5DFV4KN6.js} +1 -1
  9. package/public/{chunk-TDTMHOY3.js → chunk-5E262IZY.js} +1 -1
  10. package/public/{chunk-657MY7IJ.js → chunk-5IJ7WJ7D.js} +1 -1
  11. package/public/{chunk-JP4UERHI.js → chunk-AHMTEEWV.js} +2 -2
  12. package/public/{chunk-WWIBIOK5.js → chunk-AMA5KYHI.js} +1 -1
  13. package/public/{chunk-H73LUU46.js → chunk-D7BCWWSP.js} +1 -1
  14. package/public/{chunk-GQUKWTAM.js → chunk-DXT7NLKJ.js} +1 -1
  15. package/public/{chunk-3H4HIZHS.js → chunk-EMAIV5V4.js} +1 -1
  16. package/public/{chunk-RCUGTYVU.js → chunk-EMTQLND2.js} +1 -1
  17. package/public/{chunk-OVMPEMPZ.js → chunk-F3HXP7VF.js} +1 -1
  18. package/public/{chunk-TFD6FNNU.js → chunk-FOCYUW3Q.js} +1 -1
  19. package/public/{chunk-CK4L2OZA.js → chunk-FTKEUELX.js} +1 -1
  20. package/public/{chunk-7H56ZY4K.js → chunk-H2SGUM2A.js} +1 -1
  21. package/public/{chunk-36DWHVJK.js → chunk-HDGCOO6N.js} +1 -1
  22. package/public/{chunk-XJ6E3F3B.js → chunk-HWZEDUYR.js} +1 -1
  23. package/public/{chunk-PBTOROO2.js → chunk-HYK7MYI4.js} +1 -1
  24. package/public/{chunk-4DP4S4T6.js → chunk-JMLLNMVV.js} +1 -1
  25. package/public/{chunk-6XTPZD35.js → chunk-JTQUK76J.js} +4 -4
  26. package/public/{chunk-TP2KLH5Z.js → chunk-KZDX7DML.js} +1 -1
  27. package/public/{chunk-RQHDC2H4.js → chunk-LP4J3P2M.js} +1 -1
  28. package/public/{chunk-SKXHAHCO.js → chunk-LY2WH7XJ.js} +1 -1
  29. package/public/{chunk-4VZUA2FM.js → chunk-LYBXKFGZ.js} +1 -1
  30. package/public/{chunk-PPDVWLPC.js → chunk-MWO4XHMK.js} +1 -1
  31. package/public/{chunk-RHMBWG6P.js → chunk-NPF6UAYU.js} +1 -1
  32. package/public/{chunk-FYKCFXZ2.js → chunk-OD5BLW73.js} +1 -1
  33. package/public/{chunk-GE6FUSBI.js → chunk-OKKX5II3.js} +1 -1
  34. package/public/{chunk-YJHSSXBL.js → chunk-P5NUDX6Y.js} +1 -1
  35. package/public/{chunk-JYPTQF33.js → chunk-PTJ2WHN2.js} +1 -1
  36. package/public/{chunk-RJJ7UQ5A.js → chunk-PXX46N67.js} +1 -1
  37. package/public/{chunk-M5PVRCNI.js → chunk-QAMTKHGP.js} +1 -1
  38. package/public/{chunk-ZM7HZFSJ.js → chunk-QESYIXUR.js} +1 -1
  39. package/public/{chunk-J7YCDUH4.js → chunk-QHBHZIPJ.js} +1 -1
  40. package/public/{chunk-3D5CLRTZ.js → chunk-R4D64BTL.js} +1 -1
  41. package/public/{chunk-XDVMRWJO.js → chunk-REAVFWBE.js} +1 -1
  42. package/public/{chunk-LLHJXAVZ.js → chunk-SUZMQF44.js} +1 -1
  43. package/public/chunk-T5FIMD5K.js +1 -0
  44. package/public/{chunk-NBNIZ4FB.js → chunk-TIVCIPD3.js} +1 -1
  45. package/public/{chunk-HTAXQLUC.js → chunk-U3VPHA7X.js} +1 -1
  46. package/public/{chunk-YO6R75NE.js → chunk-U5CDHG4J.js} +1 -1
  47. package/public/{chunk-VD4V4NEZ.js → chunk-U6OOUZY4.js} +1 -1
  48. package/public/{chunk-GLSCRXLU.js → chunk-UC6DGFOX.js} +1 -1
  49. package/public/{chunk-U7J32ZCT.js → chunk-ULHOVOCI.js} +1 -1
  50. package/public/{chunk-JLMGZNW5.js → chunk-ULIXJ6WW.js} +1 -1
  51. package/public/chunk-VWDC2WDK.js +1 -0
  52. package/public/{chunk-TCAIGKCZ.js → chunk-WPMAY5Z5.js} +1 -1
  53. package/public/{chunk-QDSMJS6K.js → chunk-XOZXUAP4.js} +1 -1
  54. package/public/{chunk-ARFZQCZK.js → chunk-YDZJF4EY.js} +1 -1
  55. package/public/{chunk-DEUOHDAT.js → chunk-ZHCPTG5R.js} +1 -1
  56. package/public/index.html +2 -2
  57. package/public/{main-Q72DV553.js → main-XJKFV7IC.js} +1 -1
  58. package/public/{styles-IW6HR5PX.css → styles-FEDC3CMK.css} +1 -1
  59. package/public/chunk-WAVNYOYF.js +0 -1
  60. package/public/chunk-YEQ475QM.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,13 +2,14 @@
2
2
 
3
3
  All notable changes to `homebridge-config-ui-x` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).
4
4
 
5
- ## v5.13.0 (2025-12-24)
5
+ ## v5.13.0 (2025-12-25)
6
6
 
7
7
  ### UI Changes
8
8
 
9
9
  - add `NFCAccess` as hidden accessory service
10
10
  - expose unique id on accessory info modal + copy icon (@NorthernMan54)
11
11
  - update `@xterm/xterm` to `v6` + migration tweaks
12
+ - add cpu temperature to widget on mac systems
12
13
 
13
14
  ### Other Changes
14
15
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "homebridge-config-ui-x",
3
3
  "displayName": "Homebridge UI",
4
4
  "type": "module",
5
- "version": "5.12.1-alpha.0",
5
+ "version": "5.12.1-alpha.2",
6
6
  "description": "A web based management, configuration and control platform for Homebridge.",
7
7
  "author": "oznu <dev@oz.nu>",
8
8
  "license": "MIT",
@@ -81,7 +81,7 @@
81
81
  "dependencies": {
82
82
  "@fastify/helmet": "13.0.2",
83
83
  "@fastify/multipart": "9.3.0",
84
- "@fastify/static": "8.3.0",
84
+ "@fastify/static": "9.0.0",
85
85
  "@homebridge/hap-client": "3.1.2",
86
86
  "@homebridge/node-pty-prebuilt-multiarch": "0.13.1",
87
87
  "@nestjs/axios": "4.0.1",
@@ -114,12 +114,16 @@
114
114
  "reflect-metadata": "0.2.2",
115
115
  "rxjs": "7.8.2",
116
116
  "semver": "7.7.3",
117
- "systeminformation": "5.27.17",
117
+ "systeminformation": "5.28.0",
118
118
  "tail": "2.2.6",
119
119
  "tar": "7.5.2",
120
120
  "tcp-port-used": "1.0.2",
121
121
  "unzipper": "0.12.3"
122
122
  },
123
+ "optionalDependencies": {
124
+ "macos-temperature-sensor": "1.0.4",
125
+ "osx-temperature-sensor": "1.0.8"
126
+ },
123
127
  "devDependencies": {
124
128
  "@antfu/eslint-config": "^6.7.3",
125
129
  "@nestjs/testing": "^11.1.10",
@@ -145,6 +149,7 @@
145
149
  "vitest": "^4.0.16"
146
150
  },
147
151
  "overrides": {
152
+ "@fastify/static": "9.0.0",
148
153
  "@homebridge/hap-client": {
149
154
  "axios": "1.13.2"
150
155
  }
@@ -1 +1 @@
1
- import{h as i}from"./chunk-O7FV4MLW.js";import{gb as o,la as r}from"./chunk-UUXRTS4O.js";var u=(t,l,n,e)=>t.canDeactivate?t.canDeactivate(e?.url):!0,m=[{path:"",loadComponent:()=>import("./chunk-YEQ475QM.js").then(t=>t.TerminalComponent),canDeactivate:[u]}],a=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=o({type:t});static \u0275inj=r({imports:[i.forChild(m),i]})}return t})();var p=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=o({type:t});static \u0275inj=r({imports:[a]})}return t})();export{p as TerminalModule};
1
+ import{h as i}from"./chunk-O7FV4MLW.js";import{gb as o,la as r}from"./chunk-UUXRTS4O.js";var u=(t,l,n,e)=>t.canDeactivate?t.canDeactivate(e?.url):!0,m=[{path:"",loadComponent:()=>import("./chunk-T5FIMD5K.js").then(t=>t.TerminalComponent),canDeactivate:[u]}],a=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=o({type:t});static \u0275inj=r({imports:[i.forChild(m),i]})}return t})();var p=(()=>{class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=o({type:t});static \u0275inj=r({imports:[a]})}return t})();export{p as TerminalModule};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-TUN7H57E.js";import{b as j}from"./chunk-RCUGTYVU.js";import{a as J}from"./chunk-RFZWSS3U.js";import{a as Q}from"./chunk-Y7C4575H.js";import{a as te}from"./chunk-KSI5RFA4.js";import"./chunk-PCFKF3RR.js";import{a as X}from"./chunk-SKXHAHCO.js";import{n as L}from"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import{a as R}from"./chunk-VT7JPEPM.js";import{b as B}from"./chunk-H73LUU46.js";import{a as q,b as N,d as W,e as V,f as D,g as H}from"./chunk-O7FV4MLW.js";import{b as A}from"./chunk-VD4V4NEZ.js";import{k as $,l as U,p as T}from"./chunk-WAVNYOYF.js";import{$a as F,Ab as s,Bb as p,Kb as S,Nb as _,Pb as x,Rc as E,Sa as n,ac as g,bc as h,bd as K,fb as O,g as ee,h as P,mc as v,nc as M,pa as m,rb as u,sb as w,tb as y,tc as d,ua as b,uc as l,va as C,yb as c,z,zb as i}from"./chunk-UUXRTS4O.js";var Z=ee(te(),1);var I=()=>["/"],ne=r=>({"hamburger-icon-cross":r}),re=r=>({expanded:r}),oe=()=>({exact:!0}),ae=()=>["/plugins"],se=()=>["/accessories"],de=()=>["/logs"],le=()=>["/support"],pe=()=>["/platform-tools/terminal"],ce=()=>["/config"],me=()=>["/settings"],ue=()=>["/power-options"];function _e(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=x();return C(t.openUnderVoltageModal())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(4,"div",12),p(5,"i",21),s(),i(6,"div",14),g(7),d(8,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),n(6),h(l(8,6,"rpi.throttled.undervoltage_title")))}function ge(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",22),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),n(5),h(l(7,6,"menu.linux.label_terminal")))}function fe(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",23),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),n(5),h(l(7,6,"menu.config_json_editor")))}function he(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",24),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,me))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),n(5),h(l(7,6,"menu.label_settings")))}function ve(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",25),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,ue))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.restart.title")),n(5),h(l(7,6,"menu.restart.title")))}function be(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=x();return C(t.reloadPage())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",26),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"menu.reload")),n(5),h(l(7,4,"menu.reload")))}function Ce(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=x();return C(t.logout())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",27),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"menu.tooltip_logout")),n(5),h(l(7,4,"menu.tooltip_logout")))}var Y=(()=>{class r{$auth=m(B);$authHelper=m(j);$settings=m(A);$modal=m(L);$notification=m(Q);$renderer=m(F);$router=m(V);$translate=m($);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();sidebarMouseEnterListener=()=>this.openSidebar();sidebarMouseLeaveListener=()=>this.closeSidebar();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(a=>P(this,null,function*(){if(a instanceof q&&this.$settings.formAuth&&a.url!=="/login"&&!(yield this.$authHelper.isAuthenticated())){window.sessionStorage.setItem("target_route",a.url),yield this.$router.navigate(["/login"]);return}a instanceof N&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))}))}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(o=>{o["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),o["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(o=>{this.formAuth=o});let e=document.querySelector(".sidebar"),a=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",o=>{if(t.contains(o.target)&&this.isExpanded){o.preventDefault(),this.toggleSidebar();return}!e.contains(o.target)&&!a.contains(o.target)&&this.isExpanded&&(o.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),a.addEventListener("mouseenter",this.sidebarMouseEnterListener,{passive:!1}),a.addEventListener("mouseleave",this.sidebarMouseLeaveListener,{passive:!1}),document.addEventListener("click",o=>{e.contains(o.target)&&o.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(J,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let a=e.target;["menuitem","button"].includes(a.getAttribute("role"))&&a.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeEventListener("mouseenter",this.sidebarMouseEnterListener),e.removeEventListener("mouseleave",this.sidebarMouseLeaveListener),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",this.sidebarMouseEnterListener,{passive:!1}),e.addEventListener("mouseleave",this.sidebarMouseLeaveListener,{passive:!1}))}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=O({type:r,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-plug"],[1,"fa","fa-lightbulb"],[1,"fa","fa-wave-square"],[1,"fa","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-terminal"],[1,"fa","fa-code"],[1,"fa","fa-cog"],[1,"fa","fa-power-off"],[1,"fa","fa-refresh"],[1,"fa","fa-right-from-bracket"]],template:function(a,t){a&1&&(i(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),p(2,"span",1),i(3,"a",2),d(4,"translate"),p(5,"img",3),i(6,"div",4),g(7,"Homebridge"),s()(),i(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),s()(),i(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),i(15,"a",2),d(16,"translate"),p(17,"img",3),i(18,"div",8),g(19,"Homebridge"),s()()(),i(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(24,"div",12),p(25,"i",13),s(),i(26,"div",14),g(27),d(28,"translate"),s()()(),w(29,_e,9,8,"div",10),i(30,"div",10)(31,"div",15),d(32,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(33,"div",12),p(34,"i",16),s(),i(35,"div",14),g(36),d(37,"translate"),s()()(),i(38,"div",10)(39,"div",15),d(40,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(41,"div",12),p(42,"i",17),s(),i(43,"div",14),g(44),d(45,"translate"),s()()(),i(46,"div",10)(47,"div",15),d(48,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(49,"div",12),p(50,"i",18),s(),i(51,"div",14),g(52),d(53,"translate"),s()()(),w(54,ge,8,9,"div",10),w(55,fe,8,9,"div",10),w(56,he,8,9,"div",10),i(57,"div",10)(58,"div",15),d(59,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(60,"div",12),p(61,"i",19),s(),i(62,"div",14),g(63),d(64,"translate"),s()()(),w(65,ve,8,9,"div",10),w(66,be,8,6,"div",10),w(67,Ce,8,6,"div",10),s()()),a&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,37,"menu.sidebar.aria_menu")),n(3),c("routerLink",v(63,I)),u("aria-label",l(4,39,"menu.label_status")),n(5),c("ngClass",M(64,ne,t.isExpanded)),n(5),c("ngClass",M(66,re,t.isExpanded)),n(2),c("routerLink",v(68,I)),u("aria-label",l(16,41,"menu.label_status")),n(7),c("routerLink",v(69,I))("routerLinkActive","active")("routerLinkActiveOptions",v(70,oe)),u("aria-label",l(23,43,"menu.label_status")),n(5),h(l(28,45,"menu.label_status")),n(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),n(2),c("routerLink",v(71,ae))("routerLinkActive","active"),u("aria-label",l(32,47,"menu.label_plugins")),n(5),h(l(37,49,"menu.label_plugins")),n(3),c("routerLink",v(72,se))("routerLinkActive","active"),u("aria-label",l(40,51,"menu.label_accessories")),n(5),h(l(45,53,"menu.label_accessories")),n(3),c("routerLink",v(73,de))("routerLinkActive","active"),u("aria-label",l(48,55,"menu.linux.label_logs")),n(5),h(l(53,57,"menu.linux.label_logs")),n(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),n(),y(t.isAdmin?55:-1),n(),y(t.isAdmin?56:-1),n(2),c("routerLink",v(74,le))("routerLinkActive","active"),u("aria-label",l(59,59,"support.title")),n(5),h(l(64,61,"support.title")),n(2),y(t.isAdmin?65:-1),n(),y(t.isPwa?66:-1),n(),y(t.formAuth?67:-1))},dependencies:[D,K,E,H,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 80px)!important;scrollbar-width:thin}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{padding-bottom:60px}}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return r})();var xe=r=>({sidebarExpanded:r}),Je=(()=>{class r{$auth=m(B);$modal=m(L);$router=m(V);$settings=m(A);$translate=m($);$ws=m(R);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return P(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),!this.$router.url.endsWith("/restart")&&(0,Z.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:T.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=O({type:r,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(a,t){a&1&&(p(0,"app-sidebar",0),i(1,"div",1),p(2,"router-outlet"),s()),a&2&&(c("isExpanded",t.sidebarExpanded),n(),c("ngClass",M(2,xe,t.sidebarExpanded)))},dependencies:[Y,E,W],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return r})();export{Je as LayoutComponent};
1
+ import{a as G}from"./chunk-TUN7H57E.js";import{b as j}from"./chunk-EMTQLND2.js";import{a as J}from"./chunk-5DFV4KN6.js";import{a as Q}from"./chunk-Y7C4575H.js";import{a as te}from"./chunk-KSI5RFA4.js";import"./chunk-PCFKF3RR.js";import{a as X}from"./chunk-LY2WH7XJ.js";import{n as L}from"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import{a as R}from"./chunk-4BWNO6KH.js";import{b as B}from"./chunk-D7BCWWSP.js";import{a as q,b as N,d as W,e as V,f as D,g as H}from"./chunk-O7FV4MLW.js";import{b as A}from"./chunk-U6OOUZY4.js";import{k as $,l as U,p as T}from"./chunk-VWDC2WDK.js";import{$a as F,Ab as s,Bb as p,Kb as S,Nb as _,Pb as x,Rc as E,Sa as n,ac as g,bc as h,bd as K,fb as O,g as ee,h as P,mc as v,nc as M,pa as m,rb as u,sb as w,tb as y,tc as d,ua as b,uc as l,va as C,yb as c,z,zb as i}from"./chunk-UUXRTS4O.js";var Z=ee(te(),1);var I=()=>["/"],ne=r=>({"hamburger-icon-cross":r}),re=r=>({expanded:r}),oe=()=>({exact:!0}),ae=()=>["/plugins"],se=()=>["/accessories"],de=()=>["/logs"],le=()=>["/support"],pe=()=>["/platform-tools/terminal"],ce=()=>["/config"],me=()=>["/settings"],ue=()=>["/power-options"];function _e(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),d(3,"translate"),_("click",function(){b(e);let t=x();return C(t.openUnderVoltageModal())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(4,"div",12),p(5,"i",21),s(),i(6,"div",14),g(7),d(8,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"rpi.throttled.undervoltage_title")+" - "+l(3,4,"rpi.throttled.undervoltage_description")),n(6),h(l(8,6,"rpi.throttled.undervoltage_title")))}function ge(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",22),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,pe))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.linux.label_terminal")),n(5),h(l(7,6,"menu.linux.label_terminal")))}function fe(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",23),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,ce))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.config_json_editor")),n(5),h(l(7,6,"menu.config_json_editor")))}function he(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",24),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,me))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.label_settings")),n(5),h(l(7,6,"menu.label_settings")))}function ve(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",15),d(2,"translate"),_("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",25),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),c("routerLink",v(8,ue))("routerLinkActive","active"),u("aria-label",l(2,4,"menu.restart.title")),n(5),h(l(7,6,"menu.restart.title")))}function be(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=x();return C(t.reloadPage())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",26),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"menu.reload")),n(5),h(l(7,4,"menu.reload")))}function Ce(r,k){if(r&1){let e=S();i(0,"div",10)(1,"div",20),d(2,"translate"),_("click",function(){b(e);let t=x();return C(t.logout())})("keydown",function(t){b(e);let o=x();return C(o.handleKeydown(t))}),i(3,"div",12),p(4,"i",27),s(),i(5,"div",14),g(6),d(7,"translate"),s()()()}r&2&&(n(),u("aria-label",l(2,2,"menu.tooltip_logout")),n(5),h(l(7,4,"menu.tooltip_logout")))}var Y=(()=>{class r{$auth=m(B);$authHelper=m(j);$settings=m(A);$modal=m(L);$notification=m(Q);$renderer=m(F);$router=m(V);$translate=m($);isExpanded=!1;formAuth=this.$settings.formAuth;isAdmin=this.$auth.user.admin;enableTerminalAccess=this.$settings.env.enableTerminalAccess;rPiCurrentlyUnderVoltage=!1;rPiWasUnderVoltage=!1;isMobile=!1;freezeMenu=!1;isPwa=G();sidebarMouseEnterListener=()=>this.openSidebar();sidebarMouseLeaveListener=()=>this.closeSidebar();constructor(){this.isMobile=window.innerWidth<768;let e;window.addEventListener("resize",()=>{clearTimeout(e),e=setTimeout(()=>{this.updateListeners()},500)}),this.$router.events.subscribe(a=>P(this,null,function*(){if(a instanceof q&&this.$settings.formAuth&&a.url!=="/login"&&!(yield this.$authHelper.isAuthenticated())){window.sessionStorage.setItem("target_route",a.url),yield this.$router.navigate(["/login"]);return}a instanceof N&&(this.closeSidebar(),this.freezeMenu=!0,setTimeout(()=>{this.freezeMenu=!1},750))}))}ngOnInit(){this.$notification.raspberryPiThrottled.subscribe(o=>{o["Under Voltage"]&&(this.rPiCurrentlyUnderVoltage=!0),o["Under-voltage has occurred"]&&(this.rPiWasUnderVoltage=!0)}),this.$notification.formAuthEnabled.subscribe(o=>{this.formAuth=o});let e=document.querySelector(".sidebar"),a=document.querySelector(".m-header"),t=document.querySelector(".content");this.isMobile?document.addEventListener("touchstart",o=>{if(t.contains(o.target)&&this.isExpanded){o.preventDefault(),this.toggleSidebar();return}!e.contains(o.target)&&!a.contains(o.target)&&this.isExpanded&&(o.preventDefault(),this.closeSidebar())},{passive:!1}):(this.updateListeners(),a.addEventListener("mouseenter",this.sidebarMouseEnterListener,{passive:!1}),a.addEventListener("mouseleave",this.sidebarMouseLeaveListener,{passive:!1}),document.addEventListener("click",o=>{e.contains(o.target)&&o.clientX>60&&this.closeSidebar()},{passive:!1})),this.updateContentStyles()}toggleSidebar(){this.freezeMenu||(this.isExpanded=!this.isExpanded,this.updateContentStyles())}openUnderVoltageModal(){let e=this.$modal.open(J,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("rpi.throttled.undervoltage_title"),e.componentInstance.message=this.$translate.instant(this.rPiCurrentlyUnderVoltage?"rpi.throttled.currently_message":"rpi.throttled.previously_message"),e.componentInstance.ctaButtonLabel=this.$translate.instant("form.button_more_info"),e.componentInstance.faIconClass="fas fa-bolt yellow-text",e.componentInstance.ctaButtonLink="https://pimylifeup.com/raspberry-pi-low-voltage-warning"}handleKeydown(e){if(e.key==="Enter"){let a=e.target;["menuitem","button"].includes(a.getAttribute("role"))&&a.click()}}reloadPage(){window.location.reload()}ngOnDestroy(){document.removeEventListener("touchstart",()=>{}),document.removeEventListener("click",()=>{})}logout(){this.$auth.logout()}openSidebar(){this.freezeMenu||(this.isExpanded=!0,this.updateContentStyles())}closeSidebar(){this.freezeMenu||(this.isExpanded=!1,this.updateContentStyles())}updateContentStyles(){let e=document.querySelector(".content");this.isExpanded?(this.$renderer.setStyle(e,"opacity","20%"),this.$renderer.setStyle(e,"pointer-events","none"),this.$renderer.setStyle(e,"overflow","hidden")):(this.$renderer.removeStyle(e,"opacity"),this.$renderer.removeStyle(e,"pointer-events"),this.$renderer.removeStyle(e,"overflow"))}updateListeners(){this.isMobile=window.innerWidth<768;let e=document.querySelector(".sidebar");e.removeEventListener("mouseenter",this.sidebarMouseEnterListener),e.removeEventListener("mouseleave",this.sidebarMouseLeaveListener),(this.isMobile||!this.isMobile&&this.$settings.menuMode!=="freeze")&&(e.addEventListener("mouseenter",this.sidebarMouseEnterListener,{passive:!1}),e.addEventListener("mouseleave",this.sidebarMouseLeaveListener,{passive:!1}))}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=O({type:r,selectors:[["app-sidebar"]],inputs:{isExpanded:"isExpanded"},decls:68,vars:75,consts:[["tabindex","0","role","button",1,"m-header","text-end",3,"click","keydown"],[1,"me-2","d-block","d-lg-none",2,"font-size","0.9rem","color","#dddddd"],[3,"routerLink"],["ngSrc","assets/homebridge-logo.svg","alt","HB Logo","height","35","width","35",2,"height","35px","width","35px"],[1,"hb-logo-text-mobile"],[1,"hamburger-icon",3,"ngClass"],["role","navigation","id","sidebar",1,"sidebar",3,"ngClass"],["tabindex","0","role","button",1,"header",3,"click","keydown"],[1,"hb-logo-text"],[1,"link-wrapper"],[1,"link"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive","routerLinkActiveOptions"],[1,"icon"],[1,"fa","fa-house"],[1,"title"],["role","menuitem","tabindex","0",1,"link-row",3,"keydown","routerLink","routerLinkActive"],[1,"fa","fa-plug"],[1,"fa","fa-lightbulb"],[1,"fa","fa-wave-square"],[1,"fa","fa-question-circle-o"],["role","menuitem","tabindex","0",1,"link-row",3,"click","keydown"],[1,"fas","fa-bolt","fa-beat","yellow-text",2,"--fa-beat-scale","1.5"],[1,"fa","fa-terminal"],[1,"fa","fa-code"],[1,"fa","fa-cog"],[1,"fa","fa-power-off"],[1,"fa","fa-refresh"],[1,"fa","fa-right-from-bracket"]],template:function(a,t){a&1&&(i(0,"div",0),d(1,"translate"),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),p(2,"span",1),i(3,"a",2),d(4,"translate"),p(5,"img",3),i(6,"div",4),g(7,"Homebridge"),s()(),i(8,"div",5),p(9,"span")(10,"span")(11,"span")(12,"span"),s()(),i(13,"div",6)(14,"div",7),_("click",function(){return t.toggleSidebar()})("keydown",function(f){return t.handleKeydown(f)}),i(15,"a",2),d(16,"translate"),p(17,"img",3),i(18,"div",8),g(19,"Homebridge"),s()()(),i(20,"div",9)(21,"div",10)(22,"div",11),d(23,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(24,"div",12),p(25,"i",13),s(),i(26,"div",14),g(27),d(28,"translate"),s()()(),w(29,_e,9,8,"div",10),i(30,"div",10)(31,"div",15),d(32,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(33,"div",12),p(34,"i",16),s(),i(35,"div",14),g(36),d(37,"translate"),s()()(),i(38,"div",10)(39,"div",15),d(40,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(41,"div",12),p(42,"i",17),s(),i(43,"div",14),g(44),d(45,"translate"),s()()(),i(46,"div",10)(47,"div",15),d(48,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(49,"div",12),p(50,"i",18),s(),i(51,"div",14),g(52),d(53,"translate"),s()()(),w(54,ge,8,9,"div",10),w(55,fe,8,9,"div",10),w(56,he,8,9,"div",10),i(57,"div",10)(58,"div",15),d(59,"translate"),_("keydown",function(f){return t.handleKeydown(f)}),i(60,"div",12),p(61,"i",19),s(),i(62,"div",14),g(63),d(64,"translate"),s()()(),w(65,ve,8,9,"div",10),w(66,be,8,6,"div",10),w(67,Ce,8,6,"div",10),s()()),a&2&&(u("aria-expanded",t.isExpanded?"true":"false")("aria-controls","sidebar")("aria-label",l(1,37,"menu.sidebar.aria_menu")),n(3),c("routerLink",v(63,I)),u("aria-label",l(4,39,"menu.label_status")),n(5),c("ngClass",M(64,ne,t.isExpanded)),n(5),c("ngClass",M(66,re,t.isExpanded)),n(2),c("routerLink",v(68,I)),u("aria-label",l(16,41,"menu.label_status")),n(7),c("routerLink",v(69,I))("routerLinkActive","active")("routerLinkActiveOptions",v(70,oe)),u("aria-label",l(23,43,"menu.label_status")),n(5),h(l(28,45,"menu.label_status")),n(2),y(t.rPiWasUnderVoltage||t.rPiCurrentlyUnderVoltage?29:-1),n(2),c("routerLink",v(71,ae))("routerLinkActive","active"),u("aria-label",l(32,47,"menu.label_plugins")),n(5),h(l(37,49,"menu.label_plugins")),n(3),c("routerLink",v(72,se))("routerLinkActive","active"),u("aria-label",l(40,51,"menu.label_accessories")),n(5),h(l(45,53,"menu.label_accessories")),n(3),c("routerLink",v(73,de))("routerLinkActive","active"),u("aria-label",l(48,55,"menu.linux.label_logs")),n(5),h(l(53,57,"menu.linux.label_logs")),n(2),y(t.enableTerminalAccess&&t.isAdmin?54:-1),n(),y(t.isAdmin?55:-1),n(),y(t.isAdmin?56:-1),n(2),c("routerLink",v(74,le))("routerLinkActive","active"),u("aria-label",l(59,59,"support.title")),n(5),h(l(64,61,"support.title")),n(2),y(t.isAdmin?65:-1),n(),y(t.isPwa?66:-1),n(),y(t.formAuth?67:-1))},dependencies:[D,K,E,H,U],styles:[".m-header[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:65px;z-index:510;display:flex;align-items:center;padding-left:3px;padding-right:3px}.m-header[_ngcontent-%COMP%]:hover{cursor:pointer}@media (min-width: 768px){.m-header[_ngcontent-%COMP%]{display:none}}.sidebar[_ngcontent-%COMP%]{position:fixed;left:0;top:0;height:100vh;transition:.3s;width:60px;z-index:500}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;padding:15px 10px 15px 11px;font-size:.85rem}.sidebar[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]:hover{cursor:pointer}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{overflow-x:hidden;overflow-y:auto;max-height:calc(100vh - 80px)!important;scrollbar-width:thin}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{padding-bottom:60px}}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%]{display:flex;align-items:center;padding:15px 10px;cursor:pointer;transition:.2s;font-size:17px}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{flex:0 0 38px;display:flex;align-items:center;justify-content:center}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{flex:1;transition:.3s;max-width:0;overflow:hidden;white-space:nowrap}@media (max-width: 767px){.sidebar[_ngcontent-%COMP%]{width:0}.sidebar[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:none}}.sidebar.expanded[_ngcontent-%COMP%]{width:210px}@media (max-width: 767px){.sidebar.expanded[_ngcontent-%COMP%]{width:210px}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%]{display:block}}.sidebar.expanded[_ngcontent-%COMP%] .link-wrapper[_ngcontent-%COMP%] .link[_ngcontent-%COMP%] .link-row[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{max-width:150px;padding-left:10px}.hamburger-icon[_ngcontent-%COMP%]{margin:-7px 0 0 25px}@media (min-width: 768px){.hb-logo-text[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px}.sidebar.expanded[_ngcontent-%COMP%] .hb-logo-text[_ngcontent-%COMP%]{opacity:1;left:55px;transition:.3s}.sidebar[_ngcontent-%COMP%]:not(.expanded) .hb-logo-text[_ngcontent-%COMP%]{opacity:0;left:40px;transition:.3s}.hb-logo-text-mobile[_ngcontent-%COMP%], .hamburger-icon[_ngcontent-%COMP%]{display:none!important}}@media (max-width: 767px){.hb-logo-text[_ngcontent-%COMP%]{display:none!important}.hb-logo-text-mobile[_ngcontent-%COMP%]{color:#fff;position:absolute;top:17px;font-size:22px;padding-left:3px;opacity:1;left:55px}.hamburger-icon[_ngcontent-%COMP%]{position:absolute;right:10px;top:28px;width:30px;transform:rotate(0);transition:.5s ease-in-out;cursor:pointer}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;position:absolute;height:2px;width:100%;background-color:#fff;border-radius:9px;opacity:1;left:0;transform:rotate(0);transition:.25s ease-in-out}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:0}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2), .hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){top:10px}.hamburger-icon[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:20px}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){top:10px;width:0;left:50%}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){transform:rotate(45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){transform:rotate(-45deg)}.hamburger-icon-cross[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(4){top:10px;width:0;left:50%}}"]})}return r})();var xe=r=>({sidebarExpanded:r}),Je=(()=>{class r{$auth=m(B);$modal=m(L);$router=m(V);$settings=m(A);$translate=m($);$ws=m(R);io;sidebarExpanded=!1;ngOnInit(){this.io=this.$ws.connectToNamespace("app"),this.io.socket.on("reconnect",()=>{this.$auth.checkToken()}),this.compareServerUiVersion()}compareServerUiVersion(){return P(this,null,function*(){if(this.$settings.settingsLoaded||(yield z(this.$settings.onSettingsLoaded)),!this.$router.url.endsWith("/restart")&&(0,Z.lt)(this.$settings.uiVersion,T.serverTarget)){console.log(`Server restart required. UI Version: ${T.serverTarget} - Server Version: ${this.$settings.uiVersion} `);let e=this.$modal.open(X,{size:"lg",backdrop:"static"});e.componentInstance.title=this.$translate.instant("platform.version.service_restart_required"),e.componentInstance.message=this.$translate.instant("platform.version.restart_required",{serverVersion:this.$settings.uiVersion,uiVersion:T.serverTarget}),e.componentInstance.confirmButtonLabel=this.$translate.instant("menu.tooltip_restart"),e.componentInstance.faIconClass="fas fa-power-off orange-text",e.result.then(()=>this.$router.navigate(["/restart"])).catch(()=>{})}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=O({type:r,selectors:[["app-layout"]],decls:3,vars:4,consts:[[3,"isExpanded"],[1,"content","px-3","p-md-4",3,"ngClass"]],template:function(a,t){a&1&&(p(0,"app-sidebar",0),i(1,"div",1),p(2,"router-outlet"),s()),a&2&&(c("isExpanded",t.sidebarExpanded),n(),c("ngClass",M(2,xe,t.sidebarExpanded)))},dependencies:[Y,E,W],styles:[".content[_ngcontent-%COMP%]{margin-left:60px;transition:.3s;height:100%}@media (max-width: 767px){.content[_ngcontent-%COMP%]{margin-left:0;padding-top:85px!important}}@media (min-width: 768px){.content[_ngcontent-%COMP%]{height:100%}}a[_ngcontent-%COMP%]:hover{text-decoration:none!important}"]})}return r})();export{Je as LayoutComponent};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-MGZVKFCX.js";import{k as c,n as p,q as m}from"./chunk-WAVNYOYF.js";import{g as f,h as r,ka as n,pa as a,z as s}from"./chunk-UUXRTS4O.js";var l=f(u(),1);var $=(()=>{class e{$api=a(m);$toastr=a(p);$translate=a(c);downloadBackup(){return r(this,null,function*(){let t=yield s(this.$api.get("/backup/download",{observe:"response",responseType:"blob"})),i=t.headers.get("File-Name")||"homebridge-backup.tar.gz",o=t.body.size;if(o>globalThis.backup.maxBackupSize){let b=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(o/1048576).toFixed(1)}MB`});this.$toastr.warning(b,this.$translate.instant("toast.title_warning"))}(0,l.saveAs)(t.body,i)})}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$ as a};
1
+ import{a as u}from"./chunk-MGZVKFCX.js";import{k as c,n as p,q as m}from"./chunk-VWDC2WDK.js";import{g as f,h as r,ka as n,pa as a,z as s}from"./chunk-UUXRTS4O.js";var l=f(u(),1);var $=(()=>{class e{$api=a(m);$toastr=a(p);$translate=a(c);downloadBackup(){return r(this,null,function*(){let t=yield s(this.$api.get("/backup/download",{observe:"response",responseType:"blob"})),i=t.headers.get("File-Name")||"homebridge-backup.tar.gz",o=t.body.size;if(o>globalThis.backup.maxBackupSize){let b=this.$translate.instant("backup.backup_exceeds_max_size",{maxBackupSizeText:globalThis.backup.maxBackupSizeText,size:`${(o/1048576).toFixed(1)}MB`});this.$toastr.warning(b,this.$translate.instant("toast.title_warning"))}(0,l.saveAs)(t.body,i)})}static \u0275fac=function(i){return new(i||e)};static \u0275prov=n({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();export{$ as a};
@@ -1 +1 @@
1
- import{k as v,l as E,n as _,q as h}from"./chunk-WAVNYOYF.js";import{Cb as i,Db as e,Eb as f,Pb as u,Sa as n,ac as o,bc as a,fb as d,pa as l,sb as c,tb as x,tc as p,uc as s}from"./chunk-UUXRTS4O.js";function y(t,w){if(t&1&&(i(0,"div",7),o(1),e()),t&2){let r=u();n(),a(r.error)}}function C(t,w){t&1&&(i(0,"p",8),o(1),p(2,"translate"),e()),t&2&&(n(),a(s(2,1,"platform.linux.server_will_power_down")))}var B=(()=>{class t{$api=l(h);$toastr=l(_);$translate=l(v);error=!1;ngOnInit(){this.$api.put("/platform-tools/linux/shutdown-host",{}).subscribe({error:r=>{console.error(r),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(m){return new(m||t)};static \u0275cmp=d({type:t,selectors:[["ng-component"]],decls:13,vars:7,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"grey-text"]],template:function(m,S){m&1&&(i(0,"div",0)(1,"h3",1),o(2),p(3,"translate"),e()(),i(4,"div",2)(5,"div",3),f(6,"i",4),e(),i(7,"div",5)(8,"h4",6),o(9),p(10,"translate"),e(),c(11,y,2,1,"div",7)(12,C,3,3,"p",8),e()()),m&2&&(n(2),a(s(3,3,"menu.restart.title")),n(7),a(s(10,5,"platform.linux.shutting_down_server")),n(2),x(S.error?11:12))},dependencies:[E],encapsulation:2})}return t})();export{B as ShutdownLinuxComponent};
1
+ import{k as v,l as E,n as _,q as h}from"./chunk-VWDC2WDK.js";import{Cb as i,Db as e,Eb as f,Pb as u,Sa as n,ac as o,bc as a,fb as d,pa as l,sb as c,tb as x,tc as p,uc as s}from"./chunk-UUXRTS4O.js";function y(t,w){if(t&1&&(i(0,"div",7),o(1),e()),t&2){let r=u();n(),a(r.error)}}function C(t,w){t&1&&(i(0,"p",8),o(1),p(2,"translate"),e()),t&2&&(n(),a(s(2,1,"platform.linux.server_will_power_down")))}var B=(()=>{class t{$api=l(h);$toastr=l(_);$translate=l(v);error=!1;ngOnInit(){this.$api.put("/platform-tools/linux/shutdown-host",{}).subscribe({error:r=>{console.error(r),this.error=this.$translate.instant("platform.linux.server_restart_error"),this.$toastr.error(this.$translate.instant("platform.linux.server_restart_error"),this.$translate.instant("toast.title_error"))}})}static \u0275fac=function(m){return new(m||t)};static \u0275cmp=d({type:t,selectors:[["ng-component"]],decls:13,vars:7,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fas","fa-power-off",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"grey-text"]],template:function(m,S){m&1&&(i(0,"div",0)(1,"h3",1),o(2),p(3,"translate"),e()(),i(4,"div",2)(5,"div",3),f(6,"i",4),e(),i(7,"div",5)(8,"h4",6),o(9),p(10,"translate"),e(),c(11,y,2,1,"div",7)(12,C,3,3,"p",8),e()()),m&2&&(n(2),a(s(3,3,"menu.restart.title")),n(7),a(s(10,5,"platform.linux.shutting_down_server")),n(2),x(S.error?11:12))},dependencies:[E],encapsulation:2})}return t})();export{B as ShutdownLinuxComponent};
@@ -1 +1 @@
1
- import{b as de}from"./chunk-H73LUU46.js";import{p as pe}from"./chunk-WAVNYOYF.js";import{f as Ke,ka as ue,m as fe,p as $,pa as le}from"./chunk-UUXRTS4O.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ge=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_e=typeof ArrayBuffer=="function",be=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,N=({type:r,data:e},t,s)=>ge&&e instanceof Blob?t?s(e):me(e,s):_e&&(e instanceof ArrayBuffer||be(e))?t?s(e):me(new Blob([e]),s):s(d[r]+(e||"")),me=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function ye(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var Q;function we(r,e){if(ge&&r.data instanceof Blob)return r.data.arrayBuffer().then(ye).then(e);if(_e&&(r.data instanceof ArrayBuffer||be(r.data)))return e(ye(r.data));N(r,!1,t=>{Q||(Q=new TextEncoder),e(Q.encode(t))})}var Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Ee.length;r++)B[Ee.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,a,h;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=B[r.charCodeAt(s)],o=B[r.charCodeAt(s+1)],a=B[r.charCodeAt(s+2)],h=B[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|a>>2,p[i++]=(a&3)<<6|h&63;return m};var Ye=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:ve(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Je(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Je=(r,e)=>{if(Ye){let t=ke(r);return ve(t,e)}else return{base64:!0,data:r}},ve=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var xe="",Te=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{N(n,!1,a=>{s[o]=a,++i===t&&e(s.join(xe))})})},Ae=(r,e)=>{let t=r.split(xe),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ce(){return new TransformStream({transform(r,e){we(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var j;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){j||(j=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(s===0){if(U(t)<1)break;let h=V(t,1);n=(h[0]&128)===128,i=h[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let h=V(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let h=V(t,8),m=new DataView(h.buffer,h.byteOffset,h.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let h=V(t,i);a.enqueue(L(n?h:j.decode(h),e)),s=0}if(i===0||i>r){a.enqueue(O);break}}}})}var G=4;function f(r){if(r)return ze(r)}function ze(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Se="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var Xe=u.setTimeout,$e=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=Xe.bind(u),r.clearTimeoutFn=$e.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var Qe=1.33;function Oe(r){return typeof r=="string"?je(r):Math.ceil((r.byteLength||r.size)*Qe)}function je(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ne(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Ne(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Ae(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Te(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Le=!1;try{Le=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Pe=Le;function Ge(){}var Z=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Ge,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",qe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,qe,!1)}}function qe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ze=(function(){let r=De({xdomain:!1});return r&&r.responseType!==null})(),w=class extends Z{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ze&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(De,this.uri(),e)}};function De(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Pe))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ie=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",te=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=Ie?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;N(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},ee=u.WebSocket||u.MozWebSocket,E=class extends te{createSocket(e,t,s){return Ie?new ee(e,t,s):t?new ee(e,t):new ee(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ce();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:a,value:h})=>{a||(this.onPacket(h),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var se={websocket:E,webtransport:v,polling:w};var et=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=et.exec(r||""),n={},o=14;for(;o--;)n[tt[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=st(n,n.path),n.queryKey=rt(n,n.query),n}function st(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function rt(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var re=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];re&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Se,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),re&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=G,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Oe(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),re&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=G,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let R=new Error("probe error");R.transport=t.name,this.emitReserved("upgradeError",R)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let R=new Error("probe error: "+b);R.transport=t.name,n(),this.emitReserved("upgradeError",R)};function a(){o("transport closed")}function h(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",a),this.off("close",h),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",a),this.once("close",h),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>se[i]).filter(i=>!!i)),super(e,s)}};var bs=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var he={};Ke(he,{Decoder:()=>ce,Encoder:()=>oe,PacketType:()=>c,isPacketValid:()=>pt,protocol:()=>We});var nt=typeof ArrayBuffer=="function",ot=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ue=Object.prototype.toString,ct=typeof Blob=="function"||typeof Blob<"u"&&Ue.call(Blob)==="[object BlobConstructor]",at=typeof File=="function"||typeof File<"u"&&Ue.call(File)==="[object FileConstructor]";function D(r){return nt&&(r instanceof ArrayBuffer||ot(r))||ct&&r instanceof Blob||at&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ve(r){let e=[],t=r.data,s=r;return s.data=ie(t,e),s.attachments=e.length,{packet:s,buffers:e}}function ie(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=ie(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=ie(r[s],e));return t}return r}function Me(r,e){return r.data=ne(r.data,e),delete r.attachments,r}function ne(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ne(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ne(r[t],e));return r}var He=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],We=5,c=(function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r})(c||{}),oe=class{constructor(e){this.replacer=e}encode(e){return(e.type===c.EVENT||e.type===c.ACK)&&q(e)?this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===c.BINARY_EVENT||e.type===c.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ve(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}},ce=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===c.BINARY_EVENT;s||t.type===c.BINARY_ACK?(t.type=s?c.EVENT:c.ACK,this.reconstructor=new ae(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(c[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===c.BINARY_EVENT||s.type===c.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return X(t);case c.DISCONNECT:return t===void 0;case c.CONNECT_ERROR:return typeof t=="string"||X(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&He.indexOf(t[0])===-1);case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ae=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Me(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function ht(r){return typeof r=="string"}var ft=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function ut(r){return r===void 0||ft(r)}function X(r){return Object.prototype.toString.call(r)==="[object Object]"}function lt(r,e){switch(r){case c.CONNECT:return e===void 0||X(e);case c.DISCONNECT:return e===void 0;case c.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&He.indexOf(e[0])===-1);case c.ACK:return Array.isArray(e);case c.CONNECT_ERROR:return typeof e=="string"||X(e);default:return!1}}function pt(r){return ht(r.nsp)&&ut(r.id)&&lt(r.type,r.data)}function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var dt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(dt.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:c.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let a=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,h=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);t.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(n),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,a)=>o?i(o):s(a);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case c.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case c.EVENT:case c.BINARY_EVENT:this.onevent(e);break;case c.ACK:case c.BINARY_ACK:this.onack(e);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:c.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function k(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}k.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};k.prototype.reset=function(){this.attempts=0};k.prototype.setMin=function(r){this.ms=r};k.prototype.setMax=function(r){this.max=r};k.prototype.setJitter=function(r){this.jitter=r};var C=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new k({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||he;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let a=this._timeout,h=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},a);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var I={};function F(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=I[i]&&n in I[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return a?h=new C(s,e):(I[i]||(I[i]=new C(s,e)),h=I[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(F,{Manager:C,Socket:A,io:F,connect:F});var lr=(()=>{class r{$auth=le(de);namespaceConnectionCache={};connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new $,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new $,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=F(`${pe.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new fe(a=>{s.emit(n,o,h=>{typeof h=="object"&&h.error?a.error(h):a.next(h),a.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=ue({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{lr as a};
1
+ import{b as de}from"./chunk-D7BCWWSP.js";import{p as pe}from"./chunk-VWDC2WDK.js";import{f as Ke,ka as ue,m as fe,p as $,pa as le}from"./chunk-UUXRTS4O.js";var d=Object.create(null);d.open="0";d.close="1";d.ping="2";d.pong="3";d.message="4";d.upgrade="5";d.noop="6";var S=Object.create(null);Object.keys(d).forEach(r=>{S[d[r]]=r});var O={type:"error",data:"parser error"};var ge=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",_e=typeof ArrayBuffer=="function",be=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r&&r.buffer instanceof ArrayBuffer,N=({type:r,data:e},t,s)=>ge&&e instanceof Blob?t?s(e):me(e,s):_e&&(e instanceof ArrayBuffer||be(e))?t?s(e):me(new Blob([e]),s):s(d[r]+(e||"")),me=(r,e)=>{let t=new FileReader;return t.onload=function(){let s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(r)};function ye(r){return r instanceof Uint8Array?r:r instanceof ArrayBuffer?new Uint8Array(r):new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}var Q;function we(r,e){if(ge&&r.data instanceof Blob)return r.data.arrayBuffer().then(ye).then(e);if(_e&&(r.data instanceof ArrayBuffer||be(r.data)))return e(ye(r.data));N(r,!1,t=>{Q||(Q=new TextEncoder),e(Q.encode(t))})}var Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",B=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let r=0;r<Ee.length;r++)B[Ee.charCodeAt(r)]=r;var ke=r=>{let e=r.length*.75,t=r.length,s,i=0,n,o,a,h;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);let m=new ArrayBuffer(e),p=new Uint8Array(m);for(s=0;s<t;s+=4)n=B[r.charCodeAt(s)],o=B[r.charCodeAt(s+1)],a=B[r.charCodeAt(s+2)],h=B[r.charCodeAt(s+3)],p[i++]=n<<2|o>>4,p[i++]=(o&15)<<4|a>>2,p[i++]=(a&3)<<6|h&63;return m};var Ye=typeof ArrayBuffer=="function",L=(r,e)=>{if(typeof r!="string")return{type:"message",data:ve(r,e)};let t=r.charAt(0);return t==="b"?{type:"message",data:Je(r.substring(1),e)}:S[t]?r.length>1?{type:S[t],data:r.substring(1)}:{type:S[t]}:O},Je=(r,e)=>{if(Ye){let t=ke(r);return ve(t,e)}else return{base64:!0,data:r}},ve=(r,e)=>{switch(e){case"blob":return r instanceof Blob?r:new Blob([r]);case"arraybuffer":default:return r instanceof ArrayBuffer?r:r.buffer}};var xe="",Te=(r,e)=>{let t=r.length,s=new Array(t),i=0;r.forEach((n,o)=>{N(n,!1,a=>{s[o]=a,++i===t&&e(s.join(xe))})})},Ae=(r,e)=>{let t=r.split(xe),s=[];for(let i=0;i<t.length;i++){let n=L(t[i],e);if(s.push(n),n.type==="error")break}return s};function Ce(){return new TransformStream({transform(r,e){we(r,t=>{let s=t.length,i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);let n=new DataView(i.buffer);n.setUint8(0,126),n.setUint16(1,s)}else{i=new Uint8Array(9);let n=new DataView(i.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(s))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var j;function U(r){return r.reduce((e,t)=>e+t.length,0)}function V(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),s=0;for(let i=0;i<e;i++)t[i]=r[0][s++],s===r[0].length&&(r.shift(),s=0);return r.length&&s<r[0].length&&(r[0]=r[0].slice(s)),t}function Re(r,e){j||(j=new TextDecoder);let t=[],s=0,i=-1,n=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(s===0){if(U(t)<1)break;let h=V(t,1);n=(h[0]&128)===128,i=h[0]&127,i<126?s=3:i===126?s=1:s=2}else if(s===1){if(U(t)<2)break;let h=V(t,2);i=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(U(t)<8)break;let h=V(t,8),m=new DataView(h.buffer,h.byteOffset,h.length),p=m.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(O);break}i=p*Math.pow(2,32)+m.getUint32(4),s=3}else{if(U(t)<i)break;let h=V(t,i);a.enqueue(L(n?h:j.decode(h),e)),s=0}if(i===0||i>r){a.enqueue(O);break}}}})}var G=4;function f(r){if(r)return ze(r)}function ze(r){for(var e in f.prototype)r[e]=f.prototype[e];return r}f.prototype.on=f.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};f.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};f.prototype.off=f.prototype.removeListener=f.prototype.removeAllListeners=f.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var s,i=0;i<t.length;i++)if(s=t[i],s===e||s.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};f.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(t){t=t.slice(0);for(var s=0,i=t.length;s<i;++s)t[s].apply(this,e)}return this};f.prototype.emitReserved=f.prototype.emit;f.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};f.prototype.hasListeners=function(r){return!!this.listeners(r).length};var y=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),u=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Se="arraybuffer";function M(r,...e){return e.reduce((t,s)=>(r.hasOwnProperty(s)&&(t[s]=r[s]),t),{})}var Xe=u.setTimeout,$e=u.clearTimeout;function g(r,e){e.useNativeTimers?(r.setTimeoutFn=Xe.bind(u),r.clearTimeoutFn=$e.bind(u)):(r.setTimeoutFn=u.setTimeout.bind(u),r.clearTimeoutFn=u.clearTimeout.bind(u))}var Qe=1.33;function Oe(r){return typeof r=="string"?je(r):Math.ceil((r.byteLength||r.size)*Qe)}function je(r){let e=0,t=0;for(let s=0,i=r.length;s<i;s++)e=r.charCodeAt(s),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(s++,t+=4);return t}function H(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ne(r){let e="";for(let t in r)r.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(r[t]));return e}function Be(r){let e={},t=r.split("&");for(let s=0,i=t.length;s<i;s++){let n=t[s].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var W=class extends Error{constructor(e,t,s){super(e),this.description=t,this.context=s,this.type="TransportError"}},_=class extends f{constructor(e){super(),this.writable=!1,g(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,s){return super.emitReserved("error",new W(e,t,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){let t=L(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){let e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Ne(e);return t.length?"?"+t:""}};var P=class extends _{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";let t=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};Ae(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Te(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=H()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var Le=!1;try{Le=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Pe=Le;function Ge(){}var Z=class extends P{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){let s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,n)=>{this.onError("xhr post error",i,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}},K=(()=>{class r extends f{constructor(t,s,i){super(),this.createRequest=t,g(this,i),this._opts=i,this._method=i.method||"GET",this._uri=s,this._data=i.data!==void 0?i.data:null,this._create()}_create(){var t;let s=M(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");s.xdomain=!!this._opts.xd;let i=this._xhr=this.createRequest(s);try{i.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){i.setDisableHeaderCheck&&i.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&i.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{i.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{i.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(i),"withCredentials"in i&&(i.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(i.timeout=this._opts.requestTimeout),i.onreadystatechange=()=>{var n;i.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(i.getResponseHeader("set-cookie"))),i.readyState===4&&(i.status===200||i.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof i.status=="number"?i.status:0)},0))},i.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=r.requestsCount++,r.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Ge,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete r.requests[this._index],this._xhr=null}}_onLoad(){let t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return r.requestsCount=0,r.requests={},r})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",qe);else if(typeof addEventListener=="function"){let r="onpagehide"in u?"pagehide":"unload";addEventListener(r,qe,!1)}}function qe(){for(let r in K.requests)K.requests.hasOwnProperty(r)&&K.requests[r].abort()}var Ze=(function(){let r=De({xdomain:!1});return r&&r.responseType!==null})(),w=class extends Z{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=Ze&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new K(De,this.uri(),e)}};function De(r){let e=r.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||Pe))return new XMLHttpRequest}catch{}if(!e)try{return new u[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ie=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",te=class extends _{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,s=Ie?{}:M(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;N(s,this.supportsBinary,n=>{try{this.doWrite(s,n)}catch{}i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=H()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},ee=u.WebSocket||u.MozWebSocket,E=class extends te{createSocket(e,t,s){return Ie?new ee(e,t,s):t?new ee(e,t):new ee(e)}doWrite(e,t){this.ws.send(t)}};var v=class extends _{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{let t=Re(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=Ce();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();let n=()=>{s.read().then(({done:a,value:h})=>{a||(this.onPacket(h),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t<e.length;t++){let s=e[t],i=t===e.length-1;this._writer.write(s).then(()=>{i&&y(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var se={websocket:E,webtransport:v,polling:w};var et=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,tt=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function x(r){if(r.length>8e3)throw"URI too long";let e=r,t=r.indexOf("["),s=r.indexOf("]");t!=-1&&s!=-1&&(r=r.substring(0,t)+r.substring(t,s).replace(/:/g,";")+r.substring(s,r.length));let i=et.exec(r||""),n={},o=14;for(;o--;)n[tt[o]]=i[o]||"";return t!=-1&&s!=-1&&(n.source=e,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=st(n,n.path),n.queryKey=rt(n,n.query),n}function st(r,e){let t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function rt(r,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,n){i&&(t[i]=n)}),t}var re=typeof addEventListener=="function"&&typeof removeEventListener=="function",Y=[];re&&addEventListener("offline",()=>{Y.forEach(r=>r())},!1);var J=(()=>{class r extends f{constructor(t,s){if(super(),this.binaryType=Se,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(s=t,t=null),t){let i=x(t);s.hostname=i.host,s.secure=i.protocol==="https"||i.protocol==="wss",s.port=i.port,i.query&&(s.query=i.query)}else s.host&&(s.hostname=x(s.host).host);g(this,s),this.secure=s.secure!=null?s.secure:typeof location<"u"&&location.protocol==="https:",s.hostname&&!s.port&&(s.port=this.secure?"443":"80"),this.hostname=s.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=s.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},s.transports.forEach(i=>{let n=i.prototype.name;this.transports.push(n),this._transportsByName[n]=i}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},s),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Be(this.opts.query)),re&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Y.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let s=Object.assign({},this.opts.query);s.EIO=G,s.transport=t,this.id&&(s.sid=this.id);let i=Object.assign({},this.opts,{query:s,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](i)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&r.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let s=this.createTransport(t);s.open(),this.setTransport(s)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",s=>this._onClose("transport close",s))}onOpen(){this.readyState="open",r.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let s=new Error("server error");s.code=t.data,this._onError(s);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let s=1;for(let i=0;i<this.writeBuffer.length;i++){let n=this.writeBuffer[i].data;if(n&&(s+=Oe(n)),i>0&&s>this._maxPayload)return this.writeBuffer.slice(0,i);s+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,y(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,s,i){return this._sendPacket("message",t,s,i),this}send(t,s,i){return this._sendPacket("message",t,s,i),this}_sendPacket(t,s,i,n){if(typeof s=="function"&&(n=s,s=void 0),typeof i=="function"&&(n=i,i=null),this.readyState==="closing"||this.readyState==="closed")return;i=i||{},i.compress=i.compress!==!1;let o={type:t,data:s,options:i};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let t=()=>{this._onClose("forced close"),this.transport.close()},s=()=>{this.off("upgrade",s),this.off("upgradeError",s),t()},i=()=>{this.once("upgrade",s),this.once("upgradeError",s)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?i():t()}):this.upgrading?i():t()),this}_onError(t){if(r.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,s){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),re&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let i=Y.indexOf(this._offlineEventListener);i!==-1&&Y.splice(i,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,s),this.writeBuffer=[],this._prevBufferLen=0}}}return r.protocol=G,r})(),z=class extends J{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let t=this.createTransport(e),s=!1;J.priorWebsocketSuccess=!1;let i=()=>{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",b=>{if(!s)if(b.type==="pong"&&b.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;J.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(p(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let R=new Error("probe error");R.transport=t.name,this.emitReserved("upgradeError",R)}}))};function n(){s||(s=!0,p(),t.close(),t=null)}let o=b=>{let R=new Error("probe error: "+b);R.transport=t.name,n(),this.emitReserved("upgradeError",R)};function a(){o("transport closed")}function h(){o("socket closed")}function m(b){t&&b.name!==t.name&&n()}let p=()=>{t.removeListener("open",i),t.removeListener("error",o),t.removeListener("close",a),this.off("close",h),this.off("upgrading",m)};t.once("open",i),t.once("error",o),t.once("close",a),this.once("close",h),this.once("upgrading",m),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let s=0;s<e.length;s++)~this.transports.indexOf(e[s])&&t.push(e[s]);return t}},T=class extends z{constructor(e,t={}){let s=typeof e=="object"?e:t;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(i=>se[i]).filter(i=>!!i)),super(e,s)}};var bs=T.protocol;function Fe(r,e="",t){let s=r;t=t||typeof location<"u"&&location,r==null&&(r=t.protocol+"//"+t.host),typeof r=="string"&&(r.charAt(0)==="/"&&(r.charAt(1)==="/"?r=t.protocol+r:r=t.host+r),/^(https?|wss?):\/\//.test(r)||(typeof t<"u"?r=t.protocol+"//"+r:r="https://"+r),s=x(r)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";let n=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+n+":"+s.port+e,s.href=s.protocol+"://"+n+(t&&t.port===s.port?"":":"+s.port),s}var he={};Ke(he,{Decoder:()=>ce,Encoder:()=>oe,PacketType:()=>c,isPacketValid:()=>pt,protocol:()=>We});var nt=typeof ArrayBuffer=="function",ot=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Ue=Object.prototype.toString,ct=typeof Blob=="function"||typeof Blob<"u"&&Ue.call(Blob)==="[object BlobConstructor]",at=typeof File=="function"||typeof File<"u"&&Ue.call(File)==="[object FileConstructor]";function D(r){return nt&&(r instanceof ArrayBuffer||ot(r))||ct&&r instanceof Blob||at&&r instanceof File}function q(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,s=r.length;t<s;t++)if(q(r[t]))return!0;return!1}if(D(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return q(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&q(r[t]))return!0;return!1}function Ve(r){let e=[],t=r.data,s=r;return s.data=ie(t,e),s.attachments=e.length,{packet:s,buffers:e}}function ie(r,e){if(!r)return r;if(D(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let s=0;s<r.length;s++)t[s]=ie(r[s],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=ie(r[s],e));return t}return r}function Me(r,e){return r.data=ne(r.data,e),delete r.attachments,r}function ne(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=ne(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=ne(r[t],e));return r}var He=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],We=5,c=(function(r){return r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK",r})(c||{}),oe=class{constructor(e){this.replacer=e}encode(e){return(e.type===c.EVENT||e.type===c.ACK)&&q(e)?this.encodeAsBinary({type:e.type===c.EVENT?c.BINARY_EVENT:c.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===c.BINARY_EVENT||e.type===c.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){let t=Ve(e),s=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(s),i}},ce=class r extends f{constructor(e){super(),this.reviver=e}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let s=t.type===c.BINARY_EVENT;s||t.type===c.BINARY_ACK?(t.type=s?c.EVENT:c.ACK,this.reconstructor=new ae(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(D(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,s={type:Number(e.charAt(0))};if(c[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===c.BINARY_EVENT||s.type===c.BINARY_ACK){let n=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(n,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");s.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););s.nsp=e.substring(n,t)}else s.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}s.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(r.isPayloadValid(s.type,n))s.data=n;else throw new Error("invalid payload")}return s}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case c.CONNECT:return X(t);case c.DISCONNECT:return t===void 0;case c.CONNECT_ERROR:return typeof t=="string"||X(t);case c.EVENT:case c.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&He.indexOf(t[0])===-1);case c.ACK:case c.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},ae=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=Me(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function ht(r){return typeof r=="string"}var ft=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function ut(r){return r===void 0||ft(r)}function X(r){return Object.prototype.toString.call(r)==="[object Object]"}function lt(r,e){switch(r){case c.CONNECT:return e===void 0||X(e);case c.DISCONNECT:return e===void 0;case c.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&He.indexOf(e[0])===-1);case c.ACK:return Array.isArray(e);case c.CONNECT_ERROR:return typeof e=="string"||X(e);default:return!1}}function pt(r){return ht(r.nsp)&&ut(r.id)&&lt(r.type,r.data)}function l(r,e,t){return r.on(e,t),function(){r.off(e,t)}}var dt=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),A=class extends f{constructor(e,t,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[l(e,"open",this.onopen.bind(this)),l(e,"packet",this.onpacket.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){var s,i,n;if(dt.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;let o={type:c.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let p=this.ids++,b=t.pop();this._registerAckCallback(p,b),o.id=p}let a=(i=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||i===void 0?void 0:i.writable,h=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(h?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var s;let i=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(i===void 0){this.acks[e]=t;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===e&&this.sendBuffer.splice(a,1);t.call(this,new Error("operation has timed out"))},i),o=(...a)=>{this.io.clearTimeoutFn(n),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((s,i)=>{let n=(o,a)=>o?i(o):s(a);n.withError=!0,t.push(n),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());let s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...n)=>(this._queue[0],i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...n)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;let t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:c.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){let s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case c.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case c.EVENT:case c.BINARY_EVENT:this.onevent(e);break;case c.ACK:case c.BINARY_ACK:this.onack(e);break;case c.DISCONNECT:this.ondisconnect();break;case c.CONNECT_ERROR:this.destroy();let s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){let t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){let t=this._anyListeners.slice();for(let s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){let t=this,s=!1;return function(...i){s||(s=!0,t.packet({type:c.ACK,id:e,data:i}))}}onack(e){let t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:c.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){let t=this._anyListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){let t=this._anyOutgoingListeners;for(let s=0;s<t.length;s++)if(e===t[s])return t.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let t=this._anyOutgoingListeners.slice();for(let s of t)s.apply(this,e.data)}}};function k(r){r=r||{},this.ms=r.min||100,this.max=r.max||1e4,this.factor=r.factor||2,this.jitter=r.jitter>0&&r.jitter<=1?r.jitter:0,this.attempts=0}k.prototype.duration=function(){var r=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*r);r=(Math.floor(e*10)&1)==0?r-t:r+t}return Math.min(r,this.max)|0};k.prototype.reset=function(){this.attempts=0};k.prototype.setMin=function(r){this.ms=r};k.prototype.setMax=function(r){this.max=r};k.prototype.setJitter=function(r){this.jitter=r};var C=class extends f{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,g(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new k({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let i=t.parser||he;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new T(this.uri,this.opts);let t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;let i=l(t,"open",function(){s.onopen(),e&&e()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=l(t,"error",n);if(this._timeout!==!1){let a=this._timeout,h=this.setTimeoutFn(()=>{i(),n(new Error("timeout")),t.close()},a);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let e=this.engine;this.subs.push(l(e,"ping",this.onping.bind(this)),l(e,"data",this.ondata.bind(this)),l(e,"error",this.onerror.bind(this)),l(e,"close",this.onclose.bind(this)),l(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){y(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new A(this,e,t),this.nsps[e]=s),s}_destroy(e){let t=Object.keys(this.nsps);for(let s of t)if(this.nsps[s].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let s=0;s<t.length;s++)this.engine.write(t[s],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let t=this.backoff.duration();this._reconnecting=!0;let s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var I={};function F(r,e){typeof r=="object"&&(e=r,r=void 0),e=e||{};let t=Fe(r,e.path||"/socket.io"),s=t.source,i=t.id,n=t.path,o=I[i]&&n in I[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,h;return a?h=new C(s,e):(I[i]||(I[i]=new C(s,e)),h=I[i]),t.query&&!e.query&&(e.query=t.queryKey),h.socket(t.path,e)}Object.assign(F,{Manager:C,Socket:A,io:F,connect:F});var lr=(()=>{class r{$auth=le(de);namespaceConnectionCache={};connectToNamespace(t){if(this.namespaceConnectionCache[t]){let s=this.namespaceConnectionCache[t];return s.connected=new $,setTimeout(()=>{s.socket.connected&&s.connected.next(void 0)}),s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]}else{let s=this.establishConnectionToNamespace(t);return s.connected=new $,s.socket.on("connect",()=>{s.connected.next(void 0)}),s.end=()=>{s.socket.emit("end"),s.socket.removeAllListeners(),s.connected.complete()},this.namespaceConnectionCache[t]=s,s}}getExistingNamespace(t){return this.namespaceConnectionCache[t]}establishConnectionToNamespace(t){let s=F(`${pe.api.socket}/${t}`,{query:{token:this.$auth.token}});return{socket:s,request:(n,o)=>new fe(a=>{s.emit(n,o,h=>{typeof h=="object"&&h.error?a.error(h):a.next(h),a.complete()})})}}static \u0275fac=function(s){return new(s||r)};static \u0275prov=ue({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{lr as a};
@@ -1 +1 @@
1
- import{b as H}from"./chunk-KSI5RFA4.js";import{a as L,b as S}from"./chunk-PCFKF3RR.js";import{m as T}from"./chunk-YHD44ZXJ.js";import{l as B}from"./chunk-WAVNYOYF.js";import{$b as y,Ab as a,Bb as m,Kb as k,Na as f,Nb as b,Oa as O,Pb as d,Sa as o,ac as u,bc as I,cc as M,fb as v,kc as w,pa as h,rb as C,sb as r,tb as l,tc as g,ua as x,uc as _,va as P,yb as p,zb as i}from"./chunk-UUXRTS4O.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(w("fas ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,f)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,f)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),u(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),I(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,f),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
1
+ import{b as H}from"./chunk-KSI5RFA4.js";import{a as L,b as S}from"./chunk-PCFKF3RR.js";import{m as T}from"./chunk-YHD44ZXJ.js";import{l as B}from"./chunk-VWDC2WDK.js";import{$b as y,Ab as a,Bb as m,Kb as k,Na as f,Nb as b,Oa as O,Pb as d,Sa as o,ac as u,bc as I,cc as M,fb as v,kc as w,pa as h,rb as C,sb as r,tb as l,tc as g,ua as x,uc as _,va as P,yb as p,zb as i}from"./chunk-UUXRTS4O.js";function E(t,c){if(t&1&&m(0,"i",16),t&2){let n=d();y(w("fas ",n.faIconClass," mb-3"))}}function z(t,c){if(t&1&&m(0,"h5",6),t&2){let n=d();p("innerHTML",n.subtitle,f)}}function V(t,c){if(t&1&&m(0,"p",8),t&2){let n=d();p("innerHTML",n.message2,f)}}function D(t,c){if(t&1&&m(0,"markdown",9),t&2){let n=d();p("data",n.markdownMessage2)}}function N(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function j(t,c){if(t&1){let n=k();i(0,"button",17),g(1,"translate"),b("click",function(){x(n);let e=d();return P(e.dismissModal())}),u(2),g(3,"translate"),a()}t&2&&(C("aria-label",_(1,2,"form.button_close")),o(2),M(" ",_(3,4,"form.button_close")," "))}function A(t,c){if(t&1&&(i(0,"a",15),u(1),m(2,"i",18),a()),t&2){let n=d();p("href",n.ctaButtonLink,O),o(),M(" ",n.ctaButtonLabel," ")}}var X=(()=>{class t{$activeModal=h(T);title;subtitle;message;message2;ctaButtonLabel;ctaButtonLink;faIconClass;markdownMessage2;dismissModal(){this.$activeModal.dismiss("Dismiss")}static \u0275fac=function(s){return new(s||t)};static \u0275cmp=v({type:t,selectors:[["ng-component"]],inputs:{title:"title",subtitle:"subtitle",message:"message",message2:"message2",ctaButtonLabel:"ctaButtonLabel",ctaButtonLink:"ctaButtonLink",faIconClass:"faIconClass",markdownMessage2:"markdownMessage2"},decls:19,vars:12,consts:[[1,"modal-content"],[1,"modal-header"],[1,"modal-title"],["type","button","data-bs-dismiss","modal",1,"btn-close",3,"click"],[1,"modal-body","text-center"],[2,"font-size","75px",3,"class"],[1,"mb-3",3,"innerHTML"],[1,"mb-0",3,"innerHTML"],[1,"mb-0","mt-3",3,"innerHTML"],[1,"plugin-md",3,"data"],[1,"modal-footer","justify-content-between"],[1,"text-start"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant"],[1,"text-center"],[1,"text-end"],["target","_blank","rel","noopener noreferrer",1,"btn","btn-primary","text-decoration-none",3,"href"],[2,"font-size","75px"],["type","button","data-bs-dismiss","modal",1,"btn","btn-elegant",3,"click"],[1,"fas","fa-external-link-alt"]],template:function(s,e){s&1&&(i(0,"div",0)(1,"div",1)(2,"h5",2),u(3),a(),i(4,"button",3),g(5,"translate"),b("click",function(){return e.dismissModal()}),a()(),i(6,"div",4),r(7,E,1,3,"i",5),r(8,z,1,1,"h5",6),m(9,"p",7),r(10,V,1,1,"p",8),r(11,D,1,1,"markdown",9),a(),i(12,"div",10)(13,"div",11),r(14,N,4,6,"button",12),a(),i(15,"div",13),r(16,j,4,6,"button",12),a(),i(17,"div",14),r(18,A,3,2,"a",15),a()()()),s&2&&(o(3),I(e.title),o(),C("aria-label",_(5,10,"form.button_close")),o(3),l(e.faIconClass?7:-1),o(),l(e.subtitle?8:-1),o(),p("innerHTML",e.message,f),o(),l(e.message2?10:-1),o(),l(e.markdownMessage2?11:-1),o(3),l(e.ctaButtonLink?14:-1),o(2),l(e.ctaButtonLink?-1:16),o(2),l(e.ctaButtonLink?18:-1))},dependencies:[S,L,H,B],styles:["[_nghost-%COMP%] .plugin-md{display:block!important;background-color:#f6f8fa!important;border-radius:6px!important;padding:16px!important;margin:16px auto!important;width:100%!important;max-width:632px!important}[_nghost-%COMP%] .plugin-md table{width:100%;max-width:600px;margin:0 auto!important;border-collapse:collapse;border:1px solid #d0d7de!important;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif!important;font-size:14px!important;color:#24292e!important}[_nghost-%COMP%] .plugin-md th, [_nghost-%COMP%] .plugin-md td{padding:6px 13px!important;border:1px solid #d0d7de!important;text-align:left;color:#24292e!important}[_nghost-%COMP%] .plugin-md th{background-color:#f6f8fa!important;font-weight:600!important;text-align:center!important}[_nghost-%COMP%] .plugin-md td[align=center]{text-align:center!important}[_nghost-%COMP%] .plugin-md tr{color:#24292e!important}[_nghost-%COMP%] .plugin-md tr:nth-child(odd){background-color:#fff!important}[_nghost-%COMP%] .plugin-md tr:nth-child(2n){background-color:#f6f8fa!important}[_nghost-%COMP%] .plugin-md tr:hover{background-color:#f0f2f5!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%]{background-color:#2b2b2b!important;color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] table[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%], [_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{color:#fff!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{background-color:#3c3c3c!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(odd){background-color:#323232!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:nth-child(2n){background-color:#2b2b2b!important}[_nghost-%COMP%] body.dark-mode[_ngcontent-%COMP%] .plugin-md[_ngcontent-%COMP%] tr[_ngcontent-%COMP%]:hover{background-color:#454545!important}"]})}return t})();export{X as a};
@@ -1,4 +1,4 @@
1
- import{a as P}from"./chunk-JT7SPTVG.js";import{a as z}from"./chunk-N6D52WI6.js";import{C as $,c as E,e as y,l as k}from"./chunk-LZU5VVW4.js";import{c as D}from"./chunk-O7FV4MLW.js";import{b as O}from"./chunk-VD4V4NEZ.js";import{k as T,n as I,q as H}from"./chunk-WAVNYOYF.js";import{Ab as s,Bb as w,Kb as g,Nb as _,Pb as a,Sa as p,ac as v,fb as x,h as S,hc as b,ic as M,jc as V,pa as r,sb as m,tb as u,ua as l,va as c,yb as f,z as C,zb as d}from"./chunk-UUXRTS4O.js";function A(i,h){i&1&&w(0,"i",6)}function L(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();d(0,"ngx-monaco-editor",10),_("onInit",function(e){l(t);let o=a();return c(o.onEditorInit(e))})("keydown.control.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())})("keydown.meta.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())}),s()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();d(0,"textarea",11),V("ngModelChange",function(e){l(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),c(e)}),v(1," "),s()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(z);$route=r(D);$settings=r(O);$toastr=r(I);$translate=r(T);lastHeight;visualViewPortEventCallback;startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light"},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
1
+ import{a as P}from"./chunk-JT7SPTVG.js";import{a as z}from"./chunk-N6D52WI6.js";import{C as $,c as E,e as y,l as k}from"./chunk-LZU5VVW4.js";import{c as D}from"./chunk-O7FV4MLW.js";import{b as O}from"./chunk-U6OOUZY4.js";import{k as T,n as I,q as H}from"./chunk-VWDC2WDK.js";import{Ab as s,Bb as w,Kb as g,Nb as _,Pb as a,Sa as p,ac as v,fb as x,h as S,hc as b,ic as M,jc as V,pa as r,sb as m,tb as u,ua as l,va as c,yb as f,z as C,zb as d}from"./chunk-UUXRTS4O.js";function A(i,h){i&1&&w(0,"i",6)}function L(i,h){i&1&&w(0,"i",7)}function F(i,h){if(i&1){let t=g();d(0,"ngx-monaco-editor",10),_("onInit",function(e){l(t);let o=a();return c(o.onEditorInit(e))})("keydown.control.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())})("keydown.meta.s",function(e){l(t);let o=a();return e.preventDefault(),c(o.onSave())}),s()}if(i&2){let t=a();f("options",t.editorOptions)("model",t.monacoEditorModel)}}function W(i,h){if(i&1){let t=g();d(0,"textarea",11),V("ngModelChange",function(e){l(t);let o=a();return M(o.startupScript,e)||(o.startupScript=e),c(e)}),v(1," "),s()}if(i&2){let t=a();b("ngModel",t.startupScript)}}var tt=(()=>{class i{$api=r(H);$md=r(z);$route=r(D);$settings=r(O);$toastr=r(I);$translate=r(T);lastHeight;visualViewPortEventCallback;startupScript;saveInProgress;isMobile=!1;options={printMargin:!1};monacoEditor;editorOptions;monacoEditorModel;constructor(){this.isMobile=this.$md.detect.mobile()}ngOnInit(){this.editorOptions={language:"shell",theme:this.$settings.actualLightingMode==="dark"?"vs-dark":"vs-light"},this.visualViewPortEventCallback=()=>this.visualViewPortChanged(),this.lastHeight=window.innerHeight,window.visualViewport&&!this.isMobile&&(window.visualViewport.addEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.disableTouchMove()),this.$route.data.subscribe(t=>{this.startupScript=t.startupScript.script}),this.monacoEditorModel={value:"",language:"shell"}}onEditorInit(t){this.monacoEditor=t,this.monacoEditor.getModel().setValue(this.startupScript)}onSave(){return S(this,null,function*(){if(!this.saveInProgress){if(this.saveInProgress=!0,this.isMobile||(yield this.monacoEditor.getAction("editor.action.formatDocument").run(),this.startupScript=this.monacoEditor.getModel().getValue()),!["#!/bin/sh","#!/bin/bash"].includes(this.startupScript.split(`
2
2
  `)[0].trim())){this.$toastr.error(this.$translate.instant("platform.docker.must_use_hashbang"),this.$translate.instant("toast.title_error")),this.startupScript=`#!/bin/sh
3
3
 
4
4
  ${this.startupScript}`,this.isMobile||this.monacoEditor.getModel().setValue(this.startupScript),this.saveInProgress=!1;return}try{yield C(this.$api.put("/platform-tools/docker/startup-script",{script:this.startupScript})),this.$toastr.success(this.$translate.instant("platform.docker.restart_required"),this.$translate.instant("platform.docker.script_saved"))}catch(t){console.error(t),this.$toastr.error(t.message,this.$translate.instant("toast.title_error"))}this.saveInProgress=!1}})}ngOnDestroy(){window.visualViewport&&(window.visualViewport.removeEventListener("resize",this.visualViewPortEventCallback,!0),this.$md.enableTouchMove()),this.monacoEditor&&this.monacoEditor.dispose()}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)}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=x({type:i,selectors:[["ng-component"]],decls:11,vars:4,consts:[[1,"flex-column","d-flex","align-items-stretch","h-100"],[1,"row","mb-3"],[1,"col-6"],[1,"primary-text","m-0","font-monospace"],[1,"col-6","text-end"],[1,"btn","btn-primary","waves-effect","m-0",3,"click","disabled"],[1,"fas","fa-circle-notch","fa-spin"],[1,"fas","fa-floppy-disk"],[1,"flex-grow-1","h-100","w-100","my-2",3,"options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModel"],[1,"flex-grow-1","h-100","w-100","my-2",3,"onInit","keydown.control.s","keydown.meta.s","options","model"],["wrap","off","autocomplete","off","autocorrect","off","autocapitalize","off","spellcheck","false",1,"hb-plain-text-editor","align-self-end","h-100","w-100","my-2",3,"ngModelChange","ngModel"]],template:function(n,e){n&1&&(d(0,"div",0)(1,"div",1)(2,"div",2)(3,"h3",3),v(4,"startup.sh"),s()(),d(5,"div",4)(6,"button",5),_("click",function(){return e.onSave()}),m(7,A,1,0,"i",6)(8,L,1,0,"i",7),s()()(),m(9,F,1,2,"ngx-monaco-editor",8),m(10,W,2,1,"textarea",9),s()),n&2&&(p(6),f("disabled",e.saveInProgress),p(),u(e.saveInProgress?7:8),p(2),u(e.isMobile?-1:9),p(),u(e.isMobile?10:-1))},dependencies:[P,$,E,y,k],encapsulation:2})}return i})();export{tt as StartupScriptComponent};
@@ -1 +1 @@
1
- import{a as s}from"./chunk-3D5CLRTZ.js";import"./chunk-GE6FUSBI.js";import"./chunk-TFD6FNNU.js";import"./chunk-PCFKF3RR.js";import"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import"./chunk-VT7JPEPM.js";import"./chunk-H73LUU46.js";import{h as i}from"./chunk-O7FV4MLW.js";import"./chunk-VD4V4NEZ.js";import"./chunk-WAVNYOYF.js";import{gb as t,la as e}from"./chunk-UUXRTS4O.js";var u=[{path:"",loadComponent:()=>import("./chunk-QDSMJS6K.js").then(o=>o.AccessoriesComponent)}],c=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[i.forChild(u),i]})}return o})();var l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[s,c]})}return o})();export{l as AccessoriesModule};
1
+ import{a as s}from"./chunk-R4D64BTL.js";import"./chunk-OKKX5II3.js";import"./chunk-FOCYUW3Q.js";import"./chunk-PCFKF3RR.js";import"./chunk-YHD44ZXJ.js";import"./chunk-LZU5VVW4.js";import"./chunk-4BWNO6KH.js";import"./chunk-D7BCWWSP.js";import{h as i}from"./chunk-O7FV4MLW.js";import"./chunk-U6OOUZY4.js";import"./chunk-VWDC2WDK.js";import{gb as t,la as e}from"./chunk-UUXRTS4O.js";var u=[{path:"",loadComponent:()=>import("./chunk-XOZXUAP4.js").then(o=>o.AccessoriesComponent)}],c=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[i.forChild(u),i]})}return o})();var l=(()=>{class o{static \u0275fac=function(r){return new(r||o)};static \u0275mod=t({type:o});static \u0275inj=e({imports:[s,c]})}return o})();export{l as AccessoriesModule};