| 
									
										
										
										
											2023-10-21 02:40:09 +08:00
										 |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	import { getContext, tick } from 'svelte'; | 
					
						
							| 
									
										
										
										
											2024-03-01 17:18:07 +08:00
										 |  |  | 	import { toast } from 'svelte-sonner'; | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 	import { config, models, settings, user } from '$lib/stores'; | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	import { updateUserSettings } from '$lib/apis/users'; | 
					
						
							| 
									
										
										
										
											2024-05-24 17:17:48 +08:00
										 |  |  | 	import { getModels as _getModels } from '$lib/apis'; | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	import { goto } from '$app/navigation'; | 
					
						
							| 
									
										
										
										
											2023-12-27 14:10:22 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	import Modal from '../common/Modal.svelte'; | 
					
						
							| 
									
										
										
										
											2024-01-27 13:22:25 +08:00
										 |  |  | 	import Account from './Settings/Account.svelte'; | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 	import About from './Settings/About.svelte'; | 
					
						
							|  |  |  | 	import General from './Settings/General.svelte'; | 
					
						
							|  |  |  | 	import Interface from './Settings/Interface.svelte'; | 
					
						
							| 
									
										
										
										
											2024-02-11 18:21:06 +08:00
										 |  |  | 	import Audio from './Settings/Audio.svelte'; | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 	import Chats from './Settings/Chats.svelte'; | 
					
						
							| 
									
										
										
										
											2024-05-17 08:25:48 +08:00
										 |  |  | 	import User from '../icons/User.svelte'; | 
					
						
							|  |  |  | 	import Personalization from './Settings/Personalization.svelte'; | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | 	import Search from '../icons/Search.svelte'; | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 	import Connections from './Settings/Connections.svelte'; | 
					
						
							| 
									
										
										
										
											2025-03-27 16:38:35 +08:00
										 |  |  | 	import Tools from './Settings/Tools.svelte'; | 
					
						
							| 
									
										
										
										
											2023-10-23 07:40:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-03 04:38:51 +08:00
										 |  |  | 	const i18n = getContext('i18n'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | 	export let show = false; | 
					
						
							| 
									
										
										
										
											2023-11-20 09:47:07 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 	interface SettingsTab { | 
					
						
							|  |  |  | 		id: string; | 
					
						
							|  |  |  | 		title: string; | 
					
						
							|  |  |  | 		keywords: string[]; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const searchData: SettingsTab[] = [ | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'general', | 
					
						
							|  |  |  | 			title: 'General', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'advancedparams', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'advancedparameters', | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'advanced params', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'advanced parameters', | 
					
						
							|  |  |  | 				'configuration', | 
					
						
							|  |  |  | 				'defaultparameters', | 
					
						
							|  |  |  | 				'default parameters', | 
					
						
							|  |  |  | 				'defaultsettings', | 
					
						
							|  |  |  | 				'default settings', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'general', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'keepalive', | 
					
						
							|  |  |  | 				'keep alive', | 
					
						
							|  |  |  | 				'languages', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'notifications', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'requestmode', | 
					
						
							|  |  |  | 				'request mode', | 
					
						
							|  |  |  | 				'systemparameters', | 
					
						
							|  |  |  | 				'system parameters', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'systemprompt', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'system prompt', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'systemsettings', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'system settings', | 
					
						
							|  |  |  | 				'theme', | 
					
						
							|  |  |  | 				'translate', | 
					
						
							|  |  |  | 				'webuisettings', | 
					
						
							|  |  |  | 				'webui settings' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'interface', | 
					
						
							|  |  |  | 			title: 'Interface', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'allow user location', | 
					
						
							|  |  |  | 				'allow voice interruption in call', | 
					
						
							|  |  |  | 				'allowuserlocation', | 
					
						
							|  |  |  | 				'allowvoiceinterruptionincall', | 
					
						
							|  |  |  | 				'always collapse codeblocks', | 
					
						
							|  |  |  | 				'always collapse code blocks', | 
					
						
							|  |  |  | 				'always expand details', | 
					
						
							|  |  |  | 				'always on web search', | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'always play notification sound', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'alwayscollapsecodeblocks', | 
					
						
							|  |  |  | 				'alwaysexpanddetails', | 
					
						
							|  |  |  | 				'alwaysonwebsearch', | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'alwaysplaynotificationsound', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'android', | 
					
						
							|  |  |  | 				'auto chat tags', | 
					
						
							|  |  |  | 				'auto copy response to clipboard', | 
					
						
							|  |  |  | 				'auto title', | 
					
						
							|  |  |  | 				'autochattags', | 
					
						
							|  |  |  | 				'autocopyresponsetoclipboard', | 
					
						
							|  |  |  | 				'autotitle', | 
					
						
							|  |  |  | 				'beta', | 
					
						
							|  |  |  | 				'call', | 
					
						
							|  |  |  | 				'chat background image', | 
					
						
							|  |  |  | 				'chat bubble ui', | 
					
						
							|  |  |  | 				'chat direction', | 
					
						
							|  |  |  | 				'chat tags autogen', | 
					
						
							|  |  |  | 				'chat tags autogeneration', | 
					
						
							|  |  |  | 				'chat ui', | 
					
						
							|  |  |  | 				'chatbackgroundimage', | 
					
						
							|  |  |  | 				'chatbubbleui', | 
					
						
							|  |  |  | 				'chatdirection', | 
					
						
							|  |  |  | 				'chat tags autogeneration', | 
					
						
							|  |  |  | 				'chattagsautogeneration', | 
					
						
							|  |  |  | 				'chatui', | 
					
						
							|  |  |  | 				'copy formatted text', | 
					
						
							|  |  |  | 				'copyformattedtext', | 
					
						
							|  |  |  | 				'default model', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'defaultmodel', | 
					
						
							|  |  |  | 				'design', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'detect artifacts automatically', | 
					
						
							|  |  |  | 				'detectartifactsautomatically', | 
					
						
							|  |  |  | 				'display emoji in call', | 
					
						
							|  |  |  | 				'display username', | 
					
						
							|  |  |  | 				'displayemojiincall', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'displayusername', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'enter key behavior', | 
					
						
							|  |  |  | 				'enterkeybehavior', | 
					
						
							|  |  |  | 				'expand mode', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'expandmode', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'file', | 
					
						
							|  |  |  | 				'followup autogeneration', | 
					
						
							|  |  |  | 				'followupautogeneration', | 
					
						
							|  |  |  | 				'fullscreen', | 
					
						
							|  |  |  | 				'fullwidthmode', | 
					
						
							|  |  |  | 				'full width mode', | 
					
						
							|  |  |  | 				'haptic feedback', | 
					
						
							|  |  |  | 				'hapticfeedback', | 
					
						
							|  |  |  | 				'high contrast mode', | 
					
						
							|  |  |  | 				'highcontrastmode', | 
					
						
							|  |  |  | 				'iframe sandbox allow forms', | 
					
						
							|  |  |  | 				'iframe sandbox allow same origin', | 
					
						
							|  |  |  | 				'iframesandboxallowforms', | 
					
						
							|  |  |  | 				'iframesandboxallowsameorigin', | 
					
						
							|  |  |  | 				'imagecompression', | 
					
						
							|  |  |  | 				'image compression', | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'imagemaxcompressionsize', | 
					
						
							|  |  |  | 				'image max compression size', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'interface customization', | 
					
						
							|  |  |  | 				'interface options', | 
					
						
							|  |  |  | 				'interfacecustomization', | 
					
						
							|  |  |  | 				'interfaceoptions', | 
					
						
							|  |  |  | 				'landing page mode', | 
					
						
							|  |  |  | 				'landingpagemode', | 
					
						
							|  |  |  | 				'layout', | 
					
						
							|  |  |  | 				'left to right', | 
					
						
							|  |  |  | 				'left-to-right', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'lefttoright', | 
					
						
							|  |  |  | 				'ltr', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'paste large text as file', | 
					
						
							|  |  |  | 				'pastelargetextasfile', | 
					
						
							|  |  |  | 				'reset background', | 
					
						
							|  |  |  | 				'resetbackground', | 
					
						
							|  |  |  | 				'response auto copy', | 
					
						
							|  |  |  | 				'responseautocopy', | 
					
						
							|  |  |  | 				'rich text input for chat', | 
					
						
							|  |  |  | 				'richtextinputforchat', | 
					
						
							|  |  |  | 				'right to left', | 
					
						
							|  |  |  | 				'right-to-left', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'righttoleft', | 
					
						
							|  |  |  | 				'rtl', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'scroll behavior', | 
					
						
							|  |  |  | 				'scroll on branch change', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'scrollbehavior', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'scrollonbranchchange', | 
					
						
							|  |  |  | 				'select model', | 
					
						
							|  |  |  | 				'selectmodel', | 
					
						
							|  |  |  | 				'settings', | 
					
						
							|  |  |  | 				'show username', | 
					
						
							|  |  |  | 				'showusername', | 
					
						
							|  |  |  | 				'stream large chunks', | 
					
						
							|  |  |  | 				'streamlargechunks', | 
					
						
							|  |  |  | 				'stylized pdf export', | 
					
						
							|  |  |  | 				'stylizedpdfexport', | 
					
						
							|  |  |  | 				'title autogeneration', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'titleautogeneration', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'toast notifications for new updates', | 
					
						
							|  |  |  | 				'toastnotificationsfornewupdates', | 
					
						
							|  |  |  | 				'upload background', | 
					
						
							|  |  |  | 				'uploadbackground', | 
					
						
							|  |  |  | 				'user interface', | 
					
						
							|  |  |  | 				'user location access', | 
					
						
							|  |  |  | 				'userinterface', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'userlocationaccess', | 
					
						
							|  |  |  | 				'vibration', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'voice control', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'voicecontrol', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'widescreen mode', | 
					
						
							|  |  |  | 				'widescreenmode', | 
					
						
							|  |  |  | 				'whatsnew', | 
					
						
							|  |  |  | 				'whats new', | 
					
						
							|  |  |  | 				'websearchinchat', | 
					
						
							|  |  |  | 				'web search in chat' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							| 
									
										
										
										
											2025-05-07 06:41:33 +08:00
										 |  |  | 		...($user?.role === 'admin' || | 
					
						
							|  |  |  | 		($user?.role === 'user' && $config?.features?.enable_direct_connections) | 
					
						
							|  |  |  | 			? [ | 
					
						
							|  |  |  | 					{ | 
					
						
							|  |  |  | 						id: 'connections', | 
					
						
							|  |  |  | 						title: 'Connections', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 						keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 							'addconnection', | 
					
						
							|  |  |  | 							'add connection', | 
					
						
							|  |  |  | 							'manageconnections', | 
					
						
							|  |  |  | 							'manage connections', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 							'manage direct connections', | 
					
						
							|  |  |  | 							'managedirectconnections', | 
					
						
							|  |  |  | 							'settings' | 
					
						
							|  |  |  | 						] | 
					
						
							| 
									
										
										
										
											2025-05-07 06:41:33 +08:00
										 |  |  | 					} | 
					
						
							|  |  |  | 				] | 
					
						
							|  |  |  | 			: []), | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		...($user?.role === 'admin' || | 
					
						
							|  |  |  | 		($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers) | 
					
						
							|  |  |  | 			? [ | 
					
						
							|  |  |  | 					{ | 
					
						
							|  |  |  | 						id: 'tools', | 
					
						
							|  |  |  | 						title: 'Tools', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 						keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 							'addconnection', | 
					
						
							|  |  |  | 							'add connection', | 
					
						
							|  |  |  | 							'managetools', | 
					
						
							|  |  |  | 							'manage tools', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 							'manage tool servers', | 
					
						
							|  |  |  | 							'managetoolservers', | 
					
						
							|  |  |  | 							'settings' | 
					
						
							|  |  |  | 						] | 
					
						
							| 
									
										
										
										
											2025-05-07 06:41:33 +08:00
										 |  |  | 					} | 
					
						
							|  |  |  | 				] | 
					
						
							|  |  |  | 			: []), | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'personalization', | 
					
						
							|  |  |  | 			title: 'Personalization', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'account preferences', | 
					
						
							|  |  |  | 				'account settings', | 
					
						
							|  |  |  | 				'accountpreferences', | 
					
						
							|  |  |  | 				'accountsettings', | 
					
						
							|  |  |  | 				'custom settings', | 
					
						
							|  |  |  | 				'customsettings', | 
					
						
							|  |  |  | 				'experimental', | 
					
						
							|  |  |  | 				'memories', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'memory', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'personalization', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'personalize', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'personal settings', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'personalsettings', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'profile', | 
					
						
							|  |  |  | 				'user preferences', | 
					
						
							|  |  |  | 				'userpreferences' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'audio', | 
					
						
							|  |  |  | 			title: 'Audio', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'audio config', | 
					
						
							|  |  |  | 				'audio control', | 
					
						
							|  |  |  | 				'audio features', | 
					
						
							|  |  |  | 				'audio input', | 
					
						
							|  |  |  | 				'audio output', | 
					
						
							|  |  |  | 				'audio playback', | 
					
						
							|  |  |  | 				'audio voice', | 
					
						
							|  |  |  | 				'audioconfig', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'audiocontrol', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'audiofeatures', | 
					
						
							|  |  |  | 				'audioinput', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'audiooutput', | 
					
						
							|  |  |  | 				'audioplayback', | 
					
						
							|  |  |  | 				'audiovoice', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'auto playback response', | 
					
						
							|  |  |  | 				'autoplaybackresponse', | 
					
						
							|  |  |  | 				'auto transcribe', | 
					
						
							|  |  |  | 				'autotranscribe', | 
					
						
							|  |  |  | 				'instant auto send after voice transcription', | 
					
						
							|  |  |  | 				'instantautosendaftervoicetranscription', | 
					
						
							|  |  |  | 				'language', | 
					
						
							|  |  |  | 				'non local voices', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'nonlocalvoices', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'save settings', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'savesettings', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'set voice', | 
					
						
							|  |  |  | 				'setvoice', | 
					
						
							|  |  |  | 				'sound settings', | 
					
						
							|  |  |  | 				'soundsettings', | 
					
						
							|  |  |  | 				'speech config', | 
					
						
							|  |  |  | 				'speech mode', | 
					
						
							|  |  |  | 				'speech playback speed', | 
					
						
							|  |  |  | 				'speech rate', | 
					
						
							|  |  |  | 				'speech recognition', | 
					
						
							|  |  |  | 				'speech settings', | 
					
						
							|  |  |  | 				'speech speed', | 
					
						
							|  |  |  | 				'speech synthesis', | 
					
						
							|  |  |  | 				'speech to text engine', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'speechconfig', | 
					
						
							|  |  |  | 				'speechmode', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'speechplaybackspeed', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'speechrate', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'speechrecognition', | 
					
						
							|  |  |  | 				'speechsettings', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'speechspeed', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'speechsynthesis', | 
					
						
							|  |  |  | 				'speechtotextengine', | 
					
						
							|  |  |  | 				'speedch playback rate', | 
					
						
							|  |  |  | 				'speedchplaybackrate', | 
					
						
							|  |  |  | 				'stt settings', | 
					
						
							|  |  |  | 				'sttsettings', | 
					
						
							|  |  |  | 				'text to speech engine', | 
					
						
							|  |  |  | 				'text to speech', | 
					
						
							|  |  |  | 				'textospeechengine', | 
					
						
							|  |  |  | 				'texttospeech', | 
					
						
							| 
									
										
										
										
											2025-06-05 23:42:05 +08:00
										 |  |  | 				'texttospeechvoice', | 
					
						
							|  |  |  | 				'text to speech voice', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'voice control', | 
					
						
							|  |  |  | 				'voice modes', | 
					
						
							|  |  |  | 				'voice options', | 
					
						
							|  |  |  | 				'voice playback', | 
					
						
							|  |  |  | 				'voice recognition', | 
					
						
							|  |  |  | 				'voice speed', | 
					
						
							|  |  |  | 				'voicecontrol', | 
					
						
							|  |  |  | 				'voicemodes', | 
					
						
							|  |  |  | 				'voiceoptions', | 
					
						
							|  |  |  | 				'voiceplayback', | 
					
						
							|  |  |  | 				'voicerecognition', | 
					
						
							|  |  |  | 				'voicespeed', | 
					
						
							|  |  |  | 				'volume' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'chats', | 
					
						
							|  |  |  | 			title: 'Chats', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'archive all chats', | 
					
						
							|  |  |  | 				'archive chats', | 
					
						
							|  |  |  | 				'archiveallchats', | 
					
						
							|  |  |  | 				'archivechats', | 
					
						
							|  |  |  | 				'archived chats', | 
					
						
							|  |  |  | 				'archivedchats', | 
					
						
							|  |  |  | 				'chat activity', | 
					
						
							|  |  |  | 				'chat history', | 
					
						
							|  |  |  | 				'chat settings', | 
					
						
							|  |  |  | 				'chatactivity', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'chathistory', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'chatsettings', | 
					
						
							|  |  |  | 				'conversation activity', | 
					
						
							|  |  |  | 				'conversation history', | 
					
						
							|  |  |  | 				'conversationactivity', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'conversationhistory', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'conversations', | 
					
						
							|  |  |  | 				'convos', | 
					
						
							|  |  |  | 				'delete all chats', | 
					
						
							|  |  |  | 				'delete chats', | 
					
						
							|  |  |  | 				'deleteallchats', | 
					
						
							|  |  |  | 				'deletechats', | 
					
						
							|  |  |  | 				'export chats', | 
					
						
							|  |  |  | 				'exportchats', | 
					
						
							|  |  |  | 				'import chats', | 
					
						
							|  |  |  | 				'importchats', | 
					
						
							|  |  |  | 				'message activity', | 
					
						
							|  |  |  | 				'message archive', | 
					
						
							|  |  |  | 				'message history', | 
					
						
							|  |  |  | 				'messagearchive', | 
					
						
							|  |  |  | 				'messagehistory' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							|  |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'account', | 
					
						
							|  |  |  | 			title: 'Account', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'account preferences', | 
					
						
							|  |  |  | 				'account settings', | 
					
						
							|  |  |  | 				'accountpreferences', | 
					
						
							|  |  |  | 				'accountsettings', | 
					
						
							|  |  |  | 				'api keys', | 
					
						
							|  |  |  | 				'apikeys', | 
					
						
							|  |  |  | 				'change password', | 
					
						
							|  |  |  | 				'changepassword', | 
					
						
							|  |  |  | 				'jwt token', | 
					
						
							|  |  |  | 				'jwttoken', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'login', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'new password', | 
					
						
							|  |  |  | 				'newpassword', | 
					
						
							|  |  |  | 				'notification webhook url', | 
					
						
							|  |  |  | 				'notificationwebhookurl', | 
					
						
							|  |  |  | 				'personal settings', | 
					
						
							|  |  |  | 				'personalsettings', | 
					
						
							|  |  |  | 				'privacy settings', | 
					
						
							|  |  |  | 				'privacysettings', | 
					
						
							|  |  |  | 				'profileavatar', | 
					
						
							|  |  |  | 				'profile avatar', | 
					
						
							|  |  |  | 				'profile details', | 
					
						
							|  |  |  | 				'profile image', | 
					
						
							|  |  |  | 				'profile picture', | 
					
						
							|  |  |  | 				'profiledetails', | 
					
						
							|  |  |  | 				'profileimage', | 
					
						
							|  |  |  | 				'profilepicture', | 
					
						
							|  |  |  | 				'security settings', | 
					
						
							|  |  |  | 				'securitysettings', | 
					
						
							|  |  |  | 				'update account', | 
					
						
							|  |  |  | 				'update password', | 
					
						
							|  |  |  | 				'updateaccount', | 
					
						
							|  |  |  | 				'updatepassword', | 
					
						
							|  |  |  | 				'user account', | 
					
						
							|  |  |  | 				'user data', | 
					
						
							|  |  |  | 				'user preferences', | 
					
						
							|  |  |  | 				'user profile', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'useraccount', | 
					
						
							|  |  |  | 				'userdata', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'username', | 
					
						
							|  |  |  | 				'userpreferences', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'userprofile', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'webhook url', | 
					
						
							|  |  |  | 				'webhookurl' | 
					
						
							| 
									
										
										
										
											2024-11-11 10:44:52 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		}, | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 		{ | 
					
						
							|  |  |  | 			id: 'about', | 
					
						
							|  |  |  | 			title: 'About', | 
					
						
							|  |  |  | 			keywords: [ | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'about app', | 
					
						
							|  |  |  | 				'about me', | 
					
						
							|  |  |  | 				'about open webui', | 
					
						
							|  |  |  | 				'about page', | 
					
						
							|  |  |  | 				'about us', | 
					
						
							|  |  |  | 				'aboutapp', | 
					
						
							|  |  |  | 				'aboutme', | 
					
						
							|  |  |  | 				'aboutopenwebui', | 
					
						
							|  |  |  | 				'aboutpage', | 
					
						
							|  |  |  | 				'aboutus', | 
					
						
							|  |  |  | 				'check for updates', | 
					
						
							|  |  |  | 				'checkforupdates', | 
					
						
							|  |  |  | 				'contact', | 
					
						
							|  |  |  | 				'copyright', | 
					
						
							|  |  |  | 				'details', | 
					
						
							|  |  |  | 				'discord', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'documentation', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'github', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'help', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'information', | 
					
						
							|  |  |  | 				'license', | 
					
						
							|  |  |  | 				'redistributions', | 
					
						
							|  |  |  | 				'release', | 
					
						
							|  |  |  | 				'see whats new', | 
					
						
							|  |  |  | 				'seewhatsnew', | 
					
						
							|  |  |  | 				'settings', | 
					
						
							|  |  |  | 				'software info', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'softwareinfo', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'support', | 
					
						
							|  |  |  | 				'terms and conditions', | 
					
						
							|  |  |  | 				'terms of use', | 
					
						
							|  |  |  | 				'termsandconditions', | 
					
						
							|  |  |  | 				'termsofuse', | 
					
						
							|  |  |  | 				'timothy jae ryang baek', | 
					
						
							|  |  |  | 				'timothy j baek', | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 				'timothyjaeryangbaek', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'timothyjbaek', | 
					
						
							|  |  |  | 				'twitter', | 
					
						
							|  |  |  | 				'update info', | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 				'updateinfo', | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				'version info', | 
					
						
							|  |  |  | 				'versioninfo' | 
					
						
							| 
									
										
										
										
											2024-11-06 11:16:22 +08:00
										 |  |  | 			] | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 	]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	let search = ''; | 
					
						
							|  |  |  | 	let visibleTabs = searchData.map((tab) => tab.id); | 
					
						
							|  |  |  | 	let searchDebounceTimeout; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const searchSettings = (query: string): string[] => { | 
					
						
							|  |  |  | 		const lowerCaseQuery = query.toLowerCase().trim(); | 
					
						
							|  |  |  | 		return searchData | 
					
						
							|  |  |  | 			.filter( | 
					
						
							|  |  |  | 				(tab) => | 
					
						
							|  |  |  | 					tab.title.toLowerCase().includes(lowerCaseQuery) || | 
					
						
							|  |  |  | 					tab.keywords.some((keyword) => keyword.includes(lowerCaseQuery)) | 
					
						
							|  |  |  | 			) | 
					
						
							|  |  |  | 			.map((tab) => tab.id); | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const searchDebounceHandler = () => { | 
					
						
							|  |  |  | 		clearTimeout(searchDebounceTimeout); | 
					
						
							|  |  |  | 		searchDebounceTimeout = setTimeout(() => { | 
					
						
							|  |  |  | 			visibleTabs = searchSettings(search); | 
					
						
							|  |  |  | 			if (visibleTabs.length > 0 && !visibleTabs.includes(selectedTab)) { | 
					
						
							|  |  |  | 				selectedTab = visibleTabs[0]; | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2024-11-06 11:59:34 +08:00
										 |  |  | 		}, 100); | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-20 09:47:07 +08:00
										 |  |  | 	const saveSettings = async (updated) => { | 
					
						
							|  |  |  | 		console.log(updated); | 
					
						
							|  |  |  | 		await settings.set({ ...$settings, ...updated }); | 
					
						
							| 
									
										
										
										
											2024-05-24 17:17:48 +08:00
										 |  |  | 		await models.set(await getModels()); | 
					
						
							| 
									
										
										
										
											2024-05-27 13:47:42 +08:00
										 |  |  | 		await updateUserSettings(localStorage.token, { ui: $settings }); | 
					
						
							| 
									
										
										
										
											2023-11-20 09:47:07 +08:00
										 |  |  | 	}; | 
					
						
							| 
									
										
										
										
											2023-10-23 07:40:17 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-05-24 17:17:48 +08:00
										 |  |  | 	const getModels = async () => { | 
					
						
							| 
									
										
										
										
											2025-02-12 17:22:53 +08:00
										 |  |  | 		return await _getModels( | 
					
						
							|  |  |  | 			localStorage.token, | 
					
						
							| 
									
										
										
										
											2025-02-12 17:32:49 +08:00
										 |  |  | 			$config?.features?.enable_direct_connections && ($settings?.directConnections ?? null) | 
					
						
							| 
									
										
										
										
											2025-02-12 17:22:53 +08:00
										 |  |  | 		); | 
					
						
							| 
									
										
										
										
											2024-04-21 09:49:16 +08:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-04 08:16:02 +08:00
										 |  |  | 	let selectedTab = 'general'; | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// Function to handle sideways scrolling | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	const scrollHandler = (event) => { | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 		const settingsTabsContainer = document.getElementById('settings-tabs-container'); | 
					
						
							|  |  |  | 		if (settingsTabsContainer) { | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 			event.preventDefault(); // Prevent default vertical scrolling | 
					
						
							|  |  |  | 			settingsTabsContainer.scrollLeft += event.deltaY; // Scroll sideways | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 		} | 
					
						
							|  |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	const addScrollListener = async () => { | 
					
						
							|  |  |  | 		await tick(); | 
					
						
							|  |  |  | 		const settingsTabsContainer = document.getElementById('settings-tabs-container'); | 
					
						
							|  |  |  | 		if (settingsTabsContainer) { | 
					
						
							|  |  |  | 			settingsTabsContainer.addEventListener('wheel', scrollHandler); | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const removeScrollListener = async () => { | 
					
						
							|  |  |  | 		await tick(); | 
					
						
							|  |  |  | 		const settingsTabsContainer = document.getElementById('settings-tabs-container'); | 
					
						
							|  |  |  | 		if (settingsTabsContainer) { | 
					
						
							|  |  |  | 			settingsTabsContainer.removeEventListener('wheel', scrollHandler); | 
					
						
							|  |  |  | 		} | 
					
						
							|  |  |  | 	}; | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-07-06 12:27:59 +08:00
										 |  |  | 	$: if (show) { | 
					
						
							|  |  |  | 		addScrollListener(); | 
					
						
							|  |  |  | 	} else { | 
					
						
							|  |  |  | 		removeScrollListener(); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | </script> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | <Modal size="xl" bind:show> | 
					
						
							| 
									
										
										
										
											2024-05-02 14:11:16 +08:00
										 |  |  | 	<div class="text-gray-700 dark:text-gray-100"> | 
					
						
							| 
									
										
										
										
											2024-05-02 08:55:18 +08:00
										 |  |  | 		<div class=" flex justify-between dark:text-gray-300 px-5 pt-4 pb-1"> | 
					
						
							| 
									
										
										
										
											2024-03-03 04:38:51 +08:00
										 |  |  | 			<div class=" text-lg font-medium self-center">{$i18n.t('Settings')}</div> | 
					
						
							| 
									
										
										
										
											2023-10-21 02:40:09 +08:00
										 |  |  | 			<button | 
					
						
							| 
									
										
										
										
											2025-06-10 19:52:24 +08:00
										 |  |  | 				aria-label={$i18n.t('Close settings modal')} | 
					
						
							| 
									
										
										
										
											2023-10-21 02:40:09 +08:00
										 |  |  | 				class="self-center" | 
					
						
							|  |  |  | 				on:click={() => { | 
					
						
							|  |  |  | 					show = false; | 
					
						
							|  |  |  | 				}} | 
					
						
							|  |  |  | 			> | 
					
						
							|  |  |  | 				<svg | 
					
						
							|  |  |  | 					xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 					viewBox="0 0 20 20" | 
					
						
							|  |  |  | 					fill="currentColor" | 
					
						
							|  |  |  | 					class="w-5 h-5" | 
					
						
							|  |  |  | 				> | 
					
						
							|  |  |  | 					<path | 
					
						
							|  |  |  | 						d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" | 
					
						
							|  |  |  | 					/> | 
					
						
							|  |  |  | 				</svg> | 
					
						
							|  |  |  | 			</button> | 
					
						
							|  |  |  | 		</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | 		<div class="flex flex-col md:flex-row w-full px-4 pt-1 pb-4 md:space-x-4"> | 
					
						
							| 
									
										
										
										
											2023-10-23 06:37:06 +08:00
										 |  |  | 			<div | 
					
						
							| 
									
										
										
										
											2024-07-05 09:05:59 +08:00
										 |  |  | 				id="settings-tabs-container" | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				class="tabs flex flex-row overflow-x-auto gap-2.5 md:gap-1 md:flex-col flex-1 md:flex-none md:w-40 md:min-h-[32rem] md:max-h-[32rem] dark:text-gray-200 text-sm font-medium text-left mb-1 md:mb-0 -translate-y-1" | 
					
						
							| 
									
										
										
										
											2023-10-23 06:37:06 +08:00
										 |  |  | 			> | 
					
						
							| 
									
										
										
										
											2024-11-13 14:00:37 +08:00
										 |  |  | 				<div class="hidden md:flex w-full rounded-xl -mb-1 px-0.5 gap-2" id="settings-search"> | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | 					<div class="self-center rounded-l-xl bg-transparent"> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:25:40 +08:00
										 |  |  | 						<Search | 
					
						
							|  |  |  | 							className="size-3.5" | 
					
						
							| 
									
										
										
										
											2025-06-10 17:40:36 +08:00
										 |  |  | 							strokeWidth={($settings?.highContrastMode ?? false) ? '3' : '1.5'} | 
					
						
							| 
									
										
										
										
											2025-06-10 16:25:40 +08:00
										 |  |  | 						/> | 
					
						
							| 
									
										
										
										
											2023-10-23 06:37:06 +08:00
										 |  |  | 					</div> | 
					
						
							| 
									
										
										
										
											2025-06-10 16:27:06 +08:00
										 |  |  | 					<label class="sr-only" for="search-input-settings-modal">{$i18n.t('Search')}</label> | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 					<input | 
					
						
							| 
									
										
										
										
											2025-06-10 16:25:40 +08:00
										 |  |  | 						class={`w-full py-1.5 text-sm bg-transparent dark:text-gray-300 outline-hidden
 | 
					
						
							| 
									
										
										
										
											2025-06-10 17:40:36 +08:00
										 |  |  | 								${($settings?.highContrastMode ?? false) ? 'placeholder-gray-800' : ''}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 						bind:value={search} | 
					
						
							| 
									
										
										
										
											2025-06-10 16:27:06 +08:00
										 |  |  | 						id="search-input-settings-modal" | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | 						on:input={searchDebounceHandler} | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 						placeholder={$i18n.t('Search')} | 
					
						
							|  |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2024-11-06 13:05:14 +08:00
										 |  |  | 				</div> | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 				{#if visibleTabs.length > 0} | 
					
						
							|  |  |  | 					{#each visibleTabs as tabId (tabId)} | 
					
						
							|  |  |  | 						{#if tabId === 'general'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'general' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'general'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 										viewBox="0 0 20 20" | 
					
						
							|  |  |  | 										fill="currentColor" | 
					
						
							|  |  |  | 										class="w-4 h-4" | 
					
						
							|  |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											fill-rule="evenodd" | 
					
						
							|  |  |  | 											d="M8.34 1.804A1 1 0 019.32 1h1.36a1 1 0 01.98.804l.295 1.473c.497.144.971.342 1.416.587l1.25-.834a1 1 0 011.262.125l.962.962a1 1 0 01.125 1.262l-.834 1.25c.245.445.443.919.587 1.416l1.473.294a1 1 0 01.804.98v1.361a1 1 0 01-.804.98l-1.473.295a6.95 6.95 0 01-.587 1.416l.834 1.25a1 1 0 01-.125 1.262l-.962.962a1 1 0 01-1.262.125l-1.25-.834a6.953 6.953 0 01-1.416.587l-.294 1.473a1 1 0 01-.98.804H9.32a1 1 0 01-.98-.804l-.295-1.473a6.957 6.957 0 01-1.416-.587l-1.25.834a1 1 0 01-1.262-.125l-.962-.962a1 1 0 01-.125-1.262l.834-1.25a6.957 6.957 0 01-.587-1.416l-1.473-.294A1 1 0 011 10.68V9.32a1 1 0 01.804-.98l1.473-.295c.144-.497.342-.971.587-1.416l-.834-1.25a1 1 0 01.125-1.262l.962-.962A1 1 0 015.38 3.03l1.25.834a6.957 6.957 0 011.416-.587l.294-1.473zM13 10a3 3 0 11-6 0 3 3 0 016 0z" | 
					
						
							|  |  |  | 											clip-rule="evenodd" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('General')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							|  |  |  | 						{:else if tabId === 'interface'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'interface' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'interface'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 										viewBox="0 0 16 16" | 
					
						
							|  |  |  | 										fill="currentColor" | 
					
						
							|  |  |  | 										class="w-4 h-4" | 
					
						
							|  |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											fill-rule="evenodd" | 
					
						
							|  |  |  | 											d="M2 4.25A2.25 2.25 0 0 1 4.25 2h7.5A2.25 2.25 0 0 1 14 4.25v5.5A2.25 2.25 0 0 1 11.75 12h-1.312c.1.128.21.248.328.36a.75.75 0 0 1 .234.545v.345a.75.75 0 0 1-.75.75h-4.5a.75.75 0 0 1-.75-.75v-.345a.75.75 0 0 1 .234-.545c.118-.111.228-.232.328-.36H4.25A2.25 2.25 0 0 1 2 9.75v-5.5Zm2.25-.75a.75.75 0 0 0-.75.75v4.5c0 .414.336.75.75.75h7.5a.75.75 0 0 0 .75-.75v-4.5a.75.75 0 0 0-.75-.75h-7.5Z" | 
					
						
							|  |  |  | 											clip-rule="evenodd" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('Interface')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 						{:else if tabId === 'connections'} | 
					
						
							| 
									
										
										
										
											2025-04-01 11:32:12 +08:00
										 |  |  | 							{#if $user?.role === 'admin' || ($user?.role === 'user' && $config?.features?.enable_direct_connections)} | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 								<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'connections' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 									on:click={() => { | 
					
						
							|  |  |  | 										selectedTab = 'connections'; | 
					
						
							|  |  |  | 									}} | 
					
						
							|  |  |  | 								> | 
					
						
							|  |  |  | 									<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 										<svg | 
					
						
							|  |  |  | 											xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 											viewBox="0 0 16 16" | 
					
						
							|  |  |  | 											fill="currentColor" | 
					
						
							|  |  |  | 											class="w-4 h-4" | 
					
						
							|  |  |  | 										> | 
					
						
							|  |  |  | 											<path | 
					
						
							|  |  |  | 												d="M1 9.5A3.5 3.5 0 0 0 4.5 13H12a3 3 0 0 0 .917-5.857 2.503 2.503 0 0 0-3.198-3.019 3.5 3.5 0 0 0-6.628 2.171A3.5 3.5 0 0 0 1 9.5Z" | 
					
						
							|  |  |  | 											/> | 
					
						
							|  |  |  | 										</svg> | 
					
						
							|  |  |  | 									</div> | 
					
						
							|  |  |  | 									<div class=" self-center">{$i18n.t('Connections')}</div> | 
					
						
							|  |  |  | 								</button> | 
					
						
							|  |  |  | 							{/if} | 
					
						
							| 
									
										
										
										
											2025-03-27 16:38:35 +08:00
										 |  |  | 						{:else if tabId === 'tools'} | 
					
						
							| 
									
										
										
										
											2025-04-03 09:36:03 +08:00
										 |  |  | 							{#if $user?.role === 'admin' || ($user?.role === 'user' && $user?.permissions?.features?.direct_tool_servers)} | 
					
						
							| 
									
										
										
										
											2025-03-27 16:38:35 +08:00
										 |  |  | 								<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 									class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'tools' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2025-03-27 16:38:35 +08:00
										 |  |  | 									on:click={() => { | 
					
						
							|  |  |  | 										selectedTab = 'tools'; | 
					
						
							|  |  |  | 									}} | 
					
						
							|  |  |  | 								> | 
					
						
							|  |  |  | 									<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 										<svg | 
					
						
							|  |  |  | 											xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 											viewBox="0 0 24 24" | 
					
						
							|  |  |  | 											fill="currentColor" | 
					
						
							|  |  |  | 											class="size-4" | 
					
						
							|  |  |  | 										> | 
					
						
							|  |  |  | 											<path | 
					
						
							|  |  |  | 												fill-rule="evenodd" | 
					
						
							|  |  |  | 												d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z" | 
					
						
							|  |  |  | 												clip-rule="evenodd" | 
					
						
							|  |  |  | 											/> | 
					
						
							|  |  |  | 										</svg> | 
					
						
							|  |  |  | 									</div> | 
					
						
							|  |  |  | 									<div class=" self-center">{$i18n.t('Tools')}</div> | 
					
						
							|  |  |  | 								</button> | 
					
						
							|  |  |  | 							{/if} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 						{:else if tabId === 'personalization'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'personalization' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'personalization'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<User /> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('Personalization')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							|  |  |  | 						{:else if tabId === 'audio'} | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'audio' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'audio'; | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 										viewBox="0 0 16 16" | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 										fill="currentColor" | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 										class="w-4 h-4" | 
					
						
							|  |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											d="M7.557 2.066A.75.75 0 0 1 8 2.75v10.5a.75.75 0 0 1-1.248.56L3.59 11H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h1.59l3.162-2.81a.75.75 0 0 1 .805-.124ZM12.95 3.05a.75.75 0 1 0-1.06 1.06 5.5 5.5 0 0 1 0 7.78.75.75 0 1 0 1.06 1.06 7 7 0 0 0 0-9.9Z" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											d="M10.828 5.172a.75.75 0 1 0-1.06 1.06 2.5 2.5 0 0 1 0 3.536.75.75 0 1 0 1.06 1.06 4 4 0 0 0 0-5.656Z" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('Audio')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							|  |  |  | 						{:else if tabId === 'chats'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'chats' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'chats'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 										viewBox="0 0 16 16" | 
					
						
							|  |  |  | 										fill="currentColor" | 
					
						
							|  |  |  | 										class="w-4 h-4" | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											fill-rule="evenodd" | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 											d="M8 2C4.262 2 1 4.57 1 8c0 1.86.98 3.486 2.455 4.566a3.472 3.472 0 0 1-.469 1.26.75.75 0 0 0 .713 1.14 6.961 6.961 0 0 0 3.06-1.06c.403.062.818.094 1.241.094 3.738 0 7-2.57 7-6s-3.262-6-7-6ZM5 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm7-1a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 											clip-rule="evenodd" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								<div class=" self-center">{$i18n.t('Chats')}</div> | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 							</button> | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 						{:else if tabId === 'account'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'account' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'account'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 										viewBox="0 0 16 16" | 
					
						
							|  |  |  | 										fill="currentColor" | 
					
						
							|  |  |  | 										class="w-4 h-4" | 
					
						
							|  |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											fill-rule="evenodd" | 
					
						
							|  |  |  | 											d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-5-2a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 9c-1.825 0-3.422.977-4.295 2.437A5.49 5.49 0 0 0 8 13.5a5.49 5.49 0 0 0 4.294-2.063A4.997 4.997 0 0 0 8 9Z" | 
					
						
							|  |  |  | 											clip-rule="evenodd" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('Account')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							|  |  |  | 						{:else if tabId === 'about'} | 
					
						
							|  |  |  | 							<button | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 								class={`px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none flex text-left transition
 | 
					
						
							|  |  |  | 								${ | 
					
						
							|  |  |  | 									selectedTab === 'about' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										? ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'dark:bg-gray-800 bg-gray-200' | 
					
						
							|  |  |  | 											: '' | 
					
						
							| 
									
										
										
										
											2025-06-10 17:39:41 +08:00
										 |  |  | 										: ($settings?.highContrastMode ?? false) | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 											? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 											: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white' | 
					
						
							|  |  |  | 								}`} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 								on:click={() => { | 
					
						
							|  |  |  | 									selectedTab = 'about'; | 
					
						
							|  |  |  | 								}} | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 									<svg | 
					
						
							|  |  |  | 										xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 										viewBox="0 0 20 20" | 
					
						
							|  |  |  | 										fill="currentColor" | 
					
						
							|  |  |  | 										class="w-4 h-4" | 
					
						
							|  |  |  | 									> | 
					
						
							|  |  |  | 										<path | 
					
						
							|  |  |  | 											fill-rule="evenodd" | 
					
						
							|  |  |  | 											d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" | 
					
						
							|  |  |  | 											clip-rule="evenodd" | 
					
						
							|  |  |  | 										/> | 
					
						
							|  |  |  | 									</svg> | 
					
						
							|  |  |  | 								</div> | 
					
						
							|  |  |  | 								<div class=" self-center">{$i18n.t('About')}</div> | 
					
						
							|  |  |  | 							</button> | 
					
						
							| 
									
										
										
										
											2024-11-06 10:50:58 +08:00
										 |  |  | 						{/if} | 
					
						
							| 
									
										
										
										
											2024-11-06 12:06:37 +08:00
										 |  |  | 					{/each} | 
					
						
							|  |  |  | 				{:else} | 
					
						
							|  |  |  | 					<div class="text-center text-gray-500 mt-4"> | 
					
						
							|  |  |  | 						{$i18n.t('No results found')} | 
					
						
							|  |  |  | 					</div> | 
					
						
							|  |  |  | 				{/if} | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | 				{#if $user?.role === 'admin'} | 
					
						
							| 
									
										
										
										
											2025-06-10 18:43:59 +08:00
										 |  |  | 					<a | 
					
						
							|  |  |  | 						href="/admin/settings" | 
					
						
							| 
									
										
										
										
											2025-06-10 17:55:25 +08:00
										 |  |  | 						class="px-0.5 py-1 min-w-fit rounded-lg flex-1 md:flex-none md:mt-auto flex text-left transition {$settings?.highContrastMode | 
					
						
							| 
									
										
										
										
											2025-06-06 19:39:03 +08:00
										 |  |  | 							? 'hover:bg-gray-200 dark:hover:bg-gray-800' | 
					
						
							|  |  |  | 							: 'text-gray-300 dark:text-gray-600 hover:text-gray-700 dark:hover:text-white'}" | 
					
						
							| 
									
										
										
										
											2025-06-10 18:43:59 +08:00
										 |  |  | 						on:click={async (e) => { | 
					
						
							|  |  |  | 							e.preventDefault(); | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 							await goto('/admin/settings'); | 
					
						
							|  |  |  | 							show = false; | 
					
						
							|  |  |  | 						}} | 
					
						
							|  |  |  | 					> | 
					
						
							|  |  |  | 						<div class=" self-center mr-2"> | 
					
						
							|  |  |  | 							<svg | 
					
						
							|  |  |  | 								xmlns="http://www.w3.org/2000/svg" | 
					
						
							|  |  |  | 								viewBox="0 0 24 24" | 
					
						
							|  |  |  | 								fill="currentColor" | 
					
						
							| 
									
										
										
										
											2025-06-10 18:43:59 +08:00
										 |  |  | 								aria-hidden="true" | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 								class="size-4" | 
					
						
							|  |  |  | 							> | 
					
						
							|  |  |  | 								<path | 
					
						
							|  |  |  | 									fill-rule="evenodd" | 
					
						
							|  |  |  | 									d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" | 
					
						
							|  |  |  | 									clip-rule="evenodd" | 
					
						
							|  |  |  | 								/> | 
					
						
							|  |  |  | 							</svg> | 
					
						
							|  |  |  | 						</div> | 
					
						
							|  |  |  | 						<div class=" self-center">{$i18n.t('Admin Settings')}</div> | 
					
						
							| 
									
										
										
										
											2025-06-10 18:43:59 +08:00
										 |  |  | 					</a> | 
					
						
							| 
									
										
										
										
											2025-06-05 22:48:33 +08:00
										 |  |  | 				{/if} | 
					
						
							| 
									
										
										
										
											2023-10-21 02:40:09 +08:00
										 |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2024-11-11 10:48:54 +08:00
										 |  |  | 			<div class="flex-1 md:min-h-[32rem] max-h-[32rem]"> | 
					
						
							| 
									
										
										
										
											2023-11-04 08:16:02 +08:00
										 |  |  | 				{#if selectedTab === 'general'} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					<General | 
					
						
							| 
									
										
										
										
											2024-05-24 17:17:48 +08:00
										 |  |  | 						{getModels} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 						{saveSettings} | 
					
						
							|  |  |  | 						on:save={() => { | 
					
						
							| 
									
										
										
										
											2024-03-14 21:38:05 +08:00
										 |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 						}} | 
					
						
							|  |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2024-01-23 13:53:13 +08:00
										 |  |  | 				{:else if selectedTab === 'interface'} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					<Interface | 
					
						
							| 
									
										
										
										
											2024-02-06 13:05:38 +08:00
										 |  |  | 						{saveSettings} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 						on:save={() => { | 
					
						
							| 
									
										
										
										
											2024-03-14 21:38:05 +08:00
										 |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							| 
									
										
										
										
											2024-01-23 13:53:13 +08:00
										 |  |  | 						}} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 				{:else if selectedTab === 'connections'} | 
					
						
							|  |  |  | 					<Connections | 
					
						
							| 
									
										
										
										
											2025-02-12 17:17:30 +08:00
										 |  |  | 						saveSettings={async (updated) => { | 
					
						
							|  |  |  | 							await saveSettings(updated); | 
					
						
							| 
									
										
										
										
											2025-02-12 15:12:00 +08:00
										 |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							|  |  |  | 						}} | 
					
						
							|  |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2025-03-27 16:38:35 +08:00
										 |  |  | 				{:else if selectedTab === 'tools'} | 
					
						
							|  |  |  | 					<Tools | 
					
						
							|  |  |  | 						saveSettings={async (updated) => { | 
					
						
							|  |  |  | 							await saveSettings(updated); | 
					
						
							|  |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							|  |  |  | 						}} | 
					
						
							|  |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2024-05-17 08:25:48 +08:00
										 |  |  | 				{:else if selectedTab === 'personalization'} | 
					
						
							|  |  |  | 					<Personalization | 
					
						
							|  |  |  | 						{saveSettings} | 
					
						
							|  |  |  | 						on:save={() => { | 
					
						
							|  |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							|  |  |  | 						}} | 
					
						
							|  |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2024-02-11 18:21:06 +08:00
										 |  |  | 				{:else if selectedTab === 'audio'} | 
					
						
							|  |  |  | 					<Audio | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 						{saveSettings} | 
					
						
							|  |  |  | 						on:save={() => { | 
					
						
							| 
									
										
										
										
											2024-03-14 21:38:05 +08:00
										 |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							| 
									
										
										
										
											2023-11-06 05:25:23 +08:00
										 |  |  | 						}} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2023-12-27 08:35:01 +08:00
										 |  |  | 				{:else if selectedTab === 'chats'} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					<Chats {saveSettings} /> | 
					
						
							| 
									
										
										
										
											2023-12-29 16:12:30 +08:00
										 |  |  | 				{:else if selectedTab === 'account'} | 
					
						
							| 
									
										
										
										
											2024-01-27 13:22:25 +08:00
										 |  |  | 					<Account | 
					
						
							| 
									
										
										
										
											2024-12-21 14:54:43 +08:00
										 |  |  | 						{saveSettings} | 
					
						
							| 
									
										
										
										
											2024-01-27 13:22:25 +08:00
										 |  |  | 						saveHandler={() => { | 
					
						
							| 
									
										
										
										
											2024-03-14 21:38:05 +08:00
										 |  |  | 							toast.success($i18n.t('Settings saved successfully!')); | 
					
						
							| 
									
										
										
										
											2023-12-29 16:12:30 +08:00
										 |  |  | 						}} | 
					
						
							| 
									
										
										
										
											2024-01-27 13:22:25 +08:00
										 |  |  | 					/> | 
					
						
							| 
									
										
										
										
											2023-11-06 07:41:25 +08:00
										 |  |  | 				{:else if selectedTab === 'about'} | 
					
						
							| 
									
										
										
										
											2024-02-05 17:58:54 +08:00
										 |  |  | 					<About /> | 
					
						
							| 
									
										
										
										
											2023-10-23 06:37:06 +08:00
										 |  |  | 				{/if} | 
					
						
							|  |  |  | 			</div> | 
					
						
							| 
									
										
										
										
											2023-10-21 02:40:09 +08:00
										 |  |  | 		</div> | 
					
						
							| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | 	</div> | 
					
						
							|  |  |  | </Modal> | 
					
						
							| 
									
										
										
										
											2023-11-05 11:00:17 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | <style> | 
					
						
							|  |  |  | 	input::-webkit-outer-spin-button, | 
					
						
							|  |  |  | 	input::-webkit-inner-spin-button { | 
					
						
							|  |  |  | 		/* display: none; <- Crashes Chrome on hover */ | 
					
						
							|  |  |  | 		-webkit-appearance: none; | 
					
						
							|  |  |  | 		margin: 0; /* <-- Apparently some margin are still there even though it's hidden */ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-06 04:55:44 +08:00
										 |  |  | 	.tabs::-webkit-scrollbar { | 
					
						
							|  |  |  | 		display: none; /* for Chrome, Safari and Opera */ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	.tabs { | 
					
						
							|  |  |  | 		-ms-overflow-style: none; /* IE and Edge */ | 
					
						
							|  |  |  | 		scrollbar-width: none; /* Firefox */ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-05 11:00:17 +08:00
										 |  |  | 	input[type='number'] { | 
					
						
							| 
									
										
										
										
											2025-06-06 00:02:31 +08:00
										 |  |  | 		appearance: textfield; | 
					
						
							| 
									
										
										
										
											2023-11-05 11:00:17 +08:00
										 |  |  | 		-moz-appearance: textfield; /* Firefox */ | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | </style> |