@sync-in/server 1.3.1 → 1.3.3

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 (454) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -3
  3. package/package.json +14 -14
  4. package/server/applications/files/services/files-manager.service.js +11 -2
  5. package/server/applications/files/services/files-manager.service.js.map +1 -1
  6. package/server/applications/files/utils/send-file.js +1 -1
  7. package/server/applications/files/utils/send-file.js.map +1 -1
  8. package/server/applications/sync/services/sync-manager.service.js +1 -1
  9. package/server/applications/sync/services/sync-manager.service.js.map +1 -1
  10. package/server/applications/webdav/services/webdav-methods.service.js +28 -28
  11. package/server/applications/webdav/services/webdav-methods.service.js.map +1 -1
  12. package/static/3rdpartylicenses.txt +85 -85
  13. package/static/assets/codemirror/mode/gas/gas.js +2 -0
  14. package/static/chunk-2AC4RLMK.js +4 -0
  15. package/static/chunk-2FUMMTEK.js +1 -0
  16. package/static/chunk-3SC36MTD.js +1 -0
  17. package/static/chunk-3UFSZ24R.js +1 -0
  18. package/static/chunk-4GYSKJJC.js +4 -0
  19. package/static/chunk-67ENNMPZ.js +1 -0
  20. package/static/chunk-6QJL2YDQ.js +1 -0
  21. package/static/chunk-6WROUPVQ.js +1 -0
  22. package/static/chunk-DZNKFVGE.js +1 -0
  23. package/static/chunk-HX6BM5E5.js +1 -0
  24. package/static/chunk-J6YSVODR.js +1 -0
  25. package/static/chunk-JEF7STYA.js +1 -0
  26. package/static/chunk-JOPTBE35.js +24 -0
  27. package/static/chunk-JQOMI5VI.js +560 -0
  28. package/static/chunk-LHULGE6M.js +1 -0
  29. package/static/chunk-MGWQFMQF.js +1 -0
  30. package/static/chunk-MWMJMTGE.js +1 -0
  31. package/static/chunk-NJVHZKGK.js +1 -0
  32. package/static/chunk-OR75MKSH.js +1 -0
  33. package/static/chunk-OWYD7F64.js +1 -0
  34. package/static/chunk-Q2UU32ST.js +1 -0
  35. package/static/chunk-QNGY6EWB.js +1 -0
  36. package/static/chunk-QVWBPQWU.js +7 -0
  37. package/static/chunk-RTHDK2Z7.js +1 -0
  38. package/static/chunk-RTRJ3KFH.js +1 -0
  39. package/static/chunk-SDYSHQI5.js +1 -0
  40. package/static/chunk-TECWTVNM.js +1 -0
  41. package/static/chunk-TJICEVPI.js +1 -0
  42. package/static/chunk-UILGGLKW.js +1 -0
  43. package/static/{chunk-E27KCFP6.js → chunk-VCXIQZT4.js} +3 -3
  44. package/static/chunk-W37K2YDS.js +1 -0
  45. package/static/chunk-WA2KMN23.js +1 -0
  46. package/static/chunk-X7LCJ4LA.js +1 -0
  47. package/static/chunk-XCIDAKI5.js +1 -0
  48. package/static/chunk-ZGLYEYWA.js +1 -0
  49. package/static/index.html +2 -2
  50. package/static/main-64E5RI2M.js +10 -0
  51. package/static/{scripts-MQMRSPYD.js → scripts-263WP5VB.js} +2 -2
  52. package/static/{styles-TJJDSCD4.css → styles-3DONJ2Z4.css} +1 -1
  53. package/sync-in-server.js +24 -0
  54. package/static/assets/mimes/7zip.svg +0 -14
  55. package/static/assets/mimes/application-7zip.svg +0 -14
  56. package/static/assets/mimes/application-atom+xml.svg +0 -15
  57. package/static/assets/mimes/application-gzip.svg +0 -16
  58. package/static/assets/mimes/application-mathml+xml.svg +0 -188
  59. package/static/assets/mimes/application-mp4.svg +0 -18
  60. package/static/assets/mimes/application-msexcel.svg +0 -1
  61. package/static/assets/mimes/application-msword-template.svg +0 -1
  62. package/static/assets/mimes/application-pgp-encrypted.svg +0 -16
  63. package/static/assets/mimes/application-pgp-keys.svg +0 -16
  64. package/static/assets/mimes/application-pgp-signature.svg +0 -16
  65. package/static/assets/mimes/application-powerpoint.svg +0 -1
  66. package/static/assets/mimes/application-rdf+xml.svg +0 -14
  67. package/static/assets/mimes/application-rss+xml.svg +0 -15
  68. package/static/assets/mimes/application-rtf.svg +0 -14
  69. package/static/assets/mimes/application-text.svg +0 -14
  70. package/static/assets/mimes/application-vnd.ms-excel.sheet.binary.macroenabled.12.svg +0 -1
  71. package/static/assets/mimes/application-vnd.ms-excel.sheet.macroenabled.12.svg +0 -1
  72. package/static/assets/mimes/application-vnd.ms-excel.template.macroenabled.12.svg +0 -1
  73. package/static/assets/mimes/application-vnd.ms-powerpoint.presentation.macroenabled.12.svg +0 -1
  74. package/static/assets/mimes/application-vnd.ms-powerpoint.template.macroenabled.12.svg +0 -1
  75. package/static/assets/mimes/application-vnd.ms-word.document.macroenabled.12.svg +0 -1
  76. package/static/assets/mimes/application-vnd.ms-word.svg +0 -1
  77. package/static/assets/mimes/application-vnd.ms-word.template.macroenabled.12.svg +0 -1
  78. package/static/assets/mimes/application-vnd.mspowerpoint.svg +0 -1
  79. package/static/assets/mimes/application-vnd.oasis.opendocument.chart.svg +0 -1
  80. package/static/assets/mimes/application-vnd.oasis.opendocument.text-master.svg +0 -92
  81. package/static/assets/mimes/application-vnd.oasis.opendocument.text-web.svg +0 -18
  82. package/static/assets/mimes/application-vnd.openofficeorg.extension.svg +0 -59
  83. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.presentationml.presentation.svg +0 -1
  84. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.presentationml.slideshow.svg +0 -1
  85. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.spreadsheetml.sheet.svg +0 -1
  86. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.spreadsheetml.template.svg +0 -1
  87. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.wordprocessingml.document.svg +0 -1
  88. package/static/assets/mimes/application-vnd.openxmlformats-officedocument.wordprocessingml.template.svg +0 -1
  89. package/static/assets/mimes/application-vnd.rn-realmedia.svg +0 -18
  90. package/static/assets/mimes/application-vnd.sun.xml.calc.svg +0 -1
  91. package/static/assets/mimes/application-vnd.sun.xml.writer-global.svg +0 -1
  92. package/static/assets/mimes/application-vnd.sun.xml.writer-template.svg +0 -1
  93. package/static/assets/mimes/application-vnd.sun.xml.writer.svg +0 -1
  94. package/static/assets/mimes/application-vnd.sun.xml.writer.template.svg +0 -14
  95. package/static/assets/mimes/application-wps-office.doc.svg +0 -1
  96. package/static/assets/mimes/application-wps-office.docx.svg +0 -1
  97. package/static/assets/mimes/application-wps-office.ppt.svg +0 -1
  98. package/static/assets/mimes/application-wps-office.pptx.svg +0 -1
  99. package/static/assets/mimes/application-wps-office.xls.svg +0 -1
  100. package/static/assets/mimes/application-wps-office.xlsx.svg +0 -1
  101. package/static/assets/mimes/application-x-7zip.svg +0 -14
  102. package/static/assets/mimes/application-x-ace.svg +0 -14
  103. package/static/assets/mimes/application-x-addon.svg +0 -59
  104. package/static/assets/mimes/application-x-ar.svg +0 -16
  105. package/static/assets/mimes/application-x-arc.svg +0 -14
  106. package/static/assets/mimes/application-x-archive.svg +0 -16
  107. package/static/assets/mimes/application-x-arj.svg +0 -14
  108. package/static/assets/mimes/application-x-audacity-project.svg +0 -24
  109. package/static/assets/mimes/application-x-bzdvi.svg +0 -14
  110. package/static/assets/mimes/application-x-bzip-compressed-tar.svg +0 -14
  111. package/static/assets/mimes/application-x-class-file.svg +0 -37
  112. package/static/assets/mimes/application-x-compress-tar.svg +0 -16
  113. package/static/assets/mimes/application-x-compress.svg +0 -16
  114. package/static/assets/mimes/application-x-compressed-tar.svg +0 -14
  115. package/static/assets/mimes/application-x-core.svg +0 -20
  116. package/static/assets/mimes/application-x-cpio.svg +0 -16
  117. package/static/assets/mimes/application-x-deb.svg +0 -14
  118. package/static/assets/mimes/application-x-designer.svg +0 -48
  119. package/static/assets/mimes/application-x-egon.svg +0 -12
  120. package/static/assets/mimes/application-x-extension-html.svg +0 -18
  121. package/static/assets/mimes/application-x-font-afm.svg +0 -14
  122. package/static/assets/mimes/application-x-font-snf.svg +0 -14
  123. package/static/assets/mimes/application-x-font-speedo.svg +0 -14
  124. package/static/assets/mimes/application-x-font-type1.svg +0 -14
  125. package/static/assets/mimes/application-x-gettext-translation.svg +0 -14
  126. package/static/assets/mimes/application-x-gnome-theme-package.svg +0 -109
  127. package/static/assets/mimes/application-x-gzdvi.svg +0 -16
  128. package/static/assets/mimes/application-x-gzip.svg +0 -16
  129. package/static/assets/mimes/application-x-httpd-php.svg +0 -18
  130. package/static/assets/mimes/application-x-iso9660-image.svg +0 -292
  131. package/static/assets/mimes/application-x-java-archive.svg +0 -16
  132. package/static/assets/mimes/application-x-jokosher.svg +0 -24
  133. package/static/assets/mimes/application-x-kcachegrind.svg +0 -273
  134. package/static/assets/mimes/application-x-kcsrc.svg +0 -109
  135. package/static/assets/mimes/application-x-keepass2.svg +0 -2
  136. package/static/assets/mimes/application-x-kgetlist.svg +0 -53
  137. package/static/assets/mimes/application-x-lha.svg +0 -14
  138. package/static/assets/mimes/application-x-lzma-compressed-tar.svg +0 -16
  139. package/static/assets/mimes/application-x-lzop.svg +0 -16
  140. package/static/assets/mimes/application-x-m4.svg +0 -14
  141. package/static/assets/mimes/application-x-matroska.svg +0 -18
  142. package/static/assets/mimes/application-x-mplayer2.svg +0 -18
  143. package/static/assets/mimes/application-x-ms-application.svg +0 -306
  144. package/static/assets/mimes/application-x-msdos-program.svg +0 -306
  145. package/static/assets/mimes/application-x-msdownload.svg +0 -306
  146. package/static/assets/mimes/application-x-msi.svg +0 -306
  147. package/static/assets/mimes/application-x-mswinurl.svg +0 -18
  148. package/static/assets/mimes/application-x-mswrite.svg +0 -1
  149. package/static/assets/mimes/application-x-object.svg +0 -273
  150. package/static/assets/mimes/application-x-ole-storage.svg +0 -273
  151. package/static/assets/mimes/application-x-pak.svg +0 -16
  152. package/static/assets/mimes/application-x-perl.svg +0 -15
  153. package/static/assets/mimes/application-x-php.svg +0 -18
  154. package/static/assets/mimes/application-x-python-bytecode.svg +0 -16
  155. package/static/assets/mimes/application-x-rar.svg +0 -14
  156. package/static/assets/mimes/application-x-rpm.svg +0 -14
  157. package/static/assets/mimes/application-x-ruby.svg +0 -22
  158. package/static/assets/mimes/application-x-sh.svg +0 -17
  159. package/static/assets/mimes/application-x-shared-library-la.svg +0 -62
  160. package/static/assets/mimes/application-x-shellscript.svg +0 -17
  161. package/static/assets/mimes/application-x-shockwave-flash.svg +0 -18
  162. package/static/assets/mimes/application-x-srt.svg +0 -210
  163. package/static/assets/mimes/application-x-tar.svg +0 -16
  164. package/static/assets/mimes/application-x-tarz.svg +0 -14
  165. package/static/assets/mimes/application-x-trash.svg +0 -14
  166. package/static/assets/mimes/application-x-tzo.svg +0 -14
  167. package/static/assets/mimes/application-x-wine-extension-pdd.svg +0 -14
  168. package/static/assets/mimes/application-x-zip.svg +0 -14
  169. package/static/assets/mimes/application-x-zoo.svg +0 -14
  170. package/static/assets/mimes/application-xhtml+xml.svg +0 -18
  171. package/static/assets/mimes/application-xml.svg +0 -18
  172. package/static/assets/mimes/application-xsd.svg +0 -18
  173. package/static/assets/mimes/application-xslt+xml.svg +0 -18
  174. package/static/assets/mimes/application-zip.svg +0 -14
  175. package/static/assets/mimes/applications-java.svg +0 -14
  176. package/static/assets/mimes/archive.svg +0 -16
  177. package/static/assets/mimes/ascii.svg +0 -14
  178. package/static/assets/mimes/audio-ac3.svg +0 -24
  179. package/static/assets/mimes/audio-flac.svg +0 -24
  180. package/static/assets/mimes/audio-mpeg.svg +0 -24
  181. package/static/assets/mimes/audio-vn.rn-realmedia.svg +0 -18
  182. package/static/assets/mimes/audio-vnd.rn-realvideo.svg +0 -18
  183. package/static/assets/mimes/audio-x-adpcm.svg +0 -24
  184. package/static/assets/mimes/audio-x-aiff.svg +0 -24
  185. package/static/assets/mimes/audio-x-flac+ogg.svg +0 -24
  186. package/static/assets/mimes/audio-x-flac.svg +0 -24
  187. package/static/assets/mimes/audio-x-it.svg +0 -24
  188. package/static/assets/mimes/audio-x-monkey.svg +0 -24
  189. package/static/assets/mimes/audio-x-mpegurl.svg +0 -24
  190. package/static/assets/mimes/audio-x-wav.svg +0 -24
  191. package/static/assets/mimes/audio-x-xi.svg +0 -24
  192. package/static/assets/mimes/audio-x-xm.svg +0 -24
  193. package/static/assets/mimes/binary.svg +0 -40
  194. package/static/assets/mimes/deb.svg +0 -14
  195. package/static/assets/mimes/divx.svg +0 -18
  196. package/static/assets/mimes/document.svg +0 -14
  197. package/static/assets/mimes/emblem-package.svg +0 -16
  198. package/static/assets/mimes/eps.svg +0 -24
  199. package/static/assets/mimes/exec.svg +0 -40
  200. package/static/assets/mimes/folder-tar.svg +0 -16
  201. package/static/assets/mimes/folder_tar.svg +0 -16
  202. package/static/assets/mimes/font-otf.svg +0 -14
  203. package/static/assets/mimes/font.svg +0 -14
  204. package/static/assets/mimes/font_bitmap.svg +0 -14
  205. package/static/assets/mimes/font_truetype.svg +0 -14
  206. package/static/assets/mimes/font_type1.svg +0 -14
  207. package/static/assets/mimes/fonts-package.svg +0 -16
  208. package/static/assets/mimes/gedit-plugin.svg +0 -59
  209. package/static/assets/mimes/gnome-exe-thumbnailer-generic-x.svg +0 -306
  210. package/static/assets/mimes/gnome-exe-thumbnailer-generic.svg +0 -306
  211. package/static/assets/mimes/gnome-exe-thumbnailer-template.svg +0 -306
  212. package/static/assets/mimes/gnome-fs-executable.svg +0 -40
  213. package/static/assets/mimes/gnome-mime-application-atom+xml.svg +0 -15
  214. package/static/assets/mimes/gnome-mime-application-msexcel.svg +0 -1
  215. package/static/assets/mimes/gnome-mime-application-msword.svg +0 -1
  216. package/static/assets/mimes/gnome-mime-application-ogg.svg +0 -24
  217. package/static/assets/mimes/gnome-mime-application-pdf.svg +0 -13
  218. package/static/assets/mimes/gnome-mime-application-postscript.svg +0 -14
  219. package/static/assets/mimes/gnome-mime-application-powerpoint.svg +0 -1
  220. package/static/assets/mimes/gnome-mime-application-rss+xml.svg +0 -15
  221. package/static/assets/mimes/gnome-mime-application-rtf.svg +0 -14
  222. package/static/assets/mimes/gnome-mime-application-vnd.ms-excel.svg +0 -1
  223. package/static/assets/mimes/gnome-mime-application-vnd.ms-powerpoint.svg +0 -1
  224. package/static/assets/mimes/gnome-mime-application-vnd.ms-word.svg +0 -1
  225. package/static/assets/mimes/gnome-mime-application-vnd.mspowerpoint.svg +0 -1
  226. package/static/assets/mimes/gnome-mime-application-vnd.oasis.opendocument.formula.svg +0 -188
  227. package/static/assets/mimes/gnome-mime-application-vnd.oasis.opendocument.text-web.svg +0 -18
  228. package/static/assets/mimes/gnome-mime-application-vnd.openxmlformats-officedocument.presentationml.presentation.svg +0 -1
  229. package/static/assets/mimes/gnome-mime-application-vnd.openxmlformats-officedocument.presentationml.slideshow.svg +0 -1
  230. package/static/assets/mimes/gnome-mime-application-vnd.openxmlformats-officedocument.spreadsheetml.sheet.svg +0 -1
  231. package/static/assets/mimes/gnome-mime-application-vnd.openxmlformats-officedocument.wordprocessingml.document.svg +0 -1
  232. package/static/assets/mimes/gnome-mime-application-vnd.rn-realmedia-secure.svg +0 -18
  233. package/static/assets/mimes/gnome-mime-application-vnd.rn-realmedia-vbr.svg +0 -18
  234. package/static/assets/mimes/gnome-mime-application-vnd.rn-realmedia.svg +0 -18
  235. package/static/assets/mimes/gnome-mime-application-wps-office.doc.svg +0 -1
  236. package/static/assets/mimes/gnome-mime-application-wps-office.docx.svg +0 -1
  237. package/static/assets/mimes/gnome-mime-application-wps-office.ppt.svg +0 -1
  238. package/static/assets/mimes/gnome-mime-application-wps-office.pptx.svg +0 -1
  239. package/static/assets/mimes/gnome-mime-application-wps-office.xls.svg +0 -1
  240. package/static/assets/mimes/gnome-mime-application-wps-office.xlsx.svg +0 -1
  241. package/static/assets/mimes/gnome-mime-application-x-7z-compressed.svg +0 -14
  242. package/static/assets/mimes/gnome-mime-application-x-7zip.svg +0 -14
  243. package/static/assets/mimes/gnome-mime-application-x-archive.svg +0 -16
  244. package/static/assets/mimes/gnome-mime-application-x-arj.svg +0 -16
  245. package/static/assets/mimes/gnome-mime-application-x-bittorrent.svg +0 -53
  246. package/static/assets/mimes/gnome-mime-application-x-bzip-compressed-tar.svg +0 -16
  247. package/static/assets/mimes/gnome-mime-application-x-bzip-compressed.svg +0 -16
  248. package/static/assets/mimes/gnome-mime-application-x-bzip.svg +0 -16
  249. package/static/assets/mimes/gnome-mime-application-x-class-file.svg +0 -14
  250. package/static/assets/mimes/gnome-mime-application-x-compress.svg +0 -16
  251. package/static/assets/mimes/gnome-mime-application-x-compressed-tar.svg +0 -16
  252. package/static/assets/mimes/gnome-mime-application-x-cpio-compressed.svg +0 -16
  253. package/static/assets/mimes/gnome-mime-application-x-cpio.svg +0 -16
  254. package/static/assets/mimes/gnome-mime-application-x-deb.svg +0 -14
  255. package/static/assets/mimes/gnome-mime-application-x-designer.svg +0 -48
  256. package/static/assets/mimes/gnome-mime-application-x-executable.svg +0 -40
  257. package/static/assets/mimes/gnome-mime-application-x-font-afm.svg +0 -14
  258. package/static/assets/mimes/gnome-mime-application-x-font-bdf.svg +0 -14
  259. package/static/assets/mimes/gnome-mime-application-x-font-linux-psf.svg +0 -14
  260. package/static/assets/mimes/gnome-mime-application-x-font-pcf.svg +0 -14
  261. package/static/assets/mimes/gnome-mime-application-x-font-sunos-news.svg +0 -14
  262. package/static/assets/mimes/gnome-mime-application-x-font-ttf.svg +0 -14
  263. package/static/assets/mimes/gnome-mime-application-x-glade.svg +0 -48
  264. package/static/assets/mimes/gnome-mime-application-x-gnome-app-info.svg +0 -109
  265. package/static/assets/mimes/gnome-mime-application-x-gnome-theme-package.svg +0 -109
  266. package/static/assets/mimes/gnome-mime-application-x-gzip.svg +0 -16
  267. package/static/assets/mimes/gnome-mime-application-x-gzpostscript.svg +0 -14
  268. package/static/assets/mimes/gnome-mime-application-x-jar.svg +0 -16
  269. package/static/assets/mimes/gnome-mime-application-x-java.svg +0 -14
  270. package/static/assets/mimes/gnome-mime-application-x-killustrator.svg +0 -12
  271. package/static/assets/mimes/gnome-mime-application-x-lha.svg +0 -16
  272. package/static/assets/mimes/gnome-mime-application-x-lhz.svg +0 -16
  273. package/static/assets/mimes/gnome-mime-application-x-lzma-compressed-tar.svg +0 -16
  274. package/static/assets/mimes/gnome-mime-application-x-lzma.svg +0 -16
  275. package/static/assets/mimes/gnome-mime-application-x-ms-dos-executable.svg +0 -306
  276. package/static/assets/mimes/gnome-mime-application-x-perl.svg +0 -15
  277. package/static/assets/mimes/gnome-mime-application-x-php.svg +0 -18
  278. package/static/assets/mimes/gnome-mime-application-x-python-bytecode.svg +0 -16
  279. package/static/assets/mimes/gnome-mime-application-x-rar.svg +0 -14
  280. package/static/assets/mimes/gnome-mime-application-x-rpm.svg +0 -14
  281. package/static/assets/mimes/gnome-mime-application-x-ruby.svg +0 -22
  282. package/static/assets/mimes/gnome-mime-application-x-shellscript.svg +0 -17
  283. package/static/assets/mimes/gnome-mime-application-x-shockwave-flash.svg +0 -18
  284. package/static/assets/mimes/gnome-mime-application-x-stuffit.svg +0 -16
  285. package/static/assets/mimes/gnome-mime-application-x-tar.svg +0 -16
  286. package/static/assets/mimes/gnome-mime-application-x-tarz.svg +0 -16
  287. package/static/assets/mimes/gnome-mime-application-x-tex.svg +0 -79
  288. package/static/assets/mimes/gnome-mime-application-x-theme.svg +0 -109
  289. package/static/assets/mimes/gnome-mime-application-x-zip.svg +0 -14
  290. package/static/assets/mimes/gnome-mime-application-xhtml+xml.svg +0 -18
  291. package/static/assets/mimes/gnome-mime-application-xml.svg +0 -18
  292. package/static/assets/mimes/gnome-mime-application-zip.svg +0 -14
  293. package/static/assets/mimes/gnome-mime-application.svg +0 -40
  294. package/static/assets/mimes/gnome-mime-audio.svg +0 -24
  295. package/static/assets/mimes/gnome-mime-image-vnd.adobe.photoshop.svg +0 -14
  296. package/static/assets/mimes/gnome-mime-image-x-cmu-raster.svg +0 -12
  297. package/static/assets/mimes/gnome-mime-image-x-killustrator.svg +0 -12
  298. package/static/assets/mimes/gnome-mime-image-x-psd.svg +0 -14
  299. package/static/assets/mimes/gnome-mime-image-x-xpixmap.svg +0 -12
  300. package/static/assets/mimes/gnome-mime-image.svg +0 -12
  301. package/static/assets/mimes/gnome-mime-text-html.svg +0 -18
  302. package/static/assets/mimes/gnome-mime-text-install.svg +0 -20
  303. package/static/assets/mimes/gnome-mime-text-plain.svg +0 -14
  304. package/static/assets/mimes/gnome-mime-text-vnd.wap.wml.svg +0 -18
  305. package/static/assets/mimes/gnome-mime-text-x-changelog.svg +0 -208
  306. package/static/assets/mimes/gnome-mime-text-x-copying.svg +0 -17
  307. package/static/assets/mimes/gnome-mime-text-x-csh.svg +0 -17
  308. package/static/assets/mimes/gnome-mime-text-x-gtkrc.svg +0 -109
  309. package/static/assets/mimes/gnome-mime-text-x-install.svg +0 -17
  310. package/static/assets/mimes/gnome-mime-text-x-java-source.svg +0 -14
  311. package/static/assets/mimes/gnome-mime-text-x-java.svg +0 -14
  312. package/static/assets/mimes/gnome-mime-text-x-makefile.svg +0 -176
  313. package/static/assets/mimes/gnome-mime-text-x-opml+xml.svg +0 -15
  314. package/static/assets/mimes/gnome-mime-text-x-opml.svg +0 -15
  315. package/static/assets/mimes/gnome-mime-text-x-python.svg +0 -16
  316. package/static/assets/mimes/gnome-mime-text-x-readme.svg +0 -15
  317. package/static/assets/mimes/gnome-mime-text-x-sh.svg +0 -17
  318. package/static/assets/mimes/gnome-mime-text-x-zsh.svg +0 -17
  319. package/static/assets/mimes/gnome-mime-text.svg +0 -14
  320. package/static/assets/mimes/gnome-mime-video-x-ms-asf.svg +0 -18
  321. package/static/assets/mimes/gnome-mime-video-x-ms-wmv.svg +0 -18
  322. package/static/assets/mimes/gnome-mime-video.svg +0 -18
  323. package/static/assets/mimes/gnome-mime-x-font-afm.svg +0 -14
  324. package/static/assets/mimes/gnome-mime-x-install.svg +0 -20
  325. package/static/assets/mimes/gnome-package.svg +0 -16
  326. package/static/assets/mimes/html.svg +0 -18
  327. package/static/assets/mimes/image-gif.svg +0 -12
  328. package/static/assets/mimes/image-jpeg.svg +0 -12
  329. package/static/assets/mimes/image-png.svg +0 -12
  330. package/static/assets/mimes/image-svg+xml-compressed.svg +0 -12
  331. package/static/assets/mimes/image-svg+xml.svg +0 -12
  332. package/static/assets/mimes/image-vnd.adobe.photoshop.svg +0 -14
  333. package/static/assets/mimes/image-vnd.microsoft.icon.svg +0 -12
  334. package/static/assets/mimes/image-x-psdimage-x-psd.svg +0 -14
  335. package/static/assets/mimes/image-x-xfig.svg +0 -12
  336. package/static/assets/mimes/image.svg +0 -12
  337. package/static/assets/mimes/internet-feed.svg +0 -15
  338. package/static/assets/mimes/libpeas-plugin.svg +0 -59
  339. package/static/assets/mimes/libreoffice-database.svg +0 -155
  340. package/static/assets/mimes/libreoffice-extension.svg +0 -59
  341. package/static/assets/mimes/libreoffice-extensionn.svg +0 -59
  342. package/static/assets/mimes/libreoffice-formula.svg +0 -188
  343. package/static/assets/mimes/libreoffice-oasis-formula.svg +0 -188
  344. package/static/assets/mimes/libreoffice34-extension.svg +0 -59
  345. package/static/assets/mimes/media-audio.svg +0 -24
  346. package/static/assets/mimes/media-video.svg +0 -18
  347. package/static/assets/mimes/mime-ascii.svg +0 -14
  348. package/static/assets/mimes/mime_ascii.svg +0 -14
  349. package/static/assets/mimes/misc.svg +0 -14
  350. package/static/assets/mimes/multipart-encrypted.svg +0 -273
  351. package/static/assets/mimes/music.svg +0 -24
  352. package/static/assets/mimes/none.svg +0 -110
  353. package/static/assets/mimes/openofficeorg3-extension.svg +0 -59
  354. package/static/assets/mimes/package.svg +0 -16
  355. package/static/assets/mimes/package_editors.svg +0 -14
  356. package/static/assets/mimes/pdf.svg +0 -13
  357. package/static/assets/mimes/preferences-certificate.svg +0 -28
  358. package/static/assets/mimes/preferences-plugin.svg +0 -59
  359. package/static/assets/mimes/rar.svg +0 -14
  360. package/static/assets/mimes/raw.svg +0 -12
  361. package/static/assets/mimes/scii.svg +0 -14
  362. package/static/assets/mimes/shellscript.svg +0 -17
  363. package/static/assets/mimes/sound.svg +0 -24
  364. package/static/assets/mimes/stock_certificate.svg +0 -28
  365. package/static/assets/mimes/stock_new-formula.svg +0 -188
  366. package/static/assets/mimes/stock_new-html.svg +0 -18
  367. package/static/assets/mimes/stock_script.svg +0 -17
  368. package/static/assets/mimes/stock_scripts.svg +0 -17
  369. package/static/assets/mimes/tar.svg +0 -16
  370. package/static/assets/mimes/text-css.svg +0 -18
  371. package/static/assets/mimes/text-enriched.svg +0 -14
  372. package/static/assets/mimes/text-htmlh.svg +0 -18
  373. package/static/assets/mimes/text-javascript.svg +0 -6
  374. package/static/assets/mimes/text-mht.svg +0 -18
  375. package/static/assets/mimes/text-plain.svg +0 -14
  376. package/static/assets/mimes/text-x-bibtex.svg +0 -79
  377. package/static/assets/mimes/text-x-gtkrc.svg +0 -109
  378. package/static/assets/mimes/text-x-java-source.svg +0 -14
  379. package/static/assets/mimes/text-x-lua.svg +0 -14
  380. package/static/assets/mimes/text-x-nfo.svg +0 -14
  381. package/static/assets/mimes/text-x-opml+xml.svg +0 -15
  382. package/static/assets/mimes/text-x-opml.svg +0 -15
  383. package/static/assets/mimes/text-x-tex.svg +0 -79
  384. package/static/assets/mimes/text-x-vala.svg +0 -14
  385. package/static/assets/mimes/text-x.svg +0 -14
  386. package/static/assets/mimes/text-xmcd.svg +0 -358
  387. package/static/assets/mimes/text.svg +0 -14
  388. package/static/assets/mimes/text2.svg +0 -14
  389. package/static/assets/mimes/tgz.svg +0 -16
  390. package/static/assets/mimes/txt.svg +0 -14
  391. package/static/assets/mimes/txt2.svg +0 -14
  392. package/static/assets/mimes/uri-mms.svg +0 -18
  393. package/static/assets/mimes/uri-mmst.svg +0 -18
  394. package/static/assets/mimes/uri-mmsu.svg +0 -18
  395. package/static/assets/mimes/uri-pnm.svg +0 -18
  396. package/static/assets/mimes/uri-rtspt.svg +0 -18
  397. package/static/assets/mimes/uri-rtspu.svg +0 -18
  398. package/static/assets/mimes/video-quicktime.svg +0 -18
  399. package/static/assets/mimes/video-vivo.svg +0 -18
  400. package/static/assets/mimes/video-wavelet.svg +0 -18
  401. package/static/assets/mimes/video-webm.svg +0 -18
  402. package/static/assets/mimes/video-x-anim.svg +0 -18
  403. package/static/assets/mimes/video-x-flic.svg +0 -18
  404. package/static/assets/mimes/video-x-google-vlc-plugin.svg +0 -18
  405. package/static/assets/mimes/video-x-javafx.svg +0 -18
  406. package/static/assets/mimes/video-x-matroska.svg +0 -18
  407. package/static/assets/mimes/video-x-mng.svg +0 -18
  408. package/static/assets/mimes/video-x-ms-asf-plugin.svg +0 -18
  409. package/static/assets/mimes/video-x-ms-asf.svg +0 -18
  410. package/static/assets/mimes/video-x-ms-wmp.svg +0 -18
  411. package/static/assets/mimes/video-x-ms-wmv.svg +0 -18
  412. package/static/assets/mimes/video-x-nsv.svg +0 -18
  413. package/static/assets/mimes/video-x-sgi-movie.svg +0 -18
  414. package/static/assets/mimes/video-x-theora+ogg.svg +0 -18
  415. package/static/assets/mimes/video-x-wmv.svg +0 -18
  416. package/static/assets/mimes/video.svg +0 -18
  417. package/static/assets/mimes/www.svg +0 -18
  418. package/static/assets/mimes/x-kde-nsplugin-generated.svg +0 -59
  419. package/static/assets/mimes/zip.svg +0 -14
  420. package/static/chunk-2CQOSX2Q.js +0 -1
  421. package/static/chunk-2QEYCCHN.js +0 -1
  422. package/static/chunk-2SX3MVH3.js +0 -1
  423. package/static/chunk-2XXS272C.js +0 -1
  424. package/static/chunk-3RLZPQMJ.js +0 -1
  425. package/static/chunk-5JDPARJT.js +0 -4
  426. package/static/chunk-5OIPLRAE.js +0 -1
  427. package/static/chunk-7U66TR6P.js +0 -1
  428. package/static/chunk-AA6ZTGRW.js +0 -1
  429. package/static/chunk-AXITQYVN.js +0 -24
  430. package/static/chunk-AYEOHGUD.js +0 -1
  431. package/static/chunk-CTWOQLAR.js +0 -1
  432. package/static/chunk-DVHXFWN7.js +0 -1
  433. package/static/chunk-EWY4ALVF.js +0 -1
  434. package/static/chunk-FBG4NUDE.js +0 -1
  435. package/static/chunk-FPEGN42P.js +0 -564
  436. package/static/chunk-GAL4ENT6.js +0 -1
  437. package/static/chunk-GI2LXVWQ.js +0 -1
  438. package/static/chunk-HDDBV3QQ.js +0 -4
  439. package/static/chunk-HQC3W7BS.js +0 -1
  440. package/static/chunk-LHKO5Y4A.js +0 -1
  441. package/static/chunk-NCIAR3N4.js +0 -7
  442. package/static/chunk-R4USKWW6.js +0 -1
  443. package/static/chunk-RGONEEJE.js +0 -1
  444. package/static/chunk-TFBTBTPR.js +0 -1
  445. package/static/chunk-UGSGMP2I.js +0 -1
  446. package/static/chunk-VBWPPICY.js +0 -1
  447. package/static/chunk-VIL6L67B.js +0 -1
  448. package/static/chunk-WA3LPP4G.js +0 -1
  449. package/static/chunk-WQPVP63E.js +0 -1
  450. package/static/chunk-Y6IYSEKU.js +0 -1
  451. package/static/chunk-ZS5YIDNI.js +0 -1
  452. package/static/chunk-ZSMTUPAP.js +0 -1
  453. package/static/chunk-ZZGFGD5E.js +0 -1
  454. package/static/main-7IVUWYWM.js +0 -10
