From 98ce0408f79a0ab8f1c16b08faa89fd4cba854e2 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Sat, 16 Dec 2023 19:15:09 +0000 Subject: [PATCH] Limit colors and re-use tailwind config in desktop --- crates/librqbit/webui/.gitignore | 2 ++ crates/librqbit/webui/dist/assets/index.css | 2 +- crates/librqbit/webui/dist/assets/index.js | 2 +- crates/librqbit/webui/dist/manifest.json | 6 +++--- .../webui/src/components/modal/Modal.tsx | 2 +- crates/librqbit/webui/src/rqbit-web.tsx | 2 +- crates/librqbit/webui/tailwind.config.js | 5 ----- crates/librqbit/webui/tailwind.config.ts | 21 +++++++++++++++++++ desktop/src-tauri/Cargo.lock | 4 ++-- desktop/tailwind.config.js | 8 ------- desktop/tailwind.config.ts | 11 ++++++++++ 11 files changed, 43 insertions(+), 22 deletions(-) delete mode 100644 crates/librqbit/webui/tailwind.config.js create mode 100644 crates/librqbit/webui/tailwind.config.ts delete mode 100644 desktop/tailwind.config.js create mode 100644 desktop/tailwind.config.ts diff --git a/crates/librqbit/webui/.gitignore b/crates/librqbit/webui/.gitignore index 251ce6d2..dfe9608b 100644 --- a/crates/librqbit/webui/.gitignore +++ b/crates/librqbit/webui/.gitignore @@ -11,6 +11,8 @@ node_modules dist-ssr *.local +dist/ + # Editor directories and files .vscode/* !.vscode/extensions.json diff --git a/crates/librqbit/webui/dist/assets/index.css b/crates/librqbit/webui/dist/assets/index.css index f7944c33..ece76dac 100644 --- a/crates/librqbit/webui/dist/assets/index.css +++ b/crates/librqbit/webui/dist/assets/index.css @@ -1 +1 @@ -*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.start-0{inset-inline-start:0px}.top-0{top:0}.z-10{z-index:10}.z-\[300\]{z-index:300}.z-\[301\]{z-index:301}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.me-2{margin-inline-end:.5rem}.ml-2{margin-left:.5rem}.ms-2{margin-inline-start:.5rem}.mt-1{margin-top:.25rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-7xl{max-width:80rem}.flex-grow{flex-grow:1}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre{white-space:pre}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-green-50{--tw-border-opacity: 1;border-color:rgb(240 253 244 / var(--tw-border-opacity))}.bg-black\/30{background-color:#0000004d}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity))}.fill-blue-600{fill:#2563eb}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-2{padding-left:.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.hover\:border-red-700:hover{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:text-yellow-500:hover{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity))}.hover\:drop-shadow-sm:hover{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-200:disabled{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:border-none){border-style:none}:is(.dark .dark\:border-slate-500){--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-600){--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-700){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-900){--tw-border-opacity: 1;border-color:rgb(15 23 42 / var(--tw-border-opacity))}:is(.dark .dark\:bg-black\/60){background-color:#0009}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800\/60){background-color:#991b1b99}:is(.dark .dark\:bg-slate-600){--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-slate-800){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-200){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-300){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-400){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:text-zinc-50){--tw-text-opacity: 1;color:rgb(250 250 250 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-blue-900\/50:hover){background-color:#1e3a8a80}:is(.dark .dark\:hover\:bg-red-900:hover){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-slate-700:hover){--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}:is(.dark .dark\:disabled\:bg-slate-600:disabled){--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}:is(.dark .dark\:disabled\:text-slate-300:disabled){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:px-7{padding-left:1.75rem;padding-right:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:leading-6{line-height:1.5rem}}@media (min-width: 768px){.md\:block{display:block}.md\:hidden{display:none}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-between{justify-content:space-between}} +*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.start-0{inset-inline-start:0px}.top-0{top:0}.z-10{z-index:10}.z-\[300\]{z-index:300}.z-\[301\]{z-index:301}.m-0{margin:0}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-5{margin:1.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.me-2{margin-inline-end:.5rem}.ml-2{margin-left:.5rem}.ms-2{margin-inline-start:.5rem}.mt-1{margin-top:.25rem}.mt-4{margin-top:1rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-10{height:2.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-7xl{max-width:80rem}.flex-grow{flex-grow:1}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.flex-nowrap{flex-wrap:nowrap}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}.border-green-50{--tw-border-opacity: 1;border-color:rgb(240 253 244 / var(--tw-border-opacity))}.bg-black\/30{background-color:#0000004d}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.bg-green-700{--tw-bg-opacity: 1;background-color:rgb(21 128 61 / var(--tw-bg-opacity))}.bg-red-200{--tw-bg-opacity: 1;background-color:rgb(254 202 202 / var(--tw-bg-opacity))}.bg-red-400{--tw-bg-opacity: 1;background-color:rgb(248 113 113 / var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.fill-blue-600{fill:#2563eb}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pl-2{padding-left:.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\[10px\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.drop-shadow-lg{--tw-drop-shadow: drop-shadow(0 10px 8px rgb(0 0 0 / .04)) drop-shadow(0 4px 3px rgb(0 0 0 / .1));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}.hover\:border-red-700:hover{--tw-border-opacity: 1;border-color:rgb(185 28 28 / var(--tw-border-opacity))}.hover\:bg-blue-500:hover{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity))}.hover\:bg-blue-800:hover{--tw-bg-opacity: 1;background-color:rgb(30 64 175 / var(--tw-bg-opacity))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity))}.hover\:bg-slate-200:hover{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-green-500:hover{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.hover\:drop-shadow-sm:hover{--tw-drop-shadow: drop-shadow(0 1px 1px rgb(0 0 0 / .05));filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:bg-blue-200:disabled{--tw-bg-opacity: 1;background-color:rgb(191 219 254 / var(--tw-bg-opacity))}:is(.dark .dark\:border-none){border-style:none}:is(.dark .dark\:border-slate-500){--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-600){--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-700){--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity))}:is(.dark .dark\:border-slate-900){--tw-border-opacity: 1;border-color:rgb(15 23 42 / var(--tw-border-opacity))}:is(.dark .dark\:bg-black\/60){background-color:#0009}:is(.dark .dark\:bg-blue-900){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-500){--tw-bg-opacity: 1;background-color:rgb(107 114 128 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-gray-900){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800){--tw-bg-opacity: 1;background-color:rgb(153 27 27 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-red-800\/60){background-color:#991b1b99}:is(.dark .dark\:bg-slate-600){--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}:is(.dark .dark\:bg-slate-800){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}:is(.dark .dark\:text-gray-200){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-50){--tw-text-opacity: 1;color:rgb(249 250 251 / var(--tw-text-opacity))}:is(.dark .dark\:text-gray-600){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-200){--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-300){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}:is(.dark .dark\:text-slate-400){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}:is(.dark .dark\:hover\:bg-blue-900\/50:hover){background-color:#1e3a8a80}:is(.dark .dark\:hover\:bg-red-900:hover){--tw-bg-opacity: 1;background-color:rgb(127 29 29 / var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-slate-700:hover){--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}:is(.dark .dark\:disabled\:bg-slate-600:disabled){--tw-bg-opacity: 1;background-color:rgb(71 85 105 / var(--tw-bg-opacity))}:is(.dark .dark\:disabled\:text-slate-300:disabled){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:flex-row{flex-direction:row}.sm\:flex-wrap{flex-wrap:wrap}.sm\:px-7{padding-left:1.75rem;padding-right:1.75rem}.sm\:text-sm{font-size:.875rem;line-height:1.25rem}.sm\:leading-6{line-height:1.5rem}}@media (min-width: 768px){.md\:block{display:block}.md\:hidden{display:none}}@media (min-width: 1024px){.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:justify-between{justify-content:space-between}} diff --git a/crates/librqbit/webui/dist/assets/index.js b/crates/librqbit/webui/dist/assets/index.js index 7f85258f..eb34ea48 100644 --- a/crates/librqbit/webui/dist/assets/index.js +++ b/crates/librqbit/webui/dist/assets/index.js @@ -37,4 +37,4 @@ `+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{Yl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?On(e):""}function Hd(e){switch(e.tag){case 5:return On(e.type);case 16:return On("Lazy");case 13:return On("Suspense");case 19:return On("SuspenseList");case 0:case 2:case 15:return e=Xl(e.type,!1),e;case 11:return e=Xl(e.type.render,!1),e;case 1:return e=Xl(e.type,!0),e;default:return""}}function Lo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Jt:return"Fragment";case Xt:return"Portal";case No:return"Profiler";case Pi:return"StrictMode";case To:return"Suspense";case Po:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oa:return(e.displayName||"Context")+".Consumer";case la:return(e._context.displayName||"Context")+".Provider";case Li:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case zi:return t=e.displayName||null,t!==null?t:Lo(e.type)||"Memo";case it:t=e._payload,e=e._init;try{return Lo(e(t))}catch{}}return null}function Wd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Lo(t);case 8:return t===Pi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function St(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ua(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qd(e){var t=ua(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kr(e){e._valueTracker||(e._valueTracker=Qd(e))}function sa(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ua(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Yr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function zo(e,t){var n=t.checked;return W({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Pu(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=St(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function aa(e,t){t=t.checked,t!=null&&Ti(e,"checked",t,!1)}function Mo(e,t){aa(e,t);var n=St(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Oo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Oo(e,t.type,St(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lu(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Oo(e,t,n){(t!=="number"||Yr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Fn=Array.isArray;function an(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=Sr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Gn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Rn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Kd=["Webkit","ms","Moz","O"];Object.keys(Rn).forEach(function(e){Kd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Rn[t]=Rn[e]})});function pa(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Rn.hasOwnProperty(e)&&Rn[e]?(""+t).trim():t+"px"}function ma(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=pa(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Zd=W({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Do(e,t){if(t){if(Zd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function Ro(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $o=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ao=null,cn=null,dn=null;function Ou(e){if(e=pr(e)){if(typeof Ao!="function")throw Error(k(280));var t=e.stateNode;t&&(t=jl(t),Ao(e.stateNode,e.type,t))}}function ha(e){cn?dn?dn.push(e):dn=[e]:cn=e}function va(){if(cn){var e=cn,t=dn;if(dn=cn=null,Ou(e),t)for(e=0;e>>=0,e===0?32:31-(lf(e)/of|0)|0}var Er=64,Cr=4194304;function In(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function br(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=In(u):(o&=i,o!==0&&(r=In(o)))}else i=n&~l,i!==0?r=In(i):o!==0&&(r=In(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function dr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fe(t),e[t]=n}function cf(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=An),Vu=String.fromCharCode(32),Hu=!1;function Da(e,t){switch(e){case"keyup":return $f.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ra(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qt=!1;function Uf(e,t){switch(e){case"compositionend":return Ra(t);case"keypress":return t.which!==32?null:(Hu=!0,Vu);case"textInput":return e=t.data,e===Vu&&Hu?null:e;default:return null}}function Bf(e,t){if(qt)return e==="compositionend"||!Ui&&Da(e,t)?(e=Fa(),Ur=Ri=ct=null,qt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Zu(n)}}function Ba(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ba(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Va(){for(var e=window,t=Yr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Yr(e.document)}return t}function Bi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Xf(e){var t=Va(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ba(n.ownerDocument.documentElement,n)){if(r!==null&&Bi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=Gu(n,o);var i=Gu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,bt=null,Qo=null,Bn=null,Ko=!1;function Yu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ko||bt==null||bt!==Yr(r)||(r=bt,"selectionStart"in r&&Bi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Bn&&er(Bn,r)||(Bn=r,r=nl(Qo,"onSelect"),0nn||(e.current=qo[nn],qo[nn]=null,nn--)}function R(e,t){nn++,qo[nn]=e.current,e.current=t}var Et={},ie=_t(Et),me=_t(!1),At=Et;function vn(e,t){var n=e.type.contextTypes;if(!n)return Et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function he(e){return e=e.childContextTypes,e!=null}function ll(){U(me),U(ie)}function ns(e,t,n){if(ie.current!==Et)throw Error(k(168));R(ie,t),R(me,n)}function Ja(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(k(108,Wd(e)||"Unknown",l));return W({},n,r)}function ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Et,At=ie.current,R(ie,e),R(me,me.current),!0}function rs(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=Ja(e,t,At),r.__reactInternalMemoizedMergedChildContext=e,U(me),U(ie),R(ie,e)):U(me),R(me,n)}var Ye=null,Nl=!1,co=!1;function qa(e){Ye===null?Ye=[e]:Ye.push(e)}function s0(e){Nl=!0,qa(e)}function jt(){if(!co&&Ye!==null){co=!0;var e=0,t=I;try{var n=Ye;for(I=1;e>=i,l-=i,Xe=1<<32-Fe(t)+l|n<j?(D=C,C=null):D=C.sibling;var M=h(f,C,p[j],w);if(M===null){C===null&&(C=D);break}e&&C&&M.alternate===null&&t(f,C),d=o(M,d,j),E===null?N=M:E.sibling=M,E=M,C=D}if(j===p.length)return n(f,C),B&&zt(f,j),N;if(C===null){for(;jj?(D=C,C=null):D=C.sibling;var ge=h(f,C,M.value,w);if(ge===null){C===null&&(C=D);break}e&&C&&ge.alternate===null&&t(f,C),d=o(ge,d,j),E===null?N=ge:E.sibling=ge,E=ge,C=D}if(M.done)return n(f,C),B&&zt(f,j),N;if(C===null){for(;!M.done;j++,M=p.next())M=m(f,M.value,w),M!==null&&(d=o(M,d,j),E===null?N=M:E.sibling=M,E=M);return B&&zt(f,j),N}for(C=r(f,C);!M.done;j++,M=p.next())M=x(C,f,j,M.value,w),M!==null&&(e&&M.alternate!==null&&C.delete(M.key===null?j:M.key),d=o(M,d,j),E===null?N=M:E.sibling=M,E=M);return e&&C.forEach(function(Tt){return t(f,Tt)}),B&&zt(f,j),N}function L(f,d,p,w){if(typeof p=="object"&&p!==null&&p.type===Jt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case wr:e:{for(var N=p.key,E=d;E!==null;){if(E.key===N){if(N=p.type,N===Jt){if(E.tag===7){n(f,E.sibling),d=l(E,p.props.children),d.return=f,f=d;break e}}else if(E.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===it&&cs(N)===E.type){n(f,E.sibling),d=l(E,p.props),d.ref=Ln(f,E,p),d.return=f,f=d;break e}n(f,E);break}else t(f,E);E=E.sibling}p.type===Jt?(d=$t(p.props.children,f.mode,w,p.key),d.return=f,f=d):(w=Gr(p.type,p.key,p.props,null,f.mode,w),w.ref=Ln(f,d,p),w.return=f,f=w)}return i(f);case Xt:e:{for(E=p.key;d!==null;){if(d.key===E)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){n(f,d.sibling),d=l(d,p.children||[]),d.return=f,f=d;break e}else{n(f,d);break}else t(f,d);d=d.sibling}d=xo(p,f.mode,w),d.return=f,f=d}return i(f);case it:return E=p._init,L(f,d,E(p._payload),w)}if(Fn(p))return g(f,d,p,w);if(_n(p))return S(f,d,p,w);zr(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,d!==null&&d.tag===6?(n(f,d.sibling),d=l(d,p),d.return=f,f=d):(n(f,d),d=yo(p,f.mode,w),d.return=f,f=d),i(f)):n(f,d)}return L}var yn=ic(!0),uc=ic(!1),mr={},We=_t(mr),lr=_t(mr),or=_t(mr);function Dt(e){if(e===mr)throw Error(k(174));return e}function Xi(e,t){switch(R(or,t),R(lr,e),R(We,mr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Io(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Io(t,e)}U(We),R(We,t)}function xn(){U(We),U(lr),U(or)}function sc(e){Dt(or.current);var t=Dt(We.current),n=Io(t,e.type);t!==n&&(R(lr,e),R(We,n))}function Ji(e){lr.current===e&&(U(We),U(lr))}var V=_t(0);function dl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var fo=[];function qi(){for(var e=0;en?n:4,e(!0);var r=po.transition;po.transition={};try{e(!1),t()}finally{I=n,po.transition=r}}function Cc(){return Pe().memoizedState}function f0(e,t,n){var r=xt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e))jc(t,n);else if(n=nc(e,t,n,r),n!==null){var l=ae();Ie(n,e,r,l),Nc(n,t,r)}}function p0(e,t,n){var r=xt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))jc(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,De(u,i)){var s=t.interleaved;s===null?(l.next=l,Gi(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=nc(e,t,l,r),n!==null&&(l=ae(),Ie(n,e,r,l),Nc(n,t,r))}}function _c(e){var t=e.alternate;return e===H||t!==null&&t===H}function jc(e,t){Vn=fl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Nc(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Fi(e,n)}}var pl={readContext:Te,useCallback:re,useContext:re,useEffect:re,useImperativeHandle:re,useInsertionEffect:re,useLayoutEffect:re,useMemo:re,useReducer:re,useRef:re,useState:re,useDebugValue:re,useDeferredValue:re,useTransition:re,useMutableSource:re,useSyncExternalStore:re,useId:re,unstable_isNewReconciler:!1},m0={readContext:Te,useCallback:function(e,t){return Ue().memoizedState=[e,t===void 0?null:t],e},useContext:Te,useEffect:fs,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Wr(4194308,4,xc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Wr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Wr(4,2,e,t)},useMemo:function(e,t){var n=Ue();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ue();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=f0.bind(null,H,e),[r.memoizedState,e]},useRef:function(e){var t=Ue();return e={current:e},t.memoizedState=e},useState:ds,useDebugValue:ru,useDeferredValue:function(e){return Ue().memoizedState=e},useTransition:function(){var e=ds(!1),t=e[0];return e=d0.bind(null,e[1]),Ue().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=H,l=Ue();if(B){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),b===null)throw Error(k(349));Bt&30||dc(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,fs(pc.bind(null,r,o,e),[e]),r.flags|=2048,sr(9,fc.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Ue(),t=b.identifierPrefix;if(B){var n=Je,r=Xe;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ir++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Be]=t,e[rr]=r,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ro(n,r),n){case"dialog":A("cancel",e),A("close",e),l=r;break;case"iframe":case"object":case"embed":A("load",e),l=r;break;case"video":case"audio":for(l=0;lkn&&(t.flags|=128,r=!0,zn(o,!1),t.lanes=4194304)}else{if(!r)if(e=dl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!B)return le(t),null}else 2*G()-o.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,zn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=G(),t.sibling=null,n=V.current,R(V,r?n&1|2:n&1),t):(le(t),null);case 22:case 23:return au(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ye&1073741824&&(le(t),t.subtreeFlags&6&&(t.flags|=8192)):le(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function S0(e,t){switch(Hi(t),t.tag){case 1:return he(t.type)&&ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),U(me),U(ie),qi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ji(t),null;case 13:if(U(V),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(V),null;case 4:return xn(),null;case 10:return Zi(t.type._context),null;case 22:case 23:return au(),null;case 24:return null;default:return null}}var Or=!1,oe=!1,E0=typeof WeakSet=="function"?WeakSet:Set,T=null;function un(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Q(e,t,r)}else n.current=null}function ci(e,t,n){try{n()}catch(r){Q(e,t,r)}}var ks=!1;function C0(e,t){if(Zo=el,e=Va(),Bi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,v=0,m=e,h=null;t:for(;;){for(var x;m!==n||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(x=m.firstChild)!==null;)h=m,m=x;for(;;){if(m===e)break t;if(h===n&&++a===l&&(u=i),h===o&&++v===r&&(s=i),(x=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=x}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Go={focusedElem:e,selectionRange:n},el=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var S=g.memoizedProps,L=g.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:ze(t.type,S),L);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(w){Q(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return g=ks,ks=!1,g}function Hn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&ci(t,n,o)}l=l.next}while(l!==r)}}function Ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function di(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ac(e){var t=e.alternate;t!==null&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Be],delete t[rr],delete t[Jo],delete t[i0],delete t[u0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uc(e){return e.tag===5||e.tag===3||e.tag===4}function Ss(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rl));else if(r!==4&&(e=e.child,e!==null))for(fi(e,t,n),e=e.sibling;e!==null;)fi(e,t,n),e=e.sibling}function pi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(pi(e,t,n),e=e.sibling;e!==null;)pi(e,t,n),e=e.sibling}var ee=null,Me=!1;function ot(e,t,n){for(n=n.child;n!==null;)Bc(e,t,n),n=n.sibling}function Bc(e,t,n){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:oe||un(n,t);case 6:var r=ee,l=Me;ee=null,ot(e,t,n),ee=r,Me=l,ee!==null&&(Me?(e=ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ee.removeChild(n.stateNode));break;case 18:ee!==null&&(Me?(e=ee,n=n.stateNode,e.nodeType===8?ao(e.parentNode,n):e.nodeType===1&&ao(e,n),qn(e)):ao(ee,n.stateNode));break;case 4:r=ee,l=Me,ee=n.stateNode.containerInfo,Me=!0,ot(e,t,n),ee=r,Me=l;break;case 0:case 11:case 14:case 15:if(!oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&ci(n,t,i),l=l.next}while(l!==r)}ot(e,t,n);break;case 1:if(!oe&&(un(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Q(n,t,u)}ot(e,t,n);break;case 21:ot(e,t,n);break;case 22:n.mode&1?(oe=(r=oe)||n.memoizedState!==null,ot(e,t,n),oe=r):ot(e,t,n);break;default:ot(e,t,n)}}function Es(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new E0),t.forEach(function(r){var l=O0.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=G()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*j0(r/1960))-r,10e?16:e,dt===null)var r=!1;else{if(e=dt,dt=null,vl=0,F&6)throw Error(k(331));var l=F;for(F|=4,T=e.current;T!==null;){var o=T,i=o.child;if(T.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sG()-uu?Rt(e,0):iu|=n),ve(e,t)}function Yc(e,t){t===0&&(e.mode&1?(t=Cr,Cr<<=1,!(Cr&130023424)&&(Cr=4194304)):t=1);var n=ae();e=tt(e,t),e!==null&&(dr(e,t,n),ve(e,n))}function M0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yc(e,n)}function O0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),Yc(e,n)}var Xc;Xc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||me.current)pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pe=!1,w0(e,t,n);pe=!!(e.flags&131072)}else pe=!1,B&&t.flags&1048576&&ba(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qr(e,t),e=t.pendingProps;var l=vn(t,ie.current);pn(t,n),l=eu(null,t,r,e,l,n);var o=tu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,he(r)?(o=!0,ol(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Yi(t),l.updater=Tl,t.stateNode=l,l._reactInternals=t,ri(t,r,e,n),t=ii(null,t,r,!0,o,n)):(t.tag=0,B&&o&&Vi(t),se(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=I0(r),e=ze(r,e),l){case 0:t=oi(null,t,r,e,n);break e;case 1:t=ys(null,t,r,e,n);break e;case 11:t=vs(null,t,r,e,n);break e;case 14:t=gs(null,t,r,ze(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),ys(e,t,r,l,n);case 3:e:{if(Oc(t),e===null)throw Error(k(387));r=t.pendingProps,o=t.memoizedState,l=o.element,rc(e,t),cl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=wn(Error(k(423)),t),t=xs(e,t,r,n,l);break e}else if(r!==l){l=wn(Error(k(424)),t),t=xs(e,t,r,n,l);break e}else for(xe=vt(t.stateNode.containerInfo.firstChild),we=t,B=!0,Oe=null,n=uc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gn(),r===l){t=nt(e,t,n);break e}se(e,t,r,n)}t=t.child}return t;case 5:return sc(t),e===null&&ei(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Yo(r,l)?i=null:o!==null&&Yo(r,o)&&(t.flags|=32),Mc(e,t),se(e,t,i,n),t.child;case 6:return e===null&&ei(t),null;case 13:return Fc(e,t,n);case 4:return Xi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yn(t,null,r,n):se(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),vs(e,t,r,l,n);case 7:return se(e,t,t.pendingProps,n),t.child;case 8:return se(e,t,t.pendingProps.children,n),t.child;case 12:return se(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,R(sl,r._currentValue),r._currentValue=i,o!==null)if(De(o.value,i)){if(o.children===l.children&&!me.current){t=nt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=qe(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var v=a.pending;v===null?s.next=s:(s.next=v.next,v.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ti(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(k(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),ti(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}se(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,pn(t,n),l=Te(l),r=r(l),t.flags|=1,se(e,t,r,n),t.child;case 14:return r=t.type,l=ze(r,t.pendingProps),l=ze(r.type,l),gs(e,t,r,l,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),Qr(e,t),t.tag=1,he(r)?(e=!0,ol(t)):e=!1,pn(t,n),oc(t,r,l),ri(t,r,l,n),ii(null,t,r,!0,e,n);case 19:return Ic(e,t,n);case 22:return zc(e,t,n)}throw Error(k(156,t.tag))};function Jc(e,t){return Ea(e,t)}function F0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function je(e,t,n,r){return new F0(e,t,n,r)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function I0(e){if(typeof e=="function")return du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Li)return 11;if(e===zi)return 14}return 2}function wt(e,t){var n=e.alternate;return n===null?(n=je(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gr(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")du(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Jt:return $t(n.children,l,o,t);case Pi:i=8,l|=8;break;case No:return e=je(12,n,t,l|2),e.elementType=No,e.lanes=o,e;case To:return e=je(13,n,t,l),e.elementType=To,e.lanes=o,e;case Po:return e=je(19,n,t,l),e.elementType=Po,e.lanes=o,e;case ia:return Ml(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case la:i=10;break e;case oa:i=9;break e;case Li:i=11;break e;case zi:i=14;break e;case it:i=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=je(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function $t(e,t,n,r){return e=je(7,e,r,t),e.lanes=n,e}function Ml(e,t,n,r){return e=je(22,e,r,t),e.elementType=ia,e.lanes=n,e.stateNode={isHidden:!1},e}function yo(e,t,n){return e=je(6,e,null,t),e.lanes=n,e}function xo(e,t,n){return t=je(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D0(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ql(0),this.expirationTimes=ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ql(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,l,o,i,u,s){return e=new D0(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=je(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yi(o),e}function R0(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(td)}catch(e){console.error(e)}}td(),bs.exports=Se;var nd=bs.exports;const V0=ki(nd);var zs=nd;_o.createRoot=zs.createRoot,_o.hydrateRoot=zs.hydrateRoot;const Nt=y.createContext({listTorrents:()=>{throw new Error("Function not implemented.")},getTorrentDetails:()=>{throw new Error("Function not implemented.")},getTorrentStats:()=>{throw new Error("Function not implemented.")},uploadTorrent:()=>{throw new Error("Function not implemented.")},pause:()=>{throw new Error("Function not implemented.")},start:()=>{throw new Error("Function not implemented.")},forget:()=>{throw new Error("Function not implemented.")},delete:()=>{throw new Error("Function not implemented.")},getStreamLogsUrl:()=>null}),hr=y.createContext({setCloseableError:e=>{},refreshTorrents:()=>{}}),rd=y.createContext({refresh:()=>{}}),xl=({label:e})=>c.jsxs("div",{className:"flex gap-2 items-center w-full justify-center",children:[c.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),e?c.jsxs("span",{className:"text-sm",children:[e," ..."]}):c.jsx("span",{className:"sr-only",children:"Loading..."})]}),vu="initializing",H0="paused",W0="live",Q0="error";function gu(e,t){let n,r=t;const l=async()=>{if(r=await e(),r==null)throw"asyncCallback returned null or undefined";o()};let o=()=>{n=setTimeout(l,r)};return o(),()=>{clearTimeout(n)}}function ld(e,t){let n;const r=async()=>{await e().then(()=>!1,()=>!0)&&l()};let l=o=>{n=setTimeout(r,o!==void 0?o:t)};return l(0),()=>clearTimeout(n)}var od={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ms=ft.createContext&&ft.createContext(od),kt=globalThis&&globalThis.__assign||function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{onClick:t,disabled:n,color:r,children:l,className:o,...i}=e,u=a=>{a.stopPropagation(),!n&&t()},s=r?`text-${r}`:"";return c.jsx("a",{className:`block p-1 ${s} ${o}`,onClick:u,href:"#",...i,children:l})};function J0(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M0 .5A.5.5 0 0 1 .5 0h4a.5.5 0 0 1 0 1h-4A.5.5 0 0 1 0 .5Zm0 2A.5.5 0 0 1 .5 2h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm9 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm-9 2A.5.5 0 0 1 .5 4h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Zm5 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm7 0a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Zm-12 2A.5.5 0 0 1 .5 6h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5Zm8 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm-8 2A.5.5 0 0 1 .5 8h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm7 0a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm-7 2a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5Z"}}]})(e)}function q0(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"}}]})(e)}function ud(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}}]})(e)}const b0=({title:e,children:t,onClose:n})=>c.jsxs("div",{className:"bg-red-200 p-3 rounded-md mb-3 dark:bg-red-800/60",children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&c.jsx("button",{onClick:n,children:c.jsx(ud,{})})]}),t]}),Wt=e=>{var r,l,o;let{error:t,remove:n}=e;return t==null?null:c.jsxs(b0,{onClose:n,title:t.text,children:[((r=t.details)==null?void 0:r.statusText)&&c.jsx("div",{className:"pb-2 text-md",children:(l=t.details)==null?void 0:l.statusText}),c.jsx("div",{className:"whitespace-pre text-sm",children:(o=t.details)==null?void 0:o.text})]})};function yu(e){return e&&e.ownerDocument||document}function wo(e){e===void 0&&(e=yu());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function Os(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}const Rl=!!(typeof window<"u"&&window.document&&window.document.createElement);var yi=!1,xi=!1;try{var ko={get passive(){return yi=!0},get once(){return xi=yi=!0}};Rl&&(window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,!0))}catch{}function e1(e,t,n,r){if(r&&typeof r!="boolean"&&!xi){var l=r.once,o=r.capture,i=n;!xi&&l&&(i=n.__once||function u(s){this.removeEventListener(t,u,o),n.call(this,s)},n.__once=i),e.addEventListener(t,i,yi?r:o)}e.addEventListener(t,n,r)}function t1(e,t,n,r){var l=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,l),n.__once&&e.removeEventListener(t,n.__once,l)}function Fs(e,t,n,r){return e1(e,t,n,r),function(){t1(e,t,n,r)}}function n1(){const e=y.useRef(!0),t=y.useRef(()=>e.current);return y.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function r1(e){const t=y.useRef(e);return t.current=e,t}function l1(e){const t=r1(e);y.useEffect(()=>()=>t.current(),[])}function o1(e){const t=y.useRef(null);return y.useEffect(()=>{t.current=e}),t.current}function i1(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e},[e]),t}function Ot(e){const t=i1(e);return y.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function u1(e){var t=yu(e);return t&&t.defaultView||window}function s1(e,t){return u1(e).getComputedStyle(e,t)}var a1=/([A-Z])/g;function c1(e){return e.replace(a1,"-$1").toLowerCase()}var d1=/^ms-/;function Dr(e){return c1(e).replace(d1,"-ms-")}var f1=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function p1(e){return!!(e&&f1.test(e))}function Is(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Dr(t))||s1(e).getPropertyValue(Dr(t));Object.keys(t).forEach(function(l){var o=t[l];!o&&o!==0?e.style.removeProperty(Dr(l)):p1(l)?r+=l+"("+o+") ":n+=Dr(l)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}const m1="data-rr-ui-";function h1(e){return`${m1}${e}`}function v1(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const Ds=h1("modal-open");class g1{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return v1(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",l=this.getElement();t.style={overflow:l.style.overflow,[r]:l.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(Is(l,r)||"0",10)+t.scrollBarWidth}px`),l.setAttribute(Ds,""),Is(l,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(Ds),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const sd=g1,ad=y.createContext(Rl?window:void 0);ad.Provider;function xu(){return y.useContext(ad)}const So=(e,t)=>Rl?e==null?(t||yu()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function y1(e,t){const n=xu(),[r,l]=y.useState(()=>So(e,n==null?void 0:n.document));if(!r){const o=So(e);o&&l(o)}return y.useEffect(()=>{t&&r&&t(r)},[t,r]),y.useEffect(()=>{const o=So(e);o!==r&&l(o)},[e,r]),r}const Rs=e=>!e||typeof e=="function"?e:t=>{e.current=t};function x1(e,t){const n=Rs(e),r=Rs(t);return l=>{n&&n(l),r&&r(l)}}function cd(e,t){return y.useMemo(()=>x1(e,t),[e,t])}const w1=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",k1=typeof document<"u",$s=k1||w1?y.useLayoutEffect:y.useEffect;function S1({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:l}){const o=y.useRef(null),i=y.useRef(t),u=Ot(n);y.useEffect(()=>{t?i.current=!0:u(o.current)},[t,u]);const s=cd(o,e.ref),a=y.cloneElement(e,{ref:s});return t?a:l||!i.current&&r?null:a}function E1({in:e,onTransition:t}){const n=y.useRef(null),r=y.useRef(!0),l=Ot(t);return $s(()=>{if(!n.current)return;let o=!1;return l({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,l]),$s(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function C1({children:e,in:t,onExited:n,onEntered:r,transition:l}){const[o,i]=y.useState(!t);t&&o&&i(!1);const u=E1({in:!!t,onTransition:a=>{const v=()=>{a.isStale()||(a.in?r==null||r(a.element,a.initial):(i(!0),n==null||n(a.element)))};Promise.resolve(l(a)).then(v,m=>{throw a.in||i(!0),m})}}),s=cd(u,e.ref);return o&&!t?null:y.cloneElement(e,{ref:s})}function As(e,t,n){return e?c.jsx(e,Object.assign({},n)):t?c.jsx(C1,Object.assign({},n,{transition:t})):c.jsx(S1,Object.assign({},n))}function _1(e){return e.code==="Escape"||e.keyCode===27}const j1=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function N1(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o=0)&&(n[l]=e[l]);return n}let Eo;function T1(e){return Eo||(Eo=new sd({ownerDocument:e==null?void 0:e.document})),Eo}function P1(e){const t=xu(),n=e||T1(t),r=y.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:y.useCallback(l=>{r.current.dialog=l},[]),setBackdropRef:y.useCallback(l=>{r.current.backdrop=l},[])})}const dd=y.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:l,style:o,children:i,backdrop:u=!0,keyboard:s=!0,onBackdropClick:a,onEscapeKeyDown:v,transition:m,runTransition:h,backdropTransition:x,runBackdropTransition:g,autoFocus:S=!0,enforceFocus:L=!0,restoreFocus:f=!0,restoreFocusOptions:d,renderDialog:p,renderBackdrop:w=Z=>c.jsx("div",Object.assign({},Z)),manager:N,container:E,onShow:C,onHide:j=()=>{},onExit:D,onExited:M,onExiting:ge,onEnter:Tt,onEntering:Pt,onEntered:vr}=e,Vl=N1(e,j1);const Re=xu(),lt=y1(E),_=P1(N),P=n1(),z=o1(n),[$,K]=y.useState(!n),Qe=y.useRef(null);y.useImperativeHandle(t,()=>_,[_]),Rl&&!z&&n&&(Qe.current=wo(Re==null?void 0:Re.document)),n&&$&&K(!1);const $e=Ot(()=>{if(_.add(),Wl.current=Fs(document,"keydown",hd),Hl.current=Fs(document,"focus",()=>setTimeout(Ke),!0),C&&C(),S){var Z,Su;const Kl=wo((Z=(Su=_.dialog)==null?void 0:Su.ownerDocument)!=null?Z:Re==null?void 0:Re.document);_.dialog&&Kl&&!Os(_.dialog,Kl)&&(Qe.current=Kl,_.dialog.focus())}}),Lt=Ot(()=>{if(_.remove(),Wl.current==null||Wl.current(),Hl.current==null||Hl.current(),f){var Z;(Z=Qe.current)==null||Z.focus==null||Z.focus(d),Qe.current=null}});y.useEffect(()=>{!n||!lt||$e()},[n,lt,$e]),y.useEffect(()=>{$&&Lt()},[$,Lt]),l1(()=>{Lt()});const Ke=Ot(()=>{if(!L||!P()||!_.isTopModal())return;const Z=wo(Re==null?void 0:Re.document);_.dialog&&Z&&!Os(_.dialog,Z)&&_.dialog.focus()}),Zt=Ot(Z=>{Z.target===Z.currentTarget&&(a==null||a(Z),u===!0&&j())}),hd=Ot(Z=>{s&&_1(Z)&&_.isTopModal()&&(v==null||v(Z),Z.defaultPrevented||j())}),Hl=y.useRef(),Wl=y.useRef(),vd=(...Z)=>{K(!0),M==null||M(...Z)};if(!lt)return null;const ku=Object.assign({role:r,ref:_.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},Vl,{style:o,className:l,tabIndex:-1});let Ql=p?p(ku):c.jsx("div",Object.assign({},ku,{children:y.cloneElement(i,{role:"document"})}));Ql=As(m,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:D,onExiting:ge,onExited:vd,onEnter:Tt,onEntering:Pt,onEntered:vr,children:Ql});let gr=null;return u&&(gr=w({ref:_.setBackdropRef,onClick:Zt}),gr=As(x,g,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:gr})),c.jsx(c.Fragment,{children:V0.createPortal(c.jsxs(c.Fragment,{children:[gr,Ql]}),lt)})});dd.displayName="Modal";const L1=Object.assign(dd,{Manager:sd}),z1=({onClose:e,title:t})=>c.jsxs("div",{className:"flex p-3 justify-between items-center border-b dark:border-slate-600",children:[c.jsx("h2",{className:"text-xl font-semibold dark:slate-300",children:t}),e&&c.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:e,"aria-label":"Close modal",children:c.jsx(ud,{className:"w-5 h-5"})})]}),$l=({isOpen:e,onClose:t,title:n,children:r,className:l})=>{const o=()=>c.jsx("div",{className:"fixed inset-0 bg-black/30 z-[300] dark:bg-black/60 backdrop-blur"});return c.jsx(L1,{show:e,onHide:t,renderBackdrop:o,className:"fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto",children:c.jsxs("div",{className:`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${l} dark:bg-slate-800 dark:text-zinc-50`,children:[c.jsx(z1,{onClose:t,title:n}),r]})})},Al=({children:e})=>c.jsx("div",{className:"p-3 border-b dark:border-slate-500",children:e}),Ul=({children:e,className:t})=>c.jsx("div",{className:`p-3 flex justify-end gap-2 ${t}`,children:e}),Ve=({onClick:e,children:t,className:n,disabled:r,variant:l})=>{let o={secondary:"hover:bg-blue-500 transition-colors hover:text-white dark:hover:bg-blue-900/50",danger:"bg-red-400 text-white border-green-50 hover:border-red-700 hover:bg-red-600 dark:bg-red-800 dark:border-none dark:hover:bg-red-900",primary:"bg-blue-600 text-white hover:bg-blue-800 disabled:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-300 dark:border-none",cancel:"hover:bg-slate-200 dark:bg-slate-600 dark:hover:bg-slate-700 dark:border-none",none:""}[l??"secondary"];return c.jsx("button",{disabled:r,onClick:i=>{i.preventDefault(),e()},className:`inline-flex items-center gap-1 border rounded-lg disabled:cursor-not-allowed px-2 py-1 transition-colors duration-300 dark:border-slate-700 ${o} ${n}`,children:t})},M1=({id:e,show:t,onHide:n})=>{if(!t)return null;const[r,l]=y.useState(!1),[o,i]=y.useState(null),[u,s]=y.useState(!1),a=y.useContext(hr),v=y.useContext(Nt),m=()=>{l(!1),i(null),s(!1),n()},h=()=>{s(!0),(r?v.delete:v.forget)(e).then(()=>{a.refreshTorrents(),m()}).catch(g=>{i({text:`Error deleting torrent id=${e}`,details:g}),s(!1)})};return c.jsxs($l,{isOpen:t,onClose:n,title:"Delete torrent",children:[c.jsxs(Al,{children:[c.jsx("p",{className:"text-gray-700 dark:text-slate-300",children:"Are you sure you want to delete the torrent?"}),c.jsxs("div",{className:"mt-4 flex items-center",children:[c.jsx("input",{type:"checkbox",id:"deleteFiles",className:"form-checkbox h-4 w-4 text-blue-500",onChange:()=>l(!r),checked:r,placeholder:"Also delete files"}),c.jsx("label",{htmlFor:"deleteFiles",className:"ml-2 text-gray-700 dark:text-slate-300",children:"Also delete files"})]}),o&&c.jsx(Wt,{error:o})]}),c.jsxs(Ul,{children:[u&&c.jsx(xl,{}),c.jsx(Ve,{variant:"cancel",onClick:m,children:"Cancel"}),c.jsx(Ve,{variant:"danger",onClick:h,disabled:u,children:"Delete Torrent"})]})]})};function O1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function F1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function I1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}const D1=({id:e,statsResponse:t})=>{let n=t.state,[r,l]=y.useState(!1),[o,i]=y.useState(!1),u=y.useContext(rd);const s=n=="live",a=n=="paused"||n=="error",v=y.useContext(hr),m=y.useContext(Nt),h=()=>{l(!0),m.start(e).then(()=>{u.refresh()},L=>{v.setCloseableError({text:`Error starting torrent id=${e}`,details:L})}).finally(()=>l(!1))},x=()=>{l(!0),m.pause(e).then(()=>{u.refresh()},L=>{v.setCloseableError({text:`Error pausing torrent id=${e}`,details:L})}).finally(()=>l(!1))},g=()=>{l(!0),i(!0)},S=()=>{l(!1),i(!1)};return c.jsxs("div",{className:"flex w-full justify-center gap-2 dark:text-slate-300",children:[a&&c.jsx(Kn,{onClick:h,disabled:r,children:c.jsx(F1,{className:"hover:text-green-500 transition-colors duration-300"})}),s&&c.jsx(Kn,{onClick:x,disabled:r,children:c.jsx(O1,{className:"hover:text-yellow-500 transition-colors duration-300"})}),c.jsx(Kn,{onClick:g,disabled:r,children:c.jsx(I1,{className:"hover:text-red-500 transition-colors duration-500"})}),c.jsx(M1,{id:e,show:o,onHide:S})]})},R1=({now:e,variant:t,label:n})=>{const r=n??`${e.toFixed(2)}%`,l={warn:"bg-yellow-500",info:"bg-blue-500 text-white",success:"bg-green-700 text-white",error:"bg-red-500 text-white"}[t??"info"];return c.jsx("div",{className:"w-full bg-gray-200 rounded-full dark:bg-gray-500",children:c.jsx("div",{className:`text-xs bg-blue-500 font-medium transition-all text-center p-0.5 leading-none rounded-full ${l}`,style:{width:`${e}%`},children:r})})};function wl(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const $1=({statsResponse:e})=>{var t,n;switch(e.state){case H0:return"Paused";case vu:return"Checking files";case Q0:return"Error"}return e.state!="live"||e.live===null?e.state:c.jsxs(c.Fragment,{children:[!e.finished&&c.jsxs("div",{className:"download-speed",children:["↓ ",(t=e.live.download_speed)==null?void 0:t.human_readable]}),c.jsxs("div",{className:"upload-speed",children:["↑ ",(n=e.live.upload_speed)==null?void 0:n.human_readable,e.live.snapshot.uploaded_bytes>0&&c.jsxs("span",{children:["(",wl(e.live.snapshot.uploaded_bytes),")"]})]})]})};function A1(e){return e.files.filter(n=>n.included).reduce((n,r)=>n.length>r.length?n:r).name}function U1(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,l=(o,i)=>o>0?`${o}${i}`:"";return t>0?`${l(t,"h")} ${l(n,"m")}`.trim():n>0?`${l(n,"m")} ${l(r,"s")}`.trim():`${l(r,"s")}`.trim()}function B1(e){var n,r,l;let t=(l=(r=(n=e==null?void 0:e.live)==null?void 0:n.time_remaining)==null?void 0:r.duration)==null?void 0:l.secs;return t==null?"N/A":U1(t)}function V1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}}]})(e)}function H1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}}]})(e)}function W1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(e)}function Q1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M9 16h6v-6h4l-7-7-7 7h4v6zm3-10.17L14.17 8H13v6h-2V8H9.83L12 5.83zM5 18h14v2H5z"}}]})(e)}function K1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12c0-1.19.22-2.32.6-3.38l1.88.68C4.17 10.14 4 11.05 4 12c0 4.41 3.59 8 8 8s8-3.59 8-8-3.59-8-8-8c-.95 0-1.85.17-2.69.48l-.68-1.89C9.69 2.22 10.82 2 12 2c5.52 0 10 4.48 10 10zM5.5 4C4.67 4 4 4.67 4 5.5S4.67 7 5.5 7 7 6.33 7 5.5 6.33 4 5.5 4zM11 16V8H9v8h2zm4 0V8h-2v8h2z"}}]})(e)}const Z1=({className:e,finished:t,live:n,error:r})=>{const l=t&&n;return r?c.jsx(H1,{className:e,color:"red"}):l?c.jsx(Q1,{className:e,color:"green"}):t?c.jsx(V1,{className:e,color:"green"}):n?c.jsx(W1,{className:`text-blue-500 ${e}`}):c.jsx(K1,{className:e})},G1=({id:e,detailsResponse:t,statsResponse:n})=>{const r=(n==null?void 0:n.state)??"",l=(n==null?void 0:n.error)??null,o=(n==null?void 0:n.total_bytes)??1,i=(n==null?void 0:n.progress_bytes)??0,u=(n==null?void 0:n.finished)||!1,s=l?100:i/o*100,a=()=>{var h;let m=(h=n==null?void 0:n.live)==null?void 0:h.snapshot.peer_stats;return m?`${m.live} / ${m.seen}`:""},v=m=>c.jsx(Z1,{className:m,error:!!l,live:!!(n!=null&&n.live),finished:u});return c.jsxs("section",{className:"flex flex-col sm:flex-row items-center gap-2 border p-2 border-gray-200 rounded-xl shadow-xs hover:drop-shadow-sm dark:bg-slate-800 dark:border-slate-900",children:[c.jsx("div",{className:"hidden md:block",children:v("w-10 h-10")}),c.jsxs("div",{className:"w-full flex flex-col gap-2",children:[t&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"md:hidden",children:v("w-5 h-5")}),c.jsx("div",{className:"text-left text-lg text-gray-900 text-ellipsis break-all dark:text-slate-200",children:A1(t)})]}),l?c.jsxs("p",{className:"text-red-500 text-sm",children:[c.jsx("strong",{children:"Error:"})," ",l]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsx(R1,{now:s,label:l,variant:r==vu?"warn":u?"success":"info"})}),c.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 sm:flex-wrap items-center text-sm text-nowrap font-medium text-gray-500",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(X0,{})," ",a().toString()]}),c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(Y0,{}),c.jsxs("div",{children:[wl(i),"/",wl(o)]})]}),n&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(G0,{}),B1(n)]}),c.jsx("div",{className:"flex gap-2 items-center",children:c.jsx($1,{statsResponse:n})})]})]})]})]}),n&&c.jsx("div",{className:"",children:c.jsx(D1,{id:e,statsResponse:n})})]})},Y1=({id:e,torrent:t})=>{const[n,r]=y.useState(null),[l,o]=y.useState(null),[i,u]=y.useState(0),s=y.useContext(Nt),a=()=>{u(i+1)};return y.useEffect(()=>{if(n===null)return ld(async()=>{await s.getTorrentDetails(t.id).then(r)},1e3)},[n]),y.useEffect(()=>gu(async()=>s.getTorrentStats(t.id).then(x=>(o(x),x)).then(x=>x.state==vu||x.state==W0?1e3:1e4,()=>1e4),0),[i]),c.jsx(rd.Provider,{value:{refresh:a},children:c.jsx(G1,{id:e,detailsResponse:n,statsResponse:l})})},X1=e=>c.jsx("div",{className:"flex flex-col gap-2 mx-2 pb-3 sm:px-7",children:e.torrents===null?e.loading?c.jsx(xl,{label:"Loading torrent list"}):null:e.torrents.length===0?c.jsx("p",{className:"text-center",children:"No existing torrents found."}):e.torrents.map(t=>c.jsx(c.Fragment,{children:c.jsx(Y1,{id:t.id,torrent:t},t.id)}))}),J1=e=>{let t=y.useContext(hr);return c.jsxs("div",{className:"container mx-auto",children:[c.jsx(Wt,{error:e.closeableError,remove:()=>t.setCloseableError(null)}),c.jsx(Wt,{error:e.otherError}),c.jsx(X1,{torrents:e.torrents,loading:e.torrentsLoading})]})};var q1="Expected a function",Us=0/0,b1="[object Symbol]",ep=/^\s+|\s+$/g,tp=/^[-+]0x[0-9a-f]+$/i,np=/^0b[01]+$/i,rp=/^0o[0-7]+$/i,lp=parseInt,op=typeof yr=="object"&&yr&&yr.Object===Object&&yr,ip=typeof self=="object"&&self&&self.Object===Object&&self,up=op||ip||Function("return this")(),sp=Object.prototype,ap=sp.toString,cp=Math.max,dp=Math.min,Co=function(){return up.Date.now()};function fp(e,t,n){var r,l,o,i,u,s,a=0,v=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(q1);t=Bs(t)||0,wi(n)&&(v=!!n.leading,m="maxWait"in n,o=m?cp(Bs(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function x(E){var C=r,j=l;return r=l=void 0,a=E,i=e.apply(j,C),i}function g(E){return a=E,u=setTimeout(f,t),v?x(E):i}function S(E){var C=E-s,j=E-a,D=t-C;return m?dp(D,o-j):D}function L(E){var C=E-s,j=E-a;return s===void 0||C>=t||C<0||m&&j>=o}function f(){var E=Co();if(L(E))return d(E);u=setTimeout(f,S(E))}function d(E){return u=void 0,h&&r?x(E):(r=l=void 0,i)}function p(){u!==void 0&&clearTimeout(u),a=0,r=s=l=u=void 0}function w(){return u===void 0?i:d(Co())}function N(){var E=Co(),C=L(E);if(r=arguments,l=this,s=E,C){if(u===void 0)return g(s);if(m)return u=setTimeout(f,t),x(s)}return u===void 0&&(u=setTimeout(f,t)),i}return N.cancel=p,N.flush=w,N}function wi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pp(e){return!!e&&typeof e=="object"}function mp(e){return typeof e=="symbol"||pp(e)&&ap.call(e)==b1}function Bs(e){if(typeof e=="number")return e;if(mp(e))return Us;if(wi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=wi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ep,"");var n=np.test(e);return n||rp.test(e)?lp(e.slice(2),n?2:8):tp.test(e)?Us:+e}var hp=fp;const vp=ki(hp),gp=({span:e})=>{let t=Object.entries(e).filter(([n,r])=>n!="name");return t.length==0?null:c.jsxs(c.Fragment,{children:["{",t.map(([n,r])=>c.jsxs("span",{children:[n," = ",r]},n)).reduce((n,r)=>c.jsxs(c.Fragment,{children:[n,", ",r]})),"}"]})},yp=({span:e})=>c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-bold",children:e.name}),c.jsx(gp,{span:e}),c.jsx("span",{className:"font-bold",children:":"})]}),xp=({fields:e})=>c.jsxs("span",{className:`m-1 ${e.message.match(/error|fail/g)?"text-red-500":"text-slate-500 dark:text-slate-200"}`,children:[e.message,Object.entries(e).filter(([t,n])=>t!="message").map(([t,n])=>c.jsxs("span",{className:"m-1",children:[c.jsx("span",{className:"italic font-bold",children:t}),"=",n]},t))]}),wp=ft.memo(({line:e})=>{var r;const t=e,n=l=>{switch(l){case"DEBUG":return"text-blue-500";case"INFO":return"text-green-500";case"WARN":return"text-amber-500";case"ERROR":return"text-red-500";default:return"text-slate-500"}};return c.jsxs("p",{className:"font-mono m-0 text-break text-[10px]",children:[c.jsx("span",{className:"m-1 text-slate-500 dark:text-slate-400",children:t.timestamp}),c.jsx("span",{className:`m-1 ${n(t.level)}`,children:t.level}),c.jsx("span",{className:"m-1",children:(r=t.spans)==null?void 0:r.map((l,o)=>c.jsx(yp,{span:l},o))}),c.jsx("span",{className:"m-1 text-slate-500 dark:text-slate-400",children:t.target}),c.jsx(xp,{fields:t.fields})]})}),fd=({children:e})=>c.jsx("form",{children:e}),wu=({autoFocus:e,value:t,name:n,disabled:r,onChange:l,onKeyDown:o,label:i,help:u,inputType:s,placeholder:a})=>c.jsxs("div",{className:"flex flex-col gap-2 text-sm mb-2",children:[c.jsx("label",{htmlFor:n,className:"dark:text-white",children:i}),c.jsx("input",{autoFocus:e,type:s,className:"block border rounded bg-transparent py-1.5 pl-2 text-gray-800 focus:ring-0 sm:text-sm sm:leading-6 dark:text-slate-300",id:n,name:n,disabled:r,placeholder:a,value:t,onKeyDown:o,onChange:l}),u&&c.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-300",children:u})]}),kp=(e,t)=>{if(e.length===0)return t;if(t.length===0)return e;const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n},Sp=(e,t,n)=>{const r=new AbortController,l=r.signal;let o=!1;const i=()=>{console.log("cancelling fetch"),o=!0,r.abort()},u=async()=>{let a=await fetch(e,{signal:l});if(!a.ok){let h=await a.text();throw n({text:"error fetching logs",details:{statusText:a.statusText,text:h}}),null}if(!a.body){n({text:"error fetching logs: ReadableStream not supported."});return}n(null);const v=a.body.getReader();let m=new Uint8Array;for(;;){const{done:h,value:x}=await v.read();if(h)throw n({text:"log stream terminated"}),null;m=kp(m,x);for(let g;(g=m.indexOf(10))!==-1;){let S=m.slice(0,g),L=new TextDecoder().decode(S);t(L),m=m.slice(g+1)}}};let s=ld(()=>u().then(()=>{},a=>{if(!o&&a!==null)throw n({text:"error streaming logs",details:{text:a.toString()}}),a}),1e3);return()=>{i(),s()}},Ep=({url:e,maxLines:t})=>{const[n,r]=y.useState([]),[l,o]=y.useState(null),[i,u]=y.useState(""),s=y.useRef(null),a=t??1e3,v=y.useCallback(g=>{r(S=>[{id:S.length==0?0:S[0].id+1,content:g,parsed:JSON.parse(g),show:s.current?!!g.match(s.current):!0},...S.slice(0,a-1)])},[s.current,t]),m=y.useRef(v);m.current=v;const h=vp(g=>{let S=null;try{S=new RegExp(g)}catch{return}s.current=S,r(L=>{let f=[...L];for(let d of f)d.show=!!d.content.match(S);return f})},200),x=g=>{u(g),h(g)};return y.useEffect(()=>h.cancel,[]),y.useEffect(()=>Sp(e,g=>m.current(g),o),[e]),c.jsxs("div",{children:[c.jsx(Wt,{error:l}),c.jsxs("div",{className:"mb-3",children:["Showing last ",a," logs since this window was opened"]}),c.jsx(fd,{children:c.jsx(wu,{value:i,name:"filter",placeholder:"Enter filter (regex)",onChange:g=>x(g.target.value)})}),n.map(g=>c.jsx("div",{hidden:!g.show,children:c.jsx(wp,{line:g.parsed})},g.id))]})},Cp=({show:e,onClose:t})=>{let r=y.useContext(Nt).getStreamLogsUrl();return c.jsxs($l,{isOpen:e,onClose:t,title:"rqbit server logs",className:"max-w-7xl",children:[c.jsx(Al,{children:r?c.jsx(Ep,{url:r}):c.jsx(Wt,{error:{text:"HTTP API not available to stream logs"}})}),c.jsx(Ul,{children:c.jsx(Ve,{variant:"primary",onClick:t,children:"Close"})})]})},_p=({checked:e,name:t,disabled:n,onChange:r,label:l,help:o,inputType:i})=>c.jsxs("div",{className:"flex gap-3 items-start",children:[c.jsx("div",{className:"flex",children:c.jsx("input",{type:i||"checkbox",className:"block mt-1",id:t,name:t,disabled:n,checked:e,onChange:r})}),c.jsxs("div",{className:"text-sm flex flex-col gap-1",children:[c.jsx("label",{htmlFor:t,children:l}),o&&c.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-300 mb-3",children:o})]})]}),jp=({children:e,label:t,help:n,className:r})=>c.jsxs("fieldset",{className:`mb-4 ${r}`,children:[t&&c.jsx("label",{className:"text-md font-md mb-3 block pb-1 border-b",children:t}),e]}),Np=e=>{let{onHide:t,listTorrentResponse:n,listTorrentError:r,listTorrentLoading:l,data:o}=e;const[i,u]=y.useState([]),[s,a]=y.useState(!1),[v,m]=y.useState(null),[h,x]=y.useState(!1),[g,S]=y.useState(""),L=y.useContext(hr),f=y.useContext(Nt),d=()=>{u(n?n.details.files.map((C,j)=>j):[])};y.useEffect(()=>{console.log(n),d(),S((n==null?void 0:n.output_folder)||"")},[n]);const p=()=>{t(),u([]),m(null),a(!1)},w=C=>{i.includes(C)?u(i.filter(j=>j!==C)):u([...i,C])},N=async()=>{if(!n)return;a(!0);let C=n.seen_peers?n.seen_peers.slice(0,32):null,j={overwrite:!0,only_files:i,initial_peers:C,output_folder:g};h&&(j.peer_opts={connect_timeout:20,read_write_timeout:60}),f.uploadTorrent(o,j).then(()=>{t(),L.refreshTorrents()},D=>{m({text:"Error starting torrent",details:D})}).finally(()=>a(!1))},E=()=>{if(l)return c.jsx(xl,{label:"Loading torrent contents"});if(r)return c.jsx(Wt,{error:r});if(n)return c.jsxs(fd,{children:[c.jsx(wu,{label:"Output folder",name:"output_folder",inputType:"text",value:g,onChange:C=>S(C.target.value)}),c.jsxs(jp,{children:[c.jsx("label",{className:"text-sm mb-2 block",children:"Select files"}),c.jsxs("div",{className:"mb-3 flex gap-2",children:[c.jsx(Ve,{onClick:d,className:"text-sm",children:"Select all"}),c.jsx(Ve,{onClick:()=>u([]),className:"text-sm",children:"Deselect all"})]}),n.details.files.map((C,j)=>c.jsx(_p,{label:`${C.name} (${wl(C.length)})`,checked:i.includes(j),onChange:()=>w(j),name:`check-${j}`},j))]})]})};return c.jsxs($l,{isOpen:!0,onClose:p,title:"Add Torrent",children:[c.jsxs(Al,{children:[E(),c.jsx(Wt,{error:v})]}),c.jsxs(Ul,{children:[s&&c.jsx(xl,{}),c.jsx(Ve,{onClick:p,variant:"cancel",children:"Cancel"}),c.jsx(Ve,{onClick:N,variant:"primary",disabled:l||s||i.length==0,children:"OK"})]})]})},pd=({onClick:e,data:t,resetData:n,children:r,className:l})=>{const[o,i]=y.useState(!1),[u,s]=y.useState(null),[a,v]=y.useState(null),m=y.useContext(Nt);y.useEffect(()=>{if(t===null)return;let x=setTimeout(async()=>{i(!0);try{const g=await m.uploadTorrent(t,{list_only:!0});s(g)}catch(g){v({text:"Error listing torrent files",details:g})}finally{i(!1)}},0);return()=>clearTimeout(x)},[t]);const h=()=>{n(),v(null),s(null),i(!1)};return c.jsxs(c.Fragment,{children:[c.jsx(Ve,{onClick:e,className:l,children:r}),t&&c.jsx(Np,{onHide:h,listTorrentError:a,listTorrentResponse:u,data:t,listTorrentLoading:o})]})};function Tp(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M10 18V16H8V14H10V12H12V14H14V16H12V18H10Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2C4.34315 2 3 3.34315 3 5V19C3 20.6569 4.34315 22 6 22H18C19.6569 22 21 20.6569 21 19V9C21 5.13401 17.866 2 14 2H6ZM6 4H13V9H19V19C19 19.5523 18.5523 20 18 20H6C5.44772 20 5 19.5523 5 19V5C5 4.44772 5.44772 4 6 4ZM15 4.10002C16.6113 4.4271 17.9413 5.52906 18.584 7H15V4.10002Z",fill:"currentColor"}}]})(e)}function Pp(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M14.8284 12L16.2426 13.4142L19.071 10.5858C20.6331 9.02365 20.6331 6.49099 19.071 4.9289C17.509 3.3668 14.9763 3.3668 13.4142 4.9289L10.5858 7.75732L12 9.17154L14.8284 6.34311C15.6095 5.56206 16.8758 5.56206 17.6568 6.34311C18.4379 7.12416 18.4379 8.39049 17.6568 9.17154L14.8284 12Z",fill:"currentColor"}},{tag:"path",attr:{d:"M12 14.8285L13.4142 16.2427L10.5858 19.0711C9.02372 20.6332 6.49106 20.6332 4.92896 19.0711C3.36686 17.509 3.36686 14.9764 4.92896 13.4143L7.75739 10.5858L9.1716 12L6.34317 14.8285C5.56212 15.6095 5.56212 16.8758 6.34317 17.6569C7.12422 18.4379 8.39055 18.4379 9.1716 17.6569L12 14.8285Z",fill:"currentColor"}},{tag:"path",attr:{d:"M14.8285 10.5857C15.219 10.1952 15.219 9.56199 14.8285 9.17147C14.4379 8.78094 13.8048 8.78094 13.4142 9.17147L9.1716 13.4141C8.78107 13.8046 8.78107 14.4378 9.1716 14.8283C9.56212 15.2188 10.1953 15.2188 10.5858 14.8283L14.8285 10.5857Z",fill:"currentColor"}}]})(e)}const Lp=({className:e})=>{const t=y.useRef(),[n,r]=y.useState(null),l=async()=>{var s;if(!((s=t==null?void 0:t.current)!=null&&s.files))return;const u=t.current.files[0];r(u)},o=()=>{t!=null&&t.current&&(t.current.value="",r(null))},i=()=>{t!=null&&t.current&&t.current.click()};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"file",ref:t,accept:".torrent",onChange:l,hidden:!0}),c.jsxs(pd,{onClick:i,data:n,resetData:o,className:e,children:[c.jsx(Tp,{className:"text-blue-500 dark:text-white"}),c.jsx("div",{children:"Upload .torrent File"})]})]})},zp=({className:e})=>{const[t,n]=y.useState(null),[r,l]=y.useState(""),[o,i]=y.useState(!1),u=()=>{n(r),l(""),i(!1)},s=()=>{i(!1),n(null)};return c.jsxs(c.Fragment,{children:[c.jsxs(pd,{onClick:()=>{i(!0)},data:t,className:e,resetData:()=>n(null),children:[c.jsx(Pp,{className:"text-blue-500 dark:text-white"}),c.jsx("div",{children:"Add Torrent from Magnet / URL"})]}),c.jsxs($l,{isOpen:o,onClose:s,title:"Add torrent",children:[c.jsx(Al,{children:c.jsx(wu,{autoFocus:!0,value:r,name:"magnet",onChange:a=>l(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r&&u()},placeholder:"magnet:?xt=urn:btih:...",help:"Enter magnet or HTTP(S) URL to the .torrent"})}),c.jsxs(Ul,{children:[c.jsx(Ve,{variant:"cancel",onClick:s,children:"Cancel"}),c.jsx(Ve,{disabled:!r,variant:"primary",onClick:u,children:"Add"})]})]})]})},Mp=e=>y.createElement("svg",{width:"64mm",height:"64mm",viewBox:"0 0 64 64",id:"svg1",xmlSpace:"preserve","inkscape:version":"1.3.1 (91b66b0, 2023-11-16)","sodipodi:docname":"logo.svg","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},y.createElement("sodipodi:namedview",{id:"namedview1",pagecolor:"#ffffff",bordercolor:"#000000",borderopacity:.25,"inkscape:showpageshadow":2,"inkscape:pageopacity":0,"inkscape:pagecheckerboard":0,"inkscape:deskcolor":"#d1d1d1","inkscape:document-units":"mm","inkscape:zoom":1.4936372,"inkscape:cx":134.90559,"inkscape:cy":139.92689,"inkscape:window-width":1440,"inkscape:window-height":847,"inkscape:window-x":0,"inkscape:window-y":25,"inkscape:window-maximized":0,"inkscape:current-layer":"layer1"}),y.createElement("defs",{id:"defs1"},y.createElement("inkscape:perspective",{"sodipodi:type":"inkscape:persp3d","inkscape:vp_x":"3.1042448 : 18.147022 : 1","inkscape:vp_y":"0 : 999.99994 : 0","inkscape:vp_z":"303.94612 : 54.05812 : 1","inkscape:persp3d-origin":"105 : -134 : 1",id:"perspective4"})),y.createElement("g",{"inkscape:label":"Layer 1","inkscape:groupmode":"layer",id:"layer1",transform:"translate(-56.674541,-85.911432)"},y.createElement("path",{style:{fill:"#0d6efd",fillOpacity:1,strokeWidth:.610041},d:"m 81.603814,145.5382 -7.433116,-4.36986 -6.018097,-3.54529 -6.018099,-3.54529 -0.09405,-0.35761 -0.09406,-0.3576 v -15.31979 -15.31979 l 0.09451,-0.35939 0.09451,-0.35938 6.017643,-3.544433 6.017641,-3.544428 7.432805,-4.369167 7.432803,-4.369166 0.240089,0.09331 0.240083,0.09331 13.292394,7.826122 13.29241,7.826122 0.093,0.35355 0.093,0.35355 v 15.31979 15.31979 l -0.0928,0.35267 -0.0928,0.35266 -13.29682,7.82802 -13.296819,7.82803 -0.235583,0.0921 -0.235588,0.0921 z m 19.758596,-5.88315 12.13185,-7.15306 v -14.45996 -14.45994 l -5.11526,-3.01603 -5.11526,-3.016035 -7.017048,-4.136312 -7.017053,-4.13631 h -0.112738 -0.11273 l -7.097035,4.182089 -7.09703,4.18209 -5.035336,2.971548 -5.035335,2.97155 v 14.45761 14.45762 l 5.275113,3.11051 5.275113,3.11051 6.793709,4.02813 6.793702,4.02812 0.176743,0.0155 0.176742,0.0155 z",id:"path15","sodipodi:nodetypes":"cccccccccccccccccccccccccccccccccccccccccccccccccccc"}),y.createElement("path",{style:{fill:"#000000"},id:"path1",d:""}),y.createElement("path",{d:"m 84.161856,133.76725 -4.567369,-2.5483 -0.700367,0.28585 -0.700376,0.28584 -0.495731,0.11427 -0.495731,0.11426 -3.168791,-1.75603 -3.168782,-1.75603 -0.515321,-0.57002 -0.515323,-0.57002 0.0161,-3.59449 0.0161,-3.59448 0.164041,-0.41611 0.164042,-0.41611 1.480342,-0.85565 1.480346,-0.85565 0.06276,-3.67919 0.06276,-3.67921 0.39653,-0.35884 0.396521,-0.35886 3.663275,-2.04111 3.663267,-2.04112 0.114523,-1.62785 0.114506,-1.62786 0.229029,-0.21764 0.229038,-0.21765 3.341459,-1.854383 3.341467,-1.854382 h 0.301682 0.301682 l 2.476951,1.380374 2.476959,1.380381 1.151673,0.57845 1.151674,0.57845 0.02969,0.27424 0.02969,0.27423 0.02753,1.46272 0.02753,1.46273 3.663258,2.04521 3.66327,2.04521 0.40205,0.36386 0.40206,0.36385 v 3.60098 3.60097 l 0.28629,0.23408 0.28628,0.23408 1.43146,0.72479 1.43145,0.72479 v 3.9806 3.98059 l -0.51533,0.56995 -0.51532,0.56994 -3.19072,1.75191 -3.19072,1.75191 -0.47379,-0.11007 -0.473797,-0.11007 -0.699654,-0.28558 -0.699656,-0.28558 -4.589745,2.5527 -4.589746,2.55269 -0.321886,-0.004 -0.321886,-0.004 z m 8.681258,-1.65766 3.426793,-1.91645 0.06536,-0.19784 0.06535,-0.19785 -1.315884,-0.68709 -1.315885,-0.6871 -0.401264,-0.40081 -0.401265,-0.4008 v -3.79409 -3.79409 l 0.221568,-0.41401 0.221567,-0.414 3.411065,-1.86126 3.411061,-1.86126 h 0.38456 0.38455 l 0.91435,0.46646 0.91435,0.46646 -0.0646,-2.66249 -0.0646,-2.66248 -2.829977,-1.58148 -2.829984,-1.58149 -0.204696,0.12651 -0.204688,0.12651 v 1.11999 1.11999 l -0.744359,0.54975 -0.744358,0.54977 -2.773906,1.52318 -2.773906,1.52319 h -0.526565 -0.526565 l -3.34145,-1.85945 -3.341467,-1.85945 -0.168271,-0.2591 -0.16827,-0.25909 -0.0035,-1.07439 -0.0035,-1.07439 -0.204688,-0.12651 -0.204697,-0.12651 -2.82999,1.58149 -2.829982,1.58148 -0.06458,2.66248 -0.06458,2.66249 0.914351,-0.46646 0.914343,-0.46646 h 0.378551 0.37855 l 3.638639,1.97495 3.63864,1.97495 v 4.0944 4.09441 l -0.401265,0.4008 -0.401264,0.40081 -1.315885,0.6871 -1.315884,0.68709 0.06535,0.19785 0.06536,0.19784 3.426792,1.91645 3.426785,1.91644 h 0.343552 0.343544 z m -16.416873,-5.4431 -0.06475,-2.55838 -2.046125,-1.10985 -2.046124,-1.10984 -0.195677,0.19567 -0.195685,0.19568 0.06596,2.2656 0.06596,2.2656 2.06129,1.18713 2.06129,1.18713 0.179282,0.0198 0.179273,0.0198 z m 4.515881,1.34369 2.061291,-1.19456 0.06527,-2.48747 0.06527,-2.48748 -0.408821,0.15589 -0.408848,0.15589 -1.889514,1.02885 -1.889514,1.02885 v 2.50736 2.50736 l 0.171777,-0.01 0.171767,-0.01 z m 18.666131,-1.29267 v -2.50736 l -1.889509,-1.02885 -1.889522,-1.02885 -0.40883,-0.15589 -0.408839,-0.15589 0.06527,2.48748 0.06527,2.48747 2.061291,1.19456 2.061288,1.19456 0.171777,0.01 0.171774,0.01 z m 4.466127,1.28059 2.06129,-1.18713 0.0661,-2.2656 0.066,-2.2656 -0.19568,-0.19568 -0.19568,-0.19567 -2.04613,1.10984 -2.04612,1.10985 -0.0647,2.55838 -0.0648,2.55838 0.17927,-0.0198 0.17927,-0.0198 z m -24.281888,-6.71835 1.960418,-1.07415 -0.07566,-0.22693 -0.07566,-0.22691 -2.049423,-1.09443 -2.049431,-1.09442 -2.116604,1.14523 -2.116613,1.14523 v 0.17781 0.17782 l 2.004029,1.06709 2.004037,1.06711 0.277236,0.005 0.277237,0.005 z m 23.056528,4.3e-4 2.03643,-1.07372 -0.0708,-0.21245 -0.0708,-0.21244 -2.09332,-1.13015 -2.09332,-1.13016 -2.077692,1.17124 -2.077685,1.17123 v 0.17384 0.17386 l 1.889522,1.0551 1.889505,1.0551 0.31588,0.0161 0.31587,0.0161 z m -14.742004,-11.90808 0.06492,-2.2946 -0.293917,-0.23052 -0.293926,-0.2305 -2.011741,-1.08631 -2.01175,-1.08629 0.06501,2.57478 0.06501,2.57476 1.946776,1.09773 1.946767,1.09773 0.229038,-0.0611 0.229029,-0.0611 z m 4.401245,1.31989 1.946767,-1.09857 0.06501,-2.57476 0.06501,-2.57478 -2.01175,1.08629 -2.011741,1.08631 -0.286291,0.22417 -0.286291,0.22418 v 2.22411 2.2241 l 0.152689,0.15269 0.152689,0.15269 0.133602,-0.0139 0.133602,-0.0139 z m -1.021015,-6.79999 1.952048,-1.05546 -0.224347,-0.26147 -0.224337,-0.26149 -1.958921,-1.03065 -1.958911,-1.03064 -1.958912,1.03064 -1.958912,1.03065 -0.224303,0.26142 -0.224277,0.26141 1.896915,1.04261 1.896906,1.04261 0.517494,0.0129 0.517501,0.0129 z",style:{fill:"#0d6efd",fillOpacity:1,strokeWidth:.865634},id:"path1-8"}))),Op=({title:e})=>{const[t,n]=e.split("-");return c.jsxs("header",{className:"bg-slate-50 drop-shadow-lg flex flex-wrap justify-center lg:justify-between items-center dark:bg-slate-800 mb-3",children:[c.jsxs("div",{className:"flex flex-nowrap items-center justify-between m-2",children:[c.jsx(Mp,{className:"w-10 h-10 p-1",alt:"logo"}),c.jsxs("h1",{className:"flex items-center dark:text-white",children:[c.jsx("div",{className:"text-3xl",children:t}),c.jsx("div",{className:"bg-blue-100 text-blue-800 text-xl font-semibold me-2 px-2.5 py-0.5 rounded ms-2 dark:bg-blue-900 dark:text-white",children:n})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-1 m-2",children:[c.jsx(zp,{className:"flex-grow justify-center dark:text-white"}),c.jsx(Lp,{className:"flex-grow justify-center dark:text-white"})]})]})};let Yt=window.matchMedia("(prefers-color-scheme: dark)").matches;window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{Bl.setDark(e.matches)});const Bl={isDark:()=>Yt,setDark:e=>(Yt=e,document.body.classList.toggle("dark",Yt),Yt),toggle:()=>{Bl.setDark(!Yt)}};Bl.setDark(Yt);const Fp=e=>{const[t,n]=y.useState(null),[r,l]=y.useState(null),[o,i]=y.useState(null),[u,s]=y.useState(!1);let[a,v]=y.useState(!1);const m=y.useContext(Nt),h=async()=>{s(!0);let g=await m.listTorrents().finally(()=>s(!1));i(g.torrents)};y.useEffect(()=>gu(async()=>h().then(()=>(l(null),5e3),g=>(l({text:"Error refreshing torrents",details:g}),console.error(g),5e3)),0),[]);const x={setCloseableError:n,refreshTorrents:h};return c.jsx(hr.Provider,{value:x,children:c.jsxs("div",{className:"dark:bg-gray-900 dark:text-zinc-50 min-h-screen",children:[c.jsx(Op,{title:e.title}),c.jsxs("div",{className:"relative",children:[c.jsxs("div",{className:"absolute top-0 start-0 pl-2 z-10",children:[e.menuButtons&&e.menuButtons.map((g,S)=>c.jsx("span",{children:g},S)),c.jsx(Kn,{onClick:()=>v(!0),children:c.jsx(J0,{})}),c.jsx(Kn,{onClick:Bl.toggle,children:c.jsx(q0,{})})]}),c.jsx(J1,{closeableError:t,otherError:r,torrents:o,torrentsLoading:u})]}),c.jsx(Cp,{show:a,onClose:()=>v(!1)})]})})},md=window.origin==="null"||window.origin==="http://localhost:3031"?"http://localhost:3030":"",Ze=async(e,t,n)=>{console.log(e,t);const r=md+t,l={method:e,headers:{Accept:"application/json"},body:n};let o={method:e,path:t,text:""},i;try{i=await fetch(r,l)}catch{return o.text="network error",Promise.reject(o)}if(o.status=i.status,o.statusText=`${i.status} ${i.statusText}`,!i.ok){const s=await i.text();try{const a=JSON.parse(s);o.text=a.human_readable!==void 0?a.human_readable:JSON.stringify(a,null,2)}catch{o.text=s}return Promise.reject(o)}return await i.json()},Vs={getStreamLogsUrl:()=>md+"/stream_logs",listTorrents:()=>Ze("GET","/torrents"),getTorrentDetails:e=>Ze("GET",`/torrents/${e}`),getTorrentStats:e=>Ze("GET",`/torrents/${e}/stats/v1`),uploadTorrent:(e,t)=>{var r,l;let n="/torrents?&overwrite=true";return t!=null&&t.list_only&&(n+="&list_only=true"),(t==null?void 0:t.only_files)!=null&&(n+=`&only_files=${t.only_files.join(",")}`),(r=t==null?void 0:t.peer_opts)!=null&&r.connect_timeout&&(n+=`&peer_connect_timeout=${t.peer_opts.connect_timeout}`),(l=t==null?void 0:t.peer_opts)!=null&&l.read_write_timeout&&(n+=`&peer_read_write_timeout=${t.peer_opts.read_write_timeout}`),t!=null&&t.initial_peers&&(n+=`&initial_peers=${t.initial_peers.join(",")}`),t!=null&&t.output_folder&&(n+=`&output_folder=${t.output_folder}`),typeof e=="string"&&(n+="&is_url=true"),Ze("POST",n,e)},pause:e=>Ze("POST",`/torrents/${e}/pause`),start:e=>Ze("POST",`/torrents/${e}/start`),forget:e=>Ze("POST",`/torrents/${e}/forget`),delete:e=>Ze("POST",`/torrents/${e}/delete`),getVersion:async()=>(await Ze("GET","/")).version},Ip=()=>{let[e,t]=y.useState("rqbit web UI");return y.useEffect(()=>gu(()=>Vs.getVersion().then(r=>{const l=`rqbit web UI - v${r}`;return t(l),document.title=l,1e4},r=>1e3),0),[]),c.jsx(y.StrictMode,{children:c.jsx(Nt.Provider,{value:Vs,children:c.jsx(Fp,{title:e})})})};_o.createRoot(document.getElementById("app")).render(c.jsx(Ip,{})); +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function vo(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function li(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var g0=typeof WeakMap=="function"?WeakMap:Map;function Tc(e,t,n){n=qe(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hl||(hl=!0,mi=r),li(e,t)},n}function Pc(e,t,n){n=qe(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){li(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){li(e,t),typeof r!="function"&&(yt===null?yt=new Set([this]):yt.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function ps(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new g0;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=z0.bind(null,e,t,n),t.then(e,e))}function ms(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function hs(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=qe(-1,1),t.tag=2,gt(n,t,1))),n.lanes|=1),e)}var y0=rt.ReactCurrentOwner,pe=!1;function se(e,t,n,r){t.child=e===null?uc(t,null,n,r):yn(t,e.child,n,r)}function vs(e,t,n,r,l){n=n.render;var o=t.ref;return pn(t,l),r=eu(e,t,n,r,o,l),n=tu(),e!==null&&!pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,nt(e,t,l)):(B&&n&&Vi(t),t.flags|=1,se(e,t,r,l),t.child)}function gs(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!du(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,Lc(e,t,o,r,l)):(e=Gr(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&l)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:er,n(i,r)&&e.ref===t.ref)return nt(e,t,l)}return t.flags|=1,e=wt(o,r),e.ref=t.ref,e.return=t,t.child=e}function Lc(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(er(o,r)&&e.ref===t.ref)if(pe=!1,t.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(pe=!0);else return t.lanes=e.lanes,nt(e,t,l)}return oi(e,t,n,r,l)}function zc(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},R(sn,ye),ye|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,R(sn,ye),ye|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,R(sn,ye),ye|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,R(sn,ye),ye|=r;return se(e,t,l,n),t.child}function Mc(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function oi(e,t,n,r,l){var o=he(n)?At:ie.current;return o=vn(t,o),pn(t,l),n=eu(e,t,n,r,o,l),r=tu(),e!==null&&!pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,nt(e,t,l)):(B&&r&&Vi(t),t.flags|=1,se(e,t,n,l),t.child)}function ys(e,t,n,r,l){if(he(n)){var o=!0;ol(t)}else o=!1;if(pn(t,l),t.stateNode===null)Qr(e,t),oc(t,n,r),ri(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,u=t.memoizedProps;i.props=u;var s=i.context,a=n.contextType;typeof a=="object"&&a!==null?a=Te(a):(a=he(n)?At:ie.current,a=vn(t,a));var v=n.getDerivedStateFromProps,m=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function";m||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==r||s!==a)&&as(t,i,r,a),ut=!1;var h=t.memoizedState;i.state=h,cl(t,r,i,l),s=t.memoizedState,u!==r||h!==s||me.current||ut?(typeof v=="function"&&(ni(t,n,v,r),s=t.memoizedState),(u=ut||ss(t,n,u,r,h,s,a))?(m||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=a,r=u):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,rc(e,t),u=t.memoizedProps,a=t.type===t.elementType?u:ze(t.type,u),i.props=a,m=t.pendingProps,h=i.context,s=n.contextType,typeof s=="object"&&s!==null?s=Te(s):(s=he(n)?At:ie.current,s=vn(t,s));var x=n.getDerivedStateFromProps;(v=typeof x=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==m||h!==s)&&as(t,i,r,s),ut=!1,h=t.memoizedState,i.state=h,cl(t,r,i,l);var g=t.memoizedState;u!==m||h!==g||me.current||ut?(typeof x=="function"&&(ni(t,n,x,r),g=t.memoizedState),(a=ut||ss(t,n,a,r,h,g,s)||!1)?(v||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,g,s),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,g,s)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),i.props=r,i.state=g,i.context=s,r=a):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ii(e,t,n,r,o,l)}function ii(e,t,n,r,l,o){Mc(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&rs(t,n,!1),nt(e,t,o);r=t.stateNode,y0.current=t;var u=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=yn(t,e.child,null,o),t.child=yn(t,null,u,o)):se(e,t,u,o),t.memoizedState=r.state,l&&rs(t,n,!0),t.child}function Oc(e){var t=e.stateNode;t.pendingContext?ns(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ns(e,t.context,!1),Xi(e,t.containerInfo)}function xs(e,t,n,r,l){return gn(),Wi(l),t.flags|=256,se(e,t,n,r),t.child}var ui={dehydrated:null,treeContext:null,retryLane:0};function si(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fc(e,t,n){var r=t.pendingProps,l=V.current,o=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(l&2)!==0),u?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),R(V,l&1),e===null)return ei(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Ml(i,r,0,null),e=$t(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=si(n),t.memoizedState=ui,e):lu(t,i));if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null))return x0(e,t,i,r,u,l,n);if(o){o=r.fallback,i=t.mode,l=e.child,u=l.sibling;var s={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=wt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),u!==null?o=wt(u,o):(o=$t(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?si(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=ui,r}return o=e.child,e=o.sibling,r=wt(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function lu(e,t){return t=Ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Mr(e,t,n,r){return r!==null&&Wi(r),yn(t,e.child,null,n),e=lu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function x0(e,t,n,r,l,o,i){if(n)return t.flags&256?(t.flags&=-257,r=vo(Error(k(422))),Mr(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=Ml({mode:"visible",children:r.children},l,0,null),o=$t(o,l,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&yn(t,e.child,null,i),t.child.memoizedState=si(i),t.memoizedState=ui,o);if(!(t.mode&1))return Mr(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var u=r.dgst;return r=u,o=Error(k(419)),r=vo(o,r,void 0),Mr(e,t,i,r)}if(u=(i&e.childLanes)!==0,pe||u){if(r=b,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,tt(e,l),Ie(r,e,l,-1))}return cu(),r=vo(Error(k(421))),Mr(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=M0.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,xe=vt(l.nextSibling),we=t,B=!0,Oe=null,e!==null&&(Ce[_e++]=Xe,Ce[_e++]=Je,Ce[_e++]=Ut,Xe=e.id,Je=e.overflow,Ut=t),t=lu(t,r.children),t.flags|=4096,t)}function ws(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ti(e.return,t,n)}function go(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function Ic(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(se(e,t,r.children,n),r=V.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ws(e,n,t);else if(e.tag===19)ws(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(R(V,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&dl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),go(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&dl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}go(t,!0,n,null,o);break;case"together":go(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Qr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function nt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(k(153));if(t.child!==null){for(e=t.child,n=wt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function w0(e,t,n){switch(t.tag){case 3:Oc(t),gn();break;case 5:sc(t);break;case 1:he(t.type)&&ol(t);break;case 4:Xi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;R(sl,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(R(V,V.current&1),t.flags|=128,null):n&t.child.childLanes?Fc(e,t,n):(R(V,V.current&1),e=nt(e,t,n),e!==null?e.sibling:null);R(V,V.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ic(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),R(V,V.current),r)break;return null;case 22:case 23:return t.lanes=0,zc(e,t,n)}return nt(e,t,n)}var Dc,ai,Rc,$c;Dc=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ai=function(){};Rc=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Dt(We.current);var o=null;switch(n){case"input":l=zo(e,l),r=zo(e,r),o=[];break;case"select":l=W({},l,{value:void 0}),r=W({},r,{value:void 0}),o=[];break;case"textarea":l=Fo(e,l),r=Fo(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=rl)}Do(n,r);var i;n=null;for(a in l)if(!r.hasOwnProperty(a)&&l.hasOwnProperty(a)&&l[a]!=null)if(a==="style"){var u=l[a];for(i in u)u.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Zn.hasOwnProperty(a)?o||(o=[]):(o=o||[]).push(a,null));for(a in r){var s=r[a];if(u=l!=null?l[a]:void 0,r.hasOwnProperty(a)&&s!==u&&(s!=null||u!=null))if(a==="style")if(u){for(i in u)!u.hasOwnProperty(i)||s&&s.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in s)s.hasOwnProperty(i)&&u[i]!==s[i]&&(n||(n={}),n[i]=s[i])}else n||(o||(o=[]),o.push(a,n)),n=s;else a==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,u=u?u.__html:void 0,s!=null&&u!==s&&(o=o||[]).push(a,s)):a==="children"?typeof s!="string"&&typeof s!="number"||(o=o||[]).push(a,""+s):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(Zn.hasOwnProperty(a)?(s!=null&&a==="onScroll"&&A("scroll",e),o||u===s||(o=[])):(o=o||[]).push(a,s))}n&&(o=o||[]).push("style",n);var a=o;(t.updateQueue=a)&&(t.flags|=4)}};$c=function(e,t,n,r){n!==r&&(t.flags|=4)};function zn(e,t){if(!B)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function k0(e,t,n){var r=t.pendingProps;switch(Hi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return le(t),null;case 1:return he(t.type)&&ll(),le(t),null;case 3:return r=t.stateNode,xn(),U(me),U(ie),qi(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Lr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Oe!==null&&(gi(Oe),Oe=null))),ai(e,t),le(t),null;case 5:Ji(t);var l=Dt(or.current);if(n=t.type,e!==null&&t.stateNode!=null)Rc(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(k(166));return le(t),null}if(e=Dt(We.current),Lr(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Be]=t,r[rr]=o,e=(t.mode&1)!==0,n){case"dialog":A("cancel",r),A("close",r);break;case"iframe":case"object":case"embed":A("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Be]=t,e[rr]=r,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(i=Ro(n,r),n){case"dialog":A("cancel",e),A("close",e),l=r;break;case"iframe":case"object":case"embed":A("load",e),l=r;break;case"video":case"audio":for(l=0;lkn&&(t.flags|=128,r=!0,zn(o,!1),t.lanes=4194304)}else{if(!r)if(e=dl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),zn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!B)return le(t),null}else 2*G()-o.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,zn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=G(),t.sibling=null,n=V.current,R(V,r?n&1|2:n&1),t):(le(t),null);case 22:case 23:return au(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ye&1073741824&&(le(t),t.subtreeFlags&6&&(t.flags|=8192)):le(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function S0(e,t){switch(Hi(t),t.tag){case 1:return he(t.type)&&ll(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),U(me),U(ie),qi(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ji(t),null;case 13:if(U(V),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));gn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(V),null;case 4:return xn(),null;case 10:return Zi(t.type._context),null;case 22:case 23:return au(),null;case 24:return null;default:return null}}var Or=!1,oe=!1,E0=typeof WeakSet=="function"?WeakSet:Set,T=null;function un(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Q(e,t,r)}else n.current=null}function ci(e,t,n){try{n()}catch(r){Q(e,t,r)}}var ks=!1;function C0(e,t){if(Zo=el,e=Va(),Bi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,a=0,v=0,m=e,h=null;t:for(;;){for(var x;m!==n||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(x=m.firstChild)!==null;)h=m,m=x;for(;;){if(m===e)break t;if(h===n&&++a===l&&(u=i),h===o&&++v===r&&(s=i),(x=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=x}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Go={focusedElem:e,selectionRange:n},el=!1,T=t;T!==null;)if(t=T,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,T=e;else for(;T!==null;){t=T;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var S=g.memoizedProps,L=g.memoizedState,f=t.stateNode,d=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:ze(t.type,S),L);f.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(w){Q(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,T=e;break}T=t.return}return g=ks,ks=!1,g}function Hn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&ci(t,n,o)}l=l.next}while(l!==r)}}function Ll(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function di(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ac(e){var t=e.alternate;t!==null&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Be],delete t[rr],delete t[Jo],delete t[i0],delete t[u0])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Uc(e){return e.tag===5||e.tag===3||e.tag===4}function Ss(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Uc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rl));else if(r!==4&&(e=e.child,e!==null))for(fi(e,t,n),e=e.sibling;e!==null;)fi(e,t,n),e=e.sibling}function pi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(pi(e,t,n),e=e.sibling;e!==null;)pi(e,t,n),e=e.sibling}var ee=null,Me=!1;function ot(e,t,n){for(n=n.child;n!==null;)Bc(e,t,n),n=n.sibling}function Bc(e,t,n){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(Sl,n)}catch{}switch(n.tag){case 5:oe||un(n,t);case 6:var r=ee,l=Me;ee=null,ot(e,t,n),ee=r,Me=l,ee!==null&&(Me?(e=ee,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ee.removeChild(n.stateNode));break;case 18:ee!==null&&(Me?(e=ee,n=n.stateNode,e.nodeType===8?ao(e.parentNode,n):e.nodeType===1&&ao(e,n),qn(e)):ao(ee,n.stateNode));break;case 4:r=ee,l=Me,ee=n.stateNode.containerInfo,Me=!0,ot(e,t,n),ee=r,Me=l;break;case 0:case 11:case 14:case 15:if(!oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&ci(n,t,i),l=l.next}while(l!==r)}ot(e,t,n);break;case 1:if(!oe&&(un(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Q(n,t,u)}ot(e,t,n);break;case 21:ot(e,t,n);break;case 22:n.mode&1?(oe=(r=oe)||n.memoizedState!==null,ot(e,t,n),oe=r):ot(e,t,n);break;default:ot(e,t,n)}}function Es(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new E0),t.forEach(function(r){var l=O0.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=G()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*j0(r/1960))-r,10e?16:e,dt===null)var r=!1;else{if(e=dt,dt=null,vl=0,F&6)throw Error(k(331));var l=F;for(F|=4,T=e.current;T!==null;){var o=T,i=o.child;if(T.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sG()-uu?Rt(e,0):iu|=n),ve(e,t)}function Yc(e,t){t===0&&(e.mode&1?(t=Cr,Cr<<=1,!(Cr&130023424)&&(Cr=4194304)):t=1);var n=ae();e=tt(e,t),e!==null&&(dr(e,t,n),ve(e,n))}function M0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Yc(e,n)}function O0(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),Yc(e,n)}var Xc;Xc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||me.current)pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pe=!1,w0(e,t,n);pe=!!(e.flags&131072)}else pe=!1,B&&t.flags&1048576&&ba(t,ul,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Qr(e,t),e=t.pendingProps;var l=vn(t,ie.current);pn(t,n),l=eu(null,t,r,e,l,n);var o=tu();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,he(r)?(o=!0,ol(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Yi(t),l.updater=Tl,t.stateNode=l,l._reactInternals=t,ri(t,r,e,n),t=ii(null,t,r,!0,o,n)):(t.tag=0,B&&o&&Vi(t),se(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Qr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=I0(r),e=ze(r,e),l){case 0:t=oi(null,t,r,e,n);break e;case 1:t=ys(null,t,r,e,n);break e;case 11:t=vs(null,t,r,e,n);break e;case 14:t=gs(null,t,r,ze(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),ys(e,t,r,l,n);case 3:e:{if(Oc(t),e===null)throw Error(k(387));r=t.pendingProps,o=t.memoizedState,l=o.element,rc(e,t),cl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=wn(Error(k(423)),t),t=xs(e,t,r,n,l);break e}else if(r!==l){l=wn(Error(k(424)),t),t=xs(e,t,r,n,l);break e}else for(xe=vt(t.stateNode.containerInfo.firstChild),we=t,B=!0,Oe=null,n=uc(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(gn(),r===l){t=nt(e,t,n);break e}se(e,t,r,n)}t=t.child}return t;case 5:return sc(t),e===null&&ei(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,Yo(r,l)?i=null:o!==null&&Yo(r,o)&&(t.flags|=32),Mc(e,t),se(e,t,i,n),t.child;case 6:return e===null&&ei(t),null;case 13:return Fc(e,t,n);case 4:return Xi(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=yn(t,null,r,n):se(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),vs(e,t,r,l,n);case 7:return se(e,t,t.pendingProps,n),t.child;case 8:return se(e,t,t.pendingProps.children,n),t.child;case 12:return se(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,R(sl,r._currentValue),r._currentValue=i,o!==null)if(De(o.value,i)){if(o.children===l.children&&!me.current){t=nt(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=qe(-1,n&-n),s.tag=2;var a=o.updateQueue;if(a!==null){a=a.shared;var v=a.pending;v===null?s.next=s:(s.next=v.next,v.next=s),a.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),ti(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(k(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),ti(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}se(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,pn(t,n),l=Te(l),r=r(l),t.flags|=1,se(e,t,r,n),t.child;case 14:return r=t.type,l=ze(r,t.pendingProps),l=ze(r.type,l),gs(e,t,r,l,n);case 15:return Lc(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:ze(r,l),Qr(e,t),t.tag=1,he(r)?(e=!0,ol(t)):e=!1,pn(t,n),oc(t,r,l),ri(t,r,l,n),ii(null,t,r,!0,e,n);case 19:return Ic(e,t,n);case 22:return zc(e,t,n)}throw Error(k(156,t.tag))};function Jc(e,t){return Ea(e,t)}function F0(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function je(e,t,n,r){return new F0(e,t,n,r)}function du(e){return e=e.prototype,!(!e||!e.isReactComponent)}function I0(e){if(typeof e=="function")return du(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Li)return 11;if(e===zi)return 14}return 2}function wt(e,t){var n=e.alternate;return n===null?(n=je(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Gr(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")du(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Jt:return $t(n.children,l,o,t);case Pi:i=8,l|=8;break;case No:return e=je(12,n,t,l|2),e.elementType=No,e.lanes=o,e;case To:return e=je(13,n,t,l),e.elementType=To,e.lanes=o,e;case Po:return e=je(19,n,t,l),e.elementType=Po,e.lanes=o,e;case ia:return Ml(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case la:i=10;break e;case oa:i=9;break e;case Li:i=11;break e;case zi:i=14;break e;case it:i=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=je(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function $t(e,t,n,r){return e=je(7,e,r,t),e.lanes=n,e}function Ml(e,t,n,r){return e=je(22,e,r,t),e.elementType=ia,e.lanes=n,e.stateNode={isHidden:!1},e}function yo(e,t,n){return e=je(6,e,null,t),e.lanes=n,e}function xo(e,t,n){return t=je(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function D0(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ql(0),this.expirationTimes=ql(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ql(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,l,o,i,u,s){return e=new D0(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=je(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yi(o),e}function R0(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(td)}catch(e){console.error(e)}}td(),bs.exports=Se;var nd=bs.exports;const V0=ki(nd);var zs=nd;_o.createRoot=zs.createRoot,_o.hydrateRoot=zs.hydrateRoot;const Nt=y.createContext({listTorrents:()=>{throw new Error("Function not implemented.")},getTorrentDetails:()=>{throw new Error("Function not implemented.")},getTorrentStats:()=>{throw new Error("Function not implemented.")},uploadTorrent:()=>{throw new Error("Function not implemented.")},pause:()=>{throw new Error("Function not implemented.")},start:()=>{throw new Error("Function not implemented.")},forget:()=>{throw new Error("Function not implemented.")},delete:()=>{throw new Error("Function not implemented.")},getStreamLogsUrl:()=>null}),hr=y.createContext({setCloseableError:e=>{},refreshTorrents:()=>{}}),rd=y.createContext({refresh:()=>{}}),xl=({label:e,className:t})=>c.jsxs("div",{className:`flex gap-2 items-center ${t}`,children:[c.jsxs("svg",{"aria-hidden":"true",className:"w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),c.jsx("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),e?c.jsxs("span",{className:"text-sm",children:[e," ..."]}):c.jsx("span",{className:"sr-only",children:"Loading..."})]}),vu="initializing",H0="paused",W0="live",Q0="error";function gu(e,t){let n,r=t;const l=async()=>{if(r=await e(),r==null)throw"asyncCallback returned null or undefined";o()};let o=()=>{n=setTimeout(l,r)};return o(),()=>{clearTimeout(n)}}function ld(e,t){let n;const r=async()=>{await e().then(()=>!1,()=>!0)&&l()};let l=o=>{n=setTimeout(r,o!==void 0?o:t)};return l(0),()=>clearTimeout(n)}var od={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ms=ft.createContext&&ft.createContext(od),kt=globalThis&&globalThis.__assign||function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{onClick:t,disabled:n,color:r,children:l,className:o,...i}=e,u=a=>{a.stopPropagation(),!n&&t()},s=r?`text-${r}`:"";return c.jsx("a",{className:`block p-1 ${s} ${o}`,onClick:u,href:"#",...i,children:l})};function J0(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M0 .5A.5.5 0 0 1 .5 0h4a.5.5 0 0 1 0 1h-4A.5.5 0 0 1 0 .5Zm0 2A.5.5 0 0 1 .5 2h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm9 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm-9 2A.5.5 0 0 1 .5 4h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Zm5 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm7 0a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1-.5-.5Zm-12 2A.5.5 0 0 1 .5 6h6a.5.5 0 0 1 0 1h-6a.5.5 0 0 1-.5-.5Zm8 0a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm-8 2A.5.5 0 0 1 .5 8h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm7 0a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5Zm-7 2a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1h-8a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 0 1h-4a.5.5 0 0 1-.5-.5Zm0 2a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5Z"}}]})(e)}function q0(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"}}]})(e)}function ud(e){return ue({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708z"}}]})(e)}const b0=({title:e,children:t,onClose:n})=>c.jsxs("div",{className:"bg-red-200 p-3 rounded-md mb-3 dark:bg-red-800/60",children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("h2",{className:"text-lg font-semibold",children:e}),n&&c.jsx("button",{onClick:n,children:c.jsx(ud,{})})]}),t]}),Wt=e=>{var r,l,o;let{error:t,remove:n}=e;return t==null?null:c.jsxs(b0,{onClose:n,title:t.text,children:[((r=t.details)==null?void 0:r.statusText)&&c.jsx("div",{className:"pb-2 text-md",children:(l=t.details)==null?void 0:l.statusText}),c.jsx("div",{className:"whitespace-pre-wrap text-sm",children:(o=t.details)==null?void 0:o.text})]})};function yu(e){return e&&e.ownerDocument||document}function wo(e){e===void 0&&(e=yu());try{var t=e.activeElement;return!t||!t.nodeName?null:t}catch{return e.body}}function Os(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}const Rl=!!(typeof window<"u"&&window.document&&window.document.createElement);var yi=!1,xi=!1;try{var ko={get passive(){return yi=!0},get once(){return xi=yi=!0}};Rl&&(window.addEventListener("test",ko,ko),window.removeEventListener("test",ko,!0))}catch{}function e1(e,t,n,r){if(r&&typeof r!="boolean"&&!xi){var l=r.once,o=r.capture,i=n;!xi&&l&&(i=n.__once||function u(s){this.removeEventListener(t,u,o),n.call(this,s)},n.__once=i),e.addEventListener(t,i,yi?r:o)}e.addEventListener(t,n,r)}function t1(e,t,n,r){var l=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,l),n.__once&&e.removeEventListener(t,n.__once,l)}function Fs(e,t,n,r){return e1(e,t,n,r),function(){t1(e,t,n,r)}}function n1(){const e=y.useRef(!0),t=y.useRef(()=>e.current);return y.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function r1(e){const t=y.useRef(e);return t.current=e,t}function l1(e){const t=r1(e);y.useEffect(()=>()=>t.current(),[])}function o1(e){const t=y.useRef(null);return y.useEffect(()=>{t.current=e}),t.current}function i1(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e},[e]),t}function Ot(e){const t=i1(e);return y.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function u1(e){var t=yu(e);return t&&t.defaultView||window}function s1(e,t){return u1(e).getComputedStyle(e,t)}var a1=/([A-Z])/g;function c1(e){return e.replace(a1,"-$1").toLowerCase()}var d1=/^ms-/;function Dr(e){return c1(e).replace(d1,"-ms-")}var f1=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function p1(e){return!!(e&&f1.test(e))}function Is(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Dr(t))||s1(e).getPropertyValue(Dr(t));Object.keys(t).forEach(function(l){var o=t[l];!o&&o!==0?e.style.removeProperty(Dr(l)):p1(l)?r+=l+"("+o+") ":n+=Dr(l)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}const m1="data-rr-ui-";function h1(e){return`${m1}${e}`}function v1(e=document){const t=e.defaultView;return Math.abs(t.innerWidth-e.documentElement.clientWidth)}const Ds=h1("modal-open");class g1{constructor({ownerDocument:t,handleContainerOverflow:n=!0,isRTL:r=!1}={}){this.handleContainerOverflow=n,this.isRTL=r,this.modals=[],this.ownerDocument=t}getScrollbarWidth(){return v1(this.ownerDocument)}getElement(){return(this.ownerDocument||document).body}setModalAttributes(t){}removeModalAttributes(t){}setContainerStyle(t){const n={overflow:"hidden"},r=this.isRTL?"paddingLeft":"paddingRight",l=this.getElement();t.style={overflow:l.style.overflow,[r]:l.style[r]},t.scrollBarWidth&&(n[r]=`${parseInt(Is(l,r)||"0",10)+t.scrollBarWidth}px`),l.setAttribute(Ds,""),Is(l,n)}reset(){[...this.modals].forEach(t=>this.remove(t))}removeContainerStyle(t){const n=this.getElement();n.removeAttribute(Ds),Object.assign(n.style,t.style)}add(t){let n=this.modals.indexOf(t);return n!==-1||(n=this.modals.length,this.modals.push(t),this.setModalAttributes(t),n!==0)||(this.state={scrollBarWidth:this.getScrollbarWidth(),style:{}},this.handleContainerOverflow&&this.setContainerStyle(this.state)),n}remove(t){const n=this.modals.indexOf(t);n!==-1&&(this.modals.splice(n,1),!this.modals.length&&this.handleContainerOverflow&&this.removeContainerStyle(this.state),this.removeModalAttributes(t))}isTopModal(t){return!!this.modals.length&&this.modals[this.modals.length-1]===t}}const sd=g1,ad=y.createContext(Rl?window:void 0);ad.Provider;function xu(){return y.useContext(ad)}const So=(e,t)=>Rl?e==null?(t||yu()).body:(typeof e=="function"&&(e=e()),e&&"current"in e&&(e=e.current),e&&("nodeType"in e||e.getBoundingClientRect)?e:null):null;function y1(e,t){const n=xu(),[r,l]=y.useState(()=>So(e,n==null?void 0:n.document));if(!r){const o=So(e);o&&l(o)}return y.useEffect(()=>{t&&r&&t(r)},[t,r]),y.useEffect(()=>{const o=So(e);o!==r&&l(o)},[e,r]),r}const Rs=e=>!e||typeof e=="function"?e:t=>{e.current=t};function x1(e,t){const n=Rs(e),r=Rs(t);return l=>{n&&n(l),r&&r(l)}}function cd(e,t){return y.useMemo(()=>x1(e,t),[e,t])}const w1=typeof global<"u"&&global.navigator&&global.navigator.product==="ReactNative",k1=typeof document<"u",$s=k1||w1?y.useLayoutEffect:y.useEffect;function S1({children:e,in:t,onExited:n,mountOnEnter:r,unmountOnExit:l}){const o=y.useRef(null),i=y.useRef(t),u=Ot(n);y.useEffect(()=>{t?i.current=!0:u(o.current)},[t,u]);const s=cd(o,e.ref),a=y.cloneElement(e,{ref:s});return t?a:l||!i.current&&r?null:a}function E1({in:e,onTransition:t}){const n=y.useRef(null),r=y.useRef(!0),l=Ot(t);return $s(()=>{if(!n.current)return;let o=!1;return l({in:e,element:n.current,initial:r.current,isStale:()=>o}),()=>{o=!0}},[e,l]),$s(()=>(r.current=!1,()=>{r.current=!0}),[]),n}function C1({children:e,in:t,onExited:n,onEntered:r,transition:l}){const[o,i]=y.useState(!t);t&&o&&i(!1);const u=E1({in:!!t,onTransition:a=>{const v=()=>{a.isStale()||(a.in?r==null||r(a.element,a.initial):(i(!0),n==null||n(a.element)))};Promise.resolve(l(a)).then(v,m=>{throw a.in||i(!0),m})}}),s=cd(u,e.ref);return o&&!t?null:y.cloneElement(e,{ref:s})}function As(e,t,n){return e?c.jsx(e,Object.assign({},n)):t?c.jsx(C1,Object.assign({},n,{transition:t})):c.jsx(S1,Object.assign({},n))}function _1(e){return e.code==="Escape"||e.keyCode===27}const j1=["show","role","className","style","children","backdrop","keyboard","onBackdropClick","onEscapeKeyDown","transition","runTransition","backdropTransition","runBackdropTransition","autoFocus","enforceFocus","restoreFocus","restoreFocusOptions","renderDialog","renderBackdrop","manager","container","onShow","onHide","onExit","onExited","onExiting","onEnter","onEntering","onEntered"];function N1(e,t){if(e==null)return{};var n={},r=Object.keys(e),l,o;for(o=0;o=0)&&(n[l]=e[l]);return n}let Eo;function T1(e){return Eo||(Eo=new sd({ownerDocument:e==null?void 0:e.document})),Eo}function P1(e){const t=xu(),n=e||T1(t),r=y.useRef({dialog:null,backdrop:null});return Object.assign(r.current,{add:()=>n.add(r.current),remove:()=>n.remove(r.current),isTopModal:()=>n.isTopModal(r.current),setDialogRef:y.useCallback(l=>{r.current.dialog=l},[]),setBackdropRef:y.useCallback(l=>{r.current.backdrop=l},[])})}const dd=y.forwardRef((e,t)=>{let{show:n=!1,role:r="dialog",className:l,style:o,children:i,backdrop:u=!0,keyboard:s=!0,onBackdropClick:a,onEscapeKeyDown:v,transition:m,runTransition:h,backdropTransition:x,runBackdropTransition:g,autoFocus:S=!0,enforceFocus:L=!0,restoreFocus:f=!0,restoreFocusOptions:d,renderDialog:p,renderBackdrop:w=Z=>c.jsx("div",Object.assign({},Z)),manager:N,container:E,onShow:C,onHide:j=()=>{},onExit:D,onExited:M,onExiting:ge,onEnter:Tt,onEntering:Pt,onEntered:vr}=e,Vl=N1(e,j1);const Re=xu(),lt=y1(E),_=P1(N),P=n1(),z=o1(n),[$,K]=y.useState(!n),Qe=y.useRef(null);y.useImperativeHandle(t,()=>_,[_]),Rl&&!z&&n&&(Qe.current=wo(Re==null?void 0:Re.document)),n&&$&&K(!1);const $e=Ot(()=>{if(_.add(),Wl.current=Fs(document,"keydown",hd),Hl.current=Fs(document,"focus",()=>setTimeout(Ke),!0),C&&C(),S){var Z,Su;const Kl=wo((Z=(Su=_.dialog)==null?void 0:Su.ownerDocument)!=null?Z:Re==null?void 0:Re.document);_.dialog&&Kl&&!Os(_.dialog,Kl)&&(Qe.current=Kl,_.dialog.focus())}}),Lt=Ot(()=>{if(_.remove(),Wl.current==null||Wl.current(),Hl.current==null||Hl.current(),f){var Z;(Z=Qe.current)==null||Z.focus==null||Z.focus(d),Qe.current=null}});y.useEffect(()=>{!n||!lt||$e()},[n,lt,$e]),y.useEffect(()=>{$&&Lt()},[$,Lt]),l1(()=>{Lt()});const Ke=Ot(()=>{if(!L||!P()||!_.isTopModal())return;const Z=wo(Re==null?void 0:Re.document);_.dialog&&Z&&!Os(_.dialog,Z)&&_.dialog.focus()}),Zt=Ot(Z=>{Z.target===Z.currentTarget&&(a==null||a(Z),u===!0&&j())}),hd=Ot(Z=>{s&&_1(Z)&&_.isTopModal()&&(v==null||v(Z),Z.defaultPrevented||j())}),Hl=y.useRef(),Wl=y.useRef(),vd=(...Z)=>{K(!0),M==null||M(...Z)};if(!lt)return null;const ku=Object.assign({role:r,ref:_.setDialogRef,"aria-modal":r==="dialog"?!0:void 0},Vl,{style:o,className:l,tabIndex:-1});let Ql=p?p(ku):c.jsx("div",Object.assign({},ku,{children:y.cloneElement(i,{role:"document"})}));Ql=As(m,h,{unmountOnExit:!0,mountOnEnter:!0,appear:!0,in:!!n,onExit:D,onExiting:ge,onExited:vd,onEnter:Tt,onEntering:Pt,onEntered:vr,children:Ql});let gr=null;return u&&(gr=w({ref:_.setBackdropRef,onClick:Zt}),gr=As(x,g,{in:!!n,appear:!0,mountOnEnter:!0,unmountOnExit:!0,children:gr})),c.jsx(c.Fragment,{children:V0.createPortal(c.jsxs(c.Fragment,{children:[gr,Ql]}),lt)})});dd.displayName="Modal";const L1=Object.assign(dd,{Manager:sd}),z1=({onClose:e,title:t})=>c.jsxs("div",{className:"flex p-3 justify-between items-center border-b dark:border-slate-600",children:[c.jsx("h2",{className:"text-xl font-semibold dark:slate-300",children:t}),e&&c.jsx("button",{className:"text-gray-500 hover:text-gray-700",onClick:e,"aria-label":"Close modal",children:c.jsx(ud,{className:"w-5 h-5"})})]}),$l=({isOpen:e,onClose:t,title:n,children:r,className:l})=>{const o=()=>c.jsx("div",{className:"fixed inset-0 bg-black/30 z-[300] dark:bg-black/60 backdrop-blur"});return c.jsx(L1,{show:e,onHide:t,renderBackdrop:o,className:"fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto",children:c.jsxs("div",{className:`bg-white shadow-lg my-8 mx-auto max-w-2xl rounded ${l} dark:bg-slate-800 dark:text-gray-50`,children:[c.jsx(z1,{onClose:t,title:n}),r]})})},Al=({children:e})=>c.jsx("div",{className:"p-3 border-b dark:border-slate-500",children:e}),Ul=({children:e,className:t})=>c.jsx("div",{className:`p-3 flex justify-end gap-2 ${t}`,children:e}),Ve=({onClick:e,children:t,className:n,disabled:r,variant:l})=>{let o={secondary:"hover:bg-blue-500 transition-colors hover:text-white dark:hover:bg-blue-900/50",danger:"bg-red-400 text-white border-green-50 hover:border-red-700 hover:bg-red-600 dark:bg-red-800 dark:border-none dark:hover:bg-red-900",primary:"bg-blue-600 text-white hover:bg-blue-800 disabled:bg-blue-200 dark:disabled:bg-slate-600 dark:disabled:text-slate-300 dark:border-none",cancel:"hover:bg-slate-200 dark:bg-slate-600 dark:hover:bg-slate-700 dark:border-none",none:""}[l??"secondary"];return c.jsx("button",{disabled:r,onClick:i=>{i.preventDefault(),e()},className:`inline-flex items-center gap-1 border rounded-lg disabled:cursor-not-allowed px-2 py-1 transition-colors duration-300 dark:border-slate-700 ${o} ${n}`,children:t})},M1=({id:e,show:t,onHide:n})=>{if(!t)return null;const[r,l]=y.useState(!1),[o,i]=y.useState(null),[u,s]=y.useState(!1),a=y.useContext(hr),v=y.useContext(Nt),m=()=>{l(!1),i(null),s(!1),n()},h=()=>{s(!0),(r?v.delete:v.forget)(e).then(()=>{a.refreshTorrents(),m()}).catch(g=>{i({text:`Error deleting torrent id=${e}`,details:g}),s(!1)})};return c.jsxs($l,{isOpen:t,onClose:n,title:"Delete torrent",children:[c.jsxs(Al,{children:[c.jsx("p",{className:"text-gray-700 dark:text-slate-300",children:"Are you sure you want to delete the torrent?"}),c.jsxs("div",{className:"mt-4 flex items-center",children:[c.jsx("input",{type:"checkbox",id:"deleteFiles",className:"form-checkbox h-4 w-4 text-blue-500",onChange:()=>l(!r),checked:r,placeholder:"Also delete files"}),c.jsx("label",{htmlFor:"deleteFiles",className:"ml-2 text-gray-700 dark:text-slate-300",children:"Also delete files"})]}),o&&c.jsx(Wt,{error:o})]}),c.jsxs(Ul,{children:[u&&c.jsx(xl,{}),c.jsx(Ve,{variant:"cancel",onClick:m,children:"Cancel"}),c.jsx(Ve,{variant:"danger",onClick:h,disabled:u,children:"Delete Torrent"})]})]})};function O1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M144 479H48c-26.5 0-48-21.5-48-48V79c0-26.5 21.5-48 48-48h96c26.5 0 48 21.5 48 48v352c0 26.5-21.5 48-48 48zm304-48V79c0-26.5-21.5-48-48-48h-96c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h96c26.5 0 48-21.5 48-48z"}}]})(e)}function F1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M424.4 214.7L72.4 6.6C43.8-10.3 0 6.1 0 47.9V464c0 37.5 40.7 60.1 72.4 41.3l352-208c31.4-18.5 31.5-64.1 0-82.6z"}}]})(e)}function I1(e){return ue({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z"}}]})(e)}const D1=({id:e,statsResponse:t})=>{let n=t.state,[r,l]=y.useState(!1),[o,i]=y.useState(!1),u=y.useContext(rd);const s=n=="live",a=n=="paused"||n=="error",v=y.useContext(hr),m=y.useContext(Nt),h=()=>{l(!0),m.start(e).then(()=>{u.refresh()},L=>{v.setCloseableError({text:`Error starting torrent id=${e}`,details:L})}).finally(()=>l(!1))},x=()=>{l(!0),m.pause(e).then(()=>{u.refresh()},L=>{v.setCloseableError({text:`Error pausing torrent id=${e}`,details:L})}).finally(()=>l(!1))},g=()=>{l(!0),i(!0)},S=()=>{l(!1),i(!1)};return c.jsxs("div",{className:"flex w-full justify-center gap-2 dark:text-slate-300",children:[a&&c.jsx(Kn,{onClick:h,disabled:r,children:c.jsx(F1,{className:"hover:text-green-500 transition-colors duration-300"})}),s&&c.jsx(Kn,{onClick:x,disabled:r,children:c.jsx(O1,{className:"hover:text-yellow-500 transition-colors duration-300"})}),c.jsx(Kn,{onClick:g,disabled:r,children:c.jsx(I1,{className:"hover:text-red-500 transition-colors duration-500"})}),c.jsx(M1,{id:e,show:o,onHide:S})]})},R1=({now:e,variant:t,label:n})=>{const r=n??`${e.toFixed(2)}%`,l={warn:"bg-yellow-500",info:"bg-blue-500 text-white",success:"bg-green-700 text-white",error:"bg-red-500 text-white"}[t??"info"];return c.jsx("div",{className:"w-full bg-gray-200 rounded-full dark:bg-gray-500",children:c.jsx("div",{className:`text-xs bg-blue-500 font-medium transition-all text-center p-0.5 leading-none rounded-full ${l}`,style:{width:`${e}%`},children:r})})};function wl(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]}const $1=({statsResponse:e})=>{var t,n;switch(e.state){case H0:return"Paused";case vu:return"Checking files";case Q0:return"Error"}return e.state!="live"||e.live===null?e.state:c.jsxs(c.Fragment,{children:[!e.finished&&c.jsxs("div",{className:"download-speed",children:["↓ ",(t=e.live.download_speed)==null?void 0:t.human_readable]}),c.jsxs("div",{className:"upload-speed",children:["↑ ",(n=e.live.upload_speed)==null?void 0:n.human_readable,e.live.snapshot.uploaded_bytes>0&&c.jsxs("span",{children:["(",wl(e.live.snapshot.uploaded_bytes),")"]})]})]})};function A1(e){return e.files.filter(n=>n.included).reduce((n,r)=>n.length>r.length?n:r).name}function U1(e){const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=e%60,l=(o,i)=>o>0?`${o}${i}`:"";return t>0?`${l(t,"h")} ${l(n,"m")}`.trim():n>0?`${l(n,"m")} ${l(r,"s")}`.trim():`${l(r,"s")}`.trim()}function B1(e){var n,r,l;let t=(l=(r=(n=e==null?void 0:e.live)==null?void 0:n.time_remaining)==null?void 0:r.duration)==null?void 0:l.secs;return t==null?"N/A":U1(t)}function V1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}}]})(e)}function H1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}}]})(e)}function W1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"}}]})(e)}function Q1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M9 16h6v-6h4l-7-7-7 7h4v6zm3-10.17L14.17 8H13v6h-2V8H9.83L12 5.83zM5 18h14v2H5z"}}]})(e)}function K1(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"}},{tag:"path",attr:{d:"M22 12c0 5.52-4.48 10-10 10S2 17.52 2 12c0-1.19.22-2.32.6-3.38l1.88.68C4.17 10.14 4 11.05 4 12c0 4.41 3.59 8 8 8s8-3.59 8-8-3.59-8-8-8c-.95 0-1.85.17-2.69.48l-.68-1.89C9.69 2.22 10.82 2 12 2c5.52 0 10 4.48 10 10zM5.5 4C4.67 4 4 4.67 4 5.5S4.67 7 5.5 7 7 6.33 7 5.5 6.33 4 5.5 4zM11 16V8H9v8h2zm4 0V8h-2v8h2z"}}]})(e)}const Z1=({className:e,finished:t,live:n,error:r})=>{const l=t&&n;return r?c.jsx(H1,{className:e,color:"red"}):l?c.jsx(Q1,{className:e,color:"green"}):t?c.jsx(V1,{className:e,color:"green"}):n?c.jsx(W1,{className:`text-blue-500 ${e}`}):c.jsx(K1,{className:e})},G1=({id:e,detailsResponse:t,statsResponse:n})=>{const r=(n==null?void 0:n.state)??"",l=(n==null?void 0:n.error)??null,o=(n==null?void 0:n.total_bytes)??1,i=(n==null?void 0:n.progress_bytes)??0,u=(n==null?void 0:n.finished)||!1,s=l?100:i/o*100,a=()=>{var h;let m=(h=n==null?void 0:n.live)==null?void 0:h.snapshot.peer_stats;return m?`${m.live} / ${m.seen}`:""},v=m=>c.jsx(Z1,{className:m,error:!!l,live:!!(n!=null&&n.live),finished:u});return c.jsxs("section",{className:"flex flex-col sm:flex-row items-center gap-2 border p-2 border-gray-200 rounded-xl shadow-xs hover:drop-shadow-sm dark:bg-slate-800 dark:border-slate-900",children:[c.jsx("div",{className:"hidden md:block",children:v("w-10 h-10")}),c.jsxs("div",{className:"w-full flex flex-col gap-2",children:[t&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"md:hidden",children:v("w-5 h-5")}),c.jsx("div",{className:"text-left text-lg text-gray-900 text-ellipsis break-all dark:text-slate-200",children:A1(t)})]}),l?c.jsxs("p",{className:"text-red-500 text-sm",children:[c.jsx("strong",{children:"Error:"})," ",l]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{children:c.jsx(R1,{now:s,label:l,variant:r==vu?"warn":u?"success":"info"})}),c.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-2 sm:flex-wrap items-center text-sm text-nowrap font-medium text-gray-500",children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(X0,{})," ",a().toString()]}),c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(Y0,{}),c.jsxs("div",{children:[wl(i),"/",wl(o)]})]}),n&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex gap-2 items-center",children:[c.jsx(G0,{}),B1(n)]}),c.jsx("div",{className:"flex gap-2 items-center",children:c.jsx($1,{statsResponse:n})})]})]})]})]}),n&&c.jsx("div",{className:"",children:c.jsx(D1,{id:e,statsResponse:n})})]})},Y1=({id:e,torrent:t})=>{const[n,r]=y.useState(null),[l,o]=y.useState(null),[i,u]=y.useState(0),s=y.useContext(Nt),a=()=>{u(i+1)};return y.useEffect(()=>{if(n===null)return ld(async()=>{await s.getTorrentDetails(t.id).then(r)},1e3)},[n]),y.useEffect(()=>gu(async()=>s.getTorrentStats(t.id).then(x=>(o(x),x)).then(x=>x.state==vu||x.state==W0?1e3:1e4,()=>1e4),0),[i]),c.jsx(rd.Provider,{value:{refresh:a},children:c.jsx(G1,{id:e,detailsResponse:n,statsResponse:l})})},X1=e=>c.jsx("div",{className:"flex flex-col gap-2 mx-2 pb-3 sm:px-7",children:e.torrents===null?e.loading?c.jsx(xl,{className:"justify-center m-5",label:"Loading torrent list"}):null:e.torrents.length===0?c.jsx("p",{className:"text-center",children:"No existing torrents found."}):e.torrents.map(t=>c.jsx(c.Fragment,{children:c.jsx(Y1,{id:t.id,torrent:t},t.id)}))}),J1=e=>{let t=y.useContext(hr);return c.jsxs("div",{className:"container mx-auto",children:[c.jsx(Wt,{error:e.closeableError,remove:()=>t.setCloseableError(null)}),c.jsx(Wt,{error:e.otherError}),c.jsx(X1,{torrents:e.torrents,loading:e.torrentsLoading})]})};var q1="Expected a function",Us=0/0,b1="[object Symbol]",ep=/^\s+|\s+$/g,tp=/^[-+]0x[0-9a-f]+$/i,np=/^0b[01]+$/i,rp=/^0o[0-7]+$/i,lp=parseInt,op=typeof yr=="object"&&yr&&yr.Object===Object&&yr,ip=typeof self=="object"&&self&&self.Object===Object&&self,up=op||ip||Function("return this")(),sp=Object.prototype,ap=sp.toString,cp=Math.max,dp=Math.min,Co=function(){return up.Date.now()};function fp(e,t,n){var r,l,o,i,u,s,a=0,v=!1,m=!1,h=!0;if(typeof e!="function")throw new TypeError(q1);t=Bs(t)||0,wi(n)&&(v=!!n.leading,m="maxWait"in n,o=m?cp(Bs(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function x(E){var C=r,j=l;return r=l=void 0,a=E,i=e.apply(j,C),i}function g(E){return a=E,u=setTimeout(f,t),v?x(E):i}function S(E){var C=E-s,j=E-a,D=t-C;return m?dp(D,o-j):D}function L(E){var C=E-s,j=E-a;return s===void 0||C>=t||C<0||m&&j>=o}function f(){var E=Co();if(L(E))return d(E);u=setTimeout(f,S(E))}function d(E){return u=void 0,h&&r?x(E):(r=l=void 0,i)}function p(){u!==void 0&&clearTimeout(u),a=0,r=s=l=u=void 0}function w(){return u===void 0?i:d(Co())}function N(){var E=Co(),C=L(E);if(r=arguments,l=this,s=E,C){if(u===void 0)return g(s);if(m)return u=setTimeout(f,t),x(s)}return u===void 0&&(u=setTimeout(f,t)),i}return N.cancel=p,N.flush=w,N}function wi(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function pp(e){return!!e&&typeof e=="object"}function mp(e){return typeof e=="symbol"||pp(e)&&ap.call(e)==b1}function Bs(e){if(typeof e=="number")return e;if(mp(e))return Us;if(wi(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=wi(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ep,"");var n=np.test(e);return n||rp.test(e)?lp(e.slice(2),n?2:8):tp.test(e)?Us:+e}var hp=fp;const vp=ki(hp),gp=({span:e})=>{let t=Object.entries(e).filter(([n,r])=>n!="name");return t.length==0?null:c.jsxs(c.Fragment,{children:["{",t.map(([n,r])=>c.jsxs("span",{children:[n," = ",r]},n)).reduce((n,r)=>c.jsxs(c.Fragment,{children:[n,", ",r]})),"}"]})},yp=({span:e})=>c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"font-bold",children:e.name}),c.jsx(gp,{span:e}),c.jsx("span",{className:"font-bold",children:":"})]}),xp=({fields:e})=>c.jsxs("span",{className:`m-1 ${e.message.match(/error|fail/g)?"text-red-500":"text-slate-500 dark:text-slate-200"}`,children:[e.message,Object.entries(e).filter(([t,n])=>t!="message").map(([t,n])=>c.jsxs("span",{className:"m-1",children:[c.jsx("span",{className:"italic font-bold",children:t}),"=",n]},t))]}),wp=ft.memo(({line:e})=>{var r;const t=e,n=l=>{switch(l){case"DEBUG":return"text-blue-500";case"INFO":return"text-green-500";case"WARN":return"text-amber-500";case"ERROR":return"text-red-500";default:return"text-slate-500"}};return c.jsxs("p",{className:"font-mono m-0 text-break text-[10px]",children:[c.jsx("span",{className:"m-1 text-slate-500 dark:text-slate-400",children:t.timestamp}),c.jsx("span",{className:`m-1 ${n(t.level)}`,children:t.level}),c.jsx("span",{className:"m-1",children:(r=t.spans)==null?void 0:r.map((l,o)=>c.jsx(yp,{span:l},o))}),c.jsx("span",{className:"m-1 text-slate-500 dark:text-slate-400",children:t.target}),c.jsx(xp,{fields:t.fields})]})}),fd=({children:e})=>c.jsx("form",{children:e}),wu=({autoFocus:e,value:t,name:n,disabled:r,onChange:l,onKeyDown:o,label:i,help:u,inputType:s,placeholder:a})=>c.jsxs("div",{className:"flex flex-col gap-2 text-sm mb-2",children:[c.jsx("label",{htmlFor:n,className:"dark:text-white",children:i}),c.jsx("input",{autoFocus:e,type:s,className:"block border rounded bg-transparent py-1.5 pl-2 text-gray-800 focus:ring-0 sm:text-sm sm:leading-6 dark:text-slate-300",id:n,name:n,disabled:r,placeholder:a,value:t,onKeyDown:o,onChange:l}),u&&c.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-300",children:u})]}),kp=(e,t)=>{if(e.length===0)return t;if(t.length===0)return e;const n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n},Sp=(e,t,n)=>{const r=new AbortController,l=r.signal;let o=!1;const i=()=>{console.log("cancelling fetch"),o=!0,r.abort()},u=async()=>{let a=await fetch(e,{signal:l});if(!a.ok){let h=await a.text();throw n({text:"error fetching logs",details:{statusText:a.statusText,text:h}}),null}if(!a.body){n({text:"error fetching logs: ReadableStream not supported."});return}n(null);const v=a.body.getReader();let m=new Uint8Array;for(;;){const{done:h,value:x}=await v.read();if(h)throw n({text:"log stream terminated"}),null;m=kp(m,x);for(let g;(g=m.indexOf(10))!==-1;){let S=m.slice(0,g),L=new TextDecoder().decode(S);t(L),m=m.slice(g+1)}}};let s=ld(()=>u().then(()=>{},a=>{if(!o&&a!==null)throw n({text:"error streaming logs",details:{text:a.toString()}}),a}),1e3);return()=>{i(),s()}},Ep=({url:e,maxLines:t})=>{const[n,r]=y.useState([]),[l,o]=y.useState(null),[i,u]=y.useState(""),s=y.useRef(null),a=t??1e3,v=y.useCallback(g=>{r(S=>[{id:S.length==0?0:S[0].id+1,content:g,parsed:JSON.parse(g),show:s.current?!!g.match(s.current):!0},...S.slice(0,a-1)])},[s.current,t]),m=y.useRef(v);m.current=v;const h=vp(g=>{let S=null;try{S=new RegExp(g)}catch{return}s.current=S,r(L=>{let f=[...L];for(let d of f)d.show=!!d.content.match(S);return f})},200),x=g=>{u(g),h(g)};return y.useEffect(()=>h.cancel,[]),y.useEffect(()=>Sp(e,g=>m.current(g),o),[e]),c.jsxs("div",{children:[c.jsx(Wt,{error:l}),c.jsxs("div",{className:"mb-3",children:["Showing last ",a," logs since this window was opened"]}),c.jsx(fd,{children:c.jsx(wu,{value:i,name:"filter",placeholder:"Enter filter (regex)",onChange:g=>x(g.target.value)})}),n.map(g=>c.jsx("div",{hidden:!g.show,children:c.jsx(wp,{line:g.parsed})},g.id))]})},Cp=({show:e,onClose:t})=>{let r=y.useContext(Nt).getStreamLogsUrl();return c.jsxs($l,{isOpen:e,onClose:t,title:"rqbit server logs",className:"max-w-7xl",children:[c.jsx(Al,{children:r?c.jsx(Ep,{url:r}):c.jsx(Wt,{error:{text:"HTTP API not available to stream logs"}})}),c.jsx(Ul,{children:c.jsx(Ve,{variant:"primary",onClick:t,children:"Close"})})]})},_p=({checked:e,name:t,disabled:n,onChange:r,label:l,help:o,inputType:i})=>c.jsxs("div",{className:"flex gap-3 items-start",children:[c.jsx("div",{className:"flex",children:c.jsx("input",{type:i||"checkbox",className:"block mt-1",id:t,name:t,disabled:n,checked:e,onChange:r})}),c.jsxs("div",{className:"text-sm flex flex-col gap-1",children:[c.jsx("label",{htmlFor:t,children:l}),o&&c.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-300 mb-3",children:o})]})]}),jp=({children:e,label:t,help:n,className:r})=>c.jsxs("fieldset",{className:`mb-4 ${r}`,children:[t&&c.jsx("label",{className:"text-md font-md mb-3 block pb-1 border-b",children:t}),e]}),Np=e=>{let{onHide:t,listTorrentResponse:n,listTorrentError:r,listTorrentLoading:l,data:o}=e;const[i,u]=y.useState([]),[s,a]=y.useState(!1),[v,m]=y.useState(null),[h,x]=y.useState(!1),[g,S]=y.useState(""),L=y.useContext(hr),f=y.useContext(Nt),d=()=>{u(n?n.details.files.map((C,j)=>j):[])};y.useEffect(()=>{console.log(n),d(),S((n==null?void 0:n.output_folder)||"")},[n]);const p=()=>{t(),u([]),m(null),a(!1)},w=C=>{i.includes(C)?u(i.filter(j=>j!==C)):u([...i,C])},N=async()=>{if(!n)return;a(!0);let C=n.seen_peers?n.seen_peers.slice(0,32):null,j={overwrite:!0,only_files:i,initial_peers:C,output_folder:g};h&&(j.peer_opts={connect_timeout:20,read_write_timeout:60}),f.uploadTorrent(o,j).then(()=>{t(),L.refreshTorrents()},D=>{m({text:"Error starting torrent",details:D})}).finally(()=>a(!1))},E=()=>{if(l)return c.jsx(xl,{label:"Loading torrent contents"});if(r)return c.jsx(Wt,{error:r});if(n)return c.jsxs(fd,{children:[c.jsx(wu,{label:"Output folder",name:"output_folder",inputType:"text",value:g,onChange:C=>S(C.target.value)}),c.jsxs(jp,{children:[c.jsx("label",{className:"text-sm mb-2 block",children:"Select files"}),c.jsxs("div",{className:"mb-3 flex gap-2",children:[c.jsx(Ve,{onClick:d,className:"text-sm",children:"Select all"}),c.jsx(Ve,{onClick:()=>u([]),className:"text-sm",children:"Deselect all"})]}),n.details.files.map((C,j)=>c.jsx(_p,{label:`${C.name} (${wl(C.length)})`,checked:i.includes(j),onChange:()=>w(j),name:`check-${j}`},j))]})]})};return c.jsxs($l,{isOpen:!0,onClose:p,title:"Add Torrent",children:[c.jsxs(Al,{children:[E(),c.jsx(Wt,{error:v})]}),c.jsxs(Ul,{children:[s&&c.jsx(xl,{}),c.jsx(Ve,{onClick:p,variant:"cancel",children:"Cancel"}),c.jsx(Ve,{onClick:N,variant:"primary",disabled:l||s||i.length==0,children:"OK"})]})]})},pd=({onClick:e,data:t,resetData:n,children:r,className:l})=>{const[o,i]=y.useState(!1),[u,s]=y.useState(null),[a,v]=y.useState(null),m=y.useContext(Nt);y.useEffect(()=>{if(t===null)return;let x=setTimeout(async()=>{i(!0);try{const g=await m.uploadTorrent(t,{list_only:!0});s(g)}catch(g){v({text:"Error listing torrent files",details:g})}finally{i(!1)}},0);return()=>clearTimeout(x)},[t]);const h=()=>{n(),v(null),s(null),i(!1)};return c.jsxs(c.Fragment,{children:[c.jsx(Ve,{onClick:e,className:l,children:r}),t&&c.jsx(Np,{onHide:h,listTorrentError:a,listTorrentResponse:u,data:t,listTorrentLoading:o})]})};function Tp(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M10 18V16H8V14H10V12H12V14H14V16H12V18H10Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M6 2C4.34315 2 3 3.34315 3 5V19C3 20.6569 4.34315 22 6 22H18C19.6569 22 21 20.6569 21 19V9C21 5.13401 17.866 2 14 2H6ZM6 4H13V9H19V19C19 19.5523 18.5523 20 18 20H6C5.44772 20 5 19.5523 5 19V5C5 4.44772 5.44772 4 6 4ZM15 4.10002C16.6113 4.4271 17.9413 5.52906 18.584 7H15V4.10002Z",fill:"currentColor"}}]})(e)}function Pp(e){return ue({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M14.8284 12L16.2426 13.4142L19.071 10.5858C20.6331 9.02365 20.6331 6.49099 19.071 4.9289C17.509 3.3668 14.9763 3.3668 13.4142 4.9289L10.5858 7.75732L12 9.17154L14.8284 6.34311C15.6095 5.56206 16.8758 5.56206 17.6568 6.34311C18.4379 7.12416 18.4379 8.39049 17.6568 9.17154L14.8284 12Z",fill:"currentColor"}},{tag:"path",attr:{d:"M12 14.8285L13.4142 16.2427L10.5858 19.0711C9.02372 20.6332 6.49106 20.6332 4.92896 19.0711C3.36686 17.509 3.36686 14.9764 4.92896 13.4143L7.75739 10.5858L9.1716 12L6.34317 14.8285C5.56212 15.6095 5.56212 16.8758 6.34317 17.6569C7.12422 18.4379 8.39055 18.4379 9.1716 17.6569L12 14.8285Z",fill:"currentColor"}},{tag:"path",attr:{d:"M14.8285 10.5857C15.219 10.1952 15.219 9.56199 14.8285 9.17147C14.4379 8.78094 13.8048 8.78094 13.4142 9.17147L9.1716 13.4141C8.78107 13.8046 8.78107 14.4378 9.1716 14.8283C9.56212 15.2188 10.1953 15.2188 10.5858 14.8283L14.8285 10.5857Z",fill:"currentColor"}}]})(e)}const Lp=({className:e})=>{const t=y.useRef(),[n,r]=y.useState(null),l=async()=>{var s;if(!((s=t==null?void 0:t.current)!=null&&s.files))return;const u=t.current.files[0];r(u)},o=()=>{t!=null&&t.current&&(t.current.value="",r(null))},i=()=>{t!=null&&t.current&&t.current.click()};return c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"file",ref:t,accept:".torrent",onChange:l,hidden:!0}),c.jsxs(pd,{onClick:i,data:n,resetData:o,className:e,children:[c.jsx(Tp,{className:"text-blue-500 dark:text-white"}),c.jsx("div",{children:"Upload .torrent File"})]})]})},zp=({className:e})=>{const[t,n]=y.useState(null),[r,l]=y.useState(""),[o,i]=y.useState(!1),u=()=>{n(r),l(""),i(!1)},s=()=>{i(!1),n(null)};return c.jsxs(c.Fragment,{children:[c.jsxs(pd,{onClick:()=>{i(!0)},data:t,className:e,resetData:()=>n(null),children:[c.jsx(Pp,{className:"text-blue-500 dark:text-white"}),c.jsx("div",{children:"Add Torrent from Magnet / URL"})]}),c.jsxs($l,{isOpen:o,onClose:s,title:"Add torrent",children:[c.jsx(Al,{children:c.jsx(wu,{autoFocus:!0,value:r,name:"magnet",onChange:a=>l(a.target.value),onKeyDown:a=>{a.key==="Enter"&&r&&u()},placeholder:"magnet:?xt=urn:btih:...",help:"Enter magnet or HTTP(S) URL to the .torrent"})}),c.jsxs(Ul,{children:[c.jsx(Ve,{variant:"cancel",onClick:s,children:"Cancel"}),c.jsx(Ve,{disabled:!r,variant:"primary",onClick:u,children:"Add"})]})]})]})},Mp=e=>y.createElement("svg",{width:"64mm",height:"64mm",viewBox:"0 0 64 64",id:"svg1",xmlSpace:"preserve","inkscape:version":"1.3.1 (91b66b0, 2023-11-16)","sodipodi:docname":"logo.svg","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...e},y.createElement("sodipodi:namedview",{id:"namedview1",pagecolor:"#ffffff",bordercolor:"#000000",borderopacity:.25,"inkscape:showpageshadow":2,"inkscape:pageopacity":0,"inkscape:pagecheckerboard":0,"inkscape:deskcolor":"#d1d1d1","inkscape:document-units":"mm","inkscape:zoom":1.4936372,"inkscape:cx":134.90559,"inkscape:cy":139.92689,"inkscape:window-width":1440,"inkscape:window-height":847,"inkscape:window-x":0,"inkscape:window-y":25,"inkscape:window-maximized":0,"inkscape:current-layer":"layer1"}),y.createElement("defs",{id:"defs1"},y.createElement("inkscape:perspective",{"sodipodi:type":"inkscape:persp3d","inkscape:vp_x":"3.1042448 : 18.147022 : 1","inkscape:vp_y":"0 : 999.99994 : 0","inkscape:vp_z":"303.94612 : 54.05812 : 1","inkscape:persp3d-origin":"105 : -134 : 1",id:"perspective4"})),y.createElement("g",{"inkscape:label":"Layer 1","inkscape:groupmode":"layer",id:"layer1",transform:"translate(-56.674541,-85.911432)"},y.createElement("path",{style:{fill:"#0d6efd",fillOpacity:1,strokeWidth:.610041},d:"m 81.603814,145.5382 -7.433116,-4.36986 -6.018097,-3.54529 -6.018099,-3.54529 -0.09405,-0.35761 -0.09406,-0.3576 v -15.31979 -15.31979 l 0.09451,-0.35939 0.09451,-0.35938 6.017643,-3.544433 6.017641,-3.544428 7.432805,-4.369167 7.432803,-4.369166 0.240089,0.09331 0.240083,0.09331 13.292394,7.826122 13.29241,7.826122 0.093,0.35355 0.093,0.35355 v 15.31979 15.31979 l -0.0928,0.35267 -0.0928,0.35266 -13.29682,7.82802 -13.296819,7.82803 -0.235583,0.0921 -0.235588,0.0921 z m 19.758596,-5.88315 12.13185,-7.15306 v -14.45996 -14.45994 l -5.11526,-3.01603 -5.11526,-3.016035 -7.017048,-4.136312 -7.017053,-4.13631 h -0.112738 -0.11273 l -7.097035,4.182089 -7.09703,4.18209 -5.035336,2.971548 -5.035335,2.97155 v 14.45761 14.45762 l 5.275113,3.11051 5.275113,3.11051 6.793709,4.02813 6.793702,4.02812 0.176743,0.0155 0.176742,0.0155 z",id:"path15","sodipodi:nodetypes":"cccccccccccccccccccccccccccccccccccccccccccccccccccc"}),y.createElement("path",{style:{fill:"#000000"},id:"path1",d:""}),y.createElement("path",{d:"m 84.161856,133.76725 -4.567369,-2.5483 -0.700367,0.28585 -0.700376,0.28584 -0.495731,0.11427 -0.495731,0.11426 -3.168791,-1.75603 -3.168782,-1.75603 -0.515321,-0.57002 -0.515323,-0.57002 0.0161,-3.59449 0.0161,-3.59448 0.164041,-0.41611 0.164042,-0.41611 1.480342,-0.85565 1.480346,-0.85565 0.06276,-3.67919 0.06276,-3.67921 0.39653,-0.35884 0.396521,-0.35886 3.663275,-2.04111 3.663267,-2.04112 0.114523,-1.62785 0.114506,-1.62786 0.229029,-0.21764 0.229038,-0.21765 3.341459,-1.854383 3.341467,-1.854382 h 0.301682 0.301682 l 2.476951,1.380374 2.476959,1.380381 1.151673,0.57845 1.151674,0.57845 0.02969,0.27424 0.02969,0.27423 0.02753,1.46272 0.02753,1.46273 3.663258,2.04521 3.66327,2.04521 0.40205,0.36386 0.40206,0.36385 v 3.60098 3.60097 l 0.28629,0.23408 0.28628,0.23408 1.43146,0.72479 1.43145,0.72479 v 3.9806 3.98059 l -0.51533,0.56995 -0.51532,0.56994 -3.19072,1.75191 -3.19072,1.75191 -0.47379,-0.11007 -0.473797,-0.11007 -0.699654,-0.28558 -0.699656,-0.28558 -4.589745,2.5527 -4.589746,2.55269 -0.321886,-0.004 -0.321886,-0.004 z m 8.681258,-1.65766 3.426793,-1.91645 0.06536,-0.19784 0.06535,-0.19785 -1.315884,-0.68709 -1.315885,-0.6871 -0.401264,-0.40081 -0.401265,-0.4008 v -3.79409 -3.79409 l 0.221568,-0.41401 0.221567,-0.414 3.411065,-1.86126 3.411061,-1.86126 h 0.38456 0.38455 l 0.91435,0.46646 0.91435,0.46646 -0.0646,-2.66249 -0.0646,-2.66248 -2.829977,-1.58148 -2.829984,-1.58149 -0.204696,0.12651 -0.204688,0.12651 v 1.11999 1.11999 l -0.744359,0.54975 -0.744358,0.54977 -2.773906,1.52318 -2.773906,1.52319 h -0.526565 -0.526565 l -3.34145,-1.85945 -3.341467,-1.85945 -0.168271,-0.2591 -0.16827,-0.25909 -0.0035,-1.07439 -0.0035,-1.07439 -0.204688,-0.12651 -0.204697,-0.12651 -2.82999,1.58149 -2.829982,1.58148 -0.06458,2.66248 -0.06458,2.66249 0.914351,-0.46646 0.914343,-0.46646 h 0.378551 0.37855 l 3.638639,1.97495 3.63864,1.97495 v 4.0944 4.09441 l -0.401265,0.4008 -0.401264,0.40081 -1.315885,0.6871 -1.315884,0.68709 0.06535,0.19785 0.06536,0.19784 3.426792,1.91645 3.426785,1.91644 h 0.343552 0.343544 z m -16.416873,-5.4431 -0.06475,-2.55838 -2.046125,-1.10985 -2.046124,-1.10984 -0.195677,0.19567 -0.195685,0.19568 0.06596,2.2656 0.06596,2.2656 2.06129,1.18713 2.06129,1.18713 0.179282,0.0198 0.179273,0.0198 z m 4.515881,1.34369 2.061291,-1.19456 0.06527,-2.48747 0.06527,-2.48748 -0.408821,0.15589 -0.408848,0.15589 -1.889514,1.02885 -1.889514,1.02885 v 2.50736 2.50736 l 0.171777,-0.01 0.171767,-0.01 z m 18.666131,-1.29267 v -2.50736 l -1.889509,-1.02885 -1.889522,-1.02885 -0.40883,-0.15589 -0.408839,-0.15589 0.06527,2.48748 0.06527,2.48747 2.061291,1.19456 2.061288,1.19456 0.171777,0.01 0.171774,0.01 z m 4.466127,1.28059 2.06129,-1.18713 0.0661,-2.2656 0.066,-2.2656 -0.19568,-0.19568 -0.19568,-0.19567 -2.04613,1.10984 -2.04612,1.10985 -0.0647,2.55838 -0.0648,2.55838 0.17927,-0.0198 0.17927,-0.0198 z m -24.281888,-6.71835 1.960418,-1.07415 -0.07566,-0.22693 -0.07566,-0.22691 -2.049423,-1.09443 -2.049431,-1.09442 -2.116604,1.14523 -2.116613,1.14523 v 0.17781 0.17782 l 2.004029,1.06709 2.004037,1.06711 0.277236,0.005 0.277237,0.005 z m 23.056528,4.3e-4 2.03643,-1.07372 -0.0708,-0.21245 -0.0708,-0.21244 -2.09332,-1.13015 -2.09332,-1.13016 -2.077692,1.17124 -2.077685,1.17123 v 0.17384 0.17386 l 1.889522,1.0551 1.889505,1.0551 0.31588,0.0161 0.31587,0.0161 z m -14.742004,-11.90808 0.06492,-2.2946 -0.293917,-0.23052 -0.293926,-0.2305 -2.011741,-1.08631 -2.01175,-1.08629 0.06501,2.57478 0.06501,2.57476 1.946776,1.09773 1.946767,1.09773 0.229038,-0.0611 0.229029,-0.0611 z m 4.401245,1.31989 1.946767,-1.09857 0.06501,-2.57476 0.06501,-2.57478 -2.01175,1.08629 -2.011741,1.08631 -0.286291,0.22417 -0.286291,0.22418 v 2.22411 2.2241 l 0.152689,0.15269 0.152689,0.15269 0.133602,-0.0139 0.133602,-0.0139 z m -1.021015,-6.79999 1.952048,-1.05546 -0.224347,-0.26147 -0.224337,-0.26149 -1.958921,-1.03065 -1.958911,-1.03064 -1.958912,1.03064 -1.958912,1.03065 -0.224303,0.26142 -0.224277,0.26141 1.896915,1.04261 1.896906,1.04261 0.517494,0.0129 0.517501,0.0129 z",style:{fill:"#0d6efd",fillOpacity:1,strokeWidth:.865634},id:"path1-8"}))),Op=({title:e})=>{const[t,n]=e.split("-");return c.jsxs("header",{className:"bg-slate-50 drop-shadow-lg flex flex-wrap justify-center lg:justify-between items-center dark:bg-slate-800 mb-3",children:[c.jsxs("div",{className:"flex flex-nowrap items-center justify-between m-2",children:[c.jsx(Mp,{className:"w-10 h-10 p-1",alt:"logo"}),c.jsxs("h1",{className:"flex items-center dark:text-white",children:[c.jsx("div",{className:"text-3xl",children:t}),c.jsx("div",{className:"bg-blue-100 text-blue-800 text-xl font-semibold me-2 px-2.5 py-0.5 rounded ms-2 dark:bg-blue-900 dark:text-white",children:n})]})]}),c.jsxs("div",{className:"flex flex-wrap gap-1 m-2",children:[c.jsx(zp,{className:"flex-grow justify-center dark:text-white"}),c.jsx(Lp,{className:"flex-grow justify-center dark:text-white"})]})]})};let Yt=window.matchMedia("(prefers-color-scheme: dark)").matches;window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{Bl.setDark(e.matches)});const Bl={isDark:()=>Yt,setDark:e=>(Yt=e,document.body.classList.toggle("dark",Yt),Yt),toggle:()=>{Bl.setDark(!Yt)}};Bl.setDark(Yt);const Fp=e=>{const[t,n]=y.useState(null),[r,l]=y.useState(null),[o,i]=y.useState(null),[u,s]=y.useState(!1);let[a,v]=y.useState(!1);const m=y.useContext(Nt),h=async()=>{s(!0);let g=await m.listTorrents().finally(()=>s(!1));i(g.torrents)};y.useEffect(()=>gu(async()=>h().then(()=>(l(null),5e3),g=>(l({text:"Error refreshing torrents",details:g}),console.error(g),5e3)),0),[]);const x={setCloseableError:n,refreshTorrents:h};return c.jsx(hr.Provider,{value:x,children:c.jsxs("div",{className:"dark:bg-gray-900 dark:text-gray-200 min-h-screen",children:[c.jsx(Op,{title:e.title}),c.jsxs("div",{className:"relative",children:[c.jsxs("div",{className:"absolute top-0 start-0 pl-2 z-10",children:[e.menuButtons&&e.menuButtons.map((g,S)=>c.jsx("span",{children:g},S)),c.jsx(Kn,{onClick:()=>v(!0),children:c.jsx(J0,{})}),c.jsx(Kn,{onClick:Bl.toggle,children:c.jsx(q0,{})})]}),c.jsx(J1,{closeableError:t,otherError:r,torrents:o,torrentsLoading:u})]}),c.jsx(Cp,{show:a,onClose:()=>v(!1)})]})})},md=window.origin==="null"||window.origin==="http://localhost:3031"?"http://localhost:3030":"",Ze=async(e,t,n)=>{console.log(e,t);const r=md+t,l={method:e,headers:{Accept:"application/json"},body:n};let o={method:e,path:t,text:""},i;try{i=await fetch(r,l)}catch{return o.text="network error",Promise.reject(o)}if(o.status=i.status,o.statusText=`${i.status} ${i.statusText}`,!i.ok){const s=await i.text();try{const a=JSON.parse(s);o.text=a.human_readable!==void 0?a.human_readable:JSON.stringify(a,null,2)}catch{o.text=s}return Promise.reject(o)}return await i.json()},Vs={getStreamLogsUrl:()=>md+"/stream_logs",listTorrents:()=>Ze("GET","/torrents"),getTorrentDetails:e=>Ze("GET",`/torrents/${e}`),getTorrentStats:e=>Ze("GET",`/torrents/${e}/stats/v1`),uploadTorrent:(e,t)=>{var r,l;let n="/torrents?&overwrite=true";return t!=null&&t.list_only&&(n+="&list_only=true"),(t==null?void 0:t.only_files)!=null&&(n+=`&only_files=${t.only_files.join(",")}`),(r=t==null?void 0:t.peer_opts)!=null&&r.connect_timeout&&(n+=`&peer_connect_timeout=${t.peer_opts.connect_timeout}`),(l=t==null?void 0:t.peer_opts)!=null&&l.read_write_timeout&&(n+=`&peer_read_write_timeout=${t.peer_opts.read_write_timeout}`),t!=null&&t.initial_peers&&(n+=`&initial_peers=${t.initial_peers.join(",")}`),t!=null&&t.output_folder&&(n+=`&output_folder=${t.output_folder}`),typeof e=="string"&&(n+="&is_url=true"),Ze("POST",n,e)},pause:e=>Ze("POST",`/torrents/${e}/pause`),start:e=>Ze("POST",`/torrents/${e}/start`),forget:e=>Ze("POST",`/torrents/${e}/forget`),delete:e=>Ze("POST",`/torrents/${e}/delete`),getVersion:async()=>(await Ze("GET","/")).version},Ip=()=>{let[e,t]=y.useState("rqbit web UI");return y.useEffect(()=>gu(()=>Vs.getVersion().then(r=>{const l=`rqbit web UI - v${r}`;return t(l),document.title=l,1e4},r=>1e3),0),[]),c.jsx(y.StrictMode,{children:c.jsx(Nt.Provider,{value:Vs,children:c.jsx(Fp,{title:e})})})};_o.createRoot(document.getElementById("app")).render(c.jsx(Ip,{})); diff --git a/crates/librqbit/webui/dist/manifest.json b/crates/librqbit/webui/dist/manifest.json index 48b57c7d..66cb60dd 100644 --- a/crates/librqbit/webui/dist/manifest.json +++ b/crates/librqbit/webui/dist/manifest.json @@ -4,14 +4,14 @@ "src": "assets/logo.svg" }, "index.css": { - "file": "assets/index-8d563632.css", + "file": "assets/index-54ac219d.css", "src": "index.css" }, "index.html": { "css": [ - "assets/index-8d563632.css" + "assets/index-54ac219d.css" ], - "file": "assets/index-c39122a8.js", + "file": "assets/index-7c5fc47e.js", "isEntry": true, "src": "index.html" } diff --git a/crates/librqbit/webui/src/components/modal/Modal.tsx b/crates/librqbit/webui/src/components/modal/Modal.tsx index 0c8d864a..a9f10a45 100644 --- a/crates/librqbit/webui/src/components/modal/Modal.tsx +++ b/crates/librqbit/webui/src/components/modal/Modal.tsx @@ -51,7 +51,7 @@ export const Modal: React.FC = ({ className="fixed z-[301] top-0 left-0 w-full h-full block overflow-x-hidden overflow-y-auto" >
{children} diff --git a/crates/librqbit/webui/src/rqbit-web.tsx b/crates/librqbit/webui/src/rqbit-web.tsx index fbb0405e..a8743c1a 100644 --- a/crates/librqbit/webui/src/rqbit-web.tsx +++ b/crates/librqbit/webui/src/rqbit-web.tsx @@ -67,7 +67,7 @@ export const RqbitWebUI = (props: { return ( -
+
{/* Menu buttons */} diff --git a/crates/librqbit/webui/tailwind.config.js b/crates/librqbit/webui/tailwind.config.js deleted file mode 100644 index b78b940e..00000000 --- a/crates/librqbit/webui/tailwind.config.js +++ /dev/null @@ -1,5 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -export default { - content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], - darkMode: "class", -}; diff --git a/crates/librqbit/webui/tailwind.config.ts b/crates/librqbit/webui/tailwind.config.ts new file mode 100644 index 00000000..cdaaaddb --- /dev/null +++ b/crates/librqbit/webui/tailwind.config.ts @@ -0,0 +1,21 @@ +import colors from "tailwindcss/colors"; + +import type { Config } from "tailwindcss"; + +export default { + content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"], + darkMode: "class", + theme: { + colors: { + transparent: colors.transparent, + amber: colors.amber, + black: colors.black, + blue: colors.blue, + slate: colors.slate, + white: colors.white, + gray: colors.gray, + green: colors.green, + red: colors.red, + }, + }, +} satisfies Config; diff --git a/desktop/src-tauri/Cargo.lock b/desktop/src-tauri/Cargo.lock index 5150bbb2..61a19413 100644 --- a/desktop/src-tauri/Cargo.lock +++ b/desktop/src-tauri/Cargo.lock @@ -1867,7 +1867,7 @@ dependencies = [ [[package]] name = "librqbit" -version = "5.2.0" +version = "5.3.0" dependencies = [ "anyhow", "axum", @@ -3012,7 +3012,7 @@ dependencies = [ [[package]] name = "rqbit-desktop" -version = "5.2.0" +version = "5.3.0" dependencies = [ "anyhow", "base64 0.21.5", diff --git a/desktop/tailwind.config.js b/desktop/tailwind.config.js deleted file mode 100644 index 807d3670..00000000 --- a/desktop/tailwind.config.js +++ /dev/null @@ -1,8 +0,0 @@ -/** @type {import('tailwindcss').Config} */ -export default { - content: [ - "./src/**/*.{js,ts,jsx,tsx,mdx}", - "../crates/librqbit/webui/src/**/*.{js,ts,jsx,tsx,mdx}", - ], - darkMode: "class", -}; diff --git a/desktop/tailwind.config.ts b/desktop/tailwind.config.ts new file mode 100644 index 00000000..85df615d --- /dev/null +++ b/desktop/tailwind.config.ts @@ -0,0 +1,11 @@ +import rqbitWebTailwind from "../crates/librqbit/webui/tailwind.config"; + +import type { Config } from "tailwindcss"; + +export default { + ...rqbitWebTailwind, + content: [ + "./src/**/*.{js,ts,jsx,tsx,mdx}", + "../crates/librqbit/webui/src/**/*.{js,ts,jsx,tsx,mdx}", + ], +} satisfies Config;