Sidebar.svelte 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <script lang="ts">
  2. import { toast } from 'svelte-sonner';
  3. import { goto } from '$app/navigation';
  4. import {
  5. user,
  6. chats,
  7. settings,
  8. showSettings,
  9. chatId,
  10. tags,
  11. showSidebar,
  12. mobile,
  13. showArchivedChats,
  14. pinnedChats,
  15. scrollPaginationEnabled,
  16. currentChatPage,
  17. temporaryChatEnabled,
  18. showArtifacts,
  19. showOverview,
  20. showControls
  21. } from '$lib/stores';
  22. import { onMount, getContext, tick, onDestroy } from 'svelte';
  23. const i18n = getContext('i18n');
  24. import { updateUserSettings } from '$lib/apis/users';
  25. import {
  26. deleteChatById,
  27. getChatList,
  28. getChatById,
  29. getChatListByTagName,
  30. updateChatById,
  31. getAllChatTags,
  32. archiveChatById,
  33. cloneChatById,
  34. getChatListBySearchText,
  35. createNewChat,
  36. getPinnedChatList
  37. } from '$lib/apis/chats';
  38. import { WEBUI_BASE_URL } from '$lib/constants';
  39. import ArchivedChatsModal from './Sidebar/ArchivedChatsModal.svelte';
  40. import UserMenu from './Sidebar/UserMenu.svelte';
  41. import ChatItem from './Sidebar/ChatItem.svelte';
  42. import DeleteConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
  43. import Spinner from '../common/Spinner.svelte';
  44. import Loader from '../common/Loader.svelte';
  45. import FilesOverlay from '../chat/MessageInput/FilesOverlay.svelte';
  46. import AddFilesPlaceholder from '../AddFilesPlaceholder.svelte';
  47. import { select } from 'd3-selection';
  48. import SearchInput from './Sidebar/SearchInput.svelte';
  49. import ChevronDown from '../icons/ChevronDown.svelte';
  50. import ChevronUp from '../icons/ChevronUp.svelte';
  51. import ChevronRight from '../icons/ChevronRight.svelte';
  52. const BREAKPOINT = 768;
  53. let navElement;
  54. let search = '';
  55. let shiftKey = false;
  56. let selectedChatId = null;
  57. let deleteChat = null;
  58. let showDeleteConfirm = false;
  59. let showDropdown = false;
  60. let selectedTagName = null;
  61. let showPinnedChat = true;
  62. // Pagination variables
  63. let chatListLoading = false;
  64. let allChatsLoaded = false;
  65. const initChatList = async () => {
  66. // Reset pagination variables
  67. currentChatPage.set(1);
  68. allChatsLoaded = false;
  69. await chats.set(await getChatList(localStorage.token, $currentChatPage));
  70. // Enable pagination
  71. scrollPaginationEnabled.set(true);
  72. };
  73. const loadMoreChats = async () => {
  74. chatListLoading = true;
  75. currentChatPage.set($currentChatPage + 1);
  76. let newChatList = [];
  77. if (search) {
  78. newChatList = await getChatListBySearchText(localStorage.token, search, $currentChatPage);
  79. } else {
  80. newChatList = await getChatList(localStorage.token, $currentChatPage);
  81. }
  82. // once the bottom of the list has been reached (no results) there is no need to continue querying
  83. allChatsLoaded = newChatList.length === 0;
  84. await chats.set([...($chats ? $chats : []), ...newChatList]);
  85. chatListLoading = false;
  86. };
  87. let searchDebounceTimeout;
  88. const searchDebounceHandler = async () => {
  89. console.log('search', search);
  90. chats.set(null);
  91. selectedTagName = null;
  92. if (searchDebounceTimeout) {
  93. clearTimeout(searchDebounceTimeout);
  94. }
  95. if (search === '') {
  96. await initChatList();
  97. return;
  98. } else {
  99. searchDebounceTimeout = setTimeout(async () => {
  100. currentChatPage.set(1);
  101. await chats.set(await getChatListBySearchText(localStorage.token, search));
  102. }, 1000);
  103. }
  104. };
  105. const deleteChatHandler = async (id) => {
  106. const res = await deleteChatById(localStorage.token, id).catch((error) => {
  107. toast.error(error);
  108. return null;
  109. });
  110. if (res) {
  111. if ($chatId === id) {
  112. await chatId.set('');
  113. await tick();
  114. goto('/');
  115. }
  116. allChatsLoaded = false;
  117. currentChatPage.set(1);
  118. await chats.set(await getChatList(localStorage.token, $currentChatPage));
  119. await pinnedChats.set(await getPinnedChatList(localStorage.token));
  120. }
  121. };
  122. const inputFilesHandler = async (files) => {
  123. console.log(files);
  124. for (const file of files) {
  125. const reader = new FileReader();
  126. reader.onload = async (e) => {
  127. const content = e.target.result;
  128. try {
  129. const items = JSON.parse(content);
  130. for (const item of items) {
  131. if (item.chat) {
  132. await createNewChat(localStorage.token, item.chat);
  133. }
  134. }
  135. } catch {
  136. toast.error($i18n.t(`Invalid file format.`));
  137. }
  138. initChatList();
  139. };
  140. reader.readAsText(file);
  141. }
  142. };
  143. const tagEventHandler = async (type, tagName, chatId) => {
  144. console.log(type, tagName, chatId);
  145. if (type === 'delete') {
  146. currentChatPage.set(1);
  147. await chats.set(await getChatListBySearchText(localStorage.token, search));
  148. }
  149. };
  150. let dragged = false;
  151. const onDragOver = (e) => {
  152. e.preventDefault();
  153. // Check if a file is being dragged.
  154. if (e.dataTransfer?.types?.includes('Files')) {
  155. dragged = true;
  156. } else {
  157. dragged = false;
  158. }
  159. };
  160. const onDragLeave = () => {
  161. dragged = false;
  162. };
  163. const onDrop = async (e) => {
  164. e.preventDefault();
  165. console.log(e); // Log the drop event
  166. // Perform file drop check and handle it accordingly
  167. if (e.dataTransfer?.files) {
  168. const inputFiles = Array.from(e.dataTransfer?.files);
  169. if (inputFiles && inputFiles.length > 0) {
  170. console.log(inputFiles); // Log the dropped files
  171. inputFilesHandler(inputFiles); // Handle the dropped files
  172. }
  173. }
  174. dragged = false; // Reset dragged status after drop
  175. };
  176. let touchstart;
  177. let touchend;
  178. function checkDirection() {
  179. const screenWidth = window.innerWidth;
  180. const swipeDistance = Math.abs(touchend.screenX - touchstart.screenX);
  181. if (touchstart.clientX < 40 && swipeDistance >= screenWidth / 8) {
  182. if (touchend.screenX < touchstart.screenX) {
  183. showSidebar.set(false);
  184. }
  185. if (touchend.screenX > touchstart.screenX) {
  186. showSidebar.set(true);
  187. }
  188. }
  189. }
  190. const onTouchStart = (e) => {
  191. touchstart = e.changedTouches[0];
  192. console.log(touchstart.clientX);
  193. };
  194. const onTouchEnd = (e) => {
  195. touchend = e.changedTouches[0];
  196. checkDirection();
  197. };
  198. const onKeyDown = (e) => {
  199. if (e.key === 'Shift') {
  200. shiftKey = true;
  201. }
  202. };
  203. const onKeyUp = (e) => {
  204. if (e.key === 'Shift') {
  205. shiftKey = false;
  206. }
  207. };
  208. const onFocus = () => {};
  209. const onBlur = () => {
  210. shiftKey = false;
  211. selectedChatId = null;
  212. };
  213. onMount(async () => {
  214. showPinnedChat = localStorage?.showPinnedChat ? localStorage.showPinnedChat === 'true' : true;
  215. mobile.subscribe((e) => {
  216. if ($showSidebar && e) {
  217. showSidebar.set(false);
  218. }
  219. if (!$showSidebar && !e) {
  220. showSidebar.set(true);
  221. }
  222. });
  223. showSidebar.set(!$mobile ? localStorage.sidebar === 'true' : false);
  224. showSidebar.subscribe((value) => {
  225. localStorage.sidebar = value;
  226. });
  227. await pinnedChats.set(await getPinnedChatList(localStorage.token));
  228. await initChatList();
  229. window.addEventListener('keydown', onKeyDown);
  230. window.addEventListener('keyup', onKeyUp);
  231. window.addEventListener('touchstart', onTouchStart);
  232. window.addEventListener('touchend', onTouchEnd);
  233. window.addEventListener('focus', onFocus);
  234. window.addEventListener('blur', onBlur);
  235. const dropZone = document.getElementById('sidebar');
  236. dropZone?.addEventListener('dragover', onDragOver);
  237. dropZone?.addEventListener('drop', onDrop);
  238. dropZone?.addEventListener('dragleave', onDragLeave);
  239. });
  240. onDestroy(() => {
  241. window.removeEventListener('keydown', onKeyDown);
  242. window.removeEventListener('keyup', onKeyUp);
  243. window.removeEventListener('touchstart', onTouchStart);
  244. window.removeEventListener('touchend', onTouchEnd);
  245. window.removeEventListener('focus', onFocus);
  246. window.removeEventListener('blur', onBlur);
  247. const dropZone = document.getElementById('sidebar');
  248. dropZone?.removeEventListener('dragover', onDragOver);
  249. dropZone?.removeEventListener('drop', onDrop);
  250. dropZone?.removeEventListener('dragleave', onDragLeave);
  251. });
  252. </script>
  253. <ArchivedChatsModal
  254. bind:show={$showArchivedChats}
  255. on:change={async () => {
  256. await pinnedChats.set(await getPinnedChatList(localStorage.token));
  257. await chats.set(await getChatList(localStorage.token));
  258. }}
  259. />
  260. <DeleteConfirmDialog
  261. bind:show={showDeleteConfirm}
  262. title={$i18n.t('Delete chat?')}
  263. on:confirm={() => {
  264. deleteChatHandler(deleteChat.id);
  265. }}
  266. >
  267. <div class=" text-sm text-gray-500 flex-1 line-clamp-3">
  268. {$i18n.t('This will delete')} <span class=" font-semibold">{deleteChat.title}</span>.
  269. </div>
  270. </DeleteConfirmDialog>
  271. <!-- svelte-ignore a11y-no-static-element-interactions -->
  272. {#if $showSidebar}
  273. <div
  274. class=" fixed md:hidden z-40 top-0 right-0 left-0 bottom-0 bg-black/60 w-full min-h-screen h-screen flex justify-center overflow-hidden overscroll-contain"
  275. on:mousedown={() => {
  276. showSidebar.set(!$showSidebar);
  277. }}
  278. />
  279. {/if}
  280. <div
  281. bind:this={navElement}
  282. id="sidebar"
  283. class="h-screen max-h-[100dvh] min-h-screen select-none {$showSidebar
  284. ? 'md:relative w-[260px]'
  285. : '-translate-x-[260px] w-[0px]'} bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-200 text-sm transition fixed z-50 top-0 left-0
  286. "
  287. data-state={$showSidebar}
  288. >
  289. {#if dragged}
  290. <div
  291. class="absolute w-full h-full max-h-full backdrop-blur bg-gray-800/40 flex justify-center z-[999] touch-none pointer-events-none"
  292. >
  293. <div class="m-auto pt-64 flex flex-col justify-center">
  294. <AddFilesPlaceholder
  295. title={$i18n.t('Drop Chat Export')}
  296. content={$i18n.t('Drop a chat export file here to import it.')}
  297. />
  298. </div>
  299. </div>
  300. {/if}
  301. <div
  302. class="py-2.5 my-auto flex flex-col justify-between h-screen max-h-[100dvh] w-[260px] z-50 {$showSidebar
  303. ? ''
  304. : 'invisible'}"
  305. >
  306. <div class="px-2.5 flex justify-between space-x-1 text-gray-600 dark:text-gray-400">
  307. <a
  308. id="sidebar-new-chat-button"
  309. class="flex flex-1 justify-between rounded-xl px-2 h-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"
  310. href="/"
  311. draggable="false"
  312. on:click={async () => {
  313. selectedChatId = null;
  314. await goto('/');
  315. const newChatButton = document.getElementById('new-chat-button');
  316. setTimeout(() => {
  317. newChatButton?.click();
  318. if ($mobile) {
  319. showSidebar.set(false);
  320. }
  321. }, 0);
  322. }}
  323. >
  324. <div class="self-center mx-1.5">
  325. <img
  326. crossorigin="anonymous"
  327. src="{WEBUI_BASE_URL}/static/favicon.png"
  328. class=" size-6 -translate-x-1.5 rounded-full"
  329. alt="logo"
  330. />
  331. </div>
  332. <div class=" self-center font-medium text-sm text-gray-850 dark:text-white font-primary">
  333. {$i18n.t('New Chat')}
  334. </div>
  335. <div class="self-center ml-auto">
  336. <svg
  337. xmlns="http://www.w3.org/2000/svg"
  338. viewBox="0 0 20 20"
  339. fill="currentColor"
  340. class="size-5"
  341. >
  342. <path
  343. d="M5.433 13.917l1.262-3.155A4 4 0 017.58 9.42l6.92-6.918a2.121 2.121 0 013 3l-6.92 6.918c-.383.383-.84.685-1.343.886l-3.154 1.262a.5.5 0 01-.65-.65z"
  344. />
  345. <path
  346. d="M3.5 5.75c0-.69.56-1.25 1.25-1.25H10A.75.75 0 0010 3H4.75A2.75 2.75 0 002 5.75v9.5A2.75 2.75 0 004.75 18h9.5A2.75 2.75 0 0017 15.25V10a.75.75 0 00-1.5 0v5.25c0 .69-.56 1.25-1.25 1.25h-9.5c-.69 0-1.25-.56-1.25-1.25v-9.5z"
  347. />
  348. </svg>
  349. </div>
  350. </a>
  351. <button
  352. class=" cursor-pointer px-2 py-2 flex rounded-xl hover:bg-gray-100 dark:hover:bg-gray-900 transition"
  353. on:click={() => {
  354. showSidebar.set(!$showSidebar);
  355. }}
  356. >
  357. <div class=" m-auto self-center">
  358. <svg
  359. xmlns="http://www.w3.org/2000/svg"
  360. fill="none"
  361. viewBox="0 0 24 24"
  362. stroke-width="2"
  363. stroke="currentColor"
  364. class="size-5"
  365. >
  366. <path
  367. stroke-linecap="round"
  368. stroke-linejoin="round"
  369. d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"
  370. />
  371. </svg>
  372. </div>
  373. </button>
  374. </div>
  375. {#if $user?.role === 'admin'}
  376. <div class="px-2.5 flex justify-center text-gray-800 dark:text-gray-200">
  377. <a
  378. class="flex-grow flex space-x-3 rounded-xl px-2.5 py-2 hover:bg-gray-100 dark:hover:bg-gray-900 transition"
  379. href="/workspace"
  380. on:click={() => {
  381. selectedChatId = null;
  382. chatId.set('');
  383. if ($mobile) {
  384. showSidebar.set(false);
  385. }
  386. }}
  387. draggable="false"
  388. >
  389. <div class="self-center">
  390. <svg
  391. xmlns="http://www.w3.org/2000/svg"
  392. fill="none"
  393. viewBox="0 0 24 24"
  394. stroke-width="2"
  395. stroke="currentColor"
  396. class="size-[1.1rem]"
  397. >
  398. <path
  399. stroke-linecap="round"
  400. stroke-linejoin="round"
  401. d="M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"
  402. />
  403. </svg>
  404. </div>
  405. <div class="flex self-center">
  406. <div class=" self-center font-medium text-sm font-primary">{$i18n.t('Workspace')}</div>
  407. </div>
  408. </a>
  409. </div>
  410. {/if}
  411. <div class="relative {$temporaryChatEnabled ? 'opacity-20' : ''}">
  412. {#if $temporaryChatEnabled}
  413. <div class="absolute z-40 w-full h-full flex justify-center"></div>
  414. {/if}
  415. <SearchInput
  416. bind:value={search}
  417. on:input={searchDebounceHandler}
  418. placeholder={$i18n.t('Search')}
  419. />
  420. </div>
  421. <div
  422. class="relative flex flex-col flex-1 overflow-y-auto {$temporaryChatEnabled
  423. ? 'opacity-20'
  424. : ''}"
  425. >
  426. {#if $temporaryChatEnabled}
  427. <div class="absolute z-40 w-full h-full flex justify-center"></div>
  428. {/if}
  429. {#if !search && $pinnedChats.length > 0}
  430. <div class=" pb-2 flex flex-col space-y-1">
  431. <div class="">
  432. <div class="px-2">
  433. <button
  434. class="w-full py-1 px-1.5 rounded-md flex items-center gap-1 text-xs text-gray-500 dark:text-gray-500 font-medium hover:bg-gray-100 dark:hover:bg-gray-900 transition"
  435. on:click={() => {
  436. showPinnedChat = !showPinnedChat;
  437. localStorage.setItem('showPinnedChat', showPinnedChat);
  438. }}
  439. >
  440. <div class="text-gray-300">
  441. {#if showPinnedChat}
  442. <ChevronDown className=" size-3" strokeWidth="2.5" />
  443. {:else}
  444. <ChevronRight className=" text-gra size-3" strokeWidth="2.5" />
  445. {/if}
  446. </div>
  447. <div class=" translate-y-[0.5px]">
  448. {$i18n.t('Pinned')}
  449. </div>
  450. </button>
  451. </div>
  452. {#if showPinnedChat}
  453. <div class="pl-2 mt-1 flex flex-col overflow-y-auto scrollbar-hidden">
  454. {#each $pinnedChats as chat, idx}
  455. <ChatItem
  456. {chat}
  457. {shiftKey}
  458. selected={selectedChatId === chat.id}
  459. on:select={() => {
  460. selectedChatId = chat.id;
  461. }}
  462. on:unselect={() => {
  463. selectedChatId = null;
  464. }}
  465. on:delete={(e) => {
  466. if ((e?.detail ?? '') === 'shift') {
  467. deleteChatHandler(chat.id);
  468. } else {
  469. deleteChat = chat;
  470. showDeleteConfirm = true;
  471. }
  472. }}
  473. on:tag={(e) => {
  474. const { type, name } = e.detail;
  475. tagEventHandler(type, name, chat.id);
  476. }}
  477. />
  478. {/each}
  479. </div>
  480. {/if}
  481. </div>
  482. </div>
  483. {/if}
  484. <div class="pl-2 flex-1 flex flex-col space-y-1 overflow-y-auto scrollbar-hidden">
  485. {#if $chats}
  486. {#each $chats as chat, idx}
  487. {#if idx === 0 || (idx > 0 && chat.time_range !== $chats[idx - 1].time_range)}
  488. <div
  489. class="w-full pl-2.5 text-xs text-gray-500 dark:text-gray-500 font-medium {idx === 0
  490. ? ''
  491. : 'pt-5'} pb-0.5"
  492. >
  493. {$i18n.t(chat.time_range)}
  494. <!-- localisation keys for time_range to be recognized from the i18next parser (so they don't get automatically removed):
  495. {$i18n.t('Today')}
  496. {$i18n.t('Yesterday')}
  497. {$i18n.t('Previous 7 days')}
  498. {$i18n.t('Previous 30 days')}
  499. {$i18n.t('January')}
  500. {$i18n.t('February')}
  501. {$i18n.t('March')}
  502. {$i18n.t('April')}
  503. {$i18n.t('May')}
  504. {$i18n.t('June')}
  505. {$i18n.t('July')}
  506. {$i18n.t('August')}
  507. {$i18n.t('September')}
  508. {$i18n.t('October')}
  509. {$i18n.t('November')}
  510. {$i18n.t('December')}
  511. -->
  512. </div>
  513. {/if}
  514. <ChatItem
  515. {chat}
  516. {shiftKey}
  517. selected={selectedChatId === chat.id}
  518. on:select={() => {
  519. selectedChatId = chat.id;
  520. }}
  521. on:unselect={() => {
  522. selectedChatId = null;
  523. }}
  524. on:delete={(e) => {
  525. if ((e?.detail ?? '') === 'shift') {
  526. deleteChatHandler(chat.id);
  527. } else {
  528. deleteChat = chat;
  529. showDeleteConfirm = true;
  530. }
  531. }}
  532. on:tag={(e) => {
  533. const { type, name } = e.detail;
  534. tagEventHandler(type, name, chat.id);
  535. }}
  536. />
  537. {/each}
  538. {#if $scrollPaginationEnabled && !allChatsLoaded}
  539. <Loader
  540. on:visible={(e) => {
  541. if (!chatListLoading) {
  542. loadMoreChats();
  543. }
  544. }}
  545. >
  546. <div class="w-full flex justify-center py-1 text-xs animate-pulse items-center gap-2">
  547. <Spinner className=" size-4" />
  548. <div class=" ">Loading...</div>
  549. </div>
  550. </Loader>
  551. {/if}
  552. {:else}
  553. <div class="w-full flex justify-center py-1 text-xs animate-pulse items-center gap-2">
  554. <Spinner className=" size-4" />
  555. <div class=" ">Loading...</div>
  556. </div>
  557. {/if}
  558. </div>
  559. </div>
  560. <div class="px-2.5 pb-safe-bottom">
  561. <!-- <hr class=" border-gray-900 mb-1 w-full" /> -->
  562. <div class="flex flex-col font-primary">
  563. {#if $user !== undefined}
  564. <UserMenu
  565. role={$user.role}
  566. on:show={(e) => {
  567. if (e.detail === 'archived-chat') {
  568. showArchivedChats.set(true);
  569. }
  570. }}
  571. >
  572. <button
  573. class=" flex rounded-xl py-3 px-3.5 w-full hover:bg-gray-100 dark:hover:bg-gray-900 transition"
  574. on:click={() => {
  575. showDropdown = !showDropdown;
  576. }}
  577. >
  578. <div class=" self-center mr-3">
  579. <img
  580. src={$user.profile_image_url}
  581. class=" max-w-[30px] object-cover rounded-full"
  582. alt="User profile"
  583. />
  584. </div>
  585. <div class=" self-center font-medium">{$user.name}</div>
  586. </button>
  587. </UserMenu>
  588. {/if}
  589. </div>
  590. </div>
  591. </div>
  592. </div>
  593. <style>
  594. .scrollbar-hidden:active::-webkit-scrollbar-thumb,
  595. .scrollbar-hidden:focus::-webkit-scrollbar-thumb,
  596. .scrollbar-hidden:hover::-webkit-scrollbar-thumb {
  597. visibility: visible;
  598. }
  599. .scrollbar-hidden::-webkit-scrollbar-thumb {
  600. visibility: hidden;
  601. }
  602. </style>