@@ -1 +0,0 @@
1
- import{a as vt,c as yt,d as L,e as J,g as bt}from"./chunk-2SX3MVH3.js";import{a as _t,b as kt}from"./chunk-2CQOSX2Q.js";import{f as Ct}from"./chunk-Y6IYSEKU.js";import{f as ft,g as St,h as gt}from"./chunk-ZZGFGD5E.js";import{A as Xe,Da as he,Ea as N,Fa as O,Ga as st,Ia as at,Na as de,Pa as ue,R as Q,Sb as B,Wa as lt,gb as ct,ib as pt,ob as mt,pa as x,qb as ht,sa as rt,tb as dt,v as We,w as Ge,y as Ze,yb as ut,z as Ye}from"./chunk-HDDBV3QQ.js";import{d as G}from"./chunk-UGSGMP2I.js";import{$d as Qe,$f as me,Ad as X,Bb as q,Bd as qe,Ce as et,Dd as z,Eb as w,Ec as Le,Fb as u,Fe as tt,G as ie,He as it,L as Ce,Le as nt,Mc as W,Qb as l,Rb as $,Sa as a,Sb as T,Tb as Ae,Ub as ae,Vb as le,Wb as ce,Xa as I,Xc as Te,Xd as ze,Yc as De,Zb as we,_c as Z,ab as K,ad as Ne,ag as ot,bc as _,bd as Re,bg as D,ca as R,cd as pe,dc as k,ed as f,f as _e,fa as ve,fb as S,fd as Pe,gd as Fe,ha as y,hd as Me,jd as $e,kd as Oe,lb as c,ld as Be,mb as Ie,md as He,nb as j,nd as Ue,oa as ye,ob as re,od as je,p as U,pa as P,pb as M,pe as Je,qa as F,rb as g,rc as xe,sb as Ee,sd as Ve,t as ke,tb as oe,td as Ke,ub as se,ud as Y,v,vb as o,wa as ne,wb as s,xa as be,xb as d}from"./chunk-FPEGN42P.js";import{a as C,b as A,c as ge}from"./chunk-GAL4ENT6.js";function Ft(n,p){if(n&1&&d(0,"fa-icon",2),n&2){let e=u();re(e.repository.class),Ie("min-width",e.galleryMode.dimensions/3,"px")("min-height",e.galleryMode.dimensions/3,"px")("font-size",e.galleryMode.faSize/1.8,"px"),c("icon",e.repository.icon)}}function Mt(n,p){if(n&1&&d(0,"fa-icon",5),n&2){let e=u(2);re(e.repository.class),c("icon",e.repository.icon)}}function $t(n,p){if(n&1&&(l(0),_(1,"translate")),n&2){let e=u(2);T(" ",k(1,1,e.repository.label,e.locale.language)," ")}}function Ot(n,p){if(n&1&&l(0),n&2){let e=u(2);T(" ",e.repository.label," ")}}function Bt(n,p){if(n&1&&(o(0,"div",1),S(1,Mt,1,3,"fa-icon",3),o(2,"span",4),S(3,$t,2,4)(4,Ot,1,1),s()()),n&2){let e=u();a(),g(e.showIcon?1:-1),a(2),g(e.repository.translate?3:4)}}var Et=(()=>{class n{constructor(e,i){this.locale=e,this.layout=i,this.showIcon=!0,this.showFullPath=!1,this.unknownRepository={icon:et,label:"",class:"circle-primary-icon",translate:!1}}ngOnInit(){this.setRepository()}ngOnChanges(){this.setRepository()}setRepository(){this.share.parent?.id||this.share.parent?.id===0?this.repository={icon:N.SHARES,label:this.share.parent.name,class:"circle-purple-icon",translate:!1}:this.share.file?.ownerId?this.repository={icon:N.PERSONAL,label:he.PERSONAL_FILES,class:"circle-primary-icon",translate:!0}:this.share.file?.space?.alias?this.repository={icon:N.SPACES,label:`${this.share.file.space.name}`,class:"circle-primary-icon",translate:!1}:this.share.externalPath?this.repository={icon:N.EXTERNAL,label:"External",class:"circle-primary-icon",translate:!0}:this.repository=C({},this.unknownRepository),this.showFullPath&&this.setFullPath()}setFullPath(){if(!this.repository.label)return;let e=this.share.file?.path?this.share.file.path.split("/").filter(i=>i&&i!=="."):[];this.share.parent?.id&&!this.share.file?.id&&this.share.file?.path.indexOf("/")===-1?e.shift():this.share.file?.space?.alias&&this.share.file.space?.root?.alias&&(e.length?e.unshift(this.share.file.space.root.name):e.push(this.share.file.space.root.name)),this.repository.label===he.PERSONAL_FILES&&(this.repository.label=this.layout.translateString(this.repository.label)),e.length&&(this.repository.label=`${this.repository.label}/${e.join("/")}`)}static{this.\u0275fac=function(i){return new(i||n)(I(Y),I(B))}}static{this.\u0275cmp=K({type:n,selectors:[["app-share-repository"]],inputs:{share:"share",galleryMode:"galleryMode",showIcon:"showIcon",showFullPath:"showFullPath"},features:[ye],decls:2,vars:1,consts:[[3,"icon","class","min-width","min-height","font-size"],[1,"d-flex","align-items-center"],[3,"icon"],[1,"me-2",3,"icon","class"],["draggable","false",1,"no-pointer-events"],[1,"me-2",3,"icon"]],template:function(i,t){i&1&&S(0,Ft,1,9,"fa-icon",0)(1,Bt,5,2,"div",1),i&2&&g(t.galleryMode?0:1)},dependencies:[X,z],encapsulation:2})}}return n})();var h={BASE:`${Q}/shares`,LIST:"list",CHILDREN:"children",LINKS:"links",LINKS_LIST:"links/list",LINKS_UUID:"links/uuid"},At=`${h.BASE}/${h.LIST}`,V=`${h.BASE}/${h.LINKS}`,wt=`${h.BASE}/${h.LINKS_LIST}`,xt=`${h.BASE}/${h.LINKS_UUID}`;var Lt=(()=>{class n{constructor(e,i){this.http=e,this.router=i}getShare(e){return this.http.get(`${h.BASE}/${e}`).pipe(v(i=>new L(i)))}createShare(e){return this.http.post(h.BASE,e).pipe(v(i=>new L(i)))}updateShare(e){return this.http.put(`${h.BASE}/${e.id}`,e).pipe(v(i=>new L(i)))}deleteShare(e){return this.http.delete(`${h.BASE}/${e}`)}listShares(){return this.http.get(At)}getShareChild(e,i){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}/${i}`).pipe(v(t=>new L(t)))}updateShareChild(e,i,t){return this.http.put(`${h.BASE}/${e}/${h.CHILDREN}/${i}`,t).pipe(v(r=>new L(r)))}deleteShareChild(e,i){return this.http.delete(`${h.BASE}/${e}/${h.CHILDREN}/${i}`)}listChildShares(e){return this.http.get(`${h.BASE}/${e}/${h.CHILDREN}`)}initShareFromFile(e,i,t=!1,r=!1){let m,b=null,E=C({id:0,name:"",createdAt:new Date,modifiedAt:new Date,enabled:!0},t?{parent:{id:0,ownerId:0,alias:i.space.alias,name:i.space.name}}:{});if(i){r&&(b=i.root.id);let Se=null;(i?.root?.owner.login===e.login||!i?.space?.alias)&&(i.space=null,Se=e.id),m=new L(A(C({},E),{name:i.name,file:A(C({},i),{path:r?".":lt(i.path,2),ownerId:Se})}))}else m=new L(E);return[m,b]}goTo(e){if(!e.id)return ke(U(!1));if(e.externalPath&&!e.parent?.id)return this.router.navigate([O.SPACES_SHARES],{queryParams:{select:e.name}});if(e.parent?.id&&!e.file?.id&&e.file?.path.indexOf("/")===-1)return this.router.navigate([O.SPACES_SHARES],{queryParams:{select:e.parent.name}});{let[i,t]=yt(e);return this.router.navigate([i],{queryParams:{select:t}})}}static{this.\u0275fac=function(i){return new(i||n)(y(W),y(G))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var H={BASE:`${Q}/link`,LINK:"link",VALIDATION:"validation",ACCESS:"access",AUTH:"auth"},Tt=`${H.BASE}/${H.VALIDATION}`,fe=`${H.BASE}/${H.ACCESS}`,Dt=`${H.BASE}/${H.AUTH}`;var Nt=new ve("WindowToken",typeof window<"u"&&window.document?{providedIn:"root",factory:()=>window}:{providedIn:"root",factory:()=>{}});var Rt=(()=>{class n{constructor(e,i,t){this.ngZone=e,this.document=i,this.window=t,this.copySubject=new _e,this.copyResponse$=this.copySubject.asObservable(),this.config={}}configure(e){this.config=e}copy(e){if(!this.isSupported||!e)return this.pushCopyResponse({isSuccess:!1,content:e});let i=this.copyFromContent(e);return i?this.pushCopyResponse({content:e,isSuccess:i}):this.pushCopyResponse({isSuccess:!1,content:e})}get isSupported(){return!!this.document.queryCommandSupported&&!!this.document.queryCommandSupported("copy")&&!!this.window}isTargetValid(e){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){if(e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');return!0}throw new Error("Target should be input or textarea")}copyFromInputElement(e,i=!0){try{this.selectTarget(e);let t=this.copyText();return this.clearSelection(i?e:void 0,this.window),t&&this.isCopySuccessInIE11()}catch{return!1}}isCopySuccessInIE11(){let e=this.window.clipboardData;return!(e&&e.getData&&!e.getData("Text"))}copyFromContent(e,i=this.document.body){if(this.tempTextArea&&!i.contains(this.tempTextArea)&&this.destroy(this.tempTextArea.parentElement||void 0),!this.tempTextArea){this.tempTextArea=this.createTempTextArea(this.document,this.window);try{i.appendChild(this.tempTextArea)}catch{throw new Error("Container should be a Dom element")}}this.tempTextArea.value=e;let t=this.copyFromInputElement(this.tempTextArea,!1);return this.config.cleanUpAfterCopy&&this.destroy(this.tempTextArea.parentElement||void 0),t}destroy(e=this.document.body){this.tempTextArea&&(e.removeChild(this.tempTextArea),this.tempTextArea=void 0)}selectTarget(e){return e.select(),e.setSelectionRange(0,e.value.length),e.value.length}copyText(){return this.document.execCommand("copy")}clearSelection(e,i){e&&e.focus(),i.getSelection()?.removeAllRanges()}createTempTextArea(e,i){let t=e.documentElement.getAttribute("dir")==="rtl",r;r=e.createElement("textarea"),r.style.fontSize="12pt",r.style.border="0",r.style.padding="0",r.style.margin="0",r.style.position="absolute",r.style[t?"right":"left"]="-9999px";let m=i.pageYOffset||e.documentElement.scrollTop;return r.style.top=m+"px",r.setAttribute("readonly",""),r}pushCopyResponse(e){this.copySubject.observers.length>0&&this.ngZone.run(()=>{this.copySubject.next(e)})}pushCopyReponse(e){this.pushCopyResponse(e)}}return n.\u0275fac=function(e){return new(e||n)(y(be),y(xe),y(Nt,8))},n.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();var Pt=(()=>{class n{constructor(e,i,t,r,m){this.router=e,this.http=i,this.layout=t,this.authService=r,this.clipboard=m}shareLinksList(){return this.http.get(wt).pipe(v(e=>e.map(i=>new J(i))))}shareLink(e){return this.http.get(`${V}/${e}`).pipe(v(i=>new J(i)))}shareLinkChild(e,i){return this.http.get(`${V}/${e}/${h.CHILDREN}/${i}`).pipe(v(t=>new J(t)))}linkFromSpaceOrShare(e,i,t){return this.http.get(`${V}/${e}/${t}/${i}`)}linkValidation(e){return this.http.get(`${Tt}/${e}`).pipe(v(i=>i.ok?i.link:(i.error&&(i.error===me.UNAUTHORIZED?this.router.navigate([`${D.LINK}/${e}/${D.AUTH}`]).catch(t=>console.error(t)):this.router.navigate([`${D.LINK}/${e}/${i.error}`]).catch(t=>console.error(t))),!1)),ie(()=>(this.authService.logout(),U(!1))))}linkAccess(e,i){i.share?.isDir||i.space?.alias?this.http.get(`${fe}/${e}`).subscribe(t=>{this.authService.initUserFromResponse(t),i.space?this.router.navigate([O.SPACES],{queryParams:{select:i.space.name}}).catch(r=>console.error(r)):this.router.navigate([O.SPACES_SHARES],{queryParams:{select:i.share.name}}).catch(r=>console.error(r))}):pt(`${fe}/${e}`)}linkAuthentication(e,i){return this.http.post(`${Dt}/${e}`,{password:i}).pipe(v(t=>(this.authService.initUserFromResponse(t),this.router.navigate([`${D.LINK}/${e}`]).catch(r=>console.error(r)),!0)),ie(t=>(t.error.message===me.UNAUTHORIZED?this.layout.sendNotification("warning","Link","Bad password"):this.router.navigate([`${D.LINK}/${e}/${t.error.message}`]).catch(r=>console.error(r)),U(!1))))}copyLinkToClipboard(e){this.clipboard.copyFromContent(this.genLink(e))}genUUID(){return this.http.get(xt).pipe(v(e=>e.uuid))}createLinkDialog(e){this.genUUID().subscribe(i=>{let t=this.layout.openDialog(te,"md",{initialState:{link:{name:e.name,uuid:i,isActive:!0,nbAccess:0}}});this.subscribeToSubmitLinkModal(t,e)})}updateLinkFromSpaceOrShare(e,i,t,r){return this.http.put(`${V}/${e}/${t}/${i}`,r)}editLinkDialog(e,i,t){if(i.id===0||e?.linkSettings?.uuid){let r=this.layout.openDialog(te,"md",{initialState:{link:e.linkSettings}});this.subscribeToSubmitLinkModal(r,i,e)}else this.linkFromSpaceOrShare(e.linkId,i.id,t).subscribe({next:r=>{let m=this.layout.openDialog(te,"md",{initialState:{link:A(C({},r),{permissions:e.permissions})}});this.subscribeToSubmitLinkModal(m,i,e)},error:r=>this.layout.sendNotification("error","Link error",e.name||i.name,r)})}shareLinkGuestToMember(e,i,t){return new dt({id:e,linkId:i,name:t.name,description:t.email,createdAt:t.createdAt,permissions:t.permissions,type:at.LINK,spaceRole:rt.IS_MEMBER,linkSettings:t},[x.SHARE_INSIDE,x.SHARE_OUTSIDE])}subscribeToSubmitLinkModal(e,i,t){e.content.submitEvent.pipe(Ce(1)).subscribe(r=>{if(Object.keys(r).length){let m=Object.assign(e.content.link,r),b=this.shareLinkGuestToMember(m.userId||-(i.links.length+1),t?.linkId||-(i.links.length+1),m);b.linkId?i.links=[b,...i.links.filter(E=>E.linkId!==b.linkId)]:i.links=[b,...i.links]}e.content.layout.closeDialog()})}genLink(e){return`${document.location.origin}/#/${D.LINK}/${e}`}static{this.\u0275fac=function(i){return new(i||n)(y(G),y(W),y(B),y(Ct),y(Rt))}}static{this.\u0275prov=R({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var Wt=n=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:n,showWeekNumbers:!1}),Gt=(n,p)=>p.key;function Zt(n,p){n&1&&(o(0,"span",4),l(1,"Edit link"),s())}function Yt(n,p){n&1&&(o(0,"span",4),l(1,"New link"),s())}function Xt(n,p){n&1&&d(0,"div",54)}function zt(n,p){if(n&1){let e=q();o(0,"button",53),_(1,"translate"),ce("ngModelChange",function(t){let r=P(e).$implicit,m=u(3);return le(m.permissions[r.key],t)||(m.permissions[r.key]=t),F(t)}),w("ngModelChange",function(){P(e);let t=u(3);return F(t.onPermissionChange())}),d(2,"fa-icon",50),s(),S(3,Xt,1,0,"div",54)}if(n&2){let e=p.$implicit,i=p.$index,t=p.$count,r=u(3);ae("ngModel",r.permissions[e.key]),c("tooltip",k(1,4,r.SPACES_PERMISSIONS_TEXT[e.key].text,r.locale.language)),a(2),c("icon",r.SPACES_PERMISSIONS_TEXT[e.key].icon),a(),g(i===t-1?3:-1)}}function Qt(n,p){if(n&1&&(oe(0,zt,4,7,null,null,Gt),_(2,"keyvalue")),n&2){let e=u(2);se(k(2,0,e.permissions,e.originalOrderKeyValue))}}function Jt(n,p){if(n&1&&(o(0,"div",51),d(1,"app-share-repository",55),s()),n&2){let e=u(2);a(),c("share",e.share)("showIcon",!0)("showFullPath",!0)}}function ei(n,p){if(n&1){let e=q();o(0,"div",44),d(1,"fa-icon",45),o(2,"div",46)(3,"span"),l(4),s(),o(5,"span",47),l(6),s()(),o(7,"div",48),S(8,Qt,3,3),o(9,"button",49),_(10,"translate"),w("click",function(){P(e);let t=u();return F(t.toggleRequireAuth())}),d(11,"fa-icon",50),s(),o(12,"button",49),_(13,"translate"),w("click",function(){P(e);let t=u();return F(t.copyToClipboard())}),d(14,"fa-icon",50),s()()(),S(15,Jt,2,3,"div",51),d(16,"hr",52)}if(n&2){let e=u();a(),c("icon",e.icons.links),a(3),$(e.linkForm.value.name||e.linkForm.value.shareName),a(2),$(e.linkForm.value.email),a(2),g(e.share&&e.permissions?8:-1),a(),M("btn btn-sm ",e.linkForm.value.requireAuth?"btn-success":"btn-warning",""),c("tooltip",k(10,15,"Password",e.locale.language)),a(2),c("icon",e.linkForm.value.requireAuth?e.icons.faLock:e.icons.faLockOpen),a(),M("btn btn-sm ms-2 ",e.linkWasCopied?"btn-info":"btn-secondary",""),c("tooltip",k(13,18,"Copy link",e.locale.language)),a(2),c("icon",e.linkWasCopied?e.icons.faClipboardCheck:e.icons.faClipboard),a(),g(e.share?15:-1)}}function ti(n,p){if(n&1&&(o(0,"span"),l(1),s()),n&2){let e=u();M("badge rounded-pill ",(e.share?e.share.link.nbAccess:e.link.nbAccess)>=e.linkForm.value.limitAccess?"bg-danger":"bg-success",""),a(),Ae(" ",e.share?e.share.link.nbAccess:e.link.nbAccess,"/",e.linkForm.value.limitAccess," ")}}function ii(n,p){if(n&1&&(o(0,"span",20),l(1),s()),n&2){let e=u();a(),$(e.share?e.share.link.nbAccess:e.link.nbAccess)}}function ni(n,p){if(n&1&&(o(0,"div",27)(1,"label",56),l(2,"Share name"),s(),d(3,"input",57),_(4,"translate"),s(),o(5,"div",27)(6,"label",58),l(7,"Share description"),s(),d(8,"input",59),_(9,"translate"),s()),n&2){let e=u();a(3),j("is-invalid",e.linkForm.controls.shareName.invalid),c("placeholder",k(4,4,"Share name",e.locale.language)),a(5),c("placeholder",k(9,7,"Share description",e.locale.language))}}function ri(n,p){if(n&1&&(o(0,"option",30),l(1),s()),n&2){let e=p.$implicit;c("ngValue",e),a(),$(e)}}function oi(n,p){if(n&1&&(o(0,"div",37),d(1,"app-password-strength-bar",60),s()),n&2){let e=u();a(),c("passwordToCheck",e.password)}}function si(n,p){if(n&1){let e=q();o(0,"button",61),w("click",function(){P(e);let t=u();return F(t.confirmDeletion=!0)}),l(1," Remove "),s()}if(n&2){let e=u();c("disabled",e.confirmDeletion)}}var te=(()=>{class n{constructor(e,i,t,r,m,b){this.locale=e,this.layout=i,this.userService=t,this.sharesService=r,this.linksService=m,this.spacesService=b,this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.submitEvent=new ne,this.shareChange=new ne,this.confirmDeletion=!1,this.submitted=!1,this.SPACES_PERMISSIONS_TEXT=st,this.originalOrderKeyValue=ct,this.icons={faEye:nt,faEyeSlash:Qe,links:N.LINKS,faClipboard:Je,faClipboardCheck:it,faLock:ze,faLockOpen:tt},this.languages=this.layout.getLanguages(),this.minDate=de(),this.defaultPassword=this.layout.translateString(ut),this.passwordMinLength=8,this.password="",this.linkIsExpired=!1,this.linkIsHovered=!1,this.linkWasCopied=!1,this.minDate.setDate(this.minDate.getDate()+1)}ngOnInit(){this.link?this.initLink():this.file?this.initFile():this.initShareLink(),this.linkForm.value.requireAuth&&(this.password=this.defaultPassword),this.linkForm.value.expiresAt&&this.isLinkIsExpired(this.share?this.share.link.expiresAt:this.link.expiresAt),this.linkForm.controls.expiresAt.valueChanges.subscribe(e=>this.isLinkIsExpired(e))}initFile(){let e=this.sharesService.initShareFromFile(this.userService.user,this.file,this.isSharesRepo,this.inSharesList)[0];this.share=A(C({},e),{link:{id:-1,userId:-1,uuid:"",isActive:!0,requireAuth:!1,permissions:"",nbAccess:0,limitAccess:0}}),this.linksService.genUUID().subscribe(i=>this.share.link.uuid=i),this.initShareLink(),this.onPermissionChange()}initShareLink(){this.linkForm=new pe({shareName:new f(this.share.name,Z.required),shareDescription:new f(this.share.description||""),name:new f(this.share.link?.name||""),email:new f(this.share.link?.email||"",Z.email),language:new f(this.share.link.language||null),limitAccess:new f(this.share.link.limitAccess||null),expiresAt:new f(this.share.link.expiresAt||null),requireAuth:new f(this.share.link.requireAuth||!1),permissions:new f(this.share.link.permissions),isActive:new f(this.share.link.isActive)}),this.permissions=mt(this.share.file.permissions,this.share.link.permissions,[x.SHARE_INSIDE,x.SHARE_OUTSIDE,...this.share.file.isDir?[]:[x.DELETE,x.ADD]])}initLink(){this.linkForm=new pe({shareName:new f(""),shareDescription:new f(""),name:new f(this.link.name||""),email:new f(this.link.email||"",Z.email),language:new f(this.link.language||null),limitAccess:new f(this.link.limitAccess||null),expiresAt:new f(this.link.expiresAt||null),requireAuth:new f(this.link.requireAuth||!1),permissions:new f(this.link.permissions),isActive:new f(this.link.isActive)}),this.link.id||(this.linkForm.controls.name.markAsDirty(),this.linkForm.controls.isActive.markAsDirty())}isLinkIsExpired(e){if(e==null){if(this.linkIsExpired=!1,e===null)return;this.linkForm.controls.expiresAt.setValue(null)}this.linkIsExpired=de()>=e}onPermissionChange(){let e=ht(this.permissions);this.linkForm.controls.permissions.setValue(e),e!==this.share.link.permissions?this.linkForm.controls.permissions.markAsDirty():this.linkForm.controls.permissions.markAsPristine()}toggleRequireAuth(){this.linkForm.controls.requireAuth.setValue(!this.linkForm.value.requireAuth),this.linkForm.controls.requireAuth.markAsDirty()}copyToClipboard(){this.linksService.copyLinkToClipboard(this.share?this.share.link.uuid:this.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.linkForm.value.name||this.linkForm.value.shareName),setTimeout(()=>this.linkWasCopied=!1,3e3)}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){if(this.submitted=!0,this.confirmDeletion){(this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.layout.sendNotification("success","Link deleted",this.share.link.name||this.share.name),this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:r=>{this.layout.sendNotification("error","Delete share",this.share.name,r),this.layout.closeDialog()}});return}if(this.file?.id){let i=this.share,{link:t}=i,r=ge(i,["link"]),m=A(C(C({},t),this.linkForm.value),{password:this.mustIncludePassword()?this.password:void 0});r.name=ue("shareName",m),r.description=ue("shareDescription",m);let b=this.linksService.shareLinkGuestToMember(-1,-1,m);this.sharesService.createShare(A(C({},r),{type:vt.LINK,links:[b]})).subscribe({next:E=>{this.shareChange.emit(["add",E]),this.layout.sendNotification("success","Link created",t.name||E.name),this.layout.closeDialog()},error:E=>{this.layout.sendNotification("error","Link error",this.share.name,E),this.layout.closeDialog()}});return}let e={};for(let t in this.linkForm.controls)this.linkForm.controls[t].dirty&&(e[t]=this.linkForm.controls[t].value);if(this.mustIncludePassword()&&(e.password=this.password),this.share?.id){Object.keys(e).length&&this.linksService.updateLinkFromSpaceOrShare(this.share.link.id,this.share.id,ot.SHARE,e).subscribe({next:t=>{this.share.name=this.linkForm.value.shareName,this.share.description=this.linkForm.value.shareDescription,this.share.link=Object.assign(this.share.link,t),this.share.updateTimes(),this.share.updatePermission(),this.shareChange.emit(["update",this.share]),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Link error",this.share.link.name||this.share.name,t),this.layout.closeDialog()}}),this.layout.closeDialog();return}this.submitEvent.emit(e)}mustIncludePassword(){return!!this.password.length&&this.password!==this.defaultPassword}static{this.\u0275fac=function(i){return new(i||n)(I(Y),I(B),I(ft),I(Lt),I(Pt),I(bt))}}static{this.\u0275cmp=K({type:n,selectors:[["app-link-dialog"]],inputs:{share:"share",parentSpaceId:"parentSpaceId",link:"link",file:"file",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList"},outputs:{submitEvent:"submitEvent",shareChange:"shareChange"},decls:73,vars:52,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],["autocomplete","off",3,"formGroup"],[1,"d-flex"],[1,"d-flex","flex-column","flex-grow-1"],[1,"d-flex","align-items-center","cursor-pointer","py-2",3,"mouseover","mouseleave","focus","click"],["for","link","l10nTranslate",""],["id","link",1,"ms-auto"],[1,"d-flex","align-items-center","py-2"],["for","state","l10nTranslate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","state","formControlName","isActive","type","checkbox","role","button",1,"form-check-input"],["for","access","l10nTranslate",""],["id","access",1,"ms-auto"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"d-flex","align-items-center"],["for","guestName","l10nTranslate",""],["id","guestName","formControlName","name","type","text",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between","px-0"],["for","guestEmail","l10nTranslate",""],["id","guestEmail","autocomplete","off","formControlName","email","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[1,"d-flex","align-items-center","justify-content-between"],["for","guestLanguage","l10nTranslate",""],["id","guestLanguage","formControlName","language",1,"form-control","form-select","form-select-sm","ms-auto","w-50"],[3,"ngValue"],["for","limitAccess","l10nTranslate",""],["id","limitAccess","formControlName","limitAccess","min","1","type","number",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","expiration","l10nTranslate",""],["id","expiration","formControlName","expiresAt","placement","left","type","text","bsDatepicker","",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder","bsConfig"],[1,"d-flex","align-items-center","px-0"],["for","requireAuth","translate","",1,"cursor-pointer","me-auto"],[1,"d-flex","align-items-center","d-none","d-sm-flex","mx-auto"],["id","requireAuth","formControlName","requireAuth","type","checkbox","role","button",1,"form-check-input"],["placeholder","Set a password",2,"width","45%",3,"passwordChange","isRequired","disabled","passwordMinLength","password","showGenerator"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"d-flex","flex-fill","align-items-center"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","flex-column"],[1,"fs-xxxs"],[1,"d-flex","ms-auto"],["container","body","type","button",3,"click","tooltip"],["size","lg",3,"icon"],[1,"d-flex","align-items-center","d-none","d-sm-flex","py-2"],[1,"my-2"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-0","ms-2",3,"ngModelChange","ngModel","tooltip"],[1,"vr","mx-2"],["id","file",3,"share","showIcon","showFullPath"],["for","shareName","l10nTranslate",""],["id","shareName","formControlName","shareName","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],["for","shareDescription","l10nTranslate",""],["id","shareDescription","formControlName","shareDescription","type","email",1,"form-control","form-control-sm","ms-auto","w-50",3,"placeholder"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(i,t){i&1&&(o(0,"div",0)(1,"h4",1),d(2,"fa-icon",2),o(3,"span"),l(4),s()(),o(5,"h4",3),S(6,Zt,2,0,"span",4)(7,Yt,2,0,"span",4),s(),o(8,"button",5),w("click",function(){return t.layout.closeDialog()}),s()(),o(9,"div",6),S(10,ei,17,21),o(11,"form",7)(12,"div",8)(13,"div",9)(14,"div",10),w("mouseover",function(){return t.linkIsHovered=!0})("mouseleave",function(){return t.linkIsHovered=!1})("focus",function(){return t.linkIsHovered=!0})("click",function(){return t.copyToClipboard()}),o(15,"label",11),l(16,"Link"),s(),o(17,"span",12),l(18),s()(),o(19,"div",13)(20,"label",14),l(21,"Active"),s(),o(22,"div",15),d(23,"input",16),o(24,"span"),l(25),_(26,"translate"),s()()(),o(27,"div",13)(28,"label",17),l(29,"Current access count"),s(),o(30,"span",18),S(31,ti,2,5,"span",19)(32,ii,2,1,"span",20),s()(),S(33,ni,10,10),o(34,"div",21)(35,"label",22),l(36,"Guest name"),s(),d(37,"input",23),_(38,"translate"),s(),o(39,"div",24)(40,"label",25),l(41,"Guest email"),s(),d(42,"input",26),_(43,"translate"),s(),o(44,"div",27)(45,"label",28),l(46,"Guest language"),s(),o(47,"select",29),oe(48,ri,2,2,"option",30,Ee),s()(),o(50,"div",27)(51,"label",31),l(52,"Limit access"),s(),d(53,"input",32),_(54,"translate"),s(),o(55,"div",27)(56,"label",33),l(57,"Expiration"),s(),d(58,"input",34),_(59,"translate"),s(),o(60,"div",35)(61,"label",36),l(62,"Password"),s(),S(63,oi,2,1,"div",37),o(64,"div",15),d(65,"input",38),s(),o(66,"app-input-password",39),ce("passwordChange",function(m){return le(t.password,m)||(t.password=m),m}),s()()()()()(),o(67,"div",40),S(68,si,2,1,"button",41),o(69,"button",42),w("click",function(){return t.onCancel()}),l(70,"Cancel"),s(),o(71,"button",43),w("click",function(){return t.onSubmit()}),l(72),s()()),i&2&&(a(2),c("icon",t.icons.links),a(2),$(t.linkForm.value.name||t.linkForm.value.shareName),a(2),g(t.share!=null&&t.share.id||t.link!=null&&t.link.id?6:7),a(4),g(t.share||t.link?10:-1),a(),c("formGroup",t.linkForm),a(6),j("text-primary",t.linkIsHovered),a(),T(" ",t.share?t.share.link.uuid:t.link.uuid," "),a(6),M("badge rounded-pill ms-3 ",t.linkForm.value.isActive?"bg-primary":"bg-danger",""),a(),T(" ",k(26,35,t.linkForm.value.isActive?"yes":"no",t.locale.language)," "),a(6),g(t.linkForm.value.limitAccess?31:32),a(2),g(t.share?33:-1),a(4),c("placeholder",k(38,38,"Guest name",t.locale.language)),a(5),j("is-invalid",t.linkForm.controls.email.invalid),c("placeholder",k(43,41,"Guest email",t.locale.language)),a(6),se(t.languages),a(5),c("placeholder",k(54,44,"Unlimited",t.locale.language)),a(5),j("text-danger",t.linkIsExpired),c("placeholder",k(59,47,"Unlimited",t.locale.language))("bsConfig",we(50,Wt,t.minDate)),a(5),g(t.linkForm.value.requireAuth&&t.password!==t.defaultPassword?63:-1),a(3),c("isRequired",t.linkForm.value.requireAuth)("disabled",!t.linkForm.value.requireAuth)("passwordMinLength",t.passwordMinLength),ae("password",t.password),c("showGenerator",!0),a(2),g(t.share!=null&&t.share.id?68:-1),a(3),M("btn btn-sm ",t.confirmDeletion?"btn-danger":"btn-primary",""),c("disabled",t.linkForm.invalid||t.linkForm.controls.requireAuth.value&&t.password.length<t.passwordMinLength||t.submitted),a(),T(" ",t.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[z,qe,Xe,Ze,Ye,gt,St,Ve,Fe,He,Ue,De,Me,Te,Be,Ne,Re,je,Pe,_t,Le,Ge,We,X,Ke,$e,Oe,Et,kt],encapsulation:2})}}return n})();export{Et as a,Lt as b,te as c,Rt as d,Pt as e};
@@ -1 +0,0 @@
1
- import{f as F}from"./chunk-ZZGFGD5E.js";import{Bb as h,Ma as O,Qb as C,Rb as H,Sb as k,T,W as g,eb as d,na as N,vb as u}from"./chunk-HDDBV3QQ.js";import{d as R}from"./chunk-UGSGMP2I.js";import{$ as x,G as p,Mc as A,O as _,Z as m,ca as I,ha as o,p as n,q as S,v as a}from"./chunk-FPEGN42P.js";var c=function(r){return r.ACCESS="access",r.REFRESH="refresh",r.WS="ws",r.CSRF="csrf",r}(c||{});var i=function(r){return r.BASE="/api/auth",r.LOGIN="login",r.LOGOUT="logout",r.REFRESH="refresh",r.TOKEN="token",r.TOKEN_REFRESH="token/refresh",r.WS="socket.io",r}(i||{}),P=`${i.BASE}/${i.LOGIN}`,U=`${i.BASE}/${i.LOGOUT}`,f=`${i.BASE}/${i.REFRESH}`,v=`${i.BASE}/${i.TOKEN}`,w=`${i.BASE}/${i.TOKEN_REFRESH}`,M=`/${i.WS}`;var E="sync-in-csrf";var j=[c.REFRESH,c.ACCESS,c.WS,c.CSRF];var K="Client token is expired";var l={BASE:"auth",LOGIN:"login"};var fe=(()=>{class r{constructor(e,t,s,L,b,G){this.http=e,this.router=t,this.store=s,this.userService=L,this.layout=b,this.electron=G,this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(P,{login:e,password:t}).pipe(a(s=>(this.accessExpiration=s.token.access_expiration,this.refreshExpiration=s.token.refresh_expiration,this.userService.initUser(s.user),{success:!0,message:null})),p(s=>(console.warn(s),n({success:!1,message:s.error.message||s.message}))))}loginElectron(){return this.electron.authenticate().pipe(m(e=>this.http.post(T,e).pipe(a(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.userService.initUser(t.user),t?.client_token_update&&this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),p(t=>(console.warn(t),t.error.message===K?this.electron.send(h.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(h.SERVER.AUTHENTICATION_FAILED),n(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(_(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([l.BASE,l.LOGIN]).catch(s=>console.error(s)),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(N,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([u.BASE,u.ACCOUNT]).catch(t=>console.error(t))},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.userService.initUser(e.user,t))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(f,null).pipe(a(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,console.debug("refresh token done"),!0)),p(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),S(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),n(!1)):this.store.user.getValue()?n(!0):this.http.get(g).pipe(x(t=>this.userService.initUser(t.user)),a(()=>!0),p(t=>(t.status===401?this.logout():console.warn(t),n(!1))))}checkCSRF(e){return e.headers.has(E)?e.clone({headers:e.headers.set(E,d(E))}):e}refreshTokenHasExpired(){return this.refreshExpiration===0||O()>=this.refreshExpiration}clearCookies(){return this.http.post(U,null)}static{this.\u0275fac=function(t){return new(t||r)(o(A),o(R),o(C),o(F),o(k),o(H))}}static{this.\u0275prov=I({token:r,factory:r.\u0275fac,providedIn:"root"})}}return r})();export{P as a,U as b,f as c,E as d,l as e,fe as f};
@@ -1 +0,0 @@
1
- import{e as R}from"./chunk-WQPVP63E.js";import"./chunk-2SX3MVH3.js";import"./chunk-2CQOSX2Q.js";import"./chunk-Y6IYSEKU.js";import"./chunk-ZZGFGD5E.js";import"./chunk-HDDBV3QQ.js";import{k as j,l as D}from"./chunk-ZZ3LHYOY.js";import{b as _,e as w}from"./chunk-UGSGMP2I.js";import{Ad as M,Bd as T,Dd as E,Eb as d,Ma as m,Qb as f,Sa as t,Ub as g,Vb as v,Wb as k,Xa as p,Yc as P,ab as h,ad as L,bc as b,dc as y,fd as C,fe as I,lb as n,le as U,sd as S,ud as A,vb as i,wb as o,xb as s}from"./chunk-FPEGN42P.js";import"./chunk-GAL4ENT6.js";var H=(()=>{class l{constructor(c,r,e){this.locale=c,this.activatedRoute=r,this.linksService=e,this.logoUrl=j,this.linkProtected=D,this.icons={faKey:I,faSignInAlt:U},this.password="",this.activatedRoute.params.subscribe(a=>this.uuid=a.uuid)}validPassword(){this.password&&this.linksService.linkAuthentication(this.uuid,this.password).subscribe(()=>this.password="")}static{this.\u0275fac=function(r){return new(r||l)(p(A),p(_),p(R))}}static{this.\u0275cmp=h({type:l,selectors:[["app-public-link-auth"]],decls:18,vars:10,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],["alt","","height","96",1,"cursor-pointer",3,"click","src"],[1,"d-flex","mt-2","ms-auto","me-auto",2,"width","250px"],[1,"input-group"],[1,"input-group-text","bg-gray-light"],[3,"icon"],["autocomplete","off","type","password",1,"form-control","border-0",3,"ngModelChange","keyup.enter","ngModel","placeholder"],["type","button",1,"btn","btn-default","btn-custom","border-0",3,"click","disabled"],[1,"error-text","no-select"],[1,"hr"],["l10nTranslate","",1,"solve"]],template:function(r,e){r&1&&(i(0,"div",0)(1,"div",1)(2,"a",2),s(3,"img",3),o()(),i(4,"img",4),d("click",function(){return e.validPassword()}),o(),i(5,"div",5)(6,"div",6)(7,"span",7),s(8,"fa-icon",8),o(),i(9,"input",9),b(10,"translate"),k("ngModelChange",function(u){return v(e.password,u)||(e.password=u),u}),d("keyup.enter",function(){return e.validPassword()}),o(),i(11,"button",10),d("click",function(){return e.validPassword()}),s(12,"fa-icon",8),o()()(),i(13,"div",11),s(14,"span",12),i(15,"div")(16,"span",13),f(17,"This share is protected by a password"),o()()()()),r&2&&(t(3),n("src",e.logoUrl,m),t(),n("src",e.linkProtected,m),t(4),n("icon",e.icons.faKey),t(),g("ngModel",e.password),n("placeholder",y(10,7,"Password",e.locale.language)),t(2),n("disabled",!(e.password!=null&&e.password.length)),t(),n("icon",e.icons.faSignInAlt))},dependencies:[w,S,P,L,C,E,M,T],encapsulation:2})}}return l})();export{H as PublicLinkAuthComponent};
@@ -1 +0,0 @@
1
- import{a as B}from"./chunk-2QEYCCHN.js";import{a as fe}from"./chunk-VIL6L67B.js";import{a as me}from"./chunk-5JDPARJT.js";import{a as D,b as R,c as _e,d as de}from"./chunk-WA3LPP4G.js";import"./chunk-2CQOSX2Q.js";import{f as pe}from"./chunk-ZZGFGD5E.js";import{Cb as ae,Db as le,Eb as ce,N as ne,Sb as ue,gb as oe,v as W,vb as P,wb as re,xb as se}from"./chunk-HDDBV3QQ.js";import{Ad as K,Bb as T,Bd as q,Bf as te,Dd as z,Eb as x,Ec as O,Fb as r,Ff as ie,L as $,Ma as N,Mb as G,Me as X,Nb as S,Ob as F,Oe as Y,Qb as m,Rb as U,Sa as a,Sb as y,Tb as L,Xa as A,ab as Q,bc as g,cc as M,dc as h,fb as f,fe as J,lb as d,mb as I,nb as E,ob as k,pa as p,pf as Z,qa as _,qb as H,rb as v,tb as w,ub as b,ud as j,vb as l,wb as c,wf as ee,xb as C}from"./chunk-FPEGN42P.js";import"./chunk-GAL4ENT6.js";var ge=["MainContextMenu"],ve=["TargetContextMenu"],Ce=(t,o)=>o.key,he=(t,o)=>o.id,ye=(t,o)=>o.mid;function we(t,o){if(t&1&&C(0,"fa-icon",18),t&2){let e=r(3);d("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function be(t,o){if(t&1){let e=T();l(0,"th",17),x("click",function(){p(e);let i=r().$implicit,s=r();return _(s.sortBy(i.key))}),m(1),f(2,we,1,2,"fa-icon",18),c()}if(t&2){let e=r().$implicit,n=r();k(e.value.class),I("width",e.value.width,"%"),E("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),y(" ",e.value.label," "),a(),v(n.sortTable.sortParam.column===e.key?2:-1)}}function Te(t,o){if(t&1&&f(0,be,3,11,"th",16),t&2){let e=o.$implicit;v(e.value.show?0:-1)}}function Ge(t,o){if(t&1&&(l(0,"div",21),C(1,"img",24),l(2,"div",22)(3,"span",25),m(4),c(),l(5,"span",26),m(6),c()()()),t&2){let e=r(3).$implicit;a(),d("src",e.avatarUrl,N),a(3),y(" ",e.login," "),a(2),U(e.email)}}function Se(t,o){if(t&1&&(l(0,"div",22)(1,"span",25),m(2),c()()),t&2){let e=r(3).$implicit;a(2),U(e.fullName)}}function Fe(t,o){if(t&1&&C(0,"app-user-avatar",27),t&2){let e=o.$implicit;d("user",e)("isMember",!0)}}function Ue(t,o){if(t&1&&w(0,Fe,1,2,"app-user-avatar",27,ye),t&2){let e=r(3).$implicit;b(e.managers)}}function Ve(t,o){t&1&&m(0," too many login attempts ")}function Ae(t,o){if(t&1&&m(0),t&2){let e=r(4).$implicit;y(" ",e.userIsActiveText," ")}}function Ee(t,o){if(t&1&&(l(0,"span",28),f(1,Ve,1,0)(2,Ae,1,1),c()),t&2){let e=r(3).$implicit;k(e.isActive?"text-success":"text-danger"),a(),v(!e.isActive&&e.passwordAttempts?1:2)}}function Me(t,o){if(t&1&&(m(0),g(1,"amDateFormat")),t&2){let e=r(3).$implicit;y(" ",M(1,1,e.createdAt)," ")}}function $e(t,o){if(t&1&&(l(0,"div",22)(1,"div"),m(2),g(3,"amDateFormat"),c(),l(4,"div"),m(5),g(6,"amDateFormat"),c()()),t&2){let e=r(5).$implicit;a(2),U(M(3,2,e.currentAccess)),a(3),U(M(6,4,e.lastAccess))}}function Ie(t,o){if(t&1&&m(0),t&2){let e=r(5).$implicit;y(" ",e.hTimeAgo," ")}}function ke(t,o){if(t&1){let e=T();l(0,"div",30),x("mouseover",function(){p(e);let i=r(4).$implicit;return _(i.currentAccessHover=!0)})("focus",function(){p(e);let i=r(4).$implicit;return _(i.currentAccessHover=!0)})("mouseleave",function(){p(e);let i=r(4).$implicit;return _(i.currentAccessHover=!1)}),f(1,$e,7,6,"div",22)(2,Ie,1,1),c()}if(t&2){let e=r(4).$implicit;a(),v(e.currentAccessHover?1:2)}}function Pe(t,o){t&1&&(l(0,"span",28),m(1,"never"),c())}function De(t,o){if(t&1&&f(0,ke,3,1,"div",29)(1,Pe,2,0,"span",28),t&2){let e=r(3).$implicit;v(e.currentAccess?0:1)}}function Re(t,o){if(t&1&&(l(0,"td"),f(1,Ge,7,3,"div",21)(2,Se,3,1,"div",22)(3,Ue,2,0)(4,Ee,3,4,"span",23)(5,Me,2,3)(6,De,2,1),c()),t&2){let e,n=r().$implicit,i=r().$implicit;H("",n.value.class," ",n.value.newly?"prop-newly-"+i[n.value.newly]:"",""),I("width",n.value.width,"%"),E("text-align-center",n.value.textCenter),a(),v((e=n.key)==="login"?1:e==="fullName"?2:e==="managers"?3:e==="isActive"?4:e==="createdAt"?5:e==="currentAccess"?6:-1)}}function Be(t,o){if(t&1&&f(0,Re,7,9,"td",20),t&2){let e=o.$implicit;v(e.value.show?0:-1)}}function Ne(t,o){if(t&1){let e=T();l(0,"tr",19),x("click",function(){let i=p(e).$implicit,s=r();return _(s.onSelect(i))})("contextmenu",function(i){let s=p(e).$implicit,u=r();return _(u.onTargetContextMenu(i,s))})("pressup",function(i){let s=p(e).$implicit,u=r();return _(u.onTargetContextMenu(i,s))})("tap",function(){p(e);let i=r();return _(i.openGuestDialog())}),w(1,Be,1,1,null,null,Ce),g(3,"keyvalue"),c()}if(t&2){let e=o.$implicit,n=r();E("disabled",!e.isActive)("selected",e.id===(n.selected==null?null:n.selected.id)),a(),b(h(3,4,n.tableHeaders,n.originalOrderKeyValue))}}function Qe(t,o){if(t&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"New guest"),c()),t&2){let e=r();a(),d("icon",e.icons.faPlus)}}function He(t,o){}function Le(t,o){if(t&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Refresh"),c()),t&2){let e=r();a(),d("icon",e.icons.faArrowRotateRight)}}function Oe(t,o){if(t&1&&(l(0,"span",28),C(1,"fa-icon",6),m(2,"Edit guest"),c()),t&2){let e=r();a(),d("icon",e.icons.faPen)}}var _t=(()=>{class t{constructor(e,n,i){this.locale=e,this.layout=n,this.userService=i,this.originalOrderKeyValue=oe,this.icons={faRotate:ie,faPlus:te,faPen:X,faArrowDown:Z,faArrowUp:ee,faKey:J,faArrowRotateRight:Y},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],createdAt:[{prop:"createdAt",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new de(this.constructor.name,this.sortSettings),this.canCreateGuest=this.userService.userHavePermission(ne.GUESTS_ADMIN),this.loading=!1,this.selected=null,this.guests=[],this.loadGuests(),this.layout.setBreadcrumbIcon(se.GUESTS),this.layout.setBreadcrumbNav({url:`/${P.BASE}/${P.GUESTS}/${re.GUESTS}`,splicing:2,translating:!0,sameLink:!0})}loadGuests(){this.loading=!0,this.onSelect(),this.userService.listGuests().subscribe({next:e=>{this.sortBy(this.sortTable.sortParam.column,!1,e),this.scrollView.scrollInto(-1),this.loading=!1},error:e=>{this.guests=[],this.layout.sendNotification("error","Guests",e.error.message),this.loading=!1}})}onSelect(e=null){this.selected=e}onContextMenu(e){e.preventDefault(),e.stopPropagation(),this.layout.openContextMenu(e,this.mainContextMenu)}onTargetContextMenu(e,n){e.preventDefault(),e.type==="contextmenu"&&e.stopPropagation(),this.onSelect(n),this.layout.openContextMenu(e,this.targetContextMenu)}sortBy(e,n=!0,i){this.guests=this.sortTable.sortBy(e,n,i||this.guests)}openGuestDialog(e=!1){e?this.layout.openDialog(B,"md").content.guestChange.pipe($(1)).subscribe(i=>{let[s,u]=i;s==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.guests,u]),this.onSelect(u))}):this.userService.getGuest(this.selected.id).subscribe({next:n=>{this.layout.openDialog(B,"md",{initialState:{guest:n}}).content.guestChange.pipe($(1)).subscribe(s=>{let[u,V]=s;u==="update"?this.selected=Object.assign(this.selected,V):u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.guests.filter(xe=>xe.id!==V.id)))})},error:n=>this.layout.sendNotification("error","Guest error",this.selected.fullName,n)})}static{this.\u0275fac=function(n){return new(n||t)(A(j),A(ue),A(pe))}}static{this.\u0275cmp=Q({type:t,selectors:[["app-user-guests"]],viewQuery:function(n,i){if(n&1&&(G(R,5),G(D,7),G(ge,7),G(ve,7)),n&2){let s;S(s=F())&&(i.scrollView=s.first),S(s=F())&&(i.inputFilter=s.first),S(s=F())&&(i.mainContextMenu=s.first),S(s=F())&&(i.targetContextMenu=s.first)}},decls:35,vars:32,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],["l10nTranslate",""],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(n,i){if(n&1){let s=T();l(0,"div",2)(1,"button",3),g(2,"translate"),x("click",function(){return p(s),_(i.loadGuests())}),C(3,"fa-icon",4),c(),l(4,"button",5),g(5,"translate"),x("click",function(){return p(s),_(i.openGuestDialog(!0))}),C(6,"fa-icon",6),c(),l(7,"button",5),g(8,"translate"),x("click",function(){return p(s),_(i.openGuestDialog())}),C(9,"fa-icon",6),c(),C(10,"app-input-filter",7),c(),l(11,"table",8)(12,"thead")(13,"tr"),w(14,Te,1,1,null,null,Ce),g(16,"keyvalue"),c()()(),l(17,"app-virtual-scroll",9),g(18,"searchFilter"),x("contextmenu",function(V){return p(s),_(i.onContextMenu(V))}),l(19,"table",8)(20,"tbody",10),w(21,Ne,4,7,"tr",11,he),c()()(),l(23,"div",12)(24,"span",13),m(25),g(26,"translate"),c()(),l(27,"context-menu",null,0),f(29,Qe,3,1,"ng-template",14),x("execute",function(){return p(s),_(i.openGuestDialog(!0))}),f(30,He,0,0,"ng-template",15)(31,Le,3,1,"ng-template",14),x("execute",function(){return p(s),_(i.loadGuests())}),c(),l(32,"context-menu",null,1),f(34,Oe,3,1,"ng-template",14),x("execute",function(){return p(s),_(i.openGuestDialog())}),c()}n&2&&(a(),d("tooltip",h(2,14,"Refresh",i.locale.language)),a(2),d("icon",i.icons.faRotate)("animation",i.loading?"spin":null),a(),d("disabled",!i.canCreateGuest)("tooltip",h(5,17,"New guest",i.locale.language)),a(2),d("icon",i.icons.faPlus),a(),d("disabled",!i.selected)("tooltip",h(8,20,"Edit guest",i.locale.language)),a(2),d("icon",i.icons.faPen),a(5),b(h(16,23,i.tableHeaders,i.originalOrderKeyValue)),a(3),d("bufferAmount",5)("items",h(18,26,i.guests,i.inputFilter.search())),a(4),b(i.scrollView==null?null:i.scrollView.viewPortItems),a(4),L("",i.guests.length," ",h(26,29,"guests",i.locale.language),""),a(5),d("divider",!0))},dependencies:[z,K,D,W,O,q,R,_e,me,ce,le,ae,fe],encapsulation:2})}}return t})();export{_t as UserGuestsComponent};
@@ -1 +0,0 @@
1
- import{$ as O,$a as ve,Da as ye,Ea as Y,Ib as Ee,P as ue,Pa as _e,Qb as ft,R as le,S as Rt,Sb as pt,Ua as be,V as $,X as fe,Y as pe,Z as de,_ as Ct,aa as me,ba as ge,ca as L,f as ce,rb as P,sb as Se,tb as T}from"./chunk-HDDBV3QQ.js";import{Eb as ct,G as zt,L as Zt,Lb as ne,Mc as ut,Nb as oe,Ob as ae,Od as he,W as te,Wa as re,Wc as lt,Xa as D,Xb as ht,ba as H,bb as nt,c as Xt,ca as st,cb as ot,da as rt,fa as ee,ha as _,kb as at,kc as Ot,nb as Tt,oa as ie,v as p,za as se}from"./chunk-FPEGN42P.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-GAL4ENT6.js";var ke={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var G={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var dt=class{constructor(e){this.parentGroup=e.parentGroup,this.members=e.members.map(t=>new T(t))}};var R=class{constructor(e){this.newly=0,this.currentAccessHover=!1,this.setManagers(e),Object.assign(this,e),this.avatarUrl=P(e.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,ce.default)(this.currentAccess).fromNow(!0),this.newly=ve(this.currentAccess)}setManagers(e){e?.managers&&(e.managers=e.managers.map(t=>new T(t)))}};var W=class{constructor(e){this.setOnlineStatus(_e("status",e)),this.avatarUrl=P(e.login),Object.assign(this,e)}setOnlineStatus(e){this.onlineStatus=e,this.onlineTextStatus=ue[e]}};var Gt={};Jt(Gt,{Fetch:()=>z,Manager:()=>B,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>x,WebSocket:()=>w,WebTransport:()=>C,XHR:()=>k,connect:()=>I,default:()=>I,io:()=>I,protocol:()=>$t});var y=Object.create(null);y.open="0";y.close="1";y.ping="2";y.pong="3";y.message="4";y.upgrade="5";y.noop="6";var K=Object.create(null);Object.keys(y).forEach(s=>{K[y[s]]=s});var j={type:"error",data:"parser error"};var Te=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Oe=typeof ArrayBuffer=="function",Re=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Q=({type:s,data:e},t,i)=>Te&&e instanceof Blob?t?i(e):we(e,i):Oe&&(e instanceof ArrayBuffer||Re(e))?t?i(e):we(new Blob([e]),i):i(y[s]+(e||"")),we=(s,e)=>{let t=new FileReader;return t.onload=function(){let i=t.result.split(",")[1];e("b"+(i||""))},t.readAsDataURL(s)};function Ae(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function Ce(s,e){if(Te&&s.data instanceof Blob)return s.data.arrayBuffer().then(Ae).then(e);if(Oe&&(s.data instanceof ArrayBuffer||Re(s.data)))return e(Ae(s.data));Q(s,!1,t=>{xt||(xt=new TextEncoder),e(xt.encode(t))})}var xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",J=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<xe.length;s++)J[xe.charCodeAt(s)]=s;var Ne=s=>{let e=s.length*.75,t=s.length,i,r=0,n,o,a,c;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);let b=new ArrayBuffer(e),m=new Uint8Array(b);for(i=0;i<t;i+=4)n=J[s.charCodeAt(i)],o=J[s.charCodeAt(i+1)],a=J[s.charCodeAt(i+2)],c=J[s.charCodeAt(i+3)],m[r++]=n<<2|o>>4,m[r++]=(o&15)<<4|a>>2,m[r++]=(a&3)<<6|c&63;return b};var ri=typeof ArrayBuffer=="function",X=(s,e)=>{if(typeof s!="string")return{type:"message",data:Be(s,e)};let t=s.charAt(0);return t==="b"?{type:"message",data:ni(s.substring(1),e)}:K[t]?s.length>1?{type:K[t],data:s.substring(1)}:{type:K[t]}:j},ni=(s,e)=>{if(ri){let t=Ne(s);return Be(t,e)}else return{base64:!0,data:s}},Be=(s,e)=>{switch(e){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Ie="",De=(s,e)=>{let t=s.length,i=new Array(t),r=0;s.forEach((n,o)=>{Q(n,!1,a=>{i[o]=a,++r===t&&e(i.join(Ie))})})},Le=(s,e)=>{let t=s.split(Ie),i=[];for(let r=0;r<t.length;r++){let n=X(t[r],e);if(i.push(n),n.type==="error")break}return i};function Pe(){return new TransformStream({transform(s,e){Ce(s,t=>{let i=t.length,r;if(i<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,i);else if(i<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,i)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(i))}s.data&&typeof s.data!="string"&&(r[0]|=128),e.enqueue(r),e.enqueue(t)})}})}var Nt;function mt(s){return s.reduce((e,t)=>e+t.length,0)}function gt(s,e){if(s[0].length===e)return s.shift();let t=new Uint8Array(e),i=0;for(let r=0;r<e;r++)t[r]=s[0][i++],i===s[0].length&&(s.shift(),i=0);return s.length&&i<s[0].length&&(s[0]=s[0].slice(i)),t}function Ue(s,e){Nt||(Nt=new TextDecoder);let t=[],i=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(i===0){if(mt(t)<1)break;let c=gt(t,1);n=(c[0]&128)===128,r=c[0]&127,r<126?i=3:r===126?i=1:i=2}else if(i===1){if(mt(t)<2)break;let c=gt(t,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),i=3}else if(i===2){if(mt(t)<8)break;let c=gt(t,8),b=new DataView(c.buffer,c.byteOffset,c.length),m=b.getUint32(0);if(m>Math.pow(2,21)-1){a.enqueue(j);break}r=m*Math.pow(2,32)+b.getUint32(4),i=3}else{if(mt(t)<r)break;let c=gt(t,r);a.enqueue(X(n?c:Nt.decode(c),e)),i=0}if(r===0||r>s){a.enqueue(j);break}}}})}var Bt=4;function u(s){if(s)return oi(s)}function oi(s){for(var e in u.prototype)s[e]=u.prototype[e];return s}u.prototype.on=u.prototype.addEventListener=function(s,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(e),this};u.prototype.once=function(s,e){function t(){this.off(s,t),e.apply(this,arguments)}return t.fn=e,this.on(s,t),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+s];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var i,r=0;r<t.length;r++)if(i=t[r],i===e||i.fn===e){t.splice(r,1);break}return t.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+s],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,r=t.length;i<r;++i)t[i].apply(this,e)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var v=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,t)=>t(e,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Fe="arraybuffer";function yt(s,...e){return e.reduce((t,i)=>(s.hasOwnProperty(i)&&(t[i]=s[i]),t),{})}var ai=l.setTimeout,ci=l.clearTimeout;function S(s,e){e.useNativeTimers?(s.setTimeoutFn=ai.bind(l),s.clearTimeoutFn=ci.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var hi=1.33;function Me(s){return typeof s=="string"?ui(s):Math.ceil((s.byteLength||s.size)*hi)}function ui(s){let e=0,t=0;for(let i=0,r=s.length;i<r;i++)e=s.charCodeAt(i),e<128?t+=1:e<2048?t+=2:e<55296||e>=57344?t+=3:(i++,t+=4);return t}function _t(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function Ve(s){let e="";for(let t in s)s.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(s[t]));return e}function qe(s){let e={},t=s.split("&");for(let i=0,r=t.length;i<r;i++){let n=t[i].split("=");e[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return e}var bt=class extends Error{constructor(e,t,i){super(e),this.description=t,this.context=i,this.type="TransportError"}},E=class extends u{constructor(e){super(),this.writable=!1,S(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,t,i){return super.emitReserved("error",new bt(e,t,i)),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=X(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&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){let t=Ve(e);return t.length?"?"+t:""}};var U=class extends E{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 i=0;this._polling&&(i++,this.once("pollComplete",function(){--i||t()})),this.writable||(i++,this.once("drain",function(){--i||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){let t=i=>{if(this.readyState==="opening"&&i.type==="open"&&this.onOpen(),i.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(i)};Le(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,De(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]=_t()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}};var He=!1;try{He=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var $e=He;function li(){}var It=class extends U{constructor(e){if(super(e),typeof location<"u"){let t=location.protocol==="https:",i=location.port;i||(i=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||i!==e.port}}doWrite(e,t){let i=this.request({method:"POST",data:e});i.on("success",t),i.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,i)=>{this.onError("xhr poll error",t,i)}),this.pollXhr=e}},vt=(()=>{class s extends u{constructor(t,i,r){super(),this.createRequest=t,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=i,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;let i=yt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(i);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.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=li,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.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 s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Ye);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,Ye,!1)}}function Ye(){for(let s in vt.requests)vt.requests.hasOwnProperty(s)&&vt.requests[s].abort()}var fi=function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null}(),k=class extends It{constructor(e){super(e);let t=e&&e.forceBase64;this.supportsBinary=fi&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new vt(Ge,this.uri(),e)}};function Ge(s){let e=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||$e))return new XMLHttpRequest}catch{}if(!e)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var We=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Lt=class extends E{get name(){return"websocket"}doOpen(){let e=this.uri(),t=this.opts.protocols,i=We?{}:yt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(i.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,i)}catch(r){return this.emitReserved("error",r)}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 i=e[t],r=t===e.length-1;Q(i,this.supportsBinary,n=>{try{this.doWrite(i,n)}catch{}r&&v(()=>{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]=_t()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}},Dt=l.WebSocket||l.MozWebSocket,w=class extends Lt{createSocket(e,t,i){return We?new Dt(e,t,i):t?new Dt(e,t):new Dt(e)}doWrite(e,t){this.ws.send(t)}};var C=class extends E{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=Ue(Number.MAX_SAFE_INTEGER,this.socket.binaryType),i=e.readable.pipeThrough(t).getReader(),r=Pe();r.readable.pipeTo(e.writable),this._writer=r.writable.getWriter();let n=()=>{i.read().then(({done:a,value:c})=>{a||(this.onPacket(c),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 i=e[t],r=t===e.length-1;this._writer.write(i).then(()=>{r&&v(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}};var Pt={websocket:w,webtransport:C,polling:k};var pi=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,di=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let e=s,t=s.indexOf("["),i=s.indexOf("]");t!=-1&&i!=-1&&(s=s.substring(0,t)+s.substring(t,i).replace(/:/g,";")+s.substring(i,s.length));let r=pi.exec(s||""),n={},o=14;for(;o--;)n[di[o]]=r[o]||"";return t!=-1&&i!=-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=mi(n,n.path),n.queryKey=gi(n,n.query),n}function mi(s,e){let t=/\/{2,9}/g,i=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&i.splice(0,1),e.slice(-1)=="/"&&i.splice(i.length-1,1),i}function gi(s,e){let t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(i,r,n){r&&(t[r]=n)}),t}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",St=[];Ut&&addEventListener("offline",()=>{St.forEach(s=>s())},!1);var Et=(()=>{class s extends u{constructor(t,i){if(super(),this.binaryType=Fe,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(i=t,t=null),t){let r=F(t);i.hostname=r.host,i.secure=r.protocol==="https"||r.protocol==="wss",i.port=r.port,r.query&&(i.query=r.query)}else i.host&&(i.hostname=F(i.host).host);S(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=qe(this.opts.query)),Ut&&(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"})},St.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){let i=Object.assign({},this.opts.query);i.EIO=Bt,i.transport=t,this.id&&(i.sid=this.id);let r=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let t=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let i=this.createTransport(t);i.open(),this.setTransport(i)}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",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",s.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 i=new Error("server error");i.code=t.data,this._onError(i);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 i=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(i+=Me(n)),r>0&&i>this._maxPayload)return this.writeBuffer.slice(0,r);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,v(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,i,r){return this._sendPacket("message",t,i,r),this}send(t,i,r){return this._sendPacket("message",t,i,r),this}_sendPacket(t,i,r,n){if(typeof i=="function"&&(n=i,i=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:t,data:i,options:r};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()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),t()},r=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(s.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,i){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(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=St.indexOf(this._offlineEventListener);r!==-1&&St.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,i),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),kt=class extends Et{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),i=!1;Et.priorWebsocketSuccess=!1;let r=()=>{i||(t.send([{type:"ping",data:"probe"}]),t.once("packet",A=>{if(!i)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;Et.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{i||this.readyState!=="closed"&&(m(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=t.name,this.emitReserved("upgradeError",q)}}))};function n(){i||(i=!0,m(),t.close(),t=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=t.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function b(A){t&&A.name!==t.name&&n()}let m=()=>{t.removeListener("open",r),t.removeListener("error",o),t.removeListener("close",a),this.off("close",c),this.off("upgrading",b)};t.once("open",r),t.once("error",o),t.once("close",a),this.once("close",c),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{i||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){let t=[];for(let i=0;i<e.length;i++)~this.transports.indexOf(e[i])&&t.push(e[i]);return t}},M=class extends kt{constructor(e,t={}){let i=typeof e=="object"?e:t;(!i.transports||i.transports&&typeof i.transports[0]=="string")&&(i.transports=(i.transports||["polling","websocket","webtransport"]).map(r=>Pt[r]).filter(r=>!!r)),super(e,i)}};var z=class extends U{doPoll(){this._fetch().then(e=>{if(!e.ok)return this.onError("fetch read error",e.status,e);e.text().then(t=>this.onData(t))}).catch(e=>{this.onError("fetch read error",e)})}doWrite(e,t){this._fetch(e).then(i=>{if(!i.ok)return this.onError("fetch write error",i.status,i);t()}).catch(i=>{this.onError("fetch write error",i)})}_fetch(e){var t;let i=e!==void 0,r=new Headers(this.opts.extraHeaders);return i&&r.set("content-type","text/plain;charset=UTF-8"),(t=this.socket._cookieJar)===null||t===void 0||t.appendCookies(r),fetch(this.uri(),{method:i?"POST":"GET",body:i?e:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var Js=M.protocol;function Ke(s,e="",t){let i=s;t=t||typeof location<"u"&&location,s==null&&(s=t.protocol+"//"+t.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=t.protocol+s:s=t.host+s),/^(https?|wss?):\/\//.test(s)||(typeof t<"u"?s=t.protocol+"//"+s:s="https://"+s),i=F(s)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";let n=i.host.indexOf(":")!==-1?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+e,i.href=i.protocol+"://"+n+(t&&t.port===i.port?"":":"+i.port),i}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var yi=typeof ArrayBuffer=="function",_i=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,je=Object.prototype.toString,bi=typeof Blob=="function"||typeof Blob<"u"&&je.call(Blob)==="[object BlobConstructor]",vi=typeof File=="function"||typeof File<"u"&&je.call(File)==="[object FileConstructor]";function tt(s){return yi&&(s instanceof ArrayBuffer||_i(s))||bi&&s instanceof Blob||vi&&s instanceof File}function Z(s,e){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let t=0,i=s.length;t<i;t++)if(Z(s[t]))return!0;return!1}if(tt(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Z(s.toJSON(),!0);for(let t in s)if(Object.prototype.hasOwnProperty.call(s,t)&&Z(s[t]))return!0;return!1}function Qe(s){let e=[],t=s.data,i=s;return i.data=Ft(t,e),i.attachments=e.length,{packet:i,buffers:e}}function Ft(s,e){if(!s)return s;if(tt(s)){let t={_placeholder:!0,num:e.length};return e.push(s),t}else if(Array.isArray(s)){let t=new Array(s.length);for(let i=0;i<s.length;i++)t[i]=Ft(s[i],e);return t}else if(typeof s=="object"&&!(s instanceof Date)){let t={};for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(t[i]=Ft(s[i],e));return t}return s}function Je(s,e){return s.data=Mt(s.data,e),delete s.attachments,s}function Mt(s,e){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<e.length)return e[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let t=0;t<s.length;t++)s[t]=Mt(s[t],e);else if(typeof s=="object")for(let t in s)Object.prototype.hasOwnProperty.call(s,t)&&(s[t]=Mt(s[t],e));return s}var Si=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s}(h||{}),Vt=class{constructor(e){this.replacer=e}encode(e){return(e.type===h.EVENT||e.type===h.ACK)&&Z(e)?this.encodeAsBinary({type:e.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===h.BINARY_EVENT||e.type===h.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=Qe(e),i=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(i),r}};function Xe(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{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 i=t.type===h.BINARY_EVENT;i||t.type===h.BINARY_ACK?(t.type=i?h.EVENT:h.ACK,this.reconstructor=new Ht(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if(tt(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,i={type:Number(e.charAt(0))};if(h[i.type]===void 0)throw new Error("unknown packet type "+i.type);if(i.type===h.BINARY_EVENT||i.type===h.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");i.attachments=Number(o)}if(e.charAt(t+1)==="/"){let n=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););i.nsp=e.substring(n,t)}else i.nsp="/";let r=e.charAt(t+1);if(r!==""&&Number(r)==r){let n=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}i.id=Number(e.substring(n,t+1))}if(e.charAt(++t)){let n=this.tryParse(e.substr(t));if(s.isPayloadValid(i.type,n))i.data=n;else throw new Error("invalid payload")}return i}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case h.CONNECT:return Xe(t);case h.DISCONNECT:return t===void 0;case h.CONNECT_ERROR:return typeof t=="string"||Xe(t);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Si.indexOf(t[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=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=Je(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function d(s,e,t){return s.on(e,t),function(){s.off(e,t)}}var Ei=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),x=class extends u{constructor(e,t,i){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,i&&i.auth&&(this.auth=i.auth),this._opts=Object.assign({},i),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let e=this.io;this.subs=[d(e,"open",this.onopen.bind(this)),d(e,"packet",this.onpacket.bind(this)),d(e,"error",this.onerror.bind(this)),d(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 i,r,n;if(Ei.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:h.EVENT,data:t};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof t[t.length-1]=="function"){let m=this.ids++,A=t.pop();this._registerAckCallback(m,A),o.id=m}let a=(r=(i=this.io.engine)===null||i===void 0?void 0:i.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(e,t){var i;let r=(i=this.flags.timeout)!==null&&i!==void 0?i:this._opts.ackTimeout;if(r===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"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),t.apply(this,a)};o.withError=!0,this.acks[e]=o}emitWithAck(e,...t){return new Promise((i,r)=>{let n=(o,a)=>o?r(o):i(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 i={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((r,...n)=>i!==this._queue[0]?void 0:(r!==null?i.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(r)):(this._queue.shift(),t&&t(null,...n)),i.pending=!1,this._drainQueue())),this._queue.push(i),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:h.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(i=>String(i.id)===e)){let i=this.acks[e];delete this.acks[e],i.withError&&i.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case h.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 h.EVENT:case h.BINARY_EVENT:this.onevent(e);break;case h.ACK:case h.BINARY_ACK:this.onack(e);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let i=new Error(e.data.message);i.data=e.data.data,this.emitReserved("connect_error",i);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 i of t)i.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,i=!1;return function(...r){i||(i=!0,t.packet({type:h.ACK,id:e,data:r}))}}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.emitReserved("connect"),this._drainQueue(!0)}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:h.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 i=0;i<t.length;i++)if(e===t[i])return t.splice(i,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 i=0;i<t.length;i++)if(e===t[i])return t.splice(i,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 i of t)i.apply(this,e.data)}}};function N(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}N.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*s);s=(Math.floor(e*10)&1)==0?s-t:s+t}return Math.min(s,this.max)|0};N.prototype.reset=function(){this.attempts=0};N.prototype.setMin=function(s){this.ms=s};N.prototype.setMax=function(s){this.max=s};N.prototype.setJitter=function(s){this.jitter=s};var B=class extends u{constructor(e,t){var i;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,S(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((i=t.randomizationFactor)!==null&&i!==void 0?i:.5),this.backoff=new N({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;let r=t.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.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 M(this.uri,this.opts);let t=this.engine,i=this;this._readyState="opening",this.skipReconnect=!1;let r=d(t,"open",function(){i.onopen(),e&&e()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),e?e(a):this.maybeReconnectOnOpen()},o=d(t,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),t.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),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(d(e,"ping",this.onping.bind(this)),d(e,"data",this.ondata.bind(this)),d(e,"error",this.onerror.bind(this)),d(e,"close",this.onclose.bind(this)),d(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){v(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let i=this.nsps[e];return i?this._autoConnect&&!i.active&&i.connect():(i=new x(this,e,t),this.nsps[e]=i),i}_destroy(e){let t=Object.keys(this.nsps);for(let i of t)if(this.nsps[i].active)return;this._close()}_packet(e){let t=this.encoder.encode(e);for(let i=0;i<t.length;i++)this.engine.write(t[i],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 i;this.cleanup(),(i=this.engine)===null||i===void 0||i.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 i=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(r=>{r?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",r)):e.onreconnect()}))},t);this.opts.autoUnref&&i.unref(),this.subs.push(()=>{this.clearTimeoutFn(i)})}}onreconnect(){let e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}};var et={};function I(s,e){typeof s=="object"&&(e=s,s=void 0),e=e||{};let t=Ke(s,e.path||"/socket.io"),i=t.source,r=t.id,n=t.path,o=et[r]&&n in et[r].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||o,c;return a?c=new B(i,e):(et[r]||(et[r]=new B(i,e)),c=et[r]),t.query&&!e.query&&(e.query=t.queryKey),c.socket(t.path,e)}Object.assign(I,{Manager:B,Socket:x,io:I,connect:I});var V=class s{config;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(e){this.config=e,e===void 0&&(e=this.emptyConfig);let t=e.url,i=e.options,r=I?I:Gt;this.ioSocket=r(t,i)}get auth(){return this.ioSocket.auth}set auth(e){this.ioSocket.auth=e}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(e){if(!e||e==="/")return this;let t=this.namespaces[e];if(t)return t;let a=this.config,{url:i}=a,r=Qt(a,["url"]),n=it({url:!i.endsWith("/")&&!e.startsWith("/")?`${i}/${e}`:`${i}${e}`},r),o=new s(n);return this.namespaces[e]=o,o}on(e,t){return this.ioSocket.on(e,t),this}once(e,t){return this.ioSocket.once(e,t),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(e,...t){return this.ioSocket.emit.apply(this.ioSocket,arguments),this}send(...e){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(e,...t){return this.ioSocket.emitWithAck.apply(this.ioSocket,arguments)}removeListener(e,t){return this.ioSocket.removeListener.apply(this.ioSocket,arguments),this}removeAllListeners(e){return this.ioSocket.removeAllListeners.apply(this.ioSocket,arguments),this}fromEvent(e){return this.subscribersCounter[e]||(this.subscribersCounter[e]=0),this.subscribersCounter[e]++,this.eventObservables$[e]||(this.eventObservables$[e]=new Xt(t=>{let i=r=>{t.next(r)};return this.ioSocket.on(e,i),()=>{this.subscribersCounter[e]--,this.subscribersCounter[e]===0&&(this.ioSocket.removeListener(e,i),delete this.eventObservables$[e])}}).pipe(te())),this.eventObservables$[e]}fromOneTimeEvent(e){return new Promise(t=>this.once(e,t))}listeners(e){return this.ioSocket.listeners(e)}hasListeners(e){return this.ioSocket.hasListeners(e)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(e,t){return this.ioSocket.off(e,t),this}offAny(e){return this.ioSocket.offAny(e),this}offAnyOutgoing(e){return this.ioSocket.offAnyOutgoing(e),this}onAny(e){return this.ioSocket.onAny(e),this}onAnyOutgoing(e){return this.ioSocket.onAnyOutgoing(e),this}prependAny(e){return this.ioSocket.prependAny(e),this}prependAnyOutgoing(e){return this.ioSocket.prependAnyOutgoing(e),this}timeout(e){return this.ioSocket.timeout(e),this}get volatile(){let e=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(e){return this.ioSocket.compress(e),this}};function ki(s){return new V(s)}var ze=new ee("__SOCKET_IO_CONFIG__"),Vr=(()=>{class s{static forRoot(t){return{ngModule:s,providers:[{provide:ze,useValue:t},{provide:V,useFactory:ki,deps:[ze]}]}}static \u0275fac=function(i){return new(i||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${le}/notifications`,UNREAD:"unread"},wt=Kt.BASE;var f=function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s}(f||{});var g=function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s}(g||{}),Wr={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var Ze=he;var ti={[g.COMMENTS]:Ze,[g.SPACES]:Y.SPACES,[g.SPACE_ROOTS]:Y.SPACES,[g.SHARES]:Y.SHARES,[g.LINKS]:Y.LINKS,[g.SYNC]:Ee.SYNC};var At=class{constructor(e){this.soonRead=!1,Object.assign(this,e),this.fromUser?this.fromUser.avatarUrl=P(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ti[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===g.COMMENTS||this.content.app===g.SHARES||this.content.app===g.SYNC)return;let e=this.content.url.split("/");e.length>1&&(this.mainElement=e[e.length-1])}};var ei=(()=>{class s{constructor(t,i,r){this.http=t,this.store=i,this.layout=r}getNotifications(t=!1){return this.http.get(`${wt}${t?`/${Kt.UNREAD}`:""}`).pipe(p(i=>i.map(r=>new At(r))))}wasReadNotification(t){return this.http.patch(`${wt}/${t}`,null)}deleteNotification(t){return this.http.delete(`${wt}${t?`/${t}`:""}`)}checkUnreadNotifications(t=!1){this.getNotifications().subscribe(i=>{let r;if(t&&i.length){let n=i[0];r=this.layout.sendNotification("warning",n.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(n.content.event)}: <b>${n.content.element}</b>`),null,{enableHtml:!0})}else{let n=i.filter(o=>!o.wasRead).length;n&&(r=this.layout.sendNotification("warning","Notifications",this.layout.translateString(n===1?"one_notification":"nb_notifications",{nb:n})))}r&&r.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(i)})}static{this.\u0275fac=function(i){return new(i||s)(_(ut),_(ft),_(pt))}}static{this.\u0275prov=st({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var En=(()=>{class s{constructor(t,i,r,n,o){this.http=t,this.layout=i,this.store=r,this.webSocket=n,this.notifications=o,this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(ke.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(G.EVENTS.ONLINE_USER).pipe(p(a=>new W(a))).subscribe(a=>this.newOnlineUser(a)),this.webSocket.fromEvent(G.EVENTS.ONLINE_USERS).pipe(p(a=>a.map(c=>new W(c)))).subscribe(a=>this.setOnlineUsers(a)),this.webSocket.fromEvent(G.EVENTS.ONLINE_STATUS).subscribe(a=>this.receiveOnlineStatus(a))}get user(){return this.store.user.getValue()}initUser(t,i=!1){this.refreshAvatar(),this.layout.setLanguage(t.language),this.store.userImpersonate.set(i||t.impersonated),this.store.user.next(t),this.checkQuota(this.store.user.getValue()),i&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(t){this.store.onlineUsers.set(t)}newOnlineUser(t){this.store.onlineUsers().find(i=>i.id===t.id)?this.receiveOnlineStatus({userId:t.id,status:t.onlineStatus}):this.store.onlineUsers.update(i=>[t,...i])}userHavePermission(t){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(t)!==-1:!1}browseGroup(t){return this.http.get(`${me}${t?`/${t}`:""}`).pipe(p(i=>new dt(i)))}createPersonalGroup(t){return this.http.post(O,t).pipe(p(i=>new T(i)))}updatePersonalGroup(t,i){return this.http.put(`${O}/${t}`,i).pipe(p(r=>new T(r)))}leavePersonalGroup(t){return this.http.delete(`${ge}/${t}`)}addUsersToGroup(t,i){return this.http.patch(`${O}/${t}/${$.USERS}`,i)}deletePersonalGroup(t){return this.http.delete(`${O}/${t}`)}updateUserFromPersonalGroup(t,i,r){return this.http.patch(`${O}/${t}/${$.USERS}/${i}`,r)}removeUserFromGroup(t,i){return this.http.delete(`${O}/${t}/${$.USERS}/${i}`)}listGuests(){return this.http.get(L).pipe(p(t=>t.map(i=>new R(i))))}getGuest(t){return this.http.get(`${L}/${t}`).pipe(p(i=>new R(i)))}createGuest(t){return this.http.post(L,t).pipe(p(i=>new R(i)))}updateGuest(t,i){return this.http.put(`${L}/${t}`,i).pipe(p(r=>r?new R(r):null))}deleteGuest(t){return this.http.delete(`${L}/${t}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:t=>this.layout.sendNotification("error","Configuration","Avatar",t)})}uploadAvatar(t){let i=new FormData;i.append("file",t),this.http.put(Ct,i).subscribe({next:()=>this.refreshAvatar(),error:r=>this.layout.sendNotification("error","Configuration","Avatar",r)})}changePassword(t){return this.http.put(pe,t)}changeLanguage(t){return this.http.put(fe,t)}changeNotification(t){return this.http.put(de,t)}changeOnlineStatus(t,i=!0){this.webSocket.emit(G.EVENTS.ONLINE_STATUS,{status:t,store:i})}receiveOnlineStatus(t){this.user.id===t.userId?this.user.onlineStatus=t.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(i=>i.map(r=>r.id===t.userId?jt(it({},r),{onlineStatus:t.status}):r))}searchMembers(t,i=[]){return this.http.request("search",$.BASE,{body:t}).pipe(p(r=>r.map(n=>new T(n,i))),zt(()=>[]))}setMenusVisibility(t){for(let i of t)if(!(i.id&&(i.hide=!this.userHavePermission(i.id),i.hide))&&(i.checks?.length&&(i.hide=!i.checks.map(r=>r.negate?!this[r.prop][r.value]:this[r.prop][r.value]).every(r=>!!r)),i.submenus?.length&&this.setMenusVisibility(i.submenus),i.title===ye.FILES)){for(let r of i.submenus)if(!r.hide){i.link=r.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(Se())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:t=>this.store.appStoreManifest.set(t),error:t=>console.error(t)})}checkQuota(t){if(!(t.isGuest||t.isLink)&&t.storageQuota){let i=Math.round(100/t.storageQuota*(t.storageQuota-t.storageUsage));i<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):i<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:i}),null,{disableTimeOut:!0,closeButton:!0}):i<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:i}),null,{disableTimeOut:!0,closeButton:!0})}}static{this.\u0275fac=function(i){return new(i||s)(_(ut),_(pt),_(ft),_(V),_(ei))}}static{this.\u0275prov=st({token:s,factory:s.\u0275fac,providedIn:"root"})}}return s})();var Ci={provide:lt,useExisting:H(()=>xi),multi:!0},xi=(()=>{class s{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(t){this.state=t,this.value=this.state?this.trueValue:this.falseValue}writeValue(t){this.state=this.trueValue===t,this.value=t?this.trueValue:this.falseValue}setDisabledState(t){this.isDisabled=t}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275dir=ot({type:s,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(i,r){i&1&&ct("click",function(){return r.onClick()}),i&2&&(at("aria-pressed",r.state),Tt("active",r.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ci])]})}}return s})(),Ni={provide:lt,useExisting:H(()=>ii),multi:!0},ii=(()=>{class s{get value(){return this.group?this.group.value:this._value}set value(t){if(this.group){this.group.value=t;return}this._value=t,this._onChange(t)}get disabled(){return this._disabled}set disabled(t){this.setDisabledState(t)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(t,i,r,n){this.el=t,this.cdr=i,this.renderer=r,this.group=n,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(t){this.toggleIfAllowed(),t.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(t){"uncheckable"in t&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(t){if(this.group){this.group.value=t;return}this.onTouched(),this.onChange(t)}writeValue(t){this.value=t,this.cdr.markForCheck()}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){if(this._disabled=t,t){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}static{this.\u0275fac=function(i){return new(i||s)(D(se),D(Ot),D(re),D(H(()=>si),8))}}static{this.\u0275dir=ot({type:s,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(i,r){i&1&&ct("click",function(){return r.toggleIfAllowed()})("keydown.space",function(o){return r.onSpacePressed(o)})("focus",function(){return r.onFocus()})("blur",function(){return r.onBlur()}),i&2&&(at("aria-disabled",r.controlOrGroupDisabled)("aria-checked",r.isActive)("role",r.role)("tabindex",r.tabindex),Tt("disabled",r.hasDisabledClass)("active",r.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Ni]),ie]})}}return s})(),Bi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{class s{constructor(t){this.cdr=t,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(t){this._value=t,this.onChange(t)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(t){this._value=t,this.cdr.markForCheck()}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.radioButtons&&(this._disabled=t,this.radioButtons.forEach(i=>{i.setDisabledState(t)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let t=this.getActiveOrFocusedRadio();if(t){t.focus();return}if(this.radioButtons){let i=this.radioButtons.find(r=>!r.disabled);i&&i.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(t){this.selectInDirection("next"),t.preventDefault()}selectPrevious(t){this.selectInDirection("previous"),t.preventDefault()}selectInDirection(t){if(this._disabled)return;function i(n,o){let c=(n+(t==="next"?1:-1))%o.length;return c<0&&(c=o.length-1),c}let r=this.getActiveOrFocusedRadio();if(r&&this.radioButtons){let n=this.radioButtons.toArray(),o=n.indexOf(r);for(let a=i(o,n);a!==o;a=i(a,n))if(n[a].canToggle()){n[a].toggleIfAllowed(),n[a].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(t=>t.isActive)||this.radioButtons.find(t=>t.hasFocus)}static{this.\u0275fac=function(i){return new(i||s)(D(Ot))}}static{this.\u0275dir=ot({type:s,selectors:[["","btnRadioGroup",""]],contentQueries:function(i,r,n){if(i&1&&ne(n,ii,4),i&2){let o;oe(o=ae())&&(r.radioButtons=o)}},hostVars:2,hostBindings:function(i,r){i&1&&ct("focus",function(){return r.onFocus()})("blur",function(){return r.onBlur()})("keydown.ArrowRight",function(o){return r.selectNext(o)})("keydown.ArrowDown",function(o){return r.selectNext(o)})("keydown.ArrowLeft",function(o){return r.selectPrevious(o)})("keydown.ArrowUp",function(o){return r.selectPrevious(o)}),i&2&&at("role",r.role)("tabindex",r.tabindex)},features:[ht([Bi])]})}}return s})(),Ln=(()=>{class s{static forRoot(){return{ngModule:s,providers:[]}}static{this.\u0275fac=function(i){return new(i||s)}}static{this.\u0275mod=nt({type:s})}static{this.\u0275inj=rt({})}}return s})();export{Vr as a,dt as b,R as c,g as d,ei as e,En as f,xi as g,Ln as h